diff --git a/Makefile b/Makefile index b96ac198..d3ad6e69 100644 --- a/Makefile +++ b/Makefile @@ -21,12 +21,12 @@ # from which we generated our po files. We use it here so when we # test build, we're building with the .rst files that generated our # .po files. -CPYTHON_CURRENT_COMMIT := aeb3a6f61af53ed3fbf31f0b3704f49b71ac553c +CPYTHON_CURRENT_COMMIT := 973e2d3e29d4994bf01683e607d2a448d3d49f4f CPYTHON_PATH := ./cpython LANGUAGE := el -BRANCH := 3.12 +BRANCH := 3.13 EXCLUDED := whatsnew/ c-api/ diff --git a/about.po b/about.po index a058f530..2567a1c5 100644 --- a/about.po +++ b/about.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: 2024-03-31 19:50+0000\n" "Last-Translator: Theofanis Petkos \n" "Language-Team: PyGreece \n" diff --git a/bugs.po b/bugs.po index 8b3ec0d6..54445c68 100644 --- a/bugs.po +++ b/bugs.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: 2024-05-06 12:51+0000\n" "Last-Translator: Theofanis Petkos \n" "Language-Team: PyGreece \n" diff --git a/c-api/abstract.po b/c-api/abstract.po index 10345f32..00ce69e9 100644 --- a/c-api/abstract.po +++ b/c-api/abstract.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" diff --git a/c-api/allocation.po b/c-api/allocation.po index 6f3428fb..6400e4ef 100644 --- a/c-api/allocation.po +++ b/c-api/allocation.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" diff --git a/c-api/apiabiversion.po b/c-api/apiabiversion.po index 2de3c6ac..fd351c01 100644 --- a/c-api/apiabiversion.po +++ b/c-api/apiabiversion.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" diff --git a/c-api/arg.po b/c-api/arg.po index dd5c3ba7..b43139b4 100644 --- a/c-api/arg.po +++ b/c-api/arg.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -53,25 +53,33 @@ msgid "" "brackets is the type of the C variable(s) whose address should be passed." msgstr "" -#: c-api/arg.rst:31 +#: c-api/arg.rst:33 msgid "Strings and buffers" msgstr "" -#: c-api/arg.rst:33 +#: c-api/arg.rst:37 +msgid "" +"On Python 3.12 and older, the macro :c:macro:`!PY_SSIZE_T_CLEAN` must be " +"defined before including :file:`Python.h` to use all ``#`` variants of " +"formats (``s#``, ``y#``, etc.) explained below. This is not necessary on " +"Python 3.13 and later." +msgstr "" + +#: c-api/arg.rst:42 msgid "" "These formats allow accessing an object as a contiguous chunk of memory. You " "don't have to provide raw storage for the returned unicode or bytes area." msgstr "" -#: c-api/arg.rst:37 +#: c-api/arg.rst:46 msgid "Unless otherwise stated, buffers are not NUL-terminated." msgstr "" -#: c-api/arg.rst:39 +#: c-api/arg.rst:48 msgid "There are three ways strings and buffers can be converted to C:" msgstr "" -#: c-api/arg.rst:41 +#: c-api/arg.rst:50 msgid "" "Formats such as ``y*`` and ``s*`` fill a :c:type:`Py_buffer` structure. This " "locks the underlying buffer so that the caller can subsequently use the " @@ -81,14 +89,14 @@ msgid "" "data (or in any early abort case)." msgstr "" -#: c-api/arg.rst:48 +#: c-api/arg.rst:57 msgid "" "The ``es``, ``es#``, ``et`` and ``et#`` formats allocate the result buffer. " "**You have to call** :c:func:`PyMem_Free` after you have finished processing " "the data (or in any early abort case)." msgstr "" -#: c-api/arg.rst:54 +#: c-api/arg.rst:63 msgid "" "Other formats take a :class:`str` or a read-only :term:`bytes-like object`, " "such as :class:`bytes`, and provide a ``const char *`` pointer to its " @@ -97,7 +105,7 @@ msgid "" "won't have to release any memory yourself." msgstr "" -#: c-api/arg.rst:61 +#: c-api/arg.rst:70 msgid "" "To ensure that the underlying buffer may be safely borrowed, the object's :c:" "member:`PyBufferProcs.bf_releasebuffer` field must be ``NULL``. This " @@ -105,22 +113,13 @@ msgid "" "read-only objects such as :class:`memoryview` of :class:`bytes`." msgstr "" -#: c-api/arg.rst:67 +#: c-api/arg.rst:76 msgid "" "Besides this ``bf_releasebuffer`` requirement, there is no check to verify " "whether the input object is immutable (e.g. whether it would honor a request " "for a writable buffer, or whether another thread can mutate the data)." msgstr "" -#: c-api/arg.rst:73 -msgid "" -"For all ``#`` variants of formats (``s#``, ``y#``, etc.), the macro :c:macro:" -"`PY_SSIZE_T_CLEAN` must be defined before including :file:`Python.h`. On " -"Python 3.9 and older, the type of the length argument is :c:type:" -"`Py_ssize_t` if the :c:macro:`PY_SSIZE_T_CLEAN` macro is defined, or int " -"otherwise." -msgstr "" - #: c-api/arg.rst:80 msgid "``s`` (:class:`str`) [const char \\*]" msgstr "" @@ -176,7 +175,7 @@ msgid "" "encoding." msgstr "" -#: c-api/arg.rst:558 +#: c-api/arg.rst:593 msgid "``z`` (:class:`str` or ``None``) [const char \\*]" msgstr "" @@ -441,7 +440,7 @@ msgid "" "a C :c:expr:`unsigned char`." msgstr "" -#: c-api/arg.rst:592 +#: c-api/arg.rst:627 msgid "``B`` (:class:`int`) [unsigned char]" msgstr "" @@ -451,7 +450,7 @@ msgid "" "in a C :c:expr:`unsigned char`." msgstr "" -#: c-api/arg.rst:586 +#: c-api/arg.rst:621 msgid "``h`` (:class:`int`) [short int]" msgstr "" @@ -459,7 +458,7 @@ msgstr "" msgid "Convert a Python integer to a C :c:expr:`short int`." msgstr "" -#: c-api/arg.rst:595 +#: c-api/arg.rst:630 msgid "``H`` (:class:`int`) [unsigned short int]" msgstr "" @@ -469,7 +468,7 @@ msgid "" "overflow checking." msgstr "" -#: c-api/arg.rst:580 +#: c-api/arg.rst:615 msgid "``i`` (:class:`int`) [int]" msgstr "" @@ -477,7 +476,7 @@ msgstr "" msgid "Convert a Python integer to a plain C :c:expr:`int`." msgstr "" -#: c-api/arg.rst:598 +#: c-api/arg.rst:633 msgid "``I`` (:class:`int`) [unsigned int]" msgstr "" @@ -487,7 +486,7 @@ msgid "" "checking." msgstr "" -#: c-api/arg.rst:589 +#: c-api/arg.rst:624 msgid "``l`` (:class:`int`) [long int]" msgstr "" @@ -495,7 +494,7 @@ msgstr "" msgid "Convert a Python integer to a C :c:expr:`long int`." msgstr "" -#: c-api/arg.rst:601 +#: c-api/arg.rst:636 msgid "``k`` (:class:`int`) [unsigned long]" msgstr "" @@ -505,7 +504,7 @@ msgid "" "checking." msgstr "" -#: c-api/arg.rst:604 +#: c-api/arg.rst:639 msgid "``L`` (:class:`int`) [long long]" msgstr "" @@ -513,7 +512,7 @@ msgstr "" msgid "Convert a Python integer to a C :c:expr:`long long`." msgstr "" -#: c-api/arg.rst:607 +#: c-api/arg.rst:644 msgid "``K`` (:class:`int`) [unsigned long long]" msgstr "" @@ -523,7 +522,7 @@ msgid "" "overflow checking." msgstr "" -#: c-api/arg.rst:610 +#: c-api/arg.rst:647 msgid "``n`` (:class:`int`) [:c:type:`Py_ssize_t`]" msgstr "" @@ -545,7 +544,7 @@ msgstr "" msgid "Allow :class:`bytearray` objects." msgstr "" -#: c-api/arg.rst:617 +#: c-api/arg.rst:654 msgid "``C`` (:class:`str` of length 1) [int]" msgstr "" @@ -555,7 +554,7 @@ msgid "" "1, to a C :c:expr:`int`." msgstr "" -#: c-api/arg.rst:624 +#: c-api/arg.rst:661 msgid "``f`` (:class:`float`) [float]" msgstr "" @@ -563,7 +562,7 @@ msgstr "" msgid "Convert a Python floating-point number to a C :c:expr:`float`." msgstr "" -#: c-api/arg.rst:621 +#: c-api/arg.rst:658 msgid "``d`` (:class:`float`) [double]" msgstr "" @@ -583,7 +582,7 @@ msgstr "" msgid "Other objects" msgstr "" -#: c-api/arg.rst:630 +#: c-api/arg.rst:667 msgid "``O`` (object) [PyObject \\*]" msgstr "" @@ -666,7 +665,7 @@ msgid "" "how Python tests values for truth." msgstr "" -#: c-api/arg.rst:654 +#: c-api/arg.rst:691 msgid "``(items)`` (:class:`tuple`) [*matching-items*]" msgstr "" @@ -777,43 +776,72 @@ msgstr "" #: c-api/arg.rst:430 msgid "" "Parse the parameters of a function that takes both positional and keyword " -"parameters into local variables. The *keywords* argument is a ``NULL``-" -"terminated array of keyword parameter names. Empty names denote :ref:" -"`positional-only parameters `. Returns true on " -"success; on failure, it returns false and raises the appropriate exception." +"parameters into local variables. The *keywords* argument is a ``NULL``-" +"terminated array of keyword parameter names specified as null-terminated " +"ASCII or UTF-8 encoded C strings. Empty names denote :ref:`positional-only " +"parameters `. Returns true on success; on " +"failure, it returns false and raises the appropriate exception." msgstr "" -#: c-api/arg.rst:437 +#: c-api/arg.rst:441 +msgid "" +"The *keywords* parameter declaration is :c:expr:`char * const *` in C and :c:" +"expr:`const char * const *` in C++. This can be overridden with the :c:macro:" +"`PY_CXX_CONST` macro." +msgstr "" + +#: c-api/arg.rst:445 msgid "" "Added support for :ref:`positional-only parameters `." msgstr "" -#: c-api/arg.rst:444 +#: c-api/arg.rst:449 +msgid "" +"The *keywords* parameter has now type :c:expr:`char * const *` in C and :c:" +"expr:`const char * const *` in C++, instead of :c:expr:`char **`. Added " +"support for non-ASCII keyword parameter names." +msgstr "" + +#: c-api/arg.rst:458 msgid "" "Identical to :c:func:`PyArg_ParseTupleAndKeywords`, except that it accepts a " "va_list rather than a variable number of arguments." msgstr "" -#: c-api/arg.rst:450 +#: c-api/arg.rst:464 msgid "" "Ensure that the keys in the keywords argument dictionary are strings. This " "is only needed if :c:func:`PyArg_ParseTupleAndKeywords` is not used, since " "the latter already does this check." msgstr "" -#: c-api/arg.rst:460 +#: c-api/arg.rst:473 msgid "" -"Function used to deconstruct the argument lists of \"old-style\" functions " -"--- these are functions which use the :const:`METH_OLDARGS` parameter " -"parsing method, which has been removed in Python 3. This is not recommended " -"for use in parameter parsing in new code, and most code in the standard " -"interpreter has been modified to no longer use this for that purpose. It " -"does remain a convenient way to decompose other tuples, however, and may " -"continue to be used for that purpose." +"Parse the parameter of a function that takes a single positional parameter " +"into a local variable. Returns true on success; on failure, it returns " +"false and raises the appropriate exception." msgstr "" -#: c-api/arg.rst:471 +#: c-api/arg.rst:477 +msgid "Example::" +msgstr "" + +#: c-api/arg.rst:479 +msgid "" +"// Function using METH_O calling convention\n" +"static PyObject*\n" +"my_function(PyObject *module, PyObject *arg)\n" +"{\n" +" int value;\n" +" if (!PyArg_Parse(arg, \"i:my_function\", &value)) {\n" +" return NULL;\n" +" }\n" +" // ... use value ...\n" +"}" +msgstr "" + +#: c-api/arg.rst:493 msgid "" "A simpler form of parameter retrieval which does not use a format string to " "specify the types of the arguments. Functions which use this method to " @@ -831,13 +859,13 @@ msgid "" "if there was a failure." msgstr "" -#: c-api/arg.rst:486 +#: c-api/arg.rst:508 msgid "" "This is an example of the use of this function, taken from the sources for " "the :mod:`!_weakref` helper module for weak references::" msgstr "" -#: c-api/arg.rst:489 +#: c-api/arg.rst:511 msgid "" "static PyObject *\n" "weakref_ref(PyObject *self, PyObject *args)\n" @@ -853,21 +881,30 @@ msgid "" "}" msgstr "" -#: c-api/arg.rst:502 +#: c-api/arg.rst:524 msgid "" "The call to :c:func:`PyArg_UnpackTuple` in this example is entirely " "equivalent to this call to :c:func:`PyArg_ParseTuple`::" msgstr "" -#: c-api/arg.rst:505 +#: c-api/arg.rst:527 msgid "PyArg_ParseTuple(args, \"O|O:ref\", &object, &callback)" msgstr "" -#: c-api/arg.rst:510 +#: c-api/arg.rst:531 +msgid "" +"The value to be inserted, if any, before :c:expr:`char * const *` in the " +"*keywords* parameter declaration of :c:func:`PyArg_ParseTupleAndKeywords` " +"and :c:func:`PyArg_VaParseTupleAndKeywords`. Default empty for C and " +"``const`` for C++ (:c:expr:`const char * const *`). To override, define it " +"to the desired value before including :file:`Python.h`." +msgstr "" + +#: c-api/arg.rst:545 msgid "Building values" msgstr "" -#: c-api/arg.rst:514 +#: c-api/arg.rst:549 msgid "" "Create a new value based on a format string similar to those accepted by the " "``PyArg_Parse*`` family of functions and a sequence of values. Returns the " @@ -875,7 +912,7 @@ msgid "" "``NULL`` is returned." msgstr "" -#: c-api/arg.rst:519 +#: c-api/arg.rst:554 msgid "" ":c:func:`Py_BuildValue` does not always build a tuple. It builds a tuple " "only if its format string contains two or more format units. If the format " @@ -884,7 +921,7 @@ msgid "" "it to return a tuple of size 0 or one, parenthesize the format string." msgstr "" -#: c-api/arg.rst:525 +#: c-api/arg.rst:560 msgid "" "When memory buffers are passed as parameters to supply data to build " "objects, as for the ``s`` and ``s#`` formats, the required data is copied. " @@ -895,7 +932,7 @@ msgid "" "`Py_BuildValue` returns." msgstr "" -#: c-api/arg.rst:533 +#: c-api/arg.rst:568 msgid "" "In the following description, the quoted form is the format unit; the entry " "in (round) parentheses is the Python object type that the format unit will " @@ -903,180 +940,180 @@ msgid "" "be passed." msgstr "" -#: c-api/arg.rst:537 +#: c-api/arg.rst:572 msgid "" "The characters space, tab, colon and comma are ignored in format strings " "(but not within format units such as ``s#``). This can be used to make long " "format strings a tad more readable." msgstr "" -#: c-api/arg.rst:541 +#: c-api/arg.rst:576 msgid "``s`` (:class:`str` or ``None``) [const char \\*]" msgstr "" -#: c-api/arg.rst:542 +#: c-api/arg.rst:577 msgid "" "Convert a null-terminated C string to a Python :class:`str` object using " "``'utf-8'`` encoding. If the C string pointer is ``NULL``, ``None`` is used." msgstr "" -#: c-api/arg.rst:545 +#: c-api/arg.rst:580 msgid "" "``s#`` (:class:`str` or ``None``) [const char \\*, :c:type:`Py_ssize_t`]" msgstr "" -#: c-api/arg.rst:546 +#: c-api/arg.rst:581 msgid "" "Convert a C string and its length to a Python :class:`str` object using " "``'utf-8'`` encoding. If the C string pointer is ``NULL``, the length is " "ignored and ``None`` is returned." msgstr "" -#: c-api/arg.rst:550 +#: c-api/arg.rst:585 msgid "``y`` (:class:`bytes`) [const char \\*]" msgstr "" -#: c-api/arg.rst:551 +#: c-api/arg.rst:586 msgid "" "This converts a C string to a Python :class:`bytes` object. If the C string " "pointer is ``NULL``, ``None`` is returned." msgstr "" -#: c-api/arg.rst:554 +#: c-api/arg.rst:589 msgid "``y#`` (:class:`bytes`) [const char \\*, :c:type:`Py_ssize_t`]" msgstr "" -#: c-api/arg.rst:555 +#: c-api/arg.rst:590 msgid "" "This converts a C string and its lengths to a Python object. If the C " "string pointer is ``NULL``, ``None`` is returned." msgstr "" -#: c-api/arg.rst:575 +#: c-api/arg.rst:610 msgid "Same as ``s``." msgstr "" -#: c-api/arg.rst:561 +#: c-api/arg.rst:596 msgid "" "``z#`` (:class:`str` or ``None``) [const char \\*, :c:type:`Py_ssize_t`]" msgstr "" -#: c-api/arg.rst:578 +#: c-api/arg.rst:613 msgid "Same as ``s#``." msgstr "" -#: c-api/arg.rst:564 +#: c-api/arg.rst:599 msgid "``u`` (:class:`str`) [const wchar_t \\*]" msgstr "" -#: c-api/arg.rst:565 +#: c-api/arg.rst:600 msgid "" "Convert a null-terminated :c:type:`wchar_t` buffer of Unicode (UTF-16 or " "UCS-4) data to a Python Unicode object. If the Unicode buffer pointer is " "``NULL``, ``None`` is returned." msgstr "" -#: c-api/arg.rst:569 +#: c-api/arg.rst:604 msgid "``u#`` (:class:`str`) [const wchar_t \\*, :c:type:`Py_ssize_t`]" msgstr "" -#: c-api/arg.rst:570 +#: c-api/arg.rst:605 msgid "" "Convert a Unicode (UTF-16 or UCS-4) data buffer and its length to a Python " "Unicode object. If the Unicode buffer pointer is ``NULL``, the length is " "ignored and ``None`` is returned." msgstr "" -#: c-api/arg.rst:574 +#: c-api/arg.rst:609 msgid "``U`` (:class:`str` or ``None``) [const char \\*]" msgstr "" -#: c-api/arg.rst:577 +#: c-api/arg.rst:612 msgid "" "``U#`` (:class:`str` or ``None``) [const char \\*, :c:type:`Py_ssize_t`]" msgstr "" -#: c-api/arg.rst:581 +#: c-api/arg.rst:616 msgid "Convert a plain C :c:expr:`int` to a Python integer object." msgstr "" -#: c-api/arg.rst:583 +#: c-api/arg.rst:618 msgid "``b`` (:class:`int`) [char]" msgstr "" -#: c-api/arg.rst:584 +#: c-api/arg.rst:619 msgid "Convert a plain C :c:expr:`char` to a Python integer object." msgstr "" -#: c-api/arg.rst:587 +#: c-api/arg.rst:622 msgid "Convert a plain C :c:expr:`short int` to a Python integer object." msgstr "" -#: c-api/arg.rst:590 +#: c-api/arg.rst:625 msgid "Convert a C :c:expr:`long int` to a Python integer object." msgstr "" -#: c-api/arg.rst:593 +#: c-api/arg.rst:628 msgid "Convert a C :c:expr:`unsigned char` to a Python integer object." msgstr "" -#: c-api/arg.rst:596 +#: c-api/arg.rst:631 msgid "Convert a C :c:expr:`unsigned short int` to a Python integer object." msgstr "" -#: c-api/arg.rst:599 +#: c-api/arg.rst:634 msgid "Convert a C :c:expr:`unsigned int` to a Python integer object." msgstr "" -#: c-api/arg.rst:602 +#: c-api/arg.rst:637 msgid "Convert a C :c:expr:`unsigned long` to a Python integer object." msgstr "" -#: c-api/arg.rst:605 +#: c-api/arg.rst:640 msgid "Convert a C :c:expr:`long long` to a Python integer object." msgstr "" -#: c-api/arg.rst:608 +#: c-api/arg.rst:645 msgid "Convert a C :c:expr:`unsigned long long` to a Python integer object." msgstr "" -#: c-api/arg.rst:611 +#: c-api/arg.rst:648 msgid "Convert a C :c:type:`Py_ssize_t` to a Python integer." msgstr "" -#: c-api/arg.rst:613 +#: c-api/arg.rst:650 msgid "``c`` (:class:`bytes` of length 1) [char]" msgstr "" -#: c-api/arg.rst:614 +#: c-api/arg.rst:651 msgid "" "Convert a C :c:expr:`int` representing a byte to a Python :class:`bytes` " "object of length 1." msgstr "" -#: c-api/arg.rst:618 +#: c-api/arg.rst:655 msgid "" "Convert a C :c:expr:`int` representing a character to Python :class:`str` " "object of length 1." msgstr "" -#: c-api/arg.rst:622 +#: c-api/arg.rst:659 msgid "Convert a C :c:expr:`double` to a Python floating-point number." msgstr "" -#: c-api/arg.rst:625 +#: c-api/arg.rst:662 msgid "Convert a C :c:expr:`float` to a Python floating-point number." msgstr "" -#: c-api/arg.rst:627 +#: c-api/arg.rst:664 msgid "``D`` (:class:`complex`) [Py_complex \\*]" msgstr "" -#: c-api/arg.rst:628 +#: c-api/arg.rst:665 msgid "Convert a C :c:type:`Py_complex` structure to a Python complex number." msgstr "" -#: c-api/arg.rst:631 +#: c-api/arg.rst:668 msgid "" "Pass a Python object untouched but create a new :term:`strong reference` to " "it (i.e. its reference count is incremented by one). If the object passed in " @@ -1086,30 +1123,30 @@ msgid "" "no exception has been raised yet, :exc:`SystemError` is set." msgstr "" -#: c-api/arg.rst:640 +#: c-api/arg.rst:677 msgid "``S`` (object) [PyObject \\*]" msgstr "" -#: c-api/arg.rst:641 +#: c-api/arg.rst:678 msgid "Same as ``O``." msgstr "" -#: c-api/arg.rst:643 +#: c-api/arg.rst:680 msgid "``N`` (object) [PyObject \\*]" msgstr "" -#: c-api/arg.rst:644 +#: c-api/arg.rst:681 msgid "" "Same as ``O``, except it doesn't create a new :term:`strong reference`. " "Useful when the object is created by a call to an object constructor in the " "argument list." msgstr "" -#: c-api/arg.rst:648 +#: c-api/arg.rst:685 msgid "``O&`` (object) [*converter*, *anything*]" msgstr "" -#: c-api/arg.rst:649 +#: c-api/arg.rst:686 msgid "" "Convert *anything* to a Python object through a *converter* function. The " "function is called with *anything* (which should be compatible with :c:expr:" @@ -1117,40 +1154,40 @@ msgid "" "``NULL`` if an error occurred." msgstr "" -#: c-api/arg.rst:655 +#: c-api/arg.rst:692 msgid "" "Convert a sequence of C values to a Python tuple with the same number of " "items." msgstr "" -#: c-api/arg.rst:657 +#: c-api/arg.rst:694 msgid "``[items]`` (:class:`list`) [*matching-items*]" msgstr "" -#: c-api/arg.rst:658 +#: c-api/arg.rst:695 msgid "" "Convert a sequence of C values to a Python list with the same number of " "items." msgstr "" -#: c-api/arg.rst:660 +#: c-api/arg.rst:697 msgid "``{items}`` (:class:`dict`) [*matching-items*]" msgstr "" -#: c-api/arg.rst:661 +#: c-api/arg.rst:698 msgid "" "Convert a sequence of C values to a Python dictionary. Each pair of " "consecutive C values adds one item to the dictionary, serving as key and " "value, respectively." msgstr "" -#: c-api/arg.rst:665 +#: c-api/arg.rst:702 msgid "" "If there is an error in the format string, the :exc:`SystemError` exception " "is set and ``NULL`` returned." msgstr "" -#: c-api/arg.rst:670 +#: c-api/arg.rst:707 msgid "" "Identical to :c:func:`Py_BuildValue`, except that it accepts a va_list " "rather than a variable number of arguments." diff --git a/c-api/bool.po b/c-api/bool.po index 45b91950..9bb2b35c 100644 --- a/c-api/bool.po +++ b/c-api/bool.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -43,22 +43,22 @@ msgstr "" #: c-api/bool.rst:28 msgid "" -"The Python ``False`` object. This object has no methods and is `immortal " -"`_." +"The Python ``False`` object. This object has no methods and is :term:" +"`immortal`." msgstr "" #: c-api/bool.rst:31 -msgid ":c:data:`Py_False` is immortal." +msgid ":c:data:`Py_False` is :term:`immortal`." msgstr "" #: c-api/bool.rst:37 msgid "" -"The Python ``True`` object. This object has no methods and is `immortal " -"`_." +"The Python ``True`` object. This object has no methods and is :term:" +"`immortal`." msgstr "" #: c-api/bool.rst:40 -msgid ":c:data:`Py_True` is immortal." +msgid ":c:data:`Py_True` is :term:`immortal`." msgstr "" #: c-api/bool.rst:46 diff --git a/c-api/buffer.po b/c-api/buffer.po index 5bee05fd..30f261e4 100644 --- a/c-api/buffer.po +++ b/c-api/buffer.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -40,24 +40,26 @@ msgstr "" #: c-api/buffer.rst:29 msgid "" -"Python provides such a facility at the C level in the form of the :ref:" -"`buffer protocol `. This protocol has two sides:" +"Python provides such a facility at the C and Python level in the form of " +"the :ref:`buffer protocol `. This protocol has two sides:" msgstr "" #: c-api/buffer.rst:34 msgid "" "on the producer side, a type can export a \"buffer interface\" which allows " "objects of that type to expose information about their underlying buffer. " -"This interface is described in the section :ref:`buffer-structs`;" +"This interface is described in the section :ref:`buffer-structs`; for Python " +"see :ref:`python-buffer-protocol`." msgstr "" -#: c-api/buffer.rst:38 +#: c-api/buffer.rst:39 msgid "" "on the consumer side, several means are available to obtain a pointer to the " -"raw underlying data of an object (for example a method parameter)." +"raw underlying data of an object (for example a method parameter). For " +"Python see :class:`memoryview`." msgstr "" -#: c-api/buffer.rst:41 +#: c-api/buffer.rst:43 msgid "" "Simple objects such as :class:`bytes` and :class:`bytearray` expose their " "underlying buffer in byte-oriented form. Other forms are possible; for " @@ -65,7 +67,7 @@ msgid "" "values." msgstr "" -#: c-api/buffer.rst:45 +#: c-api/buffer.rst:47 msgid "" "An example consumer of the buffer interface is the :meth:`~io.BufferedIOBase." "write` method of file objects: any object that can export a series of bytes " @@ -77,23 +79,23 @@ msgid "" "buffers." msgstr "" -#: c-api/buffer.rst:53 +#: c-api/buffer.rst:55 msgid "" "There are two ways for a consumer of the buffer interface to acquire a " "buffer over a target object:" msgstr "" -#: c-api/buffer.rst:56 +#: c-api/buffer.rst:58 msgid "call :c:func:`PyObject_GetBuffer` with the right parameters;" msgstr "" -#: c-api/buffer.rst:58 +#: c-api/buffer.rst:60 msgid "" "call :c:func:`PyArg_ParseTuple` (or one of its siblings) with one of the " "``y*``, ``w*`` or ``s*`` :ref:`format codes `." msgstr "" -#: c-api/buffer.rst:61 +#: c-api/buffer.rst:63 msgid "" "In both cases, :c:func:`PyBuffer_Release` must be called when the buffer " "isn't needed anymore. Failure to do so could lead to various issues such as " @@ -101,10 +103,16 @@ msgid "" msgstr "" #: c-api/buffer.rst:69 +msgid "" +"The buffer protocol is now accessible in Python, see :ref:`python-buffer-" +"protocol` and :class:`memoryview`." +msgstr "" + +#: c-api/buffer.rst:75 msgid "Buffer structure" msgstr "" -#: c-api/buffer.rst:71 +#: c-api/buffer.rst:77 msgid "" "Buffer structures (or simply \"buffers\") are useful as a way to expose the " "binary data from another object to the Python programmer. They can also be " @@ -116,7 +124,7 @@ msgid "" "in its native, in-memory format." msgstr "" -#: c-api/buffer.rst:80 +#: c-api/buffer.rst:86 msgid "" "Contrary to most data types exposed by the Python interpreter, buffers are " "not :c:type:`PyObject` pointers but rather simple C structures. This allows " @@ -125,14 +133,14 @@ msgid "" "created." msgstr "" -#: c-api/buffer.rst:86 +#: c-api/buffer.rst:92 msgid "" "For short instructions how to write an exporting object, see :ref:`Buffer " "Object Structures `. For obtaining a buffer, see :c:func:" "`PyObject_GetBuffer`." msgstr "" -#: c-api/buffer.rst:94 +#: c-api/buffer.rst:100 msgid "" "A pointer to the start of the logical structure described by the buffer " "fields. This can be any location within the underlying physical memory block " @@ -140,13 +148,13 @@ msgid "" "the value may point to the end of the memory block." msgstr "" -#: c-api/buffer.rst:99 +#: c-api/buffer.rst:105 msgid "" "For :term:`contiguous` arrays, the value points to the beginning of the " "memory block." msgstr "" -#: c-api/buffer.rst:104 +#: c-api/buffer.rst:110 msgid "" "A new reference to the exporting object. The reference is owned by the " "consumer and automatically released (i.e. reference count decremented) and " @@ -154,14 +162,14 @@ msgid "" "of the return value of any standard C-API function." msgstr "" -#: c-api/buffer.rst:111 +#: c-api/buffer.rst:117 msgid "" "As a special case, for *temporary* buffers that are wrapped by :c:func:" "`PyMemoryView_FromBuffer` or :c:func:`PyBuffer_FillInfo` this field is " "``NULL``. In general, exporting objects MUST NOT use this scheme." msgstr "" -#: c-api/buffer.rst:118 +#: c-api/buffer.rst:124 msgid "" "``product(shape) * itemsize``. For contiguous arrays, this is the length of " "the underlying memory block. For non-contiguous arrays, it is the length " @@ -169,7 +177,7 @@ msgid "" "representation." msgstr "" -#: c-api/buffer.rst:123 +#: c-api/buffer.rst:129 msgid "" "Accessing ``((char *)buf)[0] up to ((char *)buf)[len-1]`` is only valid if " "the buffer has been obtained by a request that guarantees contiguity. In " @@ -177,19 +185,19 @@ msgid "" "`PyBUF_WRITABLE`." msgstr "" -#: c-api/buffer.rst:129 +#: c-api/buffer.rst:135 msgid "" "An indicator of whether the buffer is read-only. This field is controlled by " "the :c:macro:`PyBUF_WRITABLE` flag." msgstr "" -#: c-api/buffer.rst:134 +#: c-api/buffer.rst:140 msgid "" "Item size in bytes of a single element. Same as the value of :func:`struct." "calcsize` called on non-``NULL`` :c:member:`~Py_buffer.format` values." msgstr "" -#: c-api/buffer.rst:137 +#: c-api/buffer.rst:143 msgid "" "Important exception: If a consumer requests a buffer without the :c:macro:" "`PyBUF_FORMAT` flag, :c:member:`~Py_buffer.format` will be set to " @@ -197,32 +205,32 @@ msgid "" "original format." msgstr "" -#: c-api/buffer.rst:142 +#: c-api/buffer.rst:148 msgid "" "If :c:member:`~Py_buffer.shape` is present, the equality ``product(shape) * " "itemsize == len`` still holds and the consumer can use :c:member:`~Py_buffer." "itemsize` to navigate the buffer." msgstr "" -#: c-api/buffer.rst:146 +#: c-api/buffer.rst:152 msgid "" "If :c:member:`~Py_buffer.shape` is ``NULL`` as a result of a :c:macro:" "`PyBUF_SIMPLE` or a :c:macro:`PyBUF_WRITABLE` request, the consumer must " "disregard :c:member:`~Py_buffer.itemsize` and assume ``itemsize == 1``." msgstr "" -#: c-api/buffer.rst:152 +#: c-api/buffer.rst:158 msgid "" "A *NULL* terminated string in :mod:`struct` module style syntax describing " "the contents of a single item. If this is ``NULL``, ``\"B\"`` (unsigned " "bytes) is assumed." msgstr "" -#: c-api/buffer.rst:156 +#: c-api/buffer.rst:162 msgid "This field is controlled by the :c:macro:`PyBUF_FORMAT` flag." msgstr "" -#: c-api/buffer.rst:160 +#: c-api/buffer.rst:166 msgid "" "The number of dimensions the memory represents as an n-dimensional array. If " "it is ``0``, :c:member:`~Py_buffer.buf` points to a single item representing " @@ -231,7 +239,7 @@ msgid "" "number of dimensions is given by :c:macro:`PyBUF_MAX_NDIM`." msgstr "" -#: c-api/buffer.rst:168 +#: c-api/buffer.rst:174 msgid "" "An array of :c:type:`Py_ssize_t` of length :c:member:`~Py_buffer.ndim` " "indicating the shape of the memory as an n-dimensional array. Note that " @@ -239,34 +247,34 @@ msgid "" "`~Py_buffer.len`." msgstr "" -#: c-api/buffer.rst:173 +#: c-api/buffer.rst:179 msgid "" "Shape values are restricted to ``shape[n] >= 0``. The case ``shape[n] == 0`` " "requires special attention. See `complex arrays`_ for further information." msgstr "" -#: c-api/buffer.rst:177 +#: c-api/buffer.rst:183 msgid "The shape array is read-only for the consumer." msgstr "" -#: c-api/buffer.rst:181 +#: c-api/buffer.rst:187 msgid "" "An array of :c:type:`Py_ssize_t` of length :c:member:`~Py_buffer.ndim` " "giving the number of bytes to skip to get to a new element in each dimension." msgstr "" -#: c-api/buffer.rst:185 +#: c-api/buffer.rst:191 msgid "" "Stride values can be any integer. For regular arrays, strides are usually " "positive, but a consumer MUST be able to handle the case ``strides[n] <= " "0``. See `complex arrays`_ for further information." msgstr "" -#: c-api/buffer.rst:189 +#: c-api/buffer.rst:195 msgid "The strides array is read-only for the consumer." msgstr "" -#: c-api/buffer.rst:193 +#: c-api/buffer.rst:199 msgid "" "An array of :c:type:`Py_ssize_t` of length :c:member:`~Py_buffer.ndim`. If " "``suboffsets[n] >= 0``, the values stored along the nth dimension are " @@ -275,24 +283,24 @@ msgid "" "that no de-referencing should occur (striding in a contiguous memory block)." msgstr "" -#: c-api/buffer.rst:200 +#: c-api/buffer.rst:206 msgid "" "If all suboffsets are negative (i.e. no de-referencing is needed), then this " "field must be ``NULL`` (the default value)." msgstr "" -#: c-api/buffer.rst:203 +#: c-api/buffer.rst:209 msgid "" "This type of array representation is used by the Python Imaging Library " "(PIL). See `complex arrays`_ for further information how to access elements " "of such an array." msgstr "" -#: c-api/buffer.rst:207 +#: c-api/buffer.rst:213 msgid "The suboffsets array is read-only for the consumer." msgstr "" -#: c-api/buffer.rst:211 +#: c-api/buffer.rst:217 msgid "" "This is for use internally by the exporting object. For example, this might " "be re-cast as an integer by the exporter and used to store flags about " @@ -300,22 +308,22 @@ msgid "" "the buffer is released. The consumer MUST NOT alter this value." msgstr "" -#: c-api/buffer.rst:218 +#: c-api/buffer.rst:224 msgid "Constants:" msgstr "" -#: c-api/buffer.rst:222 +#: c-api/buffer.rst:228 msgid "" "The maximum number of dimensions the memory represents. Exporters MUST " "respect this limit, consumers of multi-dimensional buffers SHOULD be able to " "handle up to :c:macro:`!PyBUF_MAX_NDIM` dimensions. Currently set to 64." msgstr "" -#: c-api/buffer.rst:231 +#: c-api/buffer.rst:237 msgid "Buffer request types" msgstr "" -#: c-api/buffer.rst:233 +#: c-api/buffer.rst:239 msgid "" "Buffers are usually obtained by sending a buffer request to an exporting " "object via :c:func:`PyObject_GetBuffer`. Since the complexity of the logical " @@ -323,16 +331,16 @@ msgid "" "argument to specify the exact buffer type it can handle." msgstr "" -#: c-api/buffer.rst:238 +#: c-api/buffer.rst:244 msgid "" "All :c:type:`Py_buffer` fields are unambiguously defined by the request type." msgstr "" -#: c-api/buffer.rst:242 +#: c-api/buffer.rst:248 msgid "request-independent fields" msgstr "" -#: c-api/buffer.rst:243 +#: c-api/buffer.rst:249 msgid "" "The following fields are not influenced by *flags* and must always be filled " "in with the correct values: :c:member:`~Py_buffer.obj`, :c:member:" @@ -340,11 +348,11 @@ msgid "" "itemsize`, :c:member:`~Py_buffer.ndim`." msgstr "" -#: c-api/buffer.rst:248 +#: c-api/buffer.rst:254 msgid "readonly, format" msgstr "" -#: c-api/buffer.rst:252 +#: c-api/buffer.rst:258 msgid "" "Controls the :c:member:`~Py_buffer.readonly` field. If set, the exporter " "MUST provide a writable buffer or else report failure. Otherwise, the " @@ -353,13 +361,13 @@ msgid "" "PyBUF_WRITABLE` can be used to request a simple writable buffer." msgstr "" -#: c-api/buffer.rst:260 +#: c-api/buffer.rst:266 msgid "" "Controls the :c:member:`~Py_buffer.format` field. If set, this field MUST be " "filled in correctly. Otherwise, this field MUST be ``NULL``." msgstr "" -#: c-api/buffer.rst:264 +#: c-api/buffer.rst:270 msgid "" ":c:macro:`PyBUF_WRITABLE` can be \\|'d to any of the flags in the next " "section. Since :c:macro:`PyBUF_SIMPLE` is defined as 0, :c:macro:" @@ -367,140 +375,140 @@ msgid "" "writable buffer." msgstr "" -#: c-api/buffer.rst:268 +#: c-api/buffer.rst:274 msgid "" ":c:macro:`PyBUF_FORMAT` must be \\|'d to any of the flags except :c:macro:" "`PyBUF_SIMPLE`, because the latter already implies format ``B`` (unsigned " "bytes). :c:macro:`!PyBUF_FORMAT` cannot be used on its own." msgstr "" -#: c-api/buffer.rst:274 +#: c-api/buffer.rst:280 msgid "shape, strides, suboffsets" msgstr "" -#: c-api/buffer.rst:276 +#: c-api/buffer.rst:282 msgid "" "The flags that control the logical structure of the memory are listed in " "decreasing order of complexity. Note that each flag contains all bits of the " "flags below it." msgstr "" -#: c-api/buffer.rst:307 c-api/buffer.rst:332 +#: c-api/buffer.rst:313 c-api/buffer.rst:338 msgid "Request" msgstr "" -#: c-api/buffer.rst:307 c-api/buffer.rst:332 +#: c-api/buffer.rst:313 c-api/buffer.rst:338 msgid "shape" msgstr "" -#: c-api/buffer.rst:307 c-api/buffer.rst:332 +#: c-api/buffer.rst:313 c-api/buffer.rst:338 msgid "strides" msgstr "" -#: c-api/buffer.rst:307 c-api/buffer.rst:332 +#: c-api/buffer.rst:313 c-api/buffer.rst:338 msgid "suboffsets" msgstr "" -#: c-api/buffer.rst:287 c-api/buffer.rst:309 c-api/buffer.rst:313 -#: c-api/buffer.rst:334 c-api/buffer.rst:338 c-api/buffer.rst:342 -#: c-api/buffer.rst:346 c-api/buffer.rst:348 +#: c-api/buffer.rst:293 c-api/buffer.rst:315 c-api/buffer.rst:319 +#: c-api/buffer.rst:340 c-api/buffer.rst:344 c-api/buffer.rst:348 +#: c-api/buffer.rst:352 c-api/buffer.rst:354 msgid "yes" msgstr "" -#: c-api/buffer.rst:334 c-api/buffer.rst:336 +#: c-api/buffer.rst:340 c-api/buffer.rst:342 msgid "if needed" msgstr "" -#: c-api/buffer.rst:289 c-api/buffer.rst:309 c-api/buffer.rst:313 -#: c-api/buffer.rst:338 c-api/buffer.rst:342 c-api/buffer.rst:346 -#: c-api/buffer.rst:348 +#: c-api/buffer.rst:295 c-api/buffer.rst:315 c-api/buffer.rst:319 +#: c-api/buffer.rst:344 c-api/buffer.rst:348 c-api/buffer.rst:352 +#: c-api/buffer.rst:354 msgid "NULL" msgstr "" -#: c-api/buffer.rst:298 +#: c-api/buffer.rst:304 msgid "contiguity requests" msgstr "" -#: c-api/buffer.rst:300 +#: c-api/buffer.rst:306 msgid "" "C or Fortran :term:`contiguity ` can be explicitly requested, " "with and without stride information. Without stride information, the buffer " "must be C-contiguous." msgstr "" -#: c-api/buffer.rst:332 +#: c-api/buffer.rst:338 msgid "contig" msgstr "" -#: c-api/buffer.rst:315 c-api/buffer.rst:348 +#: c-api/buffer.rst:321 c-api/buffer.rst:354 msgid "C" msgstr "" -#: c-api/buffer.rst:311 +#: c-api/buffer.rst:317 msgid "F" msgstr "" -#: c-api/buffer.rst:313 +#: c-api/buffer.rst:319 msgid "C or F" msgstr "" -#: c-api/buffer.rst:315 +#: c-api/buffer.rst:321 msgid ":c:macro:`PyBUF_ND`" msgstr "" -#: c-api/buffer.rst:320 +#: c-api/buffer.rst:326 msgid "compound requests" msgstr "" -#: c-api/buffer.rst:322 +#: c-api/buffer.rst:328 msgid "" "All possible requests are fully defined by some combination of the flags in " "the previous section. For convenience, the buffer protocol provides " "frequently used combinations as single flags." msgstr "" -#: c-api/buffer.rst:326 +#: c-api/buffer.rst:332 msgid "" "In the following table *U* stands for undefined contiguity. The consumer " "would have to call :c:func:`PyBuffer_IsContiguous` to determine contiguity." msgstr "" -#: c-api/buffer.rst:332 +#: c-api/buffer.rst:338 msgid "readonly" msgstr "" -#: c-api/buffer.rst:332 +#: c-api/buffer.rst:338 msgid "format" msgstr "" -#: c-api/buffer.rst:336 c-api/buffer.rst:340 c-api/buffer.rst:344 +#: c-api/buffer.rst:342 c-api/buffer.rst:346 c-api/buffer.rst:350 msgid "U" msgstr "" -#: c-api/buffer.rst:338 c-api/buffer.rst:346 +#: c-api/buffer.rst:344 c-api/buffer.rst:352 msgid "0" msgstr "" -#: c-api/buffer.rst:340 c-api/buffer.rst:348 +#: c-api/buffer.rst:346 c-api/buffer.rst:354 msgid "1 or 0" msgstr "" -#: c-api/buffer.rst:353 +#: c-api/buffer.rst:359 msgid "Complex arrays" msgstr "" -#: c-api/buffer.rst:356 +#: c-api/buffer.rst:362 msgid "NumPy-style: shape and strides" msgstr "" -#: c-api/buffer.rst:358 +#: c-api/buffer.rst:364 msgid "" "The logical structure of NumPy-style arrays is defined by :c:member:" "`~Py_buffer.itemsize`, :c:member:`~Py_buffer.ndim`, :c:member:`~Py_buffer." "shape` and :c:member:`~Py_buffer.strides`." msgstr "" -#: c-api/buffer.rst:361 +#: c-api/buffer.rst:367 msgid "" "If ``ndim == 0``, the memory location pointed to by :c:member:`~Py_buffer." "buf` is interpreted as a scalar of size :c:member:`~Py_buffer.itemsize`. In " @@ -508,28 +516,28 @@ msgid "" "strides` are ``NULL``." msgstr "" -#: c-api/buffer.rst:365 +#: c-api/buffer.rst:371 msgid "" "If :c:member:`~Py_buffer.strides` is ``NULL``, the array is interpreted as a " "standard n-dimensional C-array. Otherwise, the consumer must access an n-" "dimensional array as follows:" msgstr "" -#: c-api/buffer.rst:369 +#: c-api/buffer.rst:375 msgid "" "ptr = (char *)buf + indices[0] * strides[0] + ... + indices[n-1] * " "strides[n-1];\n" "item = *((typeof(item) *)ptr);" msgstr "" -#: c-api/buffer.rst:375 +#: c-api/buffer.rst:381 msgid "" "As noted above, :c:member:`~Py_buffer.buf` can point to any location within " "the actual memory block. An exporter can check the validity of a buffer with " "this function:" msgstr "" -#: c-api/buffer.rst:379 +#: c-api/buffer.rst:385 msgid "" "def verify_structure(memlen, itemsize, ndim, shape, strides, offset):\n" " \"\"\"Verify that the parameters represent a valid array within\n" @@ -558,11 +566,11 @@ msgid "" " return 0 <= offset+imin and offset+imax+itemsize <= memlen" msgstr "" -#: c-api/buffer.rst:409 +#: c-api/buffer.rst:415 msgid "PIL-style: shape, strides and suboffsets" msgstr "" -#: c-api/buffer.rst:411 +#: c-api/buffer.rst:417 msgid "" "In addition to the regular items, PIL-style arrays can contain pointers that " "must be followed in order to get to the next element in a dimension. For " @@ -573,14 +581,14 @@ msgid "" "x[2][3]`` arrays that can be located anywhere in memory." msgstr "" -#: c-api/buffer.rst:420 +#: c-api/buffer.rst:426 msgid "" "Here is a function that returns a pointer to the element in an N-D array " "pointed to by an N-dimensional index when there are both non-``NULL`` " "strides and suboffsets::" msgstr "" -#: c-api/buffer.rst:424 +#: c-api/buffer.rst:430 msgid "" "void *get_item_pointer(int ndim, void *buf, Py_ssize_t *strides,\n" " Py_ssize_t *suboffsets, Py_ssize_t *indices) {\n" @@ -596,25 +604,25 @@ msgid "" "}" msgstr "" -#: c-api/buffer.rst:439 +#: c-api/buffer.rst:445 msgid "Buffer-related functions" msgstr "" -#: c-api/buffer.rst:443 +#: c-api/buffer.rst:449 msgid "" "Return ``1`` if *obj* supports the buffer interface otherwise ``0``. When " "``1`` is returned, it doesn't guarantee that :c:func:`PyObject_GetBuffer` " "will succeed. This function always succeeds." msgstr "" -#: c-api/buffer.rst:450 +#: c-api/buffer.rst:456 msgid "" "Send a request to *exporter* to fill in *view* as specified by *flags*. If " "the exporter cannot provide a buffer of the exact type, it MUST raise :exc:" "`BufferError`, set ``view->obj`` to ``NULL`` and return ``-1``." msgstr "" -#: c-api/buffer.rst:455 +#: c-api/buffer.rst:461 msgid "" "On success, fill in *view*, set ``view->obj`` to a new reference to " "*exporter* and return 0. In the case of chained buffer providers that " @@ -622,7 +630,7 @@ msgid "" "instead of *exporter* (See :ref:`Buffer Object Structures `)." msgstr "" -#: c-api/buffer.rst:460 +#: c-api/buffer.rst:466 msgid "" "Successful calls to :c:func:`PyObject_GetBuffer` must be paired with calls " "to :c:func:`PyBuffer_Release`, similar to :c:func:`malloc` and :c:func:" @@ -630,7 +638,7 @@ msgid "" "`PyBuffer_Release` must be called exactly once." msgstr "" -#: c-api/buffer.rst:468 +#: c-api/buffer.rst:474 msgid "" "Release the buffer *view* and release the :term:`strong reference` (i.e. " "decrement the reference count) to the view's supporting object, ``view-" @@ -638,19 +646,19 @@ msgid "" "used, otherwise reference leaks may occur." msgstr "" -#: c-api/buffer.rst:473 +#: c-api/buffer.rst:479 msgid "" "It is an error to call this function on a buffer that was not obtained via :" "c:func:`PyObject_GetBuffer`." msgstr "" -#: c-api/buffer.rst:479 +#: c-api/buffer.rst:485 msgid "" "Return the implied :c:member:`~Py_buffer.itemsize` from :c:member:" "`~Py_buffer.format`. On error, raise an exception and return -1." msgstr "" -#: c-api/buffer.rst:487 +#: c-api/buffer.rst:493 msgid "" "Return ``1`` if the memory defined by the *view* is C-style (*order* is " "``'C'``) or Fortran-style (*order* is ``'F'``) :term:`contiguous` or either " @@ -658,69 +666,69 @@ msgid "" "succeeds." msgstr "" -#: c-api/buffer.rst:494 +#: c-api/buffer.rst:500 msgid "" "Get the memory area pointed to by the *indices* inside the given *view*. " "*indices* must point to an array of ``view->ndim`` indices." msgstr "" -#: c-api/buffer.rst:500 +#: c-api/buffer.rst:506 msgid "" "Copy contiguous *len* bytes from *buf* to *view*. *fort* can be ``'C'`` or " "``'F'`` (for C-style or Fortran-style ordering). ``0`` is returned on " "success, ``-1`` on error." msgstr "" -#: c-api/buffer.rst:507 +#: c-api/buffer.rst:513 msgid "" "Copy *len* bytes from *src* to its contiguous representation in *buf*. " "*order* can be ``'C'`` or ``'F'`` or ``'A'`` (for C-style or Fortran-style " "ordering or either one). ``0`` is returned on success, ``-1`` on error." msgstr "" -#: c-api/buffer.rst:511 +#: c-api/buffer.rst:517 msgid "This function fails if *len* != *src->len*." msgstr "" -#: c-api/buffer.rst:516 +#: c-api/buffer.rst:522 msgid "" "Copy data from *src* to *dest* buffer. Can convert between C-style and or " "Fortran-style buffers." msgstr "" -#: c-api/buffer.rst:519 +#: c-api/buffer.rst:525 msgid "``0`` is returned on success, ``-1`` on error." msgstr "" -#: c-api/buffer.rst:523 +#: c-api/buffer.rst:529 msgid "" "Fill the *strides* array with byte-strides of a :term:`contiguous` (C-style " "if *order* is ``'C'`` or Fortran-style if *order* is ``'F'``) array of the " "given shape with the given number of bytes per element." msgstr "" -#: c-api/buffer.rst:530 +#: c-api/buffer.rst:536 msgid "" "Handle buffer requests for an exporter that wants to expose *buf* of size " "*len* with writability set according to *readonly*. *buf* is interpreted as " "a sequence of unsigned bytes." msgstr "" -#: c-api/buffer.rst:534 +#: c-api/buffer.rst:540 msgid "" "The *flags* argument indicates the request type. This function always fills " "in *view* as specified by flags, unless *buf* has been designated as read-" "only and :c:macro:`PyBUF_WRITABLE` is set in *flags*." msgstr "" -#: c-api/buffer.rst:538 +#: c-api/buffer.rst:544 msgid "" "On success, set ``view->obj`` to a new reference to *exporter* and return 0. " "Otherwise, raise :exc:`BufferError`, set ``view->obj`` to ``NULL`` and " "return ``-1``;" msgstr "" -#: c-api/buffer.rst:542 +#: c-api/buffer.rst:548 msgid "" "If this function is used as part of a :ref:`getbufferproc `, " "*exporter* MUST be set to the exporting object and *flags* must be passed " @@ -747,14 +755,14 @@ msgstr "" msgid "PyBufferProcs (C type)" msgstr "" -#: c-api/buffer.rst:295 +#: c-api/buffer.rst:301 msgid "contiguous" msgstr "" -#: c-api/buffer.rst:295 +#: c-api/buffer.rst:301 msgid "C-contiguous" msgstr "" -#: c-api/buffer.rst:295 +#: c-api/buffer.rst:301 msgid "Fortran contiguous" msgstr "" diff --git a/c-api/bytearray.po b/c-api/bytearray.po index e274aa98..0f136937 100644 --- a/c-api/bytearray.po +++ b/c-api/bytearray.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" diff --git a/c-api/bytes.po b/c-api/bytes.po index 4025cf90..d1fdb7f0 100644 --- a/c-api/bytes.po +++ b/c-api/bytes.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -314,16 +314,14 @@ msgstr "" #: c-api/bytes.rst:194 msgid "" -"A way to resize a bytes object even though it is \"immutable\". Only use " -"this to build up a brand new bytes object; don't use this if the bytes may " -"already be known in other parts of the code. It is an error to call this " -"function if the refcount on the input bytes object is not one. Pass the " -"address of an existing bytes object as an lvalue (it may be written into), " -"and the new size desired. On success, *\\*bytes* holds the resized bytes " -"object and ``0`` is returned; the address in *\\*bytes* may differ from its " -"input value. If the reallocation fails, the original bytes object at " -"*\\*bytes* is deallocated, *\\*bytes* is set to ``NULL``, :exc:`MemoryError` " -"is set, and ``-1`` is returned." +"Resize a bytes object. *newsize* will be the new length of the bytes object. " +"You can think of it as creating a new bytes object and destroying the old " +"one, only more efficiently. Pass the address of an existing bytes object as " +"an lvalue (it may be written into), and the new size desired. On success, " +"*\\*bytes* holds the resized bytes object and ``0`` is returned; the address " +"in *\\*bytes* may differ from its input value. If the reallocation fails, " +"the original bytes object at *\\*bytes* is deallocated, *\\*bytes* is set to " +"``NULL``, :exc:`MemoryError` is set, and ``-1`` is returned." msgstr "" #: c-api/bytes.rst:11 diff --git a/c-api/call.po b/c-api/call.po index 386c1ff6..05e3dcd3 100644 --- a/c-api/call.po +++ b/c-api/call.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -181,57 +181,45 @@ msgid "" "will usually be most efficient." msgstr "" -#: c-api/call.rst:120 -msgid "" -"In CPython 3.8, the vectorcall API and related functions were available " -"provisionally under names with a leading underscore: " -"``_PyObject_Vectorcall``, ``_Py_TPFLAGS_HAVE_VECTORCALL``, " -"``_PyObject_VectorcallMethod``, ``_PyVectorcall_Function``, " -"``_PyObject_CallOneArg``, ``_PyObject_CallMethodNoArgs``, " -"``_PyObject_CallMethodOneArg``. Additionally, ``PyObject_VectorcallDict`` " -"was available as ``_PyObject_FastCallDict``. The old names are still defined " -"as aliases of the new, non-underscored names." -msgstr "" - -#: c-api/call.rst:132 +#: c-api/call.rst:119 msgid "Recursion Control" msgstr "" -#: c-api/call.rst:134 +#: c-api/call.rst:121 msgid "" "When using *tp_call*, callees do not need to worry about :ref:`recursion " "`: CPython uses :c:func:`Py_EnterRecursiveCall` and :c:func:" "`Py_LeaveRecursiveCall` for calls made using *tp_call*." msgstr "" -#: c-api/call.rst:139 +#: c-api/call.rst:126 msgid "" "For efficiency, this is not the case for calls done using vectorcall: the " "callee should use *Py_EnterRecursiveCall* and *Py_LeaveRecursiveCall* if " "needed." msgstr "" -#: c-api/call.rst:145 +#: c-api/call.rst:132 msgid "Vectorcall Support API" msgstr "" -#: c-api/call.rst:149 +#: c-api/call.rst:136 msgid "" "Given a vectorcall *nargsf* argument, return the actual number of arguments. " "Currently equivalent to::" msgstr "" -#: c-api/call.rst:153 +#: c-api/call.rst:140 msgid "(Py_ssize_t)(nargsf & ~PY_VECTORCALL_ARGUMENTS_OFFSET)" msgstr "" -#: c-api/call.rst:155 +#: c-api/call.rst:142 msgid "" "However, the function ``PyVectorcall_NARGS`` should be used to allow for " "future extensions." msgstr "" -#: c-api/call.rst:162 +#: c-api/call.rst:149 msgid "" "If *op* does not support the vectorcall protocol (either because the type " "does not or because the specific instance does not), return *NULL*. " @@ -239,19 +227,19 @@ msgid "" "function never raises an exception." msgstr "" -#: c-api/call.rst:167 +#: c-api/call.rst:154 msgid "" "This is mostly useful to check whether or not *op* supports vectorcall, " "which can be done by checking ``PyVectorcall_Function(op) != NULL``." msgstr "" -#: c-api/call.rst:174 +#: c-api/call.rst:161 msgid "" "Call *callable*'s :c:type:`vectorcallfunc` with positional and keyword " "arguments given in a tuple and dict, respectively." msgstr "" -#: c-api/call.rst:177 +#: c-api/call.rst:164 msgid "" "This is a specialized function, intended to be put in the :c:member:" "`~PyTypeObject.tp_call` slot or be used in an implementation of ``tp_call``. " @@ -259,11 +247,11 @@ msgid "" "not fall back to ``tp_call``." msgstr "" -#: c-api/call.rst:188 +#: c-api/call.rst:175 msgid "Object Calling API" msgstr "" -#: c-api/call.rst:190 +#: c-api/call.rst:177 msgid "" "Various functions are available for calling a Python object. Each converts " "its arguments to a convention supported by the called object – either " @@ -271,177 +259,177 @@ msgid "" "pick one that best fits the format of data you have available." msgstr "" -#: c-api/call.rst:196 +#: c-api/call.rst:183 msgid "" "The following table summarizes the available functions; please see " "individual documentation for details." msgstr "" -#: c-api/call.rst:200 +#: c-api/call.rst:187 msgid "Function" msgstr "" -#: c-api/call.rst:200 +#: c-api/call.rst:187 msgid "callable" msgstr "" -#: c-api/call.rst:200 +#: c-api/call.rst:187 msgid "args" msgstr "" -#: c-api/call.rst:200 +#: c-api/call.rst:187 msgid "kwargs" msgstr "" -#: c-api/call.rst:202 +#: c-api/call.rst:189 msgid ":c:func:`PyObject_Call`" msgstr "" -#: c-api/call.rst:204 c-api/call.rst:208 c-api/call.rst:214 c-api/call.rst:224 +#: c-api/call.rst:191 c-api/call.rst:195 c-api/call.rst:201 c-api/call.rst:211 msgid "``PyObject *``" msgstr "" -#: c-api/call.rst:202 +#: c-api/call.rst:189 msgid "tuple" msgstr "" -#: c-api/call.rst:224 +#: c-api/call.rst:211 msgid "dict/``NULL``" msgstr "" -#: c-api/call.rst:204 +#: c-api/call.rst:191 msgid ":c:func:`PyObject_CallNoArgs`" msgstr "" -#: c-api/call.rst:206 c-api/call.rst:210 c-api/call.rst:214 c-api/call.rst:218 -#: c-api/call.rst:220 +#: c-api/call.rst:193 c-api/call.rst:197 c-api/call.rst:201 c-api/call.rst:205 +#: c-api/call.rst:207 msgid "---" msgstr "" -#: c-api/call.rst:206 +#: c-api/call.rst:193 msgid ":c:func:`PyObject_CallOneArg`" msgstr "" -#: c-api/call.rst:220 +#: c-api/call.rst:207 msgid "1 object" msgstr "" -#: c-api/call.rst:208 +#: c-api/call.rst:195 msgid ":c:func:`PyObject_CallObject`" msgstr "" -#: c-api/call.rst:208 +#: c-api/call.rst:195 msgid "tuple/``NULL``" msgstr "" -#: c-api/call.rst:210 +#: c-api/call.rst:197 msgid ":c:func:`PyObject_CallFunction`" msgstr "" -#: c-api/call.rst:212 +#: c-api/call.rst:199 msgid "format" msgstr "" -#: c-api/call.rst:212 +#: c-api/call.rst:199 msgid ":c:func:`PyObject_CallMethod`" msgstr "" -#: c-api/call.rst:212 +#: c-api/call.rst:199 msgid "obj + ``char*``" msgstr "" -#: c-api/call.rst:214 +#: c-api/call.rst:201 msgid ":c:func:`PyObject_CallFunctionObjArgs`" msgstr "" -#: c-api/call.rst:216 +#: c-api/call.rst:203 msgid "variadic" msgstr "" -#: c-api/call.rst:216 +#: c-api/call.rst:203 msgid ":c:func:`PyObject_CallMethodObjArgs`" msgstr "" -#: c-api/call.rst:218 c-api/call.rst:220 +#: c-api/call.rst:205 c-api/call.rst:207 msgid "obj + name" msgstr "" -#: c-api/call.rst:218 +#: c-api/call.rst:205 msgid ":c:func:`PyObject_CallMethodNoArgs`" msgstr "" -#: c-api/call.rst:220 +#: c-api/call.rst:207 msgid ":c:func:`PyObject_CallMethodOneArg`" msgstr "" -#: c-api/call.rst:222 +#: c-api/call.rst:209 msgid ":c:func:`PyObject_Vectorcall`" msgstr "" -#: c-api/call.rst:224 c-api/call.rst:226 +#: c-api/call.rst:211 c-api/call.rst:213 msgid "vectorcall" msgstr "" -#: c-api/call.rst:224 +#: c-api/call.rst:211 msgid ":c:func:`PyObject_VectorcallDict`" msgstr "" -#: c-api/call.rst:226 +#: c-api/call.rst:213 msgid ":c:func:`PyObject_VectorcallMethod`" msgstr "" -#: c-api/call.rst:226 +#: c-api/call.rst:213 msgid "arg + name" msgstr "" -#: c-api/call.rst:232 +#: c-api/call.rst:219 msgid "" "Call a callable Python object *callable*, with arguments given by the tuple " "*args*, and named arguments given by the dictionary *kwargs*." msgstr "" -#: c-api/call.rst:235 +#: c-api/call.rst:222 msgid "" "*args* must not be *NULL*; use an empty tuple if no arguments are needed. If " "no named arguments are needed, *kwargs* can be *NULL*." msgstr "" -#: c-api/call.rst:250 c-api/call.rst:272 c-api/call.rst:304 c-api/call.rst:337 -#: c-api/call.rst:358 c-api/call.rst:405 +#: c-api/call.rst:237 c-api/call.rst:259 c-api/call.rst:291 c-api/call.rst:324 +#: c-api/call.rst:345 c-api/call.rst:392 msgid "" "Return the result of the call on success, or raise an exception and return " "*NULL* on failure." msgstr "" -#: c-api/call.rst:241 +#: c-api/call.rst:228 msgid "" "This is the equivalent of the Python expression: ``callable(*args, " "**kwargs)``." msgstr "" -#: c-api/call.rst:247 +#: c-api/call.rst:234 msgid "" "Call a callable Python object *callable* without any arguments. It is the " "most efficient way to call a callable Python object without any argument." msgstr "" -#: c-api/call.rst:258 +#: c-api/call.rst:245 msgid "" "Call a callable Python object *callable* with exactly 1 positional argument " "*arg* and no keyword arguments." msgstr "" -#: c-api/call.rst:269 +#: c-api/call.rst:256 msgid "" "Call a callable Python object *callable*, with arguments given by the tuple " "*args*. If no arguments are needed, then *args* can be *NULL*." msgstr "" -#: c-api/call.rst:287 +#: c-api/call.rst:274 msgid "This is the equivalent of the Python expression: ``callable(*args)``." msgstr "" -#: c-api/call.rst:280 +#: c-api/call.rst:267 msgid "" "Call a callable Python object *callable*, with a variable number of C " "arguments. The C arguments are described using a :c:func:`Py_BuildValue` " @@ -449,57 +437,57 @@ msgid "" "are provided." msgstr "" -#: c-api/call.rst:289 +#: c-api/call.rst:276 msgid "" "Note that if you only pass :c:expr:`PyObject *` args, :c:func:" "`PyObject_CallFunctionObjArgs` is a faster alternative." msgstr "" -#: c-api/call.rst:292 +#: c-api/call.rst:279 msgid "The type of *format* was changed from ``char *``." msgstr "" -#: c-api/call.rst:298 +#: c-api/call.rst:285 msgid "" "Call the method named *name* of object *obj* with a variable number of C " "arguments. The C arguments are described by a :c:func:`Py_BuildValue` " "format string that should produce a tuple." msgstr "" -#: c-api/call.rst:302 +#: c-api/call.rst:289 msgid "The format can be *NULL*, indicating that no arguments are provided." msgstr "" -#: c-api/call.rst:307 +#: c-api/call.rst:294 msgid "" "This is the equivalent of the Python expression: ``obj.name(arg1, " "arg2, ...)``." msgstr "" -#: c-api/call.rst:310 +#: c-api/call.rst:297 msgid "" "Note that if you only pass :c:expr:`PyObject *` args, :c:func:" "`PyObject_CallMethodObjArgs` is a faster alternative." msgstr "" -#: c-api/call.rst:313 +#: c-api/call.rst:300 msgid "The types of *name* and *format* were changed from ``char *``." msgstr "" -#: c-api/call.rst:319 +#: c-api/call.rst:306 msgid "" "Call a callable Python object *callable*, with a variable number of :c:expr:" "`PyObject *` arguments. The arguments are provided as a variable number of " "parameters followed by *NULL*." msgstr "" -#: c-api/call.rst:326 +#: c-api/call.rst:313 msgid "" "This is the equivalent of the Python expression: ``callable(arg1, " "arg2, ...)``." msgstr "" -#: c-api/call.rst:332 +#: c-api/call.rst:319 msgid "" "Call a method of the Python object *obj*, where the name of the method is " "given as a Python string object in *name*. It is called with a variable " @@ -507,34 +495,34 @@ msgid "" "variable number of parameters followed by *NULL*." msgstr "" -#: c-api/call.rst:343 +#: c-api/call.rst:330 msgid "" "Call a method of the Python object *obj* without arguments, where the name " "of the method is given as a Python string object in *name*." msgstr "" -#: c-api/call.rst:354 +#: c-api/call.rst:341 msgid "" "Call a method of the Python object *obj* with a single positional argument " "*arg*, where the name of the method is given as a Python string object in " "*name*." msgstr "" -#: c-api/call.rst:366 +#: c-api/call.rst:353 msgid "" "Call a callable Python object *callable*. The arguments are the same as for :" "c:type:`vectorcallfunc`. If *callable* supports vectorcall_, this directly " "calls the vectorcall function stored in *callable*." msgstr "" -#: c-api/call.rst:378 +#: c-api/call.rst:365 msgid "" "Call *callable* with positional arguments passed exactly as in the " "vectorcall_ protocol, but with keyword arguments passed as a dictionary " "*kwdict*. The *args* array contains only the positional arguments." msgstr "" -#: c-api/call.rst:382 +#: c-api/call.rst:369 msgid "" "Regardless of which protocol is used internally, a conversion of arguments " "needs to be done. Therefore, this function should only be used if the caller " @@ -542,7 +530,7 @@ msgid "" "tuple for the positional arguments." msgstr "" -#: c-api/call.rst:392 +#: c-api/call.rst:379 msgid "" "Call a method using the vectorcall calling convention. The name of the " "method is given as a Python string *name*. The object whose method is called " @@ -554,17 +542,17 @@ msgid "" "`PyObject_Vectorcall`." msgstr "" -#: c-api/call.rst:401 +#: c-api/call.rst:388 msgid "" "If the object has the :c:macro:`Py_TPFLAGS_METHOD_DESCRIPTOR` feature, this " "will call the unbound method object with the full *args* vector as arguments." msgstr "" -#: c-api/call.rst:412 +#: c-api/call.rst:399 msgid "Call Support API" msgstr "" -#: c-api/call.rst:416 +#: c-api/call.rst:403 msgid "" "Determine if the object *o* is callable. Return ``1`` if the object is " "callable and ``0`` otherwise. This function always succeeds." diff --git a/c-api/capsule.po b/c-api/capsule.po index 0ea3ed0c..ac738e7b 100644 --- a/c-api/capsule.po +++ b/c-api/capsule.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" diff --git a/c-api/cell.po b/c-api/cell.po index 213ea740..8cf1dfc6 100644 --- a/c-api/cell.po +++ b/c-api/cell.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" diff --git a/c-api/code.po b/c-api/code.po index 00107844..0b5cf998 100644 --- a/c-api/code.po +++ b/c-api/code.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -47,116 +47,127 @@ msgid "" msgstr "" #: c-api/code.rst:35 -msgid "Return the number of free variables in a code object." +msgid "" +"Return the number of :term:`free (closure) variables ` in " +"a code object." msgstr "" -#: c-api/code.rst:39 -msgid "Return the position of the first free variable in a code object." +#: c-api/code.rst:40 +msgid "" +"Return the position of the first :term:`free (closure) variable ` in a code object." msgstr "" -#: c-api/code.rst:43 +#: c-api/code.rst:45 +msgid "" +"Renamed from ``PyCode_GetFirstFree`` as part of :ref:`unstable-c-api`. The " +"old name is deprecated, but will remain available until the signature " +"changes again." +msgstr "" + +#: c-api/code.rst:51 msgid "" "Return a new code object. If you need a dummy code object to create a " "frame, use :c:func:`PyCode_NewEmpty` instead." msgstr "" -#: c-api/code.rst:46 +#: c-api/code.rst:54 msgid "" "Since the definition of the bytecode changes often, calling :c:func:" "`PyUnstable_Code_New` directly can bind you to a precise Python version." msgstr "" -#: c-api/code.rst:49 +#: c-api/code.rst:57 msgid "" "The many arguments of this function are inter-dependent in complex ways, " "meaning that subtle changes to values are likely to result in incorrect " "execution or VM crashes. Use this function only with extreme care." msgstr "" -#: c-api/code.rst:53 +#: c-api/code.rst:61 msgid "Added ``qualname`` and ``exceptiontable`` parameters." msgstr "" -#: c-api/code.rst:60 +#: c-api/code.rst:68 msgid "" "Renamed from ``PyCode_New`` as part of :ref:`unstable-c-api`. The old name " "is deprecated, but will remain available until the signature changes again." msgstr "" -#: c-api/code.rst:66 +#: c-api/code.rst:74 msgid "" "Similar to :c:func:`PyUnstable_Code_New`, but with an extra " "\"posonlyargcount\" for positional-only arguments. The same caveats that " "apply to ``PyUnstable_Code_New`` also apply to this function." msgstr "" -#: c-api/code.rst:71 +#: c-api/code.rst:79 msgid "as ``PyCode_NewWithPosOnlyArgs``" msgstr "" -#: c-api/code.rst:73 +#: c-api/code.rst:81 msgid "Added ``qualname`` and ``exceptiontable`` parameters." msgstr "" -#: c-api/code.rst:78 +#: c-api/code.rst:86 msgid "" "Renamed to ``PyUnstable_Code_NewWithPosOnlyArgs``. The old name is " "deprecated, but will remain available until the signature changes again." msgstr "" -#: c-api/code.rst:84 +#: c-api/code.rst:92 msgid "" "Return a new empty code object with the specified filename, function name, " "and first line number. The resulting code object will raise an ``Exception`` " "if executed." msgstr "" -#: c-api/code.rst:90 +#: c-api/code.rst:98 msgid "" "Return the line number of the instruction that occurs on or before " "``byte_offset`` and ends after it. If you just need the line number of a " "frame, use :c:func:`PyFrame_GetLineNumber` instead." msgstr "" -#: c-api/code.rst:93 +#: c-api/code.rst:101 msgid "" "For efficiently iterating over the line numbers in a code object, use :pep:" "`the API described in PEP 626 <0626#out-of-process-debuggers-and-profilers>`." msgstr "" -#: c-api/code.rst:98 +#: c-api/code.rst:106 msgid "" "Sets the passed ``int`` pointers to the source code line and column numbers " "for the instruction at ``byte_offset``. Sets the value to ``0`` when " "information is not available for any particular element." msgstr "" -#: c-api/code.rst:102 +#: c-api/code.rst:110 msgid "Returns ``1`` if the function succeeds and 0 otherwise." msgstr "" -#: c-api/code.rst:108 +#: c-api/code.rst:116 msgid "" "Equivalent to the Python code ``getattr(co, 'co_code')``. Returns a strong " "reference to a :c:type:`PyBytesObject` representing the bytecode in a code " "object. On error, ``NULL`` is returned and an exception is raised." msgstr "" -#: c-api/code.rst:113 +#: c-api/code.rst:121 msgid "" "This ``PyBytesObject`` may be created on-demand by the interpreter and does " "not necessarily represent the bytecode actually executed by CPython. The " "primary use case for this function is debuggers and profilers." msgstr "" -#: c-api/code.rst:121 +#: c-api/code.rst:129 msgid "" "Equivalent to the Python code ``getattr(co, 'co_varnames')``. Returns a new " "reference to a :c:type:`PyTupleObject` containing the names of the local " "variables. On error, ``NULL`` is returned and an exception is raised." msgstr "" -#: c-api/code.rst:130 +#: c-api/code.rst:138 msgid "" "Equivalent to the Python code ``getattr(co, 'co_cellvars')``. Returns a new " "reference to a :c:type:`PyTupleObject` containing the names of the local " @@ -164,14 +175,15 @@ msgid "" "returned and an exception is raised." msgstr "" -#: c-api/code.rst:139 +#: c-api/code.rst:147 msgid "" "Equivalent to the Python code ``getattr(co, 'co_freevars')``. Returns a new " -"reference to a :c:type:`PyTupleObject` containing the names of the free " -"variables. On error, ``NULL`` is returned and an exception is raised." +"reference to a :c:type:`PyTupleObject` containing the names of the :term:" +"`free (closure) variables `. On error, ``NULL`` is " +"returned and an exception is raised." msgstr "" -#: c-api/code.rst:147 +#: c-api/code.rst:156 msgid "" "Register *callback* as a code object watcher for the current interpreter. " "Return an ID which may be passed to :c:func:`PyCode_ClearWatcher`. In case " @@ -179,7 +191,7 @@ msgid "" "exception." msgstr "" -#: c-api/code.rst:156 +#: c-api/code.rst:165 msgid "" "Clear watcher identified by *watcher_id* previously returned from :c:func:" "`PyCode_AddWatcher` for the current interpreter. Return ``0`` on success, or " @@ -187,17 +199,17 @@ msgid "" "never registered.)" msgstr "" -#: c-api/code.rst:165 +#: c-api/code.rst:174 msgid "" "Enumeration of possible code object watcher events: - " "``PY_CODE_EVENT_CREATE`` - ``PY_CODE_EVENT_DESTROY``" msgstr "" -#: c-api/code.rst:173 +#: c-api/code.rst:182 msgid "Type of a code object watcher callback function." msgstr "" -#: c-api/code.rst:175 +#: c-api/code.rst:184 msgid "" "If *event* is ``PY_CODE_EVENT_CREATE``, then the callback is invoked after " "`co` has been fully initialized. Otherwise, the callback is invoked before " @@ -205,7 +217,7 @@ msgid "" "inspected." msgstr "" -#: c-api/code.rst:180 +#: c-api/code.rst:189 msgid "" "If *event* is ``PY_CODE_EVENT_DESTROY``, taking a reference in the callback " "to the about-to-be-destroyed code object will resurrect it and prevent it " @@ -213,7 +225,7 @@ msgid "" "later, any watcher callbacks active at that time will be called again." msgstr "" -#: c-api/code.rst:185 +#: c-api/code.rst:194 msgid "" "Users of this API should not rely on internal runtime implementation " "details. Such details may include, but are not limited to, the exact order " @@ -223,14 +235,14 @@ msgid "" "the Python code being executed." msgstr "" -#: c-api/code.rst:192 +#: c-api/code.rst:201 msgid "" "If the callback sets an exception, it must return ``-1``; this exception " "will be printed as an unraisable exception using :c:func:" "`PyErr_WriteUnraisable`. Otherwise it should return ``0``." msgstr "" -#: c-api/code.rst:196 +#: c-api/code.rst:205 msgid "" "There may already be a pending exception set on entry to the callback. In " "this case, the callback should return ``0`` with the same exception still " @@ -239,85 +251,85 @@ msgid "" "it before returning." msgstr "" -#: c-api/code.rst:206 +#: c-api/code.rst:215 msgid "Extra information" msgstr "" -#: c-api/code.rst:208 +#: c-api/code.rst:217 msgid "" "To support low-level extensions to frame evaluation, such as external just-" "in-time compilers, it is possible to attach arbitrary extra data to code " "objects." msgstr "" -#: c-api/code.rst:212 +#: c-api/code.rst:221 msgid "" "These functions are part of the unstable C API tier: this functionality is a " "CPython implementation detail, and the API may change without deprecation " "warnings." msgstr "" -#: c-api/code.rst:218 +#: c-api/code.rst:227 msgid "Return a new an opaque index value used to adding data to code objects." msgstr "" -#: c-api/code.rst:220 +#: c-api/code.rst:229 msgid "" "You generally call this function once (per interpreter) and use the result " "with ``PyCode_GetExtra`` and ``PyCode_SetExtra`` to manipulate data on " "individual code objects." msgstr "" -#: c-api/code.rst:224 +#: c-api/code.rst:233 msgid "" "If *free* is not ``NULL``: when a code object is deallocated, *free* will be " "called on non-``NULL`` data stored under the new index. Use :c:func:" "`Py_DecRef` when storing :c:type:`PyObject`." msgstr "" -#: c-api/code.rst:230 +#: c-api/code.rst:239 msgid "as ``_PyEval_RequestCodeExtraIndex``" msgstr "" -#: c-api/code.rst:234 +#: c-api/code.rst:243 msgid "" "Renamed to ``PyUnstable_Eval_RequestCodeExtraIndex``. The old private name " "is deprecated, but will be available until the API changes." msgstr "" -#: c-api/code.rst:240 +#: c-api/code.rst:249 msgid "" "Set *extra* to the extra data stored under the given index. Return 0 on " "success. Set an exception and return -1 on failure." msgstr "" -#: c-api/code.rst:243 +#: c-api/code.rst:252 msgid "" "If no data was set under the index, set *extra* to ``NULL`` and return 0 " "without setting an exception." msgstr "" -#: c-api/code.rst:248 +#: c-api/code.rst:257 msgid "as ``_PyCode_GetExtra``" msgstr "" -#: c-api/code.rst:252 +#: c-api/code.rst:261 msgid "" "Renamed to ``PyUnstable_Code_GetExtra``. The old private name is deprecated, " "but will be available until the API changes." msgstr "" -#: c-api/code.rst:258 +#: c-api/code.rst:267 msgid "" "Set the extra data stored under the given index to *extra*. Return 0 on " "success. Set an exception and return -1 on failure." msgstr "" -#: c-api/code.rst:263 +#: c-api/code.rst:272 msgid "as ``_PyCode_SetExtra``" msgstr "" -#: c-api/code.rst:267 +#: c-api/code.rst:276 msgid "" "Renamed to ``PyUnstable_Code_SetExtra``. The old private name is deprecated, " "but will be available until the API changes." @@ -335,22 +347,22 @@ msgstr "" msgid "code object" msgstr "" -#: c-api/code.rst:56 +#: c-api/code.rst:64 msgid "PyCode_New (C function)" msgstr "" -#: c-api/code.rst:69 +#: c-api/code.rst:77 msgid "PyCode_NewWithPosOnlyArgs (C function)" msgstr "" -#: c-api/code.rst:228 +#: c-api/code.rst:237 msgid "_PyEval_RequestCodeExtraIndex (C function)" msgstr "" -#: c-api/code.rst:246 +#: c-api/code.rst:255 msgid "_PyCode_GetExtra (C function)" msgstr "" -#: c-api/code.rst:261 +#: c-api/code.rst:270 msgid "_PyCode_SetExtra (C function)" msgstr "" diff --git a/c-api/codec.po b/c-api/codec.po index cb0f9ca4..63449df5 100644 --- a/c-api/codec.po +++ b/c-api/codec.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" diff --git a/c-api/complex.po b/c-api/complex.po index b29fccde..1dca3029 100644 --- a/c-api/complex.po +++ b/c-api/complex.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -153,19 +153,40 @@ msgstr "" #: c-api/complex.rst:126 msgid "" +"If *op* is not a Python complex number object but has a :meth:`~object." +"__complex__` method, this method will first be called to convert *op* to a " +"Python complex number object. If :meth:`!__complex__` is not defined then " +"it falls back to call :c:func:`PyFloat_AsDouble` and returns its result." +msgstr "" + +#: c-api/complex.rst:148 +msgid "" "Upon failure, this method returns ``-1.0`` with an exception set, so one " "should call :c:func:`PyErr_Occurred` to check for errors." msgstr "" -#: c-api/complex.rst:132 +#: c-api/complex.rst:151 +msgid "Use :meth:`~object.__complex__` if available." +msgstr "" + +#: c-api/complex.rst:140 msgid "Return the imaginary part of *op* as a C :c:expr:`double`." msgstr "" -#: c-api/complex.rst:137 +#: c-api/complex.rst:142 +msgid "" +"If *op* is not a Python complex number object but has a :meth:`~object." +"__complex__` method, this method will first be called to convert *op* to a " +"Python complex number object. If :meth:`!__complex__` is not defined then " +"it falls back to call :c:func:`PyFloat_AsDouble` and returns ``0.0`` on " +"success." +msgstr "" + +#: c-api/complex.rst:156 msgid "Return the :c:type:`Py_complex` value of the complex number *op*." msgstr "" -#: c-api/complex.rst:139 +#: c-api/complex.rst:158 msgid "" "If *op* is not a Python complex number object but has a :meth:`~object." "__complex__` method, this method will first be called to convert *op* to a " @@ -174,14 +195,14 @@ msgid "" "defined then it falls back to :meth:`~object.__index__`." msgstr "" -#: c-api/complex.rst:145 +#: c-api/complex.rst:164 msgid "" "Upon failure, this method returns :c:type:`Py_complex` with :c:member:" "`~Py_complex.real` set to ``-1.0`` and with an exception set, so one should " "call :c:func:`PyErr_Occurred` to check for errors." msgstr "" -#: c-api/complex.rst:149 +#: c-api/complex.rst:168 msgid "Use :meth:`~object.__index__` if available." msgstr "" diff --git a/c-api/concrete.po b/c-api/concrete.po index 24d3aeec..d82fe1e6 100644 --- a/c-api/concrete.po +++ b/c-api/concrete.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" diff --git a/c-api/contextvars.po b/c-api/contextvars.po index c5104636..a6a1ed8e 100644 --- a/c-api/contextvars.po +++ b/c-api/contextvars.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" diff --git a/c-api/conversion.po b/c-api/conversion.po index 40a111f9..2439bda8 100644 --- a/c-api/conversion.po +++ b/c-api/conversion.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" diff --git a/c-api/coro.po b/c-api/coro.po index d63a91e8..d9083c84 100644 --- a/c-api/coro.po +++ b/c-api/coro.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" diff --git a/c-api/datetime.po b/c-api/datetime.po index c3f0ec9e..c2fe14e0 100644 --- a/c-api/datetime.po +++ b/c-api/datetime.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" diff --git a/c-api/descriptor.po b/c-api/descriptor.po index 2901d354..21891b4d 100644 --- a/c-api/descriptor.po +++ b/c-api/descriptor.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" diff --git a/c-api/dict.po b/c-api/dict.po index e37178b8..290cfb6c 100644 --- a/c-api/dict.po +++ b/c-api/dict.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -67,10 +67,17 @@ msgid "" msgstr "" #: c-api/dict.rst:60 +msgid "" +"This is the same as :c:func:`PyDict_Contains`, but *key* is specified as a :" +"c:expr:`const char*` UTF-8 encoded bytes string, rather than a :c:expr:" +"`PyObject*`." +msgstr "" + +#: c-api/dict.rst:69 msgid "Return a new dictionary that contains the same key-value pairs as *p*." msgstr "" -#: c-api/dict.rst:65 +#: c-api/dict.rst:74 msgid "" "Insert *val* into the dictionary *p* with a key of *key*. *key* must be :" "term:`hashable`; if it isn't, :exc:`TypeError` will be raised. Return ``0`` " @@ -78,14 +85,14 @@ msgid "" "to *val*." msgstr "" -#: c-api/dict.rst:73 +#: c-api/dict.rst:82 msgid "" "This is the same as :c:func:`PyDict_SetItem`, but *key* is specified as a :c:" "expr:`const char*` UTF-8 encoded bytes string, rather than a :c:expr:" "`PyObject*`." msgstr "" -#: c-api/dict.rst:80 +#: c-api/dict.rst:89 msgid "" "Remove the entry in dictionary *p* with key *key*. *key* must be :term:" "`hashable`; if it isn't, :exc:`TypeError` is raised. If *key* is not in the " @@ -93,47 +100,72 @@ msgid "" "failure." msgstr "" -#: c-api/dict.rst:88 +#: c-api/dict.rst:97 msgid "" "This is the same as :c:func:`PyDict_DelItem`, but *key* is specified as a :c:" "expr:`const char*` UTF-8 encoded bytes string, rather than a :c:expr:" "`PyObject*`." msgstr "" -#: c-api/dict.rst:95 +#: c-api/dict.rst:104 +msgid "" +"Return a new :term:`strong reference` to the object from dictionary *p* " +"which has a key *key*:" +msgstr "" + +#: c-api/dict.rst:107 +msgid "" +"If the key is present, set *\\*result* to a new :term:`strong reference` to " +"the value and return ``1``." +msgstr "" + +#: c-api/dict.rst:109 +msgid "If the key is missing, set *\\*result* to ``NULL`` and return ``0``." +msgstr "" + +#: c-api/dict.rst:207 +msgid "On error, raise an exception and return ``-1``." +msgstr "" + +#: c-api/dict.rst:114 +msgid "See also the :c:func:`PyObject_GetItem` function." +msgstr "" + +#: c-api/dict.rst:119 msgid "" -"Return the object from dictionary *p* which has a key *key*. Return " -"``NULL`` if the key *key* is not present, but *without* setting an exception." +"Return a :term:`borrowed reference` to the object from dictionary *p* which " +"has a key *key*. Return ``NULL`` if the key *key* is missing *without* " +"setting an exception." msgstr "" -#: c-api/dict.rst:100 +#: c-api/dict.rst:125 msgid "" "Exceptions that occur while this calls :meth:`~object.__hash__` and :meth:" "`~object.__eq__` methods are silently ignored. Prefer the :c:func:" "`PyDict_GetItemWithError` function instead." msgstr "" -#: c-api/dict.rst:104 +#: c-api/dict.rst:129 msgid "" "Calling this API without :term:`GIL` held had been allowed for historical " "reason. It is no longer allowed." msgstr "" -#: c-api/dict.rst:111 +#: c-api/dict.rst:136 msgid "" "Variant of :c:func:`PyDict_GetItem` that does not suppress exceptions. " "Return ``NULL`` **with** an exception set if an exception occurred. Return " "``NULL`` **without** an exception set if the key wasn't present." msgstr "" -#: c-api/dict.rst:119 +#: c-api/dict.rst:144 msgid "" "This is the same as :c:func:`PyDict_GetItem`, but *key* is specified as a :c:" "expr:`const char*` UTF-8 encoded bytes string, rather than a :c:expr:" "`PyObject*`." msgstr "" -#: c-api/dict.rst:125 +#: c-api/dict.rst:150 msgid "" "Exceptions that occur while this calls :meth:`~object.__hash__` and :meth:" "`~object.__eq__` methods or while creating the temporary :class:`str` object " @@ -141,7 +173,13 @@ msgid "" "function with your own :c:func:`PyUnicode_FromString` *key* instead." msgstr "" -#: c-api/dict.rst:134 +#: c-api/dict.rst:159 +msgid "" +"Similar to :c:func:`PyDict_GetItemRef`, but *key* is specified as a :c:expr:" +"`const char*` UTF-8 encoded bytes string, rather than a :c:expr:`PyObject*`." +msgstr "" + +#: c-api/dict.rst:168 msgid "" "This is the same as the Python-level :meth:`dict.setdefault`. If present, " "it returns the value corresponding to *key* from the dictionary *p*. If the " @@ -151,29 +189,79 @@ msgid "" "the insertion." msgstr "" -#: c-api/dict.rst:144 +#: c-api/dict.rst:179 +msgid "" +"Inserts *default_value* into the dictionary *p* with a key of *key* if the " +"key is not already present in the dictionary. If *result* is not ``NULL``, " +"then *\\*result* is set to a :term:`strong reference` to either " +"*default_value*, if the key was not present, or the existing value, if *key* " +"was already present in the dictionary. Returns ``1`` if the key was present " +"and *default_value* was not inserted, or ``0`` if the key was not present " +"and *default_value* was inserted. On failure, returns ``-1``, sets an " +"exception, and sets ``*result`` to ``NULL``." +msgstr "" + +#: c-api/dict.rst:189 +msgid "" +"For clarity: if you have a strong reference to *default_value* before " +"calling this function, then after it returns, you hold a strong reference to " +"both *default_value* and *\\*result* (if it's not ``NULL``). These may refer " +"to the same object: in that case you hold two separate references to it." +msgstr "" + +#: c-api/dict.rst:200 +msgid "" +"Remove *key* from dictionary *p* and optionally return the removed value. Do " +"not raise :exc:`KeyError` if the key missing." +msgstr "" + +#: c-api/dict.rst:203 +msgid "" +"If the key is present, set *\\*result* to a new reference to the removed " +"value if *result* is not ``NULL``, and return ``1``." +msgstr "" + +#: c-api/dict.rst:205 +msgid "" +"If the key is missing, set *\\*result* to ``NULL`` if *result* is not " +"``NULL``, and return ``0``." +msgstr "" + +#: c-api/dict.rst:209 +msgid "" +"Similar to :meth:`dict.pop`, but without the default value and not raising :" +"exc:`KeyError` if the key missing." +msgstr "" + +#: c-api/dict.rst:217 +msgid "" +"Similar to :c:func:`PyDict_Pop`, but *key* is specified as a :c:expr:`const " +"char*` UTF-8 encoded bytes string, rather than a :c:expr:`PyObject*`." +msgstr "" + +#: c-api/dict.rst:226 msgid "" "Return a :c:type:`PyListObject` containing all the items from the dictionary." msgstr "" -#: c-api/dict.rst:149 +#: c-api/dict.rst:231 msgid "" "Return a :c:type:`PyListObject` containing all the keys from the dictionary." msgstr "" -#: c-api/dict.rst:154 +#: c-api/dict.rst:236 msgid "" "Return a :c:type:`PyListObject` containing all the values from the " "dictionary *p*." msgstr "" -#: c-api/dict.rst:162 +#: c-api/dict.rst:244 msgid "" "Return the number of items in the dictionary. This is equivalent to " "``len(p)`` on a dictionary." msgstr "" -#: c-api/dict.rst:168 +#: c-api/dict.rst:250 msgid "" "Iterate over all key-value pairs in the dictionary *p*. The :c:type:" "`Py_ssize_t` referred to by *ppos* must be initialized to ``0`` prior to the " @@ -187,11 +275,11 @@ msgid "" "structure is sparse, the offsets are not consecutive." msgstr "" -#: c-api/dict.rst:179 +#: c-api/dict.rst:261 msgid "For example::" msgstr "" -#: c-api/dict.rst:181 +#: c-api/dict.rst:263 msgid "" "PyObject *key, *value;\n" "Py_ssize_t pos = 0;\n" @@ -202,14 +290,14 @@ msgid "" "}" msgstr "" -#: c-api/dict.rst:189 +#: c-api/dict.rst:271 msgid "" "The dictionary *p* should not be mutated during iteration. It is safe to " "modify the values of the keys as you iterate over the dictionary, but only " "so long as the set of keys does not change. For example::" msgstr "" -#: c-api/dict.rst:193 +#: c-api/dict.rst:275 msgid "" "PyObject *key, *value;\n" "Py_ssize_t pos = 0;\n" @@ -230,7 +318,23 @@ msgid "" "}" msgstr "" -#: c-api/dict.rst:214 +#: c-api/dict.rst:293 +msgid "" +"The function is not thread-safe in the :term:`free-threaded ` build without external synchronization. You can use :c:macro:" +"`Py_BEGIN_CRITICAL_SECTION` to lock the dictionary while iterating over it::" +msgstr "" + +#: c-api/dict.rst:298 +msgid "" +"Py_BEGIN_CRITICAL_SECTION(self->dict);\n" +"while (PyDict_Next(self->dict, &pos, &key, &value)) {\n" +" ...\n" +"}\n" +"Py_END_CRITICAL_SECTION();" +msgstr "" + +#: c-api/dict.rst:307 msgid "" "Iterate over mapping object *b* adding key-value pairs to dictionary *a*. " "*b* may be a dictionary, or any object supporting :c:func:`PyMapping_Keys` " @@ -240,7 +344,7 @@ msgid "" "or ``-1`` if an exception was raised." msgstr "" -#: c-api/dict.rst:224 +#: c-api/dict.rst:317 msgid "" "This is the same as ``PyDict_Merge(a, b, 1)`` in C, and is similar to ``a." "update(b)`` in Python except that :c:func:`PyDict_Update` doesn't fall back " @@ -249,7 +353,7 @@ msgid "" "exception was raised." msgstr "" -#: c-api/dict.rst:233 +#: c-api/dict.rst:326 msgid "" "Update or merge into dictionary *a*, from the key-value pairs in *seq2*. " "*seq2* must be an iterable object producing iterable objects of length 2, " @@ -258,7 +362,7 @@ msgid "" "if an exception was raised. Equivalent Python (except for the return value)::" msgstr "" -#: c-api/dict.rst:240 +#: c-api/dict.rst:333 msgid "" "def PyDict_MergeFromSeq2(a, seq2, override):\n" " for key, value in seq2:\n" @@ -266,7 +370,7 @@ msgid "" " a[key] = value" msgstr "" -#: c-api/dict.rst:247 +#: c-api/dict.rst:340 msgid "" "Register *callback* as a dictionary watcher. Return a non-negative integer " "id which must be passed to future calls to :c:func:`PyDict_Watch`. In case " @@ -274,21 +378,21 @@ msgid "" "exception." msgstr "" -#: c-api/dict.rst:256 +#: c-api/dict.rst:349 msgid "" "Clear watcher identified by *watcher_id* previously returned from :c:func:" "`PyDict_AddWatcher`. Return ``0`` on success, ``-1`` on error (e.g. if the " "given *watcher_id* was never registered.)" msgstr "" -#: c-api/dict.rst:264 +#: c-api/dict.rst:357 msgid "" "Mark dictionary *dict* as watched. The callback granted *watcher_id* by :c:" "func:`PyDict_AddWatcher` will be called when *dict* is modified or " "deallocated. Return ``0`` on success or ``-1`` on error." msgstr "" -#: c-api/dict.rst:272 +#: c-api/dict.rst:365 msgid "" "Mark dictionary *dict* as no longer watched. The callback granted " "*watcher_id* by :c:func:`PyDict_AddWatcher` will no longer be called when " @@ -296,7 +400,7 @@ msgid "" "watched by this watcher. Return ``0`` on success or ``-1`` on error." msgstr "" -#: c-api/dict.rst:281 +#: c-api/dict.rst:374 msgid "" "Enumeration of possible dictionary watcher events: ``PyDict_EVENT_ADDED``, " "``PyDict_EVENT_MODIFIED``, ``PyDict_EVENT_DELETED``, " @@ -304,11 +408,11 @@ msgid "" "``PyDict_EVENT_DEALLOCATED``." msgstr "" -#: c-api/dict.rst:289 +#: c-api/dict.rst:382 msgid "Type of a dict watcher callback function." msgstr "" -#: c-api/dict.rst:291 +#: c-api/dict.rst:384 msgid "" "If *event* is ``PyDict_EVENT_CLEARED`` or ``PyDict_EVENT_DEALLOCATED``, both " "*key* and *new_value* will be ``NULL``. If *event* is ``PyDict_EVENT_ADDED`` " @@ -317,7 +421,7 @@ msgid "" "dictionary and *new_value* will be ``NULL``." msgstr "" -#: c-api/dict.rst:297 +#: c-api/dict.rst:390 msgid "" "``PyDict_EVENT_CLONED`` occurs when *dict* was previously empty and another " "dict is merged into it. To maintain efficiency of this operation, per-key " @@ -325,14 +429,14 @@ msgid "" "``PyDict_EVENT_CLONED`` is issued, and *key* will be the source dictionary." msgstr "" -#: c-api/dict.rst:303 +#: c-api/dict.rst:396 msgid "" "The callback may inspect but must not modify *dict*; doing so could have " "unpredictable effects, including infinite recursion. Do not trigger Python " "code execution in the callback, as it could modify the dict as a side effect." msgstr "" -#: c-api/dict.rst:307 +#: c-api/dict.rst:400 msgid "" "If *event* is ``PyDict_EVENT_DEALLOCATED``, taking a new reference in the " "callback to the about-to-be-destroyed dictionary will resurrect it and " @@ -341,20 +445,20 @@ msgid "" "again." msgstr "" -#: c-api/dict.rst:313 +#: c-api/dict.rst:406 msgid "" "Callbacks occur before the notified modification to *dict* takes place, so " "the prior state of *dict* can be inspected." msgstr "" -#: c-api/dict.rst:316 +#: c-api/dict.rst:409 msgid "" "If the callback sets an exception, it must return ``-1``; this exception " "will be printed as an unraisable exception using :c:func:" "`PyErr_WriteUnraisable`. Otherwise it should return ``0``." msgstr "" -#: c-api/dict.rst:320 +#: c-api/dict.rst:413 msgid "" "There may already be a pending exception set on entry to the callback. In " "this case, the callback should return ``0`` with the same exception still " @@ -371,10 +475,10 @@ msgstr "" msgid "dictionary" msgstr "" -#: c-api/dict.rst:160 +#: c-api/dict.rst:242 msgid "built-in function" msgstr "" -#: c-api/dict.rst:160 +#: c-api/dict.rst:242 msgid "len" msgstr "" diff --git a/c-api/exceptions.po b/c-api/exceptions.po index c3b5c771..2bb1e6b2 100644 --- a/c-api/exceptions.po +++ b/c-api/exceptions.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -141,22 +141,31 @@ msgstr "" #: c-api/exceptions.rst:104 msgid "" +"Similar to :c:func:`PyErr_WriteUnraisable`, but the *format* and subsequent " +"parameters help format the warning message; they have the same meaning and " +"values as in :c:func:`PyUnicode_FromFormat`. ``PyErr_WriteUnraisable(obj)`` " +"is roughly equivalent to ``PyErr_FormatUnraisable(\"Exception ignored in: " +"%R\", obj)``. If *format* is ``NULL``, only the traceback is printed." +msgstr "" + +#: c-api/exceptions.rst:116 +msgid "" "Print the standard traceback display of ``exc`` to ``sys.stderr``, including " "chained exceptions and notes." msgstr "" -#: c-api/exceptions.rst:110 +#: c-api/exceptions.rst:123 msgid "Raising exceptions" msgstr "" -#: c-api/exceptions.rst:112 +#: c-api/exceptions.rst:125 msgid "" "These functions help you set the current thread's error indicator. For " "convenience, some of these functions will always return a ``NULL`` pointer " "for use in a ``return`` statement." msgstr "" -#: c-api/exceptions.rst:119 +#: c-api/exceptions.rst:132 msgid "" "This is the most common way to set the error indicator. The first argument " "specifies the exception type; it is normally one of the standard exceptions, " @@ -165,13 +174,13 @@ msgid "" "error message; it is decoded from ``'utf-8'``." msgstr "" -#: c-api/exceptions.rst:128 +#: c-api/exceptions.rst:141 msgid "" "This function is similar to :c:func:`PyErr_SetString` but lets you specify " "an arbitrary Python object for the \"value\" of the exception." msgstr "" -#: c-api/exceptions.rst:134 +#: c-api/exceptions.rst:147 msgid "" "This function sets the error indicator and returns ``NULL``. *exception* " "should be a Python exception class. The *format* and subsequent parameters " @@ -179,31 +188,31 @@ msgid "" "c:func:`PyUnicode_FromFormat`. *format* is an ASCII-encoded string." msgstr "" -#: c-api/exceptions.rst:143 +#: c-api/exceptions.rst:156 msgid "" "Same as :c:func:`PyErr_Format`, but taking a :c:type:`va_list` argument " "rather than a variable number of arguments." msgstr "" -#: c-api/exceptions.rst:151 +#: c-api/exceptions.rst:164 msgid "This is a shorthand for ``PyErr_SetObject(type, Py_None)``." msgstr "" -#: c-api/exceptions.rst:156 +#: c-api/exceptions.rst:169 msgid "" "This is a shorthand for ``PyErr_SetString(PyExc_TypeError, message)``, where " "*message* indicates that a built-in operation was invoked with an illegal " "argument. It is mostly for internal use." msgstr "" -#: c-api/exceptions.rst:163 +#: c-api/exceptions.rst:176 msgid "" "This is a shorthand for ``PyErr_SetNone(PyExc_MemoryError)``; it returns " "``NULL`` so an object allocation function can write ``return " "PyErr_NoMemory();`` when it runs out of memory." msgstr "" -#: c-api/exceptions.rst:172 +#: c-api/exceptions.rst:185 msgid "" "This is a convenience function to raise an exception when a C library " "function has returned an error and set the C variable :c:data:`errno`. It " @@ -217,7 +226,7 @@ msgid "" "``return PyErr_SetFromErrno(type);`` when the system call returns an error." msgstr "" -#: c-api/exceptions.rst:186 +#: c-api/exceptions.rst:199 msgid "" "Similar to :c:func:`PyErr_SetFromErrno`, with the additional behavior that " "if *filenameObject* is not ``NULL``, it is passed to the constructor of " @@ -225,21 +234,21 @@ msgid "" "is used to define the :attr:`!filename` attribute of the exception instance." msgstr "" -#: c-api/exceptions.rst:195 +#: c-api/exceptions.rst:208 msgid "" "Similar to :c:func:`PyErr_SetFromErrnoWithFilenameObject`, but takes a " "second filename object, for raising errors when a function that takes two " "filenames fails." msgstr "" -#: c-api/exceptions.rst:204 +#: c-api/exceptions.rst:217 msgid "" "Similar to :c:func:`PyErr_SetFromErrnoWithFilenameObject`, but the filename " "is given as a C string. *filename* is decoded from the :term:`filesystem " "encoding and error handler`." msgstr "" -#: c-api/exceptions.rst:211 +#: c-api/exceptions.rst:224 msgid "" "This is a convenience function to raise :exc:`OSError`. If called with " "*ierr* of ``0``, the error code returned by a call to :c:func:`!" @@ -253,17 +262,17 @@ msgid "" "``NULL``." msgstr "" -#: c-api/exceptions.rst:229 c-api/exceptions.rst:250 c-api/exceptions.rst:268 +#: c-api/exceptions.rst:242 c-api/exceptions.rst:263 c-api/exceptions.rst:281 msgid "Availability" msgstr "" -#: c-api/exceptions.rst:226 +#: c-api/exceptions.rst:239 msgid "" "Similar to :c:func:`PyErr_SetFromWindowsErr`, with an additional parameter " "specifying the exception type to be raised." msgstr "" -#: c-api/exceptions.rst:234 +#: c-api/exceptions.rst:247 msgid "" "Similar to :c:func:`PyErr_SetFromWindowsErr`, with the additional behavior " "that if *filename* is not ``NULL``, it is decoded from the filesystem " @@ -272,7 +281,7 @@ msgid "" "attribute of the exception instance." msgstr "" -#: c-api/exceptions.rst:245 +#: c-api/exceptions.rst:258 msgid "" "Similar to :c:func:`PyErr_SetExcFromWindowsErr`, with the additional " "behavior that if *filename* is not ``NULL``, it is passed to the constructor " @@ -280,19 +289,19 @@ msgid "" "filename` attribute of the exception instance." msgstr "" -#: c-api/exceptions.rst:255 +#: c-api/exceptions.rst:268 msgid "" "Similar to :c:func:`PyErr_SetExcFromWindowsErrWithFilenameObject`, but " "accepts a second filename object." msgstr "" -#: c-api/exceptions.rst:265 +#: c-api/exceptions.rst:278 msgid "" "Similar to :c:func:`PyErr_SetFromWindowsErrWithFilename`, with an additional " "parameter specifying the exception type to be raised." msgstr "" -#: c-api/exceptions.rst:273 +#: c-api/exceptions.rst:286 msgid "" "This is a convenience function to raise :exc:`ImportError`. *msg* will be " "set as the exception's message string. *name* and *path*, both of which can " @@ -300,13 +309,13 @@ msgid "" "``path`` attributes." msgstr "" -#: c-api/exceptions.rst:283 +#: c-api/exceptions.rst:296 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:291 +#: c-api/exceptions.rst:304 msgid "" "Set file, line, and offset information for the current exception. If the " "current exception is not a :exc:`SyntaxError`, then it sets additional " @@ -314,19 +323,19 @@ msgid "" "is a :exc:`SyntaxError`." msgstr "" -#: c-api/exceptions.rst:301 +#: c-api/exceptions.rst:314 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:309 +#: c-api/exceptions.rst:322 msgid "" "Like :c:func:`PyErr_SyntaxLocationEx`, but the *col_offset* parameter is " "omitted." msgstr "" -#: c-api/exceptions.rst:315 +#: c-api/exceptions.rst:328 msgid "" "This is a shorthand for ``PyErr_SetString(PyExc_SystemError, message)``, " "where *message* indicates that an internal operation (e.g. a Python/C API " @@ -334,11 +343,11 @@ msgid "" "use." msgstr "" -#: c-api/exceptions.rst:322 +#: c-api/exceptions.rst:335 msgid "Issuing warnings" msgstr "" -#: c-api/exceptions.rst:324 +#: c-api/exceptions.rst:337 msgid "" "Use these functions to issue warnings from C code. They mirror similar " "functions exported by the Python :mod:`warnings` module. They normally " @@ -354,7 +363,7 @@ msgid "" "return an error value)." msgstr "" -#: c-api/exceptions.rst:339 +#: c-api/exceptions.rst:352 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. " @@ -364,7 +373,7 @@ msgid "" "`PyErr_WarnEx`, 2 is the function above that, and so forth." msgstr "" -#: c-api/exceptions.rst:346 +#: c-api/exceptions.rst:359 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 " @@ -373,14 +382,14 @@ msgid "" "enumerated at :ref:`standardwarningcategories`." msgstr "" -#: c-api/exceptions.rst:352 +#: c-api/exceptions.rst:365 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:359 +#: c-api/exceptions.rst:372 msgid "" "Issue a warning message with explicit control over all warning attributes. " "This is a straightforward wrapper around the Python function :func:`warnings." @@ -388,32 +397,32 @@ msgid "" "arguments may be set to ``NULL`` to get the default effect described there." msgstr "" -#: c-api/exceptions.rst:370 +#: c-api/exceptions.rst:383 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:377 +#: c-api/exceptions.rst:390 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:386 +#: c-api/exceptions.rst:399 msgid "" "Function similar to :c:func:`PyErr_WarnFormat`, but *category* is :exc:" "`ResourceWarning` and it passes *source* to :class:`!warnings." "WarningMessage`." msgstr "" -#: c-api/exceptions.rst:393 +#: c-api/exceptions.rst:406 msgid "Querying the error indicator" msgstr "" -#: c-api/exceptions.rst:397 +#: c-api/exceptions.rst:410 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 ``PyErr_Set*`` " @@ -422,11 +431,11 @@ msgid "" "`Py_DECREF` it." msgstr "" -#: c-api/exceptions.rst:403 +#: c-api/exceptions.rst:416 msgid "The caller must hold the GIL." msgstr "" -#: c-api/exceptions.rst:407 +#: c-api/exceptions.rst:420 msgid "" "Do not compare the return value to a specific exception; use :c:func:" "`PyErr_ExceptionMatches` instead, shown below. (The comparison could easily " @@ -434,14 +443,14 @@ msgid "" "of a class exception, or it may be a subclass of the expected exception.)" msgstr "" -#: c-api/exceptions.rst:415 +#: c-api/exceptions.rst:428 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:422 +#: c-api/exceptions.rst:435 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 " @@ -449,23 +458,23 @@ msgid "" "tuple (and recursively in subtuples) are searched for a match." msgstr "" -#: c-api/exceptions.rst:430 +#: c-api/exceptions.rst:443 msgid "" "Return the exception currently being raised, clearing the error indicator at " "the same time. Return ``NULL`` if the error indicator is not set." msgstr "" -#: c-api/exceptions.rst:433 +#: c-api/exceptions.rst:446 msgid "" "This function is used by code that needs to catch exceptions, or code that " "needs to save and restore the error indicator temporarily." msgstr "" -#: c-api/exceptions.rst:480 +#: c-api/exceptions.rst:493 msgid "For example::" msgstr "" -#: c-api/exceptions.rst:438 +#: c-api/exceptions.rst:451 msgid "" "{\n" " PyObject *exc = PyErr_GetRaisedException();\n" @@ -476,27 +485,27 @@ msgid "" "}" msgstr "" -#: c-api/exceptions.rst:446 +#: c-api/exceptions.rst:459 msgid "" ":c:func:`PyErr_GetHandledException`, to save the exception currently being " "handled." msgstr "" -#: c-api/exceptions.rst:454 +#: c-api/exceptions.rst:467 msgid "" "Set *exc* as the exception currently being raised, clearing the existing " "exception if one is set." msgstr "" -#: c-api/exceptions.rst:459 +#: c-api/exceptions.rst:472 msgid "This call steals a reference to *exc*, which must be a valid exception." msgstr "" -#: c-api/exceptions.rst:468 +#: c-api/exceptions.rst:481 msgid "Use :c:func:`PyErr_GetRaisedException` instead." msgstr "" -#: c-api/exceptions.rst:470 +#: c-api/exceptions.rst:483 msgid "" "Retrieve the error indicator into three variables whose addresses are " "passed. If the error indicator is not set, set all three variables to " @@ -505,13 +514,13 @@ msgid "" "the type object is not." msgstr "" -#: c-api/exceptions.rst:477 +#: c-api/exceptions.rst:490 msgid "" "This function is normally only used by legacy code that needs to catch " "exceptions or save and restore the error indicator temporarily." msgstr "" -#: c-api/exceptions.rst:482 +#: c-api/exceptions.rst:495 msgid "" "{\n" " PyObject *type, *value, *traceback;\n" @@ -523,11 +532,11 @@ msgid "" "}" msgstr "" -#: c-api/exceptions.rst:496 +#: c-api/exceptions.rst:509 msgid "Use :c:func:`PyErr_SetRaisedException` instead." msgstr "" -#: c-api/exceptions.rst:498 +#: c-api/exceptions.rst:511 msgid "" "Set the error indicator from the three objects, *type*, *value*, and " "*traceback*, clearing the existing exception if one is set. If the objects " @@ -540,20 +549,20 @@ msgid "" "don't use this function. I warned you.)" msgstr "" -#: c-api/exceptions.rst:512 +#: c-api/exceptions.rst:525 msgid "" "This function is normally only used by legacy 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:521 +#: c-api/exceptions.rst:534 msgid "" "Use :c:func:`PyErr_GetRaisedException` instead, to avoid any possible de-" "normalization." msgstr "" -#: c-api/exceptions.rst:524 +#: c-api/exceptions.rst:537 msgid "" "Under certain circumstances, the values returned by :c:func:`PyErr_Fetch` " "below can be \"unnormalized\", meaning that ``*exc`` is a class object but " @@ -563,21 +572,21 @@ msgid "" "improve performance." msgstr "" -#: c-api/exceptions.rst:532 +#: c-api/exceptions.rst:545 msgid "" "This function *does not* implicitly set the :attr:`~BaseException." "__traceback__` attribute on the exception value. If setting the traceback " "appropriately is desired, the following additional snippet is needed::" msgstr "" -#: c-api/exceptions.rst:537 +#: c-api/exceptions.rst:550 msgid "" "if (tb != NULL) {\n" " PyException_SetTraceback(val, tb);\n" "}" msgstr "" -#: c-api/exceptions.rst:544 +#: c-api/exceptions.rst:557 msgid "" "Retrieve the active exception instance, as would be returned by :func:`sys." "exception`. This refers to an exception that was *already caught*, not to an " @@ -585,7 +594,7 @@ msgid "" "or ``NULL``. Does not modify the interpreter's exception state." msgstr "" -#: c-api/exceptions.rst:551 +#: c-api/exceptions.rst:564 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 " @@ -593,14 +602,14 @@ msgid "" "clear the exception state." msgstr "" -#: c-api/exceptions.rst:560 +#: c-api/exceptions.rst:573 msgid "" "Set the active exception, as known from ``sys.exception()``. This refers to " "an exception that was *already caught*, not to an exception that was freshly " "raised. To clear the exception state, pass ``NULL``." msgstr "" -#: c-api/exceptions.rst:567 +#: c-api/exceptions.rst:580 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 " @@ -608,7 +617,7 @@ msgid "" "exception state." msgstr "" -#: c-api/exceptions.rst:576 +#: c-api/exceptions.rst:589 msgid "" "Retrieve the old-style representation of the exception info, as known from :" "func:`sys.exc_info`. This refers to an exception that was *already caught*, " @@ -618,7 +627,7 @@ msgid "" "using :c:func:`PyErr_GetHandledException`." msgstr "" -#: c-api/exceptions.rst:585 +#: c-api/exceptions.rst:598 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 " @@ -626,7 +635,7 @@ msgid "" "exception state." msgstr "" -#: c-api/exceptions.rst:595 +#: c-api/exceptions.rst:608 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 " @@ -636,7 +645,7 @@ msgid "" "`PyErr_SetHandledException`." msgstr "" -#: c-api/exceptions.rst:604 +#: c-api/exceptions.rst:617 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 " @@ -644,22 +653,22 @@ msgid "" "state." msgstr "" -#: c-api/exceptions.rst:611 +#: c-api/exceptions.rst:624 msgid "" "The ``type`` and ``traceback`` arguments are no longer used and can be NULL. " "The interpreter now derives them from the exception instance (the ``value`` " "argument). The function still steals references of all three arguments." msgstr "" -#: c-api/exceptions.rst:619 +#: c-api/exceptions.rst:632 msgid "Signal Handling" msgstr "" -#: c-api/exceptions.rst:629 +#: c-api/exceptions.rst:642 msgid "This function interacts with Python's signal handling." msgstr "" -#: c-api/exceptions.rst:631 +#: c-api/exceptions.rst:644 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 " @@ -667,7 +676,7 @@ msgid "" "module is supported, this can invoke a signal handler written in Python." msgstr "" -#: c-api/exceptions.rst:636 +#: c-api/exceptions.rst:649 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 " @@ -676,44 +685,44 @@ msgid "" "`PyErr_CheckSignals()` invocation)." msgstr "" -#: c-api/exceptions.rst:642 +#: c-api/exceptions.rst:655 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:645 +#: c-api/exceptions.rst:658 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:649 +#: c-api/exceptions.rst:662 msgid "" "The default Python signal handler for :c:macro:`!SIGINT` raises the :exc:" "`KeyboardInterrupt` exception." msgstr "" -#: c-api/exceptions.rst:660 +#: c-api/exceptions.rst:673 msgid "" "Simulate the effect of a :c:macro:`!SIGINT` signal arriving. This is " "equivalent to ``PyErr_SetInterruptEx(SIGINT)``." msgstr "" -#: c-api/exceptions.rst:691 +#: c-api/exceptions.rst:704 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:674 +#: c-api/exceptions.rst:687 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:678 +#: c-api/exceptions.rst:691 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 " @@ -721,27 +730,27 @@ msgid "" "interrupt an operation)." msgstr "" -#: c-api/exceptions.rst:683 +#: c-api/exceptions.rst:696 msgid "" "If the given signal isn't handled by Python (it was set to :py:const:`signal." "SIG_DFL` or :py:const:`signal.SIG_IGN`), it will be ignored." msgstr "" -#: c-api/exceptions.rst:686 +#: c-api/exceptions.rst:699 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:699 +#: c-api/exceptions.rst:712 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:703 +#: c-api/exceptions.rst:716 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 " @@ -749,15 +758,15 @@ msgid "" "be called from the main thread." msgstr "" -#: c-api/exceptions.rst:708 +#: c-api/exceptions.rst:721 msgid "On Windows, the function now also supports socket handles." msgstr "" -#: c-api/exceptions.rst:713 +#: c-api/exceptions.rst:726 msgid "Exception Classes" msgstr "" -#: c-api/exceptions.rst:717 +#: c-api/exceptions.rst:730 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 " @@ -766,7 +775,7 @@ msgid "" "(accessible in C as :c:data:`PyExc_Exception`)." msgstr "" -#: c-api/exceptions.rst:723 +#: c-api/exceptions.rst:736 msgid "" "The :attr:`~type.__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 " @@ -776,31 +785,31 @@ msgid "" "variables and methods." msgstr "" -#: c-api/exceptions.rst:732 +#: c-api/exceptions.rst:745 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:740 +#: c-api/exceptions.rst:753 msgid "Exception Objects" msgstr "" -#: c-api/exceptions.rst:744 +#: c-api/exceptions.rst:757 msgid "" "Return the traceback associated with the exception as a new reference, as " "accessible from Python through the :attr:`~BaseException.__traceback__` " "attribute. If there is no traceback associated, this returns ``NULL``." msgstr "" -#: c-api/exceptions.rst:752 +#: c-api/exceptions.rst:765 msgid "" "Set the traceback associated with the exception to *tb*. Use ``Py_None`` to " "clear it." msgstr "" -#: c-api/exceptions.rst:758 +#: c-api/exceptions.rst:771 msgid "" "Return the context (another exception instance during whose handling *ex* " "was raised) associated with the exception as a new reference, as accessible " @@ -808,14 +817,14 @@ msgid "" "there is no context associated, this returns ``NULL``." msgstr "" -#: c-api/exceptions.rst:766 +#: c-api/exceptions.rst:779 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:773 +#: c-api/exceptions.rst:786 msgid "" "Return the cause (either an exception instance, or ``None``, set by " "``raise ... from ...``) associated with the exception as a new reference, as " @@ -823,28 +832,28 @@ msgid "" "attribute." msgstr "" -#: c-api/exceptions.rst:781 +#: c-api/exceptions.rst:794 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 ``None``. This steals a reference to *cause*." msgstr "" -#: c-api/exceptions.rst:785 +#: c-api/exceptions.rst:798 msgid "" "The :attr:`~BaseException.__suppress_context__` attribute is implicitly set " "to ``True`` by this function." msgstr "" -#: c-api/exceptions.rst:791 +#: c-api/exceptions.rst:804 msgid "Return :attr:`~BaseException.args` of exception *ex*." msgstr "" -#: c-api/exceptions.rst:796 +#: c-api/exceptions.rst:809 msgid "Set :attr:`~BaseException.args` of exception *ex* to *args*." msgstr "" -#: c-api/exceptions.rst:800 +#: c-api/exceptions.rst:813 msgid "" "Implement part of the interpreter's implementation of :keyword:`!except*`. " "*orig* is the original exception that was caught, and *excs* is the list of " @@ -856,72 +865,72 @@ msgid "" "if there is nothing to reraise." msgstr "" -#: c-api/exceptions.rst:814 +#: c-api/exceptions.rst:827 msgid "Unicode Exception Objects" msgstr "" -#: c-api/exceptions.rst:816 +#: c-api/exceptions.rst:829 msgid "" "The following functions are used to create and modify Unicode exceptions " "from C." msgstr "" -#: c-api/exceptions.rst:820 +#: c-api/exceptions.rst:833 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:827 +#: c-api/exceptions.rst:840 msgid "Return the *encoding* attribute of the given exception object." msgstr "" -#: c-api/exceptions.rst:833 +#: c-api/exceptions.rst:846 msgid "Return the *object* attribute of the given exception object." msgstr "" -#: c-api/exceptions.rst:839 +#: c-api/exceptions.rst:852 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:847 +#: c-api/exceptions.rst:860 msgid "" "Set the *start* attribute of the given exception object to *start*. Return " "``0`` on success, ``-1`` on failure." msgstr "" -#: c-api/exceptions.rst:854 +#: c-api/exceptions.rst:867 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:862 +#: c-api/exceptions.rst:875 msgid "" "Set the *end* attribute of the given exception object to *end*. Return " "``0`` on success, ``-1`` on failure." msgstr "" -#: c-api/exceptions.rst:869 +#: c-api/exceptions.rst:882 msgid "Return the *reason* attribute of the given exception object." msgstr "" -#: c-api/exceptions.rst:875 +#: c-api/exceptions.rst:888 msgid "" "Set the *reason* attribute of the given exception object to *reason*. " "Return ``0`` on success, ``-1`` on failure." msgstr "" -#: c-api/exceptions.rst:882 +#: c-api/exceptions.rst:895 msgid "Recursion Control" msgstr "" -#: c-api/exceptions.rst:884 +#: c-api/exceptions.rst:897 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 " @@ -931,44 +940,44 @@ msgid "" "recursion handling." msgstr "" -#: c-api/exceptions.rst:893 +#: c-api/exceptions.rst:906 msgid "Marks a point where a recursive C-level call is about to be performed." msgstr "" -#: c-api/exceptions.rst:895 +#: c-api/exceptions.rst:908 msgid "" "If :c:macro:`!USE_STACKCHECK` is defined, this function checks if the OS " "stack overflowed using :c:func:`PyOS_CheckStack`. If this is the case, it " "sets a :exc:`MemoryError` and returns a nonzero value." msgstr "" -#: c-api/exceptions.rst:899 +#: c-api/exceptions.rst:912 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:903 +#: c-api/exceptions.rst:916 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:915 +#: c-api/exceptions.rst:928 msgid "" "This function is now also available in the :ref:`limited API `." msgstr "" -#: c-api/exceptions.rst:912 +#: c-api/exceptions.rst:925 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:918 +#: c-api/exceptions.rst:931 msgid "" "Properly implementing :c:member:`~PyTypeObject.tp_repr` for container types " "requires special recursion handling. In addition to protecting the stack, :" @@ -977,13 +986,13 @@ msgid "" "Effectively, these are the C equivalent to :func:`reprlib.recursive_repr`." msgstr "" -#: c-api/exceptions.rst:926 +#: c-api/exceptions.rst:939 msgid "" "Called at the beginning of the :c:member:`~PyTypeObject.tp_repr` " "implementation to detect cycles." msgstr "" -#: c-api/exceptions.rst:929 +#: c-api/exceptions.rst:942 msgid "" "If the object has already been processed, the function returns a positive " "integer. In that case the :c:member:`~PyTypeObject.tp_repr` implementation " @@ -991,30 +1000,30 @@ msgid "" "`dict` objects return ``{...}`` and :class:`list` objects return ``[...]``." msgstr "" -#: c-api/exceptions.rst:935 +#: c-api/exceptions.rst:948 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:939 +#: c-api/exceptions.rst:952 msgid "" "Otherwise, the function returns zero and the :c:member:`~PyTypeObject." "tp_repr` implementation can continue normally." msgstr "" -#: c-api/exceptions.rst:944 +#: c-api/exceptions.rst:957 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:951 +#: c-api/exceptions.rst:964 msgid "Standard Exceptions" msgstr "" -#: c-api/exceptions.rst:953 +#: c-api/exceptions.rst:966 msgid "" "All standard Python exceptions are available as global variables whose names " "are ``PyExc_`` followed by the Python exception name. These have the type :" @@ -1022,448 +1031,456 @@ msgid "" "all the variables:" msgstr "" -#: c-api/exceptions.rst:1147 c-api/exceptions.rst:1192 +#: c-api/exceptions.rst:1163 c-api/exceptions.rst:1208 msgid "C Name" msgstr "" -#: c-api/exceptions.rst:1192 +#: c-api/exceptions.rst:1208 msgid "Python Name" msgstr "" -#: c-api/exceptions.rst:1147 c-api/exceptions.rst:1192 +#: c-api/exceptions.rst:1163 c-api/exceptions.rst:1208 msgid "Notes" msgstr "" -#: c-api/exceptions.rst:1016 +#: c-api/exceptions.rst:1030 msgid ":c:data:`PyExc_BaseException`" msgstr "" -#: c-api/exceptions.rst:1016 +#: c-api/exceptions.rst:1030 msgid ":exc:`BaseException`" msgstr "" -#: c-api/exceptions.rst:1018 c-api/exceptions.rst:1066 -#: c-api/exceptions.rst:1078 +#: c-api/exceptions.rst:1032 c-api/exceptions.rst:1080 +#: c-api/exceptions.rst:1092 msgid "[1]_" msgstr "" -#: c-api/exceptions.rst:1018 +#: c-api/exceptions.rst:1032 msgid ":c:data:`PyExc_Exception`" msgstr "" -#: c-api/exceptions.rst:1018 +#: c-api/exceptions.rst:1032 msgid ":exc:`Exception`" msgstr "" -#: c-api/exceptions.rst:1020 +#: c-api/exceptions.rst:1034 msgid ":c:data:`PyExc_ArithmeticError`" msgstr "" -#: c-api/exceptions.rst:1020 +#: c-api/exceptions.rst:1034 msgid ":exc:`ArithmeticError`" msgstr "" -#: c-api/exceptions.rst:1022 +#: c-api/exceptions.rst:1036 msgid ":c:data:`PyExc_AssertionError`" msgstr "" -#: c-api/exceptions.rst:1022 +#: c-api/exceptions.rst:1036 msgid ":exc:`AssertionError`" msgstr "" -#: c-api/exceptions.rst:1024 +#: c-api/exceptions.rst:1038 msgid ":c:data:`PyExc_AttributeError`" msgstr "" -#: c-api/exceptions.rst:1024 +#: c-api/exceptions.rst:1038 msgid ":exc:`AttributeError`" msgstr "" -#: c-api/exceptions.rst:1026 +#: c-api/exceptions.rst:1040 msgid ":c:data:`PyExc_BlockingIOError`" msgstr "" -#: c-api/exceptions.rst:1026 +#: c-api/exceptions.rst:1040 msgid ":exc:`BlockingIOError`" msgstr "" -#: c-api/exceptions.rst:1028 +#: c-api/exceptions.rst:1042 msgid ":c:data:`PyExc_BrokenPipeError`" msgstr "" -#: c-api/exceptions.rst:1028 +#: c-api/exceptions.rst:1042 msgid ":exc:`BrokenPipeError`" msgstr "" -#: c-api/exceptions.rst:1030 +#: c-api/exceptions.rst:1044 msgid ":c:data:`PyExc_BufferError`" msgstr "" -#: c-api/exceptions.rst:1030 +#: c-api/exceptions.rst:1044 msgid ":exc:`BufferError`" msgstr "" -#: c-api/exceptions.rst:1032 +#: c-api/exceptions.rst:1046 msgid ":c:data:`PyExc_ChildProcessError`" msgstr "" -#: c-api/exceptions.rst:1032 +#: c-api/exceptions.rst:1046 msgid ":exc:`ChildProcessError`" msgstr "" -#: c-api/exceptions.rst:1034 +#: c-api/exceptions.rst:1048 msgid ":c:data:`PyExc_ConnectionAbortedError`" msgstr "" -#: c-api/exceptions.rst:1034 +#: c-api/exceptions.rst:1048 msgid ":exc:`ConnectionAbortedError`" msgstr "" -#: c-api/exceptions.rst:1036 +#: c-api/exceptions.rst:1050 msgid ":c:data:`PyExc_ConnectionError`" msgstr "" -#: c-api/exceptions.rst:1036 +#: c-api/exceptions.rst:1050 msgid ":exc:`ConnectionError`" msgstr "" -#: c-api/exceptions.rst:1038 +#: c-api/exceptions.rst:1052 msgid ":c:data:`PyExc_ConnectionRefusedError`" msgstr "" -#: c-api/exceptions.rst:1038 +#: c-api/exceptions.rst:1052 msgid ":exc:`ConnectionRefusedError`" msgstr "" -#: c-api/exceptions.rst:1040 +#: c-api/exceptions.rst:1054 msgid ":c:data:`PyExc_ConnectionResetError`" msgstr "" -#: c-api/exceptions.rst:1040 +#: c-api/exceptions.rst:1054 msgid ":exc:`ConnectionResetError`" msgstr "" -#: c-api/exceptions.rst:1042 +#: c-api/exceptions.rst:1056 msgid ":c:data:`PyExc_EOFError`" msgstr "" -#: c-api/exceptions.rst:1042 +#: c-api/exceptions.rst:1056 msgid ":exc:`EOFError`" msgstr "" -#: c-api/exceptions.rst:1044 +#: c-api/exceptions.rst:1058 msgid ":c:data:`PyExc_FileExistsError`" msgstr "" -#: c-api/exceptions.rst:1044 +#: c-api/exceptions.rst:1058 msgid ":exc:`FileExistsError`" msgstr "" -#: c-api/exceptions.rst:1046 +#: c-api/exceptions.rst:1060 msgid ":c:data:`PyExc_FileNotFoundError`" msgstr "" -#: c-api/exceptions.rst:1046 +#: c-api/exceptions.rst:1060 msgid ":exc:`FileNotFoundError`" msgstr "" -#: c-api/exceptions.rst:1048 +#: c-api/exceptions.rst:1062 msgid ":c:data:`PyExc_FloatingPointError`" msgstr "" -#: c-api/exceptions.rst:1048 +#: c-api/exceptions.rst:1062 msgid ":exc:`FloatingPointError`" msgstr "" -#: c-api/exceptions.rst:1050 +#: c-api/exceptions.rst:1064 msgid ":c:data:`PyExc_GeneratorExit`" msgstr "" -#: c-api/exceptions.rst:1050 +#: c-api/exceptions.rst:1064 msgid ":exc:`GeneratorExit`" msgstr "" -#: c-api/exceptions.rst:1052 +#: c-api/exceptions.rst:1066 msgid ":c:data:`PyExc_ImportError`" msgstr "" -#: c-api/exceptions.rst:1052 +#: c-api/exceptions.rst:1066 msgid ":exc:`ImportError`" msgstr "" -#: c-api/exceptions.rst:1054 +#: c-api/exceptions.rst:1068 msgid ":c:data:`PyExc_IndentationError`" msgstr "" -#: c-api/exceptions.rst:1054 +#: c-api/exceptions.rst:1068 msgid ":exc:`IndentationError`" msgstr "" -#: c-api/exceptions.rst:1056 +#: c-api/exceptions.rst:1070 msgid ":c:data:`PyExc_IndexError`" msgstr "" -#: c-api/exceptions.rst:1056 +#: c-api/exceptions.rst:1070 msgid ":exc:`IndexError`" msgstr "" -#: c-api/exceptions.rst:1058 +#: c-api/exceptions.rst:1072 msgid ":c:data:`PyExc_InterruptedError`" msgstr "" -#: c-api/exceptions.rst:1058 +#: c-api/exceptions.rst:1072 msgid ":exc:`InterruptedError`" msgstr "" -#: c-api/exceptions.rst:1060 +#: c-api/exceptions.rst:1074 msgid ":c:data:`PyExc_IsADirectoryError`" msgstr "" -#: c-api/exceptions.rst:1060 +#: c-api/exceptions.rst:1074 msgid ":exc:`IsADirectoryError`" msgstr "" -#: c-api/exceptions.rst:1062 +#: c-api/exceptions.rst:1076 msgid ":c:data:`PyExc_KeyError`" msgstr "" -#: c-api/exceptions.rst:1062 +#: c-api/exceptions.rst:1076 msgid ":exc:`KeyError`" msgstr "" -#: c-api/exceptions.rst:1064 +#: c-api/exceptions.rst:1078 msgid ":c:data:`PyExc_KeyboardInterrupt`" msgstr "" -#: c-api/exceptions.rst:1064 +#: c-api/exceptions.rst:1078 msgid ":exc:`KeyboardInterrupt`" msgstr "" -#: c-api/exceptions.rst:1066 +#: c-api/exceptions.rst:1080 msgid ":c:data:`PyExc_LookupError`" msgstr "" -#: c-api/exceptions.rst:1066 +#: c-api/exceptions.rst:1080 msgid ":exc:`LookupError`" msgstr "" -#: c-api/exceptions.rst:1068 +#: c-api/exceptions.rst:1082 msgid ":c:data:`PyExc_MemoryError`" msgstr "" -#: c-api/exceptions.rst:1068 +#: c-api/exceptions.rst:1082 msgid ":exc:`MemoryError`" msgstr "" -#: c-api/exceptions.rst:1070 +#: c-api/exceptions.rst:1084 msgid ":c:data:`PyExc_ModuleNotFoundError`" msgstr "" -#: c-api/exceptions.rst:1070 +#: c-api/exceptions.rst:1084 msgid ":exc:`ModuleNotFoundError`" msgstr "" -#: c-api/exceptions.rst:1072 +#: c-api/exceptions.rst:1086 msgid ":c:data:`PyExc_NameError`" msgstr "" -#: c-api/exceptions.rst:1072 +#: c-api/exceptions.rst:1086 msgid ":exc:`NameError`" msgstr "" -#: c-api/exceptions.rst:1074 +#: c-api/exceptions.rst:1088 msgid ":c:data:`PyExc_NotADirectoryError`" msgstr "" -#: c-api/exceptions.rst:1074 +#: c-api/exceptions.rst:1088 msgid ":exc:`NotADirectoryError`" msgstr "" -#: c-api/exceptions.rst:1076 +#: c-api/exceptions.rst:1090 msgid ":c:data:`PyExc_NotImplementedError`" msgstr "" -#: c-api/exceptions.rst:1076 +#: c-api/exceptions.rst:1090 msgid ":exc:`NotImplementedError`" msgstr "" -#: c-api/exceptions.rst:1078 +#: c-api/exceptions.rst:1092 msgid ":c:data:`PyExc_OSError`" msgstr "" -#: c-api/exceptions.rst:1078 +#: c-api/exceptions.rst:1092 msgid ":exc:`OSError`" msgstr "" -#: c-api/exceptions.rst:1080 +#: c-api/exceptions.rst:1094 msgid ":c:data:`PyExc_OverflowError`" msgstr "" -#: c-api/exceptions.rst:1080 +#: c-api/exceptions.rst:1094 msgid ":exc:`OverflowError`" msgstr "" -#: c-api/exceptions.rst:1082 +#: c-api/exceptions.rst:1096 msgid ":c:data:`PyExc_PermissionError`" msgstr "" -#: c-api/exceptions.rst:1082 +#: c-api/exceptions.rst:1096 msgid ":exc:`PermissionError`" msgstr "" -#: c-api/exceptions.rst:1084 +#: c-api/exceptions.rst:1098 msgid ":c:data:`PyExc_ProcessLookupError`" msgstr "" -#: c-api/exceptions.rst:1084 +#: c-api/exceptions.rst:1098 msgid ":exc:`ProcessLookupError`" msgstr "" -#: c-api/exceptions.rst:1086 +#: c-api/exceptions.rst:1100 +msgid ":c:data:`PyExc_PythonFinalizationError`" +msgstr "" + +#: c-api/exceptions.rst:1100 +msgid ":exc:`PythonFinalizationError`" +msgstr "" + +#: c-api/exceptions.rst:1102 msgid ":c:data:`PyExc_RecursionError`" msgstr "" -#: c-api/exceptions.rst:1086 +#: c-api/exceptions.rst:1102 msgid ":exc:`RecursionError`" msgstr "" -#: c-api/exceptions.rst:1088 +#: c-api/exceptions.rst:1104 msgid ":c:data:`PyExc_ReferenceError`" msgstr "" -#: c-api/exceptions.rst:1088 +#: c-api/exceptions.rst:1104 msgid ":exc:`ReferenceError`" msgstr "" -#: c-api/exceptions.rst:1090 +#: c-api/exceptions.rst:1106 msgid ":c:data:`PyExc_RuntimeError`" msgstr "" -#: c-api/exceptions.rst:1090 +#: c-api/exceptions.rst:1106 msgid ":exc:`RuntimeError`" msgstr "" -#: c-api/exceptions.rst:1092 +#: c-api/exceptions.rst:1108 msgid ":c:data:`PyExc_StopAsyncIteration`" msgstr "" -#: c-api/exceptions.rst:1092 +#: c-api/exceptions.rst:1108 msgid ":exc:`StopAsyncIteration`" msgstr "" -#: c-api/exceptions.rst:1094 +#: c-api/exceptions.rst:1110 msgid ":c:data:`PyExc_StopIteration`" msgstr "" -#: c-api/exceptions.rst:1094 +#: c-api/exceptions.rst:1110 msgid ":exc:`StopIteration`" msgstr "" -#: c-api/exceptions.rst:1096 +#: c-api/exceptions.rst:1112 msgid ":c:data:`PyExc_SyntaxError`" msgstr "" -#: c-api/exceptions.rst:1096 +#: c-api/exceptions.rst:1112 msgid ":exc:`SyntaxError`" msgstr "" -#: c-api/exceptions.rst:1098 +#: c-api/exceptions.rst:1114 msgid ":c:data:`PyExc_SystemError`" msgstr "" -#: c-api/exceptions.rst:1098 +#: c-api/exceptions.rst:1114 msgid ":exc:`SystemError`" msgstr "" -#: c-api/exceptions.rst:1100 +#: c-api/exceptions.rst:1116 msgid ":c:data:`PyExc_SystemExit`" msgstr "" -#: c-api/exceptions.rst:1100 +#: c-api/exceptions.rst:1116 msgid ":exc:`SystemExit`" msgstr "" -#: c-api/exceptions.rst:1102 +#: c-api/exceptions.rst:1118 msgid ":c:data:`PyExc_TabError`" msgstr "" -#: c-api/exceptions.rst:1102 +#: c-api/exceptions.rst:1118 msgid ":exc:`TabError`" msgstr "" -#: c-api/exceptions.rst:1104 +#: c-api/exceptions.rst:1120 msgid ":c:data:`PyExc_TimeoutError`" msgstr "" -#: c-api/exceptions.rst:1104 +#: c-api/exceptions.rst:1120 msgid ":exc:`TimeoutError`" msgstr "" -#: c-api/exceptions.rst:1106 +#: c-api/exceptions.rst:1122 msgid ":c:data:`PyExc_TypeError`" msgstr "" -#: c-api/exceptions.rst:1106 +#: c-api/exceptions.rst:1122 msgid ":exc:`TypeError`" msgstr "" -#: c-api/exceptions.rst:1108 +#: c-api/exceptions.rst:1124 msgid ":c:data:`PyExc_UnboundLocalError`" msgstr "" -#: c-api/exceptions.rst:1108 +#: c-api/exceptions.rst:1124 msgid ":exc:`UnboundLocalError`" msgstr "" -#: c-api/exceptions.rst:1110 +#: c-api/exceptions.rst:1126 msgid ":c:data:`PyExc_UnicodeDecodeError`" msgstr "" -#: c-api/exceptions.rst:1110 +#: c-api/exceptions.rst:1126 msgid ":exc:`UnicodeDecodeError`" msgstr "" -#: c-api/exceptions.rst:1112 +#: c-api/exceptions.rst:1128 msgid ":c:data:`PyExc_UnicodeEncodeError`" msgstr "" -#: c-api/exceptions.rst:1112 +#: c-api/exceptions.rst:1128 msgid ":exc:`UnicodeEncodeError`" msgstr "" -#: c-api/exceptions.rst:1114 +#: c-api/exceptions.rst:1130 msgid ":c:data:`PyExc_UnicodeError`" msgstr "" -#: c-api/exceptions.rst:1114 +#: c-api/exceptions.rst:1130 msgid ":exc:`UnicodeError`" msgstr "" -#: c-api/exceptions.rst:1116 +#: c-api/exceptions.rst:1132 msgid ":c:data:`PyExc_UnicodeTranslateError`" msgstr "" -#: c-api/exceptions.rst:1116 +#: c-api/exceptions.rst:1132 msgid ":exc:`UnicodeTranslateError`" msgstr "" -#: c-api/exceptions.rst:1118 +#: c-api/exceptions.rst:1134 msgid ":c:data:`PyExc_ValueError`" msgstr "" -#: c-api/exceptions.rst:1118 +#: c-api/exceptions.rst:1134 msgid ":exc:`ValueError`" msgstr "" -#: c-api/exceptions.rst:1120 +#: c-api/exceptions.rst:1136 msgid ":c:data:`PyExc_ZeroDivisionError`" msgstr "" -#: c-api/exceptions.rst:1120 +#: c-api/exceptions.rst:1136 msgid ":exc:`ZeroDivisionError`" msgstr "" -#: c-api/exceptions.rst:1123 +#: c-api/exceptions.rst:1139 msgid "" ":c:data:`PyExc_BlockingIOError`, :c:data:`PyExc_BrokenPipeError`, :c:data:" "`PyExc_ChildProcessError`, :c:data:`PyExc_ConnectionError`, :c:data:" @@ -1475,57 +1492,57 @@ msgid "" "`PyExc_TimeoutError` were introduced following :pep:`3151`." msgstr "" -#: c-api/exceptions.rst:1133 +#: c-api/exceptions.rst:1149 msgid ":c:data:`PyExc_StopAsyncIteration` and :c:data:`PyExc_RecursionError`." msgstr "" -#: c-api/exceptions.rst:1136 +#: c-api/exceptions.rst:1152 msgid ":c:data:`PyExc_ModuleNotFoundError`." msgstr "" -#: c-api/exceptions.rst:1139 +#: c-api/exceptions.rst:1155 msgid "These are compatibility aliases to :c:data:`PyExc_OSError`:" msgstr "" -#: c-api/exceptions.rst:1149 +#: c-api/exceptions.rst:1165 msgid ":c:data:`!PyExc_EnvironmentError`" msgstr "" -#: c-api/exceptions.rst:1151 +#: c-api/exceptions.rst:1167 msgid ":c:data:`!PyExc_IOError`" msgstr "" -#: c-api/exceptions.rst:1153 +#: c-api/exceptions.rst:1169 msgid ":c:data:`!PyExc_WindowsError`" msgstr "" -#: c-api/exceptions.rst:1153 +#: c-api/exceptions.rst:1169 msgid "[2]_" msgstr "" -#: c-api/exceptions.rst:1156 +#: c-api/exceptions.rst:1172 msgid "These aliases used to be separate exception types." msgstr "" -#: c-api/exceptions.rst:1220 +#: c-api/exceptions.rst:1236 msgid "Notes:" msgstr "" -#: c-api/exceptions.rst:1162 +#: c-api/exceptions.rst:1178 msgid "This is a base class for other standard exceptions." msgstr "" -#: c-api/exceptions.rst:1165 +#: c-api/exceptions.rst:1181 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:1171 +#: c-api/exceptions.rst:1187 msgid "Standard Warning Categories" msgstr "" -#: c-api/exceptions.rst:1173 +#: c-api/exceptions.rst:1189 msgid "" "All standard Python warning categories are available as global variables " "whose names are ``PyExc_`` followed by the Python exception name. These have " @@ -1533,390 +1550,394 @@ msgid "" "here are all the variables:" msgstr "" -#: c-api/exceptions.rst:1194 +#: c-api/exceptions.rst:1210 msgid ":c:data:`PyExc_Warning`" msgstr "" -#: c-api/exceptions.rst:1194 +#: c-api/exceptions.rst:1210 msgid ":exc:`Warning`" msgstr "" -#: c-api/exceptions.rst:1194 +#: c-api/exceptions.rst:1210 msgid "[3]_" msgstr "" -#: c-api/exceptions.rst:1196 +#: c-api/exceptions.rst:1212 msgid ":c:data:`PyExc_BytesWarning`" msgstr "" -#: c-api/exceptions.rst:1196 +#: c-api/exceptions.rst:1212 msgid ":exc:`BytesWarning`" msgstr "" -#: c-api/exceptions.rst:1198 +#: c-api/exceptions.rst:1214 msgid ":c:data:`PyExc_DeprecationWarning`" msgstr "" -#: c-api/exceptions.rst:1198 +#: c-api/exceptions.rst:1214 msgid ":exc:`DeprecationWarning`" msgstr "" -#: c-api/exceptions.rst:1200 +#: c-api/exceptions.rst:1216 msgid ":c:data:`PyExc_FutureWarning`" msgstr "" -#: c-api/exceptions.rst:1200 +#: c-api/exceptions.rst:1216 msgid ":exc:`FutureWarning`" msgstr "" -#: c-api/exceptions.rst:1202 +#: c-api/exceptions.rst:1218 msgid ":c:data:`PyExc_ImportWarning`" msgstr "" -#: c-api/exceptions.rst:1202 +#: c-api/exceptions.rst:1218 msgid ":exc:`ImportWarning`" msgstr "" -#: c-api/exceptions.rst:1204 +#: c-api/exceptions.rst:1220 msgid ":c:data:`PyExc_PendingDeprecationWarning`" msgstr "" -#: c-api/exceptions.rst:1204 +#: c-api/exceptions.rst:1220 msgid ":exc:`PendingDeprecationWarning`" msgstr "" -#: c-api/exceptions.rst:1206 +#: c-api/exceptions.rst:1222 msgid ":c:data:`PyExc_ResourceWarning`" msgstr "" -#: c-api/exceptions.rst:1206 +#: c-api/exceptions.rst:1222 msgid ":exc:`ResourceWarning`" msgstr "" -#: c-api/exceptions.rst:1208 +#: c-api/exceptions.rst:1224 msgid ":c:data:`PyExc_RuntimeWarning`" msgstr "" -#: c-api/exceptions.rst:1208 +#: c-api/exceptions.rst:1224 msgid ":exc:`RuntimeWarning`" msgstr "" -#: c-api/exceptions.rst:1210 +#: c-api/exceptions.rst:1226 msgid ":c:data:`PyExc_SyntaxWarning`" msgstr "" -#: c-api/exceptions.rst:1210 +#: c-api/exceptions.rst:1226 msgid ":exc:`SyntaxWarning`" msgstr "" -#: c-api/exceptions.rst:1212 +#: c-api/exceptions.rst:1228 msgid ":c:data:`PyExc_UnicodeWarning`" msgstr "" -#: c-api/exceptions.rst:1212 +#: c-api/exceptions.rst:1228 msgid ":exc:`UnicodeWarning`" msgstr "" -#: c-api/exceptions.rst:1214 +#: c-api/exceptions.rst:1230 msgid ":c:data:`PyExc_UserWarning`" msgstr "" -#: c-api/exceptions.rst:1214 +#: c-api/exceptions.rst:1230 msgid ":exc:`UserWarning`" msgstr "" -#: c-api/exceptions.rst:1217 +#: c-api/exceptions.rst:1233 msgid ":c:data:`PyExc_ResourceWarning`." msgstr "" -#: c-api/exceptions.rst:1223 +#: c-api/exceptions.rst:1239 msgid "This is a base class for other standard warning categories." msgstr "" -#: c-api/exceptions.rst:170 +#: c-api/exceptions.rst:183 msgid "strerror (C function)" msgstr "" -#: c-api/exceptions.rst:655 c-api/exceptions.rst:670 +#: c-api/exceptions.rst:668 c-api/exceptions.rst:683 msgid "module" msgstr "" -#: c-api/exceptions.rst:655 c-api/exceptions.rst:670 +#: c-api/exceptions.rst:668 c-api/exceptions.rst:683 msgid "signal" msgstr "" -#: c-api/exceptions.rst:655 +#: c-api/exceptions.rst:668 msgid "SIGINT (C macro)" msgstr "" -#: c-api/exceptions.rst:655 c-api/exceptions.rst:670 +#: c-api/exceptions.rst:668 c-api/exceptions.rst:683 msgid "KeyboardInterrupt (built-in exception)" msgstr "" -#: c-api/exceptions.rst:958 +#: c-api/exceptions.rst:971 msgid "PyExc_BaseException (C var)" msgstr "" -#: c-api/exceptions.rst:958 +#: c-api/exceptions.rst:971 msgid "PyExc_Exception (C var)" msgstr "" -#: c-api/exceptions.rst:958 +#: c-api/exceptions.rst:971 msgid "PyExc_ArithmeticError (C var)" msgstr "" -#: c-api/exceptions.rst:958 +#: c-api/exceptions.rst:971 msgid "PyExc_AssertionError (C var)" msgstr "" -#: c-api/exceptions.rst:958 +#: c-api/exceptions.rst:971 msgid "PyExc_AttributeError (C var)" msgstr "" -#: c-api/exceptions.rst:958 +#: c-api/exceptions.rst:971 msgid "PyExc_BlockingIOError (C var)" msgstr "" -#: c-api/exceptions.rst:958 +#: c-api/exceptions.rst:971 msgid "PyExc_BrokenPipeError (C var)" msgstr "" -#: c-api/exceptions.rst:958 +#: c-api/exceptions.rst:971 msgid "PyExc_BufferError (C var)" msgstr "" -#: c-api/exceptions.rst:958 +#: c-api/exceptions.rst:971 msgid "PyExc_ChildProcessError (C var)" msgstr "" -#: c-api/exceptions.rst:958 +#: c-api/exceptions.rst:971 msgid "PyExc_ConnectionAbortedError (C var)" msgstr "" -#: c-api/exceptions.rst:958 +#: c-api/exceptions.rst:971 msgid "PyExc_ConnectionError (C var)" msgstr "" -#: c-api/exceptions.rst:958 +#: c-api/exceptions.rst:971 msgid "PyExc_ConnectionRefusedError (C var)" msgstr "" -#: c-api/exceptions.rst:958 +#: c-api/exceptions.rst:971 msgid "PyExc_ConnectionResetError (C var)" msgstr "" -#: c-api/exceptions.rst:958 +#: c-api/exceptions.rst:971 msgid "PyExc_EOFError (C var)" msgstr "" -#: c-api/exceptions.rst:958 +#: c-api/exceptions.rst:971 msgid "PyExc_FileExistsError (C var)" msgstr "" -#: c-api/exceptions.rst:958 +#: c-api/exceptions.rst:971 msgid "PyExc_FileNotFoundError (C var)" msgstr "" -#: c-api/exceptions.rst:958 +#: c-api/exceptions.rst:971 msgid "PyExc_FloatingPointError (C var)" msgstr "" -#: c-api/exceptions.rst:958 +#: c-api/exceptions.rst:971 msgid "PyExc_GeneratorExit (C var)" msgstr "" -#: c-api/exceptions.rst:958 +#: c-api/exceptions.rst:971 msgid "PyExc_ImportError (C var)" msgstr "" -#: c-api/exceptions.rst:958 +#: c-api/exceptions.rst:971 msgid "PyExc_IndentationError (C var)" msgstr "" -#: c-api/exceptions.rst:958 +#: c-api/exceptions.rst:971 msgid "PyExc_IndexError (C var)" msgstr "" -#: c-api/exceptions.rst:958 +#: c-api/exceptions.rst:971 msgid "PyExc_InterruptedError (C var)" msgstr "" -#: c-api/exceptions.rst:958 +#: c-api/exceptions.rst:971 msgid "PyExc_IsADirectoryError (C var)" msgstr "" -#: c-api/exceptions.rst:958 +#: c-api/exceptions.rst:971 msgid "PyExc_KeyError (C var)" msgstr "" -#: c-api/exceptions.rst:958 +#: c-api/exceptions.rst:971 msgid "PyExc_KeyboardInterrupt (C var)" msgstr "" -#: c-api/exceptions.rst:958 +#: c-api/exceptions.rst:971 msgid "PyExc_LookupError (C var)" msgstr "" -#: c-api/exceptions.rst:958 +#: c-api/exceptions.rst:971 msgid "PyExc_MemoryError (C var)" msgstr "" -#: c-api/exceptions.rst:958 +#: c-api/exceptions.rst:971 msgid "PyExc_ModuleNotFoundError (C var)" msgstr "" -#: c-api/exceptions.rst:958 +#: c-api/exceptions.rst:971 msgid "PyExc_NameError (C var)" msgstr "" -#: c-api/exceptions.rst:958 +#: c-api/exceptions.rst:971 msgid "PyExc_NotADirectoryError (C var)" msgstr "" -#: c-api/exceptions.rst:958 +#: c-api/exceptions.rst:971 msgid "PyExc_NotImplementedError (C var)" msgstr "" -#: c-api/exceptions.rst:958 +#: c-api/exceptions.rst:971 msgid "PyExc_OSError (C var)" msgstr "" -#: c-api/exceptions.rst:958 +#: c-api/exceptions.rst:971 msgid "PyExc_OverflowError (C var)" msgstr "" -#: c-api/exceptions.rst:958 +#: c-api/exceptions.rst:971 msgid "PyExc_PermissionError (C var)" msgstr "" -#: c-api/exceptions.rst:958 +#: c-api/exceptions.rst:971 msgid "PyExc_ProcessLookupError (C var)" msgstr "" -#: c-api/exceptions.rst:958 +#: c-api/exceptions.rst:971 +msgid "PyExc_PythonFinalizationError (C var)" +msgstr "" + +#: c-api/exceptions.rst:971 msgid "PyExc_RecursionError (C var)" msgstr "" -#: c-api/exceptions.rst:958 +#: c-api/exceptions.rst:971 msgid "PyExc_ReferenceError (C var)" msgstr "" -#: c-api/exceptions.rst:958 +#: c-api/exceptions.rst:971 msgid "PyExc_RuntimeError (C var)" msgstr "" -#: c-api/exceptions.rst:958 +#: c-api/exceptions.rst:971 msgid "PyExc_StopAsyncIteration (C var)" msgstr "" -#: c-api/exceptions.rst:958 +#: c-api/exceptions.rst:971 msgid "PyExc_StopIteration (C var)" msgstr "" -#: c-api/exceptions.rst:958 +#: c-api/exceptions.rst:971 msgid "PyExc_SyntaxError (C var)" msgstr "" -#: c-api/exceptions.rst:958 +#: c-api/exceptions.rst:971 msgid "PyExc_SystemError (C var)" msgstr "" -#: c-api/exceptions.rst:958 +#: c-api/exceptions.rst:971 msgid "PyExc_SystemExit (C var)" msgstr "" -#: c-api/exceptions.rst:958 +#: c-api/exceptions.rst:971 msgid "PyExc_TabError (C var)" msgstr "" -#: c-api/exceptions.rst:958 +#: c-api/exceptions.rst:971 msgid "PyExc_TimeoutError (C var)" msgstr "" -#: c-api/exceptions.rst:958 +#: c-api/exceptions.rst:971 msgid "PyExc_TypeError (C var)" msgstr "" -#: c-api/exceptions.rst:958 +#: c-api/exceptions.rst:971 msgid "PyExc_UnboundLocalError (C var)" msgstr "" -#: c-api/exceptions.rst:958 +#: c-api/exceptions.rst:971 msgid "PyExc_UnicodeDecodeError (C var)" msgstr "" -#: c-api/exceptions.rst:958 +#: c-api/exceptions.rst:971 msgid "PyExc_UnicodeEncodeError (C var)" msgstr "" -#: c-api/exceptions.rst:958 +#: c-api/exceptions.rst:971 msgid "PyExc_UnicodeError (C var)" msgstr "" -#: c-api/exceptions.rst:958 +#: c-api/exceptions.rst:971 msgid "PyExc_UnicodeTranslateError (C var)" msgstr "" -#: c-api/exceptions.rst:958 +#: c-api/exceptions.rst:971 msgid "PyExc_ValueError (C var)" msgstr "" -#: c-api/exceptions.rst:958 +#: c-api/exceptions.rst:971 msgid "PyExc_ZeroDivisionError (C var)" msgstr "" -#: c-api/exceptions.rst:1141 +#: c-api/exceptions.rst:1157 msgid "PyExc_EnvironmentError (C var)" msgstr "" -#: c-api/exceptions.rst:1141 +#: c-api/exceptions.rst:1157 msgid "PyExc_IOError (C var)" msgstr "" -#: c-api/exceptions.rst:1141 +#: c-api/exceptions.rst:1157 msgid "PyExc_WindowsError (C var)" msgstr "" -#: c-api/exceptions.rst:1178 +#: c-api/exceptions.rst:1194 msgid "PyExc_Warning (C var)" msgstr "" -#: c-api/exceptions.rst:1178 +#: c-api/exceptions.rst:1194 msgid "PyExc_BytesWarning (C var)" msgstr "" -#: c-api/exceptions.rst:1178 +#: c-api/exceptions.rst:1194 msgid "PyExc_DeprecationWarning (C var)" msgstr "" -#: c-api/exceptions.rst:1178 +#: c-api/exceptions.rst:1194 msgid "PyExc_FutureWarning (C var)" msgstr "" -#: c-api/exceptions.rst:1178 +#: c-api/exceptions.rst:1194 msgid "PyExc_ImportWarning (C var)" msgstr "" -#: c-api/exceptions.rst:1178 +#: c-api/exceptions.rst:1194 msgid "PyExc_PendingDeprecationWarning (C var)" msgstr "" -#: c-api/exceptions.rst:1178 +#: c-api/exceptions.rst:1194 msgid "PyExc_ResourceWarning (C var)" msgstr "" -#: c-api/exceptions.rst:1178 +#: c-api/exceptions.rst:1194 msgid "PyExc_RuntimeWarning (C var)" msgstr "" -#: c-api/exceptions.rst:1178 +#: c-api/exceptions.rst:1194 msgid "PyExc_SyntaxWarning (C var)" msgstr "" -#: c-api/exceptions.rst:1178 +#: c-api/exceptions.rst:1194 msgid "PyExc_UnicodeWarning (C var)" msgstr "" -#: c-api/exceptions.rst:1178 +#: c-api/exceptions.rst:1194 msgid "PyExc_UserWarning (C var)" msgstr "" diff --git a/c-api/file.po b/c-api/file.po index 5517db1c..5006d5b8 100644 --- a/c-api/file.po +++ b/c-api/file.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" diff --git a/c-api/float.po b/c-api/float.po index 1c13fe45..db9b8edd 100644 --- a/c-api/float.po +++ b/c-api/float.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" diff --git a/c-api/frame.po b/c-api/frame.po index 4c2f9616..d17b0442 100644 --- a/c-api/frame.po +++ b/c-api/frame.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -87,7 +87,7 @@ msgstr "" msgid "Get the *frame* code." msgstr "" -#: c-api/frame.rst:125 +#: c-api/frame.rst:130 msgid "Return a :term:`strong reference`." msgstr "" @@ -146,34 +146,70 @@ msgid "" msgstr "" #: c-api/frame.rst:123 -msgid "Get the *frame*'s :attr:`~frame.f_locals` attribute (:class:`dict`)." +msgid "" +"Get the *frame*'s :attr:`~frame.f_locals` attribute. If the frame refers to " +"an :term:`optimized scope`, this returns a write-through proxy object that " +"allows modifying the locals. In all other cases (classes, modules, :func:" +"`exec`, :func:`eval`) it returns the mapping representing the frame locals " +"directly (as described for :func:`locals`)." +msgstr "" + +#: c-api/frame.rst:134 +msgid "" +"As part of :pep:`667`, return an instance of :c:var:" +"`PyFrameLocalsProxy_Type`." msgstr "" -#: c-api/frame.rst:132 +#: c-api/frame.rst:140 msgid "Return the line number that *frame* is currently executing." msgstr "" -#: c-api/frame.rst:137 +#: c-api/frame.rst:144 +msgid "Frame Locals Proxies" +msgstr "" + +#: c-api/frame.rst:148 +msgid "" +"The :attr:`~frame.f_locals` attribute on a :ref:`frame object ` is an instance of a \"frame-locals proxy\". The proxy object " +"exposes a write-through view of the underlying locals dictionary for the " +"frame. This ensures that the variables exposed by ``f_locals`` are always up " +"to date with the live local variables in the frame itself." +msgstr "" + +#: c-api/frame.rst:154 +msgid "See :pep:`667` for more information." +msgstr "" + +#: c-api/frame.rst:158 +msgid "The type of frame :func:`locals` proxy objects." +msgstr "" + +#: c-api/frame.rst:162 +msgid "Return non-zero if *obj* is a frame :func:`locals` proxy." +msgstr "" + +#: c-api/frame.rst:165 msgid "Internal Frames" msgstr "" -#: c-api/frame.rst:139 +#: c-api/frame.rst:167 msgid "Unless using :pep:`523`, you will not need this." msgstr "" -#: c-api/frame.rst:143 +#: c-api/frame.rst:171 msgid "The interpreter's internal frame representation." msgstr "" -#: c-api/frame.rst:149 +#: c-api/frame.rst:177 msgid "Return a :term:`strong reference` to the code object for the frame." msgstr "" -#: c-api/frame.rst:156 +#: c-api/frame.rst:184 msgid "Return the byte offset into the last executed instruction." msgstr "" -#: c-api/frame.rst:163 +#: c-api/frame.rst:191 msgid "" "Return the currently executing line number, or -1 if there is no line number." msgstr "" diff --git a/c-api/function.po b/c-api/function.po index 12d0d12e..02ad8c44 100644 --- a/c-api/function.po +++ b/c-api/function.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" diff --git a/c-api/gcsupport.po b/c-api/gcsupport.po index 49344544..36822f65 100644 --- a/c-api/gcsupport.po +++ b/c-api/gcsupport.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -361,7 +361,7 @@ msgstr "" msgid "" "Type of the visitor function to be passed to :c:func:" "`PyUnstable_GC_VisitObjects`. *arg* is the same as the *arg* passed to " -"``PyUnstable_GC_VisitObjects``. Return ``0`` to continue iteration, return " -"``1`` to stop iteration. Other return values are reserved for now so " +"``PyUnstable_GC_VisitObjects``. Return ``1`` to continue iteration, return " +"``0`` to stop iteration. Other return values are reserved for now so " "behavior on returning anything else is undefined." msgstr "" diff --git a/c-api/gen.po b/c-api/gen.po index 391dfb63..6a449019 100644 --- a/c-api/gen.po +++ b/c-api/gen.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" diff --git a/c-api/hash.po b/c-api/hash.po index 25b5c27c..5feca4b4 100644 --- a/c-api/hash.po +++ b/c-api/hash.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -22,7 +22,8 @@ msgid "PyHash API" msgstr "" #: c-api/hash.rst:6 -msgid "See also the :c:member:`PyTypeObject.tp_hash` member." +msgid "" +"See also the :c:member:`PyTypeObject.tp_hash` member and :ref:`numeric-hash`." msgstr "" #: c-api/hash.rst:10 @@ -33,26 +34,68 @@ msgstr "" msgid "Hash value type: unsigned integer." msgstr "" -#: c-api/hash.rst:23 +#: c-api/hash.rst:22 +msgid "" +"The `Mersenne prime `_ ``P = " +"2**n -1``, used for numeric hash scheme." +msgstr "" + +#: c-api/hash.rst:28 +msgid "The exponent ``n`` of ``P`` in :c:macro:`PyHASH_MODULUS`." +msgstr "" + +#: c-api/hash.rst:34 +msgid "Prime multiplier used in string and various other hashes." +msgstr "" + +#: c-api/hash.rst:40 +msgid "The hash value returned for a positive infinity." +msgstr "" + +#: c-api/hash.rst:46 +msgid "The multiplier used for the imaginary part of a complex number." +msgstr "" + +#: c-api/hash.rst:52 msgid "Hash function definition used by :c:func:`PyHash_GetFuncDef`." msgstr "" -#: c-api/hash.rst:31 +#: c-api/hash.rst:60 msgid "Hash function name (UTF-8 encoded string)." msgstr "" -#: c-api/hash.rst:35 +#: c-api/hash.rst:64 msgid "Internal size of the hash value in bits." msgstr "" -#: c-api/hash.rst:39 +#: c-api/hash.rst:68 msgid "Size of seed input in bits." msgstr "" -#: c-api/hash.rst:46 +#: c-api/hash.rst:75 msgid "Get the hash function definition." msgstr "" -#: c-api/hash.rst:49 +#: c-api/hash.rst:78 msgid ":pep:`456` \"Secure and interchangeable hash algorithm\"." msgstr "" + +#: c-api/hash.rst:85 +msgid "" +"Hash a pointer value: process the pointer value as an integer (cast it to " +"``uintptr_t`` internally). The pointer is not dereferenced." +msgstr "" + +#: c-api/hash.rst:88 +msgid "The function cannot fail: it cannot return ``-1``." +msgstr "" + +#: c-api/hash.rst:94 +msgid "" +"Generic hashing function that is meant to be put into a type object's " +"``tp_hash`` slot. Its result only depends on the object's identity." +msgstr "" + +#: c-api/hash.rst:99 +msgid "In CPython, it is equivalent to :c:func:`Py_HashPointer`." +msgstr "" diff --git a/c-api/import.po b/c-api/import.po index 9bb5c3aa..ec131671 100644 --- a/c-api/import.po +++ b/c-api/import.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -39,13 +39,17 @@ msgid "" "needed anymore." msgstr "" -#: c-api/import.rst:34 +#: c-api/import.rst:29 +msgid "Use :c:func:`PyImport_ImportModule` instead." +msgstr "" + +#: c-api/import.rst:37 msgid "" "Import a module. This is best described by referring to the built-in Python " "function :func:`__import__`." msgstr "" -#: c-api/import.rst:53 +#: c-api/import.rst:56 msgid "" "The return value is a new reference to the imported module or top-level " "package, or ``NULL`` with an exception set on failure. Like for :func:" @@ -53,30 +57,30 @@ msgid "" "is normally the top-level package, unless a non-empty *fromlist* was given." msgstr "" -#: c-api/import.rst:43 +#: c-api/import.rst:46 msgid "" "Failing imports remove incomplete module objects, like with :c:func:" "`PyImport_ImportModule`." msgstr "" -#: c-api/import.rst:49 +#: c-api/import.rst:52 msgid "" "Import a module. This is best described by referring to the built-in Python " "function :func:`__import__`, as the standard :func:`__import__` function " "calls this function directly." msgstr "" -#: c-api/import.rst:63 +#: c-api/import.rst:66 msgid "" "Similar to :c:func:`PyImport_ImportModuleLevelObject`, but the name is a " "UTF-8 encoded string instead of a Unicode object." msgstr "" -#: c-api/import.rst:66 +#: c-api/import.rst:69 msgid "Negative values for *level* are no longer accepted." msgstr "" -#: c-api/import.rst:71 +#: c-api/import.rst:74 msgid "" "This is a higher-level interface that calls the current \"import hook " "function\" (with an explicit *level* of 0, meaning absolute import). It " @@ -85,40 +89,59 @@ msgid "" "hooks are installed in the current environment." msgstr "" -#: c-api/import.rst:77 +#: c-api/import.rst:80 msgid "This function always uses absolute imports." msgstr "" -#: c-api/import.rst:82 +#: c-api/import.rst:85 msgid "" "Reload a module. Return a new reference to the reloaded module, or ``NULL`` " "with an exception set on failure (the module still exists in this case)." msgstr "" -#: c-api/import.rst:88 +#: c-api/import.rst:91 +msgid "Return the module object corresponding to a module name." +msgstr "" + +#: c-api/import.rst:93 msgid "" -"Return the module object corresponding to a module name. The *name* " -"argument may be of the form ``package.module``. First check the modules " -"dictionary if there's one there, and if not, create a new one and insert it " -"in the modules dictionary. Return ``NULL`` with an exception set on failure." +"The *name* argument may be of the form ``package.module``. First check the " +"modules dictionary if there's one there, and if not, create a new one and " +"insert it in the modules dictionary." msgstr "" -#: c-api/import.rst:95 +#: c-api/import.rst:97 +msgid "" +"Return a :term:`strong reference` to the module on success. Return ``NULL`` " +"with an exception set on failure." +msgstr "" + +#: c-api/import.rst:100 +msgid "The module name *name* is decoded from UTF-8." +msgstr "" + +#: c-api/import.rst:102 msgid "" "This function does not load or import the module; if the module wasn't " "already loaded, you will get an empty module object. Use :c:func:" -"`PyImport_ImportModule` or one of its variants to import a module. Package " +"`PyImport_ImportModule` or one of its variants to import a module. Package " "structures implied by a dotted name for *name* are not created if not " "already present." msgstr "" -#: c-api/import.rst:105 +#: c-api/import.rst:113 +msgid "" +"Similar to :c:func:`PyImport_AddModuleRef`, but return a :term:`borrowed " +"reference` and *name* is a Python :class:`str` object." +msgstr "" + +#: c-api/import.rst:121 msgid "" -"Similar to :c:func:`PyImport_AddModuleObject`, but the name is a UTF-8 " -"encoded string instead of a Unicode object." +"Similar to :c:func:`PyImport_AddModuleRef`, but return a :term:`borrowed " +"reference`." msgstr "" -#: c-api/import.rst:113 +#: c-api/import.rst:129 msgid "" "Given a module name (possibly of the form ``package.module``) and a code " "object read from a Python bytecode file or obtained from the built-in " @@ -132,7 +155,7 @@ msgid "" "to the module author's intents) state." msgstr "" -#: c-api/import.rst:123 +#: c-api/import.rst:139 msgid "" "The module's :attr:`~module.__spec__` and :attr:`~module.__loader__` will be " "set, if not set already, with the appropriate values. The spec's loader " @@ -140,61 +163,61 @@ msgid "" "of :class:`~importlib.machinery.SourceFileLoader` otherwise." msgstr "" -#: c-api/import.rst:128 +#: c-api/import.rst:144 msgid "" "The module's :attr:`~module.__file__` attribute will be set to the code " "object's :attr:`~codeobject.co_filename`. If applicable, :attr:`~module." "__cached__` will also be set." msgstr "" -#: c-api/import.rst:132 +#: c-api/import.rst:148 msgid "" "This function will reload the module if it was already imported. See :c:" "func:`PyImport_ReloadModule` for the intended way to reload a module." msgstr "" -#: c-api/import.rst:135 +#: c-api/import.rst:151 msgid "" "If *name* points to a dotted name of the form ``package.module``, any " "package structures not already created will still not be created." msgstr "" -#: c-api/import.rst:138 +#: c-api/import.rst:154 msgid "" "See also :c:func:`PyImport_ExecCodeModuleEx` and :c:func:" "`PyImport_ExecCodeModuleWithPathnames`." msgstr "" -#: c-api/import.rst:141 +#: c-api/import.rst:157 msgid "" "The setting of :attr:`~module.__cached__` and :attr:`~module.__loader__` is " "deprecated. See :class:`~importlib.machinery.ModuleSpec` for alternatives." msgstr "" -#: c-api/import.rst:149 +#: c-api/import.rst:165 msgid "" "Like :c:func:`PyImport_ExecCodeModule`, but the :attr:`~module.__file__` " "attribute of the module object is set to *pathname* if it is non-``NULL``." msgstr "" -#: c-api/import.rst:152 +#: c-api/import.rst:168 msgid "See also :c:func:`PyImport_ExecCodeModuleWithPathnames`." msgstr "" -#: c-api/import.rst:157 +#: c-api/import.rst:173 msgid "" "Like :c:func:`PyImport_ExecCodeModuleEx`, but the :attr:`~module.__cached__` " "attribute of the module object is set to *cpathname* if it is non-``NULL``. " "Of the three functions, this is the preferred one to use." msgstr "" -#: c-api/import.rst:163 +#: c-api/import.rst:179 msgid "" "Setting :attr:`~module.__cached__` is deprecated. See :class:`~importlib." "machinery.ModuleSpec` for alternatives." msgstr "" -#: c-api/import.rst:170 +#: c-api/import.rst:186 msgid "" "Like :c:func:`PyImport_ExecCodeModuleObject`, but *name*, *pathname* and " "*cpathname* are UTF-8 encoded strings. Attempts are also made to figure out " @@ -202,48 +225,48 @@ msgid "" "set to ``NULL``." msgstr "" -#: c-api/import.rst:176 +#: c-api/import.rst:192 msgid "" "Uses :func:`!imp.source_from_cache` in calculating the source path if only " "the bytecode path is provided." msgstr "" -#: c-api/import.rst:179 +#: c-api/import.rst:195 msgid "No longer uses the removed :mod:`!imp` module." msgstr "" -#: c-api/import.rst:185 +#: c-api/import.rst:201 msgid "" "Return the magic number for Python bytecode files (a.k.a. :file:`.pyc` " "file). The magic number should be present in the first four bytes of the " "bytecode file, in little-endian byte order. Returns ``-1`` on error." msgstr "" -#: c-api/import.rst:189 +#: c-api/import.rst:205 msgid "Return value of ``-1`` upon failure." msgstr "" -#: c-api/import.rst:195 +#: c-api/import.rst:211 msgid "" "Return the magic tag string for :pep:`3147` format Python bytecode file " "names. Keep in mind that the value at ``sys.implementation.cache_tag`` is " "authoritative and should be used instead of this function." msgstr "" -#: c-api/import.rst:203 +#: c-api/import.rst:219 msgid "" "Return the dictionary used for the module administration (a.k.a. ``sys." "modules``). Note that this is a per-interpreter variable." msgstr "" -#: c-api/import.rst:208 +#: c-api/import.rst:224 msgid "" "Return the already imported module with the given name. If the module has " "not been imported yet then returns ``NULL`` but does not set an error. " "Returns ``NULL`` and sets an error if the lookup failed." msgstr "" -#: c-api/import.rst:216 +#: c-api/import.rst:232 msgid "" "Return a finder object for a :data:`sys.path`/:attr:`!pkg.__path__` item " "*path*, possibly by fetching it from the :data:`sys.path_importer_cache` " @@ -254,7 +277,7 @@ msgid "" "path_importer_cache`. Return a new reference to the finder object." msgstr "" -#: c-api/import.rst:227 +#: c-api/import.rst:243 msgid "" "Load a frozen module named *name*. Return ``1`` for success, ``0`` if the " "module is not found, and ``-1`` with an exception set if the initialization " @@ -263,17 +286,17 @@ msgid "" "the module if it was already imported.)" msgstr "" -#: c-api/import.rst:235 +#: c-api/import.rst:251 msgid "The ``__file__`` attribute is no longer set on the module." msgstr "" -#: c-api/import.rst:241 +#: c-api/import.rst:257 msgid "" "Similar to :c:func:`PyImport_ImportFrozenModuleObject`, but the name is a " "UTF-8 encoded string instead of a Unicode object." msgstr "" -#: c-api/import.rst:249 +#: c-api/import.rst:265 msgid "" "This is the structure type definition for frozen module descriptors, as " "generated by the :program:`freeze` utility (see :file:`Tools/freeze/` in the " @@ -281,7 +304,7 @@ msgid "" "h`, is::" msgstr "" -#: c-api/import.rst:254 +#: c-api/import.rst:270 msgid "" "struct _frozen {\n" " const char *name;\n" @@ -291,13 +314,13 @@ msgid "" "};" msgstr "" -#: c-api/import.rst:261 +#: c-api/import.rst:277 msgid "" "The new ``is_package`` field indicates whether the module is a package or " "not. This replaces setting the ``size`` field to a negative value." msgstr "" -#: c-api/import.rst:267 +#: c-api/import.rst:283 msgid "" "This pointer is initialized to point to an array of :c:struct:`_frozen` " "records, terminated by one whose members are all ``NULL`` or zero. When a " @@ -306,7 +329,7 @@ msgid "" "frozen modules." msgstr "" -#: c-api/import.rst:275 +#: c-api/import.rst:291 msgid "" "Add a single module to the existing table of built-in modules. This is a " "convenience wrapper around :c:func:`PyImport_ExtendInittab`, returning " @@ -316,7 +339,7 @@ msgid "" "before :c:func:`Py_Initialize`." msgstr "" -#: c-api/import.rst:285 +#: c-api/import.rst:301 msgid "" "Structure describing a single entry in the list of built-in modules. " "Programs which embed Python may use an array of these structures in " @@ -324,15 +347,15 @@ msgid "" "built-in modules. The structure consists of two members:" msgstr "" -#: c-api/import.rst:293 +#: c-api/import.rst:309 msgid "The module name, as an ASCII encoded string." msgstr "" -#: c-api/import.rst:297 +#: c-api/import.rst:313 msgid "Initialization function for a module built into the interpreter." msgstr "" -#: c-api/import.rst:302 +#: c-api/import.rst:318 msgid "" "Add a collection of modules to the table of built-in modules. The *newtab* " "array must end with a sentinel entry which contains ``NULL`` for the :c:" @@ -343,7 +366,7 @@ msgid "" "before :c:func:`Py_Initialize`." msgstr "" -#: c-api/import.rst:309 +#: c-api/import.rst:325 msgid "" "If Python is initialized multiple times, :c:func:`PyImport_AppendInittab` " "or :c:func:`PyImport_ExtendInittab` must be called before each Python " @@ -366,18 +389,18 @@ msgstr "" msgid "modules (in module sys)" msgstr "" -#: c-api/import.rst:111 +#: c-api/import.rst:127 msgid "built-in function" msgstr "" -#: c-api/import.rst:32 +#: c-api/import.rst:35 msgid "__import__" msgstr "" -#: c-api/import.rst:111 +#: c-api/import.rst:127 msgid "compile" msgstr "" -#: c-api/import.rst:247 +#: c-api/import.rst:263 msgid "freeze utility" msgstr "" diff --git a/c-api/index.po b/c-api/index.po index fd249d6c..a3f36443 100644 --- a/c-api/index.po +++ b/c-api/index.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" diff --git a/c-api/init.po b/c-api/init.po index fb9957f4..37a946bf 100644 --- a/c-api/init.po +++ b/c-api/init.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -22,14 +22,16 @@ msgid "Initialization, Finalization, and Threads" msgstr "" #: c-api/init.rst:10 -msgid "See also :ref:`Python Initialization Configuration `." +msgid "" +"See :ref:`Python Initialization Configuration ` for details on " +"how to configure the interpreter prior to initialization." msgstr "" -#: c-api/init.rst:15 +#: c-api/init.rst:16 msgid "Before Python Initialization" msgstr "" -#: c-api/init.rst:17 +#: c-api/init.rst:18 msgid "" "In an application embedding Python, the :c:func:`Py_Initialize` function " "must be called before using any other Python/C API functions; with the " @@ -37,152 +39,186 @@ msgid "" "`." msgstr "" -#: c-api/init.rst:22 +#: c-api/init.rst:23 msgid "" "The following functions can be safely called before Python is initialized:" msgstr "" -#: c-api/init.rst:24 -msgid "Configuration functions:" -msgstr "" - -#: c-api/init.rst:26 -msgid ":c:func:`PyImport_AppendInittab`" +#: c-api/init.rst:25 +msgid "Functions that initialize the interpreter:" msgstr "" #: c-api/init.rst:27 -msgid ":c:func:`PyImport_ExtendInittab`" +msgid ":c:func:`Py_Initialize`" msgstr "" #: c-api/init.rst:28 -msgid ":c:func:`!PyInitFrozenExtensions`" +msgid ":c:func:`Py_InitializeEx`" msgstr "" #: c-api/init.rst:29 -msgid ":c:func:`PyMem_SetAllocator`" +msgid ":c:func:`Py_InitializeFromConfig`" msgstr "" #: c-api/init.rst:30 -msgid ":c:func:`PyMem_SetupDebugHooks`" +msgid ":c:func:`Py_BytesMain`" msgstr "" #: c-api/init.rst:31 -msgid ":c:func:`PyObject_SetArenaAllocator`" +msgid ":c:func:`Py_Main`" msgstr "" #: c-api/init.rst:32 -msgid ":c:func:`Py_SetPath`" -msgstr "" - -#: c-api/init.rst:33 -msgid ":c:func:`Py_SetProgramName`" +msgid "the runtime pre-initialization functions covered in :ref:`init-config`" msgstr "" #: c-api/init.rst:34 -msgid ":c:func:`Py_SetPythonHome`" -msgstr "" - -#: c-api/init.rst:35 -msgid ":c:func:`Py_SetStandardStreamEncoding`" +msgid "Configuration functions:" msgstr "" #: c-api/init.rst:36 -msgid ":c:func:`PySys_AddWarnOption`" +msgid ":c:func:`PyImport_AppendInittab`" msgstr "" #: c-api/init.rst:37 -msgid ":c:func:`PySys_AddXOption`" +msgid ":c:func:`PyImport_ExtendInittab`" msgstr "" #: c-api/init.rst:38 -msgid ":c:func:`PySys_ResetWarnOptions`" +msgid ":c:func:`!PyInitFrozenExtensions`" +msgstr "" + +#: c-api/init.rst:39 +msgid ":c:func:`PyMem_SetAllocator`" msgstr "" #: c-api/init.rst:40 -msgid "Informative functions:" +msgid ":c:func:`PyMem_SetupDebugHooks`" +msgstr "" + +#: c-api/init.rst:41 +msgid ":c:func:`PyObject_SetArenaAllocator`" msgstr "" #: c-api/init.rst:42 -msgid ":c:func:`Py_IsInitialized`" +msgid ":c:func:`Py_SetProgramName`" msgstr "" #: c-api/init.rst:43 -msgid ":c:func:`PyMem_GetAllocator`" +msgid ":c:func:`Py_SetPythonHome`" msgstr "" #: c-api/init.rst:44 -msgid ":c:func:`PyObject_GetArenaAllocator`" +msgid ":c:func:`PySys_ResetWarnOptions`" msgstr "" #: c-api/init.rst:45 +msgid "the configuration functions covered in :ref:`init-config`" +msgstr "" + +#: c-api/init.rst:47 +msgid "Informative functions:" +msgstr "" + +#: c-api/init.rst:57 +msgid ":c:func:`Py_IsInitialized`" +msgstr "" + +#: c-api/init.rst:50 +msgid ":c:func:`PyMem_GetAllocator`" +msgstr "" + +#: c-api/init.rst:51 +msgid ":c:func:`PyObject_GetArenaAllocator`" +msgstr "" + +#: c-api/init.rst:52 msgid ":c:func:`Py_GetBuildInfo`" msgstr "" -#: c-api/init.rst:46 +#: c-api/init.rst:53 msgid ":c:func:`Py_GetCompiler`" msgstr "" -#: c-api/init.rst:47 +#: c-api/init.rst:54 msgid ":c:func:`Py_GetCopyright`" msgstr "" -#: c-api/init.rst:48 +#: c-api/init.rst:55 msgid ":c:func:`Py_GetPlatform`" msgstr "" -#: c-api/init.rst:49 +#: c-api/init.rst:56 msgid ":c:func:`Py_GetVersion`" msgstr "" -#: c-api/init.rst:51 +#: c-api/init.rst:59 msgid "Utilities:" msgstr "" -#: c-api/init.rst:53 +#: c-api/init.rst:61 msgid ":c:func:`Py_DecodeLocale`" msgstr "" -#: c-api/init.rst:55 +#: c-api/init.rst:62 +msgid "" +"the status reporting and utility functions covered in :ref:`init-config`" +msgstr "" + +#: c-api/init.rst:64 msgid "Memory allocators:" msgstr "" -#: c-api/init.rst:57 +#: c-api/init.rst:66 msgid ":c:func:`PyMem_RawMalloc`" msgstr "" -#: c-api/init.rst:58 +#: c-api/init.rst:67 msgid ":c:func:`PyMem_RawRealloc`" msgstr "" -#: c-api/init.rst:59 +#: c-api/init.rst:68 msgid ":c:func:`PyMem_RawCalloc`" msgstr "" -#: c-api/init.rst:60 +#: c-api/init.rst:69 msgid ":c:func:`PyMem_RawFree`" msgstr "" -#: c-api/init.rst:64 +#: c-api/init.rst:71 +msgid "Synchronization:" +msgstr "" + +#: c-api/init.rst:73 +msgid ":c:func:`PyMutex_Lock`" +msgstr "" + +#: c-api/init.rst:74 +msgid ":c:func:`PyMutex_Unlock`" +msgstr "" + +#: c-api/init.rst:78 msgid "" -"The following functions **should not be called** before :c:func:" -"`Py_Initialize`: :c:func:`Py_EncodeLocale`, :c:func:`Py_GetPath`, :c:func:" +"Despite their apparent similarity to some of the functions listed above, the " +"following functions **should not be called** before the interpreter has been " +"initialized: :c:func:`Py_EncodeLocale`, :c:func:`Py_GetPath`, :c:func:" "`Py_GetPrefix`, :c:func:`Py_GetExecPrefix`, :c:func:" "`Py_GetProgramFullPath`, :c:func:`Py_GetPythonHome`, :c:func:" -"`Py_GetProgramName` and :c:func:`PyEval_InitThreads`." +"`Py_GetProgramName`, :c:func:`PyEval_InitThreads`, and :c:func:`Py_RunMain`." msgstr "" -#: c-api/init.rst:74 +#: c-api/init.rst:90 msgid "Global configuration variables" msgstr "" -#: c-api/init.rst:76 +#: c-api/init.rst:92 msgid "" "Python has variables for the global configuration to control different " "features and options. By default, these flags are controlled by :ref:" "`command line options `." msgstr "" -#: c-api/init.rst:80 +#: c-api/init.rst:96 msgid "" "When a flag is set by an option, the value of the flag is the number of " "times that the option was set. For example, ``-b`` sets :c:data:" @@ -190,222 +226,222 @@ msgid "" "2." msgstr "" -#: c-api/init.rst:86 +#: c-api/init.rst:102 msgid "" "This API is kept for backward compatibility: setting :c:member:`PyConfig." "bytes_warning` should be used instead, see :ref:`Python Initialization " "Configuration `." msgstr "" -#: c-api/init.rst:90 +#: c-api/init.rst:106 msgid "" "Issue a warning when comparing :class:`bytes` or :class:`bytearray` with :" "class:`str` or :class:`bytes` with :class:`int`. Issue an error if greater " "or equal to ``2``." msgstr "" -#: c-api/init.rst:94 +#: c-api/init.rst:110 msgid "Set by the :option:`-b` option." msgstr "" -#: c-api/init.rst:100 +#: c-api/init.rst:116 msgid "" "This API is kept for backward compatibility: setting :c:member:`PyConfig." "parser_debug` should be used instead, see :ref:`Python Initialization " "Configuration `." msgstr "" -#: c-api/init.rst:104 +#: c-api/init.rst:120 msgid "" "Turn on parser debugging output (for expert only, depending on compilation " "options)." msgstr "" -#: c-api/init.rst:107 +#: c-api/init.rst:123 msgid "" "Set by the :option:`-d` option and the :envvar:`PYTHONDEBUG` environment " "variable." msgstr "" -#: c-api/init.rst:114 +#: c-api/init.rst:130 msgid "" "This API is kept for backward compatibility: setting :c:member:`PyConfig." "write_bytecode` should be used instead, see :ref:`Python Initialization " "Configuration `." msgstr "" -#: c-api/init.rst:118 +#: c-api/init.rst:134 msgid "" "If set to non-zero, Python won't try to write ``.pyc`` files on the import " "of source modules." msgstr "" -#: c-api/init.rst:121 +#: c-api/init.rst:137 msgid "" "Set by the :option:`-B` option and the :envvar:`PYTHONDONTWRITEBYTECODE` " "environment variable." msgstr "" -#: c-api/init.rst:128 +#: c-api/init.rst:144 msgid "" "This API is kept for backward compatibility: setting :c:member:`PyConfig." "pathconfig_warnings` should be used instead, see :ref:`Python Initialization " "Configuration `." msgstr "" -#: c-api/init.rst:132 +#: c-api/init.rst:148 msgid "" "Suppress error messages when calculating the module search path in :c:func:" "`Py_GetPath`." msgstr "" -#: c-api/init.rst:135 +#: c-api/init.rst:151 msgid "Private flag used by ``_freeze_module`` and ``frozenmain`` programs." msgstr "" -#: c-api/init.rst:141 +#: c-api/init.rst:157 msgid "" "This API is kept for backward compatibility: setting :c:member:`PyConfig." "hash_seed` and :c:member:`PyConfig.use_hash_seed` should be used instead, " "see :ref:`Python Initialization Configuration `." msgstr "" -#: c-api/init.rst:146 +#: c-api/init.rst:162 msgid "" "Set to ``1`` if the :envvar:`PYTHONHASHSEED` environment variable is set to " "a non-empty string." msgstr "" -#: c-api/init.rst:149 +#: c-api/init.rst:165 msgid "" "If the flag is non-zero, read the :envvar:`PYTHONHASHSEED` environment " "variable to initialize the secret hash seed." msgstr "" -#: c-api/init.rst:156 +#: c-api/init.rst:172 msgid "" "This API is kept for backward compatibility: setting :c:member:`PyConfig." "use_environment` should be used instead, see :ref:`Python Initialization " "Configuration `." msgstr "" -#: c-api/init.rst:160 +#: c-api/init.rst:176 msgid "" "Ignore all :envvar:`!PYTHON*` environment variables, e.g. :envvar:" "`PYTHONPATH` and :envvar:`PYTHONHOME`, that might be set." msgstr "" -#: c-api/init.rst:163 +#: c-api/init.rst:179 msgid "Set by the :option:`-E` and :option:`-I` options." msgstr "" -#: c-api/init.rst:169 +#: c-api/init.rst:185 msgid "" "This API is kept for backward compatibility: setting :c:member:`PyConfig." "inspect` should be used instead, see :ref:`Python Initialization " "Configuration `." msgstr "" -#: c-api/init.rst:173 +#: c-api/init.rst:189 msgid "" "When a script is passed as first argument or the :option:`-c` option is " "used, enter interactive mode after executing the script or the command, even " "when :data:`sys.stdin` does not appear to be a terminal." msgstr "" -#: c-api/init.rst:177 +#: c-api/init.rst:193 msgid "" "Set by the :option:`-i` option and the :envvar:`PYTHONINSPECT` environment " "variable." msgstr "" -#: c-api/init.rst:184 +#: c-api/init.rst:200 msgid "" "This API is kept for backward compatibility: setting :c:member:`PyConfig." "interactive` should be used instead, see :ref:`Python Initialization " "Configuration `." msgstr "" -#: c-api/init.rst:188 +#: c-api/init.rst:204 msgid "Set by the :option:`-i` option." msgstr "" -#: c-api/init.rst:194 +#: c-api/init.rst:210 msgid "" "This API is kept for backward compatibility: setting :c:member:`PyConfig." "isolated` should be used instead, see :ref:`Python Initialization " "Configuration `." msgstr "" -#: c-api/init.rst:198 +#: c-api/init.rst:214 msgid "" "Run Python in isolated mode. In isolated mode :data:`sys.path` contains " "neither the script's directory nor the user's site-packages directory." msgstr "" -#: c-api/init.rst:201 +#: c-api/init.rst:217 msgid "Set by the :option:`-I` option." msgstr "" -#: c-api/init.rst:209 +#: c-api/init.rst:225 msgid "" "This API is kept for backward compatibility: setting :c:member:`PyPreConfig." "legacy_windows_fs_encoding` should be used instead, see :ref:`Python " "Initialization Configuration `." msgstr "" -#: c-api/init.rst:213 +#: c-api/init.rst:229 msgid "" "If the flag is non-zero, use the ``mbcs`` encoding with ``replace`` error " "handler, instead of the UTF-8 encoding with ``surrogatepass`` error handler, " "for the :term:`filesystem encoding and error handler`." msgstr "" -#: c-api/init.rst:217 +#: c-api/init.rst:233 msgid "" "Set to ``1`` if the :envvar:`PYTHONLEGACYWINDOWSFSENCODING` environment " "variable is set to a non-empty string." msgstr "" -#: c-api/init.rst:220 +#: c-api/init.rst:236 msgid "See :pep:`529` for more details." msgstr "" -#: c-api/init.rst:240 +#: c-api/init.rst:256 msgid "Availability" msgstr "" -#: c-api/init.rst:228 +#: c-api/init.rst:244 msgid "" "This API is kept for backward compatibility: setting :c:member:`PyConfig." "legacy_windows_stdio` should be used instead, see :ref:`Python " "Initialization Configuration `." msgstr "" -#: c-api/init.rst:232 +#: c-api/init.rst:248 msgid "" "If the flag is non-zero, use :class:`io.FileIO` instead of :class:`!io." "_WindowsConsoleIO` for :mod:`sys` standard streams." msgstr "" -#: c-api/init.rst:235 +#: c-api/init.rst:251 msgid "" "Set to ``1`` if the :envvar:`PYTHONLEGACYWINDOWSSTDIO` environment variable " "is set to a non-empty string." msgstr "" -#: c-api/init.rst:238 +#: c-api/init.rst:254 msgid "See :pep:`528` for more details." msgstr "" -#: c-api/init.rst:246 +#: c-api/init.rst:262 msgid "" "This API is kept for backward compatibility: setting :c:member:`PyConfig." "site_import` should be used instead, see :ref:`Python Initialization " "Configuration `." msgstr "" -#: c-api/init.rst:250 +#: c-api/init.rst:266 msgid "" "Disable the import of the module :mod:`site` and the site-dependent " "manipulations of :data:`sys.path` that it entails. Also disable these " @@ -413,83 +449,83 @@ msgid "" "main` if you want them to be triggered)." msgstr "" -#: c-api/init.rst:255 +#: c-api/init.rst:271 msgid "Set by the :option:`-S` option." msgstr "" -#: c-api/init.rst:261 +#: c-api/init.rst:277 msgid "" "This API is kept for backward compatibility: setting :c:member:`PyConfig." "user_site_directory` should be used instead, see :ref:`Python Initialization " "Configuration `." msgstr "" -#: c-api/init.rst:265 +#: c-api/init.rst:281 msgid "" "Don't add the :data:`user site-packages directory ` to :data:" "`sys.path`." msgstr "" -#: c-api/init.rst:268 +#: c-api/init.rst:284 msgid "" "Set by the :option:`-s` and :option:`-I` options, and the :envvar:" "`PYTHONNOUSERSITE` environment variable." msgstr "" -#: c-api/init.rst:275 +#: c-api/init.rst:291 msgid "" "This API is kept for backward compatibility: setting :c:member:`PyConfig." "optimization_level` should be used instead, see :ref:`Python Initialization " "Configuration `." msgstr "" -#: c-api/init.rst:279 +#: c-api/init.rst:295 msgid "" "Set by the :option:`-O` option and the :envvar:`PYTHONOPTIMIZE` environment " "variable." msgstr "" -#: c-api/init.rst:286 +#: c-api/init.rst:302 msgid "" "This API is kept for backward compatibility: setting :c:member:`PyConfig." "quiet` should be used instead, see :ref:`Python Initialization Configuration " "`." msgstr "" -#: c-api/init.rst:290 +#: c-api/init.rst:306 msgid "" "Don't display the copyright and version messages even in interactive mode." msgstr "" -#: c-api/init.rst:292 +#: c-api/init.rst:308 msgid "Set by the :option:`-q` option." msgstr "" -#: c-api/init.rst:300 +#: c-api/init.rst:316 msgid "" "This API is kept for backward compatibility: setting :c:member:`PyConfig." "buffered_stdio` should be used instead, see :ref:`Python Initialization " "Configuration `." msgstr "" -#: c-api/init.rst:304 +#: c-api/init.rst:320 msgid "Force the stdout and stderr streams to be unbuffered." msgstr "" -#: c-api/init.rst:306 +#: c-api/init.rst:322 msgid "" "Set by the :option:`-u` option and the :envvar:`PYTHONUNBUFFERED` " "environment variable." msgstr "" -#: c-api/init.rst:313 +#: c-api/init.rst:329 msgid "" "This API is kept for backward compatibility: setting :c:member:`PyConfig." "verbose` should be used instead, see :ref:`Python Initialization " "Configuration `." msgstr "" -#: c-api/init.rst:317 +#: c-api/init.rst:333 msgid "" "Print a message each time a module is initialized, showing the place " "(filename or built-in module) from which it is loaded. If greater or equal " @@ -497,60 +533,81 @@ msgid "" "for a module. Also provides information on module cleanup at exit." msgstr "" -#: c-api/init.rst:322 +#: c-api/init.rst:338 msgid "" "Set by the :option:`-v` option and the :envvar:`PYTHONVERBOSE` environment " "variable." msgstr "" -#: c-api/init.rst:329 +#: c-api/init.rst:345 msgid "Initializing and finalizing the interpreter" msgstr "" -#: c-api/init.rst:347 +#: c-api/init.rst:360 msgid "" "Initialize the Python interpreter. In an application embedding Python, " "this should be called before using any other Python/C API functions; see :" "ref:`Before Python Initialization ` for the few exceptions." msgstr "" -#: c-api/init.rst:351 +#: c-api/init.rst:364 msgid "" "This initializes the table of loaded modules (``sys.modules``), and creates " -"the fundamental modules :mod:`builtins`, :mod:`__main__` and :mod:`sys`. It " +"the fundamental modules :mod:`builtins`, :mod:`__main__` and :mod:`sys`. It " "also initializes the module search path (``sys.path``). It does not set " -"``sys.argv``; use :c:func:`PySys_SetArgvEx` for that. This is a no-op when " -"called for a second time (without calling :c:func:`Py_FinalizeEx` first). " -"There is no return value; it is a fatal error if the initialization fails." +"``sys.argv``; use the :ref:`Python Initialization Configuration ` API for that. This is a no-op when called for a second time " +"(without calling :c:func:`Py_FinalizeEx` first). There is no return value; " +"it is a fatal error if the initialization fails." msgstr "" -#: c-api/init.rst:373 +#: c-api/init.rst:386 msgid "" -"Use the :c:func:`Py_InitializeFromConfig` function to customize the :ref:" -"`Python Initialization Configuration `." +"Use :c:func:`Py_InitializeFromConfig` to customize the :ref:`Python " +"Initialization Configuration `." msgstr "" -#: c-api/init.rst:363 +#: c-api/init.rst:376 msgid "" "On Windows, changes the console mode from ``O_TEXT`` to ``O_BINARY``, which " "will also affect non-Python uses of the console using the C Runtime." msgstr "" -#: c-api/init.rst:369 +#: c-api/init.rst:382 msgid "" "This function works like :c:func:`Py_Initialize` if *initsigs* is ``1``. If " "*initsigs* is ``0``, it skips initialization registration of signal " -"handlers, which might be useful when Python is embedded." +"handlers, which may be useful when CPython is embedded as part of a larger " +"application." msgstr "" -#: c-api/init.rst:379 +#: c-api/init.rst:392 +msgid "" +"Initialize Python from *config* configuration, as described in :ref:`init-" +"from-config`." +msgstr "" + +#: c-api/init.rst:395 +msgid "" +"See the :ref:`init-config` section for details on pre-initializing the " +"interpreter, populating the runtime configuration structure, and querying " +"the returned status structure." +msgstr "" + +#: c-api/init.rst:402 msgid "" "Return true (nonzero) when the Python interpreter has been initialized, " "false (zero) if not. After :c:func:`Py_FinalizeEx` is called, this returns " "false until :c:func:`Py_Initialize` is called again." msgstr "" -#: c-api/init.rst:386 +#: c-api/init.rst:409 +msgid "" +"Return true (non-zero) if the main Python interpreter is :term:`shutting " +"down `. Return false (zero) otherwise." +msgstr "" + +#: c-api/init.rst:417 msgid "" "Undo all initializations made by :c:func:`Py_Initialize` and subsequent use " "of Python/C API functions, and destroy all sub-interpreters (see :c:func:" @@ -560,7 +617,7 @@ msgid "" "second time (without calling :c:func:`Py_Initialize` again first)." msgstr "" -#: c-api/init.rst:393 +#: c-api/init.rst:424 msgid "" "Since this is the reverse of :c:func:`Py_Initialize`, it should be called in " "the same thread with the same interpreter active. That means the main " @@ -568,13 +625,13 @@ msgid "" "`Py_RunMain` is running." msgstr "" -#: c-api/init.rst:398 +#: c-api/init.rst:429 msgid "" "Normally the return value is ``0``. If there were errors during finalization " "(flushing buffered data), ``-1`` is returned." msgstr "" -#: c-api/init.rst:402 +#: c-api/init.rst:433 msgid "" "This function is provided for a number of reasons. An embedding application " "might want to restart Python without having to restart the application " @@ -585,7 +642,7 @@ msgid "" "Python before exiting from the application." msgstr "" -#: c-api/init.rst:410 +#: c-api/init.rst:441 msgid "" "**Bugs and caveats:** The destruction of modules and objects in modules is " "done in random order; this may cause destructors (:meth:`~object.__del__` " @@ -600,74 +657,171 @@ msgid "" "more than once." msgstr "" -#: c-api/init.rst:421 +#: c-api/init.rst:452 msgid "" "Raises an :ref:`auditing event ` ``cpython." "_PySys_ClearAuditHooks`` with no arguments." msgstr "" -#: c-api/init.rst:427 +#: c-api/init.rst:459 msgid "" "This is a backwards-compatible version of :c:func:`Py_FinalizeEx` that " "disregards the return value." msgstr "" -#: c-api/init.rst:432 -msgid "Process-wide parameters" +#: c-api/init.rst:465 +msgid "" +"Similar to :c:func:`Py_Main` but *argv* is an array of bytes strings, " +"allowing the calling application to delegate the text decoding step to the " +"CPython runtime." msgstr "" -#: c-api/init.rst:442 +#: c-api/init.rst:474 msgid "" -"This API is kept for backward compatibility: setting :c:member:`PyConfig." -"stdio_encoding` and :c:member:`PyConfig.stdio_errors` should be used " -"instead, see :ref:`Python Initialization Configuration `." +"The main program for the standard interpreter, encapsulating a full " +"initialization/finalization cycle, as well as additional behaviour to " +"implement reading configurations settings from the environment and command " +"line, and then executing ``__main__`` in accordance with :ref:`using-on-" +"cmdline`." +msgstr "" + +#: c-api/init.rst:480 +msgid "" +"This is made available for programs which wish to support the full CPython " +"command line interface, rather than just embedding a Python runtime in a " +"larger application." +msgstr "" + +#: c-api/init.rst:484 +msgid "" +"The *argc* and *argv* parameters are similar to those which are passed to a " +"C program's :c:func:`main` function, except that the *argv* entries are " +"first converted to ``wchar_t`` using :c:func:`Py_DecodeLocale`. It is also " +"important to note that the argument list entries may be modified to point to " +"strings other than those passed in (however, the contents of the strings " +"pointed to by the argument list are not modified)." +msgstr "" + +#: c-api/init.rst:491 +msgid "" +"The return value will be ``0`` if the interpreter exits normally (i.e., " +"without an exception), ``1`` if the interpreter exits due to an exception, " +"or ``2`` if the argument list does not represent a valid Python command line." +msgstr "" + +#: c-api/init.rst:496 +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. If ``Py_InspectFlag`` is set, execution will " +"drop into the interactive Python prompt, at which point a second otherwise " +"unhandled :exc:`SystemExit` will still exit the process, while any other " +"means of exiting will set the return value as described above." +msgstr "" + +#: c-api/init.rst:503 +msgid "" +"In terms of the CPython runtime configuration APIs documented in the :ref:" +"`runtime configuration ` section (and without accounting for " +"error handling), ``Py_Main`` is approximately equivalent to::" +msgstr "" + +#: c-api/init.rst:507 +msgid "" +"PyConfig config;\n" +"PyConfig_InitPythonConfig(&config);\n" +"PyConfig_SetArgv(&config, argc, argv);\n" +"Py_InitializeFromConfig(&config);\n" +"PyConfig_Clear(&config);\n" +"\n" +"Py_RunMain();" +msgstr "" + +#: c-api/init.rst:515 +msgid "" +"In normal usage, an embedding application will call this function *instead* " +"of calling :c:func:`Py_Initialize`, :c:func:`Py_InitializeEx` or :c:func:" +"`Py_InitializeFromConfig` directly, and all settings will be applied as " +"described elsewhere in this documentation. If this function is instead " +"called *after* a preceding runtime initialization API call, then exactly " +"which environmental and command line configuration settings will be updated " +"is version dependent (as it depends on which settings correctly support " +"being modified after they have already been set once when the runtime was " +"first initialized)." +msgstr "" + +#: c-api/init.rst:528 +msgid "Executes the main module in a fully configured CPython runtime." msgstr "" -#: c-api/init.rst:447 +#: c-api/init.rst:530 msgid "" -"This function should be called before :c:func:`Py_Initialize`, if it is " -"called at all. It specifies which encoding and error handling to use with " -"standard IO, with the same meanings as in :func:`str.encode`." +"Executes the command (:c:member:`PyConfig.run_command`), the script (:c:" +"member:`PyConfig.run_filename`) or the module (:c:member:`PyConfig." +"run_module`) specified on the command line or in the configuration. If none " +"of these values are set, runs the interactive Python prompt (REPL) using the " +"``__main__`` module's global namespace." msgstr "" -#: c-api/init.rst:451 +#: c-api/init.rst:536 msgid "" -"It overrides :envvar:`PYTHONIOENCODING` values, and allows embedding code to " -"control IO encoding when the environment variable does not work." +"If :c:member:`PyConfig.inspect` is not set (the default), the return value " +"will be ``0`` if the interpreter exits normally (that is, without raising an " +"exception), or ``1`` if the interpreter exits due to an exception. If an " +"otherwise unhandled :exc:`SystemExit` is raised, the function will " +"immediately exit the process instead of returning ``1``." msgstr "" -#: c-api/init.rst:454 +#: c-api/init.rst:542 msgid "" -"*encoding* and/or *errors* may be ``NULL`` to use :envvar:`PYTHONIOENCODING` " -"and/or default values (depending on other settings)." +"If :c:member:`PyConfig.inspect` is set (such as when the :option:`-i` option " +"is used), rather than returning when the interpreter exits, execution will " +"instead resume in an interactive Python prompt (REPL) using the ``__main__`` " +"module's global namespace. If the interpreter exited with an exception, it " +"is immediately raised in the REPL session. The function return value is then " +"determined by the way the *REPL session* terminates: returning ``0`` if the " +"session terminates without raising an unhandled exception, exiting " +"immediately for an unhandled :exc:`SystemExit`, and returning ``1`` for any " +"other unhandled exception." msgstr "" -#: c-api/init.rst:458 +#: c-api/init.rst:552 msgid "" -"Note that :data:`sys.stderr` always uses the \"backslashreplace\" error " -"handler, regardless of this (or any other) setting." +"This function always finalizes the Python interpreter regardless of whether " +"it returns a value or immediately exits the process due to an unhandled :exc:" +"`SystemExit` exception." msgstr "" -#: c-api/init.rst:461 +#: c-api/init.rst:556 msgid "" -"If :c:func:`Py_FinalizeEx` is called, this function will need to be called " -"again in order to affect subsequent calls to :c:func:`Py_Initialize`." +"See :ref:`Python Configuration ` for an example of a " +"customized Python that always runs in isolated mode using :c:func:" +"`Py_RunMain`." msgstr "" -#: c-api/init.rst:464 +#: c-api/init.rst:562 msgid "" -"Returns ``0`` if successful, a nonzero value on error (e.g. calling after " -"the interpreter has already been initialized)." +"Register an :mod:`atexit` callback for the target interpreter *interp*. This " +"is similar to :c:func:`Py_AtExit`, but takes an explicit interpreter and " +"data pointer for the callback." +msgstr "" + +#: c-api/init.rst:566 +msgid "The :term:`GIL` must be held for *interp*." msgstr "" -#: c-api/init.rst:479 +#: c-api/init.rst:571 +msgid "Process-wide parameters" +msgstr "" + +#: c-api/init.rst:581 msgid "" "This API is kept for backward compatibility: setting :c:member:`PyConfig." "program_name` should be used instead, see :ref:`Python Initialization " "Configuration `." msgstr "" -#: c-api/init.rst:483 +#: c-api/init.rst:585 msgid "" "This function should be called before :c:func:`Py_Initialize` is called for " "the first time, if it is called at all. It tells the interpreter the value " @@ -681,58 +835,68 @@ msgid "" "this storage." msgstr "" -#: c-api/init.rst:760 c-api/init.rst:822 +#: c-api/init.rst:838 c-api/init.rst:900 msgid "" "Use :c:func:`Py_DecodeLocale` to decode a bytes string to get a :c:expr:" "`wchar_t*` string." msgstr "" -#: c-api/init.rst:504 +#: c-api/init.rst:604 msgid "" -"Return the program name set with :c:func:`Py_SetProgramName`, or the " +"Return the program name set with :c:member:`PyConfig.program_name`, or the " "default. The returned string points into static storage; the caller should " "not modify its value." msgstr "" -#: c-api/init.rst:527 c-api/init.rst:587 c-api/init.rst:834 +#: c-api/init.rst:630 c-api/init.rst:698 c-api/init.rst:912 msgid "" "This function should not be called before :c:func:`Py_Initialize`, otherwise " "it returns ``NULL``." msgstr "" -#: c-api/init.rst:530 c-api/init.rst:590 c-api/init.rst:837 +#: c-api/init.rst:633 c-api/init.rst:701 c-api/init.rst:915 msgid "It now returns ``NULL`` if called before :c:func:`Py_Initialize`." msgstr "" -#: c-api/init.rst:517 +#: c-api/init.rst:704 +msgid "Get :data:`sys.executable` instead." +msgstr "" + +#: c-api/init.rst:620 msgid "" "Return the *prefix* for installed platform-independent files. This is " "derived through a number of complicated rules from the program name set " -"with :c:func:`Py_SetProgramName` and some environment variables; for " +"with :c:member:`PyConfig.program_name` and some environment variables; for " "example, if the program name is ``'/usr/local/bin/python'``, the prefix is " "``'/usr/local'``. The returned string points into static storage; the caller " "should not modify its value. This corresponds to the :makevar:`prefix` " "variable in the top-level :file:`Makefile` and the :option:`--prefix` " "argument to the :program:`configure` script at build time. The value is " -"available to Python code as ``sys.prefix``. It is only useful on Unix. See " -"also the next function." +"available to Python code as ``sys.base_prefix``. It is only useful on Unix. " +"See also the next function." msgstr "" -#: c-api/init.rst:536 +#: c-api/init.rst:636 +msgid "" +"Get :data:`sys.base_prefix` instead, or :data:`sys.prefix` if :ref:`virtual " +"environments ` need to be handled." +msgstr "" + +#: c-api/init.rst:643 msgid "" "Return the *exec-prefix* for installed platform-*dependent* files. This is " "derived through a number of complicated rules from the program name set " -"with :c:func:`Py_SetProgramName` and some environment variables; for " +"with :c:member:`PyConfig.program_name` and some environment variables; for " "example, if the program name is ``'/usr/local/bin/python'``, the exec-prefix " "is ``'/usr/local'``. The returned string points into static storage; the " "caller should not modify its value. This corresponds to the :makevar:" "`exec_prefix` variable in the top-level :file:`Makefile` and the ``--exec-" "prefix`` argument to the :program:`configure` script at build time. The " -"value is available to Python code as ``sys.exec_prefix``. It is only useful " -"on Unix." +"value is available to Python code as ``sys.base_exec_prefix``. It is only " +"useful on Unix." msgstr "" -#: c-api/init.rst:546 +#: c-api/init.rst:654 msgid "" "Background: The exec-prefix differs from the prefix when platform dependent " "files (such as executables and shared libraries) are installed in a " @@ -741,7 +905,7 @@ msgid "" "independent may be installed in :file:`/usr/local`." msgstr "" -#: c-api/init.rst:552 +#: c-api/init.rst:660 msgid "" "Generally speaking, a platform is a combination of hardware and software " "families, e.g. Sparc machines running the Solaris 2.x operating system are " @@ -755,7 +919,7 @@ msgid "" "independent from the Python version by which they were compiled!)." msgstr "" -#: c-api/init.rst:563 +#: c-api/init.rst:671 msgid "" "System administrators will know how to configure the :program:`mount` or :" "program:`automount` programs to share :file:`/usr/local` between platforms " @@ -763,19 +927,25 @@ msgid "" "platform." msgstr "" -#: c-api/init.rst:581 +#: c-api/init.rst:682 +msgid "" +"Get :data:`sys.base_exec_prefix` instead, or :data:`sys.exec_prefix` if :ref:" +"`virtual environments ` need to be handled." +msgstr "" + +#: c-api/init.rst:692 msgid "" "Return the full program name of the Python executable; this is computed as " "a side-effect of deriving the default module search path from the program " -"name (set by :c:func:`Py_SetProgramName` above). The returned string points " +"name (set by :c:member:`PyConfig.program_name`). The returned string points " "into static storage; the caller should not modify its value. The value is " "available to Python code as ``sys.executable``." msgstr "" -#: c-api/init.rst:601 +#: c-api/init.rst:714 msgid "" "Return the default module search path; this is computed from the program " -"name (set by :c:func:`Py_SetProgramName` above) and some environment " +"name (set by :c:member:`PyConfig.program_name`) and some environment " "variables. The returned string consists of a series of directory names " "separated by a platform dependent delimiter character. The delimiter " "character is ``':'`` on Unix and macOS, ``';'`` on Windows. The returned " @@ -785,62 +955,21 @@ msgid "" "for loading modules." msgstr "" -#: c-api/init.rst:627 -msgid "" -"This API is kept for backward compatibility: setting :c:member:`PyConfig." -"module_search_paths` and :c:member:`PyConfig.module_search_paths_set` should " -"be used instead, see :ref:`Python Initialization Configuration `." +#: c-api/init.rst:732 +msgid "Get :data:`sys.path` instead." msgstr "" -#: c-api/init.rst:632 -msgid "" -"Set the default module search path. If this function is called before :c:" -"func:`Py_Initialize`, then :c:func:`Py_GetPath` won't attempt to compute a " -"default search path but uses the one provided instead. This is useful if " -"Python is embedded by an application that has full knowledge of the location " -"of all modules. The path components should be separated by the platform " -"dependent delimiter character, which is ``':'`` on Unix and macOS, ``';'`` " -"on Windows." -msgstr "" - -#: c-api/init.rst:640 -msgid "" -"This also causes :data:`sys.executable` to be set to the program full path " -"(see :c:func:`Py_GetProgramFullPath`) and for :data:`sys.prefix` and :data:" -"`sys.exec_prefix` to be empty. It is up to the caller to modify these if " -"required after calling :c:func:`Py_Initialize`." -msgstr "" - -#: c-api/init.rst:645 -msgid "" -"Use :c:func:`Py_DecodeLocale` to decode a bytes string to get a :c:expr:" -"`wchar_*` string." -msgstr "" - -#: c-api/init.rst:648 -msgid "" -"The path argument is copied internally, so the caller may free it after the " -"call completes." -msgstr "" - -#: c-api/init.rst:651 -msgid "" -"The program full path is now used for :data:`sys.executable`, instead of the " -"program name." -msgstr "" - -#: c-api/init.rst:660 +#: c-api/init.rst:738 msgid "" "Return the version of this Python interpreter. This is a string that looks " "something like ::" msgstr "" -#: c-api/init.rst:663 +#: c-api/init.rst:741 msgid "\"3.0a5+ (py3k:63103M, May 12 2008, 00:53:55) \\n[GCC 4.2.3]\"" msgstr "" -#: c-api/init.rst:667 +#: c-api/init.rst:745 msgid "" "The first word (up to the first space character) is the current Python " "version; the first characters are the major and minor version separated by a " @@ -849,11 +978,11 @@ msgid "" "version`." msgstr "" -#: c-api/init.rst:672 +#: c-api/init.rst:750 msgid "See also the :c:var:`Py_Version` constant." msgstr "" -#: c-api/init.rst:679 +#: c-api/init.rst:757 msgid "" "Return the platform identifier for the current platform. On Unix, this is " "formed from the \"official\" name of the operating system, converted to " @@ -864,50 +993,50 @@ msgid "" "available to Python code as ``sys.platform``." msgstr "" -#: c-api/init.rst:690 +#: c-api/init.rst:768 msgid "" "Return the official copyright string for the current Python version, for " "example" msgstr "" -#: c-api/init.rst:692 +#: c-api/init.rst:770 msgid "``'Copyright 1991-1995 Stichting Mathematisch Centrum, Amsterdam'``" msgstr "" -#: c-api/init.rst:696 +#: c-api/init.rst:774 msgid "" "The returned string points into static storage; the caller should not modify " "its value. The value is available to Python code as ``sys.copyright``." msgstr "" -#: c-api/init.rst:702 +#: c-api/init.rst:780 msgid "" "Return an indication of the compiler used to build the current Python " "version, in square brackets, for example::" msgstr "" -#: c-api/init.rst:705 +#: c-api/init.rst:783 msgid "\"[GCC 2.7.2.2]\"" msgstr "" -#: c-api/init.rst:723 +#: c-api/init.rst:801 msgid "" "The returned string points into static storage; the caller should not modify " "its value. The value is available to Python code as part of the variable " "``sys.version``." msgstr "" -#: c-api/init.rst:716 +#: c-api/init.rst:794 msgid "" "Return information about the sequence number and build date and time of the " "current Python interpreter instance, for example ::" msgstr "" -#: c-api/init.rst:719 +#: c-api/init.rst:797 msgid "\"#67, Aug 1 1997, 22:34:28\"" msgstr "" -#: c-api/init.rst:735 +#: c-api/init.rst:813 msgid "" "This API is kept for backward compatibility: setting :c:member:`PyConfig." "argv`, :c:member:`PyConfig.parse_argv` and :c:member:`PyConfig.safe_path` " @@ -915,7 +1044,7 @@ msgid "" "config>`." msgstr "" -#: c-api/init.rst:740 +#: c-api/init.rst:818 msgid "" "Set :data:`sys.argv` based on *argc* and *argv*. These parameters are " "similar to those passed to the program's :c:func:`main` function with the " @@ -926,84 +1055,84 @@ msgid "" "fatal condition is signalled using :c:func:`Py_FatalError`." msgstr "" -#: c-api/init.rst:748 +#: c-api/init.rst:826 msgid "" "If *updatepath* is zero, this is all the function does. If *updatepath* is " "non-zero, the function also modifies :data:`sys.path` according to the " "following algorithm:" msgstr "" -#: c-api/init.rst:752 +#: c-api/init.rst:830 msgid "" "If the name of an existing script is passed in ``argv[0]``, the absolute " "path of the directory where the script is located is prepended to :data:`sys." "path`." msgstr "" -#: c-api/init.rst:755 +#: c-api/init.rst:833 msgid "" "Otherwise (that is, if *argc* is ``0`` or ``argv[0]`` doesn't point to an " "existing file name), an empty string is prepended to :data:`sys.path`, which " "is the same as prepending the current working directory (``\".\"``)." msgstr "" -#: c-api/init.rst:799 +#: c-api/init.rst:877 msgid "" "See also :c:member:`PyConfig.orig_argv` and :c:member:`PyConfig.argv` " "members of the :ref:`Python Initialization Configuration `." msgstr "" -#: c-api/init.rst:767 +#: c-api/init.rst:845 msgid "" "It is recommended that applications embedding the Python interpreter for " "purposes other than executing a single script pass ``0`` as *updatepath*, " "and update :data:`sys.path` themselves if desired. See :cve:`2008-5983`." msgstr "" -#: c-api/init.rst:772 +#: c-api/init.rst:850 msgid "" "On versions before 3.1.3, you can achieve the same effect by manually " "popping the first :data:`sys.path` element after having called :c:func:" "`PySys_SetArgv`, for example using::" msgstr "" -#: c-api/init.rst:776 +#: c-api/init.rst:854 msgid "PyRun_SimpleString(\"import sys; sys.path.pop(0)\\n\");" msgstr "" -#: c-api/init.rst:788 +#: c-api/init.rst:866 msgid "" "This API is kept for backward compatibility: setting :c:member:`PyConfig." "argv` and :c:member:`PyConfig.parse_argv` should be used instead, see :ref:" "`Python Initialization Configuration `." msgstr "" -#: c-api/init.rst:792 +#: c-api/init.rst:870 msgid "" "This function works like :c:func:`PySys_SetArgvEx` with *updatepath* set to " "``1`` unless the :program:`python` interpreter was started with the :option:" "`-I`." msgstr "" -#: c-api/init.rst:802 +#: c-api/init.rst:880 msgid "The *updatepath* value depends on :option:`-I`." msgstr "" -#: c-api/init.rst:809 +#: c-api/init.rst:887 msgid "" "This API is kept for backward compatibility: setting :c:member:`PyConfig." "home` should be used instead, see :ref:`Python Initialization Configuration " "`." msgstr "" -#: c-api/init.rst:813 +#: c-api/init.rst:891 msgid "" "Set the default \"home\" directory, that is, the location of the standard " "Python libraries. See :envvar:`PYTHONHOME` for the meaning of the argument " "string." msgstr "" -#: c-api/init.rst:817 +#: c-api/init.rst:895 msgid "" "The argument should point to a zero-terminated character string in static " "storage whose contents will not change for the duration of the program's " @@ -1011,18 +1140,24 @@ msgid "" "this storage." msgstr "" -#: c-api/init.rst:830 +#: c-api/init.rst:908 +msgid "" +"Return the default \"home\", that is, the value set by :c:member:`PyConfig." +"home`, or the value of the :envvar:`PYTHONHOME` environment variable if it " +"is set." +msgstr "" + +#: c-api/init.rst:918 msgid "" -"Return the default \"home\", that is, the value set by a previous call to :c:" -"func:`Py_SetPythonHome`, or the value of the :envvar:`PYTHONHOME` " -"environment variable if it is set." +"Get :c:member:`PyConfig.home` or :envvar:`PYTHONHOME` environment variable " +"instead." msgstr "" -#: c-api/init.rst:844 +#: c-api/init.rst:926 msgid "Thread State and the Global Interpreter Lock" msgstr "" -#: c-api/init.rst:851 +#: c-api/init.rst:933 msgid "" "The Python interpreter is not fully thread-safe. In order to support multi-" "threaded Python programs, there's a global lock, called the :term:`global " @@ -1034,7 +1169,7 @@ msgid "" "once instead of twice." msgstr "" -#: c-api/init.rst:861 +#: c-api/init.rst:943 msgid "" "Therefore, the rule exists that only the thread that has acquired the :term:" "`GIL` may operate on Python objects or call Python/C API functions. In order " @@ -1044,7 +1179,7 @@ msgid "" "a file, so that other Python threads can run in the meantime." msgstr "" -#: c-api/init.rst:871 +#: c-api/init.rst:953 msgid "" "The Python interpreter keeps some thread-specific bookkeeping information " "inside a data structure called :c:type:`PyThreadState`. There's also one " @@ -1052,17 +1187,17 @@ msgid "" "retrieved using :c:func:`PyThreadState_Get`." msgstr "" -#: c-api/init.rst:877 +#: c-api/init.rst:959 msgid "Releasing the GIL from extension code" msgstr "" -#: c-api/init.rst:879 +#: c-api/init.rst:961 msgid "" "Most extension code manipulating the :term:`GIL` has the following simple " "structure::" msgstr "" -#: c-api/init.rst:882 +#: c-api/init.rst:964 msgid "" "Save the thread state in a local variable.\n" "Release the global interpreter lock.\n" @@ -1071,29 +1206,29 @@ msgid "" "Restore the thread state from the local variable." msgstr "" -#: c-api/init.rst:888 +#: c-api/init.rst:970 msgid "This is so common that a pair of macros exists to simplify it::" msgstr "" -#: c-api/init.rst:890 +#: c-api/init.rst:972 msgid "" "Py_BEGIN_ALLOW_THREADS\n" "... Do some blocking I/O operation ...\n" "Py_END_ALLOW_THREADS" msgstr "" -#: c-api/init.rst:898 +#: c-api/init.rst:980 msgid "" "The :c:macro:`Py_BEGIN_ALLOW_THREADS` macro opens a new block and declares a " "hidden local variable; the :c:macro:`Py_END_ALLOW_THREADS` macro closes the " "block." msgstr "" -#: c-api/init.rst:902 +#: c-api/init.rst:984 msgid "The block above expands to the following code::" msgstr "" -#: c-api/init.rst:904 +#: c-api/init.rst:986 msgid "" "PyThreadState *_save;\n" "\n" @@ -1102,7 +1237,7 @@ msgid "" "PyEval_RestoreThread(_save);" msgstr "" -#: c-api/init.rst:914 +#: c-api/init.rst:996 msgid "" "Here is how these functions work: the global interpreter lock is used to " "protect the pointer to the current thread state. When releasing the lock " @@ -1113,7 +1248,7 @@ msgid "" "state, the lock must be acquired before storing the thread state pointer." msgstr "" -#: c-api/init.rst:923 +#: c-api/init.rst:1005 msgid "" "Calling system I/O functions is the most common use case for releasing the " "GIL, but it can also be useful before calling long-running computations " @@ -1123,11 +1258,11 @@ msgid "" "compressing or hashing data." msgstr "" -#: c-api/init.rst:934 +#: c-api/init.rst:1016 msgid "Non-Python created threads" msgstr "" -#: c-api/init.rst:936 +#: c-api/init.rst:1018 msgid "" "When threads are created using the dedicated Python APIs (such as the :mod:" "`threading` module), a thread state is automatically associated to them and " @@ -1137,7 +1272,7 @@ msgid "" "for them." msgstr "" -#: c-api/init.rst:943 +#: c-api/init.rst:1025 msgid "" "If you need to call Python code from these threads (often this will be part " "of a callback API provided by the aforementioned third-party library), you " @@ -1148,14 +1283,14 @@ msgid "" "finally free the thread state data structure." msgstr "" -#: c-api/init.rst:951 +#: c-api/init.rst:1033 msgid "" "The :c:func:`PyGILState_Ensure` and :c:func:`PyGILState_Release` functions " "do all of the above automatically. The typical idiom for calling into " "Python from a C thread is::" msgstr "" -#: c-api/init.rst:955 +#: c-api/init.rst:1037 msgid "" "PyGILState_STATE gstate;\n" "gstate = PyGILState_Ensure();\n" @@ -1168,7 +1303,7 @@ msgid "" "PyGILState_Release(gstate);" msgstr "" -#: c-api/init.rst:965 +#: c-api/init.rst:1047 msgid "" "Note that the ``PyGILState_*`` functions assume there is only one global " "interpreter (created automatically by :c:func:`Py_Initialize`). Python " @@ -1177,11 +1312,11 @@ msgid "" "``PyGILState_*`` API is unsupported." msgstr "" -#: c-api/init.rst:975 +#: c-api/init.rst:1057 msgid "Cautions about fork()" msgstr "" -#: c-api/init.rst:977 +#: c-api/init.rst:1059 msgid "" "Another important thing to note about threads is their behaviour in the face " "of the C :c:func:`fork` call. On most systems with :c:func:`fork`, after a " @@ -1190,7 +1325,7 @@ msgid "" "CPython's runtime." msgstr "" -#: c-api/init.rst:983 +#: c-api/init.rst:1065 msgid "" "The fact that only the \"current\" thread remains means any locks held by " "other threads will never be released. Python solves this for :func:`os.fork` " @@ -1207,7 +1342,7 @@ msgid "" "locks, but is not always able to." msgstr "" -#: c-api/init.rst:998 +#: c-api/init.rst:1080 msgid "" "The fact that all other threads go away also means that CPython's runtime " "state there must be cleaned up properly, which :func:`os.fork` does. This " @@ -1220,17 +1355,17 @@ msgid "" "called immediately after." msgstr "" -#: c-api/init.rst:1011 +#: c-api/init.rst:1093 msgid "High-level API" msgstr "" -#: c-api/init.rst:1013 +#: c-api/init.rst:1095 msgid "" "These are the most commonly used types and functions when writing C " "extension code, or when embedding the Python interpreter:" msgstr "" -#: c-api/init.rst:1018 +#: c-api/init.rst:1100 msgid "" "This data structure represents the state shared by a number of cooperating " "threads. Threads belonging to the same interpreter share their module " @@ -1238,7 +1373,7 @@ msgid "" "in this structure." msgstr "" -#: c-api/init.rst:1023 +#: c-api/init.rst:1105 msgid "" "Threads belonging to different interpreters initially share nothing, except " "process state like available memory, open file descriptors and such. The " @@ -1246,52 +1381,41 @@ msgid "" "which interpreter they belong." msgstr "" -#: c-api/init.rst:1031 +#: c-api/init.rst:1113 msgid "" "This data structure represents the state of a single thread. The only " "public data member is:" msgstr "" -#: c-api/init.rst:1036 +#: c-api/init.rst:1118 msgid "This thread's interpreter state." msgstr "" -#: c-api/init.rst:1047 +#: c-api/init.rst:1129 msgid "Deprecated function which does nothing." msgstr "" -#: c-api/init.rst:1049 +#: c-api/init.rst:1131 msgid "" "In Python 3.6 and older, this function created the GIL if it didn't exist." msgstr "" -#: c-api/init.rst:1051 +#: c-api/init.rst:1133 msgid "The function now does nothing." msgstr "" -#: c-api/init.rst:1054 +#: c-api/init.rst:1136 msgid "" "This function is now called by :c:func:`Py_Initialize()`, so you don't have " "to call it yourself anymore." msgstr "" -#: c-api/init.rst:1058 +#: c-api/init.rst:1140 msgid "" "This function cannot be called before :c:func:`Py_Initialize()` anymore." msgstr "" -#: c-api/init.rst:1068 -msgid "" -"Returns a non-zero value if :c:func:`PyEval_InitThreads` has been called. " -"This function can be called without holding the GIL, and therefore can be " -"used to avoid calls to the locking API when running single-threaded." -msgstr "" - -#: c-api/init.rst:1072 -msgid "The :term:`GIL` is now initialized by :c:func:`Py_Initialize()`." -msgstr "" - -#: c-api/init.rst:1080 +#: c-api/init.rst:1150 msgid "" "Release the global interpreter lock (if it has been created) and reset the " "thread state to ``NULL``, returning the previous thread state (which is not " @@ -1299,7 +1423,7 @@ msgid "" "acquired it." msgstr "" -#: c-api/init.rst:1088 +#: c-api/init.rst:1158 msgid "" "Acquire the global interpreter lock (if it has been created) and set the " "thread state to *tstate*, which must not be ``NULL``. If the lock has been " @@ -1307,36 +1431,53 @@ msgid "" "ensues." msgstr "" -#: c-api/init.rst:1140 c-api/init.rst:1422 +#: c-api/init.rst:1223 c-api/init.rst:1519 msgid "" "Calling this function from a thread when the runtime is finalizing will " "terminate the thread, even if the thread was not created by Python. You can " -"use :c:func:`!_Py_IsFinalizing` or :func:`sys.is_finalizing` to check if the " +"use :c:func:`Py_IsFinalizing` or :func:`sys.is_finalizing` to check if the " "interpreter is in process of being finalized before calling this function to " "avoid unwanted termination." msgstr "" -#: c-api/init.rst:1102 +#: c-api/init.rst:1172 msgid "" "Return the current thread state. The global interpreter lock must be held. " "When the current thread state is ``NULL``, this issues a fatal error (so " "that the caller needn't check for ``NULL``)." msgstr "" -#: c-api/init.rst:1109 +#: c-api/init.rst:1176 +msgid "See also :c:func:`PyThreadState_GetUnchecked`." +msgstr "" + +#: c-api/init.rst:1181 +msgid "" +"Similar to :c:func:`PyThreadState_Get`, but don't kill the process with a " +"fatal error if it is NULL. The caller is responsible to check if the result " +"is NULL." +msgstr "" + +#: c-api/init.rst:1185 +msgid "" +"In Python 3.5 to 3.12, the function was private and known as " +"``_PyThreadState_UncheckedGet()``." +msgstr "" + +#: c-api/init.rst:1192 msgid "" "Swap the current thread state with the thread state given by the argument " "*tstate*, which may be ``NULL``. The global interpreter lock must be held " "and is not released." msgstr "" -#: c-api/init.rst:1114 +#: c-api/init.rst:1197 msgid "" "The following functions use thread-local storage, and are not compatible " "with sub-interpreters:" msgstr "" -#: c-api/init.rst:1119 +#: c-api/init.rst:1202 msgid "" "Ensure that the current thread is ready to call the Python C API regardless " "of the current state of Python, or of the global interpreter lock. This may " @@ -1349,7 +1490,7 @@ msgid "" "is acceptable." msgstr "" -#: c-api/init.rst:1129 +#: c-api/init.rst:1212 msgid "" "The return value is an opaque \"handle\" to the thread state when :c:func:" "`PyGILState_Ensure` was called, and must be passed to :c:func:" @@ -1359,13 +1500,13 @@ msgid "" "func:`PyGILState_Release`." msgstr "" -#: c-api/init.rst:1136 +#: c-api/init.rst:1219 msgid "" "When the function returns, the current thread will hold the GIL and be able " "to call arbitrary Python code. Failure is a fatal error." msgstr "" -#: c-api/init.rst:1148 +#: c-api/init.rst:1231 msgid "" "Release any resources previously acquired. After this call, Python's state " "will be the same as it was prior to the corresponding :c:func:" @@ -1373,13 +1514,13 @@ msgid "" "caller, hence the use of the GILState API)." msgstr "" -#: c-api/init.rst:1153 +#: c-api/init.rst:1236 msgid "" "Every call to :c:func:`PyGILState_Ensure` must be matched by a call to :c:" "func:`PyGILState_Release` on the same thread." msgstr "" -#: c-api/init.rst:1159 +#: c-api/init.rst:1242 msgid "" "Get the current thread state for this thread. May return ``NULL`` if no " "GILState API has been used on the current thread. Note that the main thread " @@ -1387,7 +1528,7 @@ msgid "" "made on the main thread. This is mainly a helper/diagnostic function." msgstr "" -#: c-api/init.rst:1167 +#: c-api/init.rst:1250 msgid "" "Return ``1`` if the current thread is holding the GIL and ``0`` otherwise. " "This function can be called from any thread at any time. Only if it has had " @@ -1398,13 +1539,13 @@ msgid "" "otherwise behave differently." msgstr "" -#: c-api/init.rst:1179 +#: c-api/init.rst:1262 msgid "" "The following macros are normally used without a trailing semicolon; look " "for example usage in the Python source distribution." msgstr "" -#: c-api/init.rst:1185 +#: c-api/init.rst:1268 msgid "" "This macro expands to ``{ PyThreadState *_save; _save = PyEval_SaveThread();" "``. Note that it contains an opening brace; it must be matched with a " @@ -1412,7 +1553,7 @@ msgid "" "discussion of this macro." msgstr "" -#: c-api/init.rst:1193 +#: c-api/init.rst:1276 msgid "" "This macro expands to ``PyEval_RestoreThread(_save); }``. Note that it " "contains a closing brace; it must be matched with an earlier :c:macro:" @@ -1420,91 +1561,95 @@ msgid "" "macro." msgstr "" -#: c-api/init.rst:1201 +#: c-api/init.rst:1284 msgid "" "This macro expands to ``PyEval_RestoreThread(_save);``: it is equivalent to :" "c:macro:`Py_END_ALLOW_THREADS` without the closing brace." msgstr "" -#: c-api/init.rst:1207 +#: c-api/init.rst:1290 msgid "" "This macro expands to ``_save = PyEval_SaveThread();``: it is equivalent to :" "c:macro:`Py_BEGIN_ALLOW_THREADS` without the opening brace and variable " "declaration." msgstr "" -#: c-api/init.rst:1213 +#: c-api/init.rst:1296 msgid "Low-level API" msgstr "" -#: c-api/init.rst:1215 +#: c-api/init.rst:1298 msgid "" "All of the following functions must be called after :c:func:`Py_Initialize`." msgstr "" -#: c-api/init.rst:1217 +#: c-api/init.rst:1300 msgid ":c:func:`Py_Initialize()` now initializes the :term:`GIL`." msgstr "" -#: c-api/init.rst:1223 +#: c-api/init.rst:1306 msgid "" "Create a new interpreter state object. The global interpreter lock need not " "be held, but may be held if it is necessary to serialize calls to this " "function." msgstr "" -#: c-api/init.rst:1227 +#: c-api/init.rst:1310 msgid "" "Raises an :ref:`auditing event ` ``cpython." "PyInterpreterState_New`` with no arguments." msgstr "" -#: c-api/init.rst:1232 +#: c-api/init.rst:1315 msgid "" "Reset all information in an interpreter state object. The global " "interpreter lock must be held." msgstr "" -#: c-api/init.rst:1235 +#: c-api/init.rst:1318 msgid "" "Raises an :ref:`auditing event ` ``cpython." "PyInterpreterState_Clear`` with no arguments." msgstr "" -#: c-api/init.rst:1240 +#: c-api/init.rst:1323 msgid "" "Destroy an interpreter state object. The global interpreter lock need not " "be held. The interpreter state must have been reset with a previous call " "to :c:func:`PyInterpreterState_Clear`." msgstr "" -#: c-api/init.rst:1247 +#: c-api/init.rst:1330 msgid "" "Create a new thread state object belonging to the given interpreter object. " "The global interpreter lock need not be held, but may be held if it is " "necessary to serialize calls to this function." msgstr "" -#: c-api/init.rst:1254 +#: c-api/init.rst:1337 msgid "" "Reset all information in a thread state object. The global interpreter lock " "must be held." msgstr "" -#: c-api/init.rst:1257 +#: c-api/init.rst:1340 msgid "" "This function now calls the :c:member:`PyThreadState.on_delete` callback. " "Previously, that happened in :c:func:`PyThreadState_Delete`." msgstr "" -#: c-api/init.rst:1264 +#: c-api/init.rst:1344 +msgid "The :c:member:`PyThreadState.on_delete` callback was removed." +msgstr "" + +#: c-api/init.rst:1350 msgid "" "Destroy a thread state object. The global interpreter lock need not be " "held. The thread state must have been reset with a previous call to :c:func:" "`PyThreadState_Clear`." msgstr "" -#: c-api/init.rst:1271 +#: c-api/init.rst:1357 msgid "" "Destroy the current thread state and release the global interpreter lock. " "Like :c:func:`PyThreadState_Delete`, the global interpreter lock must be " @@ -1512,118 +1657,124 @@ msgid "" "`PyThreadState_Clear`." msgstr "" -#: c-api/init.rst:1279 +#: c-api/init.rst:1365 msgid "Get the current frame of the Python thread state *tstate*." msgstr "" -#: c-api/init.rst:1281 +#: c-api/init.rst:1367 msgid "" "Return a :term:`strong reference`. Return ``NULL`` if no frame is currently " "executing." msgstr "" -#: c-api/init.rst:1284 +#: c-api/init.rst:1370 msgid "See also :c:func:`PyEval_GetFrame`." msgstr "" -#: c-api/init.rst:1295 c-api/init.rst:1304 +#: c-api/init.rst:1381 c-api/init.rst:1390 msgid "*tstate* must not be ``NULL``." msgstr "" -#: c-api/init.rst:1293 +#: c-api/init.rst:1379 msgid "" "Get the unique thread state identifier of the Python thread state *tstate*." msgstr "" -#: c-api/init.rst:1302 +#: c-api/init.rst:1388 msgid "Get the interpreter of the Python thread state *tstate*." msgstr "" -#: c-api/init.rst:1311 +#: c-api/init.rst:1397 msgid "Suspend tracing and profiling in the Python thread state *tstate*." msgstr "" -#: c-api/init.rst:1313 +#: c-api/init.rst:1399 msgid "Resume them using the :c:func:`PyThreadState_LeaveTracing` function." msgstr "" -#: c-api/init.rst:1320 +#: c-api/init.rst:1406 msgid "" "Resume tracing and profiling in the Python thread state *tstate* suspended " "by the :c:func:`PyThreadState_EnterTracing` function." msgstr "" -#: c-api/init.rst:1323 +#: c-api/init.rst:1409 msgid "" "See also :c:func:`PyEval_SetTrace` and :c:func:`PyEval_SetProfile` functions." msgstr "" -#: c-api/init.rst:1331 +#: c-api/init.rst:1417 msgid "Get the current interpreter." msgstr "" -#: c-api/init.rst:1333 +#: c-api/init.rst:1419 msgid "" "Issue a fatal error if there no current Python thread state or no current " "interpreter. It cannot return NULL." msgstr "" -#: c-api/init.rst:1346 +#: c-api/init.rst:1432 c-api/init.rst:1454 msgid "The caller must hold the GIL." msgstr "" -#: c-api/init.rst:1343 +#: c-api/init.rst:1429 msgid "" "Return the interpreter's unique ID. If there was any error in doing so then " "``-1`` is returned and an error is set." msgstr "" -#: c-api/init.rst:1353 +#: c-api/init.rst:1439 msgid "" "Return a dictionary in which interpreter-specific data may be stored. If " "this function returns ``NULL`` then no exception has been raised and the " "caller should assume no interpreter-specific dict is available." msgstr "" -#: c-api/init.rst:1357 +#: c-api/init.rst:1443 msgid "" "This is not a replacement for :c:func:`PyModule_GetState()`, which " "extensions should use to store interpreter-specific state information." msgstr "" -#: c-api/init.rst:1364 +#: c-api/init.rst:1451 +msgid "" +"Return a :term:`strong reference` to the ``__main__`` :ref:`module object " +"` for the given interpreter." +msgstr "" + +#: c-api/init.rst:1461 msgid "Type of a frame evaluation function." msgstr "" -#: c-api/init.rst:1366 +#: c-api/init.rst:1463 msgid "" "The *throwflag* parameter is used by the ``throw()`` method of generators: " "if non-zero, handle the current exception." msgstr "" -#: c-api/init.rst:1369 +#: c-api/init.rst:1466 msgid "The function now takes a *tstate* parameter." msgstr "" -#: c-api/init.rst:1372 +#: c-api/init.rst:1469 msgid "" "The *frame* parameter changed from ``PyFrameObject*`` to " "``_PyInterpreterFrame*``." msgstr "" -#: c-api/init.rst:1377 +#: c-api/init.rst:1474 msgid "Get the frame evaluation function." msgstr "" -#: c-api/init.rst:1387 +#: c-api/init.rst:1484 msgid "See the :pep:`523` \"Adding a frame evaluation API to CPython\"." msgstr "" -#: c-api/init.rst:1385 +#: c-api/init.rst:1482 msgid "Set the frame evaluation function." msgstr "" -#: c-api/init.rst:1394 +#: c-api/init.rst:1491 msgid "" "Return a dictionary in which extensions can store thread-specific state " "information. Each extension should use a unique key to use to store state " @@ -1632,7 +1783,7 @@ msgid "" "raised and the caller should assume no current thread state is available." msgstr "" -#: c-api/init.rst:1403 +#: c-api/init.rst:1500 msgid "" "Asynchronously raise an exception in a thread. The *id* argument is the " "thread id of the target thread; *exc* is the exception object to be raised. " @@ -1644,33 +1795,33 @@ msgid "" "raises no exceptions." msgstr "" -#: c-api/init.rst:1411 +#: c-api/init.rst:1508 msgid "" "The type of the *id* parameter changed from :c:expr:`long` to :c:expr:" "`unsigned long`." msgstr "" -#: c-api/init.rst:1417 +#: c-api/init.rst:1514 msgid "" "Acquire the global interpreter lock and set the current thread state to " "*tstate*, which must not be ``NULL``. The lock must have been created " "earlier. If this thread already has the lock, deadlock ensues." msgstr "" -#: c-api/init.rst:1466 +#: c-api/init.rst:1525 msgid "" "Updated to be consistent with :c:func:`PyEval_RestoreThread`, :c:func:" "`Py_END_ALLOW_THREADS`, and :c:func:`PyGILState_Ensure`, and terminate the " "current thread if called while the interpreter is finalizing." msgstr "" -#: c-api/init.rst:1433 +#: c-api/init.rst:1530 msgid "" ":c:func:`PyEval_RestoreThread` is a higher-level function which is always " "available (even when threads have not been initialized)." msgstr "" -#: c-api/init.rst:1439 +#: c-api/init.rst:1536 msgid "" "Reset the current thread state to ``NULL`` and release the global " "interpreter lock. The lock must have been created earlier and must be held " @@ -1679,50 +1830,17 @@ msgid "" "isn't, a fatal error is reported." msgstr "" -#: c-api/init.rst:1445 +#: c-api/init.rst:1542 msgid "" ":c:func:`PyEval_SaveThread` is a higher-level function which is always " "available (even when threads have not been initialized)." msgstr "" -#: c-api/init.rst:1451 -msgid "" -"Acquire the global interpreter lock. The lock must have been created " -"earlier. If this thread already has the lock, a deadlock ensues." -msgstr "" - -#: c-api/init.rst:1454 -msgid "" -"This function does not update the current thread state. Please use :c:func:" -"`PyEval_RestoreThread` or :c:func:`PyEval_AcquireThread` instead." -msgstr "" - -#: c-api/init.rst:1460 -msgid "" -"Calling this function from a thread when the runtime is finalizing will " -"terminate the thread, even if the thread was not created by Python. You can " -"use :c:func:`_Py_IsFinalizing` or :func:`sys.is_finalizing` to check if the " -"interpreter is in process of being finalized before calling this function to " -"avoid unwanted termination." -msgstr "" - -#: c-api/init.rst:1474 -msgid "" -"Release the global interpreter lock. The lock must have been created " -"earlier." -msgstr "" - -#: c-api/init.rst:1476 -msgid "" -"This function does not update the current thread state. Please use :c:func:" -"`PyEval_SaveThread` or :c:func:`PyEval_ReleaseThread` instead." -msgstr "" - -#: c-api/init.rst:1485 +#: c-api/init.rst:1549 msgid "Sub-interpreter support" msgstr "" -#: c-api/init.rst:1487 +#: c-api/init.rst:1551 msgid "" "While in most uses, you will only embed a single Python interpreter, there " "are cases where you need to create several independent interpreters in the " @@ -1730,7 +1848,7 @@ msgid "" "to do that." msgstr "" -#: c-api/init.rst:1492 +#: c-api/init.rst:1556 msgid "" "The \"main\" interpreter is the first one created when the runtime " "initializes. It is usually the only Python interpreter in a process. Unlike " @@ -1741,31 +1859,31 @@ msgid "" "returns a pointer to its state." msgstr "" -#: c-api/init.rst:1499 +#: c-api/init.rst:1563 msgid "" "You can switch between sub-interpreters using the :c:func:" "`PyThreadState_Swap` function. You can create and destroy them using the " "following functions:" msgstr "" -#: c-api/init.rst:1505 +#: c-api/init.rst:1569 msgid "" "Structure containing most parameters to configure a sub-interpreter. Its " "values are used only in :c:func:`Py_NewInterpreterFromConfig` and never " "modified by the runtime." msgstr "" -#: c-api/init.rst:1511 +#: c-api/init.rst:1575 msgid "Structure fields:" msgstr "" -#: c-api/init.rst:1515 +#: c-api/init.rst:1579 msgid "" "If this is ``0`` then the sub-interpreter will use its own \"object\" " "allocator state. Otherwise it will use (share) the main interpreter's." msgstr "" -#: c-api/init.rst:1519 +#: c-api/init.rst:1583 msgid "" "If this is ``0`` then :c:member:`~PyInterpreterConfig." "check_multi_interp_extensions` must be ``1`` (non-zero). If this is ``1`` " @@ -1773,44 +1891,44 @@ msgid "" "`PyInterpreterConfig_OWN_GIL`." msgstr "" -#: c-api/init.rst:1527 +#: c-api/init.rst:1591 msgid "" "If this is ``0`` then the runtime will not support forking the process in " "any thread where the sub-interpreter is currently active. Otherwise fork is " "unrestricted." msgstr "" -#: c-api/init.rst:1531 +#: c-api/init.rst:1595 msgid "" "Note that the :mod:`subprocess` module still works when fork is disallowed." msgstr "" -#: c-api/init.rst:1536 +#: c-api/init.rst:1600 msgid "" "If this is ``0`` then the runtime will not support replacing the current " "process via exec (e.g. :func:`os.execv`) in any thread where the sub-" "interpreter is currently active. Otherwise exec is unrestricted." msgstr "" -#: c-api/init.rst:1541 +#: c-api/init.rst:1605 msgid "" "Note that the :mod:`subprocess` module still works when exec is disallowed." msgstr "" -#: c-api/init.rst:1546 +#: c-api/init.rst:1610 msgid "" "If this is ``0`` then the sub-interpreter's :mod:`threading` module won't " "create threads. Otherwise threads are allowed." msgstr "" -#: c-api/init.rst:1552 +#: c-api/init.rst:1616 msgid "" "If this is ``0`` then the sub-interpreter's :mod:`threading` module won't " "create daemon threads. Otherwise daemon threads are allowed (as long as :c:" "member:`~PyInterpreterConfig.allow_threads` is non-zero)." msgstr "" -#: c-api/init.rst:1559 +#: c-api/init.rst:1623 msgid "" "If this is ``0`` then all extension modules may be imported, including " "legacy (single-phase init) modules, in any thread where the sub-interpreter " @@ -1819,37 +1937,37 @@ msgid "" "`Py_mod_multiple_interpreters`.)" msgstr "" -#: c-api/init.rst:1566 +#: c-api/init.rst:1630 msgid "" "This must be ``1`` (non-zero) if :c:member:`~PyInterpreterConfig." "use_main_obmalloc` is ``0``." msgstr "" -#: c-api/init.rst:1571 +#: c-api/init.rst:1635 msgid "" "This determines the operation of the GIL for the sub-interpreter. It may be " "one of the following:" msgstr "" -#: c-api/init.rst:1578 +#: c-api/init.rst:1642 msgid "Use the default selection (:c:macro:`PyInterpreterConfig_SHARED_GIL`)." msgstr "" -#: c-api/init.rst:1582 +#: c-api/init.rst:1646 msgid "Use (share) the main interpreter's GIL." msgstr "" -#: c-api/init.rst:1586 +#: c-api/init.rst:1650 msgid "Use the sub-interpreter's own GIL." msgstr "" -#: c-api/init.rst:1588 +#: c-api/init.rst:1652 msgid "" "If this is :c:macro:`PyInterpreterConfig_OWN_GIL` then :c:member:" "`PyInterpreterConfig.use_main_obmalloc` must be ``0``." msgstr "" -#: c-api/init.rst:1602 +#: c-api/init.rst:1666 msgid "" "Create a new sub-interpreter. This is an (almost) totally separate " "environment for the execution of Python code. In particular, the new " @@ -1862,13 +1980,13 @@ msgid "" "underlying file descriptors)." msgstr "" -#: c-api/init.rst:1612 +#: c-api/init.rst:1676 msgid "" "The given *config* controls the options with which the interpreter is " "initialized." msgstr "" -#: c-api/init.rst:1615 +#: c-api/init.rst:1679 msgid "" "Upon success, *tstate_p* will be set to the first thread state created in " "the new sub-interpreter. This thread state is made in the current thread " @@ -1879,7 +1997,7 @@ msgid "" "state." msgstr "" -#: c-api/init.rst:1624 +#: c-api/init.rst:1688 msgid "" "Like all other Python/C API functions, the global interpreter lock must be " "held before calling this function and is still held when it returns. " @@ -1891,13 +2009,13 @@ msgid "" "released here." msgstr "" -#: c-api/init.rst:1635 +#: c-api/init.rst:1699 msgid "" "Sub-interpreters are most effective when isolated from each other, with " "certain functionality restricted::" msgstr "" -#: c-api/init.rst:1638 +#: c-api/init.rst:1702 msgid "" "PyInterpreterConfig config = {\n" " .use_main_obmalloc = 0,\n" @@ -1915,7 +2033,7 @@ msgid "" "}" msgstr "" -#: c-api/init.rst:1653 +#: c-api/init.rst:1717 msgid "" "Note that the config is used only briefly and does not get modified. During " "initialization the config's values are converted into various :c:type:" @@ -1923,11 +2041,11 @@ msgid "" "internally on the :c:type:`PyInterpreterState`." msgstr "" -#: c-api/init.rst:1662 +#: c-api/init.rst:1726 msgid "Extension modules are shared between (sub-)interpreters as follows:" msgstr "" -#: c-api/init.rst:1664 +#: c-api/init.rst:1728 msgid "" "For modules using multi-phase initialization, e.g. :c:func:" "`PyModule_FromDefAndSpec`, a separate module object is created and " @@ -1935,7 +2053,7 @@ msgid "" "are shared between these module objects." msgstr "" -#: c-api/init.rst:1670 +#: c-api/init.rst:1734 msgid "" "For modules using single-phase initialization, e.g. :c:func:" "`PyModule_Create`, the first time a particular extension is imported, it is " @@ -1947,7 +2065,7 @@ msgid "" "might cause unwanted behavior (see `Bugs and caveats`_ below)." msgstr "" -#: c-api/init.rst:1681 +#: c-api/init.rst:1745 msgid "" "Note that this is different from what happens when an extension is imported " "after the interpreter has been completely re-initialized by calling :c:func:" @@ -1957,7 +2075,7 @@ msgid "" "shared between these modules." msgstr "" -#: c-api/init.rst:1701 +#: c-api/init.rst:1765 msgid "" "Create a new sub-interpreter. This is essentially just a wrapper around :c:" "func:`Py_NewInterpreterFromConfig` with a config that preserves the existing " @@ -1966,7 +2084,7 @@ msgid "" "single-phase init modules." msgstr "" -#: c-api/init.rst:1713 +#: c-api/init.rst:1777 msgid "" "Destroy the (sub-)interpreter represented by the given thread state. The " "given thread state must be the current thread state. See the discussion of " @@ -1976,17 +2094,17 @@ msgid "" "be held before calling this function. No GIL is held when it returns." msgstr "" -#: c-api/init.rst:1721 +#: c-api/init.rst:1785 msgid "" ":c:func:`Py_FinalizeEx` will destroy all sub-interpreters that haven't been " "explicitly destroyed at that point." msgstr "" -#: c-api/init.rst:1726 +#: c-api/init.rst:1790 msgid "A Per-Interpreter GIL" msgstr "" -#: c-api/init.rst:1728 +#: c-api/init.rst:1792 msgid "" "Using :c:func:`Py_NewInterpreterFromConfig` you can create a sub-interpreter " "that is completely isolated from other interpreters, including having its " @@ -1998,7 +2116,7 @@ msgid "" "just using threads. (See :pep:`554`.)" msgstr "" -#: c-api/init.rst:1738 +#: c-api/init.rst:1802 msgid "" "Using an isolated interpreter requires vigilance in preserving that " "isolation. That especially means not sharing any objects or mutable state " @@ -2007,12 +2125,12 @@ msgid "" "the refcount. One simple but less-efficient approach around this is to use " "a global lock around all use of some state (or object). Alternately, " "effectively immutable objects (like integers or strings) can be made safe in " -"spite of their refcounts by making them \"immortal\". In fact, this has been " -"done for the builtin singletons, small integers, and a number of other " +"spite of their refcounts by making them :term:`immortal`. In fact, this has " +"been done for the builtin singletons, small integers, and a number of other " "builtin objects." msgstr "" -#: c-api/init.rst:1749 +#: c-api/init.rst:1813 msgid "" "If you preserve isolation then you will have access to proper multi-core " "computing without the complications that come with free-threading. Failure " @@ -2020,7 +2138,7 @@ msgid "" "threading, including races and hard-to-debug crashes." msgstr "" -#: c-api/init.rst:1754 +#: c-api/init.rst:1818 msgid "" "Aside from that, one of the main challenges of using multiple isolated " "interpreters is how to communicate between them safely (not break isolation) " @@ -2030,11 +2148,11 @@ msgid "" "sharing) data between interpreters." msgstr "" -#: c-api/init.rst:1765 +#: c-api/init.rst:1829 msgid "Bugs and caveats" msgstr "" -#: c-api/init.rst:1767 +#: c-api/init.rst:1831 msgid "" "Because sub-interpreters (and the main interpreter) are part of the same " "process, the insulation between them isn't perfect --- for example, using " @@ -2047,7 +2165,7 @@ msgid "" "should be avoided if possible." msgstr "" -#: c-api/init.rst:1777 +#: c-api/init.rst:1841 msgid "" "Special care should be taken to avoid sharing user-defined functions, " "methods, instances or classes between sub-interpreters, since import " @@ -2056,7 +2174,7 @@ msgid "" "objects from which the above are reachable." msgstr "" -#: c-api/init.rst:1783 +#: c-api/init.rst:1847 msgid "" "Also note that combining this functionality with ``PyGILState_*`` APIs is " "delicate, because these APIs assume a bijection between Python thread states " @@ -2068,25 +2186,25 @@ msgid "" "created threads will probably be broken when using sub-interpreters." msgstr "" -#: c-api/init.rst:1794 +#: c-api/init.rst:1858 msgid "Asynchronous Notifications" msgstr "" -#: c-api/init.rst:1796 +#: c-api/init.rst:1860 msgid "" "A mechanism is provided to make asynchronous notifications to the main " "interpreter thread. These notifications take the form of a function pointer " "and a void pointer argument." msgstr "" -#: c-api/init.rst:1803 +#: c-api/init.rst:1867 msgid "" "Schedule a function to be called from the main interpreter thread. On " "success, ``0`` is returned and *func* is queued for being called in the main " "thread. On failure, ``-1`` is returned without setting any exception." msgstr "" -#: c-api/init.rst:1807 +#: c-api/init.rst:1871 msgid "" "When successfully queued, *func* will be *eventually* called from the main " "interpreter thread with the argument *arg*. It will be called " @@ -2094,17 +2212,17 @@ msgid "" "these conditions met:" msgstr "" -#: c-api/init.rst:1812 +#: c-api/init.rst:1876 msgid "on a :term:`bytecode` boundary;" msgstr "" -#: c-api/init.rst:1813 +#: c-api/init.rst:1877 msgid "" "with the main thread holding the :term:`global interpreter lock` (*func* can " "therefore use the full C API)." msgstr "" -#: c-api/init.rst:1816 +#: c-api/init.rst:1880 msgid "" "*func* must return ``0`` on success, or ``-1`` on failure with an exception " "set. *func* won't be interrupted to perform another asynchronous " @@ -2112,20 +2230,20 @@ msgid "" "if the global interpreter lock is released." msgstr "" -#: c-api/init.rst:1821 +#: c-api/init.rst:1885 msgid "" "This function doesn't need a current thread state to run, and it doesn't " "need the global interpreter lock." msgstr "" -#: c-api/init.rst:1824 +#: c-api/init.rst:1888 msgid "" "To call this function in a subinterpreter, the caller must hold the GIL. " "Otherwise, the function *func* can be scheduled to be called from the wrong " "interpreter." msgstr "" -#: c-api/init.rst:1829 +#: c-api/init.rst:1893 msgid "" "This is a low-level function, only useful for very special cases. There is " "no guarantee that *func* will be called as quick as possible. If the main " @@ -2135,7 +2253,7 @@ msgid "" "`PyGILState API`." msgstr "" -#: c-api/init.rst:1838 +#: c-api/init.rst:1902 msgid "" "If this function is called in a subinterpreter, the function *func* is now " "scheduled to be called from the subinterpreter, rather than being called " @@ -2143,18 +2261,18 @@ msgid "" "scheduled calls." msgstr "" -#: c-api/init.rst:1847 +#: c-api/init.rst:1911 msgid "Profiling and Tracing" msgstr "" -#: c-api/init.rst:1852 +#: c-api/init.rst:1916 msgid "" "The Python interpreter provides some low-level support for attaching " "profiling and execution tracing facilities. These are used for profiling, " "debugging, and coverage analysis tools." msgstr "" -#: c-api/init.rst:1856 +#: c-api/init.rst:1920 msgid "" "This C interface allows the profiling or tracing code to avoid the overhead " "of calling through Python-level callable objects, making a direct C function " @@ -2164,7 +2282,7 @@ msgid "" "reported to the Python-level trace functions in previous versions." msgstr "" -#: c-api/init.rst:1866 +#: c-api/init.rst:1930 msgid "" "The type of the trace function registered using :c:func:`PyEval_SetProfile` " "and :c:func:`PyEval_SetTrace`. The first parameter is the object passed to " @@ -2176,64 +2294,64 @@ msgid "" "value of *what*:" msgstr "" -#: c-api/init.rst:1875 +#: c-api/init.rst:1939 msgid "Value of *what*" msgstr "" -#: c-api/init.rst:1875 +#: c-api/init.rst:1939 msgid "Meaning of *arg*" msgstr "" -#: c-api/init.rst:1877 +#: c-api/init.rst:1941 msgid ":c:data:`PyTrace_CALL`" msgstr "" -#: c-api/init.rst:1882 c-api/init.rst:1893 +#: c-api/init.rst:1946 c-api/init.rst:1957 msgid "Always :c:data:`Py_None`." msgstr "" -#: c-api/init.rst:1879 +#: c-api/init.rst:1943 msgid ":c:data:`PyTrace_EXCEPTION`" msgstr "" -#: c-api/init.rst:1879 +#: c-api/init.rst:1943 msgid "Exception information as returned by :func:`sys.exc_info`." msgstr "" -#: c-api/init.rst:1882 +#: c-api/init.rst:1946 msgid ":c:data:`PyTrace_LINE`" msgstr "" -#: c-api/init.rst:1884 +#: c-api/init.rst:1948 msgid ":c:data:`PyTrace_RETURN`" msgstr "" -#: c-api/init.rst:1884 +#: c-api/init.rst:1948 msgid "" "Value being returned to the caller, or ``NULL`` if caused by an exception." msgstr "" -#: c-api/init.rst:1887 +#: c-api/init.rst:1951 msgid ":c:data:`PyTrace_C_CALL`" msgstr "" -#: c-api/init.rst:1889 c-api/init.rst:1891 +#: c-api/init.rst:1953 c-api/init.rst:1955 msgid "Function object being called." msgstr "" -#: c-api/init.rst:1889 +#: c-api/init.rst:1953 msgid ":c:data:`PyTrace_C_EXCEPTION`" msgstr "" -#: c-api/init.rst:1891 +#: c-api/init.rst:1955 msgid ":c:data:`PyTrace_C_RETURN`" msgstr "" -#: c-api/init.rst:1893 +#: c-api/init.rst:1957 msgid ":c:data:`PyTrace_OPCODE`" msgstr "" -#: c-api/init.rst:1898 +#: c-api/init.rst:1962 msgid "" "The value of the *what* parameter to a :c:type:`Py_tracefunc` function when " "a new call to a function or method is being reported, or a new entry into a " @@ -2242,7 +2360,7 @@ msgid "" "the corresponding frame." msgstr "" -#: c-api/init.rst:1907 +#: c-api/init.rst:1971 msgid "" "The value of the *what* parameter to a :c:type:`Py_tracefunc` function when " "an exception has been raised. The callback function is called with this " @@ -2254,7 +2372,7 @@ msgid "" "profiler." msgstr "" -#: c-api/init.rst:1918 +#: c-api/init.rst:1982 msgid "" "The value passed as the *what* parameter to a :c:type:`Py_tracefunc` " "function (but not a profiling function) when a line-number event is being " @@ -2262,31 +2380,31 @@ msgid "" "f_trace_lines` to *0* on that frame." msgstr "" -#: c-api/init.rst:1926 +#: c-api/init.rst:1990 msgid "" "The value for the *what* parameter to :c:type:`Py_tracefunc` functions when " "a call is about to return." msgstr "" -#: c-api/init.rst:1932 +#: c-api/init.rst:1996 msgid "" "The value for the *what* parameter to :c:type:`Py_tracefunc` functions when " "a C function is about to be called." msgstr "" -#: c-api/init.rst:1938 +#: c-api/init.rst:2002 msgid "" "The value for the *what* parameter to :c:type:`Py_tracefunc` functions when " "a C function has raised an exception." msgstr "" -#: c-api/init.rst:1944 +#: c-api/init.rst:2008 msgid "" "The value for the *what* parameter to :c:type:`Py_tracefunc` functions when " "a C function has returned." msgstr "" -#: c-api/init.rst:1950 +#: c-api/init.rst:2014 msgid "" "The value for the *what* parameter to :c:type:`Py_tracefunc` functions (but " "not profiling functions) when a new opcode is about to be executed. This " @@ -2294,7 +2412,7 @@ msgid "" "attr:`~frame.f_trace_opcodes` to *1* on the frame." msgstr "" -#: c-api/init.rst:1958 +#: c-api/init.rst:2022 msgid "" "Set the profiler function to *func*. The *obj* parameter is passed to the " "function as its first parameter, and may be any Python object, or ``NULL``. " @@ -2304,28 +2422,28 @@ msgid "" "`PyTrace_LINE` :c:data:`PyTrace_OPCODE` and :c:data:`PyTrace_EXCEPTION`." msgstr "" -#: c-api/init.rst:1965 +#: c-api/init.rst:2029 msgid "See also the :func:`sys.setprofile` function." msgstr "" -#: c-api/init.rst:1974 c-api/init.rst:2000 +#: c-api/init.rst:2038 c-api/init.rst:2064 msgid "The caller must hold the :term:`GIL`." msgstr "" -#: c-api/init.rst:1971 +#: c-api/init.rst:2035 msgid "" "Like :c:func:`PyEval_SetProfile` but sets the profile function in all " "running threads belonging to the current interpreter instead of the setting " "it only on the current thread." msgstr "" -#: c-api/init.rst:1976 +#: c-api/init.rst:2040 msgid "" "As :c:func:`PyEval_SetProfile`, this function ignores any exceptions raised " "while setting the profile functions in all threads." msgstr "" -#: c-api/init.rst:1984 +#: c-api/init.rst:2048 msgid "" "Set the tracing function to *func*. This is similar to :c:func:" "`PyEval_SetProfile`, except the tracing function does receive line-number " @@ -2336,65 +2454,120 @@ msgid "" "*what* parameter." msgstr "" -#: c-api/init.rst:1991 +#: c-api/init.rst:2055 msgid "See also the :func:`sys.settrace` function." msgstr "" -#: c-api/init.rst:1997 +#: c-api/init.rst:2061 msgid "" "Like :c:func:`PyEval_SetTrace` but sets the tracing function in all running " "threads belonging to the current interpreter instead of the setting it only " "on the current thread." msgstr "" -#: c-api/init.rst:2002 +#: c-api/init.rst:2066 msgid "" "As :c:func:`PyEval_SetTrace`, this function ignores any exceptions raised " "while setting the trace functions in all threads." msgstr "" -#: c-api/init.rst:2011 +#: c-api/init.rst:2072 +msgid "Reference tracing" +msgstr "" + +#: c-api/init.rst:2078 +msgid "" +"The type of the trace function registered using :c:func:" +"`PyRefTracer_SetTracer`. The first parameter is a Python object that has " +"been just created (when **event** is set to :c:data:`PyRefTracer_CREATE`) or " +"about to be destroyed (when **event** is set to :c:data:" +"`PyRefTracer_DESTROY`). The **data** argument is the opaque pointer that was " +"provided when :c:func:`PyRefTracer_SetTracer` was called." +msgstr "" + +#: c-api/init.rst:2088 +msgid "" +"The value for the *event* parameter to :c:type:`PyRefTracer` functions when " +"a Python object has been created." +msgstr "" + +#: c-api/init.rst:2093 +msgid "" +"The value for the *event* parameter to :c:type:`PyRefTracer` functions when " +"a Python object has been destroyed." +msgstr "" + +#: c-api/init.rst:2098 +msgid "" +"Register a reference tracer function. The function will be called when a new " +"Python has been created or when an object is going to be destroyed. If " +"**data** is provided it must be an opaque pointer that will be provided when " +"the tracer function is called. Return ``0`` on success. Set an exception and " +"return ``-1`` on error." +msgstr "" + +#: c-api/init.rst:2104 +msgid "" +"Not that tracer functions **must not** create Python objects inside or " +"otherwise the call will be re-entrant. The tracer also **must not** clear " +"any existing exception or set an exception. The GIL will be held every time " +"the tracer function is called." +msgstr "" + +#: c-api/init.rst:2120 +msgid "The GIL must be held when calling this function." +msgstr "" + +#: c-api/init.rst:2115 +msgid "" +"Get the registered reference tracer function and the value of the opaque " +"data pointer that was registered when :c:func:`PyRefTracer_SetTracer` was " +"called. If no tracer was registered this function will return NULL and will " +"set the **data** pointer to NULL." +msgstr "" + +#: c-api/init.rst:2127 msgid "Advanced Debugger Support" msgstr "" -#: c-api/init.rst:2016 +#: c-api/init.rst:2132 msgid "" "These functions are only intended to be used by advanced debugging tools." msgstr "" -#: c-api/init.rst:2021 +#: c-api/init.rst:2137 msgid "" "Return the interpreter state object at the head of the list of all such " "objects." msgstr "" -#: c-api/init.rst:2026 +#: c-api/init.rst:2142 msgid "Return the main interpreter state object." msgstr "" -#: c-api/init.rst:2031 +#: c-api/init.rst:2147 msgid "" "Return the next interpreter state object after *interp* from the list of all " "such objects." msgstr "" -#: c-api/init.rst:2037 +#: c-api/init.rst:2153 msgid "" "Return the pointer to the first :c:type:`PyThreadState` object in the list " "of threads associated with the interpreter *interp*." msgstr "" -#: c-api/init.rst:2043 +#: c-api/init.rst:2159 msgid "" "Return the next thread state object after *tstate* from the list of all such " "objects belonging to the same :c:type:`PyInterpreterState` object." msgstr "" -#: c-api/init.rst:2050 +#: c-api/init.rst:2166 msgid "Thread Local Storage Support" msgstr "" -#: c-api/init.rst:2054 +#: c-api/init.rst:2170 msgid "" "The Python interpreter provides low-level support for thread-local storage " "(TLS) which wraps the underlying native TLS implementation to support the " @@ -2404,19 +2577,19 @@ msgid "" "thread." msgstr "" -#: c-api/init.rst:2061 +#: c-api/init.rst:2177 msgid "" "The GIL does *not* need to be held when calling these functions; they supply " "their own locking." msgstr "" -#: c-api/init.rst:2064 +#: c-api/init.rst:2180 msgid "" "Note that :file:`Python.h` does not include the declaration of the TLS APIs, " "you need to include :file:`pythread.h` to use thread-local storage." msgstr "" -#: c-api/init.rst:2068 +#: c-api/init.rst:2184 msgid "" "None of these API functions handle memory management on behalf of the :c:" "expr:`void*` values. You need to allocate and deallocate them yourself. If " @@ -2424,22 +2597,22 @@ msgid "" "don't do refcount operations on them either." msgstr "" -#: c-api/init.rst:2076 +#: c-api/init.rst:2192 msgid "Thread Specific Storage (TSS) API" msgstr "" -#: c-api/init.rst:2078 +#: c-api/init.rst:2194 msgid "" "TSS API is introduced to supersede the use of the existing TLS API within " "the CPython interpreter. This API uses a new type :c:type:`Py_tss_t` " "instead of :c:expr:`int` to represent thread keys." msgstr "" -#: c-api/init.rst:2084 +#: c-api/init.rst:2200 msgid "\"A New C-API for Thread-Local Storage in CPython\" (:pep:`539`)" msgstr "" -#: c-api/init.rst:2089 +#: c-api/init.rst:2205 msgid "" "This data structure represents the state of a thread key, the definition of " "which may depend on the underlying TLS implementation, and it has an " @@ -2447,52 +2620,52 @@ msgid "" "public members in this structure." msgstr "" -#: c-api/init.rst:2094 +#: c-api/init.rst:2210 msgid "" "When :ref:`Py_LIMITED_API ` is not defined, static allocation of " "this type by :c:macro:`Py_tss_NEEDS_INIT` is allowed." msgstr "" -#: c-api/init.rst:2100 +#: c-api/init.rst:2216 msgid "" "This macro expands to the initializer for :c:type:`Py_tss_t` variables. Note " "that this macro won't be defined with :ref:`Py_LIMITED_API `." msgstr "" -#: c-api/init.rst:2105 +#: c-api/init.rst:2221 msgid "Dynamic Allocation" msgstr "" -#: c-api/init.rst:2107 +#: c-api/init.rst:2223 msgid "" "Dynamic allocation of the :c:type:`Py_tss_t`, required in extension modules " "built with :ref:`Py_LIMITED_API `, where static allocation of this " "type is not possible due to its implementation being opaque at build time." msgstr "" -#: c-api/init.rst:2114 +#: c-api/init.rst:2230 msgid "" "Return a value which is the same state as a value initialized with :c:macro:" "`Py_tss_NEEDS_INIT`, or ``NULL`` in the case of dynamic allocation failure." msgstr "" -#: c-api/init.rst:2121 +#: c-api/init.rst:2237 msgid "" "Free the given *key* allocated by :c:func:`PyThread_tss_alloc`, after first " "calling :c:func:`PyThread_tss_delete` to ensure any associated thread locals " "have been unassigned. This is a no-op if the *key* argument is ``NULL``." msgstr "" -#: c-api/init.rst:2127 +#: c-api/init.rst:2243 msgid "" "A freed key becomes a dangling pointer. You should reset the key to ``NULL``." msgstr "" -#: c-api/init.rst:2132 +#: c-api/init.rst:2248 msgid "Methods" msgstr "" -#: c-api/init.rst:2134 +#: c-api/init.rst:2250 msgid "" "The parameter *key* of these functions must not be ``NULL``. Moreover, the " "behaviors of :c:func:`PyThread_tss_set` and :c:func:`PyThread_tss_get` are " @@ -2500,13 +2673,13 @@ msgid "" "func:`PyThread_tss_create`." msgstr "" -#: c-api/init.rst:2142 +#: c-api/init.rst:2258 msgid "" "Return a non-zero value if the given :c:type:`Py_tss_t` has been initialized " "by :c:func:`PyThread_tss_create`." msgstr "" -#: c-api/init.rst:2148 +#: c-api/init.rst:2264 msgid "" "Return a zero value on successful initialization of a TSS key. The behavior " "is undefined if the value pointed to by the *key* argument is not " @@ -2515,7 +2688,7 @@ msgid "" "no-op and immediately returns success." msgstr "" -#: c-api/init.rst:2157 +#: c-api/init.rst:2273 msgid "" "Destroy a TSS key to forget the values associated with the key across all " "threads, and change the key's initialization state to uninitialized. A " @@ -2524,31 +2697,31 @@ msgid "" "key -- calling it on an already destroyed key is a no-op." msgstr "" -#: c-api/init.rst:2166 +#: c-api/init.rst:2282 msgid "" "Return a zero value to indicate successfully associating a :c:expr:`void*` " "value with a TSS key in the current thread. Each thread has a distinct " "mapping of the key to a :c:expr:`void*` value." msgstr "" -#: c-api/init.rst:2173 +#: c-api/init.rst:2289 msgid "" "Return the :c:expr:`void*` value associated with a TSS key in the current " "thread. This returns ``NULL`` if no value is associated with the key in the " "current thread." msgstr "" -#: c-api/init.rst:2181 +#: c-api/init.rst:2297 msgid "Thread Local Storage (TLS) API" msgstr "" -#: c-api/init.rst:2183 +#: c-api/init.rst:2299 msgid "" "This API is superseded by :ref:`Thread Specific Storage (TSS) API `." msgstr "" -#: c-api/init.rst:2188 +#: c-api/init.rst:2304 msgid "" "This version of the API does not support platforms where the native TLS key " "is defined in a way that cannot be safely cast to ``int``. On such " @@ -2557,188 +2730,329 @@ msgid "" "platforms." msgstr "" -#: c-api/init.rst:2193 +#: c-api/init.rst:2309 msgid "" "Due to the compatibility problem noted above, this version of the API should " "not be used in new code." msgstr "" -#: c-api/init.rst:502 c-api/init.rst:577 -msgid "Py_SetProgramName()" +#: c-api/init.rst:2320 +msgid "Synchronization Primitives" +msgstr "" + +#: c-api/init.rst:2322 +msgid "The C-API provides a basic mutual exclusion lock." +msgstr "" + +#: c-api/init.rst:2326 +msgid "" +"A mutual exclusion lock. The :c:type:`!PyMutex` should be initialized to " +"zero to represent the unlocked state. For example::" +msgstr "" + +#: c-api/init.rst:2329 +msgid "PyMutex mutex = {0};" +msgstr "" + +#: c-api/init.rst:2331 +msgid "" +"Instances of :c:type:`!PyMutex` should not be copied or moved. Both the " +"contents and address of a :c:type:`!PyMutex` are meaningful, and it must " +"remain at a fixed, writable location in memory." +msgstr "" + +#: c-api/init.rst:2337 +msgid "" +"A :c:type:`!PyMutex` currently occupies one byte, but the size should be " +"considered unstable. The size may change in future Python releases without " +"a deprecation period." +msgstr "" + +#: c-api/init.rst:2345 +msgid "" +"Lock mutex *m*. If another thread has already locked it, the calling thread " +"will block until the mutex is unlocked. While blocked, the thread will " +"temporarily release the :term:`GIL` if it is held." +msgstr "" + +#: c-api/init.rst:2353 +msgid "" +"Unlock mutex *m*. The mutex must be locked --- otherwise, the function will " +"issue a fatal error." +msgstr "" + +#: c-api/init.rst:2361 +msgid "Python Critical Section API" +msgstr "" + +#: c-api/init.rst:2363 +msgid "" +"The critical section API provides a deadlock avoidance layer on top of per-" +"object locks for :term:`free-threaded ` CPython. They are " +"intended to replace reliance on the :term:`global interpreter lock`, and are " +"no-ops in versions of Python with the global interpreter lock." +msgstr "" + +#: c-api/init.rst:2368 +msgid "" +"Critical sections avoid deadlocks by implicitly suspending active critical " +"sections and releasing the locks during calls to :c:func:" +"`PyEval_SaveThread`. When :c:func:`PyEval_RestoreThread` is called, the most " +"recent critical section is resumed, and its locks reacquired. This means " +"the critical section API provides weaker guarantees than traditional locks " +"-- they are useful because their behavior is similar to the :term:`GIL`." +msgstr "" + +#: c-api/init.rst:2375 +msgid "" +"The functions and structs used by the macros are exposed for cases where C " +"macros are not available. They should only be used as in the given macro " +"expansions. Note that the sizes and contents of the structures may change in " +"future Python versions." +msgstr "" + +#: c-api/init.rst:2382 +msgid "" +"Operations that need to lock two objects at once must use :c:macro:" +"`Py_BEGIN_CRITICAL_SECTION2`. You *cannot* use nested critical sections to " +"lock more than one object at once, because the inner critical section may " +"suspend the outer critical sections. This API does not provide a way to " +"lock more than two objects at once." +msgstr "" + +#: c-api/init.rst:2388 +msgid "Example usage::" +msgstr "" + +#: c-api/init.rst:2390 +msgid "" +"static PyObject *\n" +"set_field(MyObject *self, PyObject *value)\n" +"{\n" +" Py_BEGIN_CRITICAL_SECTION(self);\n" +" Py_SETREF(self->field, Py_XNewRef(value));\n" +" Py_END_CRITICAL_SECTION();\n" +" Py_RETURN_NONE;\n" +"}" msgstr "" -#: c-api/init.rst:334 +#: c-api/init.rst:2399 +msgid "" +"In the above example, :c:macro:`Py_SETREF` calls :c:macro:`Py_DECREF`, which " +"can call arbitrary code through an object's deallocation function. The " +"critical section API avoids potential deadlocks due to reentrancy and lock " +"ordering by allowing the runtime to temporarily suspend the critical section " +"if the code triggered by the finalizer blocks and calls :c:func:" +"`PyEval_SaveThread`." +msgstr "" + +#: c-api/init.rst:2407 +msgid "" +"Acquires the per-object lock for the object *op* and begins a critical " +"section." +msgstr "" + +#: c-api/init.rst:2424 c-api/init.rst:2453 +msgid "In the free-threaded build, this macro expands to::" +msgstr "" + +#: c-api/init.rst:2412 +msgid "" +"{\n" +" PyCriticalSection _py_cs;\n" +" PyCriticalSection_Begin(&_py_cs, (PyObject*)(op))" +msgstr "" + +#: c-api/init.rst:2445 +msgid "In the default build, this macro expands to ``{``." +msgstr "" + +#: c-api/init.rst:2422 +msgid "Ends the critical section and releases the per-object lock." +msgstr "" + +#: c-api/init.rst:2426 +msgid "" +" PyCriticalSection_End(&_py_cs);\n" +"}" +msgstr "" + +#: c-api/init.rst:2458 +msgid "In the default build, this macro expands to ``}``." +msgstr "" + +#: c-api/init.rst:2435 +msgid "" +"Acquires the per-objects locks for the objects *a* and *b* and begins a " +"critical section. The locks are acquired in a consistent order (lowest " +"address first) to avoid lock ordering deadlocks." +msgstr "" + +#: c-api/init.rst:2441 +msgid "" +"{\n" +" PyCriticalSection2 _py_cs2;\n" +" PyCriticalSection2_Begin(&_py_cs2, (PyObject*)(a), (PyObject*)(b))" +msgstr "" + +#: c-api/init.rst:2451 +msgid "Ends the critical section and releases the per-object locks." +msgstr "" + +#: c-api/init.rst:2455 +msgid "" +" PyCriticalSection2_End(&_py_cs2);\n" +"}" +msgstr "" + +#: c-api/init.rst:350 msgid "PyEval_InitThreads()" msgstr "" -#: c-api/init.rst:334 +#: c-api/init.rst:350 msgid "modules (in module sys)" msgstr "" -#: c-api/init.rst:596 c-api/init.rst:622 +#: c-api/init.rst:710 msgid "path (in module sys)" msgstr "" -#: c-api/init.rst:596 c-api/init.rst:1063 c-api/init.rst:1693 +#: c-api/init.rst:710 c-api/init.rst:1658 c-api/init.rst:1757 msgid "module" msgstr "" -#: c-api/init.rst:1594 c-api/init.rst:1693 +#: c-api/init.rst:1658 c-api/init.rst:1757 msgid "builtins" msgstr "" -#: c-api/init.rst:1594 c-api/init.rst:1693 +#: c-api/init.rst:1658 c-api/init.rst:1757 msgid "__main__" msgstr "" -#: c-api/init.rst:1594 c-api/init.rst:1693 +#: c-api/init.rst:1658 c-api/init.rst:1757 msgid "sys" msgstr "" -#: c-api/init.rst:596 c-api/init.rst:622 +#: c-api/init.rst:710 msgid "search" msgstr "" -#: c-api/init.rst:596 c-api/init.rst:622 +#: c-api/init.rst:710 msgid "path" msgstr "" -#: c-api/init.rst:334 -msgid "PySys_SetArgv (C function)" -msgstr "" - -#: c-api/init.rst:334 -msgid "PySys_SetArgvEx (C function)" -msgstr "" - -#: c-api/init.rst:1658 c-api/init.rst:1711 +#: c-api/init.rst:1722 c-api/init.rst:1775 msgid "Py_FinalizeEx (C function)" msgstr "" -#: c-api/init.rst:474 +#: c-api/init.rst:576 msgid "Py_Initialize()" msgstr "" -#: c-api/init.rst:474 c-api/init.rst:730 +#: c-api/init.rst:808 msgid "main()" msgstr "" -#: c-api/init.rst:437 -msgid "stdin" -msgstr "" - -#: c-api/init.rst:437 -msgid "stdout" -msgstr "" - -#: c-api/init.rst:437 -msgid "sdterr" -msgstr "" - -#: c-api/init.rst:622 +#: c-api/init.rst:576 msgid "Py_GetPath()" msgstr "" -#: c-api/init.rst:577 +#: c-api/init.rst:689 msgid "executable (in module sys)" msgstr "" -#: c-api/init.rst:596 -msgid "Py_SetPath()" -msgstr "" - -#: c-api/init.rst:707 c-api/init.rst:721 +#: c-api/init.rst:785 c-api/init.rst:799 msgid "version (in module sys)" msgstr "" -#: c-api/init.rst:677 +#: c-api/init.rst:755 msgid "platform (in module sys)" msgstr "" -#: c-api/init.rst:694 +#: c-api/init.rst:772 msgid "copyright (in module sys)" msgstr "" -#: c-api/init.rst:730 +#: c-api/init.rst:808 msgid "Py_FatalError()" msgstr "" -#: c-api/init.rst:730 +#: c-api/init.rst:808 msgid "argv (in module sys)" msgstr "" -#: c-api/init.rst:846 +#: c-api/init.rst:928 msgid "global interpreter lock" msgstr "" -#: c-api/init.rst:846 +#: c-api/init.rst:928 msgid "interpreter lock" msgstr "" -#: c-api/init.rst:846 +#: c-api/init.rst:928 msgid "lock, interpreter" msgstr "" -#: c-api/init.rst:859 +#: c-api/init.rst:941 msgid "setswitchinterval (in module sys)" msgstr "" -#: c-api/init.rst:868 +#: c-api/init.rst:950 msgid "PyThreadState (C type)" msgstr "" -#: c-api/init.rst:894 +#: c-api/init.rst:976 msgid "Py_BEGIN_ALLOW_THREADS (C macro)" msgstr "" -#: c-api/init.rst:894 +#: c-api/init.rst:976 msgid "Py_END_ALLOW_THREADS (C macro)" msgstr "" -#: c-api/init.rst:910 +#: c-api/init.rst:992 msgid "PyEval_RestoreThread (C function)" msgstr "" -#: c-api/init.rst:910 +#: c-api/init.rst:992 msgid "PyEval_SaveThread (C function)" msgstr "" -#: c-api/init.rst:1041 +#: c-api/init.rst:1123 msgid "PyEval_AcquireThread()" msgstr "" -#: c-api/init.rst:1041 +#: c-api/init.rst:1123 msgid "PyEval_ReleaseThread()" msgstr "" -#: c-api/init.rst:1041 +#: c-api/init.rst:1123 msgid "PyEval_SaveThread()" msgstr "" -#: c-api/init.rst:1041 +#: c-api/init.rst:1123 msgid "PyEval_RestoreThread()" msgstr "" -#: c-api/init.rst:1063 +#: c-api/init.rst:1145 msgid "_thread" msgstr "" -#: c-api/init.rst:1693 +#: c-api/init.rst:1757 msgid "stdout (in module sys)" msgstr "" -#: c-api/init.rst:1693 +#: c-api/init.rst:1757 msgid "stderr (in module sys)" msgstr "" -#: c-api/init.rst:1693 +#: c-api/init.rst:1757 msgid "stdin (in module sys)" msgstr "" -#: c-api/init.rst:1658 +#: c-api/init.rst:1722 msgid "Py_Initialize (C function)" msgstr "" -#: c-api/init.rst:1688 +#: c-api/init.rst:1752 msgid "close (in module os)" msgstr "" diff --git a/c-api/init_config.po b/c-api/init_config.po index a65db62d..a6e1b410 100644 --- a/c-api/init_config.po +++ b/c-api/init_config.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -147,7 +147,7 @@ msgstr "" msgid "*index* must be greater than or equal to ``0``." msgstr "" -#: c-api/init_config.rst:128 c-api/init_config.rst:544 +#: c-api/init_config.rst:128 c-api/init_config.rst:554 msgid "Structure fields:" msgstr "" @@ -334,110 +334,129 @@ msgid "" "allocator ` with :ref:`debug hooks `." msgstr "" -#: c-api/init_config.rst:257 +#: c-api/init_config.rst:256 +msgid "" +"``PYMEM_ALLOCATOR_MIMALLOC`` (``6``): use ``mimalloc``, a fast malloc " +"replacement." +msgstr "" + +#: c-api/init_config.rst:258 +msgid "" +"``PYMEM_ALLOCATOR_MIMALLOC_DEBUG`` (``7``): use ``mimalloc``, a fast malloc " +"replacement with :ref:`debug hooks `." +msgstr "" + +#: c-api/init_config.rst:262 msgid "" "``PYMEM_ALLOCATOR_PYMALLOC`` and ``PYMEM_ALLOCATOR_PYMALLOC_DEBUG`` are not " "supported if Python is :option:`configured using --without-pymalloc <--" "without-pymalloc>`." msgstr "" -#: c-api/init_config.rst:261 +#: c-api/init_config.rst:266 +msgid "" +"``PYMEM_ALLOCATOR_MIMALLOC`` and ``PYMEM_ALLOCATOR_MIMALLOC_DEBUG`` are not " +"supported if Python is :option:`configured using --without-mimalloc <--" +"without-mimalloc>` or if the underlying atomic support isn't available." +msgstr "" + +#: c-api/init_config.rst:271 msgid "See :ref:`Memory Management `." msgstr "" -#: c-api/init_config.rst:263 +#: c-api/init_config.rst:273 msgid "Default: ``PYMEM_ALLOCATOR_NOT_SET``." msgstr "" -#: c-api/init_config.rst:267 +#: c-api/init_config.rst:277 msgid "Set the LC_CTYPE locale to the user preferred locale." msgstr "" -#: c-api/init_config.rst:269 +#: c-api/init_config.rst:279 msgid "" "If equals to ``0``, set :c:member:`~PyPreConfig.coerce_c_locale` and :c:" "member:`~PyPreConfig.coerce_c_locale_warn` members to ``0``." msgstr "" -#: c-api/init_config.rst:283 +#: c-api/init_config.rst:293 msgid "See the :term:`locale encoding`." msgstr "" -#: c-api/init_config.rst:329 c-api/init_config.rst:684 +#: c-api/init_config.rst:339 c-api/init_config.rst:710 msgid "Default: ``1`` in Python config, ``0`` in isolated config." msgstr "" -#: c-api/init_config.rst:278 +#: c-api/init_config.rst:288 msgid "If equals to ``2``, coerce the C locale." msgstr "" -#: c-api/init_config.rst:280 +#: c-api/init_config.rst:290 msgid "" "If equals to ``1``, read the LC_CTYPE locale to decide if it should be " "coerced." msgstr "" -#: c-api/init_config.rst:291 +#: c-api/init_config.rst:301 msgid "Default: ``-1`` in Python config, ``0`` in isolated config." msgstr "" -#: c-api/init_config.rst:289 +#: c-api/init_config.rst:299 msgid "If non-zero, emit a warning if the C locale is coerced." msgstr "" -#: c-api/init_config.rst:295 +#: c-api/init_config.rst:305 msgid "" ":ref:`Python Development Mode `: see :c:member:`PyConfig.dev_mode`." msgstr "" -#: c-api/init_config.rst:693 c-api/init_config.rst:1188 +#: c-api/init_config.rst:719 c-api/init_config.rst:1244 msgid "Default: ``-1`` in Python mode, ``0`` in isolated mode." msgstr "" -#: c-api/init_config.rst:302 +#: c-api/init_config.rst:312 msgid "Isolated mode: see :c:member:`PyConfig.isolated`." msgstr "" -#: c-api/init_config.rst:880 +#: c-api/init_config.rst:921 msgid "Default: ``0`` in Python mode, ``1`` in isolated mode." msgstr "" -#: c-api/init_config.rst:308 +#: c-api/init_config.rst:318 msgid "If non-zero:" msgstr "" -#: c-api/init_config.rst:310 +#: c-api/init_config.rst:320 msgid "Set :c:member:`PyPreConfig.utf8_mode` to ``0``," msgstr "" -#: c-api/init_config.rst:311 +#: c-api/init_config.rst:321 msgid "Set :c:member:`PyConfig.filesystem_encoding` to ``\"mbcs\"``," msgstr "" -#: c-api/init_config.rst:312 +#: c-api/init_config.rst:322 msgid "Set :c:member:`PyConfig.filesystem_errors` to ``\"replace\"``." msgstr "" -#: c-api/init_config.rst:314 +#: c-api/init_config.rst:324 msgid "" "Initialized from the :envvar:`PYTHONLEGACYWINDOWSFSENCODING` environment " "variable value." msgstr "" -#: c-api/init_config.rst:894 +#: c-api/init_config.rst:935 msgid "" "Only available on Windows. ``#ifdef MS_WINDOWS`` macro can be used for " "Windows specific code." msgstr "" -#: c-api/init_config.rst:632 c-api/init_config.rst:706 -#: c-api/init_config.rst:829 c-api/init_config.rst:897 -#: c-api/init_config.rst:971 c-api/init_config.rst:1083 -#: c-api/init_config.rst:1152 c-api/init_config.rst:1239 +#: c-api/init_config.rst:658 c-api/init_config.rst:732 +#: c-api/init_config.rst:857 c-api/init_config.rst:938 +#: c-api/init_config.rst:1012 c-api/init_config.rst:1126 +#: c-api/init_config.rst:1209 c-api/init_config.rst:1298 msgid "Default: ``0``." msgstr "" -#: c-api/init_config.rst:324 +#: c-api/init_config.rst:334 msgid "" "If non-zero, :c:func:`Py_PreInitializeFromArgs` and :c:func:" "`Py_PreInitializeFromBytesArgs` parse their ``argv`` argument the same way " @@ -445,93 +464,93 @@ msgid "" "Arguments `." msgstr "" -#: c-api/init_config.rst:333 +#: c-api/init_config.rst:343 msgid "" "Use :ref:`environment variables `? See :c:member:`PyConfig." "use_environment`." msgstr "" -#: c-api/init_config.rst:1213 +#: c-api/init_config.rst:1272 msgid "Default: ``1`` in Python config and ``0`` in isolated config." msgstr "" -#: c-api/init_config.rst:340 +#: c-api/init_config.rst:350 msgid "If non-zero, enable the :ref:`Python UTF-8 Mode `." msgstr "" -#: c-api/init_config.rst:342 +#: c-api/init_config.rst:352 msgid "" "Set to ``0`` or ``1`` by the :option:`-X utf8 <-X>` command line option and " "the :envvar:`PYTHONUTF8` environment variable." msgstr "" -#: c-api/init_config.rst:345 +#: c-api/init_config.rst:355 msgid "Also set to ``1`` if the ``LC_CTYPE`` locale is ``C`` or ``POSIX``." msgstr "" -#: c-api/init_config.rst:347 +#: c-api/init_config.rst:357 msgid "Default: ``-1`` in Python config and ``0`` in isolated config." msgstr "" -#: c-api/init_config.rst:353 +#: c-api/init_config.rst:363 msgid "Preinitialize Python with PyPreConfig" msgstr "" -#: c-api/init_config.rst:355 +#: c-api/init_config.rst:365 msgid "The preinitialization of Python:" msgstr "" -#: c-api/init_config.rst:357 +#: c-api/init_config.rst:367 msgid "Set the Python memory allocators (:c:member:`PyPreConfig.allocator`)" msgstr "" -#: c-api/init_config.rst:358 +#: c-api/init_config.rst:368 msgid "Configure the LC_CTYPE locale (:term:`locale encoding`)" msgstr "" -#: c-api/init_config.rst:359 +#: c-api/init_config.rst:369 msgid "" "Set the :ref:`Python UTF-8 Mode ` (:c:member:`PyPreConfig." "utf8_mode`)" msgstr "" -#: c-api/init_config.rst:362 +#: c-api/init_config.rst:372 msgid "" "The current preconfiguration (``PyPreConfig`` type) is stored in " "``_PyRuntime.preconfig``." msgstr "" -#: c-api/init_config.rst:365 +#: c-api/init_config.rst:375 msgid "Functions to preinitialize Python:" msgstr "" -#: c-api/init_config.rst:375 c-api/init_config.rst:384 +#: c-api/init_config.rst:385 c-api/init_config.rst:394 msgid "Preinitialize Python from *preconfig* preconfiguration." msgstr "" -#: c-api/init_config.rst:380 c-api/init_config.rst:389 +#: c-api/init_config.rst:390 c-api/init_config.rst:399 msgid "*preconfig* must not be ``NULL``." msgstr "" -#: c-api/init_config.rst:377 +#: c-api/init_config.rst:387 msgid "" "Parse *argv* command line arguments (bytes strings) if :c:member:" "`~PyPreConfig.parse_argv` of *preconfig* is non-zero." msgstr "" -#: c-api/init_config.rst:386 +#: c-api/init_config.rst:396 msgid "" "Parse *argv* command line arguments (wide strings) if :c:member:" "`~PyPreConfig.parse_argv` of *preconfig* is non-zero." msgstr "" -#: c-api/init_config.rst:1301 +#: c-api/init_config.rst:1359 msgid "" "The caller is responsible to handle exceptions (error or exit) using :c:func:" "`PyStatus_Exception` and :c:func:`Py_ExitStatusException`." msgstr "" -#: c-api/init_config.rst:394 +#: c-api/init_config.rst:404 msgid "" "For :ref:`Python Configuration ` (:c:func:" "`PyPreConfig_InitPythonConfig`), if Python is initialized with command line " @@ -541,7 +560,7 @@ msgid "" "`Python UTF-8 Mode `." msgstr "" -#: c-api/init_config.rst:401 +#: c-api/init_config.rst:411 msgid "" "``PyMem_SetAllocator()`` can be called after :c:func:`Py_PreInitialize` and " "before :c:func:`Py_InitializeFromConfig` to install a custom memory " @@ -549,7 +568,7 @@ msgid "" "`PyPreConfig.allocator` is set to ``PYMEM_ALLOCATOR_NOT_SET``." msgstr "" -#: c-api/init_config.rst:406 +#: c-api/init_config.rst:416 msgid "" "Python memory allocation functions like :c:func:`PyMem_RawMalloc` must not " "be used before the Python preinitialization, whereas calling directly " @@ -557,13 +576,13 @@ msgid "" "not be called before the Python preinitialization." msgstr "" -#: c-api/init_config.rst:411 +#: c-api/init_config.rst:421 msgid "" "Example using the preinitialization to enable the :ref:`Python UTF-8 Mode " "`::" msgstr "" -#: c-api/init_config.rst:414 +#: c-api/init_config.rst:424 msgid "" "PyStatus status;\n" "PyPreConfig preconfig;\n" @@ -583,83 +602,83 @@ msgid "" "Py_Finalize();" msgstr "" -#: c-api/init_config.rst:433 +#: c-api/init_config.rst:443 msgid "PyConfig" msgstr "" -#: c-api/init_config.rst:437 +#: c-api/init_config.rst:447 msgid "Structure containing most parameters to configure Python." msgstr "" -#: c-api/init_config.rst:439 +#: c-api/init_config.rst:449 msgid "" "When done, the :c:func:`PyConfig_Clear` function must be used to release the " "configuration memory." msgstr "" -#: c-api/init_config.rst:444 +#: c-api/init_config.rst:454 msgid "Structure methods:" msgstr "" -#: c-api/init_config.rst:448 +#: c-api/init_config.rst:458 msgid "" "Initialize configuration with the :ref:`Python Configuration `." msgstr "" -#: c-api/init_config.rst:453 +#: c-api/init_config.rst:463 msgid "" "Initialize configuration with the :ref:`Isolated Configuration `." msgstr "" -#: c-api/init_config.rst:458 +#: c-api/init_config.rst:468 msgid "Copy the wide character string *str* into ``*config_str``." msgstr "" -#: c-api/init_config.rst:467 c-api/init_config.rst:482 -#: c-api/init_config.rst:505 +#: c-api/init_config.rst:477 c-api/init_config.rst:492 +#: c-api/init_config.rst:515 msgid ":ref:`Preinitialize Python ` if needed." msgstr "" -#: c-api/init_config.rst:464 +#: c-api/init_config.rst:474 msgid "" "Decode *str* using :c:func:`Py_DecodeLocale` and set the result into " "``*config_str``." msgstr "" -#: c-api/init_config.rst:471 +#: c-api/init_config.rst:481 msgid "" "Set command line arguments (:c:member:`~PyConfig.argv` member of *config*) " "from the *argv* list of wide character strings." msgstr "" -#: c-api/init_config.rst:478 +#: c-api/init_config.rst:488 msgid "" "Set command line arguments (:c:member:`~PyConfig.argv` member of *config*) " "from the *argv* list of bytes strings. Decode bytes using :c:func:" "`Py_DecodeLocale`." msgstr "" -#: c-api/init_config.rst:486 +#: c-api/init_config.rst:496 msgid "Set the list of wide strings *list* to *length* and *items*." msgstr "" -#: c-api/init_config.rst:492 +#: c-api/init_config.rst:502 msgid "Read all Python configuration." msgstr "" -#: c-api/init_config.rst:494 +#: c-api/init_config.rst:504 msgid "Fields which are already initialized are left unchanged." msgstr "" -#: c-api/init_config.rst:496 +#: c-api/init_config.rst:506 msgid "" "Fields for :ref:`path configuration ` are no longer " "calculated or modified when calling this function, as of Python 3.11." msgstr "" -#: c-api/init_config.rst:1000 +#: c-api/init_config.rst:1041 msgid "" "The :c:func:`PyConfig_Read` function only parses :c:member:`PyConfig.argv` " "arguments once: :c:member:`PyConfig.parse_argv` is set to ``2`` after " @@ -668,25 +687,25 @@ msgid "" "as Python options." msgstr "" -#: c-api/init_config.rst:507 +#: c-api/init_config.rst:517 msgid "" "The :c:member:`PyConfig.argv` arguments are now only parsed once, :c:member:" "`PyConfig.parse_argv` is set to ``2`` after arguments are parsed, and " "arguments are only parsed if :c:member:`PyConfig.parse_argv` equals ``1``." msgstr "" -#: c-api/init_config.rst:513 +#: c-api/init_config.rst:523 msgid "" ":c:func:`PyConfig_Read` no longer calculates all paths, and so fields listed " "under :ref:`Python Path Configuration ` may no longer be " "updated until :c:func:`Py_InitializeFromConfig` is called." msgstr "" -#: c-api/init_config.rst:521 +#: c-api/init_config.rst:531 msgid "Release configuration memory." msgstr "" -#: c-api/init_config.rst:523 +#: c-api/init_config.rst:533 msgid "" "Most ``PyConfig`` methods :ref:`preinitialize Python ` if needed. " "In that case, the Python preinitialization configuration (:c:type:" @@ -695,23 +714,23 @@ msgid "" "before calling a :c:type:`PyConfig` method:" msgstr "" -#: c-api/init_config.rst:529 +#: c-api/init_config.rst:539 msgid ":c:member:`PyConfig.dev_mode`" msgstr "" -#: c-api/init_config.rst:530 +#: c-api/init_config.rst:540 msgid ":c:member:`PyConfig.isolated`" msgstr "" -#: c-api/init_config.rst:531 +#: c-api/init_config.rst:541 msgid ":c:member:`PyConfig.parse_argv`" msgstr "" -#: c-api/init_config.rst:532 +#: c-api/init_config.rst:542 msgid ":c:member:`PyConfig.use_environment`" msgstr "" -#: c-api/init_config.rst:534 +#: c-api/init_config.rst:544 msgid "" "Moreover, if :c:func:`PyConfig_SetArgv` or :c:func:`PyConfig_SetBytesArgv` " "is used, this method must be called before other methods, since the " @@ -719,405 +738,427 @@ msgid "" "member:`~PyConfig.parse_argv` is non-zero)." msgstr "" -#: c-api/init_config.rst:539 +#: c-api/init_config.rst:549 msgid "" "The caller of these methods is responsible to handle exceptions (error or " "exit) using ``PyStatus_Exception()`` and ``Py_ExitStatusException()``." msgstr "" -#: c-api/init_config.rst:548 -msgid "Command line arguments: :data:`sys.argv`." +#: c-api/init_config.rst:562 +msgid "" +"Set :data:`sys.argv` command line arguments based on :c:member:`~PyConfig." +"argv`. These parameters are similar to those passed to the program's :c:" +"func:`main` function with the difference that the first entry should refer " +"to the script file to be executed rather than the executable hosting the " +"Python interpreter. If there isn't a script that will be run, the first " +"entry in :c:member:`~PyConfig.argv` can be an empty string." msgstr "" -#: c-api/init_config.rst:550 +#: c-api/init_config.rst:570 msgid "" "Set :c:member:`~PyConfig.parse_argv` to ``1`` to parse :c:member:`~PyConfig." "argv` the same way the regular Python parses Python command line arguments " "and then to strip Python arguments from :c:member:`~PyConfig.argv`." msgstr "" -#: c-api/init_config.rst:555 +#: c-api/init_config.rst:575 msgid "" "If :c:member:`~PyConfig.argv` is empty, an empty string is added to ensure " "that :data:`sys.argv` always exists and is never empty." msgstr "" -#: c-api/init_config.rst:585 c-api/init_config.rst:605 -#: c-api/init_config.rst:722 c-api/init_config.rst:941 -#: c-api/init_config.rst:1060 c-api/init_config.rst:1091 -#: c-api/init_config.rst:1112 +#: c-api/init_config.rst:605 c-api/init_config.rst:629 +#: c-api/init_config.rst:750 c-api/init_config.rst:982 +#: c-api/init_config.rst:1102 c-api/init_config.rst:1134 +#: c-api/init_config.rst:1155 c-api/init_config.rst:1169 msgid "Default: ``NULL``." msgstr "" -#: c-api/init_config.rst:560 +#: c-api/init_config.rst:580 msgid "See also the :c:member:`~PyConfig.orig_argv` member." msgstr "" -#: c-api/init_config.rst:564 +#: c-api/init_config.rst:584 msgid "" "If equals to zero, ``Py_RunMain()`` prepends a potentially unsafe path to :" "data:`sys.path` at startup:" msgstr "" -#: c-api/init_config.rst:567 +#: c-api/init_config.rst:587 msgid "" "If :c:member:`argv[0] ` is equal to ``L\"-m\"`` (``python -m " "module``), prepend the current working directory." msgstr "" -#: c-api/init_config.rst:569 +#: c-api/init_config.rst:589 msgid "" "If running a script (``python script.py``), prepend the script's directory. " "If it's a symbolic link, resolve symbolic links." msgstr "" -#: c-api/init_config.rst:571 +#: c-api/init_config.rst:591 msgid "" "Otherwise (``python -c code`` and ``python``), prepend an empty string, " "which means the current working directory." msgstr "" -#: c-api/init_config.rst:574 +#: c-api/init_config.rst:594 msgid "" "Set to ``1`` by the :option:`-P` command line option and the :envvar:" "`PYTHONSAFEPATH` environment variable." msgstr "" -#: c-api/init_config.rst:577 +#: c-api/init_config.rst:597 msgid "Default: ``0`` in Python config, ``1`` in isolated config." msgstr "" -#: c-api/init_config.rst:583 +#: c-api/init_config.rst:603 msgid ":data:`sys.base_exec_prefix`." msgstr "" -#: c-api/init_config.rst:599 c-api/init_config.rst:715 -#: c-api/init_config.rst:958 c-api/init_config.rst:1044 +#: c-api/init_config.rst:621 c-api/init_config.rst:741 +#: c-api/init_config.rst:999 c-api/init_config.rst:1085 msgid "Part of the :ref:`Python Path Configuration ` output." msgstr "" -#: c-api/init_config.rst:591 +#: c-api/init_config.rst:609 +msgid "See also :c:member:`PyConfig.exec_prefix`." +msgstr "" + +#: c-api/init_config.rst:613 msgid "Python base executable: :data:`sys._base_executable`." msgstr "" -#: c-api/init_config.rst:593 +#: c-api/init_config.rst:615 msgid "Set by the :envvar:`__PYVENV_LAUNCHER__` environment variable." msgstr "" -#: c-api/init_config.rst:595 +#: c-api/init_config.rst:617 msgid "Set from :c:member:`PyConfig.executable` if ``NULL``." msgstr "" -#: c-api/init_config.rst:603 +#: c-api/init_config.rst:623 +msgid "See also :c:member:`PyConfig.executable`." +msgstr "" + +#: c-api/init_config.rst:627 msgid ":data:`sys.base_prefix`." msgstr "" -#: c-api/init_config.rst:611 +#: c-api/init_config.rst:633 +msgid "See also :c:member:`PyConfig.prefix`." +msgstr "" + +#: c-api/init_config.rst:637 msgid "" "If equals to ``0`` and :c:member:`~PyConfig.configure_c_stdio` is non-zero, " "disable buffering on the C streams stdout and stderr." msgstr "" -#: c-api/init_config.rst:614 +#: c-api/init_config.rst:640 msgid "" "Set to ``0`` by the :option:`-u` command line option and the :envvar:" "`PYTHONUNBUFFERED` environment variable." msgstr "" -#: c-api/init_config.rst:617 +#: c-api/init_config.rst:643 msgid "stdin is always opened in buffered mode." msgstr "" -#: c-api/init_config.rst:652 c-api/init_config.rst:1271 +#: c-api/init_config.rst:678 c-api/init_config.rst:1330 msgid "Default: ``1``." msgstr "" -#: c-api/init_config.rst:623 +#: c-api/init_config.rst:649 msgid "" "If equals to ``1``, issue a warning when comparing :class:`bytes` or :class:" "`bytearray` with :class:`str`, or comparing :class:`bytes` with :class:`int`." msgstr "" -#: c-api/init_config.rst:627 +#: c-api/init_config.rst:653 msgid "" "If equal or greater to ``2``, raise a :exc:`BytesWarning` exception in these " "cases." msgstr "" -#: c-api/init_config.rst:630 +#: c-api/init_config.rst:656 msgid "Incremented by the :option:`-b` command line option." msgstr "" -#: c-api/init_config.rst:636 +#: c-api/init_config.rst:662 msgid "" "If non-zero, emit a :exc:`EncodingWarning` warning when :class:`io." "TextIOWrapper` uses its default encoding. See :ref:`io-encoding-warning` for " "details." msgstr "" -#: c-api/init_config.rst:645 +#: c-api/init_config.rst:671 msgid "" "If equals to ``0``, disables the inclusion of the end line and column " "mappings in code objects. Also disables traceback printing carets to " "specific error locations." msgstr "" -#: c-api/init_config.rst:649 +#: c-api/init_config.rst:675 msgid "" "Set to ``0`` by the :envvar:`PYTHONNODEBUGRANGES` environment variable and " "by the :option:`-X no_debug_ranges <-X>` command line option." msgstr "" -#: c-api/init_config.rst:658 +#: c-api/init_config.rst:684 msgid "" "Control the validation behavior of hash-based ``.pyc`` files: value of the :" "option:`--check-hash-based-pycs` command line option." msgstr "" -#: c-api/init_config.rst:661 +#: c-api/init_config.rst:687 msgid "Valid values:" msgstr "" -#: c-api/init_config.rst:663 +#: c-api/init_config.rst:689 msgid "" "``L\"always\"``: Hash the source file for invalidation regardless of value " "of the 'check_source' flag." msgstr "" -#: c-api/init_config.rst:665 +#: c-api/init_config.rst:691 msgid "``L\"never\"``: Assume that hash-based pycs always are valid." msgstr "" -#: c-api/init_config.rst:666 +#: c-api/init_config.rst:692 msgid "" "``L\"default\"``: The 'check_source' flag in hash-based pycs determines " "invalidation." msgstr "" -#: c-api/init_config.rst:669 +#: c-api/init_config.rst:695 msgid "Default: ``L\"default\"``." msgstr "" -#: c-api/init_config.rst:671 +#: c-api/init_config.rst:697 msgid "See also :pep:`552` \"Deterministic pycs\"." msgstr "" -#: c-api/init_config.rst:675 +#: c-api/init_config.rst:701 msgid "If non-zero, configure C standard streams:" msgstr "" -#: c-api/init_config.rst:677 +#: c-api/init_config.rst:703 msgid "" "On Windows, set the binary mode (``O_BINARY``) on stdin, stdout and stderr." msgstr "" -#: c-api/init_config.rst:679 +#: c-api/init_config.rst:705 msgid "" "If :c:member:`~PyConfig.buffered_stdio` equals zero, disable buffering of " "stdin, stdout and stderr streams." msgstr "" -#: c-api/init_config.rst:681 +#: c-api/init_config.rst:707 msgid "" "If :c:member:`~PyConfig.interactive` is non-zero, enable stream buffering on " "stdin and stdout (only stdout on Windows)." msgstr "" -#: c-api/init_config.rst:688 +#: c-api/init_config.rst:714 msgid "If non-zero, enable the :ref:`Python Development Mode `." msgstr "" -#: c-api/init_config.rst:690 +#: c-api/init_config.rst:716 msgid "" "Set to ``1`` by the :option:`-X dev <-X>` option and the :envvar:" "`PYTHONDEVMODE` environment variable." msgstr "" -#: c-api/init_config.rst:697 +#: c-api/init_config.rst:723 msgid "Dump Python references?" msgstr "" -#: c-api/init_config.rst:699 +#: c-api/init_config.rst:725 msgid "If non-zero, dump all objects which are still alive at exit." msgstr "" -#: c-api/init_config.rst:701 +#: c-api/init_config.rst:727 msgid "Set to ``1`` by the :envvar:`PYTHONDUMPREFS` environment variable." msgstr "" -#: c-api/init_config.rst:703 +#: c-api/init_config.rst:729 msgid "" -"Need a special build of Python with the ``Py_TRACE_REFS`` macro defined: see " -"the :option:`configure --with-trace-refs option <--with-trace-refs>`." +"Needs a special build of Python with the ``Py_TRACE_REFS`` macro defined: " +"see the :option:`configure --with-trace-refs option <--with-trace-refs>`." msgstr "" -#: c-api/init_config.rst:710 +#: c-api/init_config.rst:736 msgid "" "The site-specific directory prefix where the platform-dependent Python files " "are installed: :data:`sys.exec_prefix`." msgstr "" -#: c-api/init_config.rst:719 +#: c-api/init_config.rst:743 +msgid "See also :c:member:`PyConfig.base_exec_prefix`." +msgstr "" + +#: c-api/init_config.rst:747 msgid "" "The absolute path of the executable binary for the Python interpreter: :data:" "`sys.executable`." msgstr "" -#: c-api/init_config.rst:728 +#: c-api/init_config.rst:754 +msgid "See also :c:member:`PyConfig.base_executable`." +msgstr "" + +#: c-api/init_config.rst:758 msgid "Enable faulthandler?" msgstr "" -#: c-api/init_config.rst:730 +#: c-api/init_config.rst:760 msgid "If non-zero, call :func:`faulthandler.enable` at startup." msgstr "" -#: c-api/init_config.rst:732 +#: c-api/init_config.rst:762 msgid "" "Set to ``1`` by :option:`-X faulthandler <-X>` and the :envvar:" "`PYTHONFAULTHANDLER` environment variable." msgstr "" -#: c-api/init_config.rst:739 +#: c-api/init_config.rst:769 msgid "" ":term:`Filesystem encoding `: :func:" "`sys.getfilesystemencoding`." msgstr "" -#: c-api/init_config.rst:742 +#: c-api/init_config.rst:772 msgid "On macOS, Android and VxWorks: use ``\"utf-8\"`` by default." msgstr "" -#: c-api/init_config.rst:744 +#: c-api/init_config.rst:774 msgid "" "On Windows: use ``\"utf-8\"`` by default, or ``\"mbcs\"`` if :c:member:" "`~PyPreConfig.legacy_windows_fs_encoding` of :c:type:`PyPreConfig` is non-" "zero." msgstr "" -#: c-api/init_config.rst:748 +#: c-api/init_config.rst:778 msgid "Default encoding on other platforms:" msgstr "" -#: c-api/init_config.rst:750 +#: c-api/init_config.rst:780 msgid "``\"utf-8\"`` if :c:member:`PyPreConfig.utf8_mode` is non-zero." msgstr "" -#: c-api/init_config.rst:751 +#: c-api/init_config.rst:781 msgid "" "``\"ascii\"`` if Python detects that ``nl_langinfo(CODESET)`` announces the " "ASCII encoding, whereas the ``mbstowcs()`` function decodes from a different " "encoding (usually Latin1)." msgstr "" -#: c-api/init_config.rst:754 +#: c-api/init_config.rst:784 msgid "``\"utf-8\"`` if ``nl_langinfo(CODESET)`` returns an empty string." msgstr "" -#: c-api/init_config.rst:755 +#: c-api/init_config.rst:785 msgid "" "Otherwise, use the :term:`locale encoding`: ``nl_langinfo(CODESET)`` result." msgstr "" -#: c-api/init_config.rst:758 +#: c-api/init_config.rst:788 msgid "" "At Python startup, the encoding name is normalized to the Python codec name. " "For example, ``\"ANSI_X3.4-1968\"`` is replaced with ``\"ascii\"``." msgstr "" -#: c-api/init_config.rst:761 +#: c-api/init_config.rst:791 msgid "See also the :c:member:`~PyConfig.filesystem_errors` member." msgstr "" -#: c-api/init_config.rst:765 +#: c-api/init_config.rst:795 msgid "" ":term:`Filesystem error handler `: :" "func:`sys.getfilesystemencodeerrors`." msgstr "" -#: c-api/init_config.rst:768 +#: c-api/init_config.rst:798 msgid "" "On Windows: use ``\"surrogatepass\"`` by default, or ``\"replace\"`` if :c:" "member:`~PyPreConfig.legacy_windows_fs_encoding` of :c:type:`PyPreConfig` is " "non-zero." msgstr "" -#: c-api/init_config.rst:772 +#: c-api/init_config.rst:802 msgid "On other platforms: use ``\"surrogateescape\"`` by default." msgstr "" -#: c-api/init_config.rst:774 +#: c-api/init_config.rst:804 msgid "Supported error handlers:" msgstr "" -#: c-api/init_config.rst:776 +#: c-api/init_config.rst:806 msgid "``\"strict\"``" msgstr "" -#: c-api/init_config.rst:777 +#: c-api/init_config.rst:807 msgid "``\"surrogateescape\"``" msgstr "" -#: c-api/init_config.rst:778 +#: c-api/init_config.rst:808 msgid "``\"surrogatepass\"`` (only supported with the UTF-8 encoding)" msgstr "" -#: c-api/init_config.rst:780 +#: c-api/init_config.rst:810 msgid "See also the :c:member:`~PyConfig.filesystem_encoding` member." msgstr "" -#: c-api/init_config.rst:785 +#: c-api/init_config.rst:815 msgid "Randomized hash function seed." msgstr "" -#: c-api/init_config.rst:787 +#: c-api/init_config.rst:817 msgid "" "If :c:member:`~PyConfig.use_hash_seed` is zero, a seed is chosen randomly at " "Python startup, and :c:member:`~PyConfig.hash_seed` is ignored." msgstr "" -#: c-api/init_config.rst:790 +#: c-api/init_config.rst:820 msgid "Set by the :envvar:`PYTHONHASHSEED` environment variable." msgstr "" -#: c-api/init_config.rst:792 +#: c-api/init_config.rst:822 msgid "" "Default *use_hash_seed* value: ``-1`` in Python mode, ``0`` in isolated mode." msgstr "" -#: c-api/init_config.rst:797 -msgid "Python home directory." -msgstr "" - -#: c-api/init_config.rst:799 +#: c-api/init_config.rst:827 msgid "" -"If :c:func:`Py_SetPythonHome` has been called, use its argument if it is not " -"``NULL``." +"Set the default Python \"home\" directory, that is, the location of the " +"standard Python libraries (see :envvar:`PYTHONHOME`)." msgstr "" -#: c-api/init_config.rst:802 +#: c-api/init_config.rst:830 msgid "Set by the :envvar:`PYTHONHOME` environment variable." msgstr "" -#: c-api/init_config.rst:923 c-api/init_config.rst:1032 -#: c-api/init_config.rst:1062 +#: c-api/init_config.rst:964 c-api/init_config.rst:1073 +#: c-api/init_config.rst:1104 msgid "Part of the :ref:`Python Path Configuration ` input." msgstr "" -#: c-api/init_config.rst:810 +#: c-api/init_config.rst:838 msgid "If non-zero, profile import time." msgstr "" -#: c-api/init_config.rst:812 +#: c-api/init_config.rst:840 msgid "" "Set the ``1`` by the :option:`-X importtime <-X>` option and the :envvar:" "`PYTHONPROFILEIMPORTTIME` environment variable." msgstr "" -#: c-api/init_config.rst:819 +#: c-api/init_config.rst:847 msgid "Enter interactive mode after executing a script or a command." msgstr "" -#: c-api/init_config.rst:821 +#: c-api/init_config.rst:849 msgid "" "If greater than ``0``, enable inspect: when a script is passed as first " "argument or the -c option is used, enter interactive mode after executing " @@ -1125,29 +1166,29 @@ msgid "" "a terminal." msgstr "" -#: c-api/init_config.rst:826 +#: c-api/init_config.rst:854 msgid "" "Incremented by the :option:`-i` command line option. Set to ``1`` if the :" "envvar:`PYTHONINSPECT` environment variable is non-empty." msgstr "" -#: c-api/init_config.rst:833 +#: c-api/init_config.rst:861 msgid "Install Python signal handlers?" msgstr "" -#: c-api/init_config.rst:1006 c-api/init_config.rst:1223 +#: c-api/init_config.rst:1047 c-api/init_config.rst:1282 msgid "Default: ``1`` in Python mode, ``0`` in isolated mode." msgstr "" -#: c-api/init_config.rst:839 +#: c-api/init_config.rst:867 msgid "If greater than ``0``, enable the interactive mode (REPL)." msgstr "" -#: c-api/init_config.rst:841 +#: c-api/init_config.rst:869 msgid "Incremented by the :option:`-i` command line option." msgstr "" -#: c-api/init_config.rst:847 +#: c-api/init_config.rst:875 msgid "" "Configures the :ref:`integer string conversion length limitation " "`. An initial value of ``-1`` means the value will be " @@ -1157,106 +1198,123 @@ msgid "" "str_digits_check_threshold`) are unsupported and will produce an error." msgstr "" -#: c-api/init_config.rst:855 +#: c-api/init_config.rst:883 msgid "" "Configured by the :option:`-X int_max_str_digits <-X>` command line flag or " "the :envvar:`PYTHONINTMAXSTRDIGITS` environment variable." msgstr "" -#: c-api/init_config.rst:858 +#: c-api/init_config.rst:886 msgid "" "Default: ``-1`` in Python mode. 4300 (:data:`sys.int_info." "default_max_str_digits`) in isolated mode." msgstr "" -#: c-api/init_config.rst:865 +#: c-api/init_config.rst:893 +msgid "" +"If the value of :c:member:`~PyConfig.cpu_count` is not ``-1`` then it will " +"override the return values of :func:`os.cpu_count`, :func:`os." +"process_cpu_count`, and :func:`multiprocessing.cpu_count`." +msgstr "" + +#: c-api/init_config.rst:897 +msgid "" +"Configured by the :samp:`-X cpu_count={n|default}` command line flag or the :" +"envvar:`PYTHON_CPU_COUNT` environment variable." +msgstr "" + +#: c-api/init_config.rst:1259 +msgid "Default: ``-1``." +msgstr "" + +#: c-api/init_config.rst:906 msgid "If greater than ``0``, enable isolated mode:" msgstr "" -#: c-api/init_config.rst:867 +#: c-api/init_config.rst:908 msgid "" "Set :c:member:`~PyConfig.safe_path` to ``1``: don't prepend a potentially " "unsafe path to :data:`sys.path` at Python startup, such as the current " "directory, the script's directory or an empty string." msgstr "" -#: c-api/init_config.rst:871 +#: c-api/init_config.rst:912 msgid "" "Set :c:member:`~PyConfig.use_environment` to ``0``: ignore ``PYTHON`` " "environment variables." msgstr "" -#: c-api/init_config.rst:873 +#: c-api/init_config.rst:914 msgid "" "Set :c:member:`~PyConfig.user_site_directory` to ``0``: don't add the user " "site directory to :data:`sys.path`." msgstr "" -#: c-api/init_config.rst:875 +#: c-api/init_config.rst:916 msgid "" "Python REPL doesn't import :mod:`readline` nor enable default readline " "configuration on interactive prompts." msgstr "" -#: c-api/init_config.rst:878 +#: c-api/init_config.rst:919 msgid "Set to ``1`` by the :option:`-I` command line option." msgstr "" -#: c-api/init_config.rst:882 +#: c-api/init_config.rst:923 msgid "" "See also the :ref:`Isolated Configuration ` and :c:" "member:`PyPreConfig.isolated`." msgstr "" -#: c-api/init_config.rst:887 +#: c-api/init_config.rst:928 msgid "" "If non-zero, use :class:`io.FileIO` instead of :class:`!io." "_WindowsConsoleIO` for :data:`sys.stdin`, :data:`sys.stdout` and :data:`sys." "stderr`." msgstr "" -#: c-api/init_config.rst:891 +#: c-api/init_config.rst:932 msgid "" "Set to ``1`` if the :envvar:`PYTHONLEGACYWINDOWSSTDIO` environment variable " "is set to a non-empty string." msgstr "" -#: c-api/init_config.rst:899 +#: c-api/init_config.rst:940 msgid "See also the :pep:`528` (Change Windows console encoding to UTF-8)." msgstr "" -#: c-api/init_config.rst:903 +#: c-api/init_config.rst:944 msgid "" "If non-zero, dump statistics on :ref:`Python pymalloc memory allocator " "` at exit." msgstr "" -#: c-api/init_config.rst:906 +#: c-api/init_config.rst:947 msgid "Set to ``1`` by the :envvar:`PYTHONMALLOCSTATS` environment variable." msgstr "" -#: c-api/init_config.rst:908 +#: c-api/init_config.rst:949 msgid "" "The option is ignored if Python is :option:`configured using the --without-" "pymalloc option <--without-pymalloc>`." msgstr "" -#: c-api/init_config.rst:915 +#: c-api/init_config.rst:956 msgid "Platform library directory name: :data:`sys.platlibdir`." msgstr "" -#: c-api/init_config.rst:917 +#: c-api/init_config.rst:958 msgid "Set by the :envvar:`PYTHONPLATLIBDIR` environment variable." msgstr "" -#: c-api/init_config.rst:919 +#: c-api/init_config.rst:960 msgid "" "Default: value of the ``PLATLIBDIR`` macro which is set by the :option:" "`configure --with-platlibdir option <--with-platlibdir>` (default: " "``\"lib\"``, or ``\"DLLs\"`` on Windows)." msgstr "" -#: c-api/init_config.rst:927 +#: c-api/init_config.rst:968 msgid "" "This macro is now used on Windows to locate the standard library extension " "modules, typically under ``DLLs``. However, for compatibility, note that " @@ -1264,21 +1322,21 @@ msgid "" "and virtual environments." msgstr "" -#: c-api/init_config.rst:936 +#: c-api/init_config.rst:977 msgid "" "Module search paths (:data:`sys.path`) as a string separated by ``DELIM`` (:" "data:`os.pathsep`)." msgstr "" -#: c-api/init_config.rst:939 +#: c-api/init_config.rst:980 msgid "Set by the :envvar:`PYTHONPATH` environment variable." msgstr "" -#: c-api/init_config.rst:948 +#: c-api/init_config.rst:989 msgid "Module search paths: :data:`sys.path`." msgstr "" -#: c-api/init_config.rst:950 +#: c-api/init_config.rst:991 msgid "" "If :c:member:`~PyConfig.module_search_paths_set` is equal to ``0``, :c:func:" "`Py_InitializeFromConfig` will replace :c:member:`~PyConfig." @@ -1286,41 +1344,41 @@ msgid "" "to ``1``." msgstr "" -#: c-api/init_config.rst:955 +#: c-api/init_config.rst:996 msgid "" "Default: empty list (``module_search_paths``) and ``0`` " "(``module_search_paths_set``)." msgstr "" -#: c-api/init_config.rst:962 +#: c-api/init_config.rst:1003 msgid "Compilation optimization level:" msgstr "" -#: c-api/init_config.rst:964 +#: c-api/init_config.rst:1005 msgid "``0``: Peephole optimizer, set ``__debug__`` to ``True``." msgstr "" -#: c-api/init_config.rst:965 +#: c-api/init_config.rst:1006 msgid "``1``: Level 0, remove assertions, set ``__debug__`` to ``False``." msgstr "" -#: c-api/init_config.rst:966 +#: c-api/init_config.rst:1007 msgid "``2``: Level 1, strip docstrings." msgstr "" -#: c-api/init_config.rst:968 +#: c-api/init_config.rst:1009 msgid "" "Incremented by the :option:`-O` command line option. Set to the :envvar:" "`PYTHONOPTIMIZE` environment variable value." msgstr "" -#: c-api/init_config.rst:975 +#: c-api/init_config.rst:1016 msgid "" "The list of the original command line arguments passed to the Python " "executable: :data:`sys.orig_argv`." msgstr "" -#: c-api/init_config.rst:978 +#: c-api/init_config.rst:1019 msgid "" "If :c:member:`~PyConfig.orig_argv` list is empty and :c:member:`~PyConfig." "argv` is not a list only containing an empty string, :c:func:`PyConfig_Read` " @@ -1329,387 +1387,399 @@ msgid "" "parse_argv` is non-zero)." msgstr "" -#: c-api/init_config.rst:985 +#: c-api/init_config.rst:1026 msgid "" "See also the :c:member:`~PyConfig.argv` member and the :c:func:" "`Py_GetArgcArgv` function." msgstr "" -#: c-api/init_config.rst:1258 c-api/init_config.rst:1277 +#: c-api/init_config.rst:1317 c-api/init_config.rst:1336 msgid "Default: empty list." msgstr "" -#: c-api/init_config.rst:994 +#: c-api/init_config.rst:1035 msgid "Parse command line arguments?" msgstr "" -#: c-api/init_config.rst:996 +#: c-api/init_config.rst:1037 msgid "" "If equals to ``1``, parse :c:member:`~PyConfig.argv` the same way the " "regular Python parses :ref:`command line arguments `, and " "strip Python arguments from :c:member:`~PyConfig.argv`." msgstr "" -#: c-api/init_config.rst:1008 +#: c-api/init_config.rst:1049 msgid "" "The :c:member:`PyConfig.argv` arguments are now only parsed if :c:member:" "`PyConfig.parse_argv` equals to ``1``." msgstr "" -#: c-api/init_config.rst:1014 +#: c-api/init_config.rst:1055 msgid "" "Parser debug mode. If greater than ``0``, turn on parser debugging output " "(for expert only, depending on compilation options)." msgstr "" -#: c-api/init_config.rst:1017 +#: c-api/init_config.rst:1058 msgid "" "Incremented by the :option:`-d` command line option. Set to the :envvar:" "`PYTHONDEBUG` environment variable value." msgstr "" -#: c-api/init_config.rst:1020 +#: c-api/init_config.rst:1166 msgid "" -"Need a :ref:`debug build of Python ` (the ``Py_DEBUG`` macro " +"Needs a :ref:`debug build of Python ` (the ``Py_DEBUG`` macro " "must be defined)." msgstr "" -#: c-api/init_config.rst:1027 +#: c-api/init_config.rst:1068 msgid "" "If non-zero, calculation of path configuration is allowed to log warnings " "into ``stderr``. If equals to ``0``, suppress these warnings." msgstr "" -#: c-api/init_config.rst:1034 +#: c-api/init_config.rst:1075 msgid "Now also applies on Windows." msgstr "" -#: c-api/init_config.rst:1039 +#: c-api/init_config.rst:1080 msgid "" "The site-specific directory prefix where the platform independent Python " "files are installed: :data:`sys.prefix`." msgstr "" -#: c-api/init_config.rst:1048 +#: c-api/init_config.rst:1087 +msgid "See also :c:member:`PyConfig.base_prefix`." +msgstr "" + +#: c-api/init_config.rst:1091 msgid "" "Program name used to initialize :c:member:`~PyConfig.executable` and in " "early error messages during Python initialization." msgstr "" -#: c-api/init_config.rst:1051 -msgid "If :func:`Py_SetProgramName` has been called, use its argument." -msgstr "" - -#: c-api/init_config.rst:1052 +#: c-api/init_config.rst:1094 msgid "On macOS, use :envvar:`PYTHONEXECUTABLE` environment variable if set." msgstr "" -#: c-api/init_config.rst:1053 +#: c-api/init_config.rst:1095 msgid "" "If the ``WITH_NEXT_FRAMEWORK`` macro is defined, use :envvar:" "`__PYVENV_LAUNCHER__` environment variable if set." msgstr "" -#: c-api/init_config.rst:1055 +#: c-api/init_config.rst:1097 msgid "" "Use ``argv[0]`` of :c:member:`~PyConfig.argv` if available and non-empty." msgstr "" -#: c-api/init_config.rst:1057 +#: c-api/init_config.rst:1099 msgid "" "Otherwise, use ``L\"python\"`` on Windows, or ``L\"python3\"`` on other " "platforms." msgstr "" -#: c-api/init_config.rst:1066 +#: c-api/init_config.rst:1108 msgid "" "Directory where cached ``.pyc`` files are written: :data:`sys." "pycache_prefix`." msgstr "" -#: c-api/init_config.rst:1069 +#: c-api/init_config.rst:1111 msgid "" "Set by the :option:`-X pycache_prefix=PATH <-X>` command line option and " -"the :envvar:`PYTHONPYCACHEPREFIX` environment variable." +"the :envvar:`PYTHONPYCACHEPREFIX` environment variable. The command-line " +"option takes precedence." msgstr "" -#: c-api/init_config.rst:1072 +#: c-api/init_config.rst:1115 msgid "If ``NULL``, :data:`sys.pycache_prefix` is set to ``None``." msgstr "" -#: c-api/init_config.rst:1078 +#: c-api/init_config.rst:1121 msgid "" "Quiet mode. If greater than ``0``, don't display the copyright and version " "at Python startup in interactive mode." msgstr "" -#: c-api/init_config.rst:1081 +#: c-api/init_config.rst:1124 msgid "Incremented by the :option:`-q` command line option." msgstr "" -#: c-api/init_config.rst:1087 +#: c-api/init_config.rst:1130 msgid "Value of the :option:`-c` command line option." msgstr "" -#: c-api/init_config.rst:1110 +#: c-api/init_config.rst:1153 msgid "Used by :c:func:`Py_RunMain`." msgstr "" -#: c-api/init_config.rst:1095 +#: c-api/init_config.rst:1138 msgid "" "Filename passed on the command line: trailing command line argument without :" "option:`-c` or :option:`-m`. It is used by the :c:func:`Py_RunMain` function." msgstr "" -#: c-api/init_config.rst:1099 +#: c-api/init_config.rst:1142 msgid "" "For example, it is set to ``script.py`` by the ``python3 script.py arg`` " "command line." msgstr "" -#: c-api/init_config.rst:1102 +#: c-api/init_config.rst:1145 msgid "See also the :c:member:`PyConfig.skip_source_first_line` option." msgstr "" -#: c-api/init_config.rst:1108 +#: c-api/init_config.rst:1151 msgid "Value of the :option:`-m` command line option." msgstr "" -#: c-api/init_config.rst:1116 -msgid "Show total reference count at exit (excluding immortal objects)?" +#: c-api/init_config.rst:1159 +msgid "" +"``package.module`` path to module that should be imported before ``site.py`` " +"is run." +msgstr "" + +#: c-api/init_config.rst:1162 +msgid "" +"Set by the :option:`-X presite=package.module <-X>` command-line option and " +"the :envvar:`PYTHON_PRESITE` environment variable. The command-line option " +"takes precedence." msgstr "" -#: c-api/init_config.rst:1118 +#: c-api/init_config.rst:1173 +msgid "" +"Show total reference count at exit (excluding :term:`immortal` objects)?" +msgstr "" + +#: c-api/init_config.rst:1175 msgid "Set to ``1`` by :option:`-X showrefcount <-X>` command line option." msgstr "" -#: c-api/init_config.rst:1120 +#: c-api/init_config.rst:1177 msgid "" -"Need a :ref:`debug build of Python ` (the ``Py_REF_DEBUG`` " +"Needs a :ref:`debug build of Python ` (the ``Py_REF_DEBUG`` " "macro must be defined)." msgstr "" -#: c-api/init_config.rst:1127 +#: c-api/init_config.rst:1184 msgid "Import the :mod:`site` module at startup?" msgstr "" -#: c-api/init_config.rst:1129 +#: c-api/init_config.rst:1186 msgid "" "If equal to zero, disable the import of the module site and the site-" "dependent manipulations of :data:`sys.path` that it entails." msgstr "" -#: c-api/init_config.rst:1132 +#: c-api/init_config.rst:1189 msgid "" "Also disable these manipulations if the :mod:`site` module is explicitly " "imported later (call :func:`site.main` if you want them to be triggered)." msgstr "" -#: c-api/init_config.rst:1135 +#: c-api/init_config.rst:1192 msgid "Set to ``0`` by the :option:`-S` command line option." msgstr "" -#: c-api/init_config.rst:1137 +#: c-api/init_config.rst:1194 msgid "" ":data:`sys.flags.no_site ` is set to the inverted value of :c:" "member:`~PyConfig.site_import`." msgstr "" -#: c-api/init_config.rst:1144 +#: c-api/init_config.rst:1201 msgid "" "If non-zero, skip the first line of the :c:member:`PyConfig.run_filename` " "source." msgstr "" -#: c-api/init_config.rst:1147 +#: c-api/init_config.rst:1204 msgid "" "It allows the usage of non-Unix forms of ``#!cmd``. This is intended for a " "DOS specific hack only." msgstr "" -#: c-api/init_config.rst:1150 +#: c-api/init_config.rst:1207 msgid "Set to ``1`` by the :option:`-x` command line option." msgstr "" -#: c-api/init_config.rst:1157 +#: c-api/init_config.rst:1214 msgid "" "Encoding and encoding errors of :data:`sys.stdin`, :data:`sys.stdout` and :" "data:`sys.stderr` (but :data:`sys.stderr` always uses " "``\"backslashreplace\"`` error handler)." msgstr "" -#: c-api/init_config.rst:1161 -msgid "" -"If :c:func:`Py_SetStandardStreamEncoding` has been called, use its *error* " -"and *errors* arguments if they are not ``NULL``." -msgstr "" - -#: c-api/init_config.rst:1164 +#: c-api/init_config.rst:1218 msgid "" "Use the :envvar:`PYTHONIOENCODING` environment variable if it is non-empty." msgstr "" -#: c-api/init_config.rst:1167 +#: c-api/init_config.rst:1221 msgid "Default encoding:" msgstr "" -#: c-api/init_config.rst:1169 +#: c-api/init_config.rst:1223 msgid "``\"UTF-8\"`` if :c:member:`PyPreConfig.utf8_mode` is non-zero." msgstr "" -#: c-api/init_config.rst:1170 +#: c-api/init_config.rst:1224 msgid "Otherwise, use the :term:`locale encoding`." msgstr "" -#: c-api/init_config.rst:1172 +#: c-api/init_config.rst:1226 msgid "Default error handler:" msgstr "" -#: c-api/init_config.rst:1174 +#: c-api/init_config.rst:1228 msgid "On Windows: use ``\"surrogateescape\"``." msgstr "" -#: c-api/init_config.rst:1175 +#: c-api/init_config.rst:1229 msgid "" "``\"surrogateescape\"`` if :c:member:`PyPreConfig.utf8_mode` is non-zero, or " "if the LC_CTYPE locale is \"C\" or \"POSIX\"." msgstr "" -#: c-api/init_config.rst:1177 +#: c-api/init_config.rst:1231 msgid "``\"strict\"`` otherwise." msgstr "" -#: c-api/init_config.rst:1181 +#: c-api/init_config.rst:1233 +msgid "See also :c:member:`PyConfig.legacy_windows_stdio`." +msgstr "" + +#: c-api/init_config.rst:1237 msgid "Enable tracemalloc?" msgstr "" -#: c-api/init_config.rst:1183 +#: c-api/init_config.rst:1239 msgid "If non-zero, call :func:`tracemalloc.start` at startup." msgstr "" -#: c-api/init_config.rst:1185 +#: c-api/init_config.rst:1241 msgid "" "Set by :option:`-X tracemalloc=N <-X>` command line option and by the :" "envvar:`PYTHONTRACEMALLOC` environment variable." msgstr "" -#: c-api/init_config.rst:1192 +#: c-api/init_config.rst:1248 msgid "Enable compatibility mode with the perf profiler?" msgstr "" -#: c-api/init_config.rst:1194 +#: c-api/init_config.rst:1250 msgid "" "If non-zero, initialize the perf trampoline. See :ref:`perf_profiling` for " "more information." msgstr "" -#: c-api/init_config.rst:1197 +#: c-api/init_config.rst:1253 msgid "" -"Set by :option:`-X perf <-X>` command line option and by the :envvar:" -"`PYTHONPERFSUPPORT` environment variable." -msgstr "" - -#: c-api/init_config.rst:1200 -msgid "Default: ``-1``." +"Set by :option:`-X perf <-X>` command-line option and by the :envvar:" +"`PYTHON_PERF_JIT_SUPPORT` environment variable for perf support with stack " +"pointers and :option:`-X perf_jit <-X>` command-line option and by the :" +"envvar:`PYTHON_PERF_JIT_SUPPORT` environment variable for perf support with " +"DWARF JIT information." msgstr "" -#: c-api/init_config.rst:1206 +#: c-api/init_config.rst:1265 msgid "Use :ref:`environment variables `?" msgstr "" -#: c-api/init_config.rst:1208 +#: c-api/init_config.rst:1267 msgid "" "If equals to zero, ignore the :ref:`environment variables `." msgstr "" -#: c-api/init_config.rst:1211 +#: c-api/init_config.rst:1270 msgid "Set to ``0`` by the :option:`-E` environment variable." msgstr "" -#: c-api/init_config.rst:1217 +#: c-api/init_config.rst:1276 msgid "If non-zero, add the user site directory to :data:`sys.path`." msgstr "" -#: c-api/init_config.rst:1219 +#: c-api/init_config.rst:1278 msgid "Set to ``0`` by the :option:`-s` and :option:`-I` command line options." msgstr "" -#: c-api/init_config.rst:1221 +#: c-api/init_config.rst:1280 msgid "Set to ``0`` by the :envvar:`PYTHONNOUSERSITE` environment variable." msgstr "" -#: c-api/init_config.rst:1227 +#: c-api/init_config.rst:1286 msgid "" "Verbose mode. If greater than ``0``, print a message each time a module is " "imported, showing the place (filename or built-in module) from which it is " "loaded." msgstr "" -#: c-api/init_config.rst:1231 +#: c-api/init_config.rst:1290 msgid "" "If greater than or equal to ``2``, print a message for each file that is " "checked for when searching for a module. Also provides information on module " "cleanup at exit." msgstr "" -#: c-api/init_config.rst:1235 +#: c-api/init_config.rst:1294 msgid "Incremented by the :option:`-v` command line option." msgstr "" -#: c-api/init_config.rst:1237 +#: c-api/init_config.rst:1296 msgid "Set by the :envvar:`PYTHONVERBOSE` environment variable value." msgstr "" -#: c-api/init_config.rst:1243 +#: c-api/init_config.rst:1302 msgid "" "Options of the :mod:`warnings` module to build warnings filters, lowest to " "highest priority: :data:`sys.warnoptions`." msgstr "" -#: c-api/init_config.rst:1246 +#: c-api/init_config.rst:1305 msgid "" "The :mod:`warnings` module adds :data:`sys.warnoptions` in the reverse " "order: the last :c:member:`PyConfig.warnoptions` item becomes the first item " "of :data:`warnings.filters` which is checked first (highest priority)." msgstr "" -#: c-api/init_config.rst:1251 +#: c-api/init_config.rst:1310 msgid "" "The :option:`-W` command line options adds its value to :c:member:`~PyConfig." "warnoptions`, it can be used multiple times." msgstr "" -#: c-api/init_config.rst:1254 +#: c-api/init_config.rst:1313 msgid "" "The :envvar:`PYTHONWARNINGS` environment variable can also be used to add " "warning options. Multiple options can be specified, separated by commas (``," "``)." msgstr "" -#: c-api/init_config.rst:1262 +#: c-api/init_config.rst:1321 msgid "" "If equal to ``0``, Python won't try to write ``.pyc`` files on the import of " "source modules." msgstr "" -#: c-api/init_config.rst:1265 +#: c-api/init_config.rst:1324 msgid "" "Set to ``0`` by the :option:`-B` command line option and the :envvar:" "`PYTHONDONTWRITEBYTECODE` environment variable." msgstr "" -#: c-api/init_config.rst:1268 +#: c-api/init_config.rst:1327 msgid "" ":data:`sys.dont_write_bytecode` is initialized to the inverted value of :c:" "member:`~PyConfig.write_bytecode`." msgstr "" -#: c-api/init_config.rst:1275 +#: c-api/init_config.rst:1334 msgid "Values of the :option:`-X` command line options: :data:`sys._xoptions`." msgstr "" -#: c-api/init_config.rst:1279 +#: c-api/init_config.rst:1338 msgid "" "If :c:member:`~PyConfig.parse_argv` is non-zero, :c:member:`~PyConfig.argv` " "arguments are parsed the same way the regular Python parses :ref:`command " @@ -1717,29 +1787,27 @@ msgid "" "c:member:`~PyConfig.argv`." msgstr "" -#: c-api/init_config.rst:1284 +#: c-api/init_config.rst:1343 msgid "" "The :c:member:`~PyConfig.xoptions` options are parsed to set other options: " "see the :option:`-X` command line option." msgstr "" -#: c-api/init_config.rst:1289 +#: c-api/init_config.rst:1348 msgid "The ``show_alloc_count`` field has been removed." msgstr "" -#: c-api/init_config.rst:1293 +#: c-api/init_config.rst:1354 msgid "Initialization with PyConfig" msgstr "" -#: c-api/init_config.rst:1295 -msgid "Function to initialize Python:" -msgstr "" - -#: c-api/init_config.rst:1299 -msgid "Initialize Python from *config* configuration." +#: c-api/init_config.rst:1356 +msgid "" +"Initializing the interpreter from a populated configuration struct is " +"handled by calling :c:func:`Py_InitializeFromConfig`." msgstr "" -#: c-api/init_config.rst:1304 +#: c-api/init_config.rst:1362 msgid "" "If :c:func:`PyImport_FrozenModules`, :c:func:`PyImport_AppendInittab` or :c:" "func:`PyImport_ExtendInittab` are used, they must be set or called after " @@ -1748,17 +1816,17 @@ msgid "" "`PyImport_ExtendInittab` must be called before each Python initialization." msgstr "" -#: c-api/init_config.rst:1311 +#: c-api/init_config.rst:1369 msgid "" "The current configuration (``PyConfig`` type) is stored in " "``PyInterpreterState.config``." msgstr "" -#: c-api/init_config.rst:1314 +#: c-api/init_config.rst:1372 msgid "Example setting the program name::" msgstr "" -#: c-api/init_config.rst:1316 +#: c-api/init_config.rst:1374 msgid "" "void init_python(void)\n" "{\n" @@ -1787,7 +1855,7 @@ msgid "" "}" msgstr "" -#: c-api/init_config.rst:1342 +#: c-api/init_config.rst:1400 msgid "" "More complete example modifying the default configuration, read the " "configuration, and then override some parameters. Note that since 3.11, many " @@ -1796,7 +1864,7 @@ msgid "" "called will be left unchanged by initialization::" msgstr "" -#: c-api/init_config.rst:1349 +#: c-api/init_config.rst:1407 msgid "" "PyStatus init_python(const char *program_name)\n" "{\n" @@ -1851,18 +1919,18 @@ msgid "" "}" msgstr "" -#: c-api/init_config.rst:1405 +#: c-api/init_config.rst:1463 msgid "Isolated Configuration" msgstr "" -#: c-api/init_config.rst:1407 +#: c-api/init_config.rst:1465 msgid "" ":c:func:`PyPreConfig_InitIsolatedConfig` and :c:func:" "`PyConfig_InitIsolatedConfig` functions create a configuration to isolate " "Python from the system. For example, to embed Python into an application." msgstr "" -#: c-api/init_config.rst:1412 +#: c-api/init_config.rst:1470 msgid "" "This configuration ignores global configuration variables, environment " "variables, command line arguments (:c:member:`PyConfig.argv` is not parsed) " @@ -1870,125 +1938,125 @@ msgid "" "LC_CTYPE locale are left unchanged. Signal handlers are not installed." msgstr "" -#: c-api/init_config.rst:1417 +#: c-api/init_config.rst:1475 msgid "" "Configuration files are still used with this configuration to determine " "paths that are unspecified. Ensure :c:member:`PyConfig.home` is specified to " "avoid computing the default path configuration." msgstr "" -#: c-api/init_config.rst:1425 +#: c-api/init_config.rst:1483 msgid "Python Configuration" msgstr "" -#: c-api/init_config.rst:1427 +#: c-api/init_config.rst:1485 msgid "" ":c:func:`PyPreConfig_InitPythonConfig` and :c:func:" "`PyConfig_InitPythonConfig` functions create a configuration to build a " "customized Python which behaves as the regular Python." msgstr "" -#: c-api/init_config.rst:1431 +#: c-api/init_config.rst:1489 msgid "" "Environments variables and command line arguments are used to configure " "Python, whereas global configuration variables are ignored." msgstr "" -#: c-api/init_config.rst:1434 +#: c-api/init_config.rst:1492 msgid "" "This function enables C locale coercion (:pep:`538`) and :ref:`Python UTF-8 " "Mode ` (:pep:`540`) depending on the LC_CTYPE locale, :envvar:" "`PYTHONUTF8` and :envvar:`PYTHONCOERCECLOCALE` environment variables." msgstr "" -#: c-api/init_config.rst:1443 +#: c-api/init_config.rst:1501 msgid "Python Path Configuration" msgstr "" -#: c-api/init_config.rst:1445 +#: c-api/init_config.rst:1503 msgid ":c:type:`PyConfig` contains multiple fields for the path configuration:" msgstr "" -#: c-api/init_config.rst:1447 +#: c-api/init_config.rst:1505 msgid "Path configuration inputs:" msgstr "" -#: c-api/init_config.rst:1449 +#: c-api/init_config.rst:1507 msgid ":c:member:`PyConfig.home`" msgstr "" -#: c-api/init_config.rst:1450 +#: c-api/init_config.rst:1508 msgid ":c:member:`PyConfig.platlibdir`" msgstr "" -#: c-api/init_config.rst:1451 +#: c-api/init_config.rst:1509 msgid ":c:member:`PyConfig.pathconfig_warnings`" msgstr "" -#: c-api/init_config.rst:1452 +#: c-api/init_config.rst:1510 msgid ":c:member:`PyConfig.program_name`" msgstr "" -#: c-api/init_config.rst:1453 +#: c-api/init_config.rst:1511 msgid ":c:member:`PyConfig.pythonpath_env`" msgstr "" -#: c-api/init_config.rst:1454 +#: c-api/init_config.rst:1512 msgid "current working directory: to get absolute paths" msgstr "" -#: c-api/init_config.rst:1455 +#: c-api/init_config.rst:1513 msgid "" "``PATH`` environment variable to get the program full path (from :c:member:" "`PyConfig.program_name`)" msgstr "" -#: c-api/init_config.rst:1457 +#: c-api/init_config.rst:1515 msgid "``__PYVENV_LAUNCHER__`` environment variable" msgstr "" -#: c-api/init_config.rst:1458 +#: c-api/init_config.rst:1516 msgid "" "(Windows only) Application paths in the registry under " "\"Software\\Python\\PythonCore\\X.Y\\PythonPath\" of HKEY_CURRENT_USER and " "HKEY_LOCAL_MACHINE (where X.Y is the Python version)." msgstr "" -#: c-api/init_config.rst:1462 +#: c-api/init_config.rst:1520 msgid "Path configuration output fields:" msgstr "" -#: c-api/init_config.rst:1464 +#: c-api/init_config.rst:1522 msgid ":c:member:`PyConfig.base_exec_prefix`" msgstr "" -#: c-api/init_config.rst:1465 +#: c-api/init_config.rst:1523 msgid ":c:member:`PyConfig.base_executable`" msgstr "" -#: c-api/init_config.rst:1466 +#: c-api/init_config.rst:1524 msgid ":c:member:`PyConfig.base_prefix`" msgstr "" -#: c-api/init_config.rst:1467 +#: c-api/init_config.rst:1525 msgid ":c:member:`PyConfig.exec_prefix`" msgstr "" -#: c-api/init_config.rst:1468 +#: c-api/init_config.rst:1526 msgid ":c:member:`PyConfig.executable`" msgstr "" -#: c-api/init_config.rst:1469 +#: c-api/init_config.rst:1527 msgid "" ":c:member:`PyConfig.module_search_paths_set`, :c:member:`PyConfig." "module_search_paths`" msgstr "" -#: c-api/init_config.rst:1471 +#: c-api/init_config.rst:1529 msgid ":c:member:`PyConfig.prefix`" msgstr "" -#: c-api/init_config.rst:1473 +#: c-api/init_config.rst:1531 msgid "" "If at least one \"output field\" is not set, Python calculates the path " "configuration to fill unset fields. If :c:member:`~PyConfig." @@ -1997,7 +2065,7 @@ msgid "" "module_search_paths_set` is set to ``1``." msgstr "" -#: c-api/init_config.rst:1479 +#: c-api/init_config.rst:1537 msgid "" "It is possible to completely ignore the function calculating the default " "path configuration by setting explicitly all path configuration output " @@ -2007,52 +2075,52 @@ msgid "" "modification." msgstr "" -#: c-api/init_config.rst:1486 +#: c-api/init_config.rst:1544 msgid "" "Set :c:member:`~PyConfig.pathconfig_warnings` to ``0`` to suppress warnings " "when calculating the path configuration (Unix only, Windows does not log any " "warning)." msgstr "" -#: c-api/init_config.rst:1489 +#: c-api/init_config.rst:1547 msgid "" "If :c:member:`~PyConfig.base_prefix` or :c:member:`~PyConfig." "base_exec_prefix` fields are not set, they inherit their value from :c:" "member:`~PyConfig.prefix` and :c:member:`~PyConfig.exec_prefix` respectively." msgstr "" -#: c-api/init_config.rst:1493 +#: c-api/init_config.rst:1551 msgid ":c:func:`Py_RunMain` and :c:func:`Py_Main` modify :data:`sys.path`:" msgstr "" -#: c-api/init_config.rst:1495 +#: c-api/init_config.rst:1553 msgid "" "If :c:member:`~PyConfig.run_filename` is set and is a directory which " "contains a ``__main__.py`` script, prepend :c:member:`~PyConfig." "run_filename` to :data:`sys.path`." msgstr "" -#: c-api/init_config.rst:1498 +#: c-api/init_config.rst:1556 msgid "If :c:member:`~PyConfig.isolated` is zero:" msgstr "" -#: c-api/init_config.rst:1500 +#: c-api/init_config.rst:1558 msgid "" "If :c:member:`~PyConfig.run_module` is set, prepend the current directory " "to :data:`sys.path`. Do nothing if the current directory cannot be read." msgstr "" -#: c-api/init_config.rst:1502 +#: c-api/init_config.rst:1560 msgid "" "If :c:member:`~PyConfig.run_filename` is set, prepend the directory of the " "filename to :data:`sys.path`." msgstr "" -#: c-api/init_config.rst:1504 +#: c-api/init_config.rst:1562 msgid "Otherwise, prepend an empty string to :data:`sys.path`." msgstr "" -#: c-api/init_config.rst:1506 +#: c-api/init_config.rst:1564 msgid "" "If :c:member:`~PyConfig.site_import` is non-zero, :data:`sys.path` can be " "modified by the :mod:`site` module. If :c:member:`~PyConfig." @@ -2061,170 +2129,143 @@ msgid "" "data:`sys.path`." msgstr "" -#: c-api/init_config.rst:1512 +#: c-api/init_config.rst:1570 msgid "The following configuration files are used by the path configuration:" msgstr "" -#: c-api/init_config.rst:1514 +#: c-api/init_config.rst:1572 msgid "``pyvenv.cfg``" msgstr "" -#: c-api/init_config.rst:1515 +#: c-api/init_config.rst:1573 msgid "``._pth`` file (ex: ``python._pth``)" msgstr "" -#: c-api/init_config.rst:1516 +#: c-api/init_config.rst:1574 msgid "``pybuilddir.txt`` (Unix only)" msgstr "" -#: c-api/init_config.rst:1518 +#: c-api/init_config.rst:1576 msgid "If a ``._pth`` file is present:" msgstr "" -#: c-api/init_config.rst:1520 +#: c-api/init_config.rst:1578 msgid "Set :c:member:`~PyConfig.isolated` to ``1``." msgstr "" -#: c-api/init_config.rst:1521 +#: c-api/init_config.rst:1579 msgid "Set :c:member:`~PyConfig.use_environment` to ``0``." msgstr "" -#: c-api/init_config.rst:1522 +#: c-api/init_config.rst:1580 msgid "Set :c:member:`~PyConfig.site_import` to ``0``." msgstr "" -#: c-api/init_config.rst:1523 +#: c-api/init_config.rst:1581 msgid "Set :c:member:`~PyConfig.safe_path` to ``1``." msgstr "" -#: c-api/init_config.rst:1525 +#: c-api/init_config.rst:1583 msgid "" "The ``__PYVENV_LAUNCHER__`` environment variable is used to set :c:member:" -"`PyConfig.base_executable`" -msgstr "" - -#: c-api/init_config.rst:1530 -msgid "Py_RunMain()" +"`PyConfig.base_executable`." msgstr "" -#: c-api/init_config.rst:1534 -msgid "" -"Execute the command (:c:member:`PyConfig.run_command`), the script (:c:" -"member:`PyConfig.run_filename`) or the module (:c:member:`PyConfig." -"run_module`) specified on the command line or in the configuration." -msgstr "" - -#: c-api/init_config.rst:1539 -msgid "By default and when if :option:`-i` option is used, run the REPL." -msgstr "" - -#: c-api/init_config.rst:1541 -msgid "" -"Finally, finalizes Python and returns an exit status that can be passed to " -"the ``exit()`` function." -msgstr "" - -#: c-api/init_config.rst:1544 -msgid "" -"See :ref:`Python Configuration ` for an example of " -"customized Python always running in isolated mode using :c:func:`Py_RunMain`." -msgstr "" - -#: c-api/init_config.rst:1550 +#: c-api/init_config.rst:1588 msgid "Py_GetArgcArgv()" msgstr "" -#: c-api/init_config.rst:1554 +#: c-api/init_config.rst:1592 msgid "Get the original command line arguments, before Python modified them." msgstr "" -#: c-api/init_config.rst:1556 +#: c-api/init_config.rst:1594 msgid "See also :c:member:`PyConfig.orig_argv` member." msgstr "" -#: c-api/init_config.rst:1560 +#: c-api/init_config.rst:1598 msgid "Multi-Phase Initialization Private Provisional API" msgstr "" -#: c-api/init_config.rst:1562 +#: c-api/init_config.rst:1600 msgid "" "This section is a private provisional API introducing multi-phase " "initialization, the core feature of :pep:`432`:" msgstr "" -#: c-api/init_config.rst:1565 +#: c-api/init_config.rst:1603 msgid "\"Core\" initialization phase, \"bare minimum Python\":" msgstr "" -#: c-api/init_config.rst:1567 +#: c-api/init_config.rst:1605 msgid "Builtin types;" msgstr "" -#: c-api/init_config.rst:1568 +#: c-api/init_config.rst:1606 msgid "Builtin exceptions;" msgstr "" -#: c-api/init_config.rst:1569 +#: c-api/init_config.rst:1607 msgid "Builtin and frozen modules;" msgstr "" -#: c-api/init_config.rst:1570 +#: c-api/init_config.rst:1608 msgid "" "The :mod:`sys` module is only partially initialized (ex: :data:`sys.path` " "doesn't exist yet)." msgstr "" -#: c-api/init_config.rst:1573 +#: c-api/init_config.rst:1611 msgid "\"Main\" initialization phase, Python is fully initialized:" msgstr "" -#: c-api/init_config.rst:1575 +#: c-api/init_config.rst:1613 msgid "Install and configure :mod:`importlib`;" msgstr "" -#: c-api/init_config.rst:1576 +#: c-api/init_config.rst:1614 msgid "Apply the :ref:`Path Configuration `;" msgstr "" -#: c-api/init_config.rst:1577 +#: c-api/init_config.rst:1615 msgid "Install signal handlers;" msgstr "" -#: c-api/init_config.rst:1578 +#: c-api/init_config.rst:1616 msgid "" "Finish :mod:`sys` module initialization (ex: create :data:`sys.stdout` and :" "data:`sys.path`);" msgstr "" -#: c-api/init_config.rst:1580 +#: c-api/init_config.rst:1618 msgid "" "Enable optional features like :mod:`faulthandler` and :mod:`tracemalloc`;" msgstr "" -#: c-api/init_config.rst:1581 +#: c-api/init_config.rst:1619 msgid "Import the :mod:`site` module;" msgstr "" -#: c-api/init_config.rst:1582 +#: c-api/init_config.rst:1620 msgid "etc." msgstr "" -#: c-api/init_config.rst:1584 +#: c-api/init_config.rst:1622 msgid "Private provisional API:" msgstr "" -#: c-api/init_config.rst:1586 +#: c-api/init_config.rst:1624 msgid "" ":c:member:`PyConfig._init_main`: if set to ``0``, :c:func:" "`Py_InitializeFromConfig` stops at the \"Core\" initialization phase." msgstr "" -#: c-api/init_config.rst:1591 +#: c-api/init_config.rst:1629 msgid "" "Move to the \"Main\" initialization phase, finish the Python initialization." msgstr "" -#: c-api/init_config.rst:1593 +#: c-api/init_config.rst:1631 msgid "" "No module is imported during the \"Core\" phase and the ``importlib`` module " "is not configured: the :ref:`Path Configuration ` is only " @@ -2233,14 +2274,14 @@ msgid "" "maybe install a custom :data:`sys.meta_path` importer or an import hook, etc." msgstr "" -#: c-api/init_config.rst:1599 +#: c-api/init_config.rst:1637 msgid "" "It may become possible to calculate the :ref:`Path Configuration ` in Python, after the Core phase and before the Main phase, which is " "one of the :pep:`432` motivation." msgstr "" -#: c-api/init_config.rst:1603 +#: c-api/init_config.rst:1641 msgid "" "The \"Core\" phase is not properly defined: what should be and what should " "not be available at this phase is not specified yet. The API is marked as " @@ -2248,13 +2289,13 @@ msgid "" "until a proper public API is designed." msgstr "" -#: c-api/init_config.rst:1608 +#: c-api/init_config.rst:1646 msgid "" "Example running Python code between \"Core\" and \"Main\" initialization " "phases::" msgstr "" -#: c-api/init_config.rst:1611 +#: c-api/init_config.rst:1649 msgid "" "void init_python(void)\n" "{\n" @@ -2290,3 +2331,11 @@ msgid "" " }\n" "}" msgstr "" + +#: c-api/init_config.rst:558 +msgid "main()" +msgstr "" + +#: c-api/init_config.rst:558 +msgid "argv (in module sys)" +msgstr "" diff --git a/c-api/intro.po b/c-api/intro.po index 95bcdc06..909f2d31 100644 --- a/c-api/intro.po +++ b/c-api/intro.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -196,7 +196,7 @@ msgstr "" #: c-api/intro.rst:140 msgid "" "Ask the compiler to always inline a static inline function. The compiler can " -"ignore it and decides to not inline the function." +"ignore it and decide to not inline the function." msgstr "" #: c-api/intro.rst:143 @@ -925,13 +925,13 @@ msgid "" "in front of the standard path by setting :envvar:`PYTHONPATH`." msgstr "" -#: c-api/intro.rst:779 +#: c-api/intro.rst:778 msgid "" -"The embedding application can steer the search by calling " -"``Py_SetProgramName(file)`` *before* calling :c:func:`Py_Initialize`. Note " -"that :envvar:`PYTHONHOME` still overrides this and :envvar:`PYTHONPATH` is " -"still inserted in front of the standard path. An application that requires " -"total control has to provide its own implementation of :c:func:" +"The embedding application can steer the search by setting :c:member:" +"`PyConfig.program_name` *before* calling :c:func:`Py_InitializeFromConfig`. " +"Note that :envvar:`PYTHONHOME` still overrides this and :envvar:`PYTHONPATH` " +"is still inserted in front of the standard path. An application that " +"requires total control has to provide its own implementation of :c:func:" "`Py_GetPath`, :c:func:`Py_GetPrefix`, :c:func:`Py_GetExecPrefix`, and :c:" "func:`Py_GetProgramFullPath` (all defined in :file:`Modules/getpath.c`)." msgstr "" @@ -1108,10 +1108,6 @@ msgstr "" msgid "path (in module sys)" msgstr "" -#: c-api/intro.rst:772 -msgid "Py_SetProgramName (C function)" -msgstr "" - #: c-api/intro.rst:772 msgid "Py_GetPath (C function)" msgstr "" diff --git a/c-api/iter.po b/c-api/iter.po index 4104c8ce..44794730 100644 --- a/c-api/iter.po +++ b/c-api/iter.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" diff --git a/c-api/iterator.po b/c-api/iterator.po index 97c94528..5009840d 100644 --- a/c-api/iterator.po +++ b/c-api/iterator.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" diff --git a/c-api/list.po b/c-api/list.po index 5ca14dd2..0b2f0af5 100644 --- a/c-api/list.po +++ b/c-api/list.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -50,74 +50,89 @@ msgstr "" #: c-api/list.rst:40 msgid "" "If *len* is greater than zero, the returned list object's items are set to " -"``NULL``. Thus you cannot use abstract API functions such as :c:func:" -"`PySequence_SetItem` or expose the object to Python code before setting all " -"items to a real object with :c:func:`PyList_SetItem`." +"``NULL``. Thus you cannot use abstract API functions such as :c:func:" +"`PySequence_SetItem` or expose the object to Python code before setting all " +"items to a real object with :c:func:`PyList_SetItem` or :c:func:" +"`PyList_SET_ITEM()`. The following APIs are safe APIs before the list is " +"fully initialized: :c:func:`PyList_SetItem()` and :c:func:" +"`PyList_SET_ITEM()`." msgstr "" -#: c-api/list.rst:50 +#: c-api/list.rst:53 msgid "" "Return the length of the list object in *list*; this is equivalent to " "``len(list)`` on a list object." msgstr "" -#: c-api/list.rst:56 +#: c-api/list.rst:59 msgid "Similar to :c:func:`PyList_Size`, but without error checking." msgstr "" -#: c-api/list.rst:61 +#: c-api/list.rst:64 msgid "" "Return the object at position *index* in the list pointed to by *list*. The " "position must be non-negative; indexing from the end of the list is not " -"supported. If *index* is out of bounds (<0 or >=len(list)), return ``NULL`` " -"and set an :exc:`IndexError` exception." +"supported. If *index* is out of bounds (:code:`<0 or >=len(list)`), return " +"``NULL`` and set an :exc:`IndexError` exception." msgstr "" -#: c-api/list.rst:69 +#: c-api/list.rst:74 +msgid "" +"Like :c:func:`PyList_GetItemRef`, but returns a :term:`borrowed reference` " +"instead of a :term:`strong reference`." +msgstr "" + +#: c-api/list.rst:80 msgid "Similar to :c:func:`PyList_GetItem`, but without error checking." msgstr "" -#: c-api/list.rst:74 +#: c-api/list.rst:85 msgid "" "Set the item at index *index* in list to *item*. Return ``0`` on success. " "If *index* is out of bounds, return ``-1`` and set an :exc:`IndexError` " "exception." msgstr "" -#: c-api/list.rst:80 +#: c-api/list.rst:91 msgid "" "This function \"steals\" a reference to *item* and discards a reference to " "an item already in the list at the affected position." msgstr "" -#: c-api/list.rst:86 +#: c-api/list.rst:97 msgid "" "Macro form of :c:func:`PyList_SetItem` without error checking. This is " "normally only used to fill in new lists where there is no previous content." msgstr "" -#: c-api/list.rst:91 +#: c-api/list.rst:100 +msgid "" +"Bounds checking is performed as an assertion if Python is built in :ref:" +"`debug mode ` or :option:`with assertions <--with-assertions>`." +msgstr "" + +#: c-api/list.rst:106 msgid "" "This macro \"steals\" a reference to *item*, and, unlike :c:func:" "`PyList_SetItem`, does *not* discard a reference to any item that is being " "replaced; any reference in *list* at position *i* will be leaked." msgstr "" -#: c-api/list.rst:99 +#: c-api/list.rst:114 msgid "" "Insert the item *item* into list *list* in front of index *index*. Return " "``0`` if successful; return ``-1`` and set an exception if unsuccessful. " "Analogous to ``list.insert(index, item)``." msgstr "" -#: c-api/list.rst:106 +#: c-api/list.rst:121 msgid "" "Append the object *item* at the end of list *list*. Return ``0`` if " "successful; return ``-1`` and set an exception if unsuccessful. Analogous " "to ``list.append(item)``." msgstr "" -#: c-api/list.rst:113 +#: c-api/list.rst:128 msgid "" "Return a list of the objects in *list* containing the objects *between* " "*low* and *high*. Return ``NULL`` and set an exception if unsuccessful. " @@ -125,7 +140,7 @@ msgid "" "supported." msgstr "" -#: c-api/list.rst:120 +#: c-api/list.rst:135 msgid "" "Set the slice of *list* between *low* and *high* to the contents of " "*itemlist*. Analogous to ``list[low:high] = itemlist``. The *itemlist* may " @@ -134,19 +149,45 @@ msgid "" "list is not supported." msgstr "" -#: c-api/list.rst:129 +#: c-api/list.rst:144 +msgid "" +"Extend *list* with the contents of *iterable*. This is the same as " +"``PyList_SetSlice(list, PY_SSIZE_T_MAX, PY_SSIZE_T_MAX, iterable)`` and " +"analogous to ``list.extend(iterable)`` or ``list += iterable``." +msgstr "" + +#: c-api/list.rst:148 +msgid "" +"Raise an exception and return ``-1`` if *list* is not a :class:`list` " +"object. Return 0 on success." +msgstr "" + +#: c-api/list.rst:156 +msgid "" +"Remove all items from *list*. This is the same as ``PyList_SetSlice(list, " +"0, PY_SSIZE_T_MAX, NULL)`` and analogous to ``list.clear()`` or ``del " +"list[:]``." +msgstr "" + +#: c-api/list.rst:160 +msgid "" +"Raise an exception and return ``-1`` if *list* is not a :class:`list` " +"object. Return 0 on success." +msgstr "" + +#: c-api/list.rst:168 msgid "" "Sort the items of *list* in place. Return ``0`` on success, ``-1`` on " "failure. This is equivalent to ``list.sort()``." msgstr "" -#: c-api/list.rst:135 +#: c-api/list.rst:174 msgid "" "Reverse the items of *list* in place. Return ``0`` on success, ``-1`` on " "failure. This is the equivalent of ``list.reverse()``." msgstr "" -#: c-api/list.rst:143 +#: c-api/list.rst:182 msgid "" "Return a new tuple object containing the contents of *list*; equivalent to " "``tuple(list)``." @@ -160,14 +201,14 @@ msgstr "" msgid "list" msgstr "" -#: c-api/list.rst:141 +#: c-api/list.rst:180 msgid "built-in function" msgstr "" -#: c-api/list.rst:48 +#: c-api/list.rst:51 msgid "len" msgstr "" -#: c-api/list.rst:141 +#: c-api/list.rst:180 msgid "tuple" msgstr "" diff --git a/c-api/long.po b/c-api/long.po index b9be35d6..aecece52 100644 --- a/c-api/long.po +++ b/c-api/long.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -137,43 +137,77 @@ msgid "" "retrieved from the resulting value using :c:func:`PyLong_AsVoidPtr`." msgstr "" -#: c-api/long.rst:151 +#: c-api/long.rst:118 +msgid "" +"Create a Python integer from the value contained in the first *n_bytes* of " +"*buffer*, interpreted as a two's-complement signed number." +msgstr "" + +#: c-api/long.rst:121 +msgid "" +"*flags* are as for :c:func:`PyLong_AsNativeBytes`. Passing ``-1`` will " +"select the native endian that CPython was compiled with and assume that the " +"most-significant bit is a sign bit. Passing " +"``Py_ASNATIVEBYTES_UNSIGNED_BUFFER`` will produce the same result as " +"calling :c:func:`PyLong_FromUnsignedNativeBytes`. Other flags are ignored." +msgstr "" + +#: c-api/long.rst:132 +msgid "" +"Create a Python integer from the value contained in the first *n_bytes* of " +"*buffer*, interpreted as an unsigned number." +msgstr "" + +#: c-api/long.rst:135 +msgid "" +"*flags* are as for :c:func:`PyLong_AsNativeBytes`. Passing ``-1`` will " +"select the native endian that CPython was compiled with and assume that the " +"most-significant bit is not a sign bit. Flags other than endian are ignored." +msgstr "" + +#: c-api/long.rst:184 msgid "" "Return a C :c:expr:`long` representation of *obj*. If *obj* is not an " "instance of :c:type:`PyLongObject`, first call its :meth:`~object.__index__` " "method (if present) to convert it to a :c:type:`PyLongObject`." msgstr "" -#: c-api/long.rst:127 +#: c-api/long.rst:152 msgid "" "Raise :exc:`OverflowError` if the value of *obj* is out of range for a :c:" "expr:`long`." msgstr "" -#: c-api/long.rst:160 c-api/long.rst:201 c-api/long.rst:224 +#: c-api/long.rst:193 c-api/long.rst:234 c-api/long.rst:257 msgid "Returns ``-1`` on error. Use :c:func:`PyErr_Occurred` to disambiguate." msgstr "" -#: c-api/long.rst:162 c-api/long.rst:205 c-api/long.rst:309 +#: c-api/long.rst:195 c-api/long.rst:238 c-api/long.rst:342 msgid "Use :meth:`~object.__index__` if available." msgstr "" -#: c-api/long.rst:165 c-api/long.rst:208 c-api/long.rst:312 +#: c-api/long.rst:198 c-api/long.rst:241 c-api/long.rst:345 msgid "This function will no longer use :meth:`~object.__int__`." msgstr "" -#: c-api/long.rst:142 +#: c-api/long.rst:167 msgid "" "A :term:`soft deprecated` alias. Exactly equivalent to the preferred " "``PyLong_AsLong``. In particular, it can fail with :exc:`OverflowError` or " "another exception." msgstr "" -#: c-api/long.rst:146 +#: c-api/long.rst:171 msgid "The function is soft deprecated." msgstr "" -#: c-api/long.rst:155 +#: c-api/long.rst:176 +msgid "" +"Similar to :c:func:`PyLong_AsLong`, but store the result in a C :c:expr:" +"`int` instead of a C :c:expr:`long`." +msgstr "" + +#: c-api/long.rst:188 msgid "" "If the value of *obj* is greater than :c:macro:`LONG_MAX` or less than :c:" "macro:`LONG_MIN`, set *\\*overflow* to ``1`` or ``-1``, respectively, and " @@ -181,20 +215,20 @@ msgid "" "exception occurs set *\\*overflow* to ``0`` and return ``-1`` as usual." msgstr "" -#: c-api/long.rst:192 +#: c-api/long.rst:225 msgid "" "Return a C :c:expr:`long long` representation of *obj*. If *obj* is not an " "instance of :c:type:`PyLongObject`, first call its :meth:`~object.__index__` " "method (if present) to convert it to a :c:type:`PyLongObject`." msgstr "" -#: c-api/long.rst:178 +#: c-api/long.rst:211 msgid "" "Raise :exc:`OverflowError` if the value of *obj* is out of range for a :c:" "expr:`long long`." msgstr "" -#: c-api/long.rst:196 +#: c-api/long.rst:229 msgid "" "If the value of *obj* is greater than :c:macro:`LLONG_MAX` or less than :c:" "macro:`LLONG_MIN`, set *\\*overflow* to ``1`` or ``-1``, respectively, and " @@ -202,133 +236,133 @@ msgid "" "exception occurs set *\\*overflow* to ``0`` and return ``-1`` as usual." msgstr "" -#: c-api/long.rst:218 +#: c-api/long.rst:251 msgid "" "Return a C :c:type:`Py_ssize_t` representation of *pylong*. *pylong* must " "be an instance of :c:type:`PyLongObject`." msgstr "" -#: c-api/long.rst:221 +#: c-api/long.rst:254 msgid "" "Raise :exc:`OverflowError` if the value of *pylong* is out of range for a :c:" "type:`Py_ssize_t`." msgstr "" -#: c-api/long.rst:233 +#: c-api/long.rst:266 msgid "" "Return a C :c:expr:`unsigned long` representation of *pylong*. *pylong* " "must be an instance of :c:type:`PyLongObject`." msgstr "" -#: c-api/long.rst:236 +#: c-api/long.rst:269 msgid "" "Raise :exc:`OverflowError` if the value of *pylong* is out of range for a :c:" "expr:`unsigned long`." msgstr "" -#: c-api/long.rst:239 +#: c-api/long.rst:272 msgid "" "Returns ``(unsigned long)-1`` on error. Use :c:func:`PyErr_Occurred` to " "disambiguate." msgstr "" -#: c-api/long.rst:249 +#: c-api/long.rst:282 msgid "" "Return a C :c:type:`size_t` representation of *pylong*. *pylong* must be an " "instance of :c:type:`PyLongObject`." msgstr "" -#: c-api/long.rst:252 +#: c-api/long.rst:285 msgid "" "Raise :exc:`OverflowError` if the value of *pylong* is out of range for a :c:" "type:`size_t`." msgstr "" -#: c-api/long.rst:255 +#: c-api/long.rst:288 msgid "" "Returns ``(size_t)-1`` on error. Use :c:func:`PyErr_Occurred` to " "disambiguate." msgstr "" -#: c-api/long.rst:264 +#: c-api/long.rst:297 msgid "" "Return a C :c:expr:`unsigned long long` representation of *pylong*. " "*pylong* must be an instance of :c:type:`PyLongObject`." msgstr "" -#: c-api/long.rst:267 +#: c-api/long.rst:300 msgid "" "Raise :exc:`OverflowError` if the value of *pylong* is out of range for an :" "c:expr:`unsigned long long`." msgstr "" -#: c-api/long.rst:270 +#: c-api/long.rst:303 msgid "" "Returns ``(unsigned long long)-1`` on error. Use :c:func:`PyErr_Occurred` to " "disambiguate." msgstr "" -#: c-api/long.rst:273 +#: c-api/long.rst:306 msgid "" "A negative *pylong* now raises :exc:`OverflowError`, not :exc:`TypeError`." msgstr "" -#: c-api/long.rst:279 +#: c-api/long.rst:312 msgid "" "Return a C :c:expr:`unsigned long` representation of *obj*. If *obj* is not " "an instance of :c:type:`PyLongObject`, first call its :meth:`~object." "__index__` method (if present) to convert it to a :c:type:`PyLongObject`." msgstr "" -#: c-api/long.rst:283 +#: c-api/long.rst:316 msgid "" "If the value of *obj* is out of range for an :c:expr:`unsigned long`, return " "the reduction of that value modulo ``ULONG_MAX + 1``." msgstr "" -#: c-api/long.rst:286 +#: c-api/long.rst:319 msgid "" "Returns ``(unsigned long)-1`` on error. Use :c:func:`PyErr_Occurred` to " "disambiguate." msgstr "" -#: c-api/long.rst:298 +#: c-api/long.rst:331 msgid "" "Return a C :c:expr:`unsigned long long` representation of *obj*. If *obj* " "is not an instance of :c:type:`PyLongObject`, first call its :meth:`~object." "__index__` method (if present) to convert it to a :c:type:`PyLongObject`." msgstr "" -#: c-api/long.rst:303 +#: c-api/long.rst:336 msgid "" "If the value of *obj* is out of range for an :c:expr:`unsigned long long`, " "return the reduction of that value modulo ``ULLONG_MAX + 1``." msgstr "" -#: c-api/long.rst:306 +#: c-api/long.rst:339 msgid "" "Returns ``(unsigned long long)-1`` on error. Use :c:func:`PyErr_Occurred` " "to disambiguate." msgstr "" -#: c-api/long.rst:318 +#: c-api/long.rst:351 msgid "" "Return a C :c:expr:`double` representation of *pylong*. *pylong* must be an " "instance of :c:type:`PyLongObject`." msgstr "" -#: c-api/long.rst:321 +#: c-api/long.rst:354 msgid "" "Raise :exc:`OverflowError` if the value of *pylong* is out of range for a :c:" "expr:`double`." msgstr "" -#: c-api/long.rst:324 +#: c-api/long.rst:357 msgid "" "Returns ``-1.0`` on error. Use :c:func:`PyErr_Occurred` to disambiguate." msgstr "" -#: c-api/long.rst:329 +#: c-api/long.rst:362 msgid "" "Convert a Python integer *pylong* to a C :c:expr:`void` pointer. If *pylong* " "cannot be converted, an :exc:`OverflowError` will be raised. This is only " @@ -336,52 +370,263 @@ msgid "" "c:func:`PyLong_FromVoidPtr`." msgstr "" -#: c-api/long.rst:334 +#: c-api/long.rst:367 msgid "" "Returns ``NULL`` on error. Use :c:func:`PyErr_Occurred` to disambiguate." msgstr "" -#: c-api/long.rst:339 +#: c-api/long.rst:372 +msgid "" +"Copy the Python integer value *pylong* to a native *buffer* of size " +"*n_bytes*. The *flags* can be set to ``-1`` to behave similarly to a C cast, " +"or to values documented below to control the behavior." +msgstr "" + +#: c-api/long.rst:376 +msgid "" +"Returns ``-1`` with an exception raised on error. This may happen if " +"*pylong* cannot be interpreted as an integer, or if *pylong* was negative " +"and the ``Py_ASNATIVEBYTES_REJECT_NEGATIVE`` flag was set." +msgstr "" + +#: c-api/long.rst:380 +msgid "" +"Otherwise, returns the number of bytes required to store the value. If this " +"is equal to or less than *n_bytes*, the entire value was copied. All " +"*n_bytes* of the buffer are written: large buffers are padded with zeroes." +msgstr "" + +#: c-api/long.rst:385 +msgid "" +"If the returned value is greater than than *n_bytes*, the value was " +"truncated: as many of the lowest bits of the value as could fit are written, " +"and the higher bits are ignored. This matches the typical behavior of a C-" +"style downcast." +msgstr "" + +#: c-api/long.rst:392 +msgid "" +"Overflow is not considered an error. If the returned value is larger than " +"*n_bytes*, most significant bits were discarded." +msgstr "" + +#: c-api/long.rst:395 +msgid "``0`` will never be returned." +msgstr "" + +#: c-api/long.rst:397 +msgid "Values are always copied as two's-complement." +msgstr "" + +#: c-api/long.rst:399 +msgid "Usage example::" +msgstr "" + +#: c-api/long.rst:401 +msgid "" +"int32_t value;\n" +"Py_ssize_t bytes = PyLong_AsNativeBytes(pylong, &value, sizeof(value), -1);\n" +"if (bytes < 0) {\n" +" // Failed. A Python exception was set with the reason.\n" +" return NULL;\n" +"}\n" +"else if (bytes <= (Py_ssize_t)sizeof(value)) {\n" +" // Success!\n" +"}\n" +"else {\n" +" // Overflow occurred, but 'value' contains the truncated\n" +" // lowest bits of pylong.\n" +"}" +msgstr "" + +#: c-api/long.rst:415 +msgid "" +"Passing zero to *n_bytes* will return the size of a buffer that would be " +"large enough to hold the value. This may be larger than technically " +"necessary, but not unreasonably so. If *n_bytes=0*, *buffer* may be ``NULL``." +msgstr "" + +#: c-api/long.rst:422 +msgid "" +"Passing *n_bytes=0* to this function is not an accurate way to determine the " +"bit length of the value." +msgstr "" + +#: c-api/long.rst:425 +msgid "" +"To get at the entire Python value of an unknown size, the function can be " +"called twice: first to determine the buffer size, then to fill it::" +msgstr "" + +#: c-api/long.rst:428 +msgid "" +"// Ask how much space we need.\n" +"Py_ssize_t expected = PyLong_AsNativeBytes(pylong, NULL, 0, -1);\n" +"if (expected < 0) {\n" +" // Failed. A Python exception was set with the reason.\n" +" return NULL;\n" +"}\n" +"assert(expected != 0); // Impossible per the API definition.\n" +"uint8_t *bignum = malloc(expected);\n" +"if (!bignum) {\n" +" PyErr_SetString(PyExc_MemoryError, \"bignum malloc failed.\");\n" +" return NULL;\n" +"}\n" +"// Safely get the entire value.\n" +"Py_ssize_t bytes = PyLong_AsNativeBytes(pylong, bignum, expected, -1);\n" +"if (bytes < 0) { // Exception has been set.\n" +" free(bignum);\n" +" return NULL;\n" +"}\n" +"else if (bytes > expected) { // This should not be possible.\n" +" PyErr_SetString(PyExc_RuntimeError,\n" +" \"Unexpected bignum truncation after a size check.\");\n" +" free(bignum);\n" +" return NULL;\n" +"}\n" +"// The expected success given the above pre-check.\n" +"// ... use bignum ...\n" +"free(bignum);" +msgstr "" + +#: c-api/long.rst:456 +msgid "" +"*flags* is either ``-1`` (``Py_ASNATIVEBYTES_DEFAULTS``) to select defaults " +"that behave most like a C cast, or a combination of the other flags in the " +"table below. Note that ``-1`` cannot be combined with other flags." +msgstr "" + +#: c-api/long.rst:461 +msgid "" +"Currently, ``-1`` corresponds to ``Py_ASNATIVEBYTES_NATIVE_ENDIAN | " +"Py_ASNATIVEBYTES_UNSIGNED_BUFFER``." +msgstr "" + +#: c-api/long.rst:467 +msgid "Flag" +msgstr "" + +#: c-api/long.rst:467 +msgid "Value" +msgstr "" + +#: c-api/long.rst:469 +msgid "``-1``" +msgstr "" + +#: c-api/long.rst:470 +msgid "``0``" +msgstr "" + +#: c-api/long.rst:471 +msgid "``1``" +msgstr "" + +#: c-api/long.rst:472 +msgid "``3``" +msgstr "" + +#: c-api/long.rst:473 +msgid "``4``" +msgstr "" + +#: c-api/long.rst:474 +msgid "``8``" +msgstr "" + +#: c-api/long.rst:475 +msgid "``16``" +msgstr "" + +#: c-api/long.rst:478 +msgid "" +"Specifying ``Py_ASNATIVEBYTES_NATIVE_ENDIAN`` will override any other endian " +"flags. Passing ``2`` is reserved." +msgstr "" + +#: c-api/long.rst:481 +msgid "" +"By default, sufficient buffer will be requested to include a sign bit. For " +"example, when converting 128 with *n_bytes=1*, the function will return 2 " +"(or more) in order to store a zero sign bit." +msgstr "" + +#: c-api/long.rst:485 +msgid "" +"If ``Py_ASNATIVEBYTES_UNSIGNED_BUFFER`` is specified, a zero sign bit will " +"be omitted from size calculations. This allows, for example, 128 to fit in a " +"single-byte buffer. If the destination buffer is later treated as signed, a " +"positive input value may become negative. Note that the flag does not affect " +"handling of negative values: for those, space for a sign bit is always " +"requested." +msgstr "" + +#: c-api/long.rst:492 +msgid "" +"Specifying ``Py_ASNATIVEBYTES_REJECT_NEGATIVE`` causes an exception to be " +"set if *pylong* is negative. Without this flag, negative values will be " +"copied provided there is enough space for at least one sign bit, regardless " +"of whether ``Py_ASNATIVEBYTES_UNSIGNED_BUFFER`` was specified." +msgstr "" + +#: c-api/long.rst:497 +msgid "" +"If ``Py_ASNATIVEBYTES_ALLOW_INDEX`` is specified and a non-integer value is " +"passed, its :meth:`~object.__index__` method will be called first. This may " +"result in Python code executing and other threads being allowed to run, " +"which could cause changes to other objects or values in use. When *flags* is " +"``-1``, this option is not set, and non-integer values will raise :exc:" +"`TypeError`." +msgstr "" + +#: c-api/long.rst:506 +msgid "" +"With the default *flags* (``-1``, or *UNSIGNED_BUFFER* without " +"*REJECT_NEGATIVE*), multiple Python integers can map to a single value " +"without overflow. For example, both ``255`` and ``-1`` fit a single-byte " +"buffer and set all its bits. This matches typical C cast behavior." +msgstr "" + +#: c-api/long.rst:517 msgid "" "On success, return a read only :term:`named tuple`, that holds information " "about Python's internal representation of integers. See :data:`sys.int_info` " "for description of individual fields." msgstr "" -#: c-api/long.rst:343 +#: c-api/long.rst:521 msgid "On failure, return ``NULL`` with an exception set." msgstr "" -#: c-api/long.rst:350 +#: c-api/long.rst:528 msgid "Return 1 if *op* is compact, 0 otherwise." msgstr "" -#: c-api/long.rst:352 +#: c-api/long.rst:530 msgid "" "This function makes it possible for performance-critical code to implement a " "“fast path” for small integers. For compact values use :c:func:" "`PyUnstable_Long_CompactValue`; for others fall back to a :c:func:" -"`PyLong_As* ` function or :c:func:`calling " -"` :meth:`int.to_bytes`." +"`PyLong_As* ` function or :c:func:`PyLong_AsNativeBytes`." msgstr "" -#: c-api/long.rst:358 +#: c-api/long.rst:536 msgid "The speedup is expected to be negligible for most users." msgstr "" -#: c-api/long.rst:360 +#: c-api/long.rst:538 msgid "" "Exactly what values are considered compact is an implementation detail and " "is subject to change." msgstr "" -#: c-api/long.rst:368 +#: c-api/long.rst:546 msgid "" "If *op* is compact, as determined by :c:func:`PyUnstable_Long_IsCompact`, " "return its value." msgstr "" -#: c-api/long.rst:371 +#: c-api/long.rst:549 msgid "Otherwise, the return value is undefined." msgstr "" @@ -397,22 +642,22 @@ msgstr "" msgid "integer" msgstr "" -#: c-api/long.rst:119 +#: c-api/long.rst:144 msgid "LONG_MAX (C macro)" msgstr "" -#: c-api/long.rst:171 c-api/long.rst:229 c-api/long.rst:261 +#: c-api/long.rst:204 c-api/long.rst:262 c-api/long.rst:294 msgid "OverflowError (built-in exception)" msgstr "" -#: c-api/long.rst:214 +#: c-api/long.rst:247 msgid "PY_SSIZE_T_MAX (C macro)" msgstr "" -#: c-api/long.rst:229 +#: c-api/long.rst:262 msgid "ULONG_MAX (C macro)" msgstr "" -#: c-api/long.rst:245 +#: c-api/long.rst:278 msgid "SIZE_MAX (C macro)" msgstr "" diff --git a/c-api/mapping.po b/c-api/mapping.po index 911d96e4..5d06f877 100644 --- a/c-api/mapping.po +++ b/c-api/mapping.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -51,67 +51,106 @@ msgstr "" #: c-api/mapping.rst:38 msgid "" +"Variant of :c:func:`PyObject_GetItem` which doesn't raise :exc:`KeyError` if " +"the key is not found." +msgstr "" + +#: c-api/mapping.rst:41 +msgid "" +"If the key is found, return ``1`` and set *\\*result* to a new :term:`strong " +"reference` to the corresponding value. If the key is not found, return ``0`` " +"and set *\\*result* to ``NULL``; the :exc:`KeyError` is silenced. If an " +"error other than :exc:`KeyError` is raised, return ``-1`` and set " +"*\\*result* to ``NULL``." +msgstr "" + +#: c-api/mapping.rst:53 +msgid "" +"This is the same as :c:func:`PyMapping_GetOptionalItem`, but *key* is " +"specified as a :c:expr:`const char*` UTF-8 encoded bytes string, rather than " +"a :c:expr:`PyObject*`." +msgstr "" + +#: c-api/mapping.rst:62 +msgid "" "This is the same as :c:func:`PyObject_SetItem`, but *key* is specified as a :" "c:expr:`const char*` UTF-8 encoded bytes string, rather than a :c:expr:" "`PyObject*`." msgstr "" -#: c-api/mapping.rst:45 +#: c-api/mapping.rst:69 msgid "This is an alias of :c:func:`PyObject_DelItem`." msgstr "" -#: c-api/mapping.rst:50 +#: c-api/mapping.rst:74 msgid "" "This is the same as :c:func:`PyObject_DelItem`, but *key* is specified as a :" "c:expr:`const char*` UTF-8 encoded bytes string, rather than a :c:expr:" "`PyObject*`." msgstr "" -#: c-api/mapping.rst:57 +#: c-api/mapping.rst:81 +msgid "" +"Return ``1`` if the mapping object has the key *key* and ``0`` otherwise. " +"This is equivalent to the Python expression ``key in o``. On failure, return " +"``-1``." +msgstr "" + +#: c-api/mapping.rst:90 +msgid "" +"This is the same as :c:func:`PyMapping_HasKeyWithError`, but *key* is " +"specified as a :c:expr:`const char*` UTF-8 encoded bytes string, rather than " +"a :c:expr:`PyObject*`." +msgstr "" + +#: c-api/mapping.rst:99 msgid "" "Return ``1`` if the mapping object has the key *key* and ``0`` otherwise. " "This is equivalent to the Python expression ``key in o``. This function " "always succeeds." msgstr "" -#: c-api/mapping.rst:63 +#: c-api/mapping.rst:105 msgid "" "Exceptions which occur when this calls :meth:`~object.__getitem__` method " "are silently ignored. For proper error handling, use :c:func:" +"`PyMapping_HasKeyWithError`, :c:func:`PyMapping_GetOptionalItem` or :c:func:" "`PyObject_GetItem()` instead." msgstr "" -#: c-api/mapping.rst:70 +#: c-api/mapping.rst:113 msgid "" "This is the same as :c:func:`PyMapping_HasKey`, but *key* is specified as a :" "c:expr:`const char*` UTF-8 encoded bytes string, rather than a :c:expr:" "`PyObject*`." msgstr "" -#: c-api/mapping.rst:76 +#: c-api/mapping.rst:119 msgid "" "Exceptions that occur when this calls :meth:`~object.__getitem__` method or " "while creating the temporary :class:`str` object are silently ignored. For " -"proper error handling, use :c:func:`PyMapping_GetItemString` instead." +"proper error handling, use :c:func:`PyMapping_HasKeyStringWithError`, :c:" +"func:`PyMapping_GetOptionalItemString` or :c:func:`PyMapping_GetItemString` " +"instead." msgstr "" -#: c-api/mapping.rst:84 +#: c-api/mapping.rst:129 msgid "" "On success, return a list of the keys in object *o*. On failure, return " "``NULL``." msgstr "" -#: c-api/mapping.rst:96 c-api/mapping.rst:105 +#: c-api/mapping.rst:141 c-api/mapping.rst:150 msgid "Previously, the function returned a list or a tuple." msgstr "" -#: c-api/mapping.rst:93 +#: c-api/mapping.rst:138 msgid "" "On success, return a list of the values in object *o*. On failure, return " "``NULL``." msgstr "" -#: c-api/mapping.rst:102 +#: c-api/mapping.rst:147 msgid "" "On success, return a list of the items in object *o*, where each item is a " "tuple containing a key-value pair. On failure, return ``NULL``." diff --git a/c-api/marshal.po b/c-api/marshal.po index ea6a09d1..06c9c81a 100644 --- a/c-api/marshal.po +++ b/c-api/marshal.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" diff --git a/c-api/memory.po b/c-api/memory.po index 0321f974..6a2d7d0d 100644 --- a/c-api/memory.po +++ b/c-api/memory.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -133,59 +133,70 @@ msgid "" "details on how every domain allocates memory or what internal functions each " "domain calls is considered an implementation detail, but for debugging " "purposes a simplified table can be found at :ref:`here `. There is no hard requirement to use the memory returned by the " -"allocation functions belonging to a given domain for only the purposes " -"hinted by that domain (although this is the recommended practice). For " -"example, one could use the memory returned by :c:func:`PyMem_RawMalloc` for " -"allocating Python objects or the memory returned by :c:func:" -"`PyObject_Malloc` for allocating memory for buffers." +"allocators>`. The APIs used to allocate and free a block of memory must be " +"from the same domain. For example, :c:func:`PyMem_Free` must be used to free " +"memory allocated using :c:func:`PyMem_Malloc`." msgstr "" -#: c-api/memory.rst:112 +#: c-api/memory.rst:109 msgid "The three allocation domains are:" msgstr "" -#: c-api/memory.rst:114 +#: c-api/memory.rst:111 msgid "" "Raw domain: intended for allocating memory for general-purpose memory " "buffers where the allocation *must* go to the system allocator or where the " "allocator can operate without the :term:`GIL`. The memory is requested " -"directly to the system." +"directly from the system. See :ref:`Raw Memory Interface `." msgstr "" -#: c-api/memory.rst:119 +#: c-api/memory.rst:116 msgid "" "\"Mem\" domain: intended for allocating memory for Python buffers and " "general-purpose memory buffers where the allocation must be performed with " -"the :term:`GIL` held. The memory is taken from the Python private heap." +"the :term:`GIL` held. The memory is taken from the Python private heap. See :" +"ref:`Memory Interface `." msgstr "" -#: c-api/memory.rst:123 +#: c-api/memory.rst:121 msgid "" -"Object domain: intended for allocating memory belonging to Python objects. " -"The memory is taken from the Python private heap." +"Object domain: intended for allocating memory for Python objects. The memory " +"is taken from the Python private heap. See :ref:`Object allocators " +"`." msgstr "" #: c-api/memory.rst:126 msgid "" -"When freeing memory previously allocated by the allocating functions " -"belonging to a given domain,the matching specific deallocating functions " -"must be used. For example, :c:func:`PyMem_Free` must be used to free memory " -"allocated using :c:func:`PyMem_Malloc`." +"The :term:`free-threaded ` build requires that only Python " +"objects are allocated using the \"object\" domain and that all Python " +"objects are allocated using that domain. This differs from the prior Python " +"versions, where this was only a best practice and not a hard requirement." msgstr "" -#: c-api/memory.rst:131 -msgid "Raw Memory Interface" +#: c-api/memory.rst:130 +msgid "" +"For example, buffers (non-Python objects) should be allocated using :c:func:" +"`PyMem_Malloc`, :c:func:`PyMem_RawMalloc`, or :c:func:`malloc`, but not :c:" +"func:`PyObject_Malloc`." msgstr "" #: c-api/memory.rst:133 +msgid "See :ref:`Memory Allocation APIs `." +msgstr "" + +#: c-api/memory.rst:139 +msgid "Raw Memory Interface" +msgstr "" + +#: c-api/memory.rst:141 msgid "" "The following function sets are wrappers to the system allocator. These " "functions are thread-safe, the :term:`GIL ` does " "not need to be held." msgstr "" -#: c-api/memory.rst:137 +#: c-api/memory.rst:145 msgid "" "The :ref:`default raw memory allocator ` uses the " "following functions: :c:func:`malloc`, :c:func:`calloc`, :c:func:`realloc` " @@ -193,60 +204,60 @@ msgid "" "requesting zero bytes." msgstr "" -#: c-api/memory.rst:217 c-api/memory.rst:325 +#: c-api/memory.rst:225 c-api/memory.rst:335 msgid "" "Allocates *n* bytes and returns a pointer of type :c:expr:`void*` to the " "allocated memory, or ``NULL`` if the request fails." msgstr "" -#: c-api/memory.rst:149 +#: c-api/memory.rst:157 msgid "" "Requesting zero bytes returns a distinct non-``NULL`` pointer if possible, " "as if ``PyMem_RawMalloc(1)`` had been called instead. The memory will not " "have been initialized in any way." msgstr "" -#: c-api/memory.rst:227 c-api/memory.rst:335 +#: c-api/memory.rst:235 c-api/memory.rst:345 msgid "" "Allocates *nelem* elements each whose size in bytes is *elsize* and returns " "a pointer of type :c:expr:`void*` to the allocated memory, or ``NULL`` if " "the request fails. The memory is initialized to zeros." msgstr "" -#: c-api/memory.rst:160 +#: c-api/memory.rst:168 msgid "" "Requesting zero elements or elements of size zero bytes returns a distinct " "non-``NULL`` pointer if possible, as if ``PyMem_RawCalloc(1, 1)`` had been " "called instead." msgstr "" -#: c-api/memory.rst:240 c-api/memory.rst:348 +#: c-api/memory.rst:248 c-api/memory.rst:358 msgid "" "Resizes the memory block pointed to by *p* to *n* bytes. The contents will " "be unchanged to the minimum of the old and the new sizes." msgstr "" -#: c-api/memory.rst:172 +#: c-api/memory.rst:180 msgid "" "If *p* is ``NULL``, the call is equivalent to ``PyMem_RawMalloc(n)``; else " "if *n* is equal to zero, the memory block is resized but is not freed, and " "the returned pointer is non-``NULL``." msgstr "" -#: c-api/memory.rst:176 +#: c-api/memory.rst:184 msgid "" "Unless *p* is ``NULL``, it must have been returned by a previous call to :c:" "func:`PyMem_RawMalloc`, :c:func:`PyMem_RawRealloc` or :c:func:" "`PyMem_RawCalloc`." msgstr "" -#: c-api/memory.rst:180 +#: c-api/memory.rst:188 msgid "" "If the request fails, :c:func:`PyMem_RawRealloc` returns ``NULL`` and *p* " "remains a valid pointer to the previous memory area." msgstr "" -#: c-api/memory.rst:186 +#: c-api/memory.rst:194 msgid "" "Frees the memory block pointed to by *p*, which must have been returned by a " "previous call to :c:func:`PyMem_RawMalloc`, :c:func:`PyMem_RawRealloc` or :c:" @@ -254,72 +265,72 @@ msgid "" "called before, undefined behavior occurs." msgstr "" -#: c-api/memory.rst:261 c-api/memory.rst:369 +#: c-api/memory.rst:269 c-api/memory.rst:379 msgid "If *p* is ``NULL``, no operation is performed." msgstr "" -#: c-api/memory.rst:197 +#: c-api/memory.rst:205 msgid "Memory Interface" msgstr "" -#: c-api/memory.rst:305 +#: c-api/memory.rst:315 msgid "" "The following function sets, modeled after the ANSI C standard, but " "specifying behavior when requesting zero bytes, are available for allocating " "and releasing memory from the Python heap." msgstr "" -#: c-api/memory.rst:203 +#: c-api/memory.rst:211 msgid "" "The :ref:`default memory allocator ` uses the :" "ref:`pymalloc memory allocator `." msgstr "" -#: c-api/memory.rst:320 +#: c-api/memory.rst:330 msgid "" "The :term:`GIL ` must be held when using these " "functions." msgstr "" -#: c-api/memory.rst:213 +#: c-api/memory.rst:221 msgid "" "The default allocator is now pymalloc instead of system :c:func:`malloc`." msgstr "" -#: c-api/memory.rst:220 +#: c-api/memory.rst:228 msgid "" "Requesting zero bytes returns a distinct non-``NULL`` pointer if possible, " "as if ``PyMem_Malloc(1)`` had been called instead. The memory will not have " "been initialized in any way." msgstr "" -#: c-api/memory.rst:231 +#: c-api/memory.rst:239 msgid "" "Requesting zero elements or elements of size zero bytes returns a distinct " "non-``NULL`` pointer if possible, as if ``PyMem_Calloc(1, 1)`` had been " "called instead." msgstr "" -#: c-api/memory.rst:243 +#: c-api/memory.rst:251 msgid "" "If *p* is ``NULL``, the call is equivalent to ``PyMem_Malloc(n)``; else if " "*n* is equal to zero, the memory block is resized but is not freed, and the " "returned pointer is non-``NULL``." msgstr "" -#: c-api/memory.rst:247 +#: c-api/memory.rst:255 msgid "" "Unless *p* is ``NULL``, it must have been returned by a previous call to :c:" "func:`PyMem_Malloc`, :c:func:`PyMem_Realloc` or :c:func:`PyMem_Calloc`." msgstr "" -#: c-api/memory.rst:250 +#: c-api/memory.rst:258 msgid "" "If the request fails, :c:func:`PyMem_Realloc` returns ``NULL`` and *p* " "remains a valid pointer to the previous memory area." msgstr "" -#: c-api/memory.rst:256 +#: c-api/memory.rst:264 msgid "" "Frees the memory block pointed to by *p*, which must have been returned by a " "previous call to :c:func:`PyMem_Malloc`, :c:func:`PyMem_Realloc` or :c:func:" @@ -327,20 +338,20 @@ msgid "" "undefined behavior occurs." msgstr "" -#: c-api/memory.rst:263 +#: c-api/memory.rst:271 msgid "" "The following type-oriented macros are provided for convenience. Note that " "*TYPE* refers to any C type." msgstr "" -#: c-api/memory.rst:269 +#: c-api/memory.rst:277 msgid "" "Same as :c:func:`PyMem_Malloc`, but allocates ``(n * sizeof(TYPE))`` bytes " "of memory. Returns a pointer cast to ``TYPE*``. The memory will not have " "been initialized in any way." msgstr "" -#: c-api/memory.rst:276 +#: c-api/memory.rst:284 msgid "" "Same as :c:func:`PyMem_Realloc`, but the memory block is resized to ``(n * " "sizeof(TYPE))`` bytes. Returns a pointer cast to ``TYPE*``. On return, *p* " @@ -348,17 +359,17 @@ msgid "" "failure." msgstr "" -#: c-api/memory.rst:281 +#: c-api/memory.rst:289 msgid "" "This is a C preprocessor macro; *p* is always reassigned. Save the original " "value of *p* to avoid losing memory when handling errors." msgstr "" -#: c-api/memory.rst:287 +#: c-api/memory.rst:295 msgid "Same as :c:func:`PyMem_Free`." msgstr "" -#: c-api/memory.rst:289 +#: c-api/memory.rst:297 msgid "" "In addition, the following macro sets are provided for calling the Python " "memory allocator directly, without involving the C API functions listed " @@ -366,35 +377,35 @@ msgid "" "across Python versions and is therefore deprecated in extension modules." msgstr "" -#: c-api/memory.rst:294 +#: c-api/memory.rst:302 msgid "``PyMem_MALLOC(size)``" msgstr "" -#: c-api/memory.rst:295 +#: c-api/memory.rst:303 msgid "``PyMem_NEW(type, size)``" msgstr "" -#: c-api/memory.rst:296 +#: c-api/memory.rst:304 msgid "``PyMem_REALLOC(ptr, size)``" msgstr "" -#: c-api/memory.rst:297 +#: c-api/memory.rst:305 msgid "``PyMem_RESIZE(ptr, type, size)``" msgstr "" -#: c-api/memory.rst:298 +#: c-api/memory.rst:306 msgid "``PyMem_FREE(ptr)``" msgstr "" -#: c-api/memory.rst:299 +#: c-api/memory.rst:307 msgid "``PyMem_DEL(ptr)``" msgstr "" -#: c-api/memory.rst:303 +#: c-api/memory.rst:313 msgid "Object allocators" msgstr "" -#: c-api/memory.rst:310 +#: c-api/memory.rst:320 msgid "" "There is no guarantee that the memory returned by these allocators can be " "successfully cast to a Python object when intercepting the allocating " @@ -402,47 +413,47 @@ msgid "" "Memory Allocators ` section." msgstr "" -#: c-api/memory.rst:315 +#: c-api/memory.rst:325 msgid "" "The :ref:`default object allocator ` uses the :" "ref:`pymalloc memory allocator `." msgstr "" -#: c-api/memory.rst:328 +#: c-api/memory.rst:338 msgid "" "Requesting zero bytes returns a distinct non-``NULL`` pointer if possible, " "as if ``PyObject_Malloc(1)`` had been called instead. The memory will not " "have been initialized in any way." msgstr "" -#: c-api/memory.rst:339 +#: c-api/memory.rst:349 msgid "" "Requesting zero elements or elements of size zero bytes returns a distinct " "non-``NULL`` pointer if possible, as if ``PyObject_Calloc(1, 1)`` had been " "called instead." msgstr "" -#: c-api/memory.rst:351 +#: c-api/memory.rst:361 msgid "" "If *p* is ``NULL``, the call is equivalent to ``PyObject_Malloc(n)``; else " "if *n* is equal to zero, the memory block is resized but is not freed, and " "the returned pointer is non-``NULL``." msgstr "" -#: c-api/memory.rst:355 +#: c-api/memory.rst:365 msgid "" "Unless *p* is ``NULL``, it must have been returned by a previous call to :c:" "func:`PyObject_Malloc`, :c:func:`PyObject_Realloc` or :c:func:" "`PyObject_Calloc`." msgstr "" -#: c-api/memory.rst:358 +#: c-api/memory.rst:368 msgid "" "If the request fails, :c:func:`PyObject_Realloc` returns ``NULL`` and *p* " "remains a valid pointer to the previous memory area." msgstr "" -#: c-api/memory.rst:364 +#: c-api/memory.rst:374 msgid "" "Frees the memory block pointed to by *p*, which must have been returned by a " "previous call to :c:func:`PyObject_Malloc`, :c:func:`PyObject_Realloc` or :c:" @@ -450,276 +461,282 @@ msgid "" "called before, undefined behavior occurs." msgstr "" -#: c-api/memory.rst:375 +#: c-api/memory.rst:385 msgid "Default Memory Allocators" msgstr "" -#: c-api/memory.rst:377 +#: c-api/memory.rst:387 msgid "Default memory allocators:" msgstr "" -#: c-api/memory.rst:380 +#: c-api/memory.rst:390 msgid "Configuration" msgstr "" -#: c-api/memory.rst:380 +#: c-api/memory.rst:390 msgid "Name" msgstr "" -#: c-api/memory.rst:380 +#: c-api/memory.rst:390 msgid "PyMem_RawMalloc" msgstr "" -#: c-api/memory.rst:380 +#: c-api/memory.rst:390 msgid "PyMem_Malloc" msgstr "" -#: c-api/memory.rst:380 +#: c-api/memory.rst:390 msgid "PyObject_Malloc" msgstr "" -#: c-api/memory.rst:382 +#: c-api/memory.rst:392 msgid "Release build" msgstr "" -#: c-api/memory.rst:382 +#: c-api/memory.rst:392 msgid "``\"pymalloc\"``" msgstr "" -#: c-api/memory.rst:384 +#: c-api/memory.rst:394 msgid "``malloc``" msgstr "" -#: c-api/memory.rst:382 +#: c-api/memory.rst:392 msgid "``pymalloc``" msgstr "" -#: c-api/memory.rst:383 +#: c-api/memory.rst:393 msgid "Debug build" msgstr "" -#: c-api/memory.rst:383 +#: c-api/memory.rst:393 msgid "``\"pymalloc_debug\"``" msgstr "" -#: c-api/memory.rst:385 +#: c-api/memory.rst:395 msgid "``malloc`` + debug" msgstr "" -#: c-api/memory.rst:383 +#: c-api/memory.rst:393 msgid "``pymalloc`` + debug" msgstr "" -#: c-api/memory.rst:384 +#: c-api/memory.rst:394 msgid "Release build, without pymalloc" msgstr "" -#: c-api/memory.rst:384 +#: c-api/memory.rst:394 msgid "``\"malloc\"``" msgstr "" -#: c-api/memory.rst:385 +#: c-api/memory.rst:395 msgid "Debug build, without pymalloc" msgstr "" -#: c-api/memory.rst:385 +#: c-api/memory.rst:395 msgid "``\"malloc_debug\"``" msgstr "" -#: c-api/memory.rst:388 +#: c-api/memory.rst:398 msgid "Legend:" msgstr "" -#: c-api/memory.rst:390 +#: c-api/memory.rst:400 msgid "Name: value for :envvar:`PYTHONMALLOC` environment variable." msgstr "" -#: c-api/memory.rst:391 +#: c-api/memory.rst:401 msgid "" "``malloc``: system allocators from the standard C library, C functions: :c:" "func:`malloc`, :c:func:`calloc`, :c:func:`realloc` and :c:func:`free`." msgstr "" -#: c-api/memory.rst:393 +#: c-api/memory.rst:403 msgid "``pymalloc``: :ref:`pymalloc memory allocator `." msgstr "" -#: c-api/memory.rst:394 +#: c-api/memory.rst:404 +msgid "" +"``mimalloc``: :ref:`mimalloc memory allocator `. The pymalloc " +"allocator will be used if mimalloc support isn't available." +msgstr "" + +#: c-api/memory.rst:406 msgid "" "\"+ debug\": with :ref:`debug hooks on the Python memory allocators `." msgstr "" -#: c-api/memory.rst:396 +#: c-api/memory.rst:408 msgid "\"Debug build\": :ref:`Python build in debug mode `." msgstr "" -#: c-api/memory.rst:401 +#: c-api/memory.rst:413 msgid "Customize Memory Allocators" msgstr "" -#: c-api/memory.rst:407 +#: c-api/memory.rst:419 msgid "" "Structure used to describe a memory block allocator. The structure has the " "following fields:" msgstr "" -#: c-api/memory.rst:658 +#: c-api/memory.rst:670 msgid "Field" msgstr "" -#: c-api/memory.rst:658 +#: c-api/memory.rst:670 msgid "Meaning" msgstr "" -#: c-api/memory.rst:660 +#: c-api/memory.rst:672 msgid "``void *ctx``" msgstr "" -#: c-api/memory.rst:660 +#: c-api/memory.rst:672 msgid "user context passed as first argument" msgstr "" -#: c-api/memory.rst:415 +#: c-api/memory.rst:427 msgid "``void* malloc(void *ctx, size_t size)``" msgstr "" -#: c-api/memory.rst:415 +#: c-api/memory.rst:427 msgid "allocate a memory block" msgstr "" -#: c-api/memory.rst:417 +#: c-api/memory.rst:429 msgid "``void* calloc(void *ctx, size_t nelem, size_t elsize)``" msgstr "" -#: c-api/memory.rst:417 +#: c-api/memory.rst:429 msgid "allocate a memory block initialized with zeros" msgstr "" -#: c-api/memory.rst:420 +#: c-api/memory.rst:432 msgid "``void* realloc(void *ctx, void *ptr, size_t new_size)``" msgstr "" -#: c-api/memory.rst:420 +#: c-api/memory.rst:432 msgid "allocate or resize a memory block" msgstr "" -#: c-api/memory.rst:422 +#: c-api/memory.rst:434 msgid "``void free(void *ctx, void *ptr)``" msgstr "" -#: c-api/memory.rst:422 +#: c-api/memory.rst:434 msgid "free a memory block" msgstr "" -#: c-api/memory.rst:425 +#: c-api/memory.rst:437 msgid "" "The :c:type:`!PyMemAllocator` structure was renamed to :c:type:" "`PyMemAllocatorEx` and a new ``calloc`` field was added." msgstr "" -#: c-api/memory.rst:432 +#: c-api/memory.rst:444 msgid "Enum used to identify an allocator domain. Domains:" msgstr "" -#: c-api/memory.rst:447 c-api/memory.rst:456 +#: c-api/memory.rst:459 c-api/memory.rst:468 msgid "Functions:" msgstr "" -#: c-api/memory.rst:440 +#: c-api/memory.rst:452 msgid ":c:func:`PyMem_RawMalloc`" msgstr "" -#: c-api/memory.rst:441 +#: c-api/memory.rst:453 msgid ":c:func:`PyMem_RawRealloc`" msgstr "" -#: c-api/memory.rst:442 +#: c-api/memory.rst:454 msgid ":c:func:`PyMem_RawCalloc`" msgstr "" -#: c-api/memory.rst:443 +#: c-api/memory.rst:455 msgid ":c:func:`PyMem_RawFree`" msgstr "" -#: c-api/memory.rst:449 +#: c-api/memory.rst:461 msgid ":c:func:`PyMem_Malloc`," msgstr "" -#: c-api/memory.rst:450 +#: c-api/memory.rst:462 msgid ":c:func:`PyMem_Realloc`" msgstr "" -#: c-api/memory.rst:451 +#: c-api/memory.rst:463 msgid ":c:func:`PyMem_Calloc`" msgstr "" -#: c-api/memory.rst:452 +#: c-api/memory.rst:464 msgid ":c:func:`PyMem_Free`" msgstr "" -#: c-api/memory.rst:458 +#: c-api/memory.rst:470 msgid ":c:func:`PyObject_Malloc`" msgstr "" -#: c-api/memory.rst:459 +#: c-api/memory.rst:471 msgid ":c:func:`PyObject_Realloc`" msgstr "" -#: c-api/memory.rst:460 +#: c-api/memory.rst:472 msgid ":c:func:`PyObject_Calloc`" msgstr "" -#: c-api/memory.rst:461 +#: c-api/memory.rst:473 msgid ":c:func:`PyObject_Free`" msgstr "" -#: c-api/memory.rst:465 +#: c-api/memory.rst:477 msgid "Get the memory block allocator of the specified domain." msgstr "" -#: c-api/memory.rst:470 +#: c-api/memory.rst:482 msgid "Set the memory block allocator of the specified domain." msgstr "" -#: c-api/memory.rst:472 +#: c-api/memory.rst:484 msgid "" "The new allocator must return a distinct non-``NULL`` pointer when " "requesting zero bytes." msgstr "" -#: c-api/memory.rst:475 +#: c-api/memory.rst:487 msgid "" "For the :c:macro:`PYMEM_DOMAIN_RAW` domain, the allocator must be thread-" "safe: the :term:`GIL ` is not held when the " "allocator is called." msgstr "" -#: c-api/memory.rst:479 +#: c-api/memory.rst:491 msgid "" "For the remaining domains, the allocator must also be thread-safe: the " "allocator may be called in different interpreters that do not share a " "``GIL``." msgstr "" -#: c-api/memory.rst:483 +#: c-api/memory.rst:495 msgid "" "If the new allocator is not a hook (does not call the previous allocator), " "the :c:func:`PyMem_SetupDebugHooks` function must be called to reinstall the " "debug hooks on top on the new allocator." msgstr "" -#: c-api/memory.rst:487 +#: c-api/memory.rst:499 msgid "" "See also :c:member:`PyPreConfig.allocator` and :ref:`Preinitialize Python " "with PyPreConfig `." msgstr "" -#: c-api/memory.rst:492 +#: c-api/memory.rst:504 msgid ":c:func:`PyMem_SetAllocator` does have the following contract:" msgstr "" -#: c-api/memory.rst:494 +#: c-api/memory.rst:506 msgid "" "It can be called after :c:func:`Py_PreInitialize` and before :c:func:" "`Py_InitializeFromConfig` to install a custom memory allocator. There are no " @@ -729,7 +746,7 @@ msgid "" "domains>` for more information." msgstr "" -#: c-api/memory.rst:502 +#: c-api/memory.rst:514 msgid "" "If called after Python has finish initializing (after :c:func:" "`Py_InitializeFromConfig` has been called) the allocator **must** wrap the " @@ -737,21 +754,21 @@ msgid "" "arbitrary one is **not supported**." msgstr "" -#: c-api/memory.rst:507 +#: c-api/memory.rst:519 msgid "All allocators must be thread-safe." msgstr "" -#: c-api/memory.rst:513 +#: c-api/memory.rst:525 msgid "" "Setup :ref:`debug hooks in the Python memory allocators ` " "to detect memory errors." msgstr "" -#: c-api/memory.rst:520 +#: c-api/memory.rst:532 msgid "Debug hooks on the Python memory allocators" msgstr "" -#: c-api/memory.rst:522 +#: c-api/memory.rst:534 msgid "" "When :ref:`Python is built in debug mode `, the :c:func:" "`PyMem_SetupDebugHooks` function is called at the :ref:`Python " @@ -759,19 +776,19 @@ msgid "" "allocators to detect memory errors." msgstr "" -#: c-api/memory.rst:527 +#: c-api/memory.rst:539 msgid "" "The :envvar:`PYTHONMALLOC` environment variable can be used to install debug " "hooks on a Python compiled in release mode (ex: ``PYTHONMALLOC=debug``)." msgstr "" -#: c-api/memory.rst:530 +#: c-api/memory.rst:542 msgid "" "The :c:func:`PyMem_SetupDebugHooks` function can be used to set debug hooks " "after calling :c:func:`PyMem_SetAllocator`." msgstr "" -#: c-api/memory.rst:533 +#: c-api/memory.rst:545 msgid "" "These debug hooks fill dynamically allocated memory blocks with special, " "recognizable bit patterns. Newly allocated memory is filled with the byte " @@ -781,25 +798,25 @@ msgid "" "these bytes are unlikely to be valid addresses, floats, or ASCII strings." msgstr "" -#: c-api/memory.rst:540 +#: c-api/memory.rst:552 msgid "Runtime checks:" msgstr "" -#: c-api/memory.rst:542 +#: c-api/memory.rst:554 msgid "" "Detect API violations. For example, detect if :c:func:`PyObject_Free` is " "called on a memory block allocated by :c:func:`PyMem_Malloc`." msgstr "" -#: c-api/memory.rst:544 +#: c-api/memory.rst:556 msgid "Detect write before the start of the buffer (buffer underflow)." msgstr "" -#: c-api/memory.rst:545 +#: c-api/memory.rst:557 msgid "Detect write after the end of the buffer (buffer overflow)." msgstr "" -#: c-api/memory.rst:546 +#: c-api/memory.rst:558 msgid "" "Check that the :term:`GIL ` is held when allocator " "functions of :c:macro:`PYMEM_DOMAIN_OBJ` (ex: :c:func:`PyObject_Malloc`) " @@ -807,7 +824,7 @@ msgid "" "called." msgstr "" -#: c-api/memory.rst:551 +#: c-api/memory.rst:563 msgid "" "On error, the debug hooks use the :mod:`tracemalloc` module to get the " "traceback where a memory block was allocated. The traceback is only " @@ -815,7 +832,7 @@ msgid "" "memory block was traced." msgstr "" -#: c-api/memory.rst:556 +#: c-api/memory.rst:568 msgid "" "Let *S* = ``sizeof(size_t)``. ``2*S`` bytes are added at each end of each " "block of *N* bytes requested. The memory layout is like so, where p " @@ -825,49 +842,49 @@ msgid "" "from a Python slice):" msgstr "" -#: c-api/memory.rst:562 +#: c-api/memory.rst:574 msgid "``p[-2*S:-S]``" msgstr "" -#: c-api/memory.rst:563 +#: c-api/memory.rst:575 msgid "" "Number of bytes originally asked for. This is a size_t, big-endian (easier " "to read in a memory dump)." msgstr "" -#: c-api/memory.rst:565 +#: c-api/memory.rst:577 msgid "``p[-S]``" msgstr "" -#: c-api/memory.rst:566 +#: c-api/memory.rst:578 msgid "API identifier (ASCII character):" msgstr "" -#: c-api/memory.rst:568 +#: c-api/memory.rst:580 msgid "``'r'`` for :c:macro:`PYMEM_DOMAIN_RAW`." msgstr "" -#: c-api/memory.rst:569 +#: c-api/memory.rst:581 msgid "``'m'`` for :c:macro:`PYMEM_DOMAIN_MEM`." msgstr "" -#: c-api/memory.rst:570 +#: c-api/memory.rst:582 msgid "``'o'`` for :c:macro:`PYMEM_DOMAIN_OBJ`." msgstr "" -#: c-api/memory.rst:572 +#: c-api/memory.rst:584 msgid "``p[-S+1:0]``" msgstr "" -#: c-api/memory.rst:573 +#: c-api/memory.rst:585 msgid "Copies of PYMEM_FORBIDDENBYTE. Used to catch under- writes and reads." msgstr "" -#: c-api/memory.rst:575 +#: c-api/memory.rst:587 msgid "``p[0:N]``" msgstr "" -#: c-api/memory.rst:576 +#: c-api/memory.rst:588 msgid "" "The requested memory, filled with copies of PYMEM_CLEANBYTE, used to catch " "reference to uninitialized memory. When a realloc-like function is called " @@ -878,25 +895,25 @@ msgid "" "bytes are also filled with PYMEM_DEADBYTE." msgstr "" -#: c-api/memory.rst:584 +#: c-api/memory.rst:596 msgid "``p[N:N+S]``" msgstr "" -#: c-api/memory.rst:585 +#: c-api/memory.rst:597 msgid "Copies of PYMEM_FORBIDDENBYTE. Used to catch over- writes and reads." msgstr "" -#: c-api/memory.rst:587 +#: c-api/memory.rst:599 msgid "``p[N+S:N+2*S]``" msgstr "" -#: c-api/memory.rst:588 +#: c-api/memory.rst:600 msgid "" "Only used if the ``PYMEM_DEBUG_SERIALNO`` macro is defined (not defined by " "default)." msgstr "" -#: c-api/memory.rst:591 +#: c-api/memory.rst:603 msgid "" "A serial number, incremented by 1 on each call to a malloc-like or realloc-" "like function. Big-endian :c:type:`size_t`. If \"bad memory\" is detected " @@ -906,7 +923,7 @@ msgid "" "number is incremented, and exists so you can set such a breakpoint easily." msgstr "" -#: c-api/memory.rst:598 +#: c-api/memory.rst:610 msgid "" "A realloc-like or free-like function first checks that the " "PYMEM_FORBIDDENBYTE bytes at each end are intact. If they've been altered, " @@ -919,7 +936,7 @@ msgid "" "getting used)." msgstr "" -#: c-api/memory.rst:607 +#: c-api/memory.rst:619 msgid "" "The :c:func:`PyMem_SetupDebugHooks` function now also works on Python " "compiled in release mode. On error, the debug hooks now use :mod:" @@ -928,7 +945,7 @@ msgid "" "`PYMEM_DOMAIN_OBJ` and :c:macro:`PYMEM_DOMAIN_MEM` domains are called." msgstr "" -#: c-api/memory.rst:615 +#: c-api/memory.rst:627 msgid "" "Byte patterns ``0xCB`` (``PYMEM_CLEANBYTE``), ``0xDB`` (``PYMEM_DEADBYTE``) " "and ``0xFB`` (``PYMEM_FORBIDDENBYTE``) have been replaced with ``0xCD``, " @@ -936,11 +953,11 @@ msgid "" "``malloc()`` and ``free()``." msgstr "" -#: c-api/memory.rst:625 +#: c-api/memory.rst:637 msgid "The pymalloc allocator" msgstr "" -#: c-api/memory.rst:627 +#: c-api/memory.rst:639 msgid "" "Python has a *pymalloc* allocator optimized for small objects (smaller or " "equal to 512 bytes) with a short lifetime. It uses memory mappings called " @@ -949,110 +966,122 @@ msgid "" "`PyMem_RawRealloc` for allocations larger than 512 bytes." msgstr "" -#: c-api/memory.rst:633 +#: c-api/memory.rst:645 msgid "" "*pymalloc* is the :ref:`default allocator ` of " "the :c:macro:`PYMEM_DOMAIN_MEM` (ex: :c:func:`PyMem_Malloc`) and :c:macro:" "`PYMEM_DOMAIN_OBJ` (ex: :c:func:`PyObject_Malloc`) domains." msgstr "" -#: c-api/memory.rst:637 +#: c-api/memory.rst:649 msgid "The arena allocator uses the following functions:" msgstr "" -#: c-api/memory.rst:639 +#: c-api/memory.rst:651 msgid ":c:func:`!VirtualAlloc` and :c:func:`!VirtualFree` on Windows," msgstr "" -#: c-api/memory.rst:640 +#: c-api/memory.rst:652 msgid ":c:func:`!mmap` and :c:func:`!munmap` if available," msgstr "" -#: c-api/memory.rst:641 +#: c-api/memory.rst:653 msgid ":c:func:`malloc` and :c:func:`free` otherwise." msgstr "" -#: c-api/memory.rst:643 +#: c-api/memory.rst:655 msgid "" "This allocator is disabled if Python is configured with the :option:`--" "without-pymalloc` option. It can also be disabled at runtime using the :" "envvar:`PYTHONMALLOC` environment variable (ex: ``PYTHONMALLOC=malloc``)." msgstr "" -#: c-api/memory.rst:648 +#: c-api/memory.rst:660 msgid "Customize pymalloc Arena Allocator" msgstr "" -#: c-api/memory.rst:654 +#: c-api/memory.rst:666 msgid "" "Structure used to describe an arena allocator. The structure has three " "fields:" msgstr "" -#: c-api/memory.rst:662 +#: c-api/memory.rst:674 msgid "``void* alloc(void *ctx, size_t size)``" msgstr "" -#: c-api/memory.rst:662 +#: c-api/memory.rst:674 msgid "allocate an arena of size bytes" msgstr "" -#: c-api/memory.rst:664 +#: c-api/memory.rst:676 msgid "``void free(void *ctx, void *ptr, size_t size)``" msgstr "" -#: c-api/memory.rst:664 +#: c-api/memory.rst:676 msgid "free an arena" msgstr "" -#: c-api/memory.rst:669 +#: c-api/memory.rst:681 msgid "Get the arena allocator." msgstr "" -#: c-api/memory.rst:673 +#: c-api/memory.rst:685 msgid "Set the arena allocator." msgstr "" -#: c-api/memory.rst:677 +#: c-api/memory.rst:690 +msgid "The mimalloc allocator" +msgstr "" + +#: c-api/memory.rst:694 +msgid "" +"Python supports the mimalloc allocator when the underlying platform support " +"is available. mimalloc \"is a general purpose allocator with excellent " +"performance characteristics. Initially developed by Daan Leijen for the " +"runtime systems of the Koka and Lean languages.\"" +msgstr "" + +#: c-api/memory.rst:699 msgid "tracemalloc C API" msgstr "" -#: c-api/memory.rst:683 +#: c-api/memory.rst:705 msgid "Track an allocated memory block in the :mod:`tracemalloc` module." msgstr "" -#: c-api/memory.rst:685 +#: c-api/memory.rst:707 msgid "" "Return ``0`` on success, return ``-1`` on error (failed to allocate memory " "to store the trace). Return ``-2`` if tracemalloc is disabled." msgstr "" -#: c-api/memory.rst:688 +#: c-api/memory.rst:710 msgid "If memory block is already tracked, update the existing trace." msgstr "" -#: c-api/memory.rst:692 +#: c-api/memory.rst:714 msgid "" "Untrack an allocated memory block in the :mod:`tracemalloc` module. Do " "nothing if the block was not tracked." msgstr "" -#: c-api/memory.rst:695 +#: c-api/memory.rst:717 msgid "Return ``-2`` if tracemalloc is disabled, otherwise return ``0``." msgstr "" -#: c-api/memory.rst:701 +#: c-api/memory.rst:723 msgid "Examples" msgstr "" -#: c-api/memory.rst:703 +#: c-api/memory.rst:725 msgid "" "Here is the example from section :ref:`memoryoverview`, rewritten so that " "the I/O buffer is allocated from the Python heap by using the first function " "set::" msgstr "" -#: c-api/memory.rst:706 +#: c-api/memory.rst:728 msgid "" "PyObject *res;\n" "char *buf = (char *) PyMem_Malloc(BUFSIZ); /* for I/O */\n" @@ -1065,11 +1094,11 @@ msgid "" "return res;" msgstr "" -#: c-api/memory.rst:716 +#: c-api/memory.rst:738 msgid "The same code using the type-oriented function set::" msgstr "" -#: c-api/memory.rst:718 +#: c-api/memory.rst:740 msgid "" "PyObject *res;\n" "char *buf = PyMem_New(char, BUFSIZ); /* for I/O */\n" @@ -1082,7 +1111,7 @@ msgid "" "return res;" msgstr "" -#: c-api/memory.rst:728 +#: c-api/memory.rst:750 msgid "" "Note that in the two examples above, the buffer is always manipulated via " "functions belonging to the same set. Indeed, it is required to use the same " @@ -1092,7 +1121,7 @@ msgid "" "different allocators operating on different heaps. ::" msgstr "" -#: c-api/memory.rst:735 +#: c-api/memory.rst:757 msgid "" "char *buf1 = PyMem_New(char, BUFSIZ);\n" "char *buf2 = (char *) malloc(BUFSIZ);\n" @@ -1103,14 +1132,14 @@ msgid "" "free(buf1); /* Fatal -- should be PyMem_Del() */" msgstr "" -#: c-api/memory.rst:743 +#: c-api/memory.rst:765 msgid "" "In addition to the functions aimed at handling raw memory blocks from the " "Python heap, objects in Python are allocated and released with :c:macro:" "`PyObject_New`, :c:macro:`PyObject_NewVar` and :c:func:`PyObject_Del`." msgstr "" -#: c-api/memory.rst:747 +#: c-api/memory.rst:769 msgid "" "These will be explained in the next chapter on defining and implementing new " "object types in C." diff --git a/c-api/memoryview.po b/c-api/memoryview.po index 48356588..e2d1e2a1 100644 --- a/c-api/memoryview.po +++ b/c-api/memoryview.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" diff --git a/c-api/method.po b/c-api/method.po index 00387d7d..c28e9394 100644 --- a/c-api/method.po +++ b/c-api/method.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" diff --git a/c-api/module.po b/c-api/module.po index d71ae556..abfa001a 100644 --- a/c-api/module.po +++ b/c-api/module.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -48,7 +48,7 @@ msgid "" "setting a :attr:`~module.__file__` attribute." msgstr "" -#: c-api/module.rst:272 c-api/module.rst:447 +#: c-api/module.rst:272 c-api/module.rst:474 msgid "Return ``NULL`` with an exception set on error." msgstr "" @@ -428,7 +428,7 @@ msgid "" "order they appear in the *m_slots* array." msgstr "" -#: c-api/module.rst:391 +#: c-api/module.rst:424 msgid "Specifies one of the following values:" msgstr "" @@ -466,15 +466,44 @@ msgid "" "defaults to ``Py_MOD_MULTIPLE_INTERPRETERS_SUPPORTED``." msgstr "" -#: c-api/module.rst:422 +#: c-api/module.rst:430 +msgid "" +"The module depends on the presence of the global interpreter lock (GIL), and " +"may access global state without synchronization." +msgstr "" + +#: c-api/module.rst:435 +msgid "The module is safe to run without an active GIL." +msgstr "" + +#: c-api/module.rst:437 +msgid "" +"This slot is ignored by Python builds not configured with :option:`--disable-" +"gil`. Otherwise, it determines whether or not importing this module will " +"cause the GIL to be automatically enabled. See :ref:`whatsnew313-free-" +"threaded-cpython` for more detail." +msgstr "" + +#: c-api/module.rst:442 +msgid "" +"Multiple ``Py_mod_gil`` slots may not be specified in one module definition." +msgstr "" + +#: c-api/module.rst:444 +msgid "" +"If ``Py_mod_gil`` is not specified, the import machinery defaults to " +"``Py_MOD_GIL_USED``." +msgstr "" + +#: c-api/module.rst:449 msgid "See :PEP:`489` for more details on multi-phase initialization." msgstr "" -#: c-api/module.rst:425 +#: c-api/module.rst:452 msgid "Low-level module creation functions" msgstr "" -#: c-api/module.rst:427 +#: c-api/module.rst:454 msgid "" "The following functions are called under the hood when using multi-phase " "initialization. They can be used directly, for example when creating module " @@ -482,14 +511,14 @@ msgid "" "``PyModule_ExecDef`` must be called to fully initialize a module." msgstr "" -#: c-api/module.rst:434 +#: c-api/module.rst:461 msgid "" "Create a new module object, given the definition in *def* and the ModuleSpec " "*spec*. This behaves like :c:func:`PyModule_FromDefAndSpec2` with " "*module_api_version* set to :c:macro:`PYTHON_API_VERSION`." msgstr "" -#: c-api/module.rst:442 +#: c-api/module.rst:469 msgid "" "Create a new module object, given the definition in *def* and the ModuleSpec " "*spec*, assuming the API version *module_api_version*. If that version does " @@ -497,24 +526,24 @@ msgid "" "emitted." msgstr "" -#: c-api/module.rst:451 +#: c-api/module.rst:478 msgid "" "Most uses of this function should be using :c:func:`PyModule_FromDefAndSpec` " "instead; only use this if you are sure you need it." msgstr "" -#: c-api/module.rst:458 +#: c-api/module.rst:485 msgid "Process any execution slots (:c:data:`Py_mod_exec`) given in *def*." msgstr "" -#: c-api/module.rst:464 +#: c-api/module.rst:491 msgid "" "Set the docstring for *module* to *docstring*. This function is called " "automatically when creating a module from ``PyModuleDef``, using either " "``PyModule_Create`` or ``PyModule_FromDefAndSpec``." msgstr "" -#: c-api/module.rst:473 +#: c-api/module.rst:500 msgid "" "Add the functions from the ``NULL`` terminated *functions* array to " "*module*. Refer to the :c:type:`PyMethodDef` documentation for details on " @@ -526,11 +555,11 @@ msgid "" "``PyModule_FromDefAndSpec``." msgstr "" -#: c-api/module.rst:485 +#: c-api/module.rst:512 msgid "Support functions" msgstr "" -#: c-api/module.rst:487 +#: c-api/module.rst:514 msgid "" "The module initialization function (if using single phase initialization) or " "a function called from a module execution slot (if using multi-phase " @@ -538,22 +567,22 @@ msgid "" "module state:" msgstr "" -#: c-api/module.rst:494 +#: c-api/module.rst:521 msgid "" "Add an object to *module* as *name*. This is a convenience function which " "can be used from the module's initialization function." msgstr "" -#: c-api/module.rst:497 +#: c-api/module.rst:524 msgid "" "On success, return ``0``. On error, raise an exception and return ``-1``." msgstr "" -#: c-api/module.rst:560 +#: c-api/module.rst:577 c-api/module.rst:604 msgid "Example usage::" msgstr "" -#: c-api/module.rst:501 +#: c-api/module.rst:528 msgid "" "static int\n" "add_spam(PyObject *module, int value)\n" @@ -568,20 +597,20 @@ msgid "" " }" msgstr "" -#: c-api/module.rst:513 +#: c-api/module.rst:540 msgid "" "To be convenient, the function accepts ``NULL`` *value* with an exception " "set. In this case, return ``-1`` and just leave the raised exception " "unchanged." msgstr "" -#: c-api/module.rst:578 +#: c-api/module.rst:544 msgid "" "The example can also be written without checking explicitly if *obj* is " "``NULL``::" msgstr "" -#: c-api/module.rst:520 +#: c-api/module.rst:547 msgid "" "static int\n" "add_spam(PyObject *module, int value)\n" @@ -593,13 +622,13 @@ msgid "" " }" msgstr "" -#: c-api/module.rst:594 +#: c-api/module.rst:556 msgid "" "Note that ``Py_XDECREF()`` should be used instead of ``Py_DECREF()`` in this " "case, since *obj* can be ``NULL``." msgstr "" -#: c-api/module.rst:532 +#: c-api/module.rst:559 msgid "" "The number of different *name* strings passed to this function should be " "kept small, usually by only using statically allocated strings as *name*. " @@ -609,80 +638,78 @@ msgid "" "internally to create a key object." msgstr "" -#: c-api/module.rst:545 +#: c-api/module.rst:572 +msgid "" +"Similar to :c:func:`PyModule_AddObjectRef`, but \"steals\" a reference to " +"*value*. It can be called with a result of function that returns a new " +"reference without bothering to check its result or even saving it to a " +"variable." +msgstr "" + +#: c-api/module.rst:579 +msgid "" +"if (PyModule_Add(module, \"spam\", PyBytes_FromString(value)) < 0) {\n" +" goto error;\n" +"}" +msgstr "" + +#: c-api/module.rst:588 msgid "" "Similar to :c:func:`PyModule_AddObjectRef`, but steals a reference to " "*value* on success (if it returns ``0``)." msgstr "" -#: c-api/module.rst:548 +#: c-api/module.rst:591 msgid "" -"The new :c:func:`PyModule_AddObjectRef` function is recommended, since it is " -"easy to introduce reference leaks by misusing the :c:func:" -"`PyModule_AddObject` function." +"The new :c:func:`PyModule_Add` or :c:func:`PyModule_AddObjectRef` functions " +"are recommended, since it is easy to introduce reference leaks by misusing " +"the :c:func:`PyModule_AddObject` function." msgstr "" -#: c-api/module.rst:554 +#: c-api/module.rst:598 msgid "" "Unlike other functions that steal references, ``PyModule_AddObject()`` only " "releases the reference to *value* **on success**." msgstr "" -#: c-api/module.rst:557 +#: c-api/module.rst:601 msgid "" "This means that its return value must be checked, and calling code must :c:" -"func:`Py_DECREF` *value* manually on error." +"func:`Py_XDECREF` *value* manually on error." msgstr "" -#: c-api/module.rst:562 +#: c-api/module.rst:606 msgid "" -"static int\n" -"add_spam(PyObject *module, int value)\n" -"{\n" -" PyObject *obj = PyLong_FromLong(value);\n" -" if (obj == NULL) {\n" -" return -1;\n" -" }\n" -" if (PyModule_AddObject(module, \"spam\", obj) < 0) {\n" -" Py_DECREF(obj);\n" -" return -1;\n" -" }\n" -" // PyModule_AddObject() stole a reference to obj:\n" -" // Py_DECREF(obj) is not needed here\n" -" return 0;\n" -"}" +"PyObject *obj = PyBytes_FromString(value);\n" +"if (PyModule_AddObject(module, \"spam\", obj) < 0) {\n" +" // If 'obj' is not NULL and PyModule_AddObject() failed,\n" +" // 'obj' strong reference must be deleted with Py_XDECREF().\n" +" // If 'obj' is NULL, Py_XDECREF() does nothing.\n" +" Py_XDECREF(obj);\n" +" goto error;\n" +"}\n" +"// PyModule_AddObject() stole a reference to obj:\n" +"// Py_XDECREF(obj) is not needed here." msgstr "" -#: c-api/module.rst:581 -msgid "" -"static int\n" -"add_spam(PyObject *module, int value)\n" -"{\n" -" PyObject *obj = PyLong_FromLong(value);\n" -" if (PyModule_AddObject(module, \"spam\", obj) < 0) {\n" -" Py_XDECREF(obj);\n" -" return -1;\n" -" }\n" -" // PyModule_AddObject() stole a reference to obj:\n" -" // Py_DECREF(obj) is not needed here\n" -" return 0;\n" -"}" +#: c-api/module.rst:619 +msgid ":c:func:`PyModule_AddObject` is :term:`soft deprecated`." msgstr "" -#: c-api/module.rst:600 +#: c-api/module.rst:624 msgid "" "Add an integer constant to *module* as *name*. This convenience function " "can be used from the module's initialization function. Return ``-1`` with an " "exception set on error, ``0`` on success." msgstr "" -#: c-api/module.rst:604 +#: c-api/module.rst:628 msgid "" "This is a convenience function that calls :c:func:`PyLong_FromLong` and :c:" "func:`PyModule_AddObjectRef`; see their documentation for details." msgstr "" -#: c-api/module.rst:610 +#: c-api/module.rst:634 msgid "" "Add a string constant to *module* as *name*. This convenience function can " "be used from the module's initialization function. The string *value* must " @@ -690,14 +717,14 @@ msgid "" "on success." msgstr "" -#: c-api/module.rst:615 +#: c-api/module.rst:639 msgid "" "This is a convenience function that calls :c:func:" "`PyUnicode_InternFromString` and :c:func:`PyModule_AddObjectRef`; see their " "documentation for details." msgstr "" -#: c-api/module.rst:622 +#: c-api/module.rst:646 msgid "" "Add an int constant to *module*. The name and the value are taken from " "*macro*. For example ``PyModule_AddIntMacro(module, AF_INET)`` adds the int " @@ -705,11 +732,11 @@ msgid "" "with an exception set on error, ``0`` on success." msgstr "" -#: c-api/module.rst:630 +#: c-api/module.rst:654 msgid "Add a string constant to *module*." msgstr "" -#: c-api/module.rst:634 +#: c-api/module.rst:658 msgid "" "Add a type object to *module*. The type object is finalized by calling " "internally :c:func:`PyType_Ready`. The name of the type object is taken from " @@ -717,25 +744,36 @@ msgid "" "``-1`` with an exception set on error, ``0`` on success." msgstr "" -#: c-api/module.rst:644 +#: c-api/module.rst:668 +msgid "" +"Indicate that *module* does or does not support running without the global " +"interpreter lock (GIL), using one of the values from :c:macro:`Py_mod_gil`. " +"It must be called during *module*'s initialization function. If this " +"function is not called during module initialization, the import machinery " +"assumes the module does not support running without the GIL. This function " +"is only available in Python builds configured with :option:`--disable-gil`. " +"Return ``-1`` with an exception set on error, ``0`` on success." +msgstr "" + +#: c-api/module.rst:681 msgid "Module lookup" msgstr "" -#: c-api/module.rst:646 +#: c-api/module.rst:683 msgid "" "Single-phase initialization creates singleton modules that can be looked up " "in the context of the current interpreter. This allows the module object to " "be retrieved later with only a reference to the module definition." msgstr "" -#: c-api/module.rst:650 +#: c-api/module.rst:687 msgid "" "These functions will not work on modules created using multi-phase " "initialization, since multiple such modules can be created from a single " "definition." msgstr "" -#: c-api/module.rst:655 +#: c-api/module.rst:692 msgid "" "Returns the module object that was created from *def* for the current " "interpreter. This method requires that the module object has been attached " @@ -744,18 +782,18 @@ msgid "" "to the interpreter state yet, it returns ``NULL``." msgstr "" -#: c-api/module.rst:662 +#: c-api/module.rst:699 msgid "" "Attaches the module object passed to the function to the interpreter state. " "This allows the module object to be accessible via :c:func:" "`PyState_FindModule`." msgstr "" -#: c-api/module.rst:665 +#: c-api/module.rst:702 msgid "Only effective on modules created using single-phase initialization." msgstr "" -#: c-api/module.rst:667 +#: c-api/module.rst:704 msgid "" "Python calls ``PyState_AddModule`` automatically after importing a module, " "so it is unnecessary (but harmless) to call it from module initialization " @@ -766,15 +804,15 @@ msgid "" "state updates)." msgstr "" -#: c-api/module.rst:686 +#: c-api/module.rst:723 msgid "The caller must hold the GIL." msgstr "" -#: c-api/module.rst:677 +#: c-api/module.rst:714 msgid "Return ``-1`` with an exception set on error, ``0`` on success." msgstr "" -#: c-api/module.rst:683 +#: c-api/module.rst:720 msgid "" "Removes the module object created from *def* from the interpreter state. " "Return ``-1`` with an exception set on error, ``0`` on success." diff --git a/c-api/monitoring.po b/c-api/monitoring.po new file mode 100644 index 00000000..30580af1 --- /dev/null +++ b/c-api/monitoring.po @@ -0,0 +1,294 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) 2001-2025, Python Software Foundation +# This file is distributed under the same license as the Python package. +# FIRST AUTHOR , YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: Python 3.13\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#: c-api/monitoring.rst:6 +msgid "Monitoring C API" +msgstr "" + +#: c-api/monitoring.rst:8 +msgid "Added in version 3.13." +msgstr "" + +#: c-api/monitoring.rst:10 +msgid "" +"An extension may need to interact with the event monitoring system. " +"Subscribing to events and registering callbacks can be done via the Python " +"API exposed in :mod:`sys.monitoring`." +msgstr "" + +#: c-api/monitoring.rst:15 +msgid "Generating Execution Events" +msgstr "" + +#: c-api/monitoring.rst:17 +msgid "" +"The functions below make it possible for an extension to fire monitoring " +"events as it emulates the execution of Python code. Each of these functions " +"accepts a ``PyMonitoringState`` struct which contains concise information " +"about the activation state of events, as well as the event arguments, which " +"include a ``PyObject*`` representing the code object, the instruction offset " +"and sometimes additional, event-specific arguments (see :mod:`sys." +"monitoring` for details about the signatures of the different event " +"callbacks). The ``codelike`` argument should be an instance of :class:`types." +"CodeType` or of a type that emulates it." +msgstr "" + +#: c-api/monitoring.rst:27 +msgid "" +"The VM disables tracing when firing an event, so there is no need for user " +"code to do that." +msgstr "" + +#: c-api/monitoring.rst:30 +msgid "" +"Monitoring functions should not be called with an exception set, except " +"those listed below as working with the current exception." +msgstr "" + +#: c-api/monitoring.rst:35 +msgid "" +"Representation of the state of an event type. It is allocated by the user " +"while its contents are maintained by the monitoring API functions described " +"below." +msgstr "" + +#: c-api/monitoring.rst:39 +msgid "" +"All of the functions below return 0 on success and -1 (with an exception " +"set) on error." +msgstr "" + +#: c-api/monitoring.rst:41 +msgid "See :mod:`sys.monitoring` for descriptions of the events." +msgstr "" + +#: c-api/monitoring.rst:45 +msgid "Fire a ``PY_START`` event." +msgstr "" + +#: c-api/monitoring.rst:50 +msgid "Fire a ``PY_RESUME`` event." +msgstr "" + +#: c-api/monitoring.rst:55 +msgid "Fire a ``PY_RETURN`` event." +msgstr "" + +#: c-api/monitoring.rst:60 +msgid "Fire a ``PY_YIELD`` event." +msgstr "" + +#: c-api/monitoring.rst:65 +msgid "Fire a ``CALL`` event." +msgstr "" + +#: c-api/monitoring.rst:70 +msgid "Fire a ``LINE`` event." +msgstr "" + +#: c-api/monitoring.rst:75 +msgid "Fire a ``JUMP`` event." +msgstr "" + +#: c-api/monitoring.rst:80 +msgid "Fire a ``BRANCH`` event." +msgstr "" + +#: c-api/monitoring.rst:85 +msgid "Fire a ``C_RETURN`` event." +msgstr "" + +#: c-api/monitoring.rst:90 +msgid "" +"Fire a ``PY_THROW`` event with the current exception (as returned by :c:func:" +"`PyErr_GetRaisedException`)." +msgstr "" + +#: c-api/monitoring.rst:96 +msgid "" +"Fire a ``RAISE`` event with the current exception (as returned by :c:func:" +"`PyErr_GetRaisedException`)." +msgstr "" + +#: c-api/monitoring.rst:102 +msgid "" +"Fire a ``C_RAISE`` event with the current exception (as returned by :c:func:" +"`PyErr_GetRaisedException`)." +msgstr "" + +#: c-api/monitoring.rst:108 +msgid "" +"Fire a ``RERAISE`` event with the current exception (as returned by :c:func:" +"`PyErr_GetRaisedException`)." +msgstr "" + +#: c-api/monitoring.rst:114 +msgid "" +"Fire an ``EXCEPTION_HANDLED`` event with the current exception (as returned " +"by :c:func:`PyErr_GetRaisedException`)." +msgstr "" + +#: c-api/monitoring.rst:120 +msgid "" +"Fire a ``PY_UNWIND`` event with the current exception (as returned by :c:" +"func:`PyErr_GetRaisedException`)." +msgstr "" + +#: c-api/monitoring.rst:126 +msgid "" +"Fire a ``STOP_ITERATION`` event. If ``value`` is an instance of :exc:" +"`StopIteration`, it is used. Otherwise, a new :exc:`StopIteration` instance " +"is created with ``value`` as its argument." +msgstr "" + +#: c-api/monitoring.rst:131 +msgid "Managing the Monitoring State" +msgstr "" + +#: c-api/monitoring.rst:133 +msgid "" +"Monitoring states can be managed with the help of monitoring scopes. A scope " +"would typically correspond to a python function." +msgstr "" + +#: c-api/monitoring.rst:138 +msgid "" +"Enter a monitored scope. ``event_types`` is an array of the event IDs for " +"events that may be fired from the scope. For example, the ID of a " +"``PY_START`` event is the value ``PY_MONITORING_EVENT_PY_START``, which is " +"numerically equal to the base-2 logarithm of ``sys.monitoring.events." +"PY_START``. ``state_array`` is an array with a monitoring state entry for " +"each event in ``event_types``, it is allocated by the user but populated by :" +"c:func:`!PyMonitoring_EnterScope` with information about the activation " +"state of the event. The size of ``event_types`` (and hence also of " +"``state_array``) is given in ``length``." +msgstr "" + +#: c-api/monitoring.rst:148 +msgid "" +"The ``version`` argument is a pointer to a value which should be allocated " +"by the user together with ``state_array`` and initialized to 0, and then set " +"only by :c:func:`!PyMonitoring_EnterScope` itself. It allows this function " +"to determine whether event states have changed since the previous call, and " +"to return quickly if they have not." +msgstr "" + +#: c-api/monitoring.rst:154 +msgid "" +"The scopes referred to here are lexical scopes: a function, class or " +"method. :c:func:`!PyMonitoring_EnterScope` should be called whenever the " +"lexical scope is entered. Scopes can be reentered, reusing the same " +"*state_array* and *version*, in situations like when emulating a recursive " +"Python function. When a code-like's execution is paused, such as when " +"emulating a generator, the scope needs to be exited and re-entered." +msgstr "" + +#: c-api/monitoring.rst:161 +msgid "The macros for *event_types* are:" +msgstr "" + +#: c-api/monitoring.rst:169 +msgid "Macro" +msgstr "" + +#: c-api/monitoring.rst:169 +msgid "Event" +msgstr "" + +#: c-api/monitoring.rst:171 +msgid ":monitoring-event:`BRANCH`" +msgstr "" + +#: c-api/monitoring.rst:172 +msgid ":monitoring-event:`CALL`" +msgstr "" + +#: c-api/monitoring.rst:173 +msgid ":monitoring-event:`C_RAISE`" +msgstr "" + +#: c-api/monitoring.rst:174 +msgid ":monitoring-event:`C_RETURN`" +msgstr "" + +#: c-api/monitoring.rst:175 +msgid ":monitoring-event:`EXCEPTION_HANDLED`" +msgstr "" + +#: c-api/monitoring.rst:176 +msgid ":monitoring-event:`INSTRUCTION`" +msgstr "" + +#: c-api/monitoring.rst:177 +msgid ":monitoring-event:`JUMP`" +msgstr "" + +#: c-api/monitoring.rst:178 +msgid ":monitoring-event:`LINE`" +msgstr "" + +#: c-api/monitoring.rst:179 +msgid ":monitoring-event:`PY_RESUME`" +msgstr "" + +#: c-api/monitoring.rst:180 +msgid ":monitoring-event:`PY_RETURN`" +msgstr "" + +#: c-api/monitoring.rst:181 +msgid ":monitoring-event:`PY_START`" +msgstr "" + +#: c-api/monitoring.rst:182 +msgid ":monitoring-event:`PY_THROW`" +msgstr "" + +#: c-api/monitoring.rst:183 +msgid ":monitoring-event:`PY_UNWIND`" +msgstr "" + +#: c-api/monitoring.rst:184 +msgid ":monitoring-event:`PY_YIELD`" +msgstr "" + +#: c-api/monitoring.rst:185 +msgid ":monitoring-event:`RAISE`" +msgstr "" + +#: c-api/monitoring.rst:186 +msgid ":monitoring-event:`RERAISE`" +msgstr "" + +#: c-api/monitoring.rst:187 +msgid ":monitoring-event:`STOP_ITERATION`" +msgstr "" + +#: c-api/monitoring.rst:192 +msgid "" +"Exit the last scope that was entered with :c:func:`!PyMonitoring_EnterScope`." +msgstr "" + +#: c-api/monitoring.rst:197 +msgid "" +"Return true if the event corresponding to the event ID *ev* is a :ref:`local " +"event `." +msgstr "" + +#: c-api/monitoring.rst:204 +msgid "This function is :term:`soft deprecated`." +msgstr "" diff --git a/c-api/none.po b/c-api/none.po index d4a45f06..b049c4a3 100644 --- a/c-api/none.po +++ b/c-api/none.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -32,11 +32,11 @@ msgstr "" #: c-api/none.rst:18 msgid "" "The Python ``None`` object, denoting lack of value. This object has no " -"methods and is `immortal `_." +"methods and is :term:`immortal`." msgstr "" #: c-api/none.rst:21 -msgid ":c:data:`Py_None` is immortal." +msgid ":c:data:`Py_None` is :term:`immortal`." msgstr "" #: c-api/none.rst:26 diff --git a/c-api/number.po b/c-api/number.po index 10fa1bae..70328478 100644 --- a/c-api/number.po +++ b/c-api/number.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" diff --git a/c-api/object.po b/c-api/object.po index b0e0ae83..35509fa1 100644 --- a/c-api/object.po +++ b/c-api/object.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -22,26 +22,149 @@ msgid "Object Protocol" msgstr "" #: c-api/object.rst:11 +msgid "Get a :term:`strong reference` to a constant." +msgstr "" + +#: c-api/object.rst:13 +msgid "Set an exception and return ``NULL`` if *constant_id* is invalid." +msgstr "" + +#: c-api/object.rst:15 +msgid "*constant_id* must be one of these constant identifiers:" +msgstr "" + +#: c-api/object.rst:20 +msgid "Constant Identifier" +msgstr "" + +#: c-api/object.rst:20 +msgid "Value" +msgstr "" + +#: c-api/object.rst:20 +msgid "Returned object" +msgstr "" + +#: c-api/object.rst:27 +msgid "``0``" +msgstr "" + +#: c-api/object.rst:22 +msgid ":py:data:`None`" +msgstr "" + +#: c-api/object.rst:28 +msgid "``1``" +msgstr "" + +#: c-api/object.rst:23 +msgid ":py:data:`False`" +msgstr "" + +#: c-api/object.rst:24 +msgid "``2``" +msgstr "" + +#: c-api/object.rst:24 +msgid ":py:data:`True`" +msgstr "" + +#: c-api/object.rst:25 +msgid "``3``" +msgstr "" + +#: c-api/object.rst:25 +msgid ":py:data:`Ellipsis`" +msgstr "" + +#: c-api/object.rst:26 +msgid "``4``" +msgstr "" + +#: c-api/object.rst:26 +msgid ":py:data:`NotImplemented`" +msgstr "" + +#: c-api/object.rst:27 +msgid "``5``" +msgstr "" + +#: c-api/object.rst:28 +msgid "``6``" +msgstr "" + +#: c-api/object.rst:29 +msgid "``7``" +msgstr "" + +#: c-api/object.rst:29 +msgid "``''``" +msgstr "" + +#: c-api/object.rst:30 +msgid "``8``" +msgstr "" + +#: c-api/object.rst:30 +msgid "``b''``" +msgstr "" + +#: c-api/object.rst:31 +msgid "``9``" +msgstr "" + +#: c-api/object.rst:31 +msgid "``()``" +msgstr "" + +#: c-api/object.rst:34 +msgid "" +"Numeric values are only given for projects which cannot use the constant " +"identifiers." +msgstr "" + +#: c-api/object.rst:42 +msgid "In CPython, all of these constants are :term:`immortal`." +msgstr "" + +#: c-api/object.rst:47 +msgid "" +"Similar to :c:func:`Py_GetConstant`, but return a :term:`borrowed reference`." +msgstr "" + +#: c-api/object.rst:50 +msgid "" +"This function is primarily intended for backwards compatibility: using :c:" +"func:`Py_GetConstant` is recommended for new code." +msgstr "" + +#: c-api/object.rst:53 +msgid "" +"The reference is borrowed from the interpreter, and is valid until the " +"interpreter finalization." +msgstr "" + +#: c-api/object.rst:61 msgid "" "The ``NotImplemented`` singleton, used to signal that an operation is not " "implemented for the given type combination." msgstr "" -#: c-api/object.rst:17 +#: c-api/object.rst:67 msgid "" "Properly handle returning :c:data:`Py_NotImplemented` from within a C " "function (that is, create a new :term:`strong reference` to :const:" "`NotImplemented` and return it)." msgstr "" -#: c-api/object.rst:24 +#: c-api/object.rst:74 msgid "" "Flag to be used with multiple functions that print the object (like :c:func:" "`PyObject_Print` and :c:func:`PyFile_WriteObject`). If passed, these " "function would use the :func:`str` of the object instead of the :func:`repr`." msgstr "" -#: c-api/object.rst:32 +#: c-api/object.rst:82 msgid "" "Print an object *o*, on file *fp*. Returns ``-1`` on error. The flags " "argument is used to enable certain printing options. The only option " @@ -49,50 +172,100 @@ msgid "" "the object is written instead of the :func:`repr`." msgstr "" -#: c-api/object.rst:40 +#: c-api/object.rst:90 +msgid "" +"Returns ``1`` if *o* has the attribute *attr_name*, and ``0`` otherwise. " +"This is equivalent to the Python expression ``hasattr(o, attr_name)``. On " +"failure, return ``-1``." +msgstr "" + +#: c-api/object.rst:99 +msgid "" +"This is the same as :c:func:`PyObject_HasAttrWithError`, but *attr_name* is " +"specified as a :c:expr:`const char*` UTF-8 encoded bytes string, rather than " +"a :c:expr:`PyObject*`." +msgstr "" + +#: c-api/object.rst:108 msgid "" -"Returns ``1`` if *o* has the attribute *attr_name*, and ``0`` otherwise. " -"This is equivalent to the Python expression ``hasattr(o, attr_name)``. This " -"function always succeeds." +"Returns ``1`` if *o* has the attribute *attr_name*, and ``0`` otherwise. " +"This function always succeeds." msgstr "" -#: c-api/object.rst:46 +#: c-api/object.rst:113 msgid "" "Exceptions that occur when this calls :meth:`~object.__getattr__` and :meth:" -"`~object.__getattribute__` methods are silently ignored. For proper error " -"handling, use :c:func:`PyObject_GetAttr` instead." +"`~object.__getattribute__` methods aren't propagated, but instead given to :" +"func:`sys.unraisablehook`. For proper error handling, use :c:func:" +"`PyObject_HasAttrWithError`, :c:func:`PyObject_GetOptionalAttr` or :c:func:" +"`PyObject_GetAttr` instead." msgstr "" -#: c-api/object.rst:53 +#: c-api/object.rst:122 msgid "" "This is the same as :c:func:`PyObject_HasAttr`, but *attr_name* is specified " "as a :c:expr:`const char*` UTF-8 encoded bytes string, rather than a :c:expr:" "`PyObject*`." msgstr "" -#: c-api/object.rst:59 +#: c-api/object.rst:128 msgid "" "Exceptions that occur when this calls :meth:`~object.__getattr__` and :meth:" "`~object.__getattribute__` methods or while creating the temporary :class:" "`str` object are silently ignored. For proper error handling, use :c:func:" -"`PyObject_GetAttrString` instead." +"`PyObject_HasAttrStringWithError`, :c:func:`PyObject_GetOptionalAttrString` " +"or :c:func:`PyObject_GetAttrString` instead." msgstr "" -#: c-api/object.rst:67 +#: c-api/object.rst:138 msgid "" "Retrieve an attribute named *attr_name* from object *o*. Returns the " "attribute value on success, or ``NULL`` on failure. This is the equivalent " "of the Python expression ``o.attr_name``." msgstr "" -#: c-api/object.rst:74 +#: c-api/object.rst:142 +msgid "" +"If the missing attribute should not be treated as a failure, you can use :c:" +"func:`PyObject_GetOptionalAttr` instead." +msgstr "" + +#: c-api/object.rst:148 msgid "" "This is the same as :c:func:`PyObject_GetAttr`, but *attr_name* is specified " "as a :c:expr:`const char*` UTF-8 encoded bytes string, rather than a :c:expr:" "`PyObject*`." msgstr "" -#: c-api/object.rst:81 +#: c-api/object.rst:152 +msgid "" +"If the missing attribute should not be treated as a failure, you can use :c:" +"func:`PyObject_GetOptionalAttrString` instead." +msgstr "" + +#: c-api/object.rst:158 +msgid "" +"Variant of :c:func:`PyObject_GetAttr` which doesn't raise :exc:" +"`AttributeError` if the attribute is not found." +msgstr "" + +#: c-api/object.rst:161 +msgid "" +"If the attribute is found, return ``1`` and set *\\*result* to a new :term:" +"`strong reference` to the attribute. If the attribute is not found, return " +"``0`` and set *\\*result* to ``NULL``; the :exc:`AttributeError` is " +"silenced. If an error other than :exc:`AttributeError` is raised, return " +"``-1`` and set *\\*result* to ``NULL``." +msgstr "" + +#: c-api/object.rst:173 +msgid "" +"This is the same as :c:func:`PyObject_GetOptionalAttr`, but *attr_name* is " +"specified as a :c:expr:`const char*` UTF-8 encoded bytes string, rather than " +"a :c:expr:`PyObject*`." +msgstr "" + +#: c-api/object.rst:181 msgid "" "Generic attribute getter function that is meant to be put into a type " "object's ``tp_getattro`` slot. It looks for a descriptor in the dictionary " @@ -102,34 +275,34 @@ msgid "" "descriptors don't. Otherwise, an :exc:`AttributeError` is raised." msgstr "" -#: c-api/object.rst:91 +#: c-api/object.rst:191 msgid "" "Set the value of the attribute named *attr_name*, for object *o*, to the " "value *v*. Raise an exception and return ``-1`` on failure; return ``0`` on " "success. This is the equivalent of the Python statement ``o.attr_name = v``." msgstr "" -#: c-api/object.rst:96 +#: c-api/object.rst:196 msgid "" "If *v* is ``NULL``, the attribute is deleted. This behaviour is deprecated " "in favour of using :c:func:`PyObject_DelAttr`, but there are currently no " "plans to remove it." msgstr "" -#: c-api/object.rst:103 +#: c-api/object.rst:203 msgid "" "This is the same as :c:func:`PyObject_SetAttr`, but *attr_name* is specified " "as a :c:expr:`const char*` UTF-8 encoded bytes string, rather than a :c:expr:" "`PyObject*`." msgstr "" -#: c-api/object.rst:107 +#: c-api/object.rst:207 msgid "" "If *v* is ``NULL``, the attribute is deleted, but this feature is deprecated " "in favour of using :c:func:`PyObject_DelAttrString`." msgstr "" -#: c-api/object.rst:110 +#: c-api/object.rst:210 msgid "" "The number of different attribute names passed to this function should be " "kept small, usually by using a statically allocated string as *attr_name*. " @@ -139,7 +312,7 @@ msgid "" "internally to create a key object." msgstr "" -#: c-api/object.rst:120 +#: c-api/object.rst:220 msgid "" "Generic attribute setter and deleter function that is meant to be put into a " "type object's :c:member:`~PyTypeObject.tp_setattro` slot. It looks for a " @@ -151,20 +324,20 @@ msgid "" "returned." msgstr "" -#: c-api/object.rst:132 +#: c-api/object.rst:232 msgid "" "Delete attribute named *attr_name*, for object *o*. Returns ``-1`` on " "failure. This is the equivalent of the Python statement ``del o.attr_name``." msgstr "" -#: c-api/object.rst:138 +#: c-api/object.rst:238 msgid "" "This is the same as :c:func:`PyObject_DelAttr`, but *attr_name* is specified " "as a :c:expr:`const char*` UTF-8 encoded bytes string, rather than a :c:expr:" "`PyObject*`." msgstr "" -#: c-api/object.rst:142 +#: c-api/object.rst:242 msgid "" "The number of different attribute names passed to this function should be " "kept small, usually by using a statically allocated string as *attr_name*. " @@ -174,13 +347,13 @@ msgid "" "internally to create a key object for lookup." msgstr "" -#: c-api/object.rst:153 +#: c-api/object.rst:253 msgid "" "A generic implementation for the getter of a ``__dict__`` descriptor. It " "creates the dictionary if necessary." msgstr "" -#: c-api/object.rst:156 +#: c-api/object.rst:256 msgid "" "This function may also be called to get the :py:attr:`~object.__dict__` of " "the object *o*. Pass ``NULL`` for *context* when calling it. Since this " @@ -189,30 +362,30 @@ msgid "" "the object." msgstr "" -#: c-api/object.rst:162 +#: c-api/object.rst:262 msgid "On failure, returns ``NULL`` with an exception set." msgstr "" -#: c-api/object.rst:169 +#: c-api/object.rst:269 msgid "" "A generic implementation for the setter of a ``__dict__`` descriptor. This " "implementation does not allow the dictionary to be deleted." msgstr "" -#: c-api/object.rst:177 +#: c-api/object.rst:277 msgid "" "Return a pointer to :py:attr:`~object.__dict__` of the object *obj*. If " "there is no ``__dict__``, return ``NULL`` without setting an exception." msgstr "" -#: c-api/object.rst:180 +#: c-api/object.rst:280 msgid "" "This function may need to allocate memory for the dictionary, so it may be " "more efficient to call :c:func:`PyObject_GetAttr` when accessing an " "attribute on the object." msgstr "" -#: c-api/object.rst:187 +#: c-api/object.rst:287 msgid "" "Compare the values of *o1* and *o2* using the operation specified by *opid*, " "which must be one of :c:macro:`Py_LT`, :c:macro:`Py_LE`, :c:macro:`Py_EQ`, :" @@ -223,33 +396,33 @@ msgid "" "success, or ``NULL`` on failure." msgstr "" -#: c-api/object.rst:197 +#: c-api/object.rst:297 msgid "" "Compare the values of *o1* and *o2* using the operation specified by *opid*, " "like :c:func:`PyObject_RichCompare`, but returns ``-1`` on error, ``0`` if " "the result is false, ``1`` otherwise." msgstr "" -#: c-api/object.rst:202 +#: c-api/object.rst:302 msgid "" "If *o1* and *o2* are the same object, :c:func:`PyObject_RichCompareBool` " "will always return ``1`` for :c:macro:`Py_EQ` and ``0`` for :c:macro:`Py_NE`." msgstr "" -#: c-api/object.rst:207 +#: c-api/object.rst:307 msgid "" "Format *obj* using *format_spec*. This is equivalent to the Python " "expression ``format(obj, format_spec)``." msgstr "" -#: c-api/object.rst:210 +#: c-api/object.rst:310 msgid "" "*format_spec* may be ``NULL``. In this case the call is equivalent to " "``format(obj)``. Returns the formatted string on success, ``NULL`` on " "failure." msgstr "" -#: c-api/object.rst:218 +#: c-api/object.rst:318 msgid "" "Compute a string representation of object *o*. Returns the string " "representation on success, ``NULL`` on failure. This is the equivalent of " @@ -257,13 +430,13 @@ msgid "" "function." msgstr "" -#: c-api/object.rst:246 +#: c-api/object.rst:346 msgid "" "This function now includes a debug assertion to help ensure that it does not " "silently discard an active exception." msgstr "" -#: c-api/object.rst:230 +#: c-api/object.rst:330 msgid "" "As :c:func:`PyObject_Repr`, compute a string representation of object *o*, " "but escape the non-ASCII characters in the string returned by :c:func:" @@ -272,7 +445,7 @@ msgid "" "Called by the :func:`ascii` built-in function." msgstr "" -#: c-api/object.rst:241 +#: c-api/object.rst:341 msgid "" "Compute a string representation of object *o*. Returns the string " "representation on success, ``NULL`` on failure. This is the equivalent of " @@ -280,7 +453,7 @@ msgid "" "function and, therefore, by the :func:`print` function." msgstr "" -#: c-api/object.rst:255 +#: c-api/object.rst:355 msgid "" "Compute a bytes representation of object *o*. ``NULL`` is returned on " "failure and a bytes object on success. This is equivalent to the Python " @@ -289,20 +462,20 @@ msgid "" "bytes object." msgstr "" -#: c-api/object.rst:264 +#: c-api/object.rst:364 msgid "" "Return ``1`` if the class *derived* is identical to or derived from the " "class *cls*, otherwise return ``0``. In case of an error, return ``-1``." msgstr "" -#: c-api/object.rst:286 +#: c-api/object.rst:386 msgid "" "If *cls* is a tuple, the check will be done against every entry in *cls*. " "The result will be ``1`` when at least one of the checks returns ``1``, " "otherwise it will be ``0``." msgstr "" -#: c-api/object.rst:271 +#: c-api/object.rst:371 msgid "" "If *cls* has a :meth:`~type.__subclasscheck__` method, it will be called to " "determine the subclass status as described in :pep:`3119`. Otherwise, " @@ -310,52 +483,52 @@ msgid "" "e. contained in :attr:`cls.__mro__ `." msgstr "" -#: c-api/object.rst:276 +#: c-api/object.rst:376 msgid "" "Normally only class objects, i.e. instances of :class:`type` or a derived " "class, are considered classes. However, objects can override this by having " "a :attr:`~type.__bases__` attribute (which must be a tuple of base classes)." msgstr "" -#: c-api/object.rst:283 +#: c-api/object.rst:383 msgid "" "Return ``1`` if *inst* is an instance of the class *cls* or a subclass of " "*cls*, or ``0`` if not. On error, returns ``-1`` and sets an exception." msgstr "" -#: c-api/object.rst:290 +#: c-api/object.rst:390 msgid "" "If *cls* has a :meth:`~type.__instancecheck__` method, it will be called to " "determine the subclass status as described in :pep:`3119`. Otherwise, " "*inst* is an instance of *cls* if its class is a subclass of *cls*." msgstr "" -#: c-api/object.rst:294 +#: c-api/object.rst:394 msgid "" "An instance *inst* can override what is considered its class by having a :" "attr:`~object.__class__` attribute." msgstr "" -#: c-api/object.rst:297 +#: c-api/object.rst:397 msgid "" "An object *cls* can override if it is considered a class, and what its base " "classes are, by having a :attr:`~type.__bases__` attribute (which must be a " "tuple of base classes)." msgstr "" -#: c-api/object.rst:306 +#: c-api/object.rst:406 msgid "" "Compute and return the hash value of an object *o*. On failure, return " "``-1``. This is the equivalent of the Python expression ``hash(o)``." msgstr "" -#: c-api/object.rst:309 +#: c-api/object.rst:409 msgid "" "The return type is now Py_hash_t. This is a signed integer the same size " "as :c:type:`Py_ssize_t`." msgstr "" -#: c-api/object.rst:316 +#: c-api/object.rst:416 msgid "" "Set a :exc:`TypeError` indicating that ``type(o)`` is not :term:`hashable` " "and return ``-1``. This function receives special treatment when stored in a " @@ -363,21 +536,21 @@ msgid "" "that it is not hashable." msgstr "" -#: c-api/object.rst:324 +#: c-api/object.rst:424 msgid "" "Returns ``1`` if the object *o* is considered to be true, and ``0`` " "otherwise. This is equivalent to the Python expression ``not not o``. On " "failure, return ``-1``." msgstr "" -#: c-api/object.rst:331 +#: c-api/object.rst:431 msgid "" "Returns ``0`` if the object *o* is considered to be true, and ``1`` " "otherwise. This is equivalent to the Python expression ``not o``. On " "failure, return ``-1``." msgstr "" -#: c-api/object.rst:340 +#: c-api/object.rst:440 msgid "" "When *o* is non-``NULL``, returns a type object corresponding to the object " "type of object *o*. On failure, raises :exc:`SystemError` and returns " @@ -388,13 +561,13 @@ msgid "" "when a new :term:`strong reference` is needed." msgstr "" -#: c-api/object.rst:352 +#: c-api/object.rst:452 msgid "" "Return non-zero if the object *o* is of type *type* or a subtype of *type*, " "and ``0`` otherwise. Both parameters must be non-``NULL``." msgstr "" -#: c-api/object.rst:361 +#: c-api/object.rst:461 msgid "" "Return the length of object *o*. If the object *o* provides either the " "sequence and mapping protocols, the sequence length is returned. On error, " @@ -402,7 +575,7 @@ msgid "" "``len(o)``." msgstr "" -#: c-api/object.rst:368 +#: c-api/object.rst:468 msgid "" "Return an estimated length for the object *o*. First try to return its " "actual length, then an estimate using :meth:`~object.__length_hint__`, and " @@ -411,33 +584,33 @@ msgid "" "defaultvalue)``." msgstr "" -#: c-api/object.rst:378 +#: c-api/object.rst:478 msgid "" "Return element of *o* corresponding to the object *key* or ``NULL`` on " "failure. This is the equivalent of the Python expression ``o[key]``." msgstr "" -#: c-api/object.rst:384 +#: c-api/object.rst:484 msgid "" "Map the object *key* to the value *v*. Raise an exception and return ``-1`` " "on failure; return ``0`` on success. This is the equivalent of the Python " "statement ``o[key] = v``. This function *does not* steal a reference to *v*." msgstr "" -#: c-api/object.rst:392 +#: c-api/object.rst:492 msgid "" "Remove the mapping for the object *key* from the object *o*. Return ``-1`` " "on failure. This is equivalent to the Python statement ``del o[key]``." msgstr "" -#: c-api/object.rst:398 +#: c-api/object.rst:498 msgid "" "This is the same as :c:func:`PyObject_DelItem`, but *key* is specified as a :" "c:expr:`const char*` UTF-8 encoded bytes string, rather than a :c:expr:" "`PyObject*`." msgstr "" -#: c-api/object.rst:405 +#: c-api/object.rst:505 msgid "" "This is equivalent to the Python expression ``dir(o)``, returning a " "(possibly empty) list of strings appropriate for the object argument, or " @@ -447,7 +620,7 @@ msgid "" "`PyErr_Occurred` will return false." msgstr "" -#: c-api/object.rst:414 +#: c-api/object.rst:514 msgid "" "This is equivalent to the Python expression ``iter(o)``. It returns a new " "iterator for the object argument, or the object itself if the object is " @@ -455,14 +628,14 @@ msgid "" "object cannot be iterated." msgstr "" -#: c-api/object.rst:422 +#: c-api/object.rst:522 msgid "" "This is equivalent to the Python ``__iter__(self): return self`` method. It " "is intended for :term:`iterator` types, to be used in the :c:member:" "`PyTypeObject.tp_iter` slot." msgstr "" -#: c-api/object.rst:428 +#: c-api/object.rst:528 msgid "" "This is the equivalent to the Python expression ``aiter(o)``. Takes an :" "class:`AsyncIterable` object and returns an :class:`AsyncIterator` for it. " @@ -471,88 +644,102 @@ msgid "" "``NULL`` if the object cannot be iterated." msgstr "" -#: c-api/object.rst:438 +#: c-api/object.rst:538 msgid "Get a pointer to subclass-specific data reserved for *cls*." msgstr "" -#: c-api/object.rst:440 +#: c-api/object.rst:540 msgid "" "The object *o* must be an instance of *cls*, and *cls* must have been " "created using negative :c:member:`PyType_Spec.basicsize`. Python does not " "check this." msgstr "" -#: c-api/object.rst:444 +#: c-api/object.rst:544 msgid "On error, set an exception and return ``NULL``." msgstr "" -#: c-api/object.rst:450 +#: c-api/object.rst:550 msgid "" "Return the size of the instance memory space reserved for *cls*, i.e. the " "size of the memory :c:func:`PyObject_GetTypeData` returns." msgstr "" -#: c-api/object.rst:453 +#: c-api/object.rst:553 msgid "" "This may be larger than requested using :c:member:`-PyType_Spec.basicsize " "`; it is safe to use this larger size (e.g. with :c:" "func:`!memset`)." msgstr "" -#: c-api/object.rst:456 +#: c-api/object.rst:556 msgid "" "The type *cls* **must** have been created using negative :c:member:" "`PyType_Spec.basicsize`. Python does not check this." msgstr "" -#: c-api/object.rst:460 +#: c-api/object.rst:560 msgid "On error, set an exception and return a negative value." msgstr "" -#: c-api/object.rst:466 +#: c-api/object.rst:566 msgid "" "Get a pointer to per-item data for a class with :c:macro:" "`Py_TPFLAGS_ITEMS_AT_END`." msgstr "" -#: c-api/object.rst:469 +#: c-api/object.rst:569 msgid "" "On error, set an exception and return ``NULL``. :py:exc:`TypeError` is " "raised if *o* does not have :c:macro:`Py_TPFLAGS_ITEMS_AT_END` set." msgstr "" -#: c-api/object.rst:228 c-api/object.rst:304 c-api/object.rst:359 +#: c-api/object.rst:577 +msgid "Visit the managed dictionary of *obj*." +msgstr "" + +#: c-api/object.rst:588 +msgid "" +"This function must only be called in a traverse function of the type which " +"has the :c:macro:`Py_TPFLAGS_MANAGED_DICT` flag set." +msgstr "" + +#: c-api/object.rst:586 +msgid "Clear the managed dictionary of *obj*." +msgstr "" + +#: c-api/object.rst:328 c-api/object.rst:404 c-api/object.rst:459 msgid "built-in function" msgstr "" -#: c-api/object.rst:216 +#: c-api/object.rst:316 msgid "repr" msgstr "" -#: c-api/object.rst:228 +#: c-api/object.rst:328 msgid "ascii" msgstr "" -#: c-api/object.rst:236 +#: c-api/object.rst:336 msgid "string" msgstr "" -#: c-api/object.rst:236 +#: c-api/object.rst:336 msgid "PyObject_Str (C function)" msgstr "" -#: c-api/object.rst:253 +#: c-api/object.rst:353 msgid "bytes" msgstr "" -#: c-api/object.rst:304 +#: c-api/object.rst:404 msgid "hash" msgstr "" -#: c-api/object.rst:338 +#: c-api/object.rst:438 msgid "type" msgstr "" -#: c-api/object.rst:359 +#: c-api/object.rst:459 msgid "len" msgstr "" diff --git a/c-api/objimpl.po b/c-api/objimpl.po index 54f02d5b..09257b92 100644 --- a/c-api/objimpl.po +++ b/c-api/objimpl.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" diff --git a/c-api/perfmaps.po b/c-api/perfmaps.po index d3580871..3b68dacb 100644 --- a/c-api/perfmaps.po +++ b/c-api/perfmaps.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" diff --git a/c-api/refcounting.po b/c-api/refcounting.po index 5a64bc5f..466542df 100644 --- a/c-api/refcounting.po +++ b/c-api/refcounting.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -34,10 +34,10 @@ msgstr "" #: c-api/refcounting.rst:18 msgid "" "Note that the returned value may not actually reflect how many references to " -"the object are actually held. For example, some objects are \"immortal\" " -"and have a very high refcount that does not reflect the actual number of " -"references. Consequently, do not rely on the returned value to be accurate, " -"other than a value of 0 or 1." +"the object are actually held. For example, some objects are :term:" +"`immortal` and have a very high refcount that does not reflect the actual " +"number of references. Consequently, do not rely on the returned value to be " +"accurate, other than a value of 0 or 1." msgstr "" #: c-api/refcounting.rst:24 @@ -59,133 +59,137 @@ msgstr "" #: c-api/refcounting.rst:37 msgid "" -"Note that this function has no effect on `immortal `_ objects." +"On :ref:`Python build with Free Threading `, if " +"*refcnt* is larger than ``UINT32_MAX``, the object is made :term:`immortal`." msgstr "" -#: c-api/refcounting.rst:65 c-api/refcounting.rst:142 +#: c-api/refcounting.rst:53 c-api/refcounting.rst:119 +msgid "This function has no effect on :term:`immortal` objects." +msgstr "" + +#: c-api/refcounting.rst:68 c-api/refcounting.rst:147 msgid "Immortal objects are not modified." msgstr "" -#: c-api/refcounting.rst:49 +#: c-api/refcounting.rst:50 msgid "" "Indicate taking a new :term:`strong reference` to object *o*, indicating it " "is in use and should not be destroyed." msgstr "" -#: c-api/refcounting.rst:52 +#: c-api/refcounting.rst:55 msgid "" "This function is usually used to convert a :term:`borrowed reference` to a :" "term:`strong reference` in-place. The :c:func:`Py_NewRef` function can be " "used to create a new :term:`strong reference`." msgstr "" -#: c-api/refcounting.rst:56 -msgid "When done using the object, release it by calling :c:func:`Py_DECREF`." +#: c-api/refcounting.rst:59 +msgid "When done using the object, release is by calling :c:func:`Py_DECREF`." msgstr "" -#: c-api/refcounting.rst:58 +#: c-api/refcounting.rst:61 msgid "" "The object must not be ``NULL``; if you aren't sure that it isn't ``NULL``, " "use :c:func:`Py_XINCREF`." msgstr "" -#: c-api/refcounting.rst:61 +#: c-api/refcounting.rst:64 msgid "" "Do not expect this function to actually modify *o* in any way. For at least :" "pep:`some objects <0683>`, this function has no effect." msgstr "" -#: c-api/refcounting.rst:71 +#: c-api/refcounting.rst:74 msgid "" "Similar to :c:func:`Py_INCREF`, but the object *o* can be ``NULL``, in which " "case this has no effect." msgstr "" -#: c-api/refcounting.rst:74 +#: c-api/refcounting.rst:77 msgid "See also :c:func:`Py_XNewRef`." msgstr "" -#: c-api/refcounting.rst:79 +#: c-api/refcounting.rst:82 msgid "" "Create a new :term:`strong reference` to an object: call :c:func:`Py_INCREF` " "on *o* and return the object *o*." msgstr "" -#: c-api/refcounting.rst:82 +#: c-api/refcounting.rst:85 msgid "" "When the :term:`strong reference` is no longer needed, :c:func:`Py_DECREF` " "should be called on it to release the reference." msgstr "" -#: c-api/refcounting.rst:85 +#: c-api/refcounting.rst:88 msgid "" "The object *o* must not be ``NULL``; use :c:func:`Py_XNewRef` if *o* can be " "``NULL``." msgstr "" -#: c-api/refcounting.rst:88 +#: c-api/refcounting.rst:91 msgid "For example::" msgstr "" -#: c-api/refcounting.rst:90 +#: c-api/refcounting.rst:93 msgid "" "Py_INCREF(obj);\n" "self->attr = obj;" msgstr "" -#: c-api/refcounting.rst:93 +#: c-api/refcounting.rst:96 msgid "can be written as::" msgstr "" -#: c-api/refcounting.rst:95 +#: c-api/refcounting.rst:98 msgid "self->attr = Py_NewRef(obj);" msgstr "" -#: c-api/refcounting.rst:97 +#: c-api/refcounting.rst:100 msgid "See also :c:func:`Py_INCREF`." msgstr "" -#: c-api/refcounting.rst:104 +#: c-api/refcounting.rst:107 msgid "Similar to :c:func:`Py_NewRef`, but the object *o* can be NULL." msgstr "" -#: c-api/refcounting.rst:106 +#: c-api/refcounting.rst:109 msgid "If the object *o* is ``NULL``, the function just returns ``NULL``." msgstr "" -#: c-api/refcounting.rst:113 +#: c-api/refcounting.rst:116 msgid "" "Release a :term:`strong reference` to object *o*, indicating the reference " "is no longer used." msgstr "" -#: c-api/refcounting.rst:116 +#: c-api/refcounting.rst:121 msgid "" "Once the last :term:`strong reference` is released (i.e. the object's " "reference count reaches 0), the object's type's deallocation function (which " "must not be ``NULL``) is invoked." msgstr "" -#: c-api/refcounting.rst:121 +#: c-api/refcounting.rst:126 msgid "" "This function is usually used to delete a :term:`strong reference` before " "exiting its scope." msgstr "" -#: c-api/refcounting.rst:124 +#: c-api/refcounting.rst:129 msgid "" "The object must not be ``NULL``; if you aren't sure that it isn't ``NULL``, " "use :c:func:`Py_XDECREF`." msgstr "" -#: c-api/refcounting.rst:127 +#: c-api/refcounting.rst:132 msgid "" "Do not expect this function to actually modify *o* in any way. For at least :" "pep:`some objects <683>`, this function has no effect." msgstr "" -#: c-api/refcounting.rst:133 +#: c-api/refcounting.rst:138 msgid "" "The deallocation function can cause arbitrary Python code to be invoked (e." "g. when a class instance with a :meth:`~object.__del__` method is " @@ -198,14 +202,14 @@ msgid "" "call :c:func:`Py_DECREF` for the temporary variable." msgstr "" -#: c-api/refcounting.rst:148 +#: c-api/refcounting.rst:153 msgid "" "Similar to :c:func:`Py_DECREF`, but the object *o* can be ``NULL``, in which " "case this has no effect. The same warning from :c:func:`Py_DECREF` applies " "here as well." msgstr "" -#: c-api/refcounting.rst:155 +#: c-api/refcounting.rst:160 msgid "" "Release a :term:`strong reference` for object *o*. The object may be " "``NULL``, in which case the macro has no effect; otherwise the effect is the " @@ -215,69 +219,69 @@ msgid "" "and sets the argument to ``NULL`` before releasing the reference." msgstr "" -#: c-api/refcounting.rst:163 +#: c-api/refcounting.rst:168 msgid "" "It is a good idea to use this macro whenever releasing a reference to an " "object that might be traversed during garbage collection." msgstr "" -#: c-api/refcounting.rst:166 +#: c-api/refcounting.rst:171 msgid "" "The macro argument is now only evaluated once. If the argument has side " "effects, these are no longer duplicated." msgstr "" -#: c-api/refcounting.rst:173 +#: c-api/refcounting.rst:178 msgid "" "Indicate taking a new :term:`strong reference` to object *o*. A function " "version of :c:func:`Py_XINCREF`. It can be used for runtime dynamic " "embedding of Python." msgstr "" -#: c-api/refcounting.rst:180 +#: c-api/refcounting.rst:185 msgid "" "Release a :term:`strong reference` to object *o*. A function version of :c:" "func:`Py_XDECREF`. It can be used for runtime dynamic embedding of Python." msgstr "" -#: c-api/refcounting.rst:187 +#: c-api/refcounting.rst:192 msgid "" "Macro safely releasing a :term:`strong reference` to object *dst* and " "setting *dst* to *src*." msgstr "" -#: c-api/refcounting.rst:190 +#: c-api/refcounting.rst:195 msgid "As in case of :c:func:`Py_CLEAR`, \"the obvious\" code can be deadly::" msgstr "" -#: c-api/refcounting.rst:192 +#: c-api/refcounting.rst:197 msgid "" "Py_DECREF(dst);\n" "dst = src;" msgstr "" -#: c-api/refcounting.rst:195 +#: c-api/refcounting.rst:200 msgid "The safe way is::" msgstr "" -#: c-api/refcounting.rst:197 +#: c-api/refcounting.rst:202 msgid "Py_SETREF(dst, src);" msgstr "" -#: c-api/refcounting.rst:199 +#: c-api/refcounting.rst:204 msgid "" "That arranges to set *dst* to *src* _before_ releasing the reference to the " "old value of *dst*, so that any code triggered as a side-effect of *dst* " "getting torn down no longer believes *dst* points to a valid object." msgstr "" -#: c-api/refcounting.rst:218 +#: c-api/refcounting.rst:223 msgid "" "The macro arguments are now only evaluated once. If an argument has side " "effects, these are no longer duplicated." msgstr "" -#: c-api/refcounting.rst:213 +#: c-api/refcounting.rst:218 msgid "" "Variant of :c:macro:`Py_SETREF` macro that uses :c:func:`Py_XDECREF` instead " "of :c:func:`Py_DECREF`." diff --git a/c-api/reflection.po b/c-api/reflection.po index 9a74385c..5ba34cda 100644 --- a/c-api/reflection.po +++ b/c-api/reflection.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -21,41 +21,103 @@ msgstr "" msgid "Reflection" msgstr "" -#: c-api/reflection.rst:10 +#: c-api/reflection.rst:12 +msgid "Use :c:func:`PyEval_GetFrameBuiltins` instead." +msgstr "" + +#: c-api/reflection.rst:66 msgid "" "Return a dictionary of the builtins in the current execution frame, or the " "interpreter of the thread state if no frame is currently executing." msgstr "" -#: c-api/reflection.rst:16 +#: c-api/reflection.rst:22 msgid "" -"Return a dictionary of the local variables in the current execution frame, " -"or ``NULL`` if no frame is currently executing." +"Use either :c:func:`PyEval_GetFrameLocals` to obtain the same behaviour as " +"calling :func:`locals` in Python code, or else call :c:func:" +"`PyFrame_GetLocals` on the result of :c:func:`PyEval_GetFrame` to access " +"the :attr:`~frame.f_locals` attribute of the currently executing frame." msgstr "" -#: c-api/reflection.rst:22 +#: c-api/reflection.rst:27 +msgid "" +"Return a mapping providing access to the local variables in the current " +"execution frame, or ``NULL`` if no frame is currently executing." +msgstr "" + +#: c-api/reflection.rst:30 +msgid "" +"Refer to :func:`locals` for details of the mapping returned at different " +"scopes." +msgstr "" + +#: c-api/reflection.rst:32 +msgid "" +"As this function returns a :term:`borrowed reference`, the dictionary " +"returned for :term:`optimized scopes ` is cached on the " +"frame object and will remain alive as long as the frame object does. Unlike :" +"c:func:`PyEval_GetFrameLocals` and :func:`locals`, subsequent calls to this " +"function in the same frame will update the contents of the cached dictionary " +"to reflect changes in the state of the local variables rather than returning " +"a new snapshot." +msgstr "" + +#: c-api/reflection.rst:39 +msgid "" +"As part of :pep:`667`, :c:func:`PyFrame_GetLocals`, :func:`locals`, and :" +"attr:`FrameType.f_locals ` no longer make use of the shared " +"cache dictionary. Refer to the :ref:`What's New entry ` for additional details." +msgstr "" + +#: c-api/reflection.rst:50 +msgid "Use :c:func:`PyEval_GetFrameGlobals` instead." +msgstr "" + +#: c-api/reflection.rst:52 msgid "" "Return a dictionary of the global variables in the current execution frame, " "or ``NULL`` if no frame is currently executing." msgstr "" -#: c-api/reflection.rst:28 +#: c-api/reflection.rst:58 msgid "" "Return the current thread state's frame, which is ``NULL`` if no frame is " "currently executing." msgstr "" -#: c-api/reflection.rst:31 +#: c-api/reflection.rst:61 msgid "See also :c:func:`PyThreadState_GetFrame`." msgstr "" -#: c-api/reflection.rst:36 +#: c-api/reflection.rst:74 +msgid "" +"Return a dictionary of the local variables in the current execution frame, " +"or ``NULL`` if no frame is currently executing. Equivalent to calling :func:" +"`locals` in Python code." +msgstr "" + +#: c-api/reflection.rst:78 +msgid "" +"To access :attr:`~frame.f_locals` on the current frame without making an " +"independent snapshot in :term:`optimized scopes `, call :c:" +"func:`PyFrame_GetLocals` on the result of :c:func:`PyEval_GetFrame`." +msgstr "" + +#: c-api/reflection.rst:87 +msgid "" +"Return a dictionary of the global variables in the current execution frame, " +"or ``NULL`` if no frame is currently executing. Equivalent to calling :func:" +"`globals` in Python code." +msgstr "" + +#: c-api/reflection.rst:96 msgid "" "Return the name of *func* if it is a function, class or instance object, " "else the name of *func*\\s type." msgstr "" -#: c-api/reflection.rst:42 +#: c-api/reflection.rst:102 msgid "" "Return a description string, depending on the type of *func*. Return values " "include \"()\" for functions and methods, \" constructor\", \" instance\", " diff --git a/c-api/sequence.po b/c-api/sequence.po index 096ae4fb..a31a3ea7 100644 --- a/c-api/sequence.po +++ b/c-api/sequence.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" diff --git a/c-api/set.po b/c-api/set.po index 60124cbe..65164a44 100644 --- a/c-api/set.po +++ b/c-api/set.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" diff --git a/c-api/slice.po b/c-api/slice.po index 042328a4..8f3b2e8e 100644 --- a/c-api/slice.po +++ b/c-api/slice.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -165,10 +165,9 @@ msgstr "" #: c-api/slice.rst:129 msgid "" "The Python ``Ellipsis`` object. This object has no methods. Like :c:data:" -"`Py_None`, it is an `immortal `_. " -"singleton object." +"`Py_None`, it is an :term:`immortal` singleton object." msgstr "" -#: c-api/slice.rst:133 +#: c-api/slice.rst:132 msgid ":c:data:`Py_Ellipsis` is immortal." msgstr "" diff --git a/c-api/stable.po b/c-api/stable.po index 90c69c37..3e4f9c96 100644 --- a/c-api/stable.po +++ b/c-api/stable.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" diff --git a/c-api/structures.po b/c-api/structures.po index bba00cb0..f0bc75bf 100644 --- a/c-api/structures.po +++ b/c-api/structures.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -237,9 +237,9 @@ msgstr "" #: c-api/structures.rst:201 msgid "" -"PyObject *_PyCFunctionFast(PyObject *self,\n" -" PyObject *const *args,\n" -" Py_ssize_t nargs);" +"PyObject *PyCFunctionFast(PyObject *self,\n" +" PyObject *const *args,\n" +" Py_ssize_t nargs);" msgstr "" #: c-api/structures.rst:207 @@ -251,10 +251,10 @@ msgstr "" #: c-api/structures.rst:211 msgid "" -"PyObject *_PyCFunctionFastWithKeywords(PyObject *self,\n" -" PyObject *const *args,\n" -" Py_ssize_t nargs,\n" -" PyObject *kwnames);" +"PyObject *PyCFunctionFastWithKeywords(PyObject *self,\n" +" PyObject *const *args,\n" +" Py_ssize_t nargs,\n" +" PyObject *kwnames);" msgstr "" #: c-api/structures.rst:218 @@ -351,7 +351,7 @@ msgstr "" #: c-api/structures.rst:297 msgid "" "Fast calling convention supporting only positional arguments. The methods " -"have the type :c:type:`_PyCFunctionFast`. The first parameter is *self*, the " +"have the type :c:type:`PyCFunctionFast`. The first parameter is *self*, the " "second parameter is a C array of :c:expr:`PyObject*` values indicating the " "arguments and the third parameter is the number of arguments (the length of " "the array)." @@ -368,7 +368,7 @@ msgstr "" #: c-api/structures.rst:313 msgid "" "Extension of :c:macro:`METH_FASTCALL` supporting also keyword arguments, " -"with methods of type :c:type:`_PyCFunctionFastWithKeywords`. Keyword " +"with methods of type :c:type:`PyCFunctionFastWithKeywords`. Keyword " "arguments are passed the same way as in the :ref:`vectorcall protocol " "`: there is an additional fourth :c:expr:`PyObject*` parameter " "which is a tuple representing the names of the keyword arguments (which are " diff --git a/c-api/sys.po b/c-api/sys.po index 29311ad8..1e5cb94f 100644 --- a/c-api/sys.po +++ b/c-api/sys.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -278,54 +278,17 @@ msgid "" "prior to :c:func:`Py_Initialize`." msgstr "" -#: c-api/sys.rst:258 -msgid "" -"This API is kept for backward compatibility: setting :c:member:`PyConfig." -"warnoptions` should be used instead, see :ref:`Python Initialization " -"Configuration `." -msgstr "" - -#: c-api/sys.rst:251 -msgid "" -"Append *s* to :data:`sys.warnoptions`. This function must be called prior " -"to :c:func:`Py_Initialize` in order to affect the warnings filter list." -msgstr "" - -#: c-api/sys.rst:262 -msgid "Append *unicode* to :data:`sys.warnoptions`." -msgstr "" - -#: c-api/sys.rst:264 -msgid "" -"Note: this function is not currently usable from outside the CPython " -"implementation, as it must be called prior to the implicit import of :mod:" -"`warnings` in :c:func:`Py_Initialize` to be effective, but can't be called " -"until enough of the runtime has been initialized to permit the creation of " -"Unicode objects." -msgstr "" - -#: c-api/sys.rst:274 -msgid "" -"This API is kept for backward compatibility: setting :c:member:`PyConfig." -"module_search_paths` and :c:member:`PyConfig.module_search_paths_set` should " -"be used instead, see :ref:`Python Initialization Configuration `." -msgstr "" - -#: c-api/sys.rst:279 -msgid "" -"Set :data:`sys.path` to a list object of paths found in *path* which should " -"be a list of paths separated with the platform's search path delimiter (``:" -"`` on Unix, ``;`` on Windows)." +#: c-api/sys.rst:245 +msgid "Clear :data:`sys.warnoptions` and :data:`!warnings.filters` instead." msgstr "" -#: c-api/sys.rst:287 +#: c-api/sys.rst:250 msgid "" "Write the output string described by *format* to :data:`sys.stdout`. No " "exceptions are raised, even if truncation occurs (see below)." msgstr "" -#: c-api/sys.rst:290 +#: c-api/sys.rst:253 msgid "" "*format* should limit the total size of the formatted output string to 1000 " "bytes or less -- after 1000 bytes, the output string is truncated. In " @@ -336,85 +299,89 @@ msgid "" "of digits for very large numbers." msgstr "" -#: c-api/sys.rst:298 +#: c-api/sys.rst:261 msgid "" "If a problem occurs, or :data:`sys.stdout` is unset, the formatted message " "is written to the real (C level) *stdout*." msgstr "" -#: c-api/sys.rst:303 +#: c-api/sys.rst:266 msgid "" "As :c:func:`PySys_WriteStdout`, but write to :data:`sys.stderr` or *stderr* " "instead." msgstr "" -#: c-api/sys.rst:308 +#: c-api/sys.rst:271 msgid "" "Function similar to PySys_WriteStdout() but format the message using :c:func:" "`PyUnicode_FromFormatV` and don't truncate the message to an arbitrary " "length." msgstr "" -#: c-api/sys.rst:316 +#: c-api/sys.rst:279 msgid "" "As :c:func:`PySys_FormatStdout`, but write to :data:`sys.stderr` or *stderr* " "instead." msgstr "" -#: c-api/sys.rst:323 -msgid "" -"This API is kept for backward compatibility: setting :c:member:`PyConfig." -"xoptions` should be used instead, see :ref:`Python Initialization " -"Configuration `." -msgstr "" - -#: c-api/sys.rst:327 -msgid "" -"Parse *s* as a set of :option:`-X` options and add them to the current " -"options mapping as returned by :c:func:`PySys_GetXOptions`. This function " -"may be called prior to :c:func:`Py_Initialize`." -msgstr "" - -#: c-api/sys.rst:337 +#: c-api/sys.rst:286 msgid "" "Return the current dictionary of :option:`-X` options, similarly to :data:" "`sys._xoptions`. On error, ``NULL`` is returned and an exception is set." msgstr "" -#: c-api/sys.rst:346 +#: c-api/sys.rst:295 msgid "" "Raise an auditing event with any active hooks. Return zero for success and " "non-zero with an exception set on failure." msgstr "" -#: c-api/sys.rst:349 +#: c-api/sys.rst:298 +msgid "The *event* string argument must not be *NULL*." +msgstr "" + +#: c-api/sys.rst:300 msgid "" "If any hooks have been added, *format* and other arguments will be used to " "construct a tuple to pass. Apart from ``N``, the same format characters as " "used in :c:func:`Py_BuildValue` are available. If the built value is not a " -"tuple, it will be added into a single-element tuple. (The ``N`` format " -"option consumes a reference, but since there is no way to know whether " -"arguments to this function will be consumed, using it may cause reference " -"leaks.)" +"tuple, it will be added into a single-element tuple." msgstr "" -#: c-api/sys.rst:357 +#: c-api/sys.rst:305 +msgid "" +"The ``N`` format option must not be used. It consumes a reference, but since " +"there is no way to know whether arguments to this function will be consumed, " +"using it may cause reference leaks." +msgstr "" + +#: c-api/sys.rst:309 msgid "" "Note that ``#`` format characters should always be treated as :c:type:" "`Py_ssize_t`, regardless of whether ``PY_SSIZE_T_CLEAN`` was defined." msgstr "" -#: c-api/sys.rst:360 +#: c-api/sys.rst:312 msgid ":func:`sys.audit` performs the same function from Python code." msgstr "" -#: c-api/sys.rst:366 +#: c-api/sys.rst:314 +msgid "See also :c:func:`PySys_AuditTuple`." +msgstr "" + +#: c-api/sys.rst:320 msgid "" "Require :c:type:`Py_ssize_t` for ``#`` format characters. Previously, an " "unavoidable deprecation warning was raised." msgstr "" -#: c-api/sys.rst:372 +#: c-api/sys.rst:326 +msgid "" +"Similar to :c:func:`PySys_Audit`, but pass arguments as a Python object. " +"*args* must be a :class:`tuple`. To pass no arguments, *args* can be *NULL*." +msgstr "" + +#: c-api/sys.rst:334 msgid "" "Append the callable *hook* to the list of active auditing hooks. Return zero " "on success and non-zero on failure. If the runtime has been initialized, " @@ -422,14 +389,14 @@ msgid "" "all interpreters created by the runtime." msgstr "" -#: c-api/sys.rst:378 +#: c-api/sys.rst:340 msgid "" "The *userData* pointer is passed into the hook function. Since hook " "functions may be called from different runtimes, this pointer should not " "refer directly to Python state." msgstr "" -#: c-api/sys.rst:382 +#: c-api/sys.rst:344 msgid "" "This function is safe to call before :c:func:`Py_Initialize`. When called " "after runtime initialization, existing audit hooks are notified and may " @@ -437,20 +404,20 @@ msgid "" "`Exception` (other errors will not be silenced)." msgstr "" -#: c-api/sys.rst:387 +#: c-api/sys.rst:349 msgid "" "The hook function is always called with the GIL held by the Python " "interpreter that raised the event." msgstr "" -#: c-api/sys.rst:390 +#: c-api/sys.rst:352 msgid "" "See :pep:`578` for a detailed description of auditing. Functions in the " "runtime and standard library that raise events are listed in the :ref:`audit " "events table `. Details are in each function's documentation." msgstr "" -#: c-api/sys.rst:397 +#: c-api/sys.rst:359 msgid "" "If the interpreter is initialized, this function raises an auditing event " "``sys.addaudithook`` with no arguments. If any existing hooks raise an " @@ -459,18 +426,19 @@ msgid "" "hook has been added unless they control all existing hooks." msgstr "" -#: c-api/sys.rst:406 +#: c-api/sys.rst:368 msgid "" "The type of the hook function. *event* is the C string event argument passed " -"to :c:func:`PySys_Audit`. *args* is guaranteed to be a :c:type:" -"`PyTupleObject`. *userData* is the argument passed to PySys_AddAuditHook()." +"to :c:func:`PySys_Audit` or :c:func:`PySys_AuditTuple`. *args* is guaranteed " +"to be a :c:type:`PyTupleObject`. *userData* is the argument passed to " +"PySys_AddAuditHook()." msgstr "" -#: c-api/sys.rst:417 +#: c-api/sys.rst:380 msgid "Process Control" msgstr "" -#: c-api/sys.rst:424 +#: c-api/sys.rst:387 msgid "" "Print a fatal error message and kill the process. No cleanup is performed. " "This function should only be invoked when a condition is detected that would " @@ -480,29 +448,29 @@ msgid "" "file:`core` file." msgstr "" -#: c-api/sys.rst:431 +#: c-api/sys.rst:394 msgid "" "The ``Py_FatalError()`` function is replaced with a macro which logs " "automatically the name of the current function, unless the " "``Py_LIMITED_API`` macro is defined." msgstr "" -#: c-api/sys.rst:435 +#: c-api/sys.rst:398 msgid "Log the function name automatically." msgstr "" -#: c-api/sys.rst:445 +#: c-api/sys.rst:408 msgid "" "Exit the current process. This calls :c:func:`Py_FinalizeEx` and then calls " "the standard C library function ``exit(status)``. If :c:func:" "`Py_FinalizeEx` indicates an error, the exit status is set to 120." msgstr "" -#: c-api/sys.rst:449 +#: c-api/sys.rst:412 msgid "Errors from finalization no longer ignored." msgstr "" -#: c-api/sys.rst:459 +#: c-api/sys.rst:422 msgid "" "Register a cleanup function to be called by :c:func:`Py_FinalizeEx`. The " "cleanup function will be called with no arguments and should return no " @@ -514,22 +482,26 @@ msgid "" "should be called by *func*." msgstr "" +#: c-api/sys.rst:432 +msgid ":c:func:`PyUnstable_AtExit` for passing a ``void *data`` argument." +msgstr "" + #: c-api/sys.rst:101 msgid "USE_STACKCHECK (C macro)" msgstr "" -#: c-api/sys.rst:422 +#: c-api/sys.rst:385 msgid "abort (C function)" msgstr "" -#: c-api/sys.rst:455 +#: c-api/sys.rst:418 msgid "Py_FinalizeEx (C function)" msgstr "" -#: c-api/sys.rst:441 +#: c-api/sys.rst:404 msgid "exit (C function)" msgstr "" -#: c-api/sys.rst:455 +#: c-api/sys.rst:418 msgid "cleanup functions" msgstr "" diff --git a/c-api/time.po b/c-api/time.po new file mode 100644 index 00000000..c0813e70 --- /dev/null +++ b/c-api/time.po @@ -0,0 +1,166 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) 2001-2025, Python Software Foundation +# This file is distributed under the same license as the Python package. +# FIRST AUTHOR , YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: Python 3.13\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#: c-api/time.rst:6 +msgid "PyTime C API" +msgstr "" + +#: c-api/time.rst:10 +msgid "" +"The clock C API provides access to system clocks. It is similar to the " +"Python :mod:`time` module." +msgstr "" + +#: c-api/time.rst:13 +msgid "" +"For C API related to the :mod:`datetime` module, see :ref:`datetimeobjects`." +msgstr "" + +#: c-api/time.rst:17 +msgid "Types" +msgstr "" + +#: c-api/time.rst:21 +msgid "" +"A timestamp or duration in nanoseconds, represented as a signed 64-bit " +"integer." +msgstr "" + +#: c-api/time.rst:24 +msgid "" +"The reference point for timestamps depends on the clock used. For example, :" +"c:func:`PyTime_Time` returns timestamps relative to the UNIX epoch." +msgstr "" + +#: c-api/time.rst:27 +msgid "" +"The supported range is around [-292.3 years; +292.3 years]. Using the Unix " +"epoch (January 1st, 1970) as reference, the supported date range is around " +"[1677-09-21; 2262-04-11]. The exact limits are exposed as constants:" +msgstr "" + +#: c-api/time.rst:34 +msgid "Minimum value of :c:type:`PyTime_t`." +msgstr "" + +#: c-api/time.rst:38 +msgid "Maximum value of :c:type:`PyTime_t`." +msgstr "" + +#: c-api/time.rst:42 +msgid "Clock Functions" +msgstr "" + +#: c-api/time.rst:44 +msgid "" +"The following functions take a pointer to a :c:expr:`PyTime_t` that they set " +"to the value of a particular clock. Details of each clock are given in the " +"documentation of the corresponding Python function." +msgstr "" + +#: c-api/time.rst:49 +msgid "" +"The functions return ``0`` on success, or ``-1`` (with an exception set) on " +"failure." +msgstr "" + +#: c-api/time.rst:52 +msgid "" +"On integer overflow, they set the :c:data:`PyExc_OverflowError` exception " +"and set ``*result`` to the value clamped to the ``[PyTime_MIN; PyTime_MAX]`` " +"range. (On current systems, integer overflows are likely caused by " +"misconfigured system time.)" +msgstr "" + +#: c-api/time.rst:58 +msgid "" +"As any other C API (unless otherwise specified), the functions must be " +"called with the :term:`GIL` held." +msgstr "" + +#: c-api/time.rst:63 +msgid "" +"Read the monotonic clock. See :func:`time.monotonic` for important details " +"on this clock." +msgstr "" + +#: c-api/time.rst:68 +msgid "" +"Read the performance counter. See :func:`time.perf_counter` for important " +"details on this clock." +msgstr "" + +#: c-api/time.rst:73 +msgid "" +"Read the “wall clock” time. See :func:`time.time` for details important on " +"this clock." +msgstr "" + +#: c-api/time.rst:78 +msgid "Raw Clock Functions" +msgstr "" + +#: c-api/time.rst:80 +msgid "" +"Similar to clock functions, but don't set an exception on error and don't " +"require the caller to hold the GIL." +msgstr "" + +#: c-api/time.rst:83 +msgid "On success, the functions return ``0``." +msgstr "" + +#: c-api/time.rst:85 +msgid "" +"On failure, they set ``*result`` to ``0`` and return ``-1``, *without* " +"setting an exception. To get the cause of the error, acquire the GIL and " +"call the regular (non-``Raw``) function. Note that the regular function may " +"succeed after the ``Raw`` one failed." +msgstr "" + +#: c-api/time.rst:92 +msgid "" +"Similar to :c:func:`PyTime_Monotonic`, but don't set an exception on error " +"and don't require holding the GIL." +msgstr "" + +#: c-api/time.rst:97 +msgid "" +"Similar to :c:func:`PyTime_PerfCounter`, but don't set an exception on error " +"and don't require holding the GIL." +msgstr "" + +#: c-api/time.rst:102 +msgid "" +"Similar to :c:func:`PyTime_Time`, but don't set an exception on error and " +"don't require holding the GIL." +msgstr "" + +#: c-api/time.rst:107 +msgid "Conversion functions" +msgstr "" + +#: c-api/time.rst:111 +msgid "Convert a timestamp to a number of seconds as a C :c:expr:`double`." +msgstr "" + +#: c-api/time.rst:113 +msgid "" +"The function cannot fail, but note that :c:expr:`double` has limited " +"accuracy for large values." +msgstr "" diff --git a/c-api/tuple.po b/c-api/tuple.po index dd7747e9..419fafda 100644 --- a/c-api/tuple.po +++ b/c-api/tuple.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -117,14 +117,20 @@ msgid "" "*only* be used to fill in brand new tuples." msgstr "" -#: c-api/tuple.rst:104 +#: c-api/tuple.rst:218 c-api/tuple.rst:236 +msgid "" +"Bounds checking is performed as an assertion if Python is built in :ref:" +"`debug mode ` or :option:`with assertions <--with-assertions>`." +msgstr "" + +#: c-api/tuple.rst:107 msgid "" "This function \"steals\" a reference to *o*, and, unlike :c:func:" "`PyTuple_SetItem`, does *not* discard a reference to any item that is being " "replaced; any reference in the tuple at position *pos* will be leaked." msgstr "" -#: c-api/tuple.rst:112 +#: c-api/tuple.rst:115 msgid "" "Can be used to resize a tuple. *newsize* will be the new length of the " "tuple. Because tuples are *supposed* to be immutable, this should only be " @@ -139,11 +145,11 @@ msgid "" "`SystemError`." msgstr "" -#: c-api/tuple.rst:127 +#: c-api/tuple.rst:130 msgid "Struct Sequence Objects" msgstr "" -#: c-api/tuple.rst:129 +#: c-api/tuple.rst:132 msgid "" "Struct sequence objects are the C equivalent of :func:`~collections." "namedtuple` objects, i.e. a sequence whose items can also be accessed " @@ -151,50 +157,50 @@ msgid "" "specific struct sequence type." msgstr "" -#: c-api/tuple.rst:136 +#: c-api/tuple.rst:139 msgid "" "Create a new struct sequence type from the data in *desc*, described below. " "Instances of the resulting type can be created with :c:func:" "`PyStructSequence_New`." msgstr "" -#: c-api/tuple.rst:208 +#: c-api/tuple.rst:211 msgid "Return ``NULL`` with an exception set on failure." msgstr "" -#: c-api/tuple.rst:144 +#: c-api/tuple.rst:147 msgid "Initializes a struct sequence type *type* from *desc* in place." msgstr "" -#: c-api/tuple.rst:149 +#: c-api/tuple.rst:152 msgid "" "Like :c:func:`PyStructSequence_InitType`, but returns ``0`` on success and " "``-1`` with an exception set on failure." msgstr "" -#: c-api/tuple.rst:157 +#: c-api/tuple.rst:160 msgid "Contains the meta information of a struct sequence type to create." msgstr "" -#: c-api/tuple.rst:161 +#: c-api/tuple.rst:164 msgid "" "Fully qualified name of the type; null-terminated UTF-8 encoded. The name " "must contain the module name." msgstr "" -#: c-api/tuple.rst:166 +#: c-api/tuple.rst:169 msgid "Pointer to docstring for the type or ``NULL`` to omit." msgstr "" -#: c-api/tuple.rst:170 +#: c-api/tuple.rst:173 msgid "Pointer to ``NULL``-terminated array with field names of the new type." msgstr "" -#: c-api/tuple.rst:174 +#: c-api/tuple.rst:177 msgid "Number of fields visible to the Python side (if used as tuple)." msgstr "" -#: c-api/tuple.rst:179 +#: c-api/tuple.rst:182 msgid "" "Describes a field of a struct sequence. As a struct sequence is modeled as a " "tuple, all fields are typed as :c:expr:`PyObject*`. The index in the :c:" @@ -203,55 +209,60 @@ msgid "" "described." msgstr "" -#: c-api/tuple.rst:187 +#: c-api/tuple.rst:190 msgid "" "Name for the field or ``NULL`` to end the list of named fields, set to :c:" "data:`PyStructSequence_UnnamedField` to leave unnamed." msgstr "" -#: c-api/tuple.rst:192 +#: c-api/tuple.rst:195 msgid "Field docstring or ``NULL`` to omit." msgstr "" -#: c-api/tuple.rst:197 +#: c-api/tuple.rst:200 msgid "Special value for a field name to leave it unnamed." msgstr "" -#: c-api/tuple.rst:199 +#: c-api/tuple.rst:202 msgid "The type was changed from ``char *``." msgstr "" -#: c-api/tuple.rst:205 +#: c-api/tuple.rst:208 msgid "" "Creates an instance of *type*, which must have been created with :c:func:" "`PyStructSequence_NewType`." msgstr "" -#: c-api/tuple.rst:213 +#: c-api/tuple.rst:216 msgid "" -"Return the object at position *pos* in the struct sequence pointed to by " -"*p*. No bounds checking is performed." +"Return the object at position *pos* in the struct sequence pointed to by *p*." +msgstr "" + +#: c-api/tuple.rst:224 +msgid "Alias to :c:func:`PyStructSequence_GetItem`." msgstr "" -#: c-api/tuple.rst:219 -msgid "Macro equivalent of :c:func:`PyStructSequence_GetItem`." +#: c-api/tuple.rst:226 +msgid "Now implemented as an alias to :c:func:`PyStructSequence_GetItem`." msgstr "" -#: c-api/tuple.rst:224 +#: c-api/tuple.rst:232 msgid "" "Sets the field at index *pos* of the struct sequence *p* to value *o*. " "Like :c:func:`PyTuple_SET_ITEM`, this should only be used to fill in brand " "new instances." msgstr "" -#: c-api/tuple.rst:240 +#: c-api/tuple.rst:241 msgid "This function \"steals\" a reference to *o*." msgstr "" -#: c-api/tuple.rst:235 -msgid "" -"Similar to :c:func:`PyStructSequence_SetItem`, but implemented as a static " -"inlined function." +#: c-api/tuple.rst:246 +msgid "Alias to :c:func:`PyStructSequence_SetItem`." +msgstr "" + +#: c-api/tuple.rst:248 +msgid "Now implemented as an alias to :c:func:`PyStructSequence_SetItem`." msgstr "" #: c-api/tuple.rst:8 diff --git a/c-api/type.po b/c-api/type.po index d0090d10..ad03c3d3 100644 --- a/c-api/type.po +++ b/c-api/type.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -98,21 +98,27 @@ msgid "" "exception." msgstr "" -#: c-api/type.rst:90 +#: c-api/type.rst:85 +msgid "" +"In free-threaded builds, :c:func:`PyType_AddWatcher` is not thread-safe, so " +"it must be called at start up (before spawning the first thread)." +msgstr "" + +#: c-api/type.rst:93 msgid "" "Clear watcher identified by *watcher_id* (previously returned from :c:func:" "`PyType_AddWatcher`). Return ``0`` on success, ``-1`` on error (e.g. if " "*watcher_id* was never registered.)" msgstr "" -#: c-api/type.rst:94 +#: c-api/type.rst:97 msgid "" "An extension should never call ``PyType_ClearWatcher`` with a *watcher_id* " "that was not returned to it by a previous call to :c:func:" "`PyType_AddWatcher`." msgstr "" -#: c-api/type.rst:103 +#: c-api/type.rst:106 msgid "" "Mark *type* as watched. The callback granted *watcher_id* by :c:func:" "`PyType_AddWatcher` will be called whenever :c:func:`PyType_Modified` " @@ -122,61 +128,61 @@ msgid "" "detail and subject to change.)" msgstr "" -#: c-api/type.rst:110 +#: c-api/type.rst:113 msgid "" "An extension should never call ``PyType_Watch`` with a *watcher_id* that was " "not returned to it by a previous call to :c:func:`PyType_AddWatcher`." msgstr "" -#: c-api/type.rst:118 +#: c-api/type.rst:121 msgid "Type of a type-watcher callback function." msgstr "" -#: c-api/type.rst:120 +#: c-api/type.rst:123 msgid "" "The callback must not modify *type* or cause :c:func:`PyType_Modified` to be " "called on *type* or any type in its MRO; violating this rule could cause " "infinite recursion." msgstr "" -#: c-api/type.rst:129 +#: c-api/type.rst:132 msgid "" "Return non-zero if the type object *o* sets the feature *feature*. Type " "features are denoted by single bit flags." msgstr "" -#: c-api/type.rst:135 +#: c-api/type.rst:138 msgid "" "Return true if the type object includes support for the cycle detector; this " "tests the type flag :c:macro:`Py_TPFLAGS_HAVE_GC`." msgstr "" -#: c-api/type.rst:141 +#: c-api/type.rst:144 msgid "Return true if *a* is a subtype of *b*." msgstr "" -#: c-api/type.rst:143 +#: c-api/type.rst:146 msgid "" "This function only checks for actual subtypes, which means that :meth:`~type." "__subclasscheck__` is not called on *b*. Call :c:func:`PyObject_IsSubclass` " "to do the same check that :func:`issubclass` would do." msgstr "" -#: c-api/type.rst:151 +#: c-api/type.rst:154 msgid "" "Generic handler for the :c:member:`~PyTypeObject.tp_alloc` slot of a type " "object. Use Python's default memory allocation mechanism to allocate a new " "instance and initialize all its contents to ``NULL``." msgstr "" -#: c-api/type.rst:157 +#: c-api/type.rst:160 msgid "" "Generic handler for the :c:member:`~PyTypeObject.tp_new` slot of a type " "object. Create a new instance using the type's :c:member:`~PyTypeObject." "tp_alloc` slot." msgstr "" -#: c-api/type.rst:162 +#: c-api/type.rst:165 msgid "" "Finalize a type object. This should be called on all type objects to finish " "their initialization. This function is responsible for adding inherited " @@ -184,7 +190,7 @@ msgid "" "and sets an exception on error." msgstr "" -#: c-api/type.rst:168 +#: c-api/type.rst:171 msgid "" "If some of the base classes implements the GC protocol and the provided type " "does not include the :c:macro:`Py_TPFLAGS_HAVE_GC` in its flags, then the GC " @@ -195,19 +201,32 @@ msgid "" "handle." msgstr "" -#: c-api/type.rst:178 +#: c-api/type.rst:181 msgid "" "Return the type's name. Equivalent to getting the type's :attr:`~type." "__name__` attribute." msgstr "" -#: c-api/type.rst:185 +#: c-api/type.rst:188 msgid "" "Return the type's qualified name. Equivalent to getting the type's :attr:" "`~type.__qualname__` attribute." msgstr "" -#: c-api/type.rst:192 +#: c-api/type.rst:195 +msgid "" +"Return the type's fully qualified name. Equivalent to ``f\"{type.__module__}." +"{type.__qualname__}\"``, or :attr:`type.__qualname__` if :attr:`type." +"__module__` is not a string or is equal to ``\"builtins\"``." +msgstr "" + +#: c-api/type.rst:203 +msgid "" +"Return the type's module name. Equivalent to getting the :attr:`type." +"__module__` attribute." +msgstr "" + +#: c-api/type.rst:210 msgid "" "Return the function pointer stored in the given slot. If the result is " "``NULL``, this indicates that either the slot is ``NULL``, or that the " @@ -215,30 +234,30 @@ msgid "" "result pointer into the appropriate function type." msgstr "" -#: c-api/type.rst:198 +#: c-api/type.rst:216 msgid "" "See :c:member:`PyType_Slot.slot` for possible values of the *slot* argument." msgstr "" -#: c-api/type.rst:202 +#: c-api/type.rst:220 msgid "" ":c:func:`PyType_GetSlot` can now accept all types. Previously, it was " "limited to :ref:`heap types `." msgstr "" -#: c-api/type.rst:208 +#: c-api/type.rst:226 msgid "" "Return the module object associated with the given type when the type was " "created using :c:func:`PyType_FromModuleAndSpec`." msgstr "" -#: c-api/type.rst:231 +#: c-api/type.rst:249 msgid "" "If no module is associated with the given type, sets :py:class:`TypeError` " "and returns ``NULL``." msgstr "" -#: c-api/type.rst:214 +#: c-api/type.rst:232 msgid "" "This function is usually used to get the module in which a method is " "defined. Note that in such a method, ``PyType_GetModule(Py_TYPE(self))`` may " @@ -249,31 +268,31 @@ msgid "" "type:`!PyCMethod` cannot be used." msgstr "" -#: c-api/type.rst:227 +#: c-api/type.rst:245 msgid "" "Return the state of the module object associated with the given type. This " "is a shortcut for calling :c:func:`PyModule_GetState()` on the result of :c:" "func:`PyType_GetModule`." msgstr "" -#: c-api/type.rst:234 +#: c-api/type.rst:252 msgid "" "If the *type* has an associated module but its state is ``NULL``, returns " "``NULL`` without setting an exception." msgstr "" -#: c-api/type.rst:241 +#: c-api/type.rst:259 msgid "" "Find the first superclass whose module was created from the given :c:type:" "`PyModuleDef` *def*, and return that module." msgstr "" -#: c-api/type.rst:244 +#: c-api/type.rst:262 msgid "" "If no module is found, raises a :py:class:`TypeError` and returns ``NULL``." msgstr "" -#: c-api/type.rst:246 +#: c-api/type.rst:264 msgid "" "This function is intended to be used together with :c:func:" "`PyModule_GetState()` to get module state from slot methods (such as :c:" @@ -282,40 +301,40 @@ msgid "" "type:`PyCMethod` calling convention." msgstr "" -#: c-api/type.rst:256 +#: c-api/type.rst:274 msgid "Attempt to assign a version tag to the given type." msgstr "" -#: c-api/type.rst:258 +#: c-api/type.rst:276 msgid "" "Returns 1 if the type already had a valid version tag or a new one was " "assigned, or 0 if a new tag could not be assigned." msgstr "" -#: c-api/type.rst:265 +#: c-api/type.rst:283 msgid "Creating Heap-Allocated Types" msgstr "" -#: c-api/type.rst:267 +#: c-api/type.rst:285 msgid "" "The following functions and structs are used to create :ref:`heap types " "`." msgstr "" -#: c-api/type.rst:272 +#: c-api/type.rst:290 msgid "" "Create and return a :ref:`heap type ` from the *spec* (see :c:" "macro:`Py_TPFLAGS_HEAPTYPE`)." msgstr "" -#: c-api/type.rst:275 +#: c-api/type.rst:293 msgid "" "The metaclass *metaclass* is used to construct the resulting type object. " "When *metaclass* is ``NULL``, the metaclass is derived from *bases* (or " "*Py_tp_base[s]* slots if *bases* is ``NULL``, see below)." msgstr "" -#: c-api/type.rst:279 +#: c-api/type.rst:297 msgid "" "Metaclasses that override :c:member:`~PyTypeObject.tp_new` are not " "supported, except if ``tp_new`` is ``NULL``. (For backwards compatibility, " @@ -324,7 +343,7 @@ msgid "" "deprecated and in Python 3.14+ such metaclasses will not be supported.)" msgstr "" -#: c-api/type.rst:286 +#: c-api/type.rst:304 msgid "" "The *bases* argument can be used to specify base classes; it can either be " "only one class or a tuple of classes. If *bases* is ``NULL``, the " @@ -333,7 +352,7 @@ msgid "" "derives from :class:`object`." msgstr "" -#: c-api/type.rst:292 +#: c-api/type.rst:310 msgid "" "The *module* argument can be used to record the module in which the new " "class is defined. It must be a module object or ``NULL``. If not ``NULL``, " @@ -342,11 +361,11 @@ msgid "" "subclasses; it must be specified for each class individually." msgstr "" -#: c-api/type.rst:299 +#: c-api/type.rst:317 msgid "This function calls :c:func:`PyType_Ready` on the new type." msgstr "" -#: c-api/type.rst:301 +#: c-api/type.rst:319 msgid "" "Note that this function does *not* fully match the behavior of calling :py:" "class:`type() ` or using the :keyword:`class` statement. With user-" @@ -355,41 +374,41 @@ msgid "" "Specifically:" msgstr "" -#: c-api/type.rst:308 +#: c-api/type.rst:326 msgid "" ":py:meth:`~object.__new__` is not called on the new class (and it must be " "set to ``type.__new__``)." msgstr "" -#: c-api/type.rst:310 +#: c-api/type.rst:328 msgid ":py:meth:`~object.__init__` is not called on the new class." msgstr "" -#: c-api/type.rst:311 +#: c-api/type.rst:329 msgid ":py:meth:`~object.__init_subclass__` is not called on any bases." msgstr "" -#: c-api/type.rst:312 +#: c-api/type.rst:330 msgid ":py:meth:`~object.__set_name__` is not called on new descriptors." msgstr "" -#: c-api/type.rst:318 +#: c-api/type.rst:336 msgid "Equivalent to ``PyType_FromMetaclass(NULL, module, spec, bases)``." msgstr "" -#: c-api/type.rst:324 +#: c-api/type.rst:342 msgid "" "The function now accepts a single class as the *bases* argument and ``NULL`` " "as the ``tp_doc`` slot." msgstr "" -#: c-api/type.rst:346 +#: c-api/type.rst:364 msgid "" "The function now finds and uses a metaclass corresponding to the provided " "base classes. Previously, only :class:`type` instances were returned." msgstr "" -#: c-api/type.rst:349 c-api/type.rst:365 +#: c-api/type.rst:367 c-api/type.rst:383 msgid "" "The :c:member:`~PyTypeObject.tp_new` of the metaclass is *ignored*. which " "may result in incomplete initialization. Creating classes whose metaclass " @@ -397,42 +416,42 @@ msgid "" "it will be no longer allowed." msgstr "" -#: c-api/type.rst:340 +#: c-api/type.rst:358 msgid "Equivalent to ``PyType_FromMetaclass(NULL, NULL, spec, bases)``." msgstr "" -#: c-api/type.rst:357 +#: c-api/type.rst:375 msgid "Equivalent to ``PyType_FromMetaclass(NULL, NULL, spec, NULL)``." msgstr "" -#: c-api/type.rst:361 +#: c-api/type.rst:379 msgid "" "The function now finds and uses a metaclass corresponding to the base " "classes provided in *Py_tp_base[s]* slots. Previously, only :class:`type` " "instances were returned." msgstr "" -#: c-api/type.rst:382 +#: c-api/type.rst:400 msgid "Structure defining a type's behavior." msgstr "" -#: c-api/type.rst:386 +#: c-api/type.rst:404 msgid "Name of the type, used to set :c:member:`PyTypeObject.tp_name`." msgstr "" -#: c-api/type.rst:390 +#: c-api/type.rst:408 msgid "" "If positive, specifies the size of the instance in bytes. It is used to set :" "c:member:`PyTypeObject.tp_basicsize`." msgstr "" -#: c-api/type.rst:393 +#: c-api/type.rst:411 msgid "" "If zero, specifies that :c:member:`~PyTypeObject.tp_basicsize` should be " "inherited." msgstr "" -#: c-api/type.rst:396 +#: c-api/type.rst:414 msgid "" "If negative, the absolute value specifies how much space instances of the " "class need *in addition* to the superclass. Use :c:func:" @@ -442,17 +461,17 @@ msgid "" "requirements." msgstr "" -#: c-api/type.rst:406 +#: c-api/type.rst:424 msgid "Previously, this field could not be negative." msgstr "" -#: c-api/type.rst:410 +#: c-api/type.rst:428 msgid "" "Size of one element of a variable-size type, in bytes. Used to set :c:member:" "`PyTypeObject.tp_itemsize`. See ``tp_itemsize`` documentation for caveats." msgstr "" -#: c-api/type.rst:414 +#: c-api/type.rst:432 msgid "" "If zero, :c:member:`~PyTypeObject.tp_itemsize` is inherited. Extending " "arbitrary variable-sized classes is dangerous, since some types use a fixed " @@ -461,58 +480,58 @@ msgid "" "only possible in the following situations:" msgstr "" -#: c-api/type.rst:421 +#: c-api/type.rst:439 msgid "" "The base is not variable-sized (its :c:member:`~PyTypeObject.tp_itemsize`)." msgstr "" -#: c-api/type.rst:423 +#: c-api/type.rst:441 msgid "" "The requested :c:member:`PyType_Spec.basicsize` is positive, suggesting that " "the memory layout of the base class is known." msgstr "" -#: c-api/type.rst:425 +#: c-api/type.rst:443 msgid "" "The requested :c:member:`PyType_Spec.basicsize` is zero, suggesting that the " "subclass does not access the instance's memory directly." msgstr "" -#: c-api/type.rst:428 +#: c-api/type.rst:446 msgid "With the :c:macro:`Py_TPFLAGS_ITEMS_AT_END` flag." msgstr "" -#: c-api/type.rst:432 +#: c-api/type.rst:450 msgid "Type flags, used to set :c:member:`PyTypeObject.tp_flags`." msgstr "" -#: c-api/type.rst:434 +#: c-api/type.rst:452 msgid "" "If the ``Py_TPFLAGS_HEAPTYPE`` flag is not set, :c:func:" "`PyType_FromSpecWithBases` sets it automatically." msgstr "" -#: c-api/type.rst:439 +#: c-api/type.rst:457 msgid "" "Array of :c:type:`PyType_Slot` structures. Terminated by the special slot " "value ``{0, NULL}``." msgstr "" -#: c-api/type.rst:442 +#: c-api/type.rst:460 msgid "Each slot ID should be specified at most once." msgstr "" -#: c-api/type.rst:452 +#: c-api/type.rst:470 msgid "" "Structure defining optional functionality of a type, containing a slot ID " "and a value pointer." msgstr "" -#: c-api/type.rst:457 +#: c-api/type.rst:475 msgid "A slot ID." msgstr "" -#: c-api/type.rst:459 +#: c-api/type.rst:477 msgid "" "Slot IDs are named like the field names of the structures :c:type:" "`PyTypeObject`, :c:type:`PyNumberMethods`, :c:type:`PySequenceMethods`, :c:" @@ -520,42 +539,42 @@ msgid "" "prefix. For example, use:" msgstr "" -#: c-api/type.rst:465 +#: c-api/type.rst:483 msgid "``Py_tp_dealloc`` to set :c:member:`PyTypeObject.tp_dealloc`" msgstr "" -#: c-api/type.rst:466 +#: c-api/type.rst:484 msgid "``Py_nb_add`` to set :c:member:`PyNumberMethods.nb_add`" msgstr "" -#: c-api/type.rst:467 +#: c-api/type.rst:485 msgid "``Py_sq_length`` to set :c:member:`PySequenceMethods.sq_length`" msgstr "" -#: c-api/type.rst:469 +#: c-api/type.rst:487 msgid "" "The following “offset” fields cannot be set using :c:type:`PyType_Slot`:" msgstr "" -#: c-api/type.rst:471 +#: c-api/type.rst:489 msgid "" ":c:member:`~PyTypeObject.tp_weaklistoffset` (use :c:macro:" "`Py_TPFLAGS_MANAGED_WEAKREF` instead if possible)" msgstr "" -#: c-api/type.rst:473 +#: c-api/type.rst:491 msgid "" ":c:member:`~PyTypeObject.tp_dictoffset` (use :c:macro:" "`Py_TPFLAGS_MANAGED_DICT` instead if possible)" msgstr "" -#: c-api/type.rst:475 +#: c-api/type.rst:493 msgid "" ":c:member:`~PyTypeObject.tp_vectorcall_offset` (use " "``\"__vectorcalloffset__\"`` in :ref:`PyMemberDef `)" msgstr "" -#: c-api/type.rst:479 +#: c-api/type.rst:497 msgid "" "If it is not possible to switch to a ``MANAGED`` flag (for example, for " "vectorcall or to support Python older than 3.12), specify the offset in :c:" @@ -563,48 +582,48 @@ msgid "" "documentation ` for details." msgstr "" -#: c-api/type.rst:485 +#: c-api/type.rst:503 msgid "The following fields cannot be set at all when creating a heap type:" msgstr "" -#: c-api/type.rst:487 +#: c-api/type.rst:505 msgid "" ":c:member:`~PyTypeObject.tp_vectorcall` (use :c:member:`~PyTypeObject." "tp_new` and/or :c:member:`~PyTypeObject.tp_init`)" msgstr "" -#: c-api/type.rst:491 +#: c-api/type.rst:509 msgid "" "Internal fields: :c:member:`~PyTypeObject.tp_dict`, :c:member:`~PyTypeObject." "tp_mro`, :c:member:`~PyTypeObject.tp_cache`, :c:member:`~PyTypeObject." "tp_subclasses`, and :c:member:`~PyTypeObject.tp_weaklist`." msgstr "" -#: c-api/type.rst:498 +#: c-api/type.rst:516 msgid "" "Setting :c:data:`Py_tp_bases` or :c:data:`Py_tp_base` may be problematic on " "some platforms. To avoid issues, use the *bases* argument of :c:func:" "`PyType_FromSpecWithBases` instead." msgstr "" -#: c-api/type.rst:503 +#: c-api/type.rst:521 msgid "Slots in :c:type:`PyBufferProcs` may be set in the unlimited API." msgstr "" -#: c-api/type.rst:506 +#: c-api/type.rst:524 msgid "" ":c:member:`~PyBufferProcs.bf_getbuffer` and :c:member:`~PyBufferProcs." "bf_releasebuffer` are now available under the :ref:`limited API `." msgstr "" -#: c-api/type.rst:513 +#: c-api/type.rst:531 msgid "" "The desired value of the slot. In most cases, this is a pointer to a " "function." msgstr "" -#: c-api/type.rst:516 +#: c-api/type.rst:534 msgid "Slots other than ``Py_tp_doc`` may not be ``NULL``." msgstr "" diff --git a/c-api/typehints.po b/c-api/typehints.po index 544bc3cc..9b59edad 100644 --- a/c-api/typehints.po +++ b/c-api/typehints.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" diff --git a/c-api/typeobj.po b/c-api/typeobj.po index bd8520b8..3125184b 100644 --- a/c-api/typeobj.po +++ b/c-api/typeobj.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -1236,21 +1236,21 @@ msgid "" "instances *do* count as references." msgstr "" -#: c-api/typeobj.rst:526 c-api/typeobj.rst:565 c-api/typeobj.rst:687 -#: c-api/typeobj.rst:804 c-api/typeobj.rst:838 c-api/typeobj.rst:880 -#: c-api/typeobj.rst:909 c-api/typeobj.rst:954 c-api/typeobj.rst:992 -#: c-api/typeobj.rst:1039 c-api/typeobj.rst:1074 c-api/typeobj.rst:1124 -#: c-api/typeobj.rst:1144 c-api/typeobj.rst:1176 c-api/typeobj.rst:1214 -#: c-api/typeobj.rst:1249 c-api/typeobj.rst:1314 c-api/typeobj.rst:1363 -#: c-api/typeobj.rst:1411 c-api/typeobj.rst:1547 c-api/typeobj.rst:1644 -#: c-api/typeobj.rst:1692 c-api/typeobj.rst:1720 c-api/typeobj.rst:1764 -#: c-api/typeobj.rst:1822 c-api/typeobj.rst:1869 c-api/typeobj.rst:1930 -#: c-api/typeobj.rst:1993 c-api/typeobj.rst:2053 c-api/typeobj.rst:2076 -#: c-api/typeobj.rst:2110 c-api/typeobj.rst:2159 c-api/typeobj.rst:2182 +#: c-api/typeobj.rst:526 c-api/typeobj.rst:587 c-api/typeobj.rst:741 +#: c-api/typeobj.rst:799 c-api/typeobj.rst:834 c-api/typeobj.rst:875 +#: c-api/typeobj.rst:899 c-api/typeobj.rst:954 c-api/typeobj.rst:995 +#: c-api/typeobj.rst:1040 c-api/typeobj.rst:1095 c-api/typeobj.rst:1116 +#: c-api/typeobj.rst:1140 c-api/typeobj.rst:1181 c-api/typeobj.rst:1212 +#: c-api/typeobj.rst:1278 c-api/typeobj.rst:1318 c-api/typeobj.rst:1370 +#: c-api/typeobj.rst:1481 c-api/typeobj.rst:1616 c-api/typeobj.rst:1677 +#: c-api/typeobj.rst:1713 c-api/typeobj.rst:1742 c-api/typeobj.rst:1804 +#: c-api/typeobj.rst:1848 c-api/typeobj.rst:1921 c-api/typeobj.rst:1979 +#: c-api/typeobj.rst:2033 c-api/typeobj.rst:2074 c-api/typeobj.rst:2101 +#: c-api/typeobj.rst:2132 c-api/typeobj.rst:2188 msgid "**Inheritance:**" msgstr "" -#: c-api/typeobj.rst:567 c-api/typeobj.rst:611 +#: c-api/typeobj.rst:545 c-api/typeobj.rst:589 msgid "This field is not inherited by subtypes." msgstr "" @@ -1278,60 +1278,33 @@ msgid "" "class. :c:func:`PyType_Ready` will not change this field if it is non-zero." msgstr "" -#: c-api/typeobj.rst:765 c-api/typeobj.rst:974 c-api/typeobj.rst:1671 -#: c-api/typeobj.rst:1824 c-api/typeobj.rst:1915 c-api/typeobj.rst:2161 +#: c-api/typeobj.rst:743 c-api/typeobj.rst:956 c-api/typeobj.rst:1679 +#: c-api/typeobj.rst:1832 c-api/typeobj.rst:1923 c-api/typeobj.rst:2167 msgid "This field is inherited by subtypes." msgstr "" -#: c-api/typeobj.rst:534 -msgid "" -"These fields are only present when the macro ``Py_TRACE_REFS`` is defined " -"(see the :option:`configure --with-trace-refs option <--with-trace-refs>`)." -msgstr "" - -#: c-api/typeobj.rst:537 -msgid "" -"Their initialization to ``NULL`` is taken care of by the " -"``PyObject_HEAD_INIT`` macro. For :ref:`statically allocated objects " -"`, these fields always remain ``NULL``. For :ref:`dynamically " -"allocated objects `, these two fields are used to link the " -"object into a doubly linked list of *all* live objects on the heap." -msgstr "" - -#: c-api/typeobj.rst:543 -msgid "" -"This could be used for various debugging purposes; currently the only uses " -"are the :func:`sys.getobjects` function and to print the objects that are " -"still alive at the end of a run when the environment variable :envvar:" -"`PYTHONDUMPREFS` is set." -msgstr "" - -#: c-api/typeobj.rst:550 -msgid "These fields are not inherited by subtypes." -msgstr "" - -#: c-api/typeobj.rst:554 +#: c-api/typeobj.rst:532 msgid "PyVarObject Slots" msgstr "" -#: c-api/typeobj.rst:558 +#: c-api/typeobj.rst:536 msgid "" "For :ref:`statically allocated type objects `, this should be " "initialized to zero. For :ref:`dynamically allocated type objects `, this field has a special internal meaning." msgstr "" -#: c-api/typeobj.rst:562 +#: c-api/typeobj.rst:540 msgid "" "This field should be accessed using the :c:func:`Py_SIZE()` and :c:func:" "`Py_SET_SIZE()` macros." msgstr "" -#: c-api/typeobj.rst:571 +#: c-api/typeobj.rst:549 msgid "PyTypeObject Slots" msgstr "" -#: c-api/typeobj.rst:573 +#: c-api/typeobj.rst:551 msgid "" "Each slot has a section describing inheritance. If :c:func:`PyType_Ready` " "may set a value when the field is set to ``NULL`` then there will also be a " @@ -1339,7 +1312,7 @@ msgid "" "`PyBaseObject_Type` and :c:data:`PyType_Type` effectively act as defaults.)" msgstr "" -#: c-api/typeobj.rst:580 +#: c-api/typeobj.rst:558 msgid "" "Pointer to a NUL-terminated string containing the name of the type. For " "types that are accessible as module globals, the string should be the full " @@ -1351,14 +1324,14 @@ msgid "" "tp_name` initializer ``\"P.Q.M.T\"``." msgstr "" -#: c-api/typeobj.rst:588 +#: c-api/typeobj.rst:566 msgid "" "For :ref:`dynamically allocated type objects `, this should just " "be the type name, and the module name explicitly stored in the type dict as " "the value for key ``'__module__'``." msgstr "" -#: c-api/typeobj.rst:593 +#: c-api/typeobj.rst:571 msgid "" "For :ref:`statically allocated type objects `, the *tp_name* " "field should contain a dot. Everything before the last dot is made " @@ -1366,7 +1339,7 @@ msgid "" "the last dot is made accessible as the :attr:`~type.__name__` attribute." msgstr "" -#: c-api/typeobj.rst:599 +#: c-api/typeobj.rst:577 msgid "" "If no dot is present, the entire :c:member:`~PyTypeObject.tp_name` field is " "made accessible as the :attr:`~type.__name__` attribute, and the :attr:" @@ -1376,19 +1349,19 @@ msgid "" "created with pydoc." msgstr "" -#: c-api/typeobj.rst:605 +#: c-api/typeobj.rst:583 msgid "" "This field must not be ``NULL``. It is the only required field in :c:func:" "`PyTypeObject` (other than potentially :c:member:`~PyTypeObject." "tp_itemsize`)." msgstr "" -#: c-api/typeobj.rst:617 +#: c-api/typeobj.rst:595 msgid "" "These fields allow calculating the size in bytes of instances of the type." msgstr "" -#: c-api/typeobj.rst:619 +#: c-api/typeobj.rst:597 msgid "" "There are two kinds of types: types with fixed-length instances have a zero :" "c:member:`!tp_itemsize` field, types with variable-length instances have a " @@ -1398,7 +1371,7 @@ msgid "" "`PyUnstable_Object_GC_NewWithExtraData`.)" msgstr "" -#: c-api/typeobj.rst:626 +#: c-api/typeobj.rst:604 msgid "" "For a type with variable-length instances, the instances must have an :c:" "member:`~PyVarObject.ob_size` field, and the instance size is :c:member:`!" @@ -1406,24 +1379,24 @@ msgid "" "\"length\" of the object." msgstr "" -#: c-api/typeobj.rst:631 +#: c-api/typeobj.rst:609 msgid "" "Functions like :c:func:`PyObject_NewVar` will take the value of N as an " "argument, and store in the instance's :c:member:`~PyVarObject.ob_size` " "field. Note that the :c:member:`~PyVarObject.ob_size` field may later be " "used for other purposes. For example, :py:type:`int` instances use the bits " "of :c:member:`~PyVarObject.ob_size` in an implementation-defined way; the " -"underlying storage and its size should be acessed using :c:func:" +"underlying storage and its size should be accessed using :c:func:" "`PyLong_Export`." msgstr "" -#: c-api/typeobj.rst:641 +#: c-api/typeobj.rst:619 msgid "" "The :c:member:`~PyVarObject.ob_size` field should be accessed using the :c:" "func:`Py_SIZE()` and :c:func:`Py_SET_SIZE()` macros." msgstr "" -#: c-api/typeobj.rst:644 +#: c-api/typeobj.rst:622 msgid "" "Also, the presence of an :c:member:`~PyVarObject.ob_size` field in the " "instance layout doesn't mean that the instance structure is variable-length. " @@ -1433,13 +1406,13 @@ msgid "" "`PyList_Size` instead.)" msgstr "" -#: c-api/typeobj.rst:651 +#: c-api/typeobj.rst:629 msgid "" "The :c:member:`!tp_basicsize` includes size needed for data of the type's :c:" "member:`~PyTypeObject.tp_base`, plus any extra data needed by each instance." msgstr "" -#: c-api/typeobj.rst:655 +#: c-api/typeobj.rst:633 msgid "" "The correct way to set :c:member:`!tp_basicsize` is to use the ``sizeof`` " "operator on the struct used to declare the instance layout. This struct must " @@ -1448,7 +1421,7 @@ msgid "" "tp_basicsize`." msgstr "" -#: c-api/typeobj.rst:661 +#: c-api/typeobj.rst:639 msgid "" "Since every type is a subtype of :py:type:`object`, this struct must " "include :c:type:`PyObject` or :c:type:`PyVarObject` (depending on whether :c:" @@ -1457,23 +1430,23 @@ msgid "" "respectively." msgstr "" -#: c-api/typeobj.rst:667 +#: c-api/typeobj.rst:645 msgid "" "The basic size does not include the GC header size, as that header is not " "part of :c:macro:`PyObject_HEAD`." msgstr "" -#: c-api/typeobj.rst:670 +#: c-api/typeobj.rst:648 msgid "" "For cases where struct used to declare the base type is unknown, see :c:" "member:`PyType_Spec.basicsize` and :c:func:`PyType_FromMetaclass`." msgstr "" -#: c-api/typeobj.rst:673 +#: c-api/typeobj.rst:651 msgid "Notes about alignment:" msgstr "" -#: c-api/typeobj.rst:675 +#: c-api/typeobj.rst:653 msgid "" ":c:member:`!tp_basicsize` must be a multiple of ``_Alignof(PyObject)``. When " "using ``sizeof`` on a ``struct`` that includes :c:macro:`PyObject_HEAD`, as " @@ -1482,7 +1455,7 @@ msgid "" "you." msgstr "" -#: c-api/typeobj.rst:680 +#: c-api/typeobj.rst:658 msgid "" "If the variable items require a particular alignment, :c:member:`!" "tp_basicsize` and :c:member:`!tp_itemsize` must each be a multiple of that " @@ -1490,14 +1463,14 @@ msgid "" "your responsibility that both fields are a multiple of ``_Alignof(double)``." msgstr "" -#: c-api/typeobj.rst:689 +#: c-api/typeobj.rst:667 msgid "" "These fields are inherited separately by subtypes. (That is, if the field is " "set to zero, :c:func:`PyType_Ready` will copy the value from the base type, " "indicating that the instances do not need additional storage.)" msgstr "" -#: c-api/typeobj.rst:694 +#: c-api/typeobj.rst:672 msgid "" "If the base type has a non-zero :c:member:`~PyTypeObject.tp_itemsize`, it is " "generally not safe to set :c:member:`~PyTypeObject.tp_itemsize` to a " @@ -1505,7 +1478,7 @@ msgid "" "implementation of the base type)." msgstr "" -#: c-api/typeobj.rst:701 +#: c-api/typeobj.rst:679 msgid "" "A pointer to the instance destructor function. This function must be " "defined unless the type guarantees that its instances will never be " @@ -1513,11 +1486,11 @@ msgid "" "The function signature is::" msgstr "" -#: c-api/typeobj.rst:705 +#: c-api/typeobj.rst:683 msgid "void tp_dealloc(PyObject *self);" msgstr "" -#: c-api/typeobj.rst:707 +#: c-api/typeobj.rst:685 msgid "" "The destructor function is called by the :c:func:`Py_DECREF` and :c:func:" "`Py_XDECREF` macros when the new reference count is zero. At this point, " @@ -1535,14 +1508,14 @@ msgid "" "allocated using :c:macro:`PyObject_GC_New` or :c:macro:`PyObject_GC_NewVar`." msgstr "" -#: c-api/typeobj.rst:722 +#: c-api/typeobj.rst:700 msgid "" "If the type supports garbage collection (has the :c:macro:" "`Py_TPFLAGS_HAVE_GC` flag bit set), the destructor should call :c:func:" "`PyObject_GC_UnTrack` before clearing any member fields." msgstr "" -#: c-api/typeobj.rst:726 +#: c-api/typeobj.rst:704 msgid "" "static void foo_dealloc(foo_object *self) {\n" " PyObject_GC_UnTrack(self);\n" @@ -1551,7 +1524,7 @@ msgid "" "}" msgstr "" -#: c-api/typeobj.rst:734 +#: c-api/typeobj.rst:712 msgid "" "Finally, if the type is heap allocated (:c:macro:`Py_TPFLAGS_HEAPTYPE`), the " "deallocator should release the owned reference to its type object (via :c:" @@ -1559,7 +1532,7 @@ msgid "" "dangling pointers, the recommended way to achieve this is:" msgstr "" -#: c-api/typeobj.rst:740 +#: c-api/typeobj.rst:718 msgid "" "static void foo_dealloc(foo_object *self) {\n" " PyTypeObject *tp = Py_TYPE(self);\n" @@ -1569,7 +1542,7 @@ msgid "" "}" msgstr "" -#: c-api/typeobj.rst:751 +#: c-api/typeobj.rst:729 msgid "" "In a garbage collected Python, :c:member:`!tp_dealloc` may be called from " "any Python thread, not just the thread which created the object (if the " @@ -1582,28 +1555,28 @@ msgid "" "member:`!tp_dealloc` will not violate any assumptions of the library." msgstr "" -#: c-api/typeobj.rst:770 +#: c-api/typeobj.rst:748 msgid "" "An optional offset to a per-instance function that implements calling the " "object using the :ref:`vectorcall protocol `, a more efficient " "alternative of the simpler :c:member:`~PyTypeObject.tp_call`." msgstr "" -#: c-api/typeobj.rst:775 +#: c-api/typeobj.rst:753 msgid "" "This field is only used if the flag :c:macro:`Py_TPFLAGS_HAVE_VECTORCALL` is " "set. If so, this must be a positive integer containing the offset in the " "instance of a :c:type:`vectorcallfunc` pointer." msgstr "" -#: c-api/typeobj.rst:779 +#: c-api/typeobj.rst:757 msgid "" "The *vectorcallfunc* pointer may be ``NULL``, in which case the instance " "behaves as if :c:macro:`Py_TPFLAGS_HAVE_VECTORCALL` was not set: calling the " "instance falls back to :c:member:`~PyTypeObject.tp_call`." msgstr "" -#: c-api/typeobj.rst:783 +#: c-api/typeobj.rst:761 msgid "" "Any class that sets ``Py_TPFLAGS_HAVE_VECTORCALL`` must also set :c:member:" "`~PyTypeObject.tp_call` and make sure its behaviour is consistent with the " @@ -1611,13 +1584,13 @@ msgid "" "`PyVectorcall_Call`." msgstr "" -#: c-api/typeobj.rst:790 +#: c-api/typeobj.rst:768 msgid "" "Before version 3.8, this slot was named ``tp_print``. In Python 2.x, it was " "used for printing to a file. In Python 3.0 to 3.7, it was unused." msgstr "" -#: c-api/typeobj.rst:796 +#: c-api/typeobj.rst:774 msgid "" "Before version 3.12, it was not recommended for :ref:`mutable heap types " "` to implement the vectorcall protocol. When a user sets :attr:" @@ -1627,7 +1600,7 @@ msgid "" "`Py_TPFLAGS_HAVE_VECTORCALL` flag." msgstr "" -#: c-api/typeobj.rst:806 +#: c-api/typeobj.rst:784 msgid "" "This field is always inherited. However, the :c:macro:" "`Py_TPFLAGS_HAVE_VECTORCALL` flag is not always inherited. If it's not set, " @@ -1635,11 +1608,11 @@ msgid "" "func:`PyVectorcall_Call` is explicitly called." msgstr "" -#: c-api/typeobj.rst:815 +#: c-api/typeobj.rst:793 msgid "An optional pointer to the get-attribute-string function." msgstr "" -#: c-api/typeobj.rst:817 +#: c-api/typeobj.rst:795 msgid "" "This field is deprecated. When it is defined, it should point to a function " "that acts the same as the :c:member:`~PyTypeObject.tp_getattro` function, " @@ -1647,13 +1620,13 @@ msgid "" "attribute name." msgstr "" -#: c-api/typeobj.rst:1015 +#: c-api/typeobj.rst:997 msgid "" "Group: :c:member:`~PyTypeObject.tp_getattr`, :c:member:`~PyTypeObject." "tp_getattro`" msgstr "" -#: c-api/typeobj.rst:825 +#: c-api/typeobj.rst:803 msgid "" "This field is inherited by subtypes together with :c:member:`~PyTypeObject." "tp_getattro`: a subtype inherits both :c:member:`~PyTypeObject.tp_getattr` " @@ -1662,12 +1635,12 @@ msgid "" "tp_getattro` are both ``NULL``." msgstr "" -#: c-api/typeobj.rst:1028 +#: c-api/typeobj.rst:1010 msgid "" "An optional pointer to the function for setting and deleting attributes." msgstr "" -#: c-api/typeobj.rst:834 +#: c-api/typeobj.rst:812 msgid "" "This field is deprecated. When it is defined, it should point to a function " "that acts the same as the :c:member:`~PyTypeObject.tp_setattro` function, " @@ -1675,13 +1648,13 @@ msgid "" "attribute name." msgstr "" -#: c-api/typeobj.rst:1041 +#: c-api/typeobj.rst:1023 msgid "" "Group: :c:member:`~PyTypeObject.tp_setattr`, :c:member:`~PyTypeObject." "tp_setattro`" msgstr "" -#: c-api/typeobj.rst:842 +#: c-api/typeobj.rst:820 msgid "" "This field is inherited by subtypes together with :c:member:`~PyTypeObject." "tp_setattro`: a subtype inherits both :c:member:`~PyTypeObject.tp_setattr` " @@ -1690,38 +1663,38 @@ msgid "" "tp_setattro` are both ``NULL``." msgstr "" -#: c-api/typeobj.rst:849 +#: c-api/typeobj.rst:827 msgid "" "Pointer to an additional structure that contains fields relevant only to " "objects which implement :term:`awaitable` and :term:`asynchronous iterator` " "protocols at the C-level. See :ref:`async-structs` for details." msgstr "" -#: c-api/typeobj.rst:853 +#: c-api/typeobj.rst:831 msgid "Formerly known as ``tp_compare`` and ``tp_reserved``." msgstr "" -#: c-api/typeobj.rst:858 +#: c-api/typeobj.rst:836 msgid "" "The :c:member:`~PyTypeObject.tp_as_async` field is not inherited, but the " "contained fields are inherited individually." msgstr "" -#: c-api/typeobj.rst:866 +#: c-api/typeobj.rst:844 msgid "" "An optional pointer to a function that implements the built-in function :" "func:`repr`." msgstr "" -#: c-api/typeobj.rst:869 +#: c-api/typeobj.rst:847 msgid "The signature is the same as for :c:func:`PyObject_Repr`::" msgstr "" -#: c-api/typeobj.rst:871 +#: c-api/typeobj.rst:849 msgid "PyObject *tp_repr(PyObject *self);" msgstr "" -#: c-api/typeobj.rst:873 +#: c-api/typeobj.rst:851 msgid "" "The function must return a string or a Unicode object. Ideally, this " "function should return a string that, when passed to :func:`eval`, given a " @@ -1730,80 +1703,80 @@ msgid "" "``'>'`` from which both the type and the value of the object can be deduced." msgstr "" -#: c-api/typeobj.rst:996 c-api/typeobj.rst:1047 c-api/typeobj.rst:1617 -#: c-api/typeobj.rst:1768 c-api/typeobj.rst:1876 c-api/typeobj.rst:1935 -#: c-api/typeobj.rst:1998 c-api/typeobj.rst:2029 +#: c-api/typeobj.rst:941 c-api/typeobj.rst:1003 c-api/typeobj.rst:1070 +#: c-api/typeobj.rst:1659 c-api/typeobj.rst:1809 c-api/typeobj.rst:1925 +#: c-api/typeobj.rst:1985 c-api/typeobj.rst:2037 msgid "**Default:**" msgstr "" -#: c-api/typeobj.rst:886 +#: c-api/typeobj.rst:864 msgid "" "When this field is not set, a string of the form ``<%s object at %p>`` is " "returned, where ``%s`` is replaced by the type name, and ``%p`` by the " "object's memory address." msgstr "" -#: c-api/typeobj.rst:893 +#: c-api/typeobj.rst:871 msgid "" "Pointer to an additional structure that contains fields relevant only to " "objects which implement the number protocol. These fields are documented " "in :ref:`number-structs`." msgstr "" -#: c-api/typeobj.rst:899 +#: c-api/typeobj.rst:877 msgid "" "The :c:member:`~PyTypeObject.tp_as_number` field is not inherited, but the " "contained fields are inherited individually." msgstr "" -#: c-api/typeobj.rst:905 +#: c-api/typeobj.rst:883 msgid "" "Pointer to an additional structure that contains fields relevant only to " "objects which implement the sequence protocol. These fields are documented " "in :ref:`sequence-structs`." msgstr "" -#: c-api/typeobj.rst:911 +#: c-api/typeobj.rst:889 msgid "" "The :c:member:`~PyTypeObject.tp_as_sequence` field is not inherited, but the " "contained fields are inherited individually." msgstr "" -#: c-api/typeobj.rst:917 +#: c-api/typeobj.rst:895 msgid "" "Pointer to an additional structure that contains fields relevant only to " "objects which implement the mapping protocol. These fields are documented " "in :ref:`mapping-structs`." msgstr "" -#: c-api/typeobj.rst:923 +#: c-api/typeobj.rst:901 msgid "" "The :c:member:`~PyTypeObject.tp_as_mapping` field is not inherited, but the " "contained fields are inherited individually." msgstr "" -#: c-api/typeobj.rst:931 +#: c-api/typeobj.rst:909 msgid "" "An optional pointer to a function that implements the built-in function :" "func:`hash`." msgstr "" -#: c-api/typeobj.rst:934 +#: c-api/typeobj.rst:912 msgid "The signature is the same as for :c:func:`PyObject_Hash`::" msgstr "" -#: c-api/typeobj.rst:936 +#: c-api/typeobj.rst:914 msgid "Py_hash_t tp_hash(PyObject *);" msgstr "" -#: c-api/typeobj.rst:938 +#: c-api/typeobj.rst:916 msgid "" "The value ``-1`` should not be returned as a normal return value; when an " "error occurs during the computation of the hash value, the function should " "set an exception and return ``-1``." msgstr "" -#: c-api/typeobj.rst:942 +#: c-api/typeobj.rst:920 msgid "" "When this field is not set (*and* :c:member:`~PyTypeObject.tp_richcompare` " "is not set), an attempt to take the hash of the object raises :exc:" @@ -1811,7 +1784,7 @@ msgid "" "`PyObject_HashNotImplemented`." msgstr "" -#: c-api/typeobj.rst:946 +#: c-api/typeobj.rst:924 msgid "" "This field can be set explicitly to :c:func:`PyObject_HashNotImplemented` to " "block inheritance of the hash method from a parent type. This is interpreted " @@ -1822,13 +1795,13 @@ msgid "" "`PyObject_HashNotImplemented`." msgstr "" -#: c-api/typeobj.rst:1610 +#: c-api/typeobj.rst:1618 msgid "" "Group: :c:member:`~PyTypeObject.tp_hash`, :c:member:`~PyTypeObject." "tp_richcompare`" msgstr "" -#: c-api/typeobj.rst:958 +#: c-api/typeobj.rst:936 msgid "" "This field is inherited by subtypes together with :c:member:`~PyTypeObject." "tp_richcompare`: a subtype inherits both of :c:member:`~PyTypeObject." @@ -1837,18 +1810,22 @@ msgid "" "are both ``NULL``." msgstr "" -#: c-api/typeobj.rst:966 +#: c-api/typeobj.rst:943 +msgid ":c:data:`PyBaseObject_Type` uses :c:func:`PyObject_GenericHash`." +msgstr "" + +#: c-api/typeobj.rst:948 msgid "" "An optional pointer to a function that implements calling the object. This " "should be ``NULL`` if the object is not callable. The signature is the same " "as for :c:func:`PyObject_Call`::" msgstr "" -#: c-api/typeobj.rst:970 +#: c-api/typeobj.rst:952 msgid "PyObject *tp_call(PyObject *self, PyObject *args, PyObject *kwargs);" msgstr "" -#: c-api/typeobj.rst:979 +#: c-api/typeobj.rst:961 msgid "" "An optional pointer to a function that implements the built-in operation :" "func:`str`. (Note that :class:`str` is a type now, and :func:`str` calls " @@ -1857,15 +1834,15 @@ msgid "" "this handler.)" msgstr "" -#: c-api/typeobj.rst:984 +#: c-api/typeobj.rst:966 msgid "The signature is the same as for :c:func:`PyObject_Str`::" msgstr "" -#: c-api/typeobj.rst:986 +#: c-api/typeobj.rst:968 msgid "PyObject *tp_str(PyObject *self);" msgstr "" -#: c-api/typeobj.rst:988 +#: c-api/typeobj.rst:970 msgid "" "The function must return a string or a Unicode object. It should be a " "\"friendly\" string representation of the object, as this is the " @@ -1873,32 +1850,32 @@ msgid "" "function." msgstr "" -#: c-api/typeobj.rst:998 +#: c-api/typeobj.rst:980 msgid "" "When this field is not set, :c:func:`PyObject_Repr` is called to return a " "string representation." msgstr "" -#: c-api/typeobj.rst:1004 +#: c-api/typeobj.rst:986 msgid "An optional pointer to the get-attribute function." msgstr "" -#: c-api/typeobj.rst:1006 +#: c-api/typeobj.rst:988 msgid "The signature is the same as for :c:func:`PyObject_GetAttr`::" msgstr "" -#: c-api/typeobj.rst:1008 +#: c-api/typeobj.rst:990 msgid "PyObject *tp_getattro(PyObject *self, PyObject *attr);" msgstr "" -#: c-api/typeobj.rst:1010 +#: c-api/typeobj.rst:992 msgid "" "It is usually convenient to set this field to :c:func:" "`PyObject_GenericGetAttr`, which implements the normal way of looking for " "object attributes." msgstr "" -#: c-api/typeobj.rst:1017 +#: c-api/typeobj.rst:999 msgid "" "This field is inherited by subtypes together with :c:member:`~PyTypeObject." "tp_getattr`: a subtype inherits both :c:member:`~PyTypeObject.tp_getattr` " @@ -1907,19 +1884,19 @@ msgid "" "tp_getattro` are both ``NULL``." msgstr "" -#: c-api/typeobj.rst:1023 +#: c-api/typeobj.rst:1005 msgid ":c:data:`PyBaseObject_Type` uses :c:func:`PyObject_GenericGetAttr`." msgstr "" -#: c-api/typeobj.rst:1030 +#: c-api/typeobj.rst:1012 msgid "The signature is the same as for :c:func:`PyObject_SetAttr`::" msgstr "" -#: c-api/typeobj.rst:1032 +#: c-api/typeobj.rst:1014 msgid "int tp_setattro(PyObject *self, PyObject *attr, PyObject *value);" msgstr "" -#: c-api/typeobj.rst:1034 +#: c-api/typeobj.rst:1016 msgid "" "In addition, setting *value* to ``NULL`` to delete an attribute must be " "supported. It is usually convenient to set this field to :c:func:" @@ -1927,7 +1904,7 @@ msgid "" "attributes." msgstr "" -#: c-api/typeobj.rst:1043 +#: c-api/typeobj.rst:1025 msgid "" "This field is inherited by subtypes together with :c:member:`~PyTypeObject." "tp_setattr`: a subtype inherits both :c:member:`~PyTypeObject.tp_setattr` " @@ -1936,24 +1913,24 @@ msgid "" "tp_setattro` are both ``NULL``." msgstr "" -#: c-api/typeobj.rst:1049 +#: c-api/typeobj.rst:1031 msgid ":c:data:`PyBaseObject_Type` uses :c:func:`PyObject_GenericSetAttr`." msgstr "" -#: c-api/typeobj.rst:1054 +#: c-api/typeobj.rst:1036 msgid "" "Pointer to an additional structure that contains fields relevant only to " "objects which implement the buffer interface. These fields are documented " "in :ref:`buffer-structs`." msgstr "" -#: c-api/typeobj.rst:1060 +#: c-api/typeobj.rst:1042 msgid "" "The :c:member:`~PyTypeObject.tp_as_buffer` field is not inherited, but the " "contained fields are inherited individually." msgstr "" -#: c-api/typeobj.rst:1066 +#: c-api/typeobj.rst:1048 msgid "" "This field is a bit mask of various flags. Some flags indicate variant " "semantics for certain situations; others are used to indicate that certain " @@ -1965,7 +1942,7 @@ msgid "" "accessed and must be considered to have a zero or ``NULL`` value instead." msgstr "" -#: c-api/typeobj.rst:1076 +#: c-api/typeobj.rst:1058 msgid "" "Inheritance of this field is complicated. Most flag bits are inherited " "individually, i.e. if the base type has a flag bit set, the subtype inherits " @@ -1981,17 +1958,17 @@ msgid "" "*really* inherited individually?" msgstr "" -#: c-api/typeobj.rst:1090 +#: c-api/typeobj.rst:1072 msgid "" ":c:data:`PyBaseObject_Type` uses ``Py_TPFLAGS_DEFAULT | " "Py_TPFLAGS_BASETYPE``." msgstr "" -#: c-api/typeobj.rst:1093 +#: c-api/typeobj.rst:1075 msgid "**Bit Masks:**" msgstr "" -#: c-api/typeobj.rst:1097 +#: c-api/typeobj.rst:1079 msgid "" "The following bit masks are currently defined; these can be ORed together " "using the ``|`` operator to form the value of the :c:member:`~PyTypeObject." @@ -2000,7 +1977,7 @@ msgid "" "zero." msgstr "" -#: c-api/typeobj.rst:1104 +#: c-api/typeobj.rst:1086 msgid "" "This bit is set when the type object itself is allocated on the heap, for " "example, types created dynamically using :c:func:`PyType_FromSpec`. In this " @@ -2013,30 +1990,30 @@ msgid "" "reference cycle with their own module object." msgstr "" -#: c-api/typeobj.rst:1126 c-api/typeobj.rst:1146 c-api/typeobj.rst:1178 +#: c-api/typeobj.rst:1108 c-api/typeobj.rst:1128 c-api/typeobj.rst:1160 msgid "???" msgstr "" -#: c-api/typeobj.rst:1120 +#: c-api/typeobj.rst:1102 msgid "" "This bit is set when the type can be used as the base type of another type. " "If this bit is clear, the type cannot be subtyped (similar to a \"final\" " "class in Java)." msgstr "" -#: c-api/typeobj.rst:1131 +#: c-api/typeobj.rst:1113 msgid "" "This bit is set when the type object has been fully initialized by :c:func:" "`PyType_Ready`." msgstr "" -#: c-api/typeobj.rst:1141 +#: c-api/typeobj.rst:1123 msgid "" "This bit is set while :c:func:`PyType_Ready` is in the process of " "initializing the type object." msgstr "" -#: c-api/typeobj.rst:1151 +#: c-api/typeobj.rst:1133 msgid "" "This bit is set when the object supports garbage collection. If this bit is " "set, instances must be created using :c:macro:`PyObject_GC_New` and " @@ -2046,13 +2023,13 @@ msgid "" "tp_clear` are present in the type object." msgstr "" -#: c-api/typeobj.rst:1481 c-api/typeobj.rst:1549 +#: c-api/typeobj.rst:1483 c-api/typeobj.rst:1557 msgid "" "Group: :c:macro:`Py_TPFLAGS_HAVE_GC`, :c:member:`~PyTypeObject." "tp_traverse`, :c:member:`~PyTypeObject.tp_clear`" msgstr "" -#: c-api/typeobj.rst:1162 +#: c-api/typeobj.rst:1144 msgid "" "The :c:macro:`Py_TPFLAGS_HAVE_GC` flag bit is inherited together with the :c:" "member:`~PyTypeObject.tp_traverse` and :c:member:`~PyTypeObject.tp_clear` " @@ -2062,99 +2039,105 @@ msgid "" "values." msgstr "" -#: c-api/typeobj.rst:1172 +#: c-api/typeobj.rst:1154 msgid "" "This is a bitmask of all the bits that pertain to the existence of certain " "fields in the type object and its extension structures. Currently, it " "includes the following bits: :c:macro:`Py_TPFLAGS_HAVE_STACKLESS_EXTENSION`." msgstr "" -#: c-api/typeobj.rst:1183 +#: c-api/typeobj.rst:1165 msgid "This bit indicates that objects behave like unbound methods." msgstr "" -#: c-api/typeobj.rst:1185 +#: c-api/typeobj.rst:1167 msgid "If this flag is set for ``type(meth)``, then:" msgstr "" -#: c-api/typeobj.rst:1187 +#: c-api/typeobj.rst:1169 msgid "" "``meth.__get__(obj, cls)(*args, **kwds)`` (with ``obj`` not None) must be " "equivalent to ``meth(obj, *args, **kwds)``." msgstr "" -#: c-api/typeobj.rst:1190 +#: c-api/typeobj.rst:1172 msgid "" "``meth.__get__(None, cls)(*args, **kwds)`` must be equivalent to " "``meth(*args, **kwds)``." msgstr "" -#: c-api/typeobj.rst:1193 +#: c-api/typeobj.rst:1175 msgid "" "This flag enables an optimization for typical method calls like ``obj." "meth()``: it avoids creating a temporary \"bound method\" object for ``obj." "meth``." msgstr "" -#: c-api/typeobj.rst:1201 +#: c-api/typeobj.rst:1183 msgid "" "This flag is never inherited by types without the :c:macro:" "`Py_TPFLAGS_IMMUTABLETYPE` flag set. For extension types, it is inherited " "whenever :c:member:`~PyTypeObject.tp_descr_get` is inherited." msgstr "" -#: c-api/typeobj.rst:1207 +#: c-api/typeobj.rst:1189 msgid "" "This bit indicates that instances of the class have a `~object.__dict__` " "attribute, and that the space for the dictionary is managed by the VM." msgstr "" -#: c-api/typeobj.rst:1210 +#: c-api/typeobj.rst:1192 msgid "If this flag is set, :c:macro:`Py_TPFLAGS_HAVE_GC` should also be set." msgstr "" -#: c-api/typeobj.rst:1216 +#: c-api/typeobj.rst:1194 +msgid "" +"The type traverse function must call :c:func:`PyObject_VisitManagedDict` and " +"its clear function must call :c:func:`PyObject_ClearManagedDict`." +msgstr "" + +#: c-api/typeobj.rst:1201 msgid "" "This flag is inherited unless the :c:member:`~PyTypeObject.tp_dictoffset` " "field is set in a superclass." msgstr "" -#: c-api/typeobj.rst:1222 +#: c-api/typeobj.rst:1207 msgid "" "This bit indicates that instances of the class should be weakly " "referenceable." msgstr "" -#: c-api/typeobj.rst:1229 +#: c-api/typeobj.rst:1214 msgid "" "This flag is inherited unless the :c:member:`~PyTypeObject." "tp_weaklistoffset` field is set in a superclass." msgstr "" -#: c-api/typeobj.rst:1235 +#: c-api/typeobj.rst:1220 msgid "" "Only usable with variable-size types, i.e. ones with non-zero :c:member:" "`~PyTypeObject.tp_itemsize`." msgstr "" -#: c-api/typeobj.rst:1238 +#: c-api/typeobj.rst:1223 msgid "" "Indicates that the variable-sized portion of an instance of this type is at " "the end of the instance's memory area, at an offset of ``Py_TYPE(obj)-" ">tp_basicsize`` (which may be different in each subclass)." msgstr "" -#: c-api/typeobj.rst:1243 +#: c-api/typeobj.rst:1228 msgid "" "When setting this flag, be sure that all superclasses either use this memory " "layout, or are not variable-sized. Python does not check this." msgstr "" -#: c-api/typeobj.rst:1251 +#: c-api/typeobj.rst:1236 msgid "This flag is inherited." msgstr "" -#: c-api/typeobj.rst:1265 +#: c-api/typeobj.rst:1250 msgid "" "These flags are used by functions such as :c:func:`PyLong_Check` to quickly " "determine if a type is a subclass of a built-in type; such specific checks " @@ -2164,90 +2147,90 @@ msgid "" "behave differently depending on what kind of check is used." msgstr "" -#: c-api/typeobj.rst:1276 +#: c-api/typeobj.rst:1261 msgid "" "This bit is set when the :c:member:`~PyTypeObject.tp_finalize` slot is " "present in the type structure." msgstr "" -#: c-api/typeobj.rst:1281 +#: c-api/typeobj.rst:1266 msgid "" "This flag isn't necessary anymore, as the interpreter assumes the :c:member:" "`~PyTypeObject.tp_finalize` slot is always present in the type structure." msgstr "" -#: c-api/typeobj.rst:1289 +#: c-api/typeobj.rst:1274 msgid "" "This bit is set when the class implements the :ref:`vectorcall protocol " "`. See :c:member:`~PyTypeObject.tp_vectorcall_offset` for " "details." msgstr "" -#: c-api/typeobj.rst:1295 +#: c-api/typeobj.rst:1280 msgid "" "This bit is inherited if :c:member:`~PyTypeObject.tp_call` is also inherited." msgstr "" -#: c-api/typeobj.rst:1302 +#: c-api/typeobj.rst:1287 msgid "" "This flag is now removed from a class when the class's :py:meth:`~object." "__call__` method is reassigned." msgstr "" -#: c-api/typeobj.rst:1305 +#: c-api/typeobj.rst:1290 msgid "This flag can now be inherited by mutable classes." msgstr "" -#: c-api/typeobj.rst:1309 +#: c-api/typeobj.rst:1294 msgid "" "This bit is set for type objects that are immutable: type attributes cannot " "be set nor deleted." msgstr "" -#: c-api/typeobj.rst:1311 +#: c-api/typeobj.rst:1296 msgid "" ":c:func:`PyType_Ready` automatically applies this flag to :ref:`static types " "`." msgstr "" -#: c-api/typeobj.rst:1316 +#: c-api/typeobj.rst:1301 msgid "This flag is not inherited." msgstr "" -#: c-api/typeobj.rst:1322 +#: c-api/typeobj.rst:1307 msgid "" "Disallow creating instances of the type: set :c:member:`~PyTypeObject." "tp_new` to NULL and don't create the ``__new__`` key in the type dictionary." msgstr "" -#: c-api/typeobj.rst:1326 +#: c-api/typeobj.rst:1311 msgid "" "The flag must be set before creating the type, not after. For example, it " "must be set before :c:func:`PyType_Ready` is called on the type." msgstr "" -#: c-api/typeobj.rst:1329 +#: c-api/typeobj.rst:1314 msgid "" "The flag is set automatically on :ref:`static types ` if :c:" "member:`~PyTypeObject.tp_base` is NULL or ``&PyBaseObject_Type`` and :c:" "member:`~PyTypeObject.tp_new` is NULL." msgstr "" -#: c-api/typeobj.rst:1335 +#: c-api/typeobj.rst:1320 msgid "" "This flag is not inherited. However, subclasses will not be instantiable " "unless they provide a non-NULL :c:member:`~PyTypeObject.tp_new` (which is " "only possible via the C API)." msgstr "" -#: c-api/typeobj.rst:1342 +#: c-api/typeobj.rst:1327 msgid "" "To disallow instantiating a class directly but allow instantiating its " "subclasses (e.g. for an :term:`abstract base class`), do not use this flag. " "Instead, make :c:member:`~PyTypeObject.tp_new` only succeed for subclasses." msgstr "" -#: c-api/typeobj.rst:1353 +#: c-api/typeobj.rst:1338 msgid "" "This bit indicates that instances of the class may match mapping patterns " "when used as the subject of a :keyword:`match` block. It is automatically " @@ -2255,23 +2238,23 @@ msgid "" "unset when registering :class:`collections.abc.Sequence`." msgstr "" -#: c-api/typeobj.rst:1382 +#: c-api/typeobj.rst:1367 msgid "" ":c:macro:`Py_TPFLAGS_MAPPING` and :c:macro:`Py_TPFLAGS_SEQUENCE` are " "mutually exclusive; it is an error to enable both flags simultaneously." msgstr "" -#: c-api/typeobj.rst:1365 +#: c-api/typeobj.rst:1350 msgid "" "This flag is inherited by types that do not already set :c:macro:" "`Py_TPFLAGS_SEQUENCE`." msgstr "" -#: c-api/typeobj.rst:1390 +#: c-api/typeobj.rst:1375 msgid ":pep:`634` -- Structural Pattern Matching: Specification" msgstr "" -#: c-api/typeobj.rst:1375 +#: c-api/typeobj.rst:1360 msgid "" "This bit indicates that instances of the class may match sequence patterns " "when used as the subject of a :keyword:`match` block. It is automatically " @@ -2279,53 +2262,53 @@ msgid "" "unset when registering :class:`collections.abc.Mapping`." msgstr "" -#: c-api/typeobj.rst:1387 +#: c-api/typeobj.rst:1372 msgid "" "This flag is inherited by types that do not already set :c:macro:" "`Py_TPFLAGS_MAPPING`." msgstr "" -#: c-api/typeobj.rst:1397 +#: c-api/typeobj.rst:1382 msgid "" "Internal. Do not set or unset this flag. To indicate that a class has " "changed call :c:func:`PyType_Modified`" msgstr "" -#: c-api/typeobj.rst:1401 +#: c-api/typeobj.rst:1386 msgid "" -"This flag is present in header files, but is an internal feature and should " -"not be used. It will be removed in a future version of CPython" +"This flag is present in header files, but is not be used. It will be removed " +"in a future version of CPython" msgstr "" -#: c-api/typeobj.rst:1407 +#: c-api/typeobj.rst:1392 msgid "" "An optional pointer to a NUL-terminated C string giving the docstring for " "this type object. This is exposed as the :attr:`~type.__doc__` attribute on " "the type and instances of the type." msgstr "" -#: c-api/typeobj.rst:1413 +#: c-api/typeobj.rst:1398 msgid "This field is *not* inherited by subtypes." msgstr "" -#: c-api/typeobj.rst:1418 +#: c-api/typeobj.rst:1403 msgid "" "An optional pointer to a traversal function for the garbage collector. This " "is only used if the :c:macro:`Py_TPFLAGS_HAVE_GC` flag bit is set. The " "signature is::" msgstr "" -#: c-api/typeobj.rst:1421 +#: c-api/typeobj.rst:1406 msgid "int tp_traverse(PyObject *self, visitproc visit, void *arg);" msgstr "" -#: c-api/typeobj.rst:1544 +#: c-api/typeobj.rst:1552 msgid "" "More information about Python's garbage collection scheme can be found in " "section :ref:`supporting-cycle-detection`." msgstr "" -#: c-api/typeobj.rst:1426 +#: c-api/typeobj.rst:1411 msgid "" "The :c:member:`~PyTypeObject.tp_traverse` pointer is used by the garbage " "collector to detect reference cycles. A typical implementation of a :c:" @@ -2335,7 +2318,7 @@ msgid "" "`!_thread` extension module::" msgstr "" -#: c-api/typeobj.rst:1432 +#: c-api/typeobj.rst:1417 msgid "" "static int\n" "local_traverse(localobject *self, visitproc visit, void *arg)\n" @@ -2347,7 +2330,7 @@ msgid "" "}" msgstr "" -#: c-api/typeobj.rst:1441 +#: c-api/typeobj.rst:1426 msgid "" "Note that :c:func:`Py_VISIT` is called only on those members that can " "participate in reference cycles. Although there is also a ``self->key`` " @@ -2355,14 +2338,47 @@ msgid "" "part of a reference cycle." msgstr "" -#: c-api/typeobj.rst:1445 +#: c-api/typeobj.rst:1430 msgid "" "On the other hand, even if you know a member can never be part of a cycle, " "as a debugging aid you may want to visit it anyway just so the :mod:`gc` " "module's :func:`~gc.get_referents` function will include it." msgstr "" -#: c-api/typeobj.rst:1450 +#: c-api/typeobj.rst:1434 +msgid "" +"Heap types (:c:macro:`Py_TPFLAGS_HEAPTYPE`) must visit their type with::" +msgstr "" + +#: c-api/typeobj.rst:1436 +msgid "Py_VISIT(Py_TYPE(self));" +msgstr "" + +#: c-api/typeobj.rst:1438 +msgid "" +"It is only needed since Python 3.9. To support Python 3.8 and older, this " +"line must be conditional::" +msgstr "" + +#: c-api/typeobj.rst:1441 +msgid "" +"#if PY_VERSION_HEX >= 0x03090000\n" +" Py_VISIT(Py_TYPE(self));\n" +"#endif" +msgstr "" + +#: c-api/typeobj.rst:1445 +msgid "" +"If the :c:macro:`Py_TPFLAGS_MANAGED_DICT` bit is set in the :c:member:" +"`~PyTypeObject.tp_flags` field, the traverse function must call :c:func:" +"`PyObject_VisitManagedDict` like this::" +msgstr "" + +#: c-api/typeobj.rst:1449 +msgid "PyObject_VisitManagedDict((PyObject*)self, visit, arg);" +msgstr "" + +#: c-api/typeobj.rst:1452 msgid "" "When implementing :c:member:`~PyTypeObject.tp_traverse`, only the members " "that the instance *owns* (by having :term:`strong references ` hold a reference to " "their type. Their traversal function must therefore either visit :c:func:" @@ -2391,14 +2407,14 @@ msgid "" "superclass). If they do not, the type object may not be garbage-collected." msgstr "" -#: c-api/typeobj.rst:1474 +#: c-api/typeobj.rst:1476 msgid "" "Heap-allocated types are expected to visit ``Py_TYPE(self)`` in " "``tp_traverse``. In earlier versions of Python, due to `bug 40217 `_, doing this may lead to crashes in subclasses." msgstr "" -#: c-api/typeobj.rst:1483 +#: c-api/typeobj.rst:1485 msgid "" "This field is inherited by subtypes together with :c:member:`~PyTypeObject." "tp_clear` and the :c:macro:`Py_TPFLAGS_HAVE_GC` flag bit: the flag bit, :c:" @@ -2406,18 +2422,18 @@ msgid "" "are all inherited from the base type if they are all zero in the subtype." msgstr "" -#: c-api/typeobj.rst:1491 +#: c-api/typeobj.rst:1493 msgid "" "An optional pointer to a clear function for the garbage collector. This is " "only used if the :c:macro:`Py_TPFLAGS_HAVE_GC` flag bit is set. The " "signature is::" msgstr "" -#: c-api/typeobj.rst:1494 +#: c-api/typeobj.rst:1496 msgid "int tp_clear(PyObject *);" msgstr "" -#: c-api/typeobj.rst:1496 +#: c-api/typeobj.rst:1498 msgid "" "The :c:member:`~PyTypeObject.tp_clear` member function is used to break " "reference cycles in cyclic garbage detected by the garbage collector. Taken " @@ -2432,7 +2448,7 @@ msgid "" "good reason to avoid implementing :c:member:`~PyTypeObject.tp_clear`." msgstr "" -#: c-api/typeobj.rst:1506 +#: c-api/typeobj.rst:1508 msgid "" "Implementations of :c:member:`~PyTypeObject.tp_clear` should drop the " "instance's references to those of its members that may be Python objects, " @@ -2440,7 +2456,7 @@ msgid "" "example::" msgstr "" -#: c-api/typeobj.rst:1510 +#: c-api/typeobj.rst:1512 msgid "" "static int\n" "local_clear(localobject *self)\n" @@ -2453,7 +2469,7 @@ msgid "" "}" msgstr "" -#: c-api/typeobj.rst:1520 +#: c-api/typeobj.rst:1522 msgid "" "The :c:func:`Py_CLEAR` macro should be used, because clearing references is " "delicate: the reference to the contained object must not be released (via :" @@ -2468,7 +2484,18 @@ msgid "" "performs the operations in a safe order." msgstr "" -#: c-api/typeobj.rst:1532 +#: c-api/typeobj.rst:1534 +msgid "" +"If the :c:macro:`Py_TPFLAGS_MANAGED_DICT` bit is set in the :c:member:" +"`~PyTypeObject.tp_flags` field, the traverse function must call :c:func:" +"`PyObject_ClearManagedDict` like this::" +msgstr "" + +#: c-api/typeobj.rst:1538 +msgid "PyObject_ClearManagedDict((PyObject*)self);" +msgstr "" + +#: c-api/typeobj.rst:1540 msgid "" "Note that :c:member:`~PyTypeObject.tp_clear` is not *always* called before " "an instance is deallocated. For example, when reference counting is enough " @@ -2476,7 +2503,7 @@ msgid "" "is not involved and :c:member:`~PyTypeObject.tp_dealloc` is called directly." msgstr "" -#: c-api/typeobj.rst:1538 +#: c-api/typeobj.rst:1546 msgid "" "Because the goal of :c:member:`~PyTypeObject.tp_clear` functions is to break " "reference cycles, it's not necessary to clear contained objects like Python " @@ -2486,7 +2513,7 @@ msgid "" "invoke :c:member:`~PyTypeObject.tp_clear`." msgstr "" -#: c-api/typeobj.rst:1551 +#: c-api/typeobj.rst:1559 msgid "" "This field is inherited by subtypes together with :c:member:`~PyTypeObject." "tp_traverse` and the :c:macro:`Py_TPFLAGS_HAVE_GC` flag bit: the flag bit, :" @@ -2494,22 +2521,22 @@ msgid "" "are all inherited from the base type if they are all zero in the subtype." msgstr "" -#: c-api/typeobj.rst:1559 +#: c-api/typeobj.rst:1567 msgid "" "An optional pointer to the rich comparison function, whose signature is::" msgstr "" -#: c-api/typeobj.rst:1561 +#: c-api/typeobj.rst:1569 msgid "PyObject *tp_richcompare(PyObject *self, PyObject *other, int op);" msgstr "" -#: c-api/typeobj.rst:1563 +#: c-api/typeobj.rst:1571 msgid "" "The first parameter is guaranteed to be an instance of the type that is " "defined by :c:type:`PyTypeObject`." msgstr "" -#: c-api/typeobj.rst:1566 +#: c-api/typeobj.rst:1574 msgid "" "The function should return the result of the comparison (usually ``Py_True`` " "or ``Py_False``). If the comparison is undefined, it must return " @@ -2517,50 +2544,50 @@ msgid "" "set an exception condition." msgstr "" -#: c-api/typeobj.rst:1571 +#: c-api/typeobj.rst:1579 msgid "" "The following constants are defined to be used as the third argument for :c:" "member:`~PyTypeObject.tp_richcompare` and for :c:func:`PyObject_RichCompare`:" msgstr "" -#: c-api/typeobj.rst:1577 +#: c-api/typeobj.rst:1585 msgid "Constant" msgstr "" -#: c-api/typeobj.rst:1577 +#: c-api/typeobj.rst:1585 msgid "Comparison" msgstr "" -#: c-api/typeobj.rst:1579 +#: c-api/typeobj.rst:1587 msgid "``<``" msgstr "" -#: c-api/typeobj.rst:1581 +#: c-api/typeobj.rst:1589 msgid "``<=``" msgstr "" -#: c-api/typeobj.rst:1583 +#: c-api/typeobj.rst:1591 msgid "``==``" msgstr "" -#: c-api/typeobj.rst:1585 +#: c-api/typeobj.rst:1593 msgid "``!=``" msgstr "" -#: c-api/typeobj.rst:1587 +#: c-api/typeobj.rst:1595 msgid "``>``" msgstr "" -#: c-api/typeobj.rst:1589 +#: c-api/typeobj.rst:1597 msgid "``>=``" msgstr "" -#: c-api/typeobj.rst:1592 +#: c-api/typeobj.rst:1600 msgid "" "The following macro is defined to ease writing rich comparison functions:" msgstr "" -#: c-api/typeobj.rst:1596 +#: c-api/typeobj.rst:1604 msgid "" "Return ``Py_True`` or ``Py_False`` from the function, depending on the " "result of a comparison. VAL_A and VAL_B must be orderable by C comparison " @@ -2568,15 +2595,15 @@ msgid "" "specifies the requested operation, as for :c:func:`PyObject_RichCompare`." msgstr "" -#: c-api/typeobj.rst:1602 +#: c-api/typeobj.rst:1610 msgid "The returned value is a new :term:`strong reference`." msgstr "" -#: c-api/typeobj.rst:1604 +#: c-api/typeobj.rst:1612 msgid "On error, sets an exception and returns ``NULL`` from the function." msgstr "" -#: c-api/typeobj.rst:1612 +#: c-api/typeobj.rst:1620 msgid "" "This field is inherited by subtypes together with :c:member:`~PyTypeObject." "tp_hash`: a subtype inherits :c:member:`~PyTypeObject.tp_richcompare` and :c:" @@ -2584,7 +2611,7 @@ msgid "" "tp_richcompare` and :c:member:`~PyTypeObject.tp_hash` are both ``NULL``." msgstr "" -#: c-api/typeobj.rst:1619 +#: c-api/typeobj.rst:1627 msgid "" ":c:data:`PyBaseObject_Type` provides a :c:member:`~PyTypeObject." "tp_richcompare` implementation, which may be inherited. However, if only :c:" @@ -2593,13 +2620,13 @@ msgid "" "comparisons." msgstr "" -#: c-api/typeobj.rst:1628 +#: c-api/typeobj.rst:1636 msgid "" "While this field is still supported, :c:macro:`Py_TPFLAGS_MANAGED_WEAKREF` " "should be used instead, if at all possible." msgstr "" -#: c-api/typeobj.rst:1631 +#: c-api/typeobj.rst:1639 msgid "" "If the instances of this type are weakly referenceable, this field is " "greater than zero and contains the offset in the instance structure of the " @@ -2609,19 +2636,19 @@ msgid "" "`PyObject*` which is initialized to ``NULL``." msgstr "" -#: c-api/typeobj.rst:1638 +#: c-api/typeobj.rst:1646 msgid "" "Do not confuse this field with :c:member:`~PyTypeObject.tp_weaklist`; that " "is the list head for weak references to the type object itself." msgstr "" -#: c-api/typeobj.rst:1641 +#: c-api/typeobj.rst:1649 msgid "" "It is an error to set both the :c:macro:`Py_TPFLAGS_MANAGED_WEAKREF` bit " "and :c:member:`~PyTypeObject.tp_weaklistoffset`." msgstr "" -#: c-api/typeobj.rst:1646 +#: c-api/typeobj.rst:1654 msgid "" "This field is inherited by subtypes, but see the rules listed below. A " "subtype may override this offset; this means that the subtype uses a " @@ -2630,7 +2657,7 @@ msgid "" "not be a problem." msgstr "" -#: c-api/typeobj.rst:1653 +#: c-api/typeobj.rst:1661 msgid "" "If the :c:macro:`Py_TPFLAGS_MANAGED_WEAKREF` bit is set in the :c:member:" "`~PyTypeObject.tp_flags` field, then :c:member:`~PyTypeObject." @@ -2638,32 +2665,32 @@ msgid "" "unsafe to use this field." msgstr "" -#: c-api/typeobj.rst:1661 +#: c-api/typeobj.rst:1669 msgid "" "An optional pointer to a function that returns an :term:`iterator` for the " "object. Its presence normally signals that the instances of this type are :" "term:`iterable` (although sequences may be iterable without this function)." msgstr "" -#: c-api/typeobj.rst:1665 +#: c-api/typeobj.rst:1673 msgid "This function has the same signature as :c:func:`PyObject_GetIter`::" msgstr "" -#: c-api/typeobj.rst:1667 +#: c-api/typeobj.rst:1675 msgid "PyObject *tp_iter(PyObject *self);" msgstr "" -#: c-api/typeobj.rst:1676 +#: c-api/typeobj.rst:1684 msgid "" "An optional pointer to a function that returns the next item in an :term:" "`iterator`. The signature is::" msgstr "" -#: c-api/typeobj.rst:1679 +#: c-api/typeobj.rst:1687 msgid "PyObject *tp_iternext(PyObject *self);" msgstr "" -#: c-api/typeobj.rst:1681 +#: c-api/typeobj.rst:1689 msgid "" "When the iterator is exhausted, it must return ``NULL``; a :exc:" "`StopIteration` exception may or may not be set. When another error occurs, " @@ -2671,74 +2698,74 @@ msgid "" "this type are iterators." msgstr "" -#: c-api/typeobj.rst:1686 +#: c-api/typeobj.rst:1694 msgid "" "Iterator types should also define the :c:member:`~PyTypeObject.tp_iter` " "function, and that function should return the iterator instance itself (not " "a new iterator instance)." msgstr "" -#: c-api/typeobj.rst:1690 +#: c-api/typeobj.rst:1698 msgid "This function has the same signature as :c:func:`PyIter_Next`." msgstr "" -#: c-api/typeobj.rst:1699 +#: c-api/typeobj.rst:1707 msgid "" "An optional pointer to a static ``NULL``-terminated array of :c:type:" "`PyMethodDef` structures, declaring regular methods of this type." msgstr "" -#: c-api/typeobj.rst:1702 +#: c-api/typeobj.rst:1710 msgid "" "For each entry in the array, an entry is added to the type's dictionary " "(see :c:member:`~PyTypeObject.tp_dict` below) containing a method descriptor." msgstr "" -#: c-api/typeobj.rst:1707 +#: c-api/typeobj.rst:1715 msgid "" "This field is not inherited by subtypes (methods are inherited through a " "different mechanism)." msgstr "" -#: c-api/typeobj.rst:1713 +#: c-api/typeobj.rst:1721 msgid "" "An optional pointer to a static ``NULL``-terminated array of :c:type:" "`PyMemberDef` structures, declaring regular data members (fields or slots) " "of instances of this type." msgstr "" -#: c-api/typeobj.rst:1717 +#: c-api/typeobj.rst:1725 msgid "" "For each entry in the array, an entry is added to the type's dictionary " "(see :c:member:`~PyTypeObject.tp_dict` below) containing a member descriptor." msgstr "" -#: c-api/typeobj.rst:1722 +#: c-api/typeobj.rst:1730 msgid "" "This field is not inherited by subtypes (members are inherited through a " "different mechanism)." msgstr "" -#: c-api/typeobj.rst:1728 +#: c-api/typeobj.rst:1736 msgid "" "An optional pointer to a static ``NULL``-terminated array of :c:type:" "`PyGetSetDef` structures, declaring computed attributes of instances of this " "type." msgstr "" -#: c-api/typeobj.rst:1731 +#: c-api/typeobj.rst:1739 msgid "" "For each entry in the array, an entry is added to the type's dictionary " "(see :c:member:`~PyTypeObject.tp_dict` below) containing a getset descriptor." msgstr "" -#: c-api/typeobj.rst:1736 +#: c-api/typeobj.rst:1744 msgid "" "This field is not inherited by subtypes (computed attributes are inherited " "through a different mechanism)." msgstr "" -#: c-api/typeobj.rst:1742 +#: c-api/typeobj.rst:1750 msgid "" "An optional pointer to a base type from which type properties are " "inherited. At this level, only single inheritance is supported; multiple " @@ -2746,7 +2773,7 @@ msgid "" "metatype." msgstr "" -#: c-api/typeobj.rst:1750 +#: c-api/typeobj.rst:1758 msgid "" "Slot initialization is subject to the rules of initializing globals. C99 " "requires the initializers to be \"address constants\". Function designators " @@ -2754,7 +2781,7 @@ msgid "" "valid C99 address constants." msgstr "" -#: c-api/typeobj.rst:1755 +#: c-api/typeobj.rst:1763 msgid "" "However, the unary '&' operator applied to a non-static variable like :c:" "data:`PyBaseObject_Type` is not required to produce an address constant. " @@ -2762,27 +2789,27 @@ msgid "" "strictly standard conforming in this particular behavior." msgstr "" -#: c-api/typeobj.rst:1761 +#: c-api/typeobj.rst:1769 msgid "" "Consequently, :c:member:`~PyTypeObject.tp_base` should be set in the " "extension module's init function." msgstr "" -#: c-api/typeobj.rst:1766 +#: c-api/typeobj.rst:1774 msgid "This field is not inherited by subtypes (obviously)." msgstr "" -#: c-api/typeobj.rst:1770 +#: c-api/typeobj.rst:1778 msgid "" "This field defaults to ``&PyBaseObject_Type`` (which to Python programmers " "is known as the type :class:`object`)." msgstr "" -#: c-api/typeobj.rst:1776 +#: c-api/typeobj.rst:1784 msgid "The type's dictionary is stored here by :c:func:`PyType_Ready`." msgstr "" -#: c-api/typeobj.rst:1778 +#: c-api/typeobj.rst:1786 msgid "" "This field should normally be initialized to ``NULL`` before PyType_Ready is " "called; it may also be initialized to a dictionary containing initial " @@ -2793,70 +2820,70 @@ msgid "" "be treated as read-only." msgstr "" -#: c-api/typeobj.rst:1786 +#: c-api/typeobj.rst:1794 msgid "" "Some types may not store their dictionary in this slot. Use :c:func:" "`PyType_GetDict` to retrieve the dictionary for an arbitrary type." msgstr "" -#: c-api/typeobj.rst:1792 +#: c-api/typeobj.rst:1800 msgid "" "Internals detail: For static builtin types, this is always ``NULL``. " "Instead, the dict for such types is stored on ``PyInterpreterState``. Use :c:" "func:`PyType_GetDict` to get the dict for an arbitrary type." msgstr "" -#: c-api/typeobj.rst:1798 +#: c-api/typeobj.rst:1806 msgid "" "This field is not inherited by subtypes (though the attributes defined in " "here are inherited through a different mechanism)." msgstr "" -#: c-api/typeobj.rst:1803 +#: c-api/typeobj.rst:1811 msgid "" "If this field is ``NULL``, :c:func:`PyType_Ready` will assign a new " "dictionary to it." msgstr "" -#: c-api/typeobj.rst:1808 +#: c-api/typeobj.rst:1816 msgid "" "It is not safe to use :c:func:`PyDict_SetItem` on or otherwise modify :c:" "member:`~PyTypeObject.tp_dict` with the dictionary C-API." msgstr "" -#: c-api/typeobj.rst:1814 +#: c-api/typeobj.rst:1822 msgid "An optional pointer to a \"descriptor get\" function." msgstr "" -#: c-api/typeobj.rst:1832 c-api/typeobj.rst:1926 c-api/typeobj.rst:1950 +#: c-api/typeobj.rst:1840 c-api/typeobj.rst:1934 c-api/typeobj.rst:1958 msgid "The function signature is::" msgstr "" -#: c-api/typeobj.rst:1818 +#: c-api/typeobj.rst:1826 msgid "PyObject * tp_descr_get(PyObject *self, PyObject *obj, PyObject *type);" msgstr "" -#: c-api/typeobj.rst:1829 +#: c-api/typeobj.rst:1837 msgid "" "An optional pointer to a function for setting and deleting a descriptor's " "value." msgstr "" -#: c-api/typeobj.rst:1834 +#: c-api/typeobj.rst:1842 msgid "int tp_descr_set(PyObject *self, PyObject *obj, PyObject *value);" msgstr "" -#: c-api/typeobj.rst:1836 +#: c-api/typeobj.rst:1844 msgid "The *value* argument is set to ``NULL`` to delete the value." msgstr "" -#: c-api/typeobj.rst:1847 +#: c-api/typeobj.rst:1855 msgid "" "While this field is still supported, :c:macro:`Py_TPFLAGS_MANAGED_DICT` " "should be used instead, if at all possible." msgstr "" -#: c-api/typeobj.rst:1850 +#: c-api/typeobj.rst:1858 msgid "" "If the instances of this type have a dictionary containing instance " "variables, this field is non-zero and contains the offset in the instances " @@ -2864,19 +2891,19 @@ msgid "" "func:`PyObject_GenericGetAttr`." msgstr "" -#: c-api/typeobj.rst:1855 +#: c-api/typeobj.rst:1863 msgid "" "Do not confuse this field with :c:member:`~PyTypeObject.tp_dict`; that is " "the dictionary for attributes of the type object itself." msgstr "" -#: c-api/typeobj.rst:1858 +#: c-api/typeobj.rst:1866 msgid "" "The value specifies the offset of the dictionary from the start of the " "instance structure." msgstr "" -#: c-api/typeobj.rst:1860 +#: c-api/typeobj.rst:1868 msgid "" "The :c:member:`~PyTypeObject.tp_dictoffset` should be regarded as write-" "only. To get the pointer to the dictionary call :c:func:" @@ -2885,13 +2912,13 @@ msgid "" "to call :c:func:`PyObject_GetAttr` when accessing an attribute on the object." msgstr "" -#: c-api/typeobj.rst:1866 +#: c-api/typeobj.rst:1874 msgid "" "It is an error to set both the :c:macro:`Py_TPFLAGS_MANAGED_DICT` bit and :c:" "member:`~PyTypeObject.tp_dictoffset`." msgstr "" -#: c-api/typeobj.rst:1871 +#: c-api/typeobj.rst:1879 msgid "" "This field is inherited by subtypes. A subtype should not override this " "offset; doing so could be unsafe, if C code tries to access the dictionary " @@ -2899,25 +2926,25 @@ msgid "" "`Py_TPFLAGS_MANAGED_DICT`." msgstr "" -#: c-api/typeobj.rst:1878 +#: c-api/typeobj.rst:1886 msgid "" "This slot has no default. For :ref:`static types `, if the " "field is ``NULL`` then no :attr:`~object.__dict__` gets created for " "instances." msgstr "" -#: c-api/typeobj.rst:1881 +#: c-api/typeobj.rst:1889 msgid "" "If the :c:macro:`Py_TPFLAGS_MANAGED_DICT` bit is set in the :c:member:" -"`~PyTypeObject.tp_dict` field, then :c:member:`~PyTypeObject.tp_dictoffset` " +"`~PyTypeObject.tp_flags` field, then :c:member:`~PyTypeObject.tp_dictoffset` " "will be set to ``-1``, to indicate that it is unsafe to use this field." msgstr "" -#: c-api/typeobj.rst:1889 +#: c-api/typeobj.rst:1897 msgid "An optional pointer to an instance initialization function." msgstr "" -#: c-api/typeobj.rst:1891 +#: c-api/typeobj.rst:1899 msgid "" "This function corresponds to the :meth:`~object.__init__` method of " "classes. Like :meth:`!__init__`, it is possible to create an instance " @@ -2925,18 +2952,18 @@ msgid "" "instance by calling its :meth:`!__init__` method again." msgstr "" -#: c-api/typeobj.rst:1898 +#: c-api/typeobj.rst:1906 msgid "int tp_init(PyObject *self, PyObject *args, PyObject *kwds);" msgstr "" -#: c-api/typeobj.rst:1900 +#: c-api/typeobj.rst:1908 msgid "" "The self argument is the instance to be initialized; the *args* and *kwds* " "arguments represent positional and keyword arguments of the call to :meth:" "`~object.__init__`." msgstr "" -#: c-api/typeobj.rst:1904 +#: c-api/typeobj.rst:1912 msgid "" "The :c:member:`~PyTypeObject.tp_init` function, if not ``NULL``, is called " "when an instance is created normally by calling its type, after the type's :" @@ -2948,52 +2975,52 @@ msgid "" "subtype's :c:member:`~PyTypeObject.tp_init` is called." msgstr "" -#: c-api/typeobj.rst:1911 +#: c-api/typeobj.rst:1919 msgid "Returns ``0`` on success, ``-1`` and sets an exception on error." msgstr "" -#: c-api/typeobj.rst:1919 +#: c-api/typeobj.rst:1927 msgid "" "For :ref:`static types ` this field does not have a default." msgstr "" -#: c-api/typeobj.rst:1924 +#: c-api/typeobj.rst:1932 msgid "An optional pointer to an instance allocation function." msgstr "" -#: c-api/typeobj.rst:1928 +#: c-api/typeobj.rst:1936 msgid "PyObject *tp_alloc(PyTypeObject *self, Py_ssize_t nitems);" msgstr "" -#: c-api/typeobj.rst:1932 +#: c-api/typeobj.rst:1940 msgid "" "This field is inherited by static subtypes, but not by dynamic subtypes " "(subtypes created by a class statement)." msgstr "" -#: c-api/typeobj.rst:1937 +#: c-api/typeobj.rst:1945 msgid "" "For dynamic subtypes, this field is always set to :c:func:" "`PyType_GenericAlloc`, to force a standard heap allocation strategy." msgstr "" -#: c-api/typeobj.rst:1941 +#: c-api/typeobj.rst:1949 msgid "" "For static subtypes, :c:data:`PyBaseObject_Type` uses :c:func:" "`PyType_GenericAlloc`. That is the recommended value for all statically " "defined types." msgstr "" -#: c-api/typeobj.rst:1948 +#: c-api/typeobj.rst:1956 msgid "An optional pointer to an instance creation function." msgstr "" -#: c-api/typeobj.rst:1952 +#: c-api/typeobj.rst:1960 msgid "" "PyObject *tp_new(PyTypeObject *subtype, PyObject *args, PyObject *kwds);" msgstr "" -#: c-api/typeobj.rst:1954 +#: c-api/typeobj.rst:1962 msgid "" "The *subtype* argument is the type of the object being created; the *args* " "and *kwds* arguments represent positional and keyword arguments of the call " @@ -3002,7 +3029,7 @@ msgid "" "that type (but not an unrelated type)." msgstr "" -#: c-api/typeobj.rst:1960 +#: c-api/typeobj.rst:1968 msgid "" "The :c:member:`~PyTypeObject.tp_new` function should call ``subtype-" ">tp_alloc(subtype, nitems)`` to allocate space for the object, and then do " @@ -3014,20 +3041,20 @@ msgid "" "be deferred to :c:member:`~PyTypeObject.tp_init`." msgstr "" -#: c-api/typeobj.rst:1968 +#: c-api/typeobj.rst:1976 msgid "" "Set the :c:macro:`Py_TPFLAGS_DISALLOW_INSTANTIATION` flag to disallow " "creating instances of the type in Python." msgstr "" -#: c-api/typeobj.rst:1973 +#: c-api/typeobj.rst:1981 msgid "" "This field is inherited by subtypes, except it is not inherited by :ref:" "`static types ` whose :c:member:`~PyTypeObject.tp_base` is " "``NULL`` or ``&PyBaseObject_Type``." msgstr "" -#: c-api/typeobj.rst:1979 +#: c-api/typeobj.rst:1987 msgid "" "For :ref:`static types ` this field has no default. This means " "if the slot is defined as ``NULL``, the type cannot be called to create new " @@ -3035,44 +3062,44 @@ msgid "" "factory function." msgstr "" -#: c-api/typeobj.rst:1987 +#: c-api/typeobj.rst:1995 msgid "" "An optional pointer to an instance deallocation function. Its signature is::" msgstr "" -#: c-api/typeobj.rst:1989 +#: c-api/typeobj.rst:1997 msgid "void tp_free(void *self);" msgstr "" -#: c-api/typeobj.rst:1991 +#: c-api/typeobj.rst:1999 msgid "" "An initializer that is compatible with this signature is :c:func:" "`PyObject_Free`." msgstr "" -#: c-api/typeobj.rst:1995 +#: c-api/typeobj.rst:2003 msgid "" "This field is inherited by static subtypes, but not by dynamic subtypes " "(subtypes created by a class statement)" msgstr "" -#: c-api/typeobj.rst:2000 +#: c-api/typeobj.rst:2008 msgid "" "In dynamic subtypes, this field is set to a deallocator suitable to match :c:" "func:`PyType_GenericAlloc` and the value of the :c:macro:" "`Py_TPFLAGS_HAVE_GC` flag bit." msgstr "" -#: c-api/typeobj.rst:2004 +#: c-api/typeobj.rst:2012 msgid "" "For static subtypes, :c:data:`PyBaseObject_Type` uses :c:func:`PyObject_Del`." msgstr "" -#: c-api/typeobj.rst:2009 +#: c-api/typeobj.rst:2017 msgid "An optional pointer to a function called by the garbage collector." msgstr "" -#: c-api/typeobj.rst:2011 +#: c-api/typeobj.rst:2019 msgid "" "The garbage collector needs to know whether a particular object is " "collectible or not. Normally, it is sufficient to look at the object's " @@ -3084,91 +3111,91 @@ msgid "" "instance. The signature is::" msgstr "" -#: c-api/typeobj.rst:2019 +#: c-api/typeobj.rst:2027 msgid "int tp_is_gc(PyObject *self);" msgstr "" -#: c-api/typeobj.rst:2021 +#: c-api/typeobj.rst:2029 msgid "" "(The only example of this are types themselves. The metatype, :c:data:" "`PyType_Type`, defines this function to distinguish between statically and :" "ref:`dynamically allocated types `.)" msgstr "" -#: c-api/typeobj.rst:2031 +#: c-api/typeobj.rst:2039 msgid "" "This slot has no default. If this field is ``NULL``, :c:macro:" "`Py_TPFLAGS_HAVE_GC` is used as the functional equivalent." msgstr "" -#: c-api/typeobj.rst:2037 +#: c-api/typeobj.rst:2045 msgid "Tuple of base types." msgstr "" -#: c-api/typeobj.rst:2063 +#: c-api/typeobj.rst:2071 msgid "" "This field should be set to ``NULL`` and treated as read-only. Python will " "fill it in when the type is :c:func:`initialized `." msgstr "" -#: c-api/typeobj.rst:2042 +#: c-api/typeobj.rst:2050 msgid "" "For dynamically created classes, the ``Py_tp_bases`` :c:type:`slot " "` can be used instead of the *bases* argument of :c:func:" "`PyType_FromSpecWithBases`. The argument form is preferred." msgstr "" -#: c-api/typeobj.rst:2049 +#: c-api/typeobj.rst:2057 msgid "" "Multiple inheritance does not work well for statically defined types. If you " "set ``tp_bases`` to a tuple, Python will not raise an error, but some slots " "will only be inherited from the first base." msgstr "" -#: c-api/typeobj.rst:2078 c-api/typeobj.rst:2112 c-api/typeobj.rst:2126 +#: c-api/typeobj.rst:2086 c-api/typeobj.rst:2120 c-api/typeobj.rst:2134 msgid "This field is not inherited." msgstr "" -#: c-api/typeobj.rst:2060 +#: c-api/typeobj.rst:2068 msgid "" "Tuple containing the expanded set of base types, starting with the type " "itself and ending with :class:`object`, in Method Resolution Order." msgstr "" -#: c-api/typeobj.rst:2068 +#: c-api/typeobj.rst:2076 msgid "" "This field is not inherited; it is calculated fresh by :c:func:" "`PyType_Ready`." msgstr "" -#: c-api/typeobj.rst:2074 +#: c-api/typeobj.rst:2082 msgid "Unused. Internal use only." msgstr "" -#: c-api/typeobj.rst:2083 +#: c-api/typeobj.rst:2091 msgid "" "A collection of subclasses. Internal use only. May be an invalid pointer." msgstr "" -#: c-api/typeobj.rst:2085 +#: c-api/typeobj.rst:2093 msgid "" "To get a list of subclasses, call the Python method :py:meth:`~type." "__subclasses__`." msgstr "" -#: c-api/typeobj.rst:2090 +#: c-api/typeobj.rst:2098 msgid "" "For some types, this field does not hold a valid :c:expr:`PyObject*`. The " "type was changed to :c:expr:`void*` to indicate this." msgstr "" -#: c-api/typeobj.rst:2100 +#: c-api/typeobj.rst:2108 msgid "" "Weak reference list head, for weak references to this type object. Not " "inherited. Internal use only." msgstr "" -#: c-api/typeobj.rst:2105 +#: c-api/typeobj.rst:2113 msgid "" "Internals detail: For the static builtin types this is always ``NULL``, even " "if weakrefs are added. Instead, the weakrefs for each are stored on " @@ -3176,25 +3203,25 @@ msgid "" "``_PyObject_GET_WEAKREFS_LISTPTR()`` macro to avoid the distinction." msgstr "" -#: c-api/typeobj.rst:2117 +#: c-api/typeobj.rst:2125 msgid "" "This field is deprecated. Use :c:member:`~PyTypeObject.tp_finalize` instead." msgstr "" -#: c-api/typeobj.rst:2122 +#: c-api/typeobj.rst:2130 msgid "Used to index into the method cache. Internal use only." msgstr "" -#: c-api/typeobj.rst:2131 +#: c-api/typeobj.rst:2139 msgid "" "An optional pointer to an instance finalization function. Its signature is::" msgstr "" -#: c-api/typeobj.rst:2133 +#: c-api/typeobj.rst:2141 msgid "void tp_finalize(PyObject *self);" msgstr "" -#: c-api/typeobj.rst:2135 +#: c-api/typeobj.rst:2143 msgid "" "If :c:member:`~PyTypeObject.tp_finalize` is set, the interpreter calls it " "once when finalizing an instance. It is called either from the garbage " @@ -3204,42 +3231,40 @@ msgid "" "object in a sane state." msgstr "" -#: c-api/typeobj.rst:2142 +#: c-api/typeobj.rst:2150 msgid "" ":c:member:`~PyTypeObject.tp_finalize` should not mutate the current " "exception status; therefore, a recommended way to write a non-trivial " "finalizer is::" msgstr "" -#: c-api/typeobj.rst:2145 +#: c-api/typeobj.rst:2153 msgid "" "static void\n" "local_finalize(PyObject *self)\n" "{\n" -" PyObject *error_type, *error_value, *error_traceback;\n" -"\n" " /* Save the current exception, if any. */\n" -" PyErr_Fetch(&error_type, &error_value, &error_traceback);\n" +" PyObject *exc = PyErr_GetRaisedException();\n" "\n" " /* ... */\n" "\n" " /* Restore the saved exception. */\n" -" PyErr_Restore(error_type, error_value, error_traceback);\n" +" PyErr_SetRaisedException(exc);\n" "}" msgstr "" -#: c-api/typeobj.rst:2167 +#: c-api/typeobj.rst:2173 msgid "" "Before version 3.8 it was necessary to set the :c:macro:" "`Py_TPFLAGS_HAVE_FINALIZE` flags bit in order for this field to be used. " "This is no longer required." msgstr "" -#: c-api/typeobj.rst:2171 +#: c-api/typeobj.rst:2177 msgid "\"Safe object finalization\" (:pep:`442`)" msgstr "" -#: c-api/typeobj.rst:2176 +#: c-api/typeobj.rst:2182 msgid "" "Vectorcall function to use for calls of this type object. In other words, it " "is used to implement :ref:`vectorcall ` for ``type.__call__``. " @@ -3247,65 +3272,65 @@ msgid "" "meth:`~object.__new__` and :meth:`~object.__init__` is used." msgstr "" -#: c-api/typeobj.rst:2184 +#: c-api/typeobj.rst:2190 msgid "This field is never inherited." msgstr "" -#: c-api/typeobj.rst:2186 +#: c-api/typeobj.rst:2192 msgid "(the field exists since 3.8 but it's only used since 3.9)" msgstr "" -#: c-api/typeobj.rst:2191 +#: c-api/typeobj.rst:2197 msgid "Internal. Do not use." msgstr "" -#: c-api/typeobj.rst:2199 +#: c-api/typeobj.rst:2205 msgid "Static Types" msgstr "" -#: c-api/typeobj.rst:2201 +#: c-api/typeobj.rst:2207 msgid "" "Traditionally, types defined in C code are *static*, that is, a static :c:" "type:`PyTypeObject` structure is defined directly in code and initialized " "using :c:func:`PyType_Ready`." msgstr "" -#: c-api/typeobj.rst:2205 +#: c-api/typeobj.rst:2211 msgid "" "This results in types that are limited relative to types defined in Python:" msgstr "" -#: c-api/typeobj.rst:2207 +#: c-api/typeobj.rst:2213 msgid "" "Static types are limited to one base, i.e. they cannot use multiple " "inheritance." msgstr "" -#: c-api/typeobj.rst:2209 +#: c-api/typeobj.rst:2215 msgid "" "Static type objects (but not necessarily their instances) are immutable. It " "is not possible to add or modify the type object's attributes from Python." msgstr "" -#: c-api/typeobj.rst:2211 +#: c-api/typeobj.rst:2217 msgid "" "Static type objects are shared across :ref:`sub-interpreters `, so they should not include any subinterpreter-" "specific state." msgstr "" -#: c-api/typeobj.rst:2215 +#: c-api/typeobj.rst:2221 msgid "" "Also, since :c:type:`PyTypeObject` is only part of the :ref:`Limited API " "` as an opaque struct, any extension modules using static " "types must be compiled for a specific Python minor version." msgstr "" -#: c-api/typeobj.rst:2223 +#: c-api/typeobj.rst:2229 msgid "Heap Types" msgstr "" -#: c-api/typeobj.rst:2225 +#: c-api/typeobj.rst:2231 msgid "" "An alternative to :ref:`static types ` is *heap-allocated " "types*, or *heap types* for short, which correspond closely to classes " @@ -3313,29 +3338,29 @@ msgid "" "`Py_TPFLAGS_HEAPTYPE` flag set." msgstr "" -#: c-api/typeobj.rst:2230 +#: c-api/typeobj.rst:2236 msgid "" "This is done by filling a :c:type:`PyType_Spec` structure and calling :c:" "func:`PyType_FromSpec`, :c:func:`PyType_FromSpecWithBases`, :c:func:" "`PyType_FromModuleAndSpec`, or :c:func:`PyType_FromMetaclass`." msgstr "" -#: c-api/typeobj.rst:2238 +#: c-api/typeobj.rst:2244 msgid "Number Object Structures" msgstr "" -#: c-api/typeobj.rst:2245 +#: c-api/typeobj.rst:2251 msgid "" "This structure holds pointers to the functions which an object uses to " "implement the number protocol. Each function is used by the function of " "similar name documented in the :ref:`number` section." msgstr "" -#: c-api/typeobj.rst:2575 +#: c-api/typeobj.rst:2581 msgid "Here is the structure definition::" msgstr "" -#: c-api/typeobj.rst:2253 +#: c-api/typeobj.rst:2259 msgid "" "typedef struct {\n" " binaryfunc nb_add;\n" @@ -3381,7 +3406,7 @@ msgid "" "} PyNumberMethods;" msgstr "" -#: c-api/typeobj.rst:2298 +#: c-api/typeobj.rst:2304 msgid "" "Binary and ternary functions must check the type of all their operands, and " "implement the necessary conversions (at least one of the operands is an " @@ -3391,31 +3416,31 @@ msgid "" "and set an exception." msgstr "" -#: c-api/typeobj.rst:2307 +#: c-api/typeobj.rst:2313 msgid "" "The :c:member:`~PyNumberMethods.nb_reserved` field should always be " "``NULL``. It was previously called :c:member:`!nb_long`, and was renamed in " "Python 3.0.1." msgstr "" -#: c-api/typeobj.rst:2352 +#: c-api/typeobj.rst:2358 msgid "Mapping Object Structures" msgstr "" -#: c-api/typeobj.rst:2359 +#: c-api/typeobj.rst:2365 msgid "" "This structure holds pointers to the functions which an object uses to " "implement the mapping protocol. It has three members:" msgstr "" -#: c-api/typeobj.rst:2364 +#: c-api/typeobj.rst:2370 msgid "" "This function is used by :c:func:`PyMapping_Size` and :c:func:" "`PyObject_Size`, and has the same signature. This slot may be set to " "``NULL`` if the object has no defined length." msgstr "" -#: c-api/typeobj.rst:2370 +#: c-api/typeobj.rst:2376 msgid "" "This function is used by :c:func:`PyObject_GetItem` and :c:func:" "`PySequence_GetSlice`, and has the same signature as :c:func:`!" @@ -3423,7 +3448,7 @@ msgid "" "`PyMapping_Check` function to return ``1``, it can be ``NULL`` otherwise." msgstr "" -#: c-api/typeobj.rst:2378 +#: c-api/typeobj.rst:2384 msgid "" "This function is used by :c:func:`PyObject_SetItem`, :c:func:" "`PyObject_DelItem`, :c:func:`PySequence_SetSlice` and :c:func:" @@ -3433,17 +3458,17 @@ msgid "" "deletion." msgstr "" -#: c-api/typeobj.rst:2389 +#: c-api/typeobj.rst:2395 msgid "Sequence Object Structures" msgstr "" -#: c-api/typeobj.rst:2396 +#: c-api/typeobj.rst:2402 msgid "" "This structure holds pointers to the functions which an object uses to " "implement the sequence protocol." msgstr "" -#: c-api/typeobj.rst:2401 +#: c-api/typeobj.rst:2407 msgid "" "This function is used by :c:func:`PySequence_Size` and :c:func:" "`PyObject_Size`, and has the same signature. It is also used for handling " @@ -3451,21 +3476,21 @@ msgid "" "member:`~PySequenceMethods.sq_ass_item` slots." msgstr "" -#: c-api/typeobj.rst:2408 +#: c-api/typeobj.rst:2414 msgid "" "This function is used by :c:func:`PySequence_Concat` and has the same " "signature. It is also used by the ``+`` operator, after trying the numeric " "addition via the :c:member:`~PyNumberMethods.nb_add` slot." msgstr "" -#: c-api/typeobj.rst:2414 +#: c-api/typeobj.rst:2420 msgid "" "This function is used by :c:func:`PySequence_Repeat` and has the same " "signature. It is also used by the ``*`` operator, after trying numeric " "multiplication via the :c:member:`~PyNumberMethods.nb_multiply` slot." msgstr "" -#: c-api/typeobj.rst:2420 +#: c-api/typeobj.rst:2426 msgid "" "This function is used by :c:func:`PySequence_GetItem` and has the same " "signature. It is also used by :c:func:`PyObject_GetItem`, after trying the " @@ -3474,7 +3499,7 @@ msgid "" "``1``, it can be ``NULL`` otherwise." msgstr "" -#: c-api/typeobj.rst:2426 +#: c-api/typeobj.rst:2432 msgid "" "Negative indexes are handled as follows: if the :c:member:" "`~PySequenceMethods.sq_length` slot is filled, it is called and the sequence " @@ -3483,7 +3508,7 @@ msgid "" "index is passed as is to the function." msgstr "" -#: c-api/typeobj.rst:2433 +#: c-api/typeobj.rst:2439 msgid "" "This function is used by :c:func:`PySequence_SetItem` and has the same " "signature. It is also used by :c:func:`PyObject_SetItem` and :c:func:" @@ -3492,14 +3517,14 @@ msgid "" "``NULL`` if the object does not support item assignment and deletion." msgstr "" -#: c-api/typeobj.rst:2442 +#: c-api/typeobj.rst:2448 msgid "" "This function may be used by :c:func:`PySequence_Contains` and has the same " "signature. This slot may be left to ``NULL``, in this case :c:func:`!" "PySequence_Contains` simply traverses the sequence until it finds a match." msgstr "" -#: c-api/typeobj.rst:2449 +#: c-api/typeobj.rst:2455 msgid "" "This function is used by :c:func:`PySequence_InPlaceConcat` and has the same " "signature. It should modify its first operand, and return it. This slot " @@ -3509,7 +3534,7 @@ msgid "" "c:member:`~PyNumberMethods.nb_inplace_add` slot." msgstr "" -#: c-api/typeobj.rst:2458 +#: c-api/typeobj.rst:2464 msgid "" "This function is used by :c:func:`PySequence_InPlaceRepeat` and has the same " "signature. It should modify its first operand, and return it. This slot " @@ -3519,74 +3544,74 @@ msgid "" "via the :c:member:`~PyNumberMethods.nb_inplace_multiply` slot." msgstr "" -#: c-api/typeobj.rst:2469 +#: c-api/typeobj.rst:2475 msgid "Buffer Object Structures" msgstr "" -#: c-api/typeobj.rst:2477 +#: c-api/typeobj.rst:2483 msgid "" "This structure holds pointers to the functions required by the :ref:`Buffer " "protocol `. The protocol defines how an exporter object can " "expose its internal data to consumer objects." msgstr "" -#: c-api/typeobj.rst:2532 c-api/typeobj.rst:2597 c-api/typeobj.rst:2619 +#: c-api/typeobj.rst:2538 c-api/typeobj.rst:2603 c-api/typeobj.rst:2625 msgid "The signature of this function is::" msgstr "" -#: c-api/typeobj.rst:2485 +#: c-api/typeobj.rst:2491 msgid "int (PyObject *exporter, Py_buffer *view, int flags);" msgstr "" -#: c-api/typeobj.rst:2487 +#: c-api/typeobj.rst:2493 msgid "" "Handle a request to *exporter* to fill in *view* as specified by *flags*. " "Except for point (3), an implementation of this function MUST take these " "steps:" msgstr "" -#: c-api/typeobj.rst:2491 +#: c-api/typeobj.rst:2497 msgid "" "Check if the request can be met. If not, raise :exc:`BufferError`, set :c:" "expr:`view->obj` to ``NULL`` and return ``-1``." msgstr "" -#: c-api/typeobj.rst:2494 +#: c-api/typeobj.rst:2500 msgid "Fill in the requested fields." msgstr "" -#: c-api/typeobj.rst:2496 +#: c-api/typeobj.rst:2502 msgid "Increment an internal counter for the number of exports." msgstr "" -#: c-api/typeobj.rst:2498 +#: c-api/typeobj.rst:2504 msgid "" "Set :c:expr:`view->obj` to *exporter* and increment :c:expr:`view->obj`." msgstr "" -#: c-api/typeobj.rst:2500 +#: c-api/typeobj.rst:2506 msgid "Return ``0``." msgstr "" -#: c-api/typeobj.rst:2502 +#: c-api/typeobj.rst:2508 msgid "" "If *exporter* is part of a chain or tree of buffer providers, two main " "schemes can be used:" msgstr "" -#: c-api/typeobj.rst:2505 +#: c-api/typeobj.rst:2511 msgid "" "Re-export: Each member of the tree acts as the exporting object and sets :c:" "expr:`view->obj` to a new reference to itself." msgstr "" -#: c-api/typeobj.rst:2508 +#: c-api/typeobj.rst:2514 msgid "" "Redirect: The buffer request is redirected to the root object of the tree. " "Here, :c:expr:`view->obj` will be a new reference to the root object." msgstr "" -#: c-api/typeobj.rst:2512 +#: c-api/typeobj.rst:2518 msgid "" "The individual fields of *view* are described in section :ref:`Buffer " "structure `, the rules how an exporter must react to " @@ -3594,7 +3619,7 @@ msgid "" "types>`." msgstr "" -#: c-api/typeobj.rst:2517 +#: c-api/typeobj.rst:2523 msgid "" "All memory pointed to in the :c:type:`Py_buffer` structure belongs to the " "exporter and must remain valid until there are no consumers left. :c:member:" @@ -3603,23 +3628,23 @@ msgid "" "internal` are read-only for the consumer." msgstr "" -#: c-api/typeobj.rst:2524 +#: c-api/typeobj.rst:2530 msgid "" ":c:func:`PyBuffer_FillInfo` provides an easy way of exposing a simple bytes " "buffer while dealing correctly with all request types." msgstr "" -#: c-api/typeobj.rst:2527 +#: c-api/typeobj.rst:2533 msgid "" ":c:func:`PyObject_GetBuffer` is the interface for the consumer that wraps " "this function." msgstr "" -#: c-api/typeobj.rst:2534 +#: c-api/typeobj.rst:2540 msgid "void (PyObject *exporter, Py_buffer *view);" msgstr "" -#: c-api/typeobj.rst:2536 +#: c-api/typeobj.rst:2542 msgid "" "Handle a request to release the resources of the buffer. If no resources " "need to be released, :c:member:`PyBufferProcs.bf_releasebuffer` may be " @@ -3627,15 +3652,15 @@ msgid "" "these optional steps:" msgstr "" -#: c-api/typeobj.rst:2541 +#: c-api/typeobj.rst:2547 msgid "Decrement an internal counter for the number of exports." msgstr "" -#: c-api/typeobj.rst:2543 +#: c-api/typeobj.rst:2549 msgid "If the counter is ``0``, free all memory associated with *view*." msgstr "" -#: c-api/typeobj.rst:2545 +#: c-api/typeobj.rst:2551 msgid "" "The exporter MUST use the :c:member:`~Py_buffer.internal` field to keep " "track of buffer-specific resources. This field is guaranteed to remain " @@ -3643,30 +3668,30 @@ msgid "" "*view* argument." msgstr "" -#: c-api/typeobj.rst:2551 +#: c-api/typeobj.rst:2557 msgid "" "This function MUST NOT decrement :c:expr:`view->obj`, since that is done " "automatically in :c:func:`PyBuffer_Release` (this scheme is useful for " "breaking reference cycles)." msgstr "" -#: c-api/typeobj.rst:2556 +#: c-api/typeobj.rst:2562 msgid "" ":c:func:`PyBuffer_Release` is the interface for the consumer that wraps this " "function." msgstr "" -#: c-api/typeobj.rst:2564 +#: c-api/typeobj.rst:2570 msgid "Async Object Structures" msgstr "" -#: c-api/typeobj.rst:2572 +#: c-api/typeobj.rst:2578 msgid "" "This structure holds pointers to the functions required to implement :term:" "`awaitable` and :term:`asynchronous iterator` objects." msgstr "" -#: c-api/typeobj.rst:2577 +#: c-api/typeobj.rst:2583 msgid "" "typedef struct {\n" " unaryfunc am_await;\n" @@ -3676,61 +3701,61 @@ msgid "" "} PyAsyncMethods;" msgstr "" -#: c-api/typeobj.rst:2588 +#: c-api/typeobj.rst:2594 msgid "PyObject *am_await(PyObject *self);" msgstr "" -#: c-api/typeobj.rst:2590 +#: c-api/typeobj.rst:2596 msgid "" "The returned object must be an :term:`iterator`, i.e. :c:func:`PyIter_Check` " "must return ``1`` for it." msgstr "" -#: c-api/typeobj.rst:2593 +#: c-api/typeobj.rst:2599 msgid "" "This slot may be set to ``NULL`` if an object is not an :term:`awaitable`." msgstr "" -#: c-api/typeobj.rst:2599 +#: c-api/typeobj.rst:2605 msgid "PyObject *am_aiter(PyObject *self);" msgstr "" -#: c-api/typeobj.rst:2601 +#: c-api/typeobj.rst:2607 msgid "" "Must return an :term:`asynchronous iterator` object. See :meth:`~object." "__anext__` for details." msgstr "" -#: c-api/typeobj.rst:2604 +#: c-api/typeobj.rst:2610 msgid "" "This slot may be set to ``NULL`` if an object does not implement " "asynchronous iteration protocol." msgstr "" -#: c-api/typeobj.rst:2611 +#: c-api/typeobj.rst:2617 msgid "PyObject *am_anext(PyObject *self);" msgstr "" -#: c-api/typeobj.rst:2613 +#: c-api/typeobj.rst:2619 msgid "" "Must return an :term:`awaitable` object. See :meth:`~object.__anext__` for " "details. This slot may be set to ``NULL``." msgstr "" -#: c-api/typeobj.rst:2621 +#: c-api/typeobj.rst:2627 msgid "PySendResult am_send(PyObject *self, PyObject *arg, PyObject **result);" msgstr "" -#: c-api/typeobj.rst:2623 +#: c-api/typeobj.rst:2629 msgid "" "See :c:func:`PyIter_Send` for details. This slot may be set to ``NULL``." msgstr "" -#: c-api/typeobj.rst:2632 +#: c-api/typeobj.rst:2638 msgid "Slot Type typedefs" msgstr "" -#: c-api/typeobj.rst:2636 +#: c-api/typeobj.rst:2642 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 " @@ -3744,80 +3769,80 @@ msgid "" "length of the block should be :c:member:`~PyTypeObject.tp_basicsize`." msgstr "" -#: c-api/typeobj.rst:2646 +#: c-api/typeobj.rst:2652 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:2653 +#: c-api/typeobj.rst:2659 msgid "See :c:member:`~PyTypeObject.tp_free`." msgstr "" -#: c-api/typeobj.rst:2657 +#: c-api/typeobj.rst:2663 msgid "See :c:member:`~PyTypeObject.tp_new`." msgstr "" -#: c-api/typeobj.rst:2661 +#: c-api/typeobj.rst:2667 msgid "See :c:member:`~PyTypeObject.tp_init`." msgstr "" -#: c-api/typeobj.rst:2665 +#: c-api/typeobj.rst:2671 msgid "See :c:member:`~PyTypeObject.tp_repr`." msgstr "" -#: c-api/typeobj.rst:2678 +#: c-api/typeobj.rst:2684 msgid "Return the value of the named attribute for the object." msgstr "" -#: c-api/typeobj.rst:2684 +#: c-api/typeobj.rst:2690 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:2680 +#: c-api/typeobj.rst:2686 msgid "See :c:member:`~PyTypeObject.tp_getattro`." msgstr "" -#: c-api/typeobj.rst:2687 +#: c-api/typeobj.rst:2693 msgid "See :c:member:`~PyTypeObject.tp_setattro`." msgstr "" -#: c-api/typeobj.rst:2691 +#: c-api/typeobj.rst:2697 msgid "See :c:member:`~PyTypeObject.tp_descr_get`." msgstr "" -#: c-api/typeobj.rst:2695 +#: c-api/typeobj.rst:2701 msgid "See :c:member:`~PyTypeObject.tp_descr_set`." msgstr "" -#: c-api/typeobj.rst:2699 +#: c-api/typeobj.rst:2705 msgid "See :c:member:`~PyTypeObject.tp_hash`." msgstr "" -#: c-api/typeobj.rst:2703 +#: c-api/typeobj.rst:2709 msgid "See :c:member:`~PyTypeObject.tp_richcompare`." msgstr "" -#: c-api/typeobj.rst:2707 +#: c-api/typeobj.rst:2713 msgid "See :c:member:`~PyTypeObject.tp_iter`." msgstr "" -#: c-api/typeobj.rst:2711 +#: c-api/typeobj.rst:2717 msgid "See :c:member:`~PyTypeObject.tp_iternext`." msgstr "" -#: c-api/typeobj.rst:2725 +#: c-api/typeobj.rst:2731 msgid "See :c:member:`~PyAsyncMethods.am_send`." msgstr "" -#: c-api/typeobj.rst:2741 +#: c-api/typeobj.rst:2747 msgid "Examples" msgstr "" -#: c-api/typeobj.rst:2743 +#: c-api/typeobj.rst:2749 msgid "" "The following are simple examples of Python type definitions. They include " "common usage you may encounter. Some demonstrate tricky corner cases. For " @@ -3825,11 +3850,11 @@ msgid "" "and :ref:`new-types-topics`." msgstr "" -#: c-api/typeobj.rst:2748 +#: c-api/typeobj.rst:2754 msgid "A basic :ref:`static type `::" msgstr "" -#: c-api/typeobj.rst:2750 +#: c-api/typeobj.rst:2756 msgid "" "typedef struct {\n" " PyObject_HEAD\n" @@ -3847,13 +3872,13 @@ msgid "" "};" msgstr "" -#: c-api/typeobj.rst:2765 +#: c-api/typeobj.rst:2771 msgid "" "You may also find older code (especially in the CPython code base) with a " "more verbose initializer::" msgstr "" -#: c-api/typeobj.rst:2768 +#: c-api/typeobj.rst:2774 msgid "" "static PyTypeObject MyObject_Type = {\n" " PyVarObject_HEAD_INIT(NULL, 0)\n" @@ -3897,11 +3922,11 @@ msgid "" "};" msgstr "" -#: c-api/typeobj.rst:2809 +#: c-api/typeobj.rst:2815 msgid "A type that supports weakrefs, instance dicts, and hashing::" msgstr "" -#: c-api/typeobj.rst:2811 +#: c-api/typeobj.rst:2817 msgid "" "typedef struct {\n" " PyObject_HEAD\n" @@ -3927,14 +3952,14 @@ msgid "" "};" msgstr "" -#: c-api/typeobj.rst:2834 +#: c-api/typeobj.rst:2840 msgid "" "A str subclass that cannot be subclassed and cannot be called to create " "instances (e.g. uses a separate factory func) using :c:macro:" "`Py_TPFLAGS_DISALLOW_INSTANTIATION` flag::" msgstr "" -#: c-api/typeobj.rst:2838 +#: c-api/typeobj.rst:2844 msgid "" "typedef struct {\n" " PyUnicodeObject raw;\n" @@ -3952,12 +3977,12 @@ msgid "" "};" msgstr "" -#: c-api/typeobj.rst:2853 +#: c-api/typeobj.rst:2859 msgid "" "The simplest :ref:`static type ` with fixed-length instances::" msgstr "" -#: c-api/typeobj.rst:2855 +#: c-api/typeobj.rst:2861 msgid "" "typedef struct {\n" " PyObject_HEAD\n" @@ -3969,13 +3994,13 @@ msgid "" "};" msgstr "" -#: c-api/typeobj.rst:2864 +#: c-api/typeobj.rst:2870 msgid "" "The simplest :ref:`static type ` with variable-length " "instances::" msgstr "" -#: c-api/typeobj.rst:2866 +#: c-api/typeobj.rst:2872 msgid "" "typedef struct {\n" " PyObject_VAR_HEAD\n" @@ -3990,14 +4015,14 @@ msgid "" "};" msgstr "" -#: c-api/typeobj.rst:929 +#: c-api/typeobj.rst:907 msgid "built-in function" msgstr "" -#: c-api/typeobj.rst:864 +#: c-api/typeobj.rst:842 msgid "repr" msgstr "" -#: c-api/typeobj.rst:929 +#: c-api/typeobj.rst:907 msgid "hash" msgstr "" diff --git a/c-api/unicode.po b/c-api/unicode.po index 4eb9a46e..d1fd3abf 100644 --- a/c-api/unicode.po +++ b/c-api/unicode.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -76,52 +76,58 @@ msgid "" "build time." msgstr "" -#: c-api/unicode.rst:60 +#: c-api/unicode.rst:62 msgid "" "These subtypes of :c:type:`PyObject` represent a Python Unicode object. In " "almost all cases, they shouldn't be used directly, since all API functions " "that deal with Unicode objects take and return :c:type:`PyObject` pointers." msgstr "" -#: c-api/unicode.rst:69 +#: c-api/unicode.rst:71 msgid "" -"This instance of :c:type:`PyTypeObject` represents the Python Unicode type. " +"This instance of :c:type:`PyTypeObject` represents the Python Unicode type. " "It is exposed to Python code as ``str``." msgstr "" -#: c-api/unicode.rst:73 +#: c-api/unicode.rst:77 +msgid "" +"This instance of :c:type:`PyTypeObject` represents the Python Unicode " +"iterator type. It is used to iterate over Unicode string objects." +msgstr "" + +#: c-api/unicode.rst:81 msgid "" "The following APIs are C macros and static inlined functions for fast checks " "and access to internal read-only data of Unicode objects:" msgstr "" -#: c-api/unicode.rst:78 +#: c-api/unicode.rst:86 msgid "" "Return true if the object *obj* is a Unicode object or an instance of a " "Unicode subtype. This function always succeeds." msgstr "" -#: c-api/unicode.rst:84 +#: c-api/unicode.rst:92 msgid "" "Return true if the object *obj* is a Unicode object, but not an instance of " "a subtype. This function always succeeds." msgstr "" -#: c-api/unicode.rst:90 +#: c-api/unicode.rst:98 msgid "Returns ``0``. This API is kept only for backward compatibility." msgstr "" -#: c-api/unicode.rst:94 +#: c-api/unicode.rst:102 msgid "This API does nothing since Python 3.12." msgstr "" -#: c-api/unicode.rst:100 +#: c-api/unicode.rst:108 msgid "" "Return the length of the Unicode string, in code points. *unicode* has to " "be a Unicode object in the \"canonical\" representation (not checked)." msgstr "" -#: c-api/unicode.rst:110 +#: c-api/unicode.rst:118 msgid "" "Return a pointer to the canonical representation cast to UCS1, UCS2 or UCS4 " "integer types for direct character access. No checks are performed if the " @@ -129,15 +135,15 @@ msgid "" "`PyUnicode_KIND` to select the right function." msgstr "" -#: c-api/unicode.rst:122 +#: c-api/unicode.rst:130 msgid "Return values of the :c:func:`PyUnicode_KIND` macro." msgstr "" -#: c-api/unicode.rst:126 +#: c-api/unicode.rst:134 msgid "``PyUnicode_WCHAR_KIND`` has been removed." msgstr "" -#: c-api/unicode.rst:132 +#: c-api/unicode.rst:140 msgid "" "Return one of the PyUnicode kind constants (see above) that indicate how " "many bytes per character this Unicode object uses to store its data. " @@ -145,13 +151,13 @@ msgid "" "(not checked)." msgstr "" -#: c-api/unicode.rst:141 +#: c-api/unicode.rst:149 msgid "" "Return a void pointer to the raw Unicode buffer. *unicode* has to be a " "Unicode object in the \"canonical\" representation (not checked)." msgstr "" -#: c-api/unicode.rst:150 +#: c-api/unicode.rst:158 msgid "" "Write into a canonical representation *data* (as obtained with :c:func:" "`PyUnicode_DATA`). This function performs no sanity checks, and is intended " @@ -161,192 +167,188 @@ msgid "" "written to that location." msgstr "" -#: c-api/unicode.rst:163 +#: c-api/unicode.rst:171 msgid "" "Read a code point from a canonical representation *data* (as obtained with :" "c:func:`PyUnicode_DATA`). No checks or ready calls are performed." msgstr "" -#: c-api/unicode.rst:171 +#: c-api/unicode.rst:179 msgid "" "Read a character from a Unicode object *unicode*, which must be in the " "\"canonical\" representation. This is less efficient than :c:func:" "`PyUnicode_READ` if you do multiple consecutive reads." msgstr "" -#: c-api/unicode.rst:180 +#: c-api/unicode.rst:188 msgid "" "Return the maximum code point that is suitable for creating another string " "based on *unicode*, which must be in the \"canonical\" representation. This " "is always an approximation but more efficient than iterating over the string." msgstr "" -#: c-api/unicode.rst:189 +#: c-api/unicode.rst:197 msgid "" "Return ``1`` if the string is a valid identifier according to the language " "definition, section :ref:`identifiers`. Return ``0`` otherwise." msgstr "" -#: c-api/unicode.rst:192 +#: c-api/unicode.rst:200 msgid "" "The function does not call :c:func:`Py_FatalError` anymore if the string is " "not ready." msgstr "" -#: c-api/unicode.rst:198 +#: c-api/unicode.rst:206 msgid "Unicode Character Properties" msgstr "" -#: c-api/unicode.rst:200 +#: c-api/unicode.rst:208 msgid "" "Unicode provides many different character properties. The most often needed " "ones are available through these macros which are mapped to C functions " "depending on the Python configuration." msgstr "" -#: c-api/unicode.rst:207 +#: c-api/unicode.rst:215 msgid "" "Return ``1`` or ``0`` depending on whether *ch* is a whitespace character." msgstr "" -#: c-api/unicode.rst:212 +#: c-api/unicode.rst:220 msgid "" "Return ``1`` or ``0`` depending on whether *ch* is a lowercase character." msgstr "" -#: c-api/unicode.rst:217 +#: c-api/unicode.rst:225 msgid "" "Return ``1`` or ``0`` depending on whether *ch* is an uppercase character." msgstr "" -#: c-api/unicode.rst:222 +#: c-api/unicode.rst:230 msgid "" "Return ``1`` or ``0`` depending on whether *ch* is a titlecase character." msgstr "" -#: c-api/unicode.rst:227 +#: c-api/unicode.rst:235 msgid "" "Return ``1`` or ``0`` depending on whether *ch* is a linebreak character." msgstr "" -#: c-api/unicode.rst:232 +#: c-api/unicode.rst:240 msgid "Return ``1`` or ``0`` depending on whether *ch* is a decimal character." msgstr "" -#: c-api/unicode.rst:237 +#: c-api/unicode.rst:245 msgid "Return ``1`` or ``0`` depending on whether *ch* is a digit character." msgstr "" -#: c-api/unicode.rst:242 +#: c-api/unicode.rst:250 msgid "Return ``1`` or ``0`` depending on whether *ch* is a numeric character." msgstr "" -#: c-api/unicode.rst:247 +#: c-api/unicode.rst:255 msgid "" "Return ``1`` or ``0`` depending on whether *ch* is an alphabetic character." msgstr "" -#: c-api/unicode.rst:252 +#: c-api/unicode.rst:260 msgid "" "Return ``1`` or ``0`` depending on whether *ch* is an alphanumeric character." msgstr "" -#: c-api/unicode.rst:257 +#: c-api/unicode.rst:265 msgid "" "Return ``1`` or ``0`` depending on whether *ch* is a printable character, in " "the sense of :meth:`str.isprintable`." msgstr "" -#: c-api/unicode.rst:261 +#: c-api/unicode.rst:269 msgid "These APIs can be used for fast direct character conversions:" msgstr "" -#: c-api/unicode.rst:266 +#: c-api/unicode.rst:274 msgid "Return the character *ch* converted to lower case." msgstr "" -#: c-api/unicode.rst:276 c-api/unicode.rst:284 -msgid "This function uses simple case mappings." -msgstr "" - -#: c-api/unicode.rst:274 +#: c-api/unicode.rst:279 msgid "Return the character *ch* converted to upper case." msgstr "" -#: c-api/unicode.rst:282 +#: c-api/unicode.rst:284 msgid "Return the character *ch* converted to title case." msgstr "" -#: c-api/unicode.rst:290 +#: c-api/unicode.rst:289 msgid "" "Return the character *ch* converted to a decimal positive integer. Return " "``-1`` if this is not possible. This function does not raise exceptions." msgstr "" -#: c-api/unicode.rst:296 +#: c-api/unicode.rst:295 msgid "" "Return the character *ch* converted to a single digit integer. Return ``-1`` " "if this is not possible. This function does not raise exceptions." msgstr "" -#: c-api/unicode.rst:302 +#: c-api/unicode.rst:301 msgid "" "Return the character *ch* converted to a double. Return ``-1.0`` if this is " "not possible. This function does not raise exceptions." msgstr "" -#: c-api/unicode.rst:306 +#: c-api/unicode.rst:305 msgid "These APIs can be used to work with surrogates:" msgstr "" -#: c-api/unicode.rst:310 +#: c-api/unicode.rst:309 msgid "Check if *ch* is a surrogate (``0xD800 <= ch <= 0xDFFF``)." msgstr "" -#: c-api/unicode.rst:314 +#: c-api/unicode.rst:313 msgid "Check if *ch* is a high surrogate (``0xD800 <= ch <= 0xDBFF``)." msgstr "" -#: c-api/unicode.rst:318 +#: c-api/unicode.rst:317 msgid "Check if *ch* is a low surrogate (``0xDC00 <= ch <= 0xDFFF``)." msgstr "" -#: c-api/unicode.rst:322 +#: c-api/unicode.rst:321 msgid "" -"Join two surrogate characters and return a single :c:type:`Py_UCS4` value. " +"Join two surrogate code points and return a single :c:type:`Py_UCS4` value. " "*high* and *low* are respectively the leading and trailing surrogates in a " "surrogate pair. *high* must be in the range [0xD800; 0xDBFF] and *low* must " "be in the range [0xDC00; 0xDFFF]." msgstr "" -#: c-api/unicode.rst:329 +#: c-api/unicode.rst:328 msgid "Creating and accessing Unicode strings" msgstr "" -#: c-api/unicode.rst:331 +#: c-api/unicode.rst:330 msgid "" "To create Unicode objects and access their basic sequence properties, use " "these APIs:" msgstr "" -#: c-api/unicode.rst:336 +#: c-api/unicode.rst:335 msgid "" "Create a new Unicode object. *maxchar* should be the true maximum code " "point to be placed in the string. As an approximation, it can be rounded up " "to the nearest value in the sequence 127, 255, 65535, 1114111." msgstr "" -#: c-api/unicode.rst:340 +#: c-api/unicode.rst:339 msgid "" "This is the recommended way to allocate a new Unicode object. Objects " "created using this function are not resizable." msgstr "" -#: c-api/unicode.rst:343 +#: c-api/unicode.rst:342 msgid "On error, set an exception and return ``NULL``." msgstr "" -#: c-api/unicode.rst:351 +#: c-api/unicode.rst:350 msgid "" "Create a new Unicode object with the given *kind* (possible values are :c:" "macro:`PyUnicode_1BYTE_KIND` etc., as returned by :c:func:" @@ -354,7 +356,7 @@ msgid "" "1, 2 or 4 bytes per character, as given by the kind." msgstr "" -#: c-api/unicode.rst:356 +#: c-api/unicode.rst:355 msgid "" "If necessary, the input *buffer* is copied and transformed into the " "canonical representation. For example, if the *buffer* is a UCS4 string (:c:" @@ -362,7 +364,7 @@ msgid "" "range, it will be transformed into UCS1 (:c:macro:`PyUnicode_1BYTE_KIND`)." msgstr "" -#: c-api/unicode.rst:367 +#: c-api/unicode.rst:366 msgid "" "Create a Unicode object from the char buffer *str*. The bytes will be " "interpreted as being UTF-8 encoded. The buffer is copied into the new " @@ -370,29 +372,29 @@ msgid "" "data is not allowed." msgstr "" -#: c-api/unicode.rst:373 +#: c-api/unicode.rst:372 msgid "This function raises :exc:`SystemError` when:" msgstr "" -#: c-api/unicode.rst:375 +#: c-api/unicode.rst:374 msgid "*size* < 0," msgstr "" -#: c-api/unicode.rst:376 +#: c-api/unicode.rst:375 msgid "*str* is ``NULL`` and *size* > 0" msgstr "" -#: c-api/unicode.rst:378 +#: c-api/unicode.rst:377 msgid "*str* == ``NULL`` with *size* > 0 is not allowed anymore." msgstr "" -#: c-api/unicode.rst:384 +#: c-api/unicode.rst:383 msgid "" "Create a Unicode object from a UTF-8 encoded null-terminated char buffer " "*str*." msgstr "" -#: c-api/unicode.rst:390 +#: c-api/unicode.rst:389 msgid "" "Take a C :c:func:`printf`\\ -style *format* string and a variable number of " "arguments, calculate the size of the resulting Python Unicode string and " @@ -401,23 +403,23 @@ msgid "" "*format* ASCII-encoded string." msgstr "" -#: c-api/unicode.rst:396 +#: c-api/unicode.rst:395 msgid "" "A conversion specifier contains two or more characters and has the following " "components, which must occur in this order:" msgstr "" -#: c-api/unicode.rst:399 +#: c-api/unicode.rst:398 msgid "The ``'%'`` character, which marks the start of the specifier." msgstr "" -#: c-api/unicode.rst:401 +#: c-api/unicode.rst:400 msgid "" "Conversion flags (optional), which affect the result of some conversion " "types." msgstr "" -#: c-api/unicode.rst:404 +#: c-api/unicode.rst:403 msgid "" "Minimum field width (optional). If specified as an ``'*'`` (asterisk), the " "actual width is given in the next argument, which must be of type :c:expr:" @@ -425,7 +427,7 @@ msgid "" "optional precision." msgstr "" -#: c-api/unicode.rst:409 +#: c-api/unicode.rst:408 msgid "" "Precision (optional), given as a ``'.'`` (dot) followed by the precision. If " "specified as ``'*'`` (an asterisk), the actual precision is given in the " @@ -433,269 +435,313 @@ msgid "" "comes after the precision." msgstr "" -#: c-api/unicode.rst:414 +#: c-api/unicode.rst:413 msgid "Length modifier (optional)." msgstr "" -#: c-api/unicode.rst:416 +#: c-api/unicode.rst:415 msgid "Conversion type." msgstr "" -#: c-api/unicode.rst:418 +#: c-api/unicode.rst:417 msgid "The conversion flag characters are:" msgstr "" -#: c-api/unicode.rst:423 +#: c-api/unicode.rst:422 msgid "Flag" msgstr "" -#: c-api/unicode.rst:423 +#: c-api/unicode.rst:422 msgid "Meaning" msgstr "" -#: c-api/unicode.rst:425 +#: c-api/unicode.rst:424 msgid "``0``" msgstr "" -#: c-api/unicode.rst:425 +#: c-api/unicode.rst:424 msgid "The conversion will be zero padded for numeric values." msgstr "" -#: c-api/unicode.rst:427 +#: c-api/unicode.rst:426 msgid "``-``" msgstr "" -#: c-api/unicode.rst:427 +#: c-api/unicode.rst:426 msgid "" "The converted value is left adjusted (overrides the ``0`` flag if both are " "given)." msgstr "" -#: c-api/unicode.rst:431 +#: c-api/unicode.rst:430 msgid "" "The length modifiers for following integer conversions (``d``, ``i``, ``o``, " "``u``, ``x``, or ``X``) specify the type of the argument (:c:expr:`int` by " "default):" msgstr "" -#: c-api/unicode.rst:438 +#: c-api/unicode.rst:437 msgid "Modifier" msgstr "" -#: c-api/unicode.rst:438 +#: c-api/unicode.rst:437 msgid "Types" msgstr "" -#: c-api/unicode.rst:440 +#: c-api/unicode.rst:439 msgid "``l``" msgstr "" -#: c-api/unicode.rst:440 +#: c-api/unicode.rst:439 msgid ":c:expr:`long` or :c:expr:`unsigned long`" msgstr "" -#: c-api/unicode.rst:442 +#: c-api/unicode.rst:441 msgid "``ll``" msgstr "" -#: c-api/unicode.rst:442 +#: c-api/unicode.rst:441 msgid ":c:expr:`long long` or :c:expr:`unsigned long long`" msgstr "" -#: c-api/unicode.rst:444 +#: c-api/unicode.rst:443 msgid "``j``" msgstr "" -#: c-api/unicode.rst:444 +#: c-api/unicode.rst:443 msgid ":c:type:`intmax_t` or :c:type:`uintmax_t`" msgstr "" -#: c-api/unicode.rst:446 +#: c-api/unicode.rst:445 msgid "``z``" msgstr "" -#: c-api/unicode.rst:446 +#: c-api/unicode.rst:445 msgid ":c:type:`size_t` or :c:type:`ssize_t`" msgstr "" -#: c-api/unicode.rst:448 +#: c-api/unicode.rst:447 msgid "``t``" msgstr "" -#: c-api/unicode.rst:448 +#: c-api/unicode.rst:447 msgid ":c:type:`ptrdiff_t`" msgstr "" -#: c-api/unicode.rst:451 +#: c-api/unicode.rst:450 msgid "" "The length modifier ``l`` for following conversions ``s`` or ``V`` specify " "that the type of the argument is :c:expr:`const wchar_t*`." msgstr "" -#: c-api/unicode.rst:454 +#: c-api/unicode.rst:453 msgid "The conversion specifiers are:" msgstr "" -#: c-api/unicode.rst:460 +#: c-api/unicode.rst:459 msgid "Conversion Specifier" msgstr "" -#: c-api/unicode.rst:461 +#: c-api/unicode.rst:460 msgid "Type" msgstr "" -#: c-api/unicode.rst:462 +#: c-api/unicode.rst:461 msgid "Comment" msgstr "" -#: c-api/unicode.rst:464 +#: c-api/unicode.rst:463 msgid "``%``" msgstr "" -#: c-api/unicode.rst:465 +#: c-api/unicode.rst:464 msgid "*n/a*" msgstr "" -#: c-api/unicode.rst:466 +#: c-api/unicode.rst:465 msgid "The literal ``%`` character." msgstr "" -#: c-api/unicode.rst:468 +#: c-api/unicode.rst:467 msgid "``d``, ``i``" msgstr "" -#: c-api/unicode.rst:473 c-api/unicode.rst:481 c-api/unicode.rst:485 +#: c-api/unicode.rst:472 c-api/unicode.rst:480 c-api/unicode.rst:484 msgid "Specified by the length modifier" msgstr "" -#: c-api/unicode.rst:470 +#: c-api/unicode.rst:469 msgid "The decimal representation of a signed C integer." msgstr "" -#: c-api/unicode.rst:472 +#: c-api/unicode.rst:471 msgid "``u``" msgstr "" -#: c-api/unicode.rst:474 +#: c-api/unicode.rst:473 msgid "The decimal representation of an unsigned C integer." msgstr "" -#: c-api/unicode.rst:476 +#: c-api/unicode.rst:475 msgid "``o``" msgstr "" -#: c-api/unicode.rst:478 +#: c-api/unicode.rst:477 msgid "The octal representation of an unsigned C integer." msgstr "" -#: c-api/unicode.rst:480 +#: c-api/unicode.rst:479 msgid "``x``" msgstr "" -#: c-api/unicode.rst:482 +#: c-api/unicode.rst:481 msgid "The hexadecimal representation of an unsigned C integer (lowercase)." msgstr "" -#: c-api/unicode.rst:484 +#: c-api/unicode.rst:483 msgid "``X``" msgstr "" -#: c-api/unicode.rst:486 +#: c-api/unicode.rst:485 msgid "The hexadecimal representation of an unsigned C integer (uppercase)." msgstr "" -#: c-api/unicode.rst:488 +#: c-api/unicode.rst:487 msgid "``c``" msgstr "" -#: c-api/unicode.rst:489 +#: c-api/unicode.rst:488 msgid ":c:expr:`int`" msgstr "" -#: c-api/unicode.rst:490 +#: c-api/unicode.rst:489 msgid "A single character." msgstr "" -#: c-api/unicode.rst:492 +#: c-api/unicode.rst:491 msgid "``s``" msgstr "" -#: c-api/unicode.rst:493 +#: c-api/unicode.rst:492 msgid ":c:expr:`const char*` or :c:expr:`const wchar_t*`" msgstr "" -#: c-api/unicode.rst:494 +#: c-api/unicode.rst:493 msgid "A null-terminated C character array." msgstr "" -#: c-api/unicode.rst:496 +#: c-api/unicode.rst:495 msgid "``p``" msgstr "" -#: c-api/unicode.rst:497 +#: c-api/unicode.rst:496 msgid ":c:expr:`const void*`" msgstr "" -#: c-api/unicode.rst:498 +#: c-api/unicode.rst:497 msgid "" "The hex representation of a C pointer. Mostly equivalent to " "``printf(\"%p\")`` except that it is guaranteed to start with the literal " "``0x`` regardless of what the platform's ``printf`` yields." msgstr "" -#: c-api/unicode.rst:503 +#: c-api/unicode.rst:502 msgid "``A``" msgstr "" -#: c-api/unicode.rst:508 c-api/unicode.rst:522 +#: c-api/unicode.rst:507 c-api/unicode.rst:521 c-api/unicode.rst:530 msgid ":c:expr:`PyObject*`" msgstr "" -#: c-api/unicode.rst:505 +#: c-api/unicode.rst:504 msgid "The result of calling :func:`ascii`." msgstr "" -#: c-api/unicode.rst:507 +#: c-api/unicode.rst:506 msgid "``U``" msgstr "" -#: c-api/unicode.rst:509 +#: c-api/unicode.rst:508 msgid "A Unicode object." msgstr "" -#: c-api/unicode.rst:511 +#: c-api/unicode.rst:510 msgid "``V``" msgstr "" -#: c-api/unicode.rst:512 +#: c-api/unicode.rst:511 msgid ":c:expr:`PyObject*`, :c:expr:`const char*` or :c:expr:`const wchar_t*`" msgstr "" -#: c-api/unicode.rst:513 +#: c-api/unicode.rst:512 msgid "" "A Unicode object (which may be ``NULL``) and a null-terminated C character " "array as a second parameter (which will be used, if the first parameter is " "``NULL``)." msgstr "" -#: c-api/unicode.rst:517 +#: c-api/unicode.rst:516 msgid "``S``" msgstr "" -#: c-api/unicode.rst:519 +#: c-api/unicode.rst:518 msgid "The result of calling :c:func:`PyObject_Str`." msgstr "" -#: c-api/unicode.rst:521 +#: c-api/unicode.rst:520 msgid "``R``" msgstr "" -#: c-api/unicode.rst:523 +#: c-api/unicode.rst:522 msgid "The result of calling :c:func:`PyObject_Repr`." msgstr "" +#: c-api/unicode.rst:524 +msgid "``T``" +msgstr "" + #: c-api/unicode.rst:526 msgid "" +"Get the fully qualified name of an object type; call :c:func:" +"`PyType_GetFullyQualifiedName`." +msgstr "" + +#: c-api/unicode.rst:529 +msgid "``#T``" +msgstr "" + +#: c-api/unicode.rst:531 +msgid "" +"Similar to ``T`` format, but use a colon (``:``) as separator between the " +"module name and the qualified name." +msgstr "" + +#: c-api/unicode.rst:534 +msgid "``N``" +msgstr "" + +#: c-api/unicode.rst:540 +msgid ":c:expr:`PyTypeObject*`" +msgstr "" + +#: c-api/unicode.rst:536 +msgid "" +"Get the fully qualified name of a type; call :c:func:" +"`PyType_GetFullyQualifiedName`." +msgstr "" + +#: c-api/unicode.rst:539 +msgid "``#N``" +msgstr "" + +#: c-api/unicode.rst:541 +msgid "" +"Similar to ``N`` format, but use a colon (``:``) as separator between the " +"module name and the qualified name." +msgstr "" + +#: c-api/unicode.rst:545 +msgid "" "The width formatter unit is number of characters rather than bytes. The " "precision formatter unit is number of bytes or :c:type:`wchar_t` items (if " "the length modifier ``l`` is used) for ``\"%s\"`` and ``\"%V\"`` (if the " @@ -704,28 +750,28 @@ msgid "" "``PyObject*`` argument is not ``NULL``)." msgstr "" -#: c-api/unicode.rst:534 +#: c-api/unicode.rst:553 msgid "" "Unlike to C :c:func:`printf` the ``0`` flag has effect even when a precision " "is given for integer conversions (``d``, ``i``, ``u``, ``o``, ``x``, or " "``X``)." msgstr "" -#: c-api/unicode.rst:538 +#: c-api/unicode.rst:557 msgid "Support for ``\"%lld\"`` and ``\"%llu\"`` added." msgstr "" -#: c-api/unicode.rst:541 +#: c-api/unicode.rst:560 msgid "Support for ``\"%li\"``, ``\"%lli\"`` and ``\"%zi\"`` added." msgstr "" -#: c-api/unicode.rst:544 +#: c-api/unicode.rst:563 msgid "" "Support width and precision formatter for ``\"%s\"``, ``\"%A\"``, " "``\"%U\"``, ``\"%V\"``, ``\"%S\"``, ``\"%R\"`` added." msgstr "" -#: c-api/unicode.rst:548 +#: c-api/unicode.rst:567 msgid "" "Support for conversion specifiers ``o`` and ``X``. Support for length " "modifiers ``j`` and ``t``. Length modifiers are now applied to all integer " @@ -734,36 +780,50 @@ msgid "" "flag ``-``." msgstr "" -#: c-api/unicode.rst:556 +#: c-api/unicode.rst:575 msgid "" "An unrecognized format character now sets a :exc:`SystemError`. In previous " "versions it caused all the rest of the format string to be copied as-is to " "the result string, and any extra arguments discarded." msgstr "" -#: c-api/unicode.rst:563 +#: c-api/unicode.rst:579 +msgid "Support for ``%T``, ``%#T``, ``%N`` and ``%#N`` formats added." +msgstr "" + +#: c-api/unicode.rst:585 msgid "" "Identical to :c:func:`PyUnicode_FromFormat` except that it takes exactly two " "arguments." msgstr "" -#: c-api/unicode.rst:569 +#: c-api/unicode.rst:591 msgid "" "Copy an instance of a Unicode subtype to a new true Unicode object if " "necessary. If *obj* is already a true Unicode object (not a subtype), return " "a new :term:`strong reference` to the object." msgstr "" -#: c-api/unicode.rst:573 +#: c-api/unicode.rst:595 msgid "" "Objects other than Unicode or its subtypes will cause a :exc:`TypeError`." msgstr "" -#: c-api/unicode.rst:579 +#: c-api/unicode.rst:600 +msgid "Create a Unicode Object from the given Unicode code point *ordinal*." +msgstr "" + +#: c-api/unicode.rst:602 +msgid "" +"The ordinal must be in ``range(0x110000)``. A :exc:`ValueError` is raised in " +"the case it is not." +msgstr "" + +#: c-api/unicode.rst:609 msgid "Decode an encoded object *obj* to a Unicode object." msgstr "" -#: c-api/unicode.rst:581 +#: c-api/unicode.rst:611 msgid "" ":class:`bytes`, :class:`bytearray` and other :term:`bytes-like objects " "` are decoded according to the given *encoding* and using " @@ -771,39 +831,39 @@ msgid "" "interface use the default values (see :ref:`builtincodecs` for details)." msgstr "" -#: c-api/unicode.rst:587 +#: c-api/unicode.rst:617 msgid "" "All other objects, including Unicode objects, cause a :exc:`TypeError` to be " "set." msgstr "" -#: c-api/unicode.rst:590 +#: c-api/unicode.rst:620 msgid "" "The API returns ``NULL`` if there was an error. The caller is responsible " "for decref'ing the returned objects." msgstr "" -#: c-api/unicode.rst:596 +#: c-api/unicode.rst:626 msgid "" "Return the name of the default string encoding, ``\"utf-8\"``. See :func:" "`sys.getdefaultencoding`." msgstr "" -#: c-api/unicode.rst:599 +#: c-api/unicode.rst:629 msgid "" "The returned string does not need to be freed, and is valid until " "interpreter shutdown." msgstr "" -#: c-api/unicode.rst:605 +#: c-api/unicode.rst:635 msgid "Return the length of the Unicode object, in code points." msgstr "" -#: c-api/unicode.rst:607 +#: c-api/unicode.rst:637 msgid "On error, set an exception and return ``-1``." msgstr "" -#: c-api/unicode.rst:618 +#: c-api/unicode.rst:648 msgid "" "Copy characters from one Unicode object into another. This function " "performs character conversion when necessary and falls back to :c:func:`!" @@ -811,61 +871,61 @@ msgid "" "otherwise returns the number of copied characters." msgstr "" -#: c-api/unicode.rst:629 +#: c-api/unicode.rst:659 msgid "" "Fill a string with a character: write *fill_char* into ``unicode[start:" "start+length]``." msgstr "" -#: c-api/unicode.rst:632 +#: c-api/unicode.rst:662 msgid "" "Fail if *fill_char* is bigger than the string maximum character, or if the " "string has more than 1 reference." msgstr "" -#: c-api/unicode.rst:635 +#: c-api/unicode.rst:665 msgid "" "Return the number of written character, or return ``-1`` and raise an " "exception on error." msgstr "" -#: c-api/unicode.rst:644 +#: c-api/unicode.rst:674 msgid "" "Write a character to a string. The string must have been created through :c:" "func:`PyUnicode_New`. Since Unicode strings are supposed to be immutable, " "the string must not be shared, or have been hashed yet." msgstr "" -#: c-api/unicode.rst:648 +#: c-api/unicode.rst:678 msgid "" "This function checks that *unicode* is a Unicode object, that the index is " "not out of bounds, and that the object can be modified safely (i.e. that it " "its reference count is one)." msgstr "" -#: c-api/unicode.rst:652 +#: c-api/unicode.rst:682 msgid "Return ``0`` on success, ``-1`` on error with an exception set." msgstr "" -#: c-api/unicode.rst:659 +#: c-api/unicode.rst:689 msgid "" "Read a character from a string. This function checks that *unicode* is a " "Unicode object and the index is not out of bounds, in contrast to :c:func:" "`PyUnicode_READ_CHAR`, which performs no error checking." msgstr "" -#: c-api/unicode.rst:663 +#: c-api/unicode.rst:693 msgid "Return character on success, ``-1`` on error with an exception set." msgstr "" -#: c-api/unicode.rst:671 +#: c-api/unicode.rst:701 msgid "" "Return a substring of *unicode*, from character index *start* (included) to " "character index *end* (excluded). Negative indices are not supported. On " "error, set an exception and return ``NULL``." msgstr "" -#: c-api/unicode.rst:681 +#: c-api/unicode.rst:711 msgid "" "Copy the string *unicode* into a UCS4 buffer, including a null character, if " "*copy_null* is set. Returns ``NULL`` and sets an exception on error (in " @@ -873,7 +933,7 @@ msgid "" "*unicode*). *buffer* is returned on success." msgstr "" -#: c-api/unicode.rst:691 +#: c-api/unicode.rst:721 msgid "" "Copy the string *unicode* into a new UCS4 buffer that is allocated using :c:" "func:`PyMem_Malloc`. If this fails, ``NULL`` is returned with a :exc:" @@ -881,17 +941,17 @@ msgid "" "appended." msgstr "" -#: c-api/unicode.rst:700 +#: c-api/unicode.rst:730 msgid "Locale Encoding" msgstr "" -#: c-api/unicode.rst:702 +#: c-api/unicode.rst:732 msgid "" "The current locale encoding can be used to decode text from the operating " "system." msgstr "" -#: c-api/unicode.rst:709 +#: c-api/unicode.rst:739 msgid "" "Decode a string from UTF-8 on Android and VxWorks, or from the current " "locale encoding on other platforms. The supported error handlers are " @@ -900,21 +960,21 @@ msgid "" "null character but cannot contain embedded null characters." msgstr "" -#: c-api/unicode.rst:716 +#: c-api/unicode.rst:746 msgid "" "Use :c:func:`PyUnicode_DecodeFSDefaultAndSize` to decode a string from the :" "term:`filesystem encoding and error handler`." msgstr "" -#: c-api/unicode.rst:754 +#: c-api/unicode.rst:784 msgid "This function ignores the :ref:`Python UTF-8 Mode `." msgstr "" -#: c-api/unicode.rst:839 +#: c-api/unicode.rst:869 msgid "The :c:func:`Py_DecodeLocale` function." msgstr "" -#: c-api/unicode.rst:727 +#: c-api/unicode.rst:757 msgid "" "The function now also uses the current locale encoding for the " "``surrogateescape`` error handler, except on Android. Previously, :c:func:" @@ -922,13 +982,13 @@ msgid "" "locale encoding was used for ``strict``." msgstr "" -#: c-api/unicode.rst:736 +#: c-api/unicode.rst:766 msgid "" "Similar to :c:func:`PyUnicode_DecodeLocaleAndSize`, but compute the string " "length using :c:func:`!strlen`." msgstr "" -#: c-api/unicode.rst:744 +#: c-api/unicode.rst:774 msgid "" "Encode a Unicode object to UTF-8 on Android and VxWorks, or to the current " "locale encoding on other platforms. The supported error handlers are " @@ -937,17 +997,17 @@ msgid "" "`bytes` object. *unicode* cannot contain embedded null characters." msgstr "" -#: c-api/unicode.rst:751 +#: c-api/unicode.rst:781 msgid "" "Use :c:func:`PyUnicode_EncodeFSDefault` to encode a string to the :term:" "`filesystem encoding and error handler`." msgstr "" -#: c-api/unicode.rst:870 +#: c-api/unicode.rst:900 msgid "The :c:func:`Py_EncodeLocale` function." msgstr "" -#: c-api/unicode.rst:762 +#: c-api/unicode.rst:792 msgid "" "The function now also uses the current locale encoding for the " "``surrogateescape`` error handler, except on Android. Previously, :c:func:" @@ -955,24 +1015,24 @@ msgid "" "locale encoding was used for ``strict``." msgstr "" -#: c-api/unicode.rst:771 +#: c-api/unicode.rst:801 msgid "File System Encoding" msgstr "" -#: c-api/unicode.rst:773 +#: c-api/unicode.rst:803 msgid "" "Functions encoding to and decoding from the :term:`filesystem encoding and " "error handler` (:pep:`383` and :pep:`529`)." msgstr "" -#: c-api/unicode.rst:776 +#: c-api/unicode.rst:806 msgid "" "To encode file names to :class:`bytes` during argument parsing, the " "``\"O&\"`` converter should be used, passing :c:func:`!" "PyUnicode_FSConverter` as the conversion function:" msgstr "" -#: c-api/unicode.rst:782 +#: c-api/unicode.rst:812 msgid "" ":ref:`PyArg_Parse\\* converter `: encode :class:`str` objects " "-- obtained directly or through the :class:`os.PathLike` interface -- to :" @@ -985,24 +1045,24 @@ msgid "" "not allowed in the result. On failure, return ``0`` with an exception set." msgstr "" -#: c-api/unicode.rst:794 +#: c-api/unicode.rst:824 msgid "" "If *obj* is ``NULL``, the function releases a strong reference stored in the " "variable referred by *result* and returns ``1``." msgstr "" -#: c-api/unicode.rst:826 +#: c-api/unicode.rst:856 msgid "Accepts a :term:`path-like object`." msgstr "" -#: c-api/unicode.rst:802 +#: c-api/unicode.rst:832 msgid "" "To decode file names to :class:`str` during argument parsing, the ``\"O&\"`` " "converter should be used, passing :c:func:`!PyUnicode_FSDecoder` as the " "conversion function:" msgstr "" -#: c-api/unicode.rst:808 +#: c-api/unicode.rst:838 msgid "" ":ref:`PyArg_Parse\\* converter `: decode :class:`bytes` objects " "-- obtained either directly or indirectly through the :class:`os.PathLike` " @@ -1016,62 +1076,62 @@ msgid "" "result. On failure, return ``0`` with an exception set." msgstr "" -#: c-api/unicode.rst:821 +#: c-api/unicode.rst:851 msgid "" "If *obj* is ``NULL``, release the strong reference to the object referred to " "by *result* and return ``1``." msgstr "" -#: c-api/unicode.rst:832 +#: c-api/unicode.rst:862 msgid "Decode a string from the :term:`filesystem encoding and error handler`." msgstr "" -#: c-api/unicode.rst:834 +#: c-api/unicode.rst:864 msgid "" "If you need to decode a string from the current locale encoding, use :c:func:" "`PyUnicode_DecodeLocaleAndSize`." msgstr "" -#: c-api/unicode.rst:854 c-api/unicode.rst:874 +#: c-api/unicode.rst:884 c-api/unicode.rst:904 msgid "" "The :term:`filesystem error handler ` " "is now used." msgstr "" -#: c-api/unicode.rst:848 +#: c-api/unicode.rst:878 msgid "" "Decode a null-terminated string from the :term:`filesystem encoding and " "error handler`." msgstr "" -#: c-api/unicode.rst:851 +#: c-api/unicode.rst:881 msgid "" "If the string length is known, use :c:func:" "`PyUnicode_DecodeFSDefaultAndSize`." msgstr "" -#: c-api/unicode.rst:861 +#: c-api/unicode.rst:891 msgid "" "Encode a Unicode object to the :term:`filesystem encoding and error " "handler`, and return :class:`bytes`. Note that the resulting :class:`bytes` " "object can contain null bytes." msgstr "" -#: c-api/unicode.rst:865 +#: c-api/unicode.rst:895 msgid "" "If you need to encode a string to the current locale encoding, use :c:func:" "`PyUnicode_EncodeLocale`." msgstr "" -#: c-api/unicode.rst:879 +#: c-api/unicode.rst:909 msgid "wchar_t Support" msgstr "" -#: c-api/unicode.rst:881 +#: c-api/unicode.rst:911 msgid ":c:type:`wchar_t` support for platforms which support it:" msgstr "" -#: c-api/unicode.rst:885 +#: c-api/unicode.rst:915 msgid "" "Create a Unicode object from the :c:type:`wchar_t` buffer *wstr* of the " "given *size*. Passing ``-1`` as the *size* indicates that the function must " @@ -1079,7 +1139,7 @@ msgid "" "failure." msgstr "" -#: c-api/unicode.rst:893 +#: c-api/unicode.rst:923 msgid "" "Copy the Unicode object contents into the :c:type:`wchar_t` buffer *wstr*. " "At most *size* :c:type:`wchar_t` characters are copied (excluding a possibly " @@ -1087,13 +1147,13 @@ msgid "" "`wchar_t` characters copied or ``-1`` in case of an error." msgstr "" -#: c-api/unicode.rst:898 +#: c-api/unicode.rst:928 msgid "" "When *wstr* is ``NULL``, instead return the *size* that would be required to " "store all of *unicode* including a terminating null." msgstr "" -#: c-api/unicode.rst:901 +#: c-api/unicode.rst:931 msgid "" "Note that the resulting :c:expr:`wchar_t*` string may or may not be null-" "terminated. It is the responsibility of the caller to make sure that the :c:" @@ -1103,7 +1163,7 @@ msgid "" "most C functions." msgstr "" -#: c-api/unicode.rst:911 +#: c-api/unicode.rst:941 msgid "" "Convert the Unicode object to a wide character string. The output string " "always ends with a null character. If *size* is not ``NULL``, write the " @@ -1114,37 +1174,37 @@ msgid "" "`wchar_t*` string contains null characters a :exc:`ValueError` is raised." msgstr "" -#: c-api/unicode.rst:919 +#: c-api/unicode.rst:949 msgid "" "Returns a buffer allocated by :c:macro:`PyMem_New` (use :c:func:`PyMem_Free` " "to free it) on success. On error, returns ``NULL`` and *\\*size* is " "undefined. Raises a :exc:`MemoryError` if memory allocation is failed." msgstr "" -#: c-api/unicode.rst:926 +#: c-api/unicode.rst:956 msgid "" "Raises a :exc:`ValueError` if *size* is ``NULL`` and the :c:expr:`wchar_t*` " "string contains null characters." msgstr "" -#: c-api/unicode.rst:934 +#: c-api/unicode.rst:964 msgid "Built-in Codecs" msgstr "" -#: c-api/unicode.rst:936 +#: c-api/unicode.rst:966 msgid "" "Python provides a set of built-in codecs which are written in C for speed. " "All of these codecs are directly usable via the following functions." msgstr "" -#: c-api/unicode.rst:939 +#: c-api/unicode.rst:969 msgid "" "Many of the following APIs take two arguments encoding and errors, and they " "have the same semantics as the ones of the built-in :func:`str` string " "object constructor." msgstr "" -#: c-api/unicode.rst:943 +#: c-api/unicode.rst:973 msgid "" "Setting encoding to ``NULL`` causes the default encoding to be used which is " "UTF-8. The file system calls should use :c:func:`PyUnicode_FSConverter` for " @@ -1152,28 +1212,28 @@ msgid "" "handler` internally." msgstr "" -#: c-api/unicode.rst:948 +#: c-api/unicode.rst:978 msgid "" "Error handling is set by errors which may also be set to ``NULL`` meaning to " "use the default handling defined for the codec. Default error handling for " "all built-in codecs is \"strict\" (:exc:`ValueError` is raised)." msgstr "" -#: c-api/unicode.rst:952 +#: c-api/unicode.rst:982 msgid "" "The codecs all use a similar interface. Only deviations from the following " "generic ones are documented for simplicity." msgstr "" -#: c-api/unicode.rst:957 +#: c-api/unicode.rst:987 msgid "Generic Codecs" msgstr "" -#: c-api/unicode.rst:959 +#: c-api/unicode.rst:989 msgid "These are the generic codec APIs:" msgstr "" -#: c-api/unicode.rst:965 +#: c-api/unicode.rst:995 msgid "" "Create a Unicode object by decoding *size* bytes of the encoded string " "*str*. *encoding* and *errors* have the same meaning as the parameters of " @@ -1182,7 +1242,7 @@ msgid "" "was raised by the codec." msgstr "" -#: c-api/unicode.rst:975 +#: c-api/unicode.rst:1005 msgid "" "Encode a Unicode object and return the result as Python bytes object. " "*encoding* and *errors* have the same meaning as the parameters of the same " @@ -1191,21 +1251,21 @@ msgid "" "was raised by the codec." msgstr "" -#: c-api/unicode.rst:983 +#: c-api/unicode.rst:1013 msgid "UTF-8 Codecs" msgstr "" -#: c-api/unicode.rst:985 +#: c-api/unicode.rst:1015 msgid "These are the UTF-8 codec APIs:" msgstr "" -#: c-api/unicode.rst:990 +#: c-api/unicode.rst:1020 msgid "" "Create a Unicode object by decoding *size* bytes of the UTF-8 encoded string " "*str*. Return ``NULL`` if an exception was raised by the codec." msgstr "" -#: c-api/unicode.rst:997 +#: c-api/unicode.rst:1027 msgid "" "If *consumed* is ``NULL``, behave like :c:func:`PyUnicode_DecodeUTF8`. If " "*consumed* is not ``NULL``, trailing incomplete UTF-8 byte sequences will " @@ -1213,14 +1273,20 @@ msgid "" "of bytes that have been decoded will be stored in *consumed*." msgstr "" -#: c-api/unicode.rst:1005 +#: c-api/unicode.rst:1035 msgid "" "Encode a Unicode object using UTF-8 and return the result as Python bytes " "object. Error handling is \"strict\". Return ``NULL`` if an exception was " "raised by the codec." msgstr "" -#: c-api/unicode.rst:1012 +#: c-api/unicode.rst:1054 +msgid "" +"The function fails if the string contains surrogate code points (``U+D800`` " +"- ``U+DFFF``)." +msgstr "" + +#: c-api/unicode.rst:1045 msgid "" "Return a pointer to the UTF-8 encoding of the Unicode object, and store the " "size of the encoded representation (in bytes) in *size*. The *size* " @@ -1229,13 +1295,13 @@ msgid "" "regardless of whether there are any other null code points." msgstr "" -#: c-api/unicode.rst:1018 +#: c-api/unicode.rst:1051 msgid "" -"In the case of an error, ``NULL`` is returned with an exception set and no " -"*size* is stored." +"On error, set an exception, set *size* to ``-1`` (if it's not NULL) and " +"return ``NULL``." msgstr "" -#: c-api/unicode.rst:1021 +#: c-api/unicode.rst:1057 msgid "" "This caches the UTF-8 representation of the string in the Unicode object, " "and subsequent calls will return a pointer to the same buffer. The caller " @@ -1244,19 +1310,19 @@ msgid "" "collected." msgstr "" -#: c-api/unicode.rst:1050 +#: c-api/unicode.rst:1086 msgid "The return type is now ``const char *`` rather of ``char *``." msgstr "" -#: c-api/unicode.rst:1031 +#: c-api/unicode.rst:1067 msgid "This function is a part of the :ref:`limited API `." msgstr "" -#: c-api/unicode.rst:1037 +#: c-api/unicode.rst:1073 msgid "As :c:func:`PyUnicode_AsUTF8AndSize`, but does not store the size." msgstr "" -#: c-api/unicode.rst:1041 +#: c-api/unicode.rst:1077 msgid "" "This function does not have any special behavior for `null characters " "`_ embedded within *unicode*. " @@ -1266,35 +1332,35 @@ msgid "" "c:func:`PyUnicode_AsUTF8AndSize` instead." msgstr "" -#: c-api/unicode.rst:1055 +#: c-api/unicode.rst:1091 msgid "UTF-32 Codecs" msgstr "" -#: c-api/unicode.rst:1057 +#: c-api/unicode.rst:1093 msgid "These are the UTF-32 codec APIs:" msgstr "" -#: c-api/unicode.rst:1063 +#: c-api/unicode.rst:1099 msgid "" "Decode *size* bytes from a UTF-32 encoded buffer string and return the " "corresponding Unicode object. *errors* (if non-``NULL``) defines the error " "handling. It defaults to \"strict\"." msgstr "" -#: c-api/unicode.rst:1117 +#: c-api/unicode.rst:1153 msgid "" "If *byteorder* is non-``NULL``, the decoder starts decoding using the given " "byte order::" msgstr "" -#: c-api/unicode.rst:1120 +#: c-api/unicode.rst:1156 msgid "" "*byteorder == -1: little endian\n" "*byteorder == 0: native order\n" "*byteorder == 1: big endian" msgstr "" -#: c-api/unicode.rst:1074 +#: c-api/unicode.rst:1110 msgid "" "If ``*byteorder`` is zero, and the first four bytes of the input data are a " "byte order mark (BOM), the decoder switches to this byte order and the BOM " @@ -1302,21 +1368,21 @@ msgid "" "``-1`` or ``1``, any byte order mark is copied to the output." msgstr "" -#: c-api/unicode.rst:1079 +#: c-api/unicode.rst:1115 msgid "" "After completion, *\\*byteorder* is set to the current byte order at the end " "of input data." msgstr "" -#: c-api/unicode.rst:1133 +#: c-api/unicode.rst:1169 msgid "If *byteorder* is ``NULL``, the codec starts in native order mode." msgstr "" -#: c-api/unicode.rst:1135 +#: c-api/unicode.rst:1171 msgid "Return ``NULL`` if an exception was raised by the codec." msgstr "" -#: c-api/unicode.rst:1090 +#: c-api/unicode.rst:1126 msgid "" "If *consumed* is ``NULL``, behave like :c:func:`PyUnicode_DecodeUTF32`. If " "*consumed* is not ``NULL``, :c:func:`PyUnicode_DecodeUTF32Stateful` will not " @@ -1325,29 +1391,29 @@ msgid "" "number of bytes that have been decoded will be stored in *consumed*." msgstr "" -#: c-api/unicode.rst:1099 +#: c-api/unicode.rst:1135 msgid "" "Return a Python byte string using the UTF-32 encoding in native byte order. " "The string always starts with a BOM mark. Error handling is \"strict\". " "Return ``NULL`` if an exception was raised by the codec." msgstr "" -#: c-api/unicode.rst:1105 +#: c-api/unicode.rst:1141 msgid "UTF-16 Codecs" msgstr "" -#: c-api/unicode.rst:1107 +#: c-api/unicode.rst:1143 msgid "These are the UTF-16 codec APIs:" msgstr "" -#: c-api/unicode.rst:1113 +#: c-api/unicode.rst:1149 msgid "" "Decode *size* bytes from a UTF-16 encoded buffer string and return the " "corresponding Unicode object. *errors* (if non-``NULL``) defines the error " "handling. It defaults to \"strict\"." msgstr "" -#: c-api/unicode.rst:1124 +#: c-api/unicode.rst:1160 msgid "" "If ``*byteorder`` is zero, and the first two bytes of the input data are a " "byte order mark (BOM), the decoder switches to this byte order and the BOM " @@ -1356,13 +1422,13 @@ msgid "" "result in either a ``\\ufeff`` or a ``\\ufffe`` character)." msgstr "" -#: c-api/unicode.rst:1130 +#: c-api/unicode.rst:1166 msgid "" "After completion, ``*byteorder`` is set to the current byte order at the end " "of input data." msgstr "" -#: c-api/unicode.rst:1141 +#: c-api/unicode.rst:1177 msgid "" "If *consumed* is ``NULL``, behave like :c:func:`PyUnicode_DecodeUTF16`. If " "*consumed* is not ``NULL``, :c:func:`PyUnicode_DecodeUTF16Stateful` will not " @@ -1372,28 +1438,28 @@ msgid "" "*consumed*." msgstr "" -#: c-api/unicode.rst:1150 +#: c-api/unicode.rst:1186 msgid "" "Return a Python byte string using the UTF-16 encoding in native byte order. " "The string always starts with a BOM mark. Error handling is \"strict\". " "Return ``NULL`` if an exception was raised by the codec." msgstr "" -#: c-api/unicode.rst:1156 +#: c-api/unicode.rst:1192 msgid "UTF-7 Codecs" msgstr "" -#: c-api/unicode.rst:1158 +#: c-api/unicode.rst:1194 msgid "These are the UTF-7 codec APIs:" msgstr "" -#: c-api/unicode.rst:1163 +#: c-api/unicode.rst:1199 msgid "" "Create a Unicode object by decoding *size* bytes of the UTF-7 encoded string " "*str*. Return ``NULL`` if an exception was raised by the codec." msgstr "" -#: c-api/unicode.rst:1170 +#: c-api/unicode.rst:1206 msgid "" "If *consumed* is ``NULL``, behave like :c:func:`PyUnicode_DecodeUTF7`. If " "*consumed* is not ``NULL``, trailing incomplete UTF-7 base-64 sections will " @@ -1401,101 +1467,101 @@ msgid "" "of bytes that have been decoded will be stored in *consumed*." msgstr "" -#: c-api/unicode.rst:1177 +#: c-api/unicode.rst:1213 msgid "Unicode-Escape Codecs" msgstr "" -#: c-api/unicode.rst:1179 +#: c-api/unicode.rst:1215 msgid "These are the \"Unicode Escape\" codec APIs:" msgstr "" -#: c-api/unicode.rst:1185 +#: c-api/unicode.rst:1221 msgid "" "Create a Unicode object by decoding *size* bytes of the Unicode-Escape " "encoded string *str*. Return ``NULL`` if an exception was raised by the " "codec." msgstr "" -#: c-api/unicode.rst:1191 +#: c-api/unicode.rst:1227 msgid "" "Encode a Unicode object using Unicode-Escape and return the result as a " "bytes object. Error handling is \"strict\". Return ``NULL`` if an " "exception was raised by the codec." msgstr "" -#: c-api/unicode.rst:1197 +#: c-api/unicode.rst:1233 msgid "Raw-Unicode-Escape Codecs" msgstr "" -#: c-api/unicode.rst:1199 +#: c-api/unicode.rst:1235 msgid "These are the \"Raw Unicode Escape\" codec APIs:" msgstr "" -#: c-api/unicode.rst:1205 +#: c-api/unicode.rst:1241 msgid "" "Create a Unicode object by decoding *size* bytes of the Raw-Unicode-Escape " "encoded string *str*. Return ``NULL`` if an exception was raised by the " "codec." msgstr "" -#: c-api/unicode.rst:1211 +#: c-api/unicode.rst:1247 msgid "" "Encode a Unicode object using Raw-Unicode-Escape and return the result as a " "bytes object. Error handling is \"strict\". Return ``NULL`` if an " "exception was raised by the codec." msgstr "" -#: c-api/unicode.rst:1217 +#: c-api/unicode.rst:1253 msgid "Latin-1 Codecs" msgstr "" -#: c-api/unicode.rst:1219 +#: c-api/unicode.rst:1255 msgid "" "These are the Latin-1 codec APIs: Latin-1 corresponds to the first 256 " "Unicode ordinals and only these are accepted by the codecs during encoding." msgstr "" -#: c-api/unicode.rst:1225 +#: c-api/unicode.rst:1261 msgid "" "Create a Unicode object by decoding *size* bytes of the Latin-1 encoded " "string *str*. Return ``NULL`` if an exception was raised by the codec." msgstr "" -#: c-api/unicode.rst:1231 +#: c-api/unicode.rst:1267 msgid "" "Encode a Unicode object using Latin-1 and return the result as Python bytes " "object. Error handling is \"strict\". Return ``NULL`` if an exception was " "raised by the codec." msgstr "" -#: c-api/unicode.rst:1237 +#: c-api/unicode.rst:1273 msgid "ASCII Codecs" msgstr "" -#: c-api/unicode.rst:1239 +#: c-api/unicode.rst:1275 msgid "" "These are the ASCII codec APIs. Only 7-bit ASCII data is accepted. All " "other codes generate errors." msgstr "" -#: c-api/unicode.rst:1245 +#: c-api/unicode.rst:1281 msgid "" "Create a Unicode object by decoding *size* bytes of the ASCII encoded string " "*str*. Return ``NULL`` if an exception was raised by the codec." msgstr "" -#: c-api/unicode.rst:1251 +#: c-api/unicode.rst:1287 msgid "" "Encode a Unicode object using ASCII and return the result as Python bytes " "object. Error handling is \"strict\". Return ``NULL`` if an exception was " "raised by the codec." msgstr "" -#: c-api/unicode.rst:1257 +#: c-api/unicode.rst:1293 msgid "Character Map Codecs" msgstr "" -#: c-api/unicode.rst:1259 +#: c-api/unicode.rst:1295 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 " @@ -1505,18 +1571,18 @@ msgid "" "sequences work well." msgstr "" -#: c-api/unicode.rst:1265 +#: c-api/unicode.rst:1301 msgid "These are the mapping codec APIs:" msgstr "" -#: c-api/unicode.rst:1270 +#: c-api/unicode.rst:1306 msgid "" "Create a Unicode object by decoding *size* bytes of the encoded string *str* " "using the given *mapping* object. Return ``NULL`` if an exception was " "raised by the codec." msgstr "" -#: c-api/unicode.rst:1274 +#: c-api/unicode.rst:1310 msgid "" "If *mapping* is ``NULL``, Latin-1 decoding will be applied. Else *mapping* " "must map bytes ordinals (integers in the range from 0 to 255) to Unicode " @@ -1526,14 +1592,14 @@ msgid "" "treated as undefined mappings and cause an error." msgstr "" -#: c-api/unicode.rst:1285 +#: c-api/unicode.rst:1321 msgid "" "Encode a Unicode object using the given *mapping* object and return the " "result as a bytes object. Error handling is \"strict\". Return ``NULL`` if " "an exception was raised by the codec." msgstr "" -#: c-api/unicode.rst:1289 +#: c-api/unicode.rst:1325 msgid "" "The *mapping* object must map Unicode ordinal integers to bytes objects, " "integers in the range from 0 to 255 or ``None``. Unmapped character " @@ -1541,41 +1607,41 @@ msgid "" "``None`` are treated as \"undefined mapping\" and cause an error." msgstr "" -#: c-api/unicode.rst:1295 +#: c-api/unicode.rst:1331 msgid "The following codec API is special in that maps Unicode to Unicode." msgstr "" -#: c-api/unicode.rst:1299 +#: c-api/unicode.rst:1335 msgid "" "Translate a string by applying a character mapping table to it and return " "the resulting Unicode object. Return ``NULL`` if an exception was raised by " "the codec." msgstr "" -#: c-api/unicode.rst:1303 +#: c-api/unicode.rst:1339 msgid "" "The mapping table must map Unicode ordinal integers to Unicode ordinal " "integers or ``None`` (causing deletion of the character)." msgstr "" -#: c-api/unicode.rst:1306 +#: c-api/unicode.rst:1342 msgid "" "Mapping tables need only provide the :meth:`~object.__getitem__` interface; " "dictionaries and sequences work well. Unmapped character ordinals (ones " "which cause a :exc:`LookupError`) are left untouched and are copied as-is." msgstr "" -#: c-api/unicode.rst:1310 +#: c-api/unicode.rst:1346 msgid "" "*errors* has the usual meaning for codecs. It may be ``NULL`` which " "indicates to use the default error handling." msgstr "" -#: c-api/unicode.rst:1315 +#: c-api/unicode.rst:1351 msgid "MBCS codecs for Windows" msgstr "" -#: c-api/unicode.rst:1317 +#: c-api/unicode.rst:1353 msgid "" "These are the MBCS codec APIs. They are currently only available on Windows " "and use the Win32 MBCS converters to implement the conversions. Note that " @@ -1583,13 +1649,13 @@ msgid "" "is defined by the user settings on the machine running the codec." msgstr "" -#: c-api/unicode.rst:1324 +#: c-api/unicode.rst:1360 msgid "" "Create a Unicode object by decoding *size* bytes of the MBCS encoded string " "*str*. Return ``NULL`` if an exception was raised by the codec." msgstr "" -#: c-api/unicode.rst:1331 +#: c-api/unicode.rst:1367 msgid "" "If *consumed* is ``NULL``, behave like :c:func:`PyUnicode_DecodeMBCS`. If " "*consumed* is not ``NULL``, :c:func:`PyUnicode_DecodeMBCSStateful` will not " @@ -1597,50 +1663,50 @@ msgid "" "will be stored in *consumed*." msgstr "" -#: c-api/unicode.rst:1340 +#: c-api/unicode.rst:1376 msgid "" "Similar to :c:func:`PyUnicode_DecodeMBCSStateful`, except uses the code page " "specified by *code_page*." msgstr "" -#: c-api/unicode.rst:1346 +#: c-api/unicode.rst:1382 msgid "" "Encode a Unicode object using MBCS and return the result as Python bytes " "object. Error handling is \"strict\". Return ``NULL`` if an exception was " "raised by the codec." msgstr "" -#: c-api/unicode.rst:1353 +#: c-api/unicode.rst:1389 msgid "" "Encode the Unicode object using the specified code page and return a Python " "bytes object. Return ``NULL`` if an exception was raised by the codec. Use :" "c:macro:`!CP_ACP` code page to get the MBCS encoder." msgstr "" -#: c-api/unicode.rst:1361 +#: c-api/unicode.rst:1397 msgid "Methods & Slots" msgstr "" -#: c-api/unicode.rst:1367 +#: c-api/unicode.rst:1403 msgid "Methods and Slot Functions" msgstr "" -#: c-api/unicode.rst:1369 +#: c-api/unicode.rst:1405 msgid "" "The following APIs are capable of handling Unicode objects and strings on " "input (we refer to them as strings in the descriptions) and return Unicode " "objects or integers as appropriate." msgstr "" -#: c-api/unicode.rst:1373 +#: c-api/unicode.rst:1409 msgid "They all return ``NULL`` or ``-1`` if an exception occurs." msgstr "" -#: c-api/unicode.rst:1378 +#: c-api/unicode.rst:1414 msgid "Concat two strings giving a new Unicode string." msgstr "" -#: c-api/unicode.rst:1383 +#: c-api/unicode.rst:1419 msgid "" "Split a string giving a list of Unicode strings. If *sep* is ``NULL``, " "splitting will be done at all whitespace substrings. Otherwise, splits " @@ -1649,32 +1715,32 @@ msgid "" "list." msgstr "" -#: c-api/unicode.rst:1398 c-api/unicode.rst:1432 +#: c-api/unicode.rst:1434 c-api/unicode.rst:1468 msgid "On error, return ``NULL`` with an exception set." msgstr "" -#: c-api/unicode.rst:1390 +#: c-api/unicode.rst:1426 msgid "Equivalent to :py:meth:`str.split`." msgstr "" -#: c-api/unicode.rst:1395 +#: c-api/unicode.rst:1431 msgid "" "Similar to :c:func:`PyUnicode_Split`, but splitting will be done beginning " "at the end of the string." msgstr "" -#: c-api/unicode.rst:1400 +#: c-api/unicode.rst:1436 msgid "Equivalent to :py:meth:`str.rsplit`." msgstr "" -#: c-api/unicode.rst:1405 +#: c-api/unicode.rst:1441 msgid "" "Split a Unicode string at line breaks, returning a list of Unicode strings. " "CRLF is considered to be one line break. If *keepends* is ``0``, the Line " "break characters are not included in the resulting strings." msgstr "" -#: c-api/unicode.rst:1412 +#: c-api/unicode.rst:1448 msgid "" "Split a Unicode string at the first occurrence of *sep*, and return a 3-" "tuple containing the part before the separator, the separator itself, and " @@ -1682,39 +1748,39 @@ msgid "" "tuple containing the string itself, followed by two empty strings." msgstr "" -#: c-api/unicode.rst:1430 +#: c-api/unicode.rst:1466 msgid "*sep* must not be empty." msgstr "" -#: c-api/unicode.rst:1421 +#: c-api/unicode.rst:1457 msgid "Equivalent to :py:meth:`str.partition`." msgstr "" -#: c-api/unicode.rst:1426 +#: c-api/unicode.rst:1462 msgid "" "Similar to :c:func:`PyUnicode_Partition`, but split a Unicode string at the " "last occurrence of *sep*. If the separator is not found, return a 3-tuple " "containing two empty strings, followed by the string itself." msgstr "" -#: c-api/unicode.rst:1434 +#: c-api/unicode.rst:1470 msgid "Equivalent to :py:meth:`str.rpartition`." msgstr "" -#: c-api/unicode.rst:1439 +#: c-api/unicode.rst:1475 msgid "" "Join a sequence of strings using the given *separator* and return the " "resulting Unicode string." msgstr "" -#: c-api/unicode.rst:1446 +#: c-api/unicode.rst:1482 msgid "" "Return ``1`` if *substr* matches ``unicode[start:end]`` at the given tail " "end (*direction* == ``-1`` means to do a prefix match, *direction* == ``1`` " "a suffix match), ``0`` otherwise. Return ``-1`` if an error occurred." msgstr "" -#: c-api/unicode.rst:1454 +#: c-api/unicode.rst:1490 msgid "" "Return the first position of *substr* in ``unicode[start:end]`` using the " "given *direction* (*direction* == ``1`` means to do a forward search, " @@ -1723,7 +1789,7 @@ msgid "" "``-2`` indicates that an error occurred and an exception has been set." msgstr "" -#: c-api/unicode.rst:1464 +#: c-api/unicode.rst:1500 msgid "" "Return the first position of the character *ch* in ``unicode[start:end]`` " "using the given *direction* (*direction* == ``1`` means to do a forward " @@ -1733,37 +1799,57 @@ msgid "" "set." msgstr "" -#: c-api/unicode.rst:1472 +#: c-api/unicode.rst:1508 msgid "" "*start* and *end* are now adjusted to behave like ``unicode[start:end]``." msgstr "" -#: c-api/unicode.rst:1479 +#: c-api/unicode.rst:1515 msgid "" "Return the number of non-overlapping occurrences of *substr* in " "``unicode[start:end]``. Return ``-1`` if an error occurred." msgstr "" -#: c-api/unicode.rst:1486 +#: c-api/unicode.rst:1522 msgid "" "Replace at most *maxcount* occurrences of *substr* in *unicode* with " "*replstr* and return the resulting Unicode object. *maxcount* == ``-1`` " "means replace all occurrences." msgstr "" -#: c-api/unicode.rst:1493 +#: c-api/unicode.rst:1529 msgid "" "Compare two strings and return ``-1``, ``0``, ``1`` for less than, equal, " "and greater than, respectively." msgstr "" -#: c-api/unicode.rst:1496 +#: c-api/unicode.rst:1532 msgid "" "This function returns ``-1`` upon failure, so one should call :c:func:" "`PyErr_Occurred` to check for errors." msgstr "" -#: c-api/unicode.rst:1502 +#: c-api/unicode.rst:1538 +msgid "" +"Compare a Unicode object with a char buffer which is interpreted as being " +"UTF-8 or ASCII encoded and return true (``1``) if they are equal, or false " +"(``0``) otherwise. If the Unicode object contains surrogate code points " +"(``U+D800`` - ``U+DFFF``) or the C string is not valid UTF-8, false (``0``) " +"is returned." +msgstr "" + +#: c-api/unicode.rst:1566 +msgid "This function does not raise exceptions." +msgstr "" + +#: c-api/unicode.rst:1552 +msgid "" +"Similar to :c:func:`PyUnicode_EqualToUTF8AndSize`, but compute *string* " +"length using :c:func:`!strlen`. If the Unicode object contains null " +"characters, false (``0``) is returned." +msgstr "" + +#: c-api/unicode.rst:1561 msgid "" "Compare a Unicode object, *unicode*, with *string* and return ``-1``, ``0``, " "``1`` for less than, equal, and greater than, respectively. It is best to " @@ -1771,51 +1857,47 @@ msgid "" "string as ISO-8859-1 if it contains non-ASCII characters." msgstr "" -#: c-api/unicode.rst:1507 -msgid "This function does not raise exceptions." -msgstr "" - -#: c-api/unicode.rst:1512 +#: c-api/unicode.rst:1571 msgid "Rich compare two Unicode strings and return one of the following:" msgstr "" -#: c-api/unicode.rst:1514 +#: c-api/unicode.rst:1573 msgid "``NULL`` in case an exception was raised" msgstr "" -#: c-api/unicode.rst:1515 +#: c-api/unicode.rst:1574 msgid ":c:data:`Py_True` or :c:data:`Py_False` for successful comparisons" msgstr "" -#: c-api/unicode.rst:1516 +#: c-api/unicode.rst:1575 msgid ":c:data:`Py_NotImplemented` in case the type combination is unknown" msgstr "" -#: c-api/unicode.rst:1518 +#: c-api/unicode.rst:1577 msgid "" "Possible values for *op* are :c:macro:`Py_GT`, :c:macro:`Py_GE`, :c:macro:" "`Py_EQ`, :c:macro:`Py_NE`, :c:macro:`Py_LT`, and :c:macro:`Py_LE`." msgstr "" -#: c-api/unicode.rst:1524 +#: c-api/unicode.rst:1583 msgid "" "Return a new string object from *format* and *args*; this is analogous to " "``format % args``." msgstr "" -#: c-api/unicode.rst:1530 +#: c-api/unicode.rst:1589 msgid "" "Check whether *substr* is contained in *unicode* and return true or false " "accordingly." msgstr "" -#: c-api/unicode.rst:1533 +#: c-api/unicode.rst:1592 msgid "" "*substr* has to coerce to a one element Unicode string. ``-1`` is returned " "if there was an error." msgstr "" -#: c-api/unicode.rst:1539 +#: c-api/unicode.rst:1598 msgid "" "Intern the argument :c:expr:`*p_unicode` in place. The argument must be the " "address of a pointer variable pointing to a Python Unicode string object. " @@ -1826,7 +1908,7 @@ msgid "" "interns it." msgstr "" -#: c-api/unicode.rst:1546 +#: c-api/unicode.rst:1605 msgid "" "(Clarification: even though there is a lot of talk about references, think " "of this function as reference-neutral. You must own the object you pass in; " @@ -1834,42 +1916,47 @@ msgid "" "the result.)" msgstr "" -#: c-api/unicode.rst:1551 +#: c-api/unicode.rst:1610 msgid "" "This function never raises an exception. On error, it leaves its argument " "unchanged without interning it." msgstr "" -#: c-api/unicode.rst:1554 +#: c-api/unicode.rst:1613 msgid "" "Instances of subclasses of :py:class:`str` may not be interned, that is, :c:" "expr:`PyUnicode_CheckExact(*p_unicode)` must be true. If it is not, then -- " "as with any other error -- the argument is left unchanged." msgstr "" -#: c-api/unicode.rst:1558 +#: c-api/unicode.rst:1617 msgid "" "Note that interned strings are not “immortal”. You must keep a reference to " "the result to benefit from interning." msgstr "" -#: c-api/unicode.rst:1564 +#: c-api/unicode.rst:1623 msgid "" "A combination of :c:func:`PyUnicode_FromString` and :c:func:" "`PyUnicode_InternInPlace`, meant for statically allocated strings." msgstr "" -#: c-api/unicode.rst:1567 +#: c-api/unicode.rst:1626 msgid "" "Return a new (\"owned\") reference to either a new Unicode string object " "that has been interned, or an earlier interned string object with the same " "value." msgstr "" -#: c-api/unicode.rst:1571 +#: c-api/unicode.rst:1630 msgid "" -"Python may keep a reference to the result, or prevent it from being garbage-" -"collected promptly. For interning an unbounded number of different strings, " -"such as ones coming from user input, prefer calling :c:func:" -"`PyUnicode_FromString` and :c:func:`PyUnicode_InternInPlace` directly." +"Python may keep a reference to the result, or make it :term:`immortal`, " +"preventing it from being garbage-collected promptly. For interning an " +"unbounded number of different strings, such as ones coming from user input, " +"prefer calling :c:func:`PyUnicode_FromString` and :c:func:" +"`PyUnicode_InternInPlace` directly." +msgstr "" + +#: c-api/unicode.rst:1638 +msgid "Strings interned this way are made :term:`immortal`." msgstr "" diff --git a/c-api/utilities.po b/c-api/utilities.po index 6c476e7f..8341d8bf 100644 --- a/c-api/utilities.po +++ b/c-api/utilities.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" diff --git a/c-api/veryhigh.po b/c-api/veryhigh.po index dd91027a..8e04beba 100644 --- a/c-api/veryhigh.po +++ b/c-api/veryhigh.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -50,47 +50,23 @@ msgstr "" #: c-api/veryhigh.rst:30 msgid "" -"The main program for the standard interpreter. This is made available for " -"programs which embed Python. The *argc* and *argv* parameters should be " -"prepared exactly as those which are passed to a C program's :c:func:`main` " -"function (converted to wchar_t according to the user's locale). It is " -"important to note that the argument list may be modified (but the contents " -"of the strings pointed to by the argument list are not). The return value " -"will be ``0`` if the interpreter exits normally (i.e., without an " -"exception), ``1`` if the interpreter exits due to an exception, or ``2`` if " -"the parameter list does not represent a valid Python command line." -msgstr "" - -#: c-api/veryhigh.rst:40 -msgid "" -"Note that if an otherwise unhandled :exc:`SystemExit` is raised, this " -"function will not return ``1``, but exit the process, as long as :c:member:" -"`PyConfig.inspect` is zero." -msgstr "" - -#: c-api/veryhigh.rst:47 -msgid "Similar to :c:func:`Py_Main` but *argv* is an array of bytes strings." -msgstr "" - -#: c-api/veryhigh.rst:54 -msgid "" "This is a simplified interface to :c:func:`PyRun_AnyFileExFlags` below, " "leaving *closeit* set to ``0`` and *flags* set to ``NULL``." msgstr "" -#: c-api/veryhigh.rst:60 +#: c-api/veryhigh.rst:36 msgid "" "This is a simplified interface to :c:func:`PyRun_AnyFileExFlags` below, " "leaving the *closeit* argument set to ``0``." msgstr "" -#: c-api/veryhigh.rst:66 +#: c-api/veryhigh.rst:42 msgid "" "This is a simplified interface to :c:func:`PyRun_AnyFileExFlags` below, " "leaving the *flags* argument set to ``NULL``." msgstr "" -#: c-api/veryhigh.rst:72 +#: c-api/veryhigh.rst:48 msgid "" "If *fp* refers to a file associated with an interactive device (console or " "terminal input or Unix pseudo-terminal), return the value of :c:func:" @@ -101,13 +77,13 @@ msgid "" "before ``PyRun_SimpleFileExFlags()`` returns." msgstr "" -#: c-api/veryhigh.rst:84 +#: c-api/veryhigh.rst:60 msgid "" "This is a simplified interface to :c:func:`PyRun_SimpleStringFlags` below, " "leaving the :c:struct:`PyCompilerFlags`\\* argument set to ``NULL``." msgstr "" -#: c-api/veryhigh.rst:90 +#: c-api/veryhigh.rst:66 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 +92,26 @@ msgid "" "information. For the meaning of *flags*, see below." msgstr "" -#: c-api/veryhigh.rst:96 +#: c-api/veryhigh.rst:72 msgid "" "Note that if an otherwise unhandled :exc:`SystemExit` is raised, this " "function will not return ``-1``, but exit the process, as long as :c:member:" "`PyConfig.inspect` is zero." msgstr "" -#: c-api/veryhigh.rst:103 +#: c-api/veryhigh.rst:79 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:109 +#: c-api/veryhigh.rst:85 msgid "" "This is a simplified interface to :c:func:`PyRun_SimpleFileExFlags` below, " "leaving *flags* set to ``NULL``." msgstr "" -#: c-api/veryhigh.rst:115 +#: c-api/veryhigh.rst:91 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 +120,20 @@ msgid "" "``PyRun_SimpleFileExFlags()`` returns." msgstr "" -#: c-api/veryhigh.rst:122 +#: c-api/veryhigh.rst:98 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:128 +#: c-api/veryhigh.rst:104 msgid "" "This is a simplified interface to :c:func:`PyRun_InteractiveOneFlags` below, " "leaving *flags* set to ``NULL``." msgstr "" -#: c-api/veryhigh.rst:134 +#: c-api/veryhigh.rst:110 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 +141,7 @@ msgid "" "term:`filesystem encoding and error handler`." msgstr "" -#: c-api/veryhigh.rst:139 +#: c-api/veryhigh.rst:115 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 +150,13 @@ msgid "" "specifically if needed.)" msgstr "" -#: c-api/veryhigh.rst:148 +#: c-api/veryhigh.rst:124 msgid "" "This is a simplified interface to :c:func:`PyRun_InteractiveLoopFlags` " "below, leaving *flags* set to ``NULL``." msgstr "" -#: c-api/veryhigh.rst:154 +#: c-api/veryhigh.rst:130 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 +164,7 @@ msgid "" "and error handler`. Returns ``0`` at EOF or a negative number upon failure." msgstr "" -#: c-api/veryhigh.rst:162 +#: c-api/veryhigh.rst:138 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,13 +174,13 @@ msgid "" "the Python source code." msgstr "" -#: c-api/veryhigh.rst:194 +#: c-api/veryhigh.rst:170 msgid "" "This function is only called from the :ref:`main interpreter `." msgstr "" -#: c-api/veryhigh.rst:177 +#: c-api/veryhigh.rst:153 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 " @@ -215,26 +191,26 @@ msgid "" "line-editing and tab-completion features." msgstr "" -#: c-api/veryhigh.rst:186 +#: c-api/veryhigh.rst:162 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:189 +#: c-api/veryhigh.rst:165 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:200 +#: c-api/veryhigh.rst:176 msgid "" "This is a simplified interface to :c:func:`PyRun_StringFlags` below, leaving " "*flags* set to ``NULL``." msgstr "" -#: c-api/veryhigh.rst:206 +#: c-api/veryhigh.rst:182 msgid "" "Execute Python source code from *str* in the context specified by the " "objects *globals* and *locals* with the compiler flags specified by " @@ -243,31 +219,31 @@ msgid "" "token that should be used to parse the source code." msgstr "" -#: c-api/veryhigh.rst:212 +#: c-api/veryhigh.rst:188 msgid "" "Returns the result of executing the code as a Python object, or ``NULL`` if " "an exception was raised." msgstr "" -#: c-api/veryhigh.rst:218 +#: c-api/veryhigh.rst:194 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:224 +#: c-api/veryhigh.rst:200 msgid "" "This is a simplified interface to :c:func:`PyRun_FileExFlags` below, leaving " "*flags* set to ``NULL``." msgstr "" -#: c-api/veryhigh.rst:230 +#: c-api/veryhigh.rst:206 msgid "" "This is a simplified interface to :c:func:`PyRun_FileExFlags` below, leaving " "*closeit* set to ``0``." msgstr "" -#: c-api/veryhigh.rst:236 +#: c-api/veryhigh.rst:212 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 " @@ -276,19 +252,19 @@ msgid "" "`PyRun_FileExFlags` returns." msgstr "" -#: c-api/veryhigh.rst:245 +#: c-api/veryhigh.rst:221 msgid "" "This is a simplified interface to :c:func:`Py_CompileStringFlags` below, " "leaving *flags* set to ``NULL``." msgstr "" -#: c-api/veryhigh.rst:251 +#: c-api/veryhigh.rst:227 msgid "" "This is a simplified interface to :c:func:`Py_CompileStringExFlags` below, " "with *optimize* set to ``-1``." msgstr "" -#: c-api/veryhigh.rst:257 +#: c-api/veryhigh.rst:233 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 " @@ -299,7 +275,7 @@ msgid "" "returns ``NULL`` if the code cannot be parsed or compiled." msgstr "" -#: c-api/veryhigh.rst:265 +#: c-api/veryhigh.rst:241 msgid "" "The integer *optimize* specifies the optimization level of the compiler; a " "value of ``-1`` selects the optimization level of the interpreter as given " @@ -308,20 +284,20 @@ msgid "" "or ``2`` (docstrings are removed too)." msgstr "" -#: c-api/veryhigh.rst:276 +#: c-api/veryhigh.rst:252 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:283 +#: c-api/veryhigh.rst:259 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:290 +#: c-api/veryhigh.rst:266 msgid "" "Evaluate a precompiled code object, given a particular environment for its " "evaluation. This environment consists of a dictionary of global variables, " @@ -330,13 +306,13 @@ msgid "" "only_parameter>` arguments and a closure tuple of cells." msgstr "" -#: c-api/veryhigh.rst:299 +#: c-api/veryhigh.rst:275 msgid "" "Evaluate an execution frame. This is a simplified interface to :c:func:" "`PyEval_EvalFrameEx`, for backward compatibility." msgstr "" -#: c-api/veryhigh.rst:305 +#: c-api/veryhigh.rst:281 msgid "" "This is the main, unvarnished function of Python interpretation. The code " "object associated with the execution frame *f* is executed, interpreting " @@ -346,39 +322,39 @@ msgid "" "of generator objects." msgstr "" -#: c-api/veryhigh.rst:312 +#: c-api/veryhigh.rst:288 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:319 +#: c-api/veryhigh.rst:295 msgid "" "This function changes the flags of the current evaluation frame, and returns " "true on success, false on failure." msgstr "" -#: c-api/veryhigh.rst:327 +#: c-api/veryhigh.rst:303 msgid "" "The start symbol from the Python grammar for isolated expressions; for use " "with :c:func:`Py_CompileString`." msgstr "" -#: c-api/veryhigh.rst:335 +#: c-api/veryhigh.rst:311 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:344 +#: c-api/veryhigh.rst:320 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:351 +#: c-api/veryhigh.rst:327 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,39 +362,49 @@ msgid "" "case, ``from __future__ import`` can modify *flags*." msgstr "" -#: c-api/veryhigh.rst:356 +#: c-api/veryhigh.rst:332 msgid "" "Whenever ``PyCompilerFlags *flags`` is ``NULL``, :c:member:`~PyCompilerFlags." "cf_flags` is treated as equal to ``0``, and any modification due to ``from " "__future__ import`` is discarded." msgstr "" -#: c-api/veryhigh.rst:362 +#: c-api/veryhigh.rst:338 msgid "Compiler flags." msgstr "" -#: c-api/veryhigh.rst:366 +#: c-api/veryhigh.rst:342 msgid "" "*cf_feature_version* is the minor Python version. It should be initialized " "to ``PY_MINOR_VERSION``." msgstr "" -#: c-api/veryhigh.rst:369 +#: c-api/veryhigh.rst:345 msgid "" "The field is ignored by default, it is used if and only if ``PyCF_ONLY_AST`` " "flag is set in :c:member:`~PyCompilerFlags.cf_flags`." msgstr "" -#: c-api/veryhigh.rst:372 +#: c-api/veryhigh.rst:348 msgid "Added *cf_feature_version* field." msgstr "" -#: c-api/veryhigh.rst:378 +#: c-api/veryhigh.rst:351 +msgid "The available compiler flags are accessible as macros:" +msgstr "" + +#: c-api/veryhigh.rst:360 +msgid "" +"See :ref:`compiler flags ` in documentation of the :py:" +"mod:`!ast` Python module, which exports these constants under the same names." +msgstr "" + +#: c-api/veryhigh.rst:366 msgid "" "This bit can be set in *flags* to cause division operator ``/`` to be " "interpreted as \"true division\" according to :pep:`238`." msgstr "" -#: c-api/veryhigh.rst:333 c-api/veryhigh.rst:342 +#: c-api/veryhigh.rst:309 c-api/veryhigh.rst:318 msgid "Py_CompileString (C function)" msgstr "" diff --git a/c-api/weakref.po b/c-api/weakref.po index c63e2981..07cbbee9 100644 --- a/c-api/weakref.po +++ b/c-api/weakref.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -31,17 +31,19 @@ msgstr "" #: c-api/weakref.rst:16 msgid "" -"Return true if *ob* is either a reference or proxy object. This function " -"always succeeds." +"Return non-zero if *ob* is either a reference or proxy object. This " +"function always succeeds." msgstr "" #: c-api/weakref.rst:22 msgid "" -"Return true if *ob* is a reference object. This function always succeeds." +"Return non-zero if *ob* is a reference object. This function always " +"succeeds." msgstr "" #: c-api/weakref.rst:27 -msgid "Return true if *ob* is a proxy object. This function always succeeds." +msgid "" +"Return non-zero if *ob* is a proxy object. This function always succeeds." msgstr "" #: c-api/weakref.rst:32 @@ -70,11 +72,31 @@ msgstr "" #: c-api/weakref.rst:56 msgid "" -"Return the referenced object from a weak reference, *ref*. If the referent " -"is no longer live, returns ``Py_None``." +"Get a :term:`strong reference` to the referenced object from a weak " +"reference, *ref*, into *\\*pobj*." +msgstr "" + +#: c-api/weakref.rst:59 +msgid "" +"On success, set *\\*pobj* to a new :term:`strong reference` to the " +"referenced object and return 1." msgstr "" #: c-api/weakref.rst:61 +msgid "If the reference is dead, set *\\*pobj* to ``NULL`` and return 0." +msgstr "" + +#: c-api/weakref.rst:62 +msgid "On error, raise an exception and return -1." +msgstr "" + +#: c-api/weakref.rst:69 +msgid "" +"Return a :term:`borrowed reference` to the referenced object from a weak " +"reference, *ref*. If the referent is no longer live, returns ``Py_None``." +msgstr "" + +#: c-api/weakref.rst:74 msgid "" "This function returns a :term:`borrowed reference` to the referenced object. " "This means that you should always call :c:func:`Py_INCREF` on the object " @@ -82,19 +104,42 @@ msgid "" "reference." msgstr "" -#: c-api/weakref.rst:69 +#: c-api/weakref.rst:87 +msgid "Use :c:func:`PyWeakref_GetRef` instead." +msgstr "" + +#: c-api/weakref.rst:85 msgid "Similar to :c:func:`PyWeakref_GetObject`, but does no error checking." msgstr "" -#: c-api/weakref.rst:74 +#: c-api/weakref.rst:93 msgid "" "This function is called by the :c:member:`~PyTypeObject.tp_dealloc` handler " "to clear weak references." msgstr "" -#: c-api/weakref.rst:77 +#: c-api/weakref.rst:96 msgid "" "This iterates through the weak references for *object* and calls callbacks " "for those references which have one. It returns when all callbacks have been " "attempted." msgstr "" + +#: c-api/weakref.rst:103 +msgid "Clears the weakrefs for *object* without calling the callbacks." +msgstr "" + +#: c-api/weakref.rst:105 +msgid "" +"This function is called by the :c:member:`~PyTypeObject.tp_dealloc` handler " +"for types with finalizers (i.e., :meth:`~object.__del__`). The handler for " +"those objects first calls :c:func:`PyObject_ClearWeakRefs` to clear weakrefs " +"and call their callbacks, then the finalizer, and finally this function to " +"clear any weakrefs that may have been created by the finalizer." +msgstr "" + +#: c-api/weakref.rst:111 +msgid "" +"In most circumstances, it's more appropriate to use :c:func:" +"`PyObject_ClearWeakRefs` to clear weakrefs instead of this function." +msgstr "" diff --git a/contents.po b/contents.po index c282a029..f2aca82a 100644 --- a/contents.po +++ b/contents.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: 2024-04-24 22:37+0300\n" "Last-Translator: Panagiotis Skias \n" "Language-Team: PyGreece \n" diff --git a/copyright.po b/copyright.po index 0a725a75..c78f0f38 100644 --- a/copyright.po +++ b/copyright.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: 2024-04-24 22:33+0300\n" "Last-Translator: Panagiotis Skias \n" "Language-Team: PyGreece \n" @@ -27,7 +27,8 @@ msgid "Python and this documentation is:" msgstr "Η Python και αυτή η τεκμηρίωση είναι:" #: copyright.rst:7 -msgid "Copyright © 2001-2023 Python Software Foundation. All rights reserved." +#, fuzzy +msgid "Copyright © 2001-2024 Python Software Foundation. All rights reserved." msgstr "" "Copyright © 2001-2023 Python Software Foundation. Όλα τα δικαιώματα " "διατηρούνται." diff --git a/cpython b/cpython index aeb3a6f6..5daeebbb 160000 --- a/cpython +++ b/cpython @@ -1 +1 @@ -Subproject commit aeb3a6f61af53ed3fbf31f0b3704f49b71ac553c +Subproject commit 5daeebbbf2533bbb56f1cc95fa6db9c5efcb5dc5 diff --git a/deprecations/c-api-pending-removal-in-3.14.po b/deprecations/c-api-pending-removal-in-3.14.po index 798d7108..8857f918 100644 --- a/deprecations/c-api-pending-removal-in-3.14.po +++ b/deprecations/c-api-pending-removal-in-3.14.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" diff --git a/deprecations/c-api-pending-removal-in-3.15.po b/deprecations/c-api-pending-removal-in-3.15.po index 6bf1db6a..b9550fa7 100644 --- a/deprecations/c-api-pending-removal-in-3.15.po +++ b/deprecations/c-api-pending-removal-in-3.15.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -34,7 +34,7 @@ msgstr "" #: deprecations/c-api-pending-removal-in-3.15.rst:7 msgid "" ":c:func:`PyWeakref_GetObject` and :c:func:`PyWeakref_GET_OBJECT`: Use :c:" -"func:`!PyWeakref_GetRef` instead." +"func:`PyWeakref_GetRef` instead." msgstr "" #: deprecations/c-api-pending-removal-in-3.15.rst:9 @@ -54,7 +54,9 @@ msgid "" msgstr "" #: deprecations/c-api-pending-removal-in-3.15.rst:15 -msgid ":c:func:`Py_GetExecPrefix`: Get :data:`sys.exec_prefix` instead." +msgid "" +":c:func:`Py_GetExecPrefix`: Get :data:`sys.base_exec_prefix` and :data:`sys." +"exec_prefix` instead." msgstr "" #: deprecations/c-api-pending-removal-in-3.15.rst:17 @@ -62,7 +64,9 @@ msgid ":c:func:`Py_GetPath`: Get :data:`sys.path` instead." msgstr "" #: deprecations/c-api-pending-removal-in-3.15.rst:19 -msgid ":c:func:`Py_GetPrefix`: Get :data:`sys.prefix` instead." +msgid "" +":c:func:`Py_GetPrefix`: Get :data:`sys.base_prefix` and :data:`sys.prefix` " +"instead." msgstr "" #: deprecations/c-api-pending-removal-in-3.15.rst:21 diff --git a/deprecations/c-api-pending-removal-in-future.po b/deprecations/c-api-pending-removal-in-future.po index bc858fa7..4c4c5493 100644 --- a/deprecations/c-api-pending-removal-in-future.po +++ b/deprecations/c-api-pending-removal-in-future.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" diff --git a/deprecations/index.po b/deprecations/index.po index 8811ce4d..4deab285 100644 --- a/deprecations/index.po +++ b/deprecations/index.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -21,177 +21,6 @@ msgstr "" msgid "Deprecations" msgstr "" -#: deprecations/pending-removal-in-3.13.rst:2 -msgid "Pending Removal in Python 3.13" -msgstr "" - -#: deprecations/pending-removal-in-3.13.rst:4 -msgid "Modules (see :pep:`594`):" -msgstr "" - -#: deprecations/pending-removal-in-3.13.rst:6 -msgid ":mod:`aifc`" -msgstr "" - -#: deprecations/pending-removal-in-3.13.rst:7 -msgid ":mod:`audioop`" -msgstr "" - -#: deprecations/pending-removal-in-3.13.rst:8 -msgid ":mod:`cgi`" -msgstr "" - -#: deprecations/pending-removal-in-3.13.rst:9 -msgid ":mod:`cgitb`" -msgstr "" - -#: deprecations/pending-removal-in-3.13.rst:10 -msgid ":mod:`chunk`" -msgstr "" - -#: deprecations/pending-removal-in-3.13.rst:11 -msgid ":mod:`crypt`" -msgstr "" - -#: deprecations/pending-removal-in-3.13.rst:12 -msgid ":mod:`imghdr`" -msgstr "" - -#: deprecations/pending-removal-in-3.13.rst:13 -msgid ":mod:`mailcap`" -msgstr "" - -#: deprecations/pending-removal-in-3.13.rst:14 -msgid ":mod:`msilib`" -msgstr "" - -#: deprecations/pending-removal-in-3.13.rst:15 -msgid ":mod:`nis`" -msgstr "" - -#: deprecations/pending-removal-in-3.13.rst:16 -msgid ":mod:`nntplib`" -msgstr "" - -#: deprecations/pending-removal-in-3.13.rst:17 -msgid ":mod:`ossaudiodev`" -msgstr "" - -#: deprecations/pending-removal-in-3.13.rst:18 -msgid ":mod:`pipes`" -msgstr "" - -#: deprecations/pending-removal-in-3.13.rst:19 -msgid ":mod:`sndhdr`" -msgstr "" - -#: deprecations/pending-removal-in-3.13.rst:20 -msgid ":mod:`spwd`" -msgstr "" - -#: deprecations/pending-removal-in-3.13.rst:21 -msgid ":mod:`sunau`" -msgstr "" - -#: deprecations/pending-removal-in-3.13.rst:22 -msgid ":mod:`telnetlib`" -msgstr "" - -#: deprecations/pending-removal-in-3.13.rst:23 -msgid ":mod:`uu`" -msgstr "" - -#: deprecations/pending-removal-in-3.13.rst:24 -msgid ":mod:`xdrlib`" -msgstr "" - -#: deprecations/pending-removal-in-3.13.rst:26 -msgid "Other modules:" -msgstr "" - -#: deprecations/pending-removal-in-3.13.rst:28 -msgid ":mod:`!lib2to3`, and the :program:`2to3` program (:gh:`84540`)" -msgstr "" - -#: deprecations/pending-removal-in-3.13.rst:30 -msgid "APIs:" -msgstr "" - -#: deprecations/pending-removal-in-3.13.rst:32 -msgid ":class:`!configparser.LegacyInterpolation` (:gh:`90765`)" -msgstr "" - -#: deprecations/pending-removal-in-3.13.rst:33 -msgid "``locale.resetlocale()`` (:gh:`90817`)" -msgstr "" - -#: deprecations/pending-removal-in-3.13.rst:34 -msgid ":meth:`!turtle.RawTurtle.settiltangle` (:gh:`50096`)" -msgstr "" - -#: deprecations/pending-removal-in-3.13.rst:35 -msgid ":func:`!unittest.findTestCases` (:gh:`50096`)" -msgstr "" - -#: deprecations/pending-removal-in-3.13.rst:36 -msgid ":func:`!unittest.getTestCaseNames` (:gh:`50096`)" -msgstr "" - -#: deprecations/pending-removal-in-3.13.rst:37 -msgid ":func:`!unittest.makeSuite` (:gh:`50096`)" -msgstr "" - -#: deprecations/pending-removal-in-3.13.rst:38 -msgid ":meth:`!unittest.TestProgram.usageExit` (:gh:`67048`)" -msgstr "" - -#: deprecations/pending-removal-in-3.13.rst:39 -msgid ":class:`!webbrowser.MacOSX` (:gh:`86421`)" -msgstr "" - -#: deprecations/pending-removal-in-3.13.rst:40 -msgid ":class:`classmethod` descriptor chaining (:gh:`89519`)" -msgstr "" - -#: deprecations/pending-removal-in-3.13.rst:41 -msgid ":mod:`importlib.resources` deprecated methods:" -msgstr "" - -#: deprecations/pending-removal-in-3.13.rst:43 -msgid "``contents()``" -msgstr "" - -#: deprecations/pending-removal-in-3.13.rst:44 -msgid "``is_resource()``" -msgstr "" - -#: deprecations/pending-removal-in-3.13.rst:45 -msgid "``open_binary()``" -msgstr "" - -#: deprecations/pending-removal-in-3.13.rst:46 -msgid "``open_text()``" -msgstr "" - -#: deprecations/pending-removal-in-3.13.rst:47 -msgid "``path()``" -msgstr "" - -#: deprecations/pending-removal-in-3.13.rst:48 -msgid "``read_binary()``" -msgstr "" - -#: deprecations/pending-removal-in-3.13.rst:49 -msgid "``read_text()``" -msgstr "" - -#: deprecations/pending-removal-in-3.13.rst:51 -msgid "" -"Use :func:`importlib.resources.files` instead. Refer to `importlib-" -"resources: Migrating from Legacy `_ (:gh:`106531`)" -msgstr "" - #: deprecations/c-api-pending-removal-in-3.14.rst:2 #: deprecations/pending-removal-in-3.14.rst:2 msgid "Pending Removal in Python 3.14" @@ -238,6 +67,7 @@ msgid "" msgstr "" #: deprecations/pending-removal-in-3.14.rst:22 +#: deprecations/pending-removal-in-3.16.rst:19 msgid ":mod:`asyncio`:" msgstr "" @@ -280,44 +110,38 @@ msgid "" msgstr "" #: deprecations/pending-removal-in-3.14.rst:50 -msgid "" -":mod:`importlib`: ``__package__`` and ``__cached__`` will cease to be set or " -"taken into consideration by the import system (:gh:`97879`)." -msgstr "" - -#: deprecations/pending-removal-in-3.14.rst:53 msgid ":mod:`importlib.abc` deprecated classes:" msgstr "" -#: deprecations/pending-removal-in-3.14.rst:55 +#: deprecations/pending-removal-in-3.14.rst:52 msgid ":class:`!importlib.abc.ResourceReader`" msgstr "" -#: deprecations/pending-removal-in-3.14.rst:56 +#: deprecations/pending-removal-in-3.14.rst:53 msgid ":class:`!importlib.abc.Traversable`" msgstr "" -#: deprecations/pending-removal-in-3.14.rst:57 +#: deprecations/pending-removal-in-3.14.rst:54 msgid ":class:`!importlib.abc.TraversableResources`" msgstr "" -#: deprecations/pending-removal-in-3.14.rst:59 +#: deprecations/pending-removal-in-3.14.rst:56 msgid "Use :mod:`importlib.resources.abc` classes instead:" msgstr "" -#: deprecations/pending-removal-in-3.14.rst:61 +#: deprecations/pending-removal-in-3.14.rst:58 msgid ":class:`importlib.resources.abc.Traversable`" msgstr "" -#: deprecations/pending-removal-in-3.14.rst:62 +#: deprecations/pending-removal-in-3.14.rst:59 msgid ":class:`importlib.resources.abc.TraversableResources`" msgstr "" -#: deprecations/pending-removal-in-3.14.rst:64 +#: deprecations/pending-removal-in-3.14.rst:61 msgid "(Contributed by Jason R. Coombs and Hugo van Kemenade in :gh:`93963`.)" msgstr "" -#: deprecations/pending-removal-in-3.14.rst:66 +#: deprecations/pending-removal-in-3.14.rst:63 msgid "" ":mod:`itertools` had undocumented, inefficient, historically buggy, and " "inconsistent support for copy, deepcopy, and pickle operations. This will be " @@ -325,7 +149,7 @@ msgid "" "burden. (Contributed by Raymond Hettinger in :gh:`101588`.)" msgstr "" -#: deprecations/pending-removal-in-3.14.rst:72 +#: deprecations/pending-removal-in-3.14.rst:69 msgid "" ":mod:`multiprocessing`: The default start method will change to a safer one " "on Linux, BSDs, and other non-macOS POSIX platforms where ``'fork'`` is " @@ -336,53 +160,53 @@ msgid "" "``'fork'``. See :ref:`multiprocessing-start-methods`." msgstr "" -#: deprecations/pending-removal-in-3.14.rst:80 +#: deprecations/pending-removal-in-3.14.rst:77 msgid "" ":mod:`pathlib`: :meth:`~pathlib.PurePath.is_relative_to` and :meth:`~pathlib." "PurePath.relative_to`: passing additional arguments is deprecated." msgstr "" -#: deprecations/pending-removal-in-3.14.rst:84 +#: deprecations/pending-removal-in-3.14.rst:81 msgid "" ":mod:`pkgutil`: :func:`~pkgutil.find_loader` and :func:`~pkgutil.get_loader` " "now raise :exc:`DeprecationWarning`; use :func:`importlib.util.find_spec` " "instead. (Contributed by Nikita Sobolev in :gh:`97850`.)" msgstr "" -#: deprecations/pending-removal-in-3.14.rst:89 +#: deprecations/pending-removal-in-3.14.rst:86 msgid ":mod:`pty`:" msgstr "" -#: deprecations/pending-removal-in-3.14.rst:91 +#: deprecations/pending-removal-in-3.14.rst:88 msgid "``master_open()``: use :func:`pty.openpty`." msgstr "" -#: deprecations/pending-removal-in-3.14.rst:92 +#: deprecations/pending-removal-in-3.14.rst:89 msgid "``slave_open()``: use :func:`pty.openpty`." msgstr "" -#: deprecations/pending-removal-in-3.14.rst:94 +#: deprecations/pending-removal-in-3.14.rst:91 msgid ":mod:`sqlite3`:" msgstr "" -#: deprecations/pending-removal-in-3.14.rst:96 +#: deprecations/pending-removal-in-3.14.rst:93 msgid ":data:`~sqlite3.version` and :data:`~sqlite3.version_info`." msgstr "" -#: deprecations/pending-removal-in-3.14.rst:98 +#: deprecations/pending-removal-in-3.14.rst:95 msgid "" ":meth:`~sqlite3.Cursor.execute` and :meth:`~sqlite3.Cursor.executemany` if :" "ref:`named placeholders ` are used and *parameters* is " "a sequence instead of a :class:`dict`." msgstr "" -#: deprecations/pending-removal-in-3.14.rst:102 +#: deprecations/pending-removal-in-3.14.rst:99 msgid "" ":mod:`typing`: :class:`~typing.ByteString`, deprecated since Python 3.9, now " "causes a :exc:`DeprecationWarning` to be emitted when it is used." msgstr "" -#: deprecations/pending-removal-in-3.14.rst:105 +#: deprecations/pending-removal-in-3.14.rst:102 msgid "" ":mod:`urllib`: :class:`!urllib.parse.Quoter` is deprecated: it was not " "intended to be a public API. (Contributed by Gregory P. Smith in :gh:" @@ -395,81 +219,123 @@ msgid "Pending Removal in Python 3.15" msgstr "" #: deprecations/pending-removal-in-3.15.rst:4 +#: deprecations/pending-removal-in-3.16.rst:4 +msgid "The import system:" +msgstr "" + +#: deprecations/pending-removal-in-3.15.rst:6 msgid "" -":class:`http.server.CGIHTTPRequestHandler` will be removed along with its " -"related ``--cgi`` flag to ``python -m http.server``. It was obsolete and " -"rarely used. No direct replacement exists. *Anything* is better than CGI " -"to interface a web server with a request handler." +"Setting :attr:`~module.__cached__` on a module while failing to set :attr:" +"`__spec__.cached ` is deprecated. In " +"Python 3.15, :attr:`!__cached__` will cease to be set or take into " +"consideration by the import system or standard library. (:gh:`97879`)" msgstr "" -#: deprecations/pending-removal-in-3.15.rst:9 -#: deprecations/pending-removal-in-future.rst:58 +#: deprecations/pending-removal-in-3.15.rst:11 +msgid "" +"Setting :attr:`~module.__package__` on a module while failing to set :attr:" +"`__spec__.parent ` is deprecated. In " +"Python 3.15, :attr:`!__package__` will cease to be set or take into " +"consideration by the import system or standard library. (:gh:`97879`)" +msgstr "" + +#: deprecations/pending-removal-in-3.15.rst:16 +msgid ":mod:`ctypes`:" +msgstr "" + +#: deprecations/pending-removal-in-3.15.rst:18 +msgid "" +"The undocumented :func:`!ctypes.SetPointerType` function has been deprecated " +"since Python 3.13." +msgstr "" + +#: deprecations/pending-removal-in-3.15.rst:21 +msgid ":mod:`http.server`:" +msgstr "" + +#: deprecations/pending-removal-in-3.15.rst:23 +msgid "" +"The obsolete and rarely used :class:`~http.server.CGIHTTPRequestHandler` has " +"been deprecated since Python 3.13. No direct replacement exists. *Anything* " +"is better than CGI to interface a web server with a request handler." +msgstr "" + +#: deprecations/pending-removal-in-3.15.rst:29 +msgid "" +"The :option:`!--cgi` flag to the :program:`python -m http.server` command-" +"line interface has been deprecated since Python 3.13." +msgstr "" + +#: deprecations/pending-removal-in-3.15.rst:32 +#: deprecations/pending-removal-in-future.rst:56 msgid ":mod:`importlib`:" msgstr "" -#: deprecations/pending-removal-in-3.15.rst:11 +#: deprecations/pending-removal-in-3.15.rst:34 msgid "``load_module()`` method: use ``exec_module()`` instead." msgstr "" -#: deprecations/pending-removal-in-3.15.rst:13 +#: deprecations/pending-removal-in-3.15.rst:36 +msgid ":class:`locale`:" +msgstr "" + +#: deprecations/pending-removal-in-3.15.rst:38 msgid "" -":class:`locale`: :func:`locale.getdefaultlocale` was deprecated in Python " -"3.11 and originally planned for removal in Python 3.13 (:gh:`90817`), but " -"removal has been postponed to Python 3.15. Use :func:`locale.setlocale`, :" -"func:`locale.getencoding` and :func:`locale.getlocale` instead. (Contributed " -"by Hugo van Kemenade in :gh:`111187`.)" +"The :func:`~locale.getdefaultlocale` function has been deprecated since " +"Python 3.11. Its removal was originally planned for Python 3.13 (:gh:" +"`90817`), but has been postponed to Python 3.15. Use :func:`~locale." +"getlocale`, :func:`~locale.setlocale`, and :func:`~locale.getencoding` " +"instead. (Contributed by Hugo van Kemenade in :gh:`111187`.)" +msgstr "" + +#: deprecations/pending-removal-in-3.15.rst:46 +msgid ":mod:`pathlib`:" msgstr "" -#: deprecations/pending-removal-in-3.15.rst:20 +#: deprecations/pending-removal-in-3.15.rst:48 msgid "" -":mod:`pathlib`: :meth:`pathlib.PurePath.is_reserved` is deprecated and " -"scheduled for removal in Python 3.15. From Python 3.13 onwards, use ``os." -"path.isreserved`` to detect reserved paths on Windows." +":meth:`.PurePath.is_reserved` has been deprecated since Python 3.13. Use :" +"func:`os.path.isreserved` to detect reserved paths on Windows." +msgstr "" + +#: deprecations/pending-removal-in-3.15.rst:52 +msgid ":mod:`platform`:" msgstr "" -#: deprecations/pending-removal-in-3.15.rst:25 +#: deprecations/pending-removal-in-3.15.rst:54 msgid "" -":mod:`platform`: :func:`~platform.java_ver` is deprecated and will be " -"removed in 3.15. It was largely untested, had a confusing API, and was only " -"useful for Jython support. (Contributed by Nikita Sobolev in :gh:`116349`.)" +":func:`~platform.java_ver` has been deprecated since Python 3.13. This " +"function is only useful for Jython support, has a confusing API, and is " +"largely untested." msgstr "" -#: deprecations/pending-removal-in-3.15.rst:31 +#: deprecations/pending-removal-in-3.15.rst:58 msgid ":mod:`sysconfig`:" msgstr "" -#: deprecations/pending-removal-in-3.15.rst:33 +#: deprecations/pending-removal-in-3.15.rst:60 msgid "" "The *check_home* argument of :func:`sysconfig.is_python_build` has been " "deprecated since Python 3.12." msgstr "" -#: deprecations/pending-removal-in-3.15.rst:36 -msgid "" -":mod:`threading`: Passing any arguments to :func:`threading.RLock` is now " -"deprecated. C version allows any numbers of args and kwargs, but they are " -"just ignored. Python version does not allow any arguments. All arguments " -"will be removed from :func:`threading.RLock` in Python 3.15. (Contributed by " -"Nikita Sobolev in :gh:`102029`.)" +#: deprecations/pending-removal-in-3.15.rst:63 +msgid ":mod:`threading`:" msgstr "" -#: deprecations/pending-removal-in-3.15.rst:43 -msgid ":class:`typing.NamedTuple`:" -msgstr "" - -#: deprecations/pending-removal-in-3.15.rst:45 +#: deprecations/pending-removal-in-3.15.rst:65 msgid "" -"The undocumented keyword argument syntax for creating :class:`!NamedTuple` " -"classes (``NT = NamedTuple(\"NT\", x=int)``) is deprecated, and will be " -"disallowed in 3.15. Use the class-based syntax or the functional syntax " -"instead." +":func:`~threading.RLock` will take no arguments in Python 3.15. Passing any " +"arguments has been deprecated since Python 3.14, as the Python version does " +"not permit any arguments, but the C version allows any number of positional " +"or keyword arguments, ignoring every argument." msgstr "" -#: deprecations/pending-removal-in-3.15.rst:49 +#: deprecations/pending-removal-in-3.15.rst:71 msgid ":mod:`types`:" msgstr "" -#: deprecations/pending-removal-in-3.15.rst:51 +#: deprecations/pending-removal-in-3.15.rst:73 msgid "" ":class:`types.CodeType`: Accessing :attr:`~codeobject.co_lnotab` was " "deprecated in :pep:`626` since 3.10 and was planned to be removed in 3.12, " @@ -477,45 +343,38 @@ msgid "" "in 3.15. (Contributed by Nikita Sobolev in :gh:`101866`.)" msgstr "" -#: deprecations/pending-removal-in-3.15.rst:58 +#: deprecations/pending-removal-in-3.15.rst:80 msgid ":mod:`typing`:" msgstr "" -#: deprecations/pending-removal-in-3.15.rst:60 +#: deprecations/pending-removal-in-3.15.rst:82 msgid "" -"When using the functional syntax to create a :class:`!NamedTuple` class, " -"failing to pass a value to the *fields* parameter (``NT = " -"NamedTuple(\"NT\")``) is deprecated. Passing ``None`` to the *fields* " -"parameter (``NT = NamedTuple(\"NT\", None)``) is also deprecated. Both will " -"be disallowed in Python 3.15. To create a :class:`!NamedTuple` class with 0 " -"fields, use ``class NT(NamedTuple): pass`` or ``NT = NamedTuple(\"NT\", " -"[])``." +"The undocumented keyword argument syntax for creating :class:`~typing." +"NamedTuple` classes (e.g. ``Point = NamedTuple(\"Point\", x=int, y=int)``) " +"has been deprecated since Python 3.13. Use the class-based syntax or the " +"functional syntax instead." msgstr "" -#: deprecations/pending-removal-in-3.15.rst:67 +#: deprecations/pending-removal-in-3.15.rst:88 msgid "" -":class:`typing.TypedDict`: When using the functional syntax to create a :" -"class:`!TypedDict` class, failing to pass a value to the *fields* parameter " -"(``TD = TypedDict(\"TD\")``) is deprecated. Passing ``None`` to the *fields* " -"parameter (``TD = TypedDict(\"TD\", None)``) is also deprecated. Both will " -"be disallowed in Python 3.15. To create a :class:`!TypedDict` class with 0 " -"fields, use ``class TD(TypedDict): pass`` or ``TD = TypedDict(\"TD\", {})``." +"The :func:`typing.no_type_check_decorator` decorator function has been " +"deprecated since Python 3.13. After eight years in the :mod:`typing` module, " +"it has yet to be supported by any major type checker." msgstr "" -#: deprecations/pending-removal-in-3.15.rst:74 -msgid "" -":mod:`wave`: Deprecate the ``getmark()``, ``setmark()`` and ``getmarkers()`` " -"methods of the :class:`wave.Wave_read` and :class:`wave.Wave_write` classes. " -"They will be removed in Python 3.15. (Contributed by Victor Stinner in :gh:" -"`105096`.)" +#: deprecations/pending-removal-in-3.15.rst:93 +msgid ":mod:`wave`:" msgstr "" -#: deprecations/pending-removal-in-3.16.rst:2 -msgid "Pending Removal in Python 3.16" +#: deprecations/pending-removal-in-3.15.rst:95 +msgid "" +"The :meth:`~wave.Wave_read.getmark`, :meth:`!setmark`, and :meth:`~wave." +"Wave_read.getmarkers` methods of the :class:`~wave.Wave_read` and :class:" +"`~wave.Wave_write` classes have been deprecated since Python 3.13." msgstr "" -#: deprecations/pending-removal-in-3.16.rst:4 -msgid "The import system:" +#: deprecations/pending-removal-in-3.16.rst:2 +msgid "Pending removal in Python 3.16" msgstr "" #: deprecations/pending-removal-in-3.16.rst:6 @@ -527,19 +386,77 @@ msgid "" msgstr "" #: deprecations/pending-removal-in-3.16.rst:11 +msgid ":mod:`array`:" +msgstr "" + +#: deprecations/pending-removal-in-3.16.rst:13 msgid "" -":mod:`array`: :class:`array.array` ``'u'`` type (:c:type:`wchar_t`): use the " -"``'w'`` type instead (``Py_UCS4``)." +"The ``'u'`` format code (:c:type:`wchar_t`) has been deprecated in " +"documentation since Python 3.3 and at runtime since Python 3.13. Use the " +"``'w'`` format code (:c:type:`Py_UCS4`) for Unicode characters instead." msgstr "" -#: deprecations/pending-removal-in-3.16.rst:15 -msgid ":mod:`builtins`: ``~bool``, bitwise inversion on bool." +#: deprecations/pending-removal-in-3.16.rst:21 +msgid "" +":func:`!asyncio.iscoroutinefunction` is deprecated and will be removed in " +"Python 3.16, use :func:`inspect.iscoroutinefunction` instead. (Contributed " +"by Jiahao Li and Kumar Aditya in :gh:`122875`.)" msgstr "" -#: deprecations/pending-removal-in-3.16.rst:18 +#: deprecations/pending-removal-in-3.16.rst:26 +#: deprecations/pending-removal-in-future.rst:10 +msgid ":mod:`builtins`:" +msgstr "" + +#: deprecations/pending-removal-in-3.16.rst:28 +msgid "" +"Bitwise inversion on boolean types, ``~True`` or ``~False`` has been " +"deprecated since Python 3.12, as it produces surprising and unintuitive " +"results (``-2`` and ``-1``). Use ``not x`` instead for the logical negation " +"of a Boolean. In the rare case that you need the bitwise inversion of the " +"underlying integer, convert to ``int`` explicitly (``~int(x)``)." +msgstr "" + +#: deprecations/pending-removal-in-3.16.rst:35 +msgid ":mod:`shutil`:" +msgstr "" + +#: deprecations/pending-removal-in-3.16.rst:37 +msgid "" +"The :class:`!ExecError` exception has been deprecated since Python 3.14. It " +"has not been used by any function in :mod:`!shutil` since Python 3.4, and is " +"now an alias of :exc:`RuntimeError`." +msgstr "" + +#: deprecations/pending-removal-in-3.16.rst:42 +msgid ":mod:`symtable`:" +msgstr "" + +#: deprecations/pending-removal-in-3.16.rst:44 +msgid "" +"The :meth:`Class.get_methods ` method has been " +"deprecated since Python 3.14." +msgstr "" + +#: deprecations/pending-removal-in-3.16.rst:47 +msgid ":mod:`sys`:" +msgstr "" + +#: deprecations/pending-removal-in-3.16.rst:49 +msgid "" +"The :func:`~sys._enablelegacywindowsfsencoding` function has been deprecated " +"since Python 3.13. Use the :envvar:`PYTHONLEGACYWINDOWSFSENCODING` " +"environment variable instead." +msgstr "" + +#: deprecations/pending-removal-in-3.16.rst:53 +msgid ":mod:`tarfile`:" +msgstr "" + +#: deprecations/pending-removal-in-3.16.rst:55 msgid "" -":mod:`symtable`: Deprecate :meth:`symtable.Class.get_methods` due to the " -"lack of interest. (Contributed by Bénédikt Tran in :gh:`119698`.)" +"The undocumented and unused :attr:`!TarFile.tarfile` attribute has been " +"deprecated since Python 3.13." msgstr "" #: deprecations/c-api-pending-removal-in-future.rst:2 @@ -559,26 +476,18 @@ msgid "" "groups are deprecated." msgstr "" -#: deprecations/pending-removal-in-future.rst:10 -msgid ":mod:`array`'s ``'u'`` format code (:gh:`57281`)" -msgstr "" - #: deprecations/pending-removal-in-future.rst:12 -msgid ":mod:`builtins`:" -msgstr "" - -#: deprecations/pending-removal-in-future.rst:14 msgid "``bool(NotImplemented)``." msgstr "" -#: deprecations/pending-removal-in-future.rst:15 +#: deprecations/pending-removal-in-future.rst:13 msgid "" "Generators: ``throw(type, exc, tb)`` and ``athrow(type, exc, tb)`` signature " "is deprecated: use ``throw(exc)`` and ``athrow(exc)`` instead, the single " "argument signature." msgstr "" -#: deprecations/pending-removal-in-future.rst:18 +#: deprecations/pending-removal-in-future.rst:16 msgid "" "Currently Python accepts numeric literals immediately followed by keywords, " "for example ``0in x``, ``1or x``, ``0if 1else 2``. It allows confusing and " @@ -590,32 +499,32 @@ msgid "" "syntax error. (:gh:`87999`)" msgstr "" -#: deprecations/pending-removal-in-future.rst:26 +#: deprecations/pending-removal-in-future.rst:24 msgid "" "Support for ``__index__()`` and ``__int__()`` method returning non-int type: " "these methods will be required to return an instance of a strict subclass " "of :class:`int`." msgstr "" -#: deprecations/pending-removal-in-future.rst:29 +#: deprecations/pending-removal-in-future.rst:27 msgid "" "Support for ``__float__()`` method returning a strict subclass of :class:" "`float`: these methods will be required to return an instance of :class:" "`float`." msgstr "" -#: deprecations/pending-removal-in-future.rst:32 +#: deprecations/pending-removal-in-future.rst:30 msgid "" "Support for ``__complex__()`` method returning a strict subclass of :class:" "`complex`: these methods will be required to return an instance of :class:" "`complex`." msgstr "" -#: deprecations/pending-removal-in-future.rst:35 +#: deprecations/pending-removal-in-future.rst:33 msgid "Delegation of ``int()`` to ``__trunc__()`` method." msgstr "" -#: deprecations/pending-removal-in-future.rst:36 +#: deprecations/pending-removal-in-future.rst:34 msgid "" "Passing a complex number as the *real* or *imag* argument in the :func:" "`complex` constructor is now deprecated; it should only be passed as a " @@ -623,75 +532,81 @@ msgid "" "`109218`.)" msgstr "" -#: deprecations/pending-removal-in-future.rst:41 +#: deprecations/pending-removal-in-future.rst:39 msgid "" ":mod:`calendar`: ``calendar.January`` and ``calendar.February`` constants " "are deprecated and replaced by :data:`calendar.JANUARY` and :data:`calendar." "FEBRUARY`. (Contributed by Prince Roshan in :gh:`103636`.)" msgstr "" -#: deprecations/pending-removal-in-future.rst:46 +#: deprecations/pending-removal-in-future.rst:44 msgid "" ":attr:`codeobject.co_lnotab`: use the :meth:`codeobject.co_lines` method " "instead." msgstr "" -#: deprecations/pending-removal-in-future.rst:49 +#: deprecations/pending-removal-in-future.rst:47 msgid ":mod:`datetime`:" msgstr "" -#: deprecations/pending-removal-in-future.rst:51 +#: deprecations/pending-removal-in-future.rst:49 msgid "" ":meth:`~datetime.datetime.utcnow`: use ``datetime.datetime.now(tz=datetime." "UTC)``." msgstr "" -#: deprecations/pending-removal-in-future.rst:53 +#: deprecations/pending-removal-in-future.rst:51 msgid "" ":meth:`~datetime.datetime.utcfromtimestamp`: use ``datetime.datetime." "fromtimestamp(timestamp, tz=datetime.UTC)``." msgstr "" -#: deprecations/pending-removal-in-future.rst:56 +#: deprecations/pending-removal-in-future.rst:54 msgid ":mod:`gettext`: Plural value must be an integer." msgstr "" -#: deprecations/pending-removal-in-future.rst:60 +#: deprecations/pending-removal-in-future.rst:58 msgid "" ":func:`~importlib.util.cache_from_source` *debug_override* parameter is " "deprecated: use the *optimization* parameter instead." msgstr "" -#: deprecations/pending-removal-in-future.rst:63 +#: deprecations/pending-removal-in-future.rst:61 msgid ":mod:`importlib.metadata`:" msgstr "" -#: deprecations/pending-removal-in-future.rst:65 +#: deprecations/pending-removal-in-future.rst:63 msgid "``EntryPoints`` tuple interface." msgstr "" -#: deprecations/pending-removal-in-future.rst:66 +#: deprecations/pending-removal-in-future.rst:64 msgid "Implicit ``None`` on return values." msgstr "" -#: deprecations/pending-removal-in-future.rst:68 +#: deprecations/pending-removal-in-future.rst:66 +msgid "" +":mod:`logging`: the ``warn()`` method has been deprecated since Python 3.3, " +"use :meth:`~logging.warning` instead." +msgstr "" + +#: deprecations/pending-removal-in-future.rst:69 msgid "" ":mod:`mailbox`: Use of StringIO input and text mode is deprecated, use " "BytesIO and binary mode instead." msgstr "" -#: deprecations/pending-removal-in-future.rst:71 +#: deprecations/pending-removal-in-future.rst:72 msgid "" ":mod:`os`: Calling :func:`os.register_at_fork` in multi-threaded process." msgstr "" -#: deprecations/pending-removal-in-future.rst:73 +#: deprecations/pending-removal-in-future.rst:74 msgid "" ":class:`!pydoc.ErrorDuringImport`: A tuple value for *exc_info* parameter is " "deprecated, use an exception instance." msgstr "" -#: deprecations/pending-removal-in-future.rst:76 +#: deprecations/pending-removal-in-future.rst:77 msgid "" ":mod:`re`: More strict rules are now applied for numerical group references " "and group names in regular expressions. Only sequence of ASCII digits is " @@ -700,179 +615,179 @@ msgid "" "underscore. (Contributed by Serhiy Storchaka in :gh:`91760`.)" msgstr "" -#: deprecations/pending-removal-in-future.rst:83 +#: deprecations/pending-removal-in-future.rst:84 msgid "" ":mod:`!sre_compile`, :mod:`!sre_constants` and :mod:`!sre_parse` modules." msgstr "" -#: deprecations/pending-removal-in-future.rst:85 +#: deprecations/pending-removal-in-future.rst:86 msgid "" ":mod:`shutil`: :func:`~shutil.rmtree`'s *onerror* parameter is deprecated in " "Python 3.12; use the *onexc* parameter instead." msgstr "" -#: deprecations/pending-removal-in-future.rst:88 +#: deprecations/pending-removal-in-future.rst:89 msgid ":mod:`ssl` options and protocols:" msgstr "" -#: deprecations/pending-removal-in-future.rst:90 +#: deprecations/pending-removal-in-future.rst:91 msgid ":class:`ssl.SSLContext` without protocol argument is deprecated." msgstr "" -#: deprecations/pending-removal-in-future.rst:91 +#: deprecations/pending-removal-in-future.rst:92 msgid "" ":class:`ssl.SSLContext`: :meth:`~ssl.SSLContext.set_npn_protocols` and :meth:" "`!selected_npn_protocol` are deprecated: use ALPN instead." msgstr "" -#: deprecations/pending-removal-in-future.rst:94 +#: deprecations/pending-removal-in-future.rst:95 msgid "``ssl.OP_NO_SSL*`` options" msgstr "" -#: deprecations/pending-removal-in-future.rst:95 +#: deprecations/pending-removal-in-future.rst:96 msgid "``ssl.OP_NO_TLS*`` options" msgstr "" -#: deprecations/pending-removal-in-future.rst:96 +#: deprecations/pending-removal-in-future.rst:97 msgid "``ssl.PROTOCOL_SSLv3``" msgstr "" -#: deprecations/pending-removal-in-future.rst:97 +#: deprecations/pending-removal-in-future.rst:98 msgid "``ssl.PROTOCOL_TLS``" msgstr "" -#: deprecations/pending-removal-in-future.rst:98 +#: deprecations/pending-removal-in-future.rst:99 msgid "``ssl.PROTOCOL_TLSv1``" msgstr "" -#: deprecations/pending-removal-in-future.rst:99 +#: deprecations/pending-removal-in-future.rst:100 msgid "``ssl.PROTOCOL_TLSv1_1``" msgstr "" -#: deprecations/pending-removal-in-future.rst:100 +#: deprecations/pending-removal-in-future.rst:101 msgid "``ssl.PROTOCOL_TLSv1_2``" msgstr "" -#: deprecations/pending-removal-in-future.rst:101 +#: deprecations/pending-removal-in-future.rst:102 msgid "``ssl.TLSVersion.SSLv3``" msgstr "" -#: deprecations/pending-removal-in-future.rst:102 +#: deprecations/pending-removal-in-future.rst:103 msgid "``ssl.TLSVersion.TLSv1``" msgstr "" -#: deprecations/pending-removal-in-future.rst:103 +#: deprecations/pending-removal-in-future.rst:104 msgid "``ssl.TLSVersion.TLSv1_1``" msgstr "" -#: deprecations/pending-removal-in-future.rst:105 +#: deprecations/pending-removal-in-future.rst:106 msgid ":mod:`threading` methods:" msgstr "" -#: deprecations/pending-removal-in-future.rst:107 +#: deprecations/pending-removal-in-future.rst:108 msgid "" ":meth:`!threading.Condition.notifyAll`: use :meth:`~threading.Condition." "notify_all`." msgstr "" -#: deprecations/pending-removal-in-future.rst:108 +#: deprecations/pending-removal-in-future.rst:109 msgid ":meth:`!threading.Event.isSet`: use :meth:`~threading.Event.is_set`." msgstr "" -#: deprecations/pending-removal-in-future.rst:109 +#: deprecations/pending-removal-in-future.rst:110 msgid "" ":meth:`!threading.Thread.isDaemon`, :meth:`threading.Thread.setDaemon`: use :" "attr:`threading.Thread.daemon` attribute." msgstr "" -#: deprecations/pending-removal-in-future.rst:111 +#: deprecations/pending-removal-in-future.rst:112 msgid "" ":meth:`!threading.Thread.getName`, :meth:`threading.Thread.setName`: use :" "attr:`threading.Thread.name` attribute." msgstr "" -#: deprecations/pending-removal-in-future.rst:113 +#: deprecations/pending-removal-in-future.rst:114 msgid ":meth:`!threading.currentThread`: use :meth:`threading.current_thread`." msgstr "" -#: deprecations/pending-removal-in-future.rst:114 +#: deprecations/pending-removal-in-future.rst:115 msgid ":meth:`!threading.activeCount`: use :meth:`threading.active_count`." msgstr "" -#: deprecations/pending-removal-in-future.rst:116 +#: deprecations/pending-removal-in-future.rst:117 msgid ":class:`typing.Text` (:gh:`92332`)." msgstr "" -#: deprecations/pending-removal-in-future.rst:118 +#: deprecations/pending-removal-in-future.rst:119 msgid "" ":class:`unittest.IsolatedAsyncioTestCase`: it is deprecated to return a " "value that is not ``None`` from a test case." msgstr "" -#: deprecations/pending-removal-in-future.rst:121 +#: deprecations/pending-removal-in-future.rst:122 msgid "" ":mod:`urllib.parse` deprecated functions: :func:`~urllib.parse.urlparse` " "instead" msgstr "" -#: deprecations/pending-removal-in-future.rst:123 +#: deprecations/pending-removal-in-future.rst:124 msgid "``splitattr()``" msgstr "" -#: deprecations/pending-removal-in-future.rst:124 +#: deprecations/pending-removal-in-future.rst:125 msgid "``splithost()``" msgstr "" -#: deprecations/pending-removal-in-future.rst:125 +#: deprecations/pending-removal-in-future.rst:126 msgid "``splitnport()``" msgstr "" -#: deprecations/pending-removal-in-future.rst:126 +#: deprecations/pending-removal-in-future.rst:127 msgid "``splitpasswd()``" msgstr "" -#: deprecations/pending-removal-in-future.rst:127 +#: deprecations/pending-removal-in-future.rst:128 msgid "``splitport()``" msgstr "" -#: deprecations/pending-removal-in-future.rst:128 +#: deprecations/pending-removal-in-future.rst:129 msgid "``splitquery()``" msgstr "" -#: deprecations/pending-removal-in-future.rst:129 +#: deprecations/pending-removal-in-future.rst:130 msgid "``splittag()``" msgstr "" -#: deprecations/pending-removal-in-future.rst:130 +#: deprecations/pending-removal-in-future.rst:131 msgid "``splittype()``" msgstr "" -#: deprecations/pending-removal-in-future.rst:131 +#: deprecations/pending-removal-in-future.rst:132 msgid "``splituser()``" msgstr "" -#: deprecations/pending-removal-in-future.rst:132 +#: deprecations/pending-removal-in-future.rst:133 msgid "``splitvalue()``" msgstr "" -#: deprecations/pending-removal-in-future.rst:133 +#: deprecations/pending-removal-in-future.rst:134 msgid "``to_bytes()``" msgstr "" -#: deprecations/pending-removal-in-future.rst:135 +#: deprecations/pending-removal-in-future.rst:136 msgid "" ":mod:`urllib.request`: :class:`~urllib.request.URLopener` and :class:" "`~urllib.request.FancyURLopener` style of invoking requests is deprecated. " "Use newer :func:`~urllib.request.urlopen` functions and methods." msgstr "" -#: deprecations/pending-removal-in-future.rst:139 +#: deprecations/pending-removal-in-future.rst:140 msgid "" ":mod:`wsgiref`: ``SimpleHandler.stdout.write()`` should not do partial " "writes." msgstr "" -#: deprecations/pending-removal-in-future.rst:142 +#: deprecations/pending-removal-in-future.rst:143 msgid "" ":mod:`xml.etree.ElementTree`: Testing the truth value of an :class:`~xml." "etree.ElementTree.Element` is deprecated. In a future release it will always " @@ -880,13 +795,13 @@ msgid "" "instead." msgstr "" -#: deprecations/pending-removal-in-future.rst:147 +#: deprecations/pending-removal-in-future.rst:148 msgid "" ":meth:`zipimport.zipimporter.load_module` is deprecated: use :meth:" "`~zipimport.zipimporter.exec_module` instead." msgstr "" -#: deprecations/index.rst:15 +#: deprecations/index.rst:13 msgid "C API Deprecations" msgstr "" @@ -1060,7 +975,7 @@ msgstr "" #: deprecations/c-api-pending-removal-in-3.15.rst:7 msgid "" ":c:func:`PyWeakref_GetObject` and :c:func:`PyWeakref_GET_OBJECT`: Use :c:" -"func:`!PyWeakref_GetRef` instead." +"func:`PyWeakref_GetRef` instead." msgstr "" #: deprecations/c-api-pending-removal-in-3.15.rst:9 @@ -1080,7 +995,9 @@ msgid "" msgstr "" #: deprecations/c-api-pending-removal-in-3.15.rst:15 -msgid ":c:func:`Py_GetExecPrefix`: Get :data:`sys.exec_prefix` instead." +msgid "" +":c:func:`Py_GetExecPrefix`: Get :data:`sys.base_exec_prefix` and :data:`sys." +"exec_prefix` instead." msgstr "" #: deprecations/c-api-pending-removal-in-3.15.rst:17 @@ -1088,7 +1005,9 @@ msgid ":c:func:`Py_GetPath`: Get :data:`sys.path` instead." msgstr "" #: deprecations/c-api-pending-removal-in-3.15.rst:19 -msgid ":c:func:`Py_GetPrefix`: Get :data:`sys.prefix` instead." +msgid "" +":c:func:`Py_GetPrefix`: Get :data:`sys.base_prefix` and :data:`sys.prefix` " +"instead." msgstr "" #: deprecations/c-api-pending-removal-in-3.15.rst:21 diff --git a/deprecations/pending-removal-in-3.13.po b/deprecations/pending-removal-in-3.13.po index 62f54a1e..1d351a73 100644 --- a/deprecations/pending-removal-in-3.13.po +++ b/deprecations/pending-removal-in-3.13.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -26,79 +26,79 @@ msgid "Modules (see :pep:`594`):" msgstr "" #: deprecations/pending-removal-in-3.13.rst:6 -msgid ":mod:`aifc`" +msgid ":mod:`!aifc`" msgstr "" #: deprecations/pending-removal-in-3.13.rst:7 -msgid ":mod:`audioop`" +msgid ":mod:`!audioop`" msgstr "" #: deprecations/pending-removal-in-3.13.rst:8 -msgid ":mod:`cgi`" +msgid ":mod:`!cgi`" msgstr "" #: deprecations/pending-removal-in-3.13.rst:9 -msgid ":mod:`cgitb`" +msgid ":mod:`!cgitb`" msgstr "" #: deprecations/pending-removal-in-3.13.rst:10 -msgid ":mod:`chunk`" +msgid ":mod:`!chunk`" msgstr "" #: deprecations/pending-removal-in-3.13.rst:11 -msgid ":mod:`crypt`" +msgid ":mod:`!crypt`" msgstr "" #: deprecations/pending-removal-in-3.13.rst:12 -msgid ":mod:`imghdr`" +msgid ":mod:`!imghdr`" msgstr "" #: deprecations/pending-removal-in-3.13.rst:13 -msgid ":mod:`mailcap`" +msgid ":mod:`!mailcap`" msgstr "" #: deprecations/pending-removal-in-3.13.rst:14 -msgid ":mod:`msilib`" +msgid ":mod:`!msilib`" msgstr "" #: deprecations/pending-removal-in-3.13.rst:15 -msgid ":mod:`nis`" +msgid ":mod:`!nis`" msgstr "" #: deprecations/pending-removal-in-3.13.rst:16 -msgid ":mod:`nntplib`" +msgid ":mod:`!nntplib`" msgstr "" #: deprecations/pending-removal-in-3.13.rst:17 -msgid ":mod:`ossaudiodev`" +msgid ":mod:`!ossaudiodev`" msgstr "" #: deprecations/pending-removal-in-3.13.rst:18 -msgid ":mod:`pipes`" +msgid ":mod:`!pipes`" msgstr "" #: deprecations/pending-removal-in-3.13.rst:19 -msgid ":mod:`sndhdr`" +msgid ":mod:`!sndhdr`" msgstr "" #: deprecations/pending-removal-in-3.13.rst:20 -msgid ":mod:`spwd`" +msgid ":mod:`!spwd`" msgstr "" #: deprecations/pending-removal-in-3.13.rst:21 -msgid ":mod:`sunau`" +msgid ":mod:`!sunau`" msgstr "" #: deprecations/pending-removal-in-3.13.rst:22 -msgid ":mod:`telnetlib`" +msgid ":mod:`!telnetlib`" msgstr "" #: deprecations/pending-removal-in-3.13.rst:23 -msgid ":mod:`uu`" +msgid ":mod:`!uu`" msgstr "" #: deprecations/pending-removal-in-3.13.rst:24 -msgid ":mod:`xdrlib`" +msgid ":mod:`!xdrlib`" msgstr "" #: deprecations/pending-removal-in-3.13.rst:26 diff --git a/deprecations/pending-removal-in-3.14.po b/deprecations/pending-removal-in-3.14.po index c37be736..cbe8bcd8 100644 --- a/deprecations/pending-removal-in-3.14.po +++ b/deprecations/pending-removal-in-3.14.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -104,44 +104,38 @@ msgid "" msgstr "" #: deprecations/pending-removal-in-3.14.rst:50 -msgid "" -":mod:`importlib`: ``__package__`` and ``__cached__`` will cease to be set or " -"taken into consideration by the import system (:gh:`97879`)." -msgstr "" - -#: deprecations/pending-removal-in-3.14.rst:53 msgid ":mod:`importlib.abc` deprecated classes:" msgstr "" -#: deprecations/pending-removal-in-3.14.rst:55 +#: deprecations/pending-removal-in-3.14.rst:52 msgid ":class:`!importlib.abc.ResourceReader`" msgstr "" -#: deprecations/pending-removal-in-3.14.rst:56 +#: deprecations/pending-removal-in-3.14.rst:53 msgid ":class:`!importlib.abc.Traversable`" msgstr "" -#: deprecations/pending-removal-in-3.14.rst:57 +#: deprecations/pending-removal-in-3.14.rst:54 msgid ":class:`!importlib.abc.TraversableResources`" msgstr "" -#: deprecations/pending-removal-in-3.14.rst:59 +#: deprecations/pending-removal-in-3.14.rst:56 msgid "Use :mod:`importlib.resources.abc` classes instead:" msgstr "" -#: deprecations/pending-removal-in-3.14.rst:61 +#: deprecations/pending-removal-in-3.14.rst:58 msgid ":class:`importlib.resources.abc.Traversable`" msgstr "" -#: deprecations/pending-removal-in-3.14.rst:62 +#: deprecations/pending-removal-in-3.14.rst:59 msgid ":class:`importlib.resources.abc.TraversableResources`" msgstr "" -#: deprecations/pending-removal-in-3.14.rst:64 +#: deprecations/pending-removal-in-3.14.rst:61 msgid "(Contributed by Jason R. Coombs and Hugo van Kemenade in :gh:`93963`.)" msgstr "" -#: deprecations/pending-removal-in-3.14.rst:66 +#: deprecations/pending-removal-in-3.14.rst:63 msgid "" ":mod:`itertools` had undocumented, inefficient, historically buggy, and " "inconsistent support for copy, deepcopy, and pickle operations. This will be " @@ -149,7 +143,7 @@ msgid "" "burden. (Contributed by Raymond Hettinger in :gh:`101588`.)" msgstr "" -#: deprecations/pending-removal-in-3.14.rst:72 +#: deprecations/pending-removal-in-3.14.rst:69 msgid "" ":mod:`multiprocessing`: The default start method will change to a safer one " "on Linux, BSDs, and other non-macOS POSIX platforms where ``'fork'`` is " @@ -160,53 +154,53 @@ msgid "" "``'fork'``. See :ref:`multiprocessing-start-methods`." msgstr "" -#: deprecations/pending-removal-in-3.14.rst:80 +#: deprecations/pending-removal-in-3.14.rst:77 msgid "" ":mod:`pathlib`: :meth:`~pathlib.PurePath.is_relative_to` and :meth:`~pathlib." "PurePath.relative_to`: passing additional arguments is deprecated." msgstr "" -#: deprecations/pending-removal-in-3.14.rst:84 +#: deprecations/pending-removal-in-3.14.rst:81 msgid "" ":mod:`pkgutil`: :func:`~pkgutil.find_loader` and :func:`~pkgutil.get_loader` " "now raise :exc:`DeprecationWarning`; use :func:`importlib.util.find_spec` " "instead. (Contributed by Nikita Sobolev in :gh:`97850`.)" msgstr "" -#: deprecations/pending-removal-in-3.14.rst:89 +#: deprecations/pending-removal-in-3.14.rst:86 msgid ":mod:`pty`:" msgstr "" -#: deprecations/pending-removal-in-3.14.rst:91 +#: deprecations/pending-removal-in-3.14.rst:88 msgid "``master_open()``: use :func:`pty.openpty`." msgstr "" -#: deprecations/pending-removal-in-3.14.rst:92 +#: deprecations/pending-removal-in-3.14.rst:89 msgid "``slave_open()``: use :func:`pty.openpty`." msgstr "" -#: deprecations/pending-removal-in-3.14.rst:94 +#: deprecations/pending-removal-in-3.14.rst:91 msgid ":mod:`sqlite3`:" msgstr "" -#: deprecations/pending-removal-in-3.14.rst:96 +#: deprecations/pending-removal-in-3.14.rst:93 msgid ":data:`~sqlite3.version` and :data:`~sqlite3.version_info`." msgstr "" -#: deprecations/pending-removal-in-3.14.rst:98 +#: deprecations/pending-removal-in-3.14.rst:95 msgid "" ":meth:`~sqlite3.Cursor.execute` and :meth:`~sqlite3.Cursor.executemany` if :" "ref:`named placeholders ` are used and *parameters* is " "a sequence instead of a :class:`dict`." msgstr "" -#: deprecations/pending-removal-in-3.14.rst:102 +#: deprecations/pending-removal-in-3.14.rst:99 msgid "" ":mod:`typing`: :class:`~typing.ByteString`, deprecated since Python 3.9, now " "causes a :exc:`DeprecationWarning` to be emitted when it is used." msgstr "" -#: deprecations/pending-removal-in-3.14.rst:105 +#: deprecations/pending-removal-in-3.14.rst:102 msgid "" ":mod:`urllib`: :class:`!urllib.parse.Quoter` is deprecated: it was not " "intended to be a public API. (Contributed by Gregory P. Smith in :gh:" diff --git a/deprecations/pending-removal-in-3.15.po b/deprecations/pending-removal-in-3.15.po index 6ab69136..df33476c 100644 --- a/deprecations/pending-removal-in-3.15.po +++ b/deprecations/pending-removal-in-3.15.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -22,80 +22,121 @@ msgid "Pending Removal in Python 3.15" msgstr "" #: deprecations/pending-removal-in-3.15.rst:4 +msgid "The import system:" +msgstr "" + +#: deprecations/pending-removal-in-3.15.rst:6 +msgid "" +"Setting :attr:`~module.__cached__` on a module while failing to set :attr:" +"`__spec__.cached ` is deprecated. In " +"Python 3.15, :attr:`!__cached__` will cease to be set or take into " +"consideration by the import system or standard library. (:gh:`97879`)" +msgstr "" + +#: deprecations/pending-removal-in-3.15.rst:11 +msgid "" +"Setting :attr:`~module.__package__` on a module while failing to set :attr:" +"`__spec__.parent ` is deprecated. In " +"Python 3.15, :attr:`!__package__` will cease to be set or take into " +"consideration by the import system or standard library. (:gh:`97879`)" +msgstr "" + +#: deprecations/pending-removal-in-3.15.rst:16 +msgid ":mod:`ctypes`:" +msgstr "" + +#: deprecations/pending-removal-in-3.15.rst:18 +msgid "" +"The undocumented :func:`!ctypes.SetPointerType` function has been deprecated " +"since Python 3.13." +msgstr "" + +#: deprecations/pending-removal-in-3.15.rst:21 +msgid ":mod:`http.server`:" +msgstr "" + +#: deprecations/pending-removal-in-3.15.rst:23 +msgid "" +"The obsolete and rarely used :class:`~http.server.CGIHTTPRequestHandler` has " +"been deprecated since Python 3.13. No direct replacement exists. *Anything* " +"is better than CGI to interface a web server with a request handler." +msgstr "" + +#: deprecations/pending-removal-in-3.15.rst:29 msgid "" -":class:`http.server.CGIHTTPRequestHandler` will be removed along with its " -"related ``--cgi`` flag to ``python -m http.server``. It was obsolete and " -"rarely used. No direct replacement exists. *Anything* is better than CGI " -"to interface a web server with a request handler." +"The :option:`!--cgi` flag to the :program:`python -m http.server` command-" +"line interface has been deprecated since Python 3.13." msgstr "" -#: deprecations/pending-removal-in-3.15.rst:9 +#: deprecations/pending-removal-in-3.15.rst:32 msgid ":mod:`importlib`:" msgstr "" -#: deprecations/pending-removal-in-3.15.rst:11 +#: deprecations/pending-removal-in-3.15.rst:34 msgid "``load_module()`` method: use ``exec_module()`` instead." msgstr "" -#: deprecations/pending-removal-in-3.15.rst:13 +#: deprecations/pending-removal-in-3.15.rst:36 +msgid ":class:`locale`:" +msgstr "" + +#: deprecations/pending-removal-in-3.15.rst:38 msgid "" -":class:`locale`: :func:`locale.getdefaultlocale` was deprecated in Python " -"3.11 and originally planned for removal in Python 3.13 (:gh:`90817`), but " -"removal has been postponed to Python 3.15. Use :func:`locale.setlocale`, :" -"func:`locale.getencoding` and :func:`locale.getlocale` instead. (Contributed " -"by Hugo van Kemenade in :gh:`111187`.)" +"The :func:`~locale.getdefaultlocale` function has been deprecated since " +"Python 3.11. Its removal was originally planned for Python 3.13 (:gh:" +"`90817`), but has been postponed to Python 3.15. Use :func:`~locale." +"getlocale`, :func:`~locale.setlocale`, and :func:`~locale.getencoding` " +"instead. (Contributed by Hugo van Kemenade in :gh:`111187`.)" msgstr "" -#: deprecations/pending-removal-in-3.15.rst:20 +#: deprecations/pending-removal-in-3.15.rst:46 +msgid ":mod:`pathlib`:" +msgstr "" + +#: deprecations/pending-removal-in-3.15.rst:48 msgid "" -":mod:`pathlib`: :meth:`pathlib.PurePath.is_reserved` is deprecated and " -"scheduled for removal in Python 3.15. From Python 3.13 onwards, use ``os." -"path.isreserved`` to detect reserved paths on Windows." +":meth:`.PurePath.is_reserved` has been deprecated since Python 3.13. Use :" +"func:`os.path.isreserved` to detect reserved paths on Windows." +msgstr "" + +#: deprecations/pending-removal-in-3.15.rst:52 +msgid ":mod:`platform`:" msgstr "" -#: deprecations/pending-removal-in-3.15.rst:25 +#: deprecations/pending-removal-in-3.15.rst:54 msgid "" -":mod:`platform`: :func:`~platform.java_ver` is deprecated and will be " -"removed in 3.15. It was largely untested, had a confusing API, and was only " -"useful for Jython support. (Contributed by Nikita Sobolev in :gh:`116349`.)" +":func:`~platform.java_ver` has been deprecated since Python 3.13. This " +"function is only useful for Jython support, has a confusing API, and is " +"largely untested." msgstr "" -#: deprecations/pending-removal-in-3.15.rst:31 +#: deprecations/pending-removal-in-3.15.rst:58 msgid ":mod:`sysconfig`:" msgstr "" -#: deprecations/pending-removal-in-3.15.rst:33 +#: deprecations/pending-removal-in-3.15.rst:60 msgid "" "The *check_home* argument of :func:`sysconfig.is_python_build` has been " "deprecated since Python 3.12." msgstr "" -#: deprecations/pending-removal-in-3.15.rst:36 -msgid "" -":mod:`threading`: Passing any arguments to :func:`threading.RLock` is now " -"deprecated. C version allows any numbers of args and kwargs, but they are " -"just ignored. Python version does not allow any arguments. All arguments " -"will be removed from :func:`threading.RLock` in Python 3.15. (Contributed by " -"Nikita Sobolev in :gh:`102029`.)" -msgstr "" - -#: deprecations/pending-removal-in-3.15.rst:43 -msgid ":class:`typing.NamedTuple`:" +#: deprecations/pending-removal-in-3.15.rst:63 +msgid ":mod:`threading`:" msgstr "" -#: deprecations/pending-removal-in-3.15.rst:45 +#: deprecations/pending-removal-in-3.15.rst:65 msgid "" -"The undocumented keyword argument syntax for creating :class:`!NamedTuple` " -"classes (``NT = NamedTuple(\"NT\", x=int)``) is deprecated, and will be " -"disallowed in 3.15. Use the class-based syntax or the functional syntax " -"instead." +":func:`~threading.RLock` will take no arguments in Python 3.15. Passing any " +"arguments has been deprecated since Python 3.14, as the Python version does " +"not permit any arguments, but the C version allows any number of positional " +"or keyword arguments, ignoring every argument." msgstr "" -#: deprecations/pending-removal-in-3.15.rst:49 +#: deprecations/pending-removal-in-3.15.rst:71 msgid ":mod:`types`:" msgstr "" -#: deprecations/pending-removal-in-3.15.rst:51 +#: deprecations/pending-removal-in-3.15.rst:73 msgid "" ":class:`types.CodeType`: Accessing :attr:`~codeobject.co_lnotab` was " "deprecated in :pep:`626` since 3.10 and was planned to be removed in 3.12, " @@ -103,35 +144,32 @@ msgid "" "in 3.15. (Contributed by Nikita Sobolev in :gh:`101866`.)" msgstr "" -#: deprecations/pending-removal-in-3.15.rst:58 +#: deprecations/pending-removal-in-3.15.rst:80 msgid ":mod:`typing`:" msgstr "" -#: deprecations/pending-removal-in-3.15.rst:60 +#: deprecations/pending-removal-in-3.15.rst:82 msgid "" -"When using the functional syntax to create a :class:`!NamedTuple` class, " -"failing to pass a value to the *fields* parameter (``NT = " -"NamedTuple(\"NT\")``) is deprecated. Passing ``None`` to the *fields* " -"parameter (``NT = NamedTuple(\"NT\", None)``) is also deprecated. Both will " -"be disallowed in Python 3.15. To create a :class:`!NamedTuple` class with 0 " -"fields, use ``class NT(NamedTuple): pass`` or ``NT = NamedTuple(\"NT\", " -"[])``." +"The undocumented keyword argument syntax for creating :class:`~typing." +"NamedTuple` classes (e.g. ``Point = NamedTuple(\"Point\", x=int, y=int)``) " +"has been deprecated since Python 3.13. Use the class-based syntax or the " +"functional syntax instead." msgstr "" -#: deprecations/pending-removal-in-3.15.rst:67 +#: deprecations/pending-removal-in-3.15.rst:88 msgid "" -":class:`typing.TypedDict`: When using the functional syntax to create a :" -"class:`!TypedDict` class, failing to pass a value to the *fields* parameter " -"(``TD = TypedDict(\"TD\")``) is deprecated. Passing ``None`` to the *fields* " -"parameter (``TD = TypedDict(\"TD\", None)``) is also deprecated. Both will " -"be disallowed in Python 3.15. To create a :class:`!TypedDict` class with 0 " -"fields, use ``class TD(TypedDict): pass`` or ``TD = TypedDict(\"TD\", {})``." +"The :func:`typing.no_type_check_decorator` decorator function has been " +"deprecated since Python 3.13. After eight years in the :mod:`typing` module, " +"it has yet to be supported by any major type checker." +msgstr "" + +#: deprecations/pending-removal-in-3.15.rst:93 +msgid ":mod:`wave`:" msgstr "" -#: deprecations/pending-removal-in-3.15.rst:74 +#: deprecations/pending-removal-in-3.15.rst:95 msgid "" -":mod:`wave`: Deprecate the ``getmark()``, ``setmark()`` and ``getmarkers()`` " -"methods of the :class:`wave.Wave_read` and :class:`wave.Wave_write` classes. " -"They will be removed in Python 3.15. (Contributed by Victor Stinner in :gh:" -"`105096`.)" +"The :meth:`~wave.Wave_read.getmark`, :meth:`!setmark`, and :meth:`~wave." +"Wave_read.getmarkers` methods of the :class:`~wave.Wave_read` and :class:" +"`~wave.Wave_write` classes have been deprecated since Python 3.13." msgstr "" diff --git a/deprecations/pending-removal-in-3.16.po b/deprecations/pending-removal-in-3.16.po index 03839981..083e9e0d 100644 --- a/deprecations/pending-removal-in-3.16.po +++ b/deprecations/pending-removal-in-3.16.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -18,7 +18,7 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" #: deprecations/pending-removal-in-3.16.rst:2 -msgid "Pending Removal in Python 3.16" +msgid "Pending removal in Python 3.16" msgstr "" #: deprecations/pending-removal-in-3.16.rst:4 @@ -34,17 +34,78 @@ msgid "" msgstr "" #: deprecations/pending-removal-in-3.16.rst:11 +msgid ":mod:`array`:" +msgstr "" + +#: deprecations/pending-removal-in-3.16.rst:13 +msgid "" +"The ``'u'`` format code (:c:type:`wchar_t`) has been deprecated in " +"documentation since Python 3.3 and at runtime since Python 3.13. Use the " +"``'w'`` format code (:c:type:`Py_UCS4`) for Unicode characters instead." +msgstr "" + +#: deprecations/pending-removal-in-3.16.rst:19 +msgid ":mod:`asyncio`:" +msgstr "" + +#: deprecations/pending-removal-in-3.16.rst:21 +msgid "" +":func:`!asyncio.iscoroutinefunction` is deprecated and will be removed in " +"Python 3.16, use :func:`inspect.iscoroutinefunction` instead. (Contributed " +"by Jiahao Li and Kumar Aditya in :gh:`122875`.)" +msgstr "" + +#: deprecations/pending-removal-in-3.16.rst:26 +msgid ":mod:`builtins`:" +msgstr "" + +#: deprecations/pending-removal-in-3.16.rst:28 +msgid "" +"Bitwise inversion on boolean types, ``~True`` or ``~False`` has been " +"deprecated since Python 3.12, as it produces surprising and unintuitive " +"results (``-2`` and ``-1``). Use ``not x`` instead for the logical negation " +"of a Boolean. In the rare case that you need the bitwise inversion of the " +"underlying integer, convert to ``int`` explicitly (``~int(x)``)." +msgstr "" + +#: deprecations/pending-removal-in-3.16.rst:35 +msgid ":mod:`shutil`:" +msgstr "" + +#: deprecations/pending-removal-in-3.16.rst:37 +msgid "" +"The :class:`!ExecError` exception has been deprecated since Python 3.14. It " +"has not been used by any function in :mod:`!shutil` since Python 3.4, and is " +"now an alias of :exc:`RuntimeError`." +msgstr "" + +#: deprecations/pending-removal-in-3.16.rst:42 +msgid ":mod:`symtable`:" +msgstr "" + +#: deprecations/pending-removal-in-3.16.rst:44 +msgid "" +"The :meth:`Class.get_methods ` method has been " +"deprecated since Python 3.14." +msgstr "" + +#: deprecations/pending-removal-in-3.16.rst:47 +msgid ":mod:`sys`:" +msgstr "" + +#: deprecations/pending-removal-in-3.16.rst:49 msgid "" -":mod:`array`: :class:`array.array` ``'u'`` type (:c:type:`wchar_t`): use the " -"``'w'`` type instead (``Py_UCS4``)." +"The :func:`~sys._enablelegacywindowsfsencoding` function has been deprecated " +"since Python 3.13. Use the :envvar:`PYTHONLEGACYWINDOWSFSENCODING` " +"environment variable instead." msgstr "" -#: deprecations/pending-removal-in-3.16.rst:15 -msgid ":mod:`builtins`: ``~bool``, bitwise inversion on bool." +#: deprecations/pending-removal-in-3.16.rst:53 +msgid ":mod:`tarfile`:" msgstr "" -#: deprecations/pending-removal-in-3.16.rst:18 +#: deprecations/pending-removal-in-3.16.rst:55 msgid "" -":mod:`symtable`: Deprecate :meth:`symtable.Class.get_methods` due to the " -"lack of interest. (Contributed by Bénédikt Tran in :gh:`119698`.)" +"The undocumented and unused :attr:`!TarFile.tarfile` attribute has been " +"deprecated since Python 3.13." msgstr "" diff --git a/deprecations/pending-removal-in-future.po b/deprecations/pending-removal-in-future.po index ad6ffae4..9695172d 100644 --- a/deprecations/pending-removal-in-future.po +++ b/deprecations/pending-removal-in-future.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -34,25 +34,21 @@ msgid "" msgstr "" #: deprecations/pending-removal-in-future.rst:10 -msgid ":mod:`array`'s ``'u'`` format code (:gh:`57281`)" -msgstr "" - -#: deprecations/pending-removal-in-future.rst:12 msgid ":mod:`builtins`:" msgstr "" -#: deprecations/pending-removal-in-future.rst:14 +#: deprecations/pending-removal-in-future.rst:12 msgid "``bool(NotImplemented)``." msgstr "" -#: deprecations/pending-removal-in-future.rst:15 +#: deprecations/pending-removal-in-future.rst:13 msgid "" "Generators: ``throw(type, exc, tb)`` and ``athrow(type, exc, tb)`` signature " "is deprecated: use ``throw(exc)`` and ``athrow(exc)`` instead, the single " "argument signature." msgstr "" -#: deprecations/pending-removal-in-future.rst:18 +#: deprecations/pending-removal-in-future.rst:16 msgid "" "Currently Python accepts numeric literals immediately followed by keywords, " "for example ``0in x``, ``1or x``, ``0if 1else 2``. It allows confusing and " @@ -64,32 +60,32 @@ msgid "" "syntax error. (:gh:`87999`)" msgstr "" -#: deprecations/pending-removal-in-future.rst:26 +#: deprecations/pending-removal-in-future.rst:24 msgid "" "Support for ``__index__()`` and ``__int__()`` method returning non-int type: " "these methods will be required to return an instance of a strict subclass " "of :class:`int`." msgstr "" -#: deprecations/pending-removal-in-future.rst:29 +#: deprecations/pending-removal-in-future.rst:27 msgid "" "Support for ``__float__()`` method returning a strict subclass of :class:" "`float`: these methods will be required to return an instance of :class:" "`float`." msgstr "" -#: deprecations/pending-removal-in-future.rst:32 +#: deprecations/pending-removal-in-future.rst:30 msgid "" "Support for ``__complex__()`` method returning a strict subclass of :class:" "`complex`: these methods will be required to return an instance of :class:" "`complex`." msgstr "" -#: deprecations/pending-removal-in-future.rst:35 +#: deprecations/pending-removal-in-future.rst:33 msgid "Delegation of ``int()`` to ``__trunc__()`` method." msgstr "" -#: deprecations/pending-removal-in-future.rst:36 +#: deprecations/pending-removal-in-future.rst:34 msgid "" "Passing a complex number as the *real* or *imag* argument in the :func:" "`complex` constructor is now deprecated; it should only be passed as a " @@ -97,79 +93,85 @@ msgid "" "`109218`.)" msgstr "" -#: deprecations/pending-removal-in-future.rst:41 +#: deprecations/pending-removal-in-future.rst:39 msgid "" ":mod:`calendar`: ``calendar.January`` and ``calendar.February`` constants " "are deprecated and replaced by :data:`calendar.JANUARY` and :data:`calendar." "FEBRUARY`. (Contributed by Prince Roshan in :gh:`103636`.)" msgstr "" -#: deprecations/pending-removal-in-future.rst:46 +#: deprecations/pending-removal-in-future.rst:44 msgid "" ":attr:`codeobject.co_lnotab`: use the :meth:`codeobject.co_lines` method " "instead." msgstr "" -#: deprecations/pending-removal-in-future.rst:49 +#: deprecations/pending-removal-in-future.rst:47 msgid ":mod:`datetime`:" msgstr "" -#: deprecations/pending-removal-in-future.rst:51 +#: deprecations/pending-removal-in-future.rst:49 msgid "" ":meth:`~datetime.datetime.utcnow`: use ``datetime.datetime.now(tz=datetime." "UTC)``." msgstr "" -#: deprecations/pending-removal-in-future.rst:53 +#: deprecations/pending-removal-in-future.rst:51 msgid "" ":meth:`~datetime.datetime.utcfromtimestamp`: use ``datetime.datetime." "fromtimestamp(timestamp, tz=datetime.UTC)``." msgstr "" -#: deprecations/pending-removal-in-future.rst:56 +#: deprecations/pending-removal-in-future.rst:54 msgid ":mod:`gettext`: Plural value must be an integer." msgstr "" -#: deprecations/pending-removal-in-future.rst:58 +#: deprecations/pending-removal-in-future.rst:56 msgid ":mod:`importlib`:" msgstr "" -#: deprecations/pending-removal-in-future.rst:60 +#: deprecations/pending-removal-in-future.rst:58 msgid "" ":func:`~importlib.util.cache_from_source` *debug_override* parameter is " "deprecated: use the *optimization* parameter instead." msgstr "" -#: deprecations/pending-removal-in-future.rst:63 +#: deprecations/pending-removal-in-future.rst:61 msgid ":mod:`importlib.metadata`:" msgstr "" -#: deprecations/pending-removal-in-future.rst:65 +#: deprecations/pending-removal-in-future.rst:63 msgid "``EntryPoints`` tuple interface." msgstr "" -#: deprecations/pending-removal-in-future.rst:66 +#: deprecations/pending-removal-in-future.rst:64 msgid "Implicit ``None`` on return values." msgstr "" -#: deprecations/pending-removal-in-future.rst:68 +#: deprecations/pending-removal-in-future.rst:66 +msgid "" +":mod:`logging`: the ``warn()`` method has been deprecated since Python 3.3, " +"use :meth:`~logging.warning` instead." +msgstr "" + +#: deprecations/pending-removal-in-future.rst:69 msgid "" ":mod:`mailbox`: Use of StringIO input and text mode is deprecated, use " "BytesIO and binary mode instead." msgstr "" -#: deprecations/pending-removal-in-future.rst:71 +#: deprecations/pending-removal-in-future.rst:72 msgid "" ":mod:`os`: Calling :func:`os.register_at_fork` in multi-threaded process." msgstr "" -#: deprecations/pending-removal-in-future.rst:73 +#: deprecations/pending-removal-in-future.rst:74 msgid "" ":class:`!pydoc.ErrorDuringImport`: A tuple value for *exc_info* parameter is " "deprecated, use an exception instance." msgstr "" -#: deprecations/pending-removal-in-future.rst:76 +#: deprecations/pending-removal-in-future.rst:77 msgid "" ":mod:`re`: More strict rules are now applied for numerical group references " "and group names in regular expressions. Only sequence of ASCII digits is " @@ -178,179 +180,179 @@ msgid "" "underscore. (Contributed by Serhiy Storchaka in :gh:`91760`.)" msgstr "" -#: deprecations/pending-removal-in-future.rst:83 +#: deprecations/pending-removal-in-future.rst:84 msgid "" ":mod:`!sre_compile`, :mod:`!sre_constants` and :mod:`!sre_parse` modules." msgstr "" -#: deprecations/pending-removal-in-future.rst:85 +#: deprecations/pending-removal-in-future.rst:86 msgid "" ":mod:`shutil`: :func:`~shutil.rmtree`'s *onerror* parameter is deprecated in " "Python 3.12; use the *onexc* parameter instead." msgstr "" -#: deprecations/pending-removal-in-future.rst:88 +#: deprecations/pending-removal-in-future.rst:89 msgid ":mod:`ssl` options and protocols:" msgstr "" -#: deprecations/pending-removal-in-future.rst:90 +#: deprecations/pending-removal-in-future.rst:91 msgid ":class:`ssl.SSLContext` without protocol argument is deprecated." msgstr "" -#: deprecations/pending-removal-in-future.rst:91 +#: deprecations/pending-removal-in-future.rst:92 msgid "" ":class:`ssl.SSLContext`: :meth:`~ssl.SSLContext.set_npn_protocols` and :meth:" "`!selected_npn_protocol` are deprecated: use ALPN instead." msgstr "" -#: deprecations/pending-removal-in-future.rst:94 +#: deprecations/pending-removal-in-future.rst:95 msgid "``ssl.OP_NO_SSL*`` options" msgstr "" -#: deprecations/pending-removal-in-future.rst:95 +#: deprecations/pending-removal-in-future.rst:96 msgid "``ssl.OP_NO_TLS*`` options" msgstr "" -#: deprecations/pending-removal-in-future.rst:96 +#: deprecations/pending-removal-in-future.rst:97 msgid "``ssl.PROTOCOL_SSLv3``" msgstr "" -#: deprecations/pending-removal-in-future.rst:97 +#: deprecations/pending-removal-in-future.rst:98 msgid "``ssl.PROTOCOL_TLS``" msgstr "" -#: deprecations/pending-removal-in-future.rst:98 +#: deprecations/pending-removal-in-future.rst:99 msgid "``ssl.PROTOCOL_TLSv1``" msgstr "" -#: deprecations/pending-removal-in-future.rst:99 +#: deprecations/pending-removal-in-future.rst:100 msgid "``ssl.PROTOCOL_TLSv1_1``" msgstr "" -#: deprecations/pending-removal-in-future.rst:100 +#: deprecations/pending-removal-in-future.rst:101 msgid "``ssl.PROTOCOL_TLSv1_2``" msgstr "" -#: deprecations/pending-removal-in-future.rst:101 +#: deprecations/pending-removal-in-future.rst:102 msgid "``ssl.TLSVersion.SSLv3``" msgstr "" -#: deprecations/pending-removal-in-future.rst:102 +#: deprecations/pending-removal-in-future.rst:103 msgid "``ssl.TLSVersion.TLSv1``" msgstr "" -#: deprecations/pending-removal-in-future.rst:103 +#: deprecations/pending-removal-in-future.rst:104 msgid "``ssl.TLSVersion.TLSv1_1``" msgstr "" -#: deprecations/pending-removal-in-future.rst:105 +#: deprecations/pending-removal-in-future.rst:106 msgid ":mod:`threading` methods:" msgstr "" -#: deprecations/pending-removal-in-future.rst:107 +#: deprecations/pending-removal-in-future.rst:108 msgid "" ":meth:`!threading.Condition.notifyAll`: use :meth:`~threading.Condition." "notify_all`." msgstr "" -#: deprecations/pending-removal-in-future.rst:108 +#: deprecations/pending-removal-in-future.rst:109 msgid ":meth:`!threading.Event.isSet`: use :meth:`~threading.Event.is_set`." msgstr "" -#: deprecations/pending-removal-in-future.rst:109 +#: deprecations/pending-removal-in-future.rst:110 msgid "" ":meth:`!threading.Thread.isDaemon`, :meth:`threading.Thread.setDaemon`: use :" "attr:`threading.Thread.daemon` attribute." msgstr "" -#: deprecations/pending-removal-in-future.rst:111 +#: deprecations/pending-removal-in-future.rst:112 msgid "" ":meth:`!threading.Thread.getName`, :meth:`threading.Thread.setName`: use :" "attr:`threading.Thread.name` attribute." msgstr "" -#: deprecations/pending-removal-in-future.rst:113 +#: deprecations/pending-removal-in-future.rst:114 msgid ":meth:`!threading.currentThread`: use :meth:`threading.current_thread`." msgstr "" -#: deprecations/pending-removal-in-future.rst:114 +#: deprecations/pending-removal-in-future.rst:115 msgid ":meth:`!threading.activeCount`: use :meth:`threading.active_count`." msgstr "" -#: deprecations/pending-removal-in-future.rst:116 +#: deprecations/pending-removal-in-future.rst:117 msgid ":class:`typing.Text` (:gh:`92332`)." msgstr "" -#: deprecations/pending-removal-in-future.rst:118 +#: deprecations/pending-removal-in-future.rst:119 msgid "" ":class:`unittest.IsolatedAsyncioTestCase`: it is deprecated to return a " "value that is not ``None`` from a test case." msgstr "" -#: deprecations/pending-removal-in-future.rst:121 +#: deprecations/pending-removal-in-future.rst:122 msgid "" ":mod:`urllib.parse` deprecated functions: :func:`~urllib.parse.urlparse` " "instead" msgstr "" -#: deprecations/pending-removal-in-future.rst:123 +#: deprecations/pending-removal-in-future.rst:124 msgid "``splitattr()``" msgstr "" -#: deprecations/pending-removal-in-future.rst:124 +#: deprecations/pending-removal-in-future.rst:125 msgid "``splithost()``" msgstr "" -#: deprecations/pending-removal-in-future.rst:125 +#: deprecations/pending-removal-in-future.rst:126 msgid "``splitnport()``" msgstr "" -#: deprecations/pending-removal-in-future.rst:126 +#: deprecations/pending-removal-in-future.rst:127 msgid "``splitpasswd()``" msgstr "" -#: deprecations/pending-removal-in-future.rst:127 +#: deprecations/pending-removal-in-future.rst:128 msgid "``splitport()``" msgstr "" -#: deprecations/pending-removal-in-future.rst:128 +#: deprecations/pending-removal-in-future.rst:129 msgid "``splitquery()``" msgstr "" -#: deprecations/pending-removal-in-future.rst:129 +#: deprecations/pending-removal-in-future.rst:130 msgid "``splittag()``" msgstr "" -#: deprecations/pending-removal-in-future.rst:130 +#: deprecations/pending-removal-in-future.rst:131 msgid "``splittype()``" msgstr "" -#: deprecations/pending-removal-in-future.rst:131 +#: deprecations/pending-removal-in-future.rst:132 msgid "``splituser()``" msgstr "" -#: deprecations/pending-removal-in-future.rst:132 +#: deprecations/pending-removal-in-future.rst:133 msgid "``splitvalue()``" msgstr "" -#: deprecations/pending-removal-in-future.rst:133 +#: deprecations/pending-removal-in-future.rst:134 msgid "``to_bytes()``" msgstr "" -#: deprecations/pending-removal-in-future.rst:135 +#: deprecations/pending-removal-in-future.rst:136 msgid "" ":mod:`urllib.request`: :class:`~urllib.request.URLopener` and :class:" "`~urllib.request.FancyURLopener` style of invoking requests is deprecated. " "Use newer :func:`~urllib.request.urlopen` functions and methods." msgstr "" -#: deprecations/pending-removal-in-future.rst:139 +#: deprecations/pending-removal-in-future.rst:140 msgid "" ":mod:`wsgiref`: ``SimpleHandler.stdout.write()`` should not do partial " "writes." msgstr "" -#: deprecations/pending-removal-in-future.rst:142 +#: deprecations/pending-removal-in-future.rst:143 msgid "" ":mod:`xml.etree.ElementTree`: Testing the truth value of an :class:`~xml." "etree.ElementTree.Element` is deprecated. In a future release it will always " @@ -358,7 +360,7 @@ msgid "" "instead." msgstr "" -#: deprecations/pending-removal-in-future.rst:147 +#: deprecations/pending-removal-in-future.rst:148 msgid "" ":meth:`zipimport.zipimporter.load_module` is deprecated: use :meth:" "`~zipimport.zipimporter.exec_module` instead." diff --git a/dictionaries/main.txt b/dictionaries/main.txt index ea010d18..2c53ae2a 100644 --- a/dictionaries/main.txt +++ b/dictionaries/main.txt @@ -1,13 +1,16 @@ A ActiveState Actual +Agreement Alias +All Alph Alpine Alternate Alternative Android Apache +Associates Audio Avenue Awk @@ -39,8 +42,10 @@ Comprehensions Control Cookbook Cookie +Copyright Corporation Creations +Cross Ctrl Cython D @@ -97,6 +102,7 @@ If Inc Indent Index +Individual Inf Info Initiatives @@ -114,8 +120,12 @@ Jr Just Jython Korn +Krah L +Laboratories Letter +License +Licensee Linux Lisp Literals @@ -133,6 +143,7 @@ Lu Lundh M Mac +Macintosh Mailbox Majkowski Makefile @@ -145,17 +156,20 @@ Modula Modules Monty Mountain +Mozilla N National Nd New None Not +Nothing Null Number Numeric Nα O +Organization Origin Other P @@ -163,6 +177,9 @@ Packard Pascal Path Perl +Permission +Pillow +Platform Precision Print Private @@ -177,17 +194,22 @@ Randal Ranges Readline Red +Redistribution +Redistributions Reference Reilly Research Reston Richard +Rights Ro Roskind Rossum Ru Runtime Rust +Scientific +Scintilla Search Second Separator @@ -209,9 +231,11 @@ Stacks Stallman Start States +Stefan Stichting Storage String +Subject Sun Sx Sy @@ -228,6 +252,7 @@ Transform Traversable Tuples Tutorial +Twisted U Ulf Unices @@ -244,8 +269,10 @@ Zope a abc abcdef +above abs abstract +accessing accessor action active @@ -254,12 +281,16 @@ add adding adds age +agency al alias aliases +all alone ame amp +an +anchor and annotating annotation @@ -269,6 +300,7 @@ api append apple archives +are arg args argument @@ -283,6 +315,9 @@ assignment async asyncio at +attribute +attributes +available average await b @@ -295,6 +330,7 @@ bacon base based bash +basis basket batch be @@ -314,8 +350,12 @@ blocks bool boolean booleans +bound +branch +breach breadth break +brief buffer buffered buffers @@ -327,6 +367,7 @@ built builtin builtins but +by byte bytearray bytecode @@ -358,8 +399,10 @@ ceil cfg cfuhash chain +changes char character +charge chdir chomp chr @@ -392,6 +435,7 @@ components comprehension comprehensions concatenation +conditions config configure conflict @@ -412,7 +456,10 @@ control conv convenience conversion +copies copy +copying +copyright coroutine coroutines cost @@ -432,6 +479,7 @@ day days de dead +deal debug debugger debugging @@ -439,6 +487,7 @@ decimal decorated decorator decorators +deemed def default defaults @@ -452,6 +501,7 @@ demo deploy depth deque +derivative descriptor descriptors devel @@ -463,7 +513,11 @@ dir direct dishes dispatch +display +distribute +distribution dll +do doc docstring docstrings @@ -489,6 +543,7 @@ encoding end endian endianness +endorse enter entry env @@ -498,6 +553,8 @@ errors escape escaped et +eval +event events exc except @@ -536,14 +593,18 @@ float floating floats floor +following foo for forget +form format formatted formatting +forms frac framework +free freeze freshfruit from @@ -573,6 +634,9 @@ globals go golf gpa +grant +granted +grants grape group grouping @@ -592,6 +656,9 @@ heaps hello hellos help +hereafter +hereby +herein hex hints historic @@ -599,6 +666,7 @@ holder home host hot +however i id idiom @@ -614,6 +682,9 @@ imports in inactive include +included +including +incorporates increase index indexed @@ -636,6 +707,7 @@ insert inst insta install +installing instance instances int @@ -669,9 +741,12 @@ iteration iterations iterator iterators +its ium j join +joing +joint juice jump k @@ -698,9 +773,11 @@ letters lib libc libffi +license life like limit +limitation line linear liners @@ -735,11 +812,13 @@ lst lstrip lt m +made mail mailbox mailing main make +making manager mangled mangling @@ -747,9 +826,12 @@ map mapping mappingproxy mappings +marshal masking match matching +material +materials math matrix max @@ -759,7 +841,9 @@ memory memoryview memoryviews menu +merge messages +met meta meth method @@ -770,6 +854,8 @@ mkdir mm mod mode +modification +modify module modules modulo @@ -801,6 +887,7 @@ no non not notation +notice now nowait null @@ -812,6 +899,7 @@ o obj object objects +obtaining of old on @@ -828,6 +916,9 @@ ordinal ordinals org os +other +others +otherwise out over overallocation @@ -845,6 +936,9 @@ pairs parrot parser parsing +part +partnership +party pass passion path @@ -852,6 +946,12 @@ pattern payload pdb pear +perform +permission +permit +permitted +person +persons pi pickle pip @@ -865,11 +965,15 @@ points pop popleft population +portions pos positional pow precision prefix +prepare +prepared +prepares pretty primary prime @@ -878,13 +982,18 @@ printable printer printf private +products project +promote prompt prompts property +provided provides provisional proxy +publicly +publish pull pure pushing @@ -920,19 +1029,26 @@ reference register regressions regular +relationship release reload remove repr +reproduce request requiring +reserved resource +restriction result +retain +retained return reverse reversed rgb rgba +rights rjust roll round @@ -947,6 +1063,7 @@ salad sausage scalar scanf +scope script scripting scripts @@ -955,17 +1072,22 @@ seconds see seek self +sell +sense sep sequence sequences server service +services set setattr setlocale sets setter setup +shall +shallow shell shells shift @@ -983,6 +1105,8 @@ sleep slept slice slicing +so +software somedir sort sorted @@ -1026,16 +1150,21 @@ struct student style sub +subject +sublicense submodule submodules subroutine subroutines subscript subsequence +substantial substring +such sugar suite sum +summary super superscript support @@ -1045,6 +1174,7 @@ switches symbol symlink symlinks +symmary syntactic syntax sys @@ -1062,15 +1192,22 @@ tasks temperature templating terminal +terminate terminator terminators +terms test testing testmod tests text +that the +then +thereof they +third +this tho thon thread @@ -1083,10 +1220,14 @@ titlecased to today token +tokens toolkits total trace tracker +trade +trademark +trademarks trick tricks true @@ -1125,6 +1266,7 @@ unpacking unsigned up update +upon uppercase uppercasing use @@ -1143,19 +1285,25 @@ var variable vars vec +venture +version void w +wants weakref weapon web while whitespace +whom +wide width wiki will win window with +without word words work @@ -1163,6 +1311,7 @@ worker workers workfile workload +works world wrap wrapper @@ -1241,6 +1390,7 @@ zlib αρχείο αρχειοθετημένη αρχικοποιήθηκε +αρχικοποιημένες αρχικοποιημένο αρχικός βλ @@ -1271,10 +1421,13 @@ zlib διορθώσεις εγειρθεί εκδόσεων +εκτελούμενης εκτυπώσιμη εκτυπώσιμο εκτυπώσιμοι εκτυπώσιμος +εμφωλευμένες +εμφωλευμένη εμφωλεύσετε εμφώλευσης ενδοκλάσεων @@ -1282,6 +1435,8 @@ zlib εξαδικού επέκτασης επίσης +επανακαθορίζονται +επανακαθορισμός επαναλήπτη επαναλήψιμους επαναχρησιμοποιηθούν @@ -1309,6 +1464,8 @@ zlib ιστότοπο ιστότοπος καθαρό +καθοριστή +καθοριστής και κανονικοποίηση κατάσταση @@ -1388,6 +1545,7 @@ zlib προεγκατεστημένη προεπιλεγμένης προεπιλεγμένος +προεπιλεγμένου προεπισκόπηση προσήμου προσδιοριστές @@ -1419,6 +1577,8 @@ zlib συμβολοσειρές συμβολοσειρών συμπεριλαμβανομένων +συμφραζόμενο +συμφραζόμενων συντηρησιμότητα συσχετιστικές συσχετιστικοί diff --git a/distributing/index.po b/distributing/index.po index 80049455..ad108393 100644 --- a/distributing/index.po +++ b/distributing/index.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: 2024-11-25 20:18+0000\n" "Last-Translator: Artemis Leonardou \n" "Language-Team: PyGreece \n" diff --git a/extending/building.po b/extending/building.po index a1b7359a..19bff4e0 100644 --- a/extending/building.po +++ b/extending/building.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" diff --git a/extending/embedding.po b/extending/embedding.po index 2efb66a5..f2c6a3c0 100644 --- a/extending/embedding.po +++ b/extending/embedding.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -93,43 +93,64 @@ msgid "" "int\n" "main(int argc, char *argv[])\n" "{\n" -" wchar_t *program = Py_DecodeLocale(argv[0], NULL);\n" -" if (program == NULL) {\n" -" fprintf(stderr, \"Fatal error: cannot decode argv[0]\\n\");\n" -" exit(1);\n" +" PyStatus status;\n" +" PyConfig config;\n" +" PyConfig_InitPythonConfig(&config);\n" +"\n" +" /* optional but recommended */\n" +" status = PyConfig_SetBytesString(&config, &config.program_name, " +"argv[0]);\n" +" if (PyStatus_Exception(status)) {\n" +" goto exception;\n" " }\n" -" Py_SetProgramName(program); /* optional but recommended */\n" -" Py_Initialize();\n" +"\n" +" status = Py_InitializeFromConfig(&config);\n" +" if (PyStatus_Exception(status)) {\n" +" goto exception;\n" +" }\n" +" PyConfig_Clear(&config);\n" +"\n" " PyRun_SimpleString(\"from time import time,ctime\\n\"\n" " \"print('Today is', ctime(time()))\\n\");\n" " if (Py_FinalizeEx() < 0) {\n" " exit(120);\n" " }\n" -" PyMem_RawFree(program);\n" " return 0;\n" +"\n" +" exception:\n" +" PyConfig_Clear(&config);\n" +" Py_ExitStatusException(status);\n" "}" msgstr "" -#: extending/embedding.rst:78 +#: extending/embedding.rst:92 msgid "" -"The :c:func:`Py_SetProgramName` function should be called before :c:func:" -"`Py_Initialize` to inform the interpreter about paths to Python run-time " -"libraries. Next, the Python interpreter is initialized with :c:func:" -"`Py_Initialize`, followed by the execution of a hard-coded Python script " -"that prints the date and time. Afterwards, the :c:func:`Py_FinalizeEx` call " -"shuts the interpreter down, followed by the end of the program. In a real " -"program, you may want to get the Python script from another source, perhaps " -"a text-editor routine, a file, or a database. Getting the Python code from " -"a file can better be done by using the :c:func:`PyRun_SimpleFile` function, " -"which saves you the trouble of allocating memory space and loading the file " -"contents." +"``#define PY_SSIZE_T_CLEAN`` was used to indicate that ``Py_ssize_t`` should " +"be used in some APIs instead of ``int``. It is not necessary since Python " +"3.13, but we keep it here for backward compatibility. See :ref:`arg-parsing-" +"string-and-buffers` for a description of this macro." msgstr "" -#: extending/embedding.rst:93 +#: extending/embedding.rst:97 +msgid "" +"Setting :c:member:`PyConfig.program_name` should be called before :c:func:" +"`Py_InitializeFromConfig` to inform the interpreter about paths to Python " +"run-time libraries. Next, the Python interpreter is initialized with :c:" +"func:`Py_Initialize`, followed by the execution of a hard-coded Python " +"script that prints the date and time. Afterwards, the :c:func:" +"`Py_FinalizeEx` call shuts the interpreter down, followed by the end of the " +"program. In a real program, you may want to get the Python script from " +"another source, perhaps a text-editor routine, a file, or a database. " +"Getting the Python code from a file can better be done by using the :c:func:" +"`PyRun_SimpleFile` function, which saves you the trouble of allocating " +"memory space and loading the file contents." +msgstr "" + +#: extending/embedding.rst:112 msgid "Beyond Very High Level Embedding: An overview" msgstr "" -#: extending/embedding.rst:95 +#: extending/embedding.rst:114 msgid "" "The high level interface gives you the ability to execute arbitrary pieces " "of Python code from your application, but exchanging data values is quite " @@ -138,7 +159,7 @@ msgid "" "anything." msgstr "" -#: extending/embedding.rst:100 +#: extending/embedding.rst:119 msgid "" "It should be noted that extending Python and embedding Python is quite the " "same activity, despite the different intent. Most topics discussed in the " @@ -146,37 +167,37 @@ msgid "" "code from Python to C really does:" msgstr "" -#: extending/embedding.rst:105 +#: extending/embedding.rst:124 msgid "Convert data values from Python to C," msgstr "" -#: extending/embedding.rst:107 +#: extending/embedding.rst:126 msgid "Perform a function call to a C routine using the converted values, and" msgstr "" -#: extending/embedding.rst:109 +#: extending/embedding.rst:128 msgid "Convert the data values from the call from C to Python." msgstr "" -#: extending/embedding.rst:111 +#: extending/embedding.rst:130 msgid "When embedding Python, the interface code does:" msgstr "" -#: extending/embedding.rst:113 +#: extending/embedding.rst:132 msgid "Convert data values from C to Python," msgstr "" -#: extending/embedding.rst:115 +#: extending/embedding.rst:134 msgid "" "Perform a function call to a Python interface routine using the converted " "values, and" msgstr "" -#: extending/embedding.rst:118 +#: extending/embedding.rst:137 msgid "Convert the data values from the call from Python to C." msgstr "" -#: extending/embedding.rst:120 +#: extending/embedding.rst:139 msgid "" "As you can see, the data conversion steps are simply swapped to accommodate " "the different direction of the cross-language transfer. The only difference " @@ -184,7 +205,7 @@ msgid "" "you call a C routine, when embedding, you call a Python routine." msgstr "" -#: extending/embedding.rst:125 +#: extending/embedding.rst:144 msgid "" "This chapter will not discuss how to convert data from Python to C and vice " "versa. Also, proper use of references and dealing with errors is assumed to " @@ -192,11 +213,11 @@ msgid "" "interpreter, you can refer to earlier chapters for the required information." msgstr "" -#: extending/embedding.rst:134 +#: extending/embedding.rst:153 msgid "Pure Embedding" msgstr "" -#: extending/embedding.rst:136 +#: extending/embedding.rst:155 msgid "" "The first program aims to execute a function in a Python script. Like in the " "section about the very high level interface, the Python interpreter does not " @@ -204,11 +225,11 @@ msgid "" "section)." msgstr "" -#: extending/embedding.rst:141 +#: extending/embedding.rst:160 msgid "The code to run a function defined in a Python script is:" msgstr "" -#: extending/embedding.rst:143 +#: extending/embedding.rst:162 msgid "" "#define PY_SSIZE_T_CLEAN\n" "#include \n" @@ -284,7 +305,7 @@ msgid "" "}\n" msgstr "" -#: extending/embedding.rst:146 +#: extending/embedding.rst:165 msgid "" "This code loads a Python script using ``argv[1]``, and calls the function " "named in ``argv[2]``. Its integer arguments are the other values of the " @@ -293,7 +314,7 @@ msgid "" "a Python script, such as:" msgstr "" -#: extending/embedding.rst:152 +#: extending/embedding.rst:171 msgid "" "def multiply(a,b):\n" " print(\"Will compute\", a, \"times\", b)\n" @@ -303,25 +324,25 @@ msgid "" " return c" msgstr "" -#: extending/embedding.rst:161 +#: extending/embedding.rst:180 msgid "then the result should be:" msgstr "" -#: extending/embedding.rst:163 +#: extending/embedding.rst:182 msgid "" "$ call multiply multiply 3 2\n" "Will compute 3 times 2\n" "Result of call: 6" msgstr "" -#: extending/embedding.rst:169 +#: extending/embedding.rst:188 msgid "" "Although the program is quite large for its functionality, most of the code " "is for data conversion between Python and C, and for error reporting. The " "interesting part with respect to embedding Python starts with ::" msgstr "" -#: extending/embedding.rst:173 +#: extending/embedding.rst:192 msgid "" "Py_Initialize();\n" "pName = PyUnicode_DecodeFSDefault(argv[1]);\n" @@ -329,7 +350,7 @@ msgid "" "pModule = PyImport_Import(pName);" msgstr "" -#: extending/embedding.rst:178 +#: extending/embedding.rst:197 msgid "" "After initializing the interpreter, the script is loaded using :c:func:" "`PyImport_Import`. This routine needs a Python string as its argument, " @@ -337,7 +358,7 @@ msgid "" "conversion routine. ::" msgstr "" -#: extending/embedding.rst:183 +#: extending/embedding.rst:202 msgid "" "pFunc = PyObject_GetAttrString(pModule, argv[2]);\n" "/* pFunc is a new reference */\n" @@ -348,7 +369,7 @@ msgid "" "Py_XDECREF(pFunc);" msgstr "" -#: extending/embedding.rst:191 +#: extending/embedding.rst:210 msgid "" "Once the script is loaded, the name we're looking for is retrieved using :c:" "func:`PyObject_GetAttrString`. If the name exists, and the object returned " @@ -357,22 +378,22 @@ msgid "" "Python function is then made with::" msgstr "" -#: extending/embedding.rst:197 +#: extending/embedding.rst:216 msgid "pValue = PyObject_CallObject(pFunc, pArgs);" msgstr "" -#: extending/embedding.rst:199 +#: extending/embedding.rst:218 msgid "" "Upon return of the function, ``pValue`` is either ``NULL`` or it contains a " "reference to the return value of the function. Be sure to release the " "reference after examining the value." msgstr "" -#: extending/embedding.rst:207 +#: extending/embedding.rst:226 msgid "Extending Embedded Python" msgstr "" -#: extending/embedding.rst:209 +#: extending/embedding.rst:228 msgid "" "Until now, the embedded Python interpreter had no access to functionality " "from the application itself. The Python API allows this by extending the " @@ -384,7 +405,7 @@ msgid "" "like you would write a normal Python extension. For example::" msgstr "" -#: extending/embedding.rst:218 +#: extending/embedding.rst:237 msgid "" "static int numargs=0;\n" "\n" @@ -415,42 +436,42 @@ msgid "" "}" msgstr "" -#: extending/embedding.rst:246 +#: extending/embedding.rst:265 msgid "" "Insert the above code just above the :c:func:`main` function. Also, insert " "the following two statements before the call to :c:func:`Py_Initialize`::" msgstr "" -#: extending/embedding.rst:249 +#: extending/embedding.rst:268 msgid "" "numargs = argc;\n" "PyImport_AppendInittab(\"emb\", &PyInit_emb);" msgstr "" -#: extending/embedding.rst:252 +#: extending/embedding.rst:271 msgid "" "These two lines initialize the ``numargs`` variable, and make the :func:`!" "emb.numargs` function accessible to the embedded Python interpreter. With " "these extensions, the Python script can do things like" msgstr "" -#: extending/embedding.rst:256 +#: extending/embedding.rst:275 msgid "" "import emb\n" "print(\"Number of arguments\", emb.numargs())" msgstr "" -#: extending/embedding.rst:261 +#: extending/embedding.rst:280 msgid "" "In a real application, the methods will expose an API of the application to " "Python." msgstr "" -#: extending/embedding.rst:271 +#: extending/embedding.rst:290 msgid "Embedding Python in C++" msgstr "" -#: extending/embedding.rst:273 +#: extending/embedding.rst:292 msgid "" "It is also possible to embed Python in a C++ program; precisely how this is " "done will depend on the details of the C++ system used; in general you will " @@ -459,11 +480,11 @@ msgid "" "+." msgstr "" -#: extending/embedding.rst:282 +#: extending/embedding.rst:301 msgid "Compiling and Linking under Unix-like systems" msgstr "" -#: extending/embedding.rst:284 +#: extending/embedding.rst:303 msgid "" "It is not necessarily trivial to find the right flags to pass to your " "compiler (and linker) in order to embed the Python interpreter into your " @@ -471,7 +492,7 @@ msgid "" "implemented as C dynamic extensions (:file:`.so` files) linked against it." msgstr "" -#: extending/embedding.rst:290 +#: extending/embedding.rst:309 msgid "" "To find out the required compiler and linker flags, you can execute the :" "file:`python{X.Y}-config` script which is generated as part of the " @@ -480,33 +501,33 @@ msgid "" "directly useful to you:" msgstr "" -#: extending/embedding.rst:296 +#: extending/embedding.rst:315 msgid "" "``pythonX.Y-config --cflags`` will give you the recommended flags when " "compiling:" msgstr "" -#: extending/embedding.rst:299 +#: extending/embedding.rst:318 msgid "" "$ /opt/bin/python3.11-config --cflags\n" "-I/opt/include/python3.11 -I/opt/include/python3.11 -Wsign-compare -DNDEBUG " "-g -fwrapv -O3 -Wall" msgstr "" -#: extending/embedding.rst:304 +#: extending/embedding.rst:323 msgid "" "``pythonX.Y-config --ldflags --embed`` will give you the recommended flags " "when linking:" msgstr "" -#: extending/embedding.rst:307 +#: extending/embedding.rst:326 msgid "" "$ /opt/bin/python3.11-config --ldflags --embed\n" "-L/opt/lib/python3.11/config-3.11-x86_64-linux-gnu -L/opt/lib -lpython3.11 -" "lpthread -ldl -lutil -lm" msgstr "" -#: extending/embedding.rst:313 +#: extending/embedding.rst:332 msgid "" "To avoid confusion between several Python installations (and especially " "between the system Python and your own compiled Python), it is recommended " @@ -514,7 +535,7 @@ msgid "" "above example." msgstr "" -#: extending/embedding.rst:318 +#: extending/embedding.rst:337 msgid "" "If this procedure doesn't work for you (it is not guaranteed to work for all " "Unix-like platforms; however, we welcome :ref:`bug reports >> import sysconfig\n" ">>> sysconfig.get_config_var('LIBS')\n" diff --git a/extending/extending.po b/extending/extending.po index 7ff95048..d809854a 100644 --- a/extending/extending.po +++ b/extending/extending.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -87,7 +87,7 @@ msgstr "" msgid "The first two lines of our file can be::" msgstr "" -#: extending/extending.rst:60 +#: extending/extending.rst:663 msgid "" "#define PY_SSIZE_T_CLEAN\n" "#include " @@ -108,11 +108,13 @@ msgstr "" #: extending/extending.rst:72 msgid "" -"It is recommended to always define ``PY_SSIZE_T_CLEAN`` before including " -"``Python.h``. See :ref:`parsetuple` for a description of this macro." +"``#define PY_SSIZE_T_CLEAN`` was used to indicate that ``Py_ssize_t`` should " +"be used in some APIs instead of ``int``. It is not necessary since Python " +"3.13, but we keep it here for backward compatibility. See :ref:`arg-parsing-" +"string-and-buffers` for a description of this macro." msgstr "" -#: extending/extending.rst:75 +#: extending/extending.rst:77 msgid "" "All user-visible symbols defined by :file:`Python.h` have a prefix of ``Py`` " "or ``PY``, except those defined in standard header files. For convenience, " @@ -123,14 +125,14 @@ msgid "" "and :c:func:`realloc` directly." msgstr "" -#: extending/extending.rst:83 +#: extending/extending.rst:85 msgid "" "The next thing we add to our module file is the C function that will be " "called when the Python expression ``spam.system(string)`` is evaluated " "(we'll see shortly how it ends up being called)::" msgstr "" -#: extending/extending.rst:87 +#: extending/extending.rst:89 msgid "" "static PyObject *\n" "spam_system(PyObject *self, PyObject *args)\n" @@ -145,7 +147,7 @@ msgid "" "}" msgstr "" -#: extending/extending.rst:99 +#: extending/extending.rst:101 msgid "" "There is a straightforward translation from the argument list in Python (for " "example, the single expression ``\"ls -l\"``) to the arguments passed to the " @@ -153,13 +155,13 @@ msgid "" "*self* and *args*." msgstr "" -#: extending/extending.rst:104 +#: extending/extending.rst:106 msgid "" "The *self* argument points to the module object for module-level functions; " "for a method it would point to the object instance." msgstr "" -#: extending/extending.rst:107 +#: extending/extending.rst:109 msgid "" "The *args* argument will be a pointer to a Python tuple object containing " "the arguments. Each item of the tuple corresponds to an argument in the " @@ -171,7 +173,7 @@ msgid "" "variables into which to store the converted values. More about this later." msgstr "" -#: extending/extending.rst:116 +#: extending/extending.rst:118 msgid "" ":c:func:`PyArg_ParseTuple` returns true (nonzero) if all arguments have the " "right type and its components have been stored in the variables whose " @@ -181,11 +183,11 @@ msgid "" "example)." msgstr "" -#: extending/extending.rst:126 +#: extending/extending.rst:128 msgid "Intermezzo: Errors and Exceptions" msgstr "" -#: extending/extending.rst:128 +#: extending/extending.rst:130 msgid "" "An important convention throughout the Python interpreter is the following: " "when a function fails, it should set an exception condition and return an " @@ -197,13 +199,13 @@ msgid "" "important to know about them to understand how errors are passed around." msgstr "" -#: extending/extending.rst:137 +#: extending/extending.rst:139 msgid "" "The Python API defines a number of functions to set various types of " "exceptions." msgstr "" -#: extending/extending.rst:139 +#: extending/extending.rst:141 msgid "" "The most common one is :c:func:`PyErr_SetString`. Its arguments are an " "exception object and a C string. The exception object is usually a " @@ -212,7 +214,7 @@ msgid "" "and stored as the \"associated value\" of the exception." msgstr "" -#: extending/extending.rst:145 +#: extending/extending.rst:147 msgid "" "Another useful function is :c:func:`PyErr_SetFromErrno`, which only takes an " "exception argument and constructs the associated value by inspection of the " @@ -222,7 +224,7 @@ msgid "" "to any of these functions." msgstr "" -#: extending/extending.rst:152 +#: extending/extending.rst:154 msgid "" "You can test non-destructively whether an exception has been set with :c:" "func:`PyErr_Occurred`. This returns the current exception object, or " @@ -231,7 +233,7 @@ msgid "" "since you should be able to tell from the return value." msgstr "" -#: extending/extending.rst:158 +#: extending/extending.rst:160 msgid "" "When a function *f* that calls another function *g* detects that the latter " "fails, *f* should itself return an error value (usually ``NULL`` or " @@ -244,7 +246,7 @@ msgid "" "tries to find an exception handler specified by the Python programmer." msgstr "" -#: extending/extending.rst:168 +#: extending/extending.rst:170 msgid "" "(There are situations where a module can actually give a more detailed error " "message by calling another ``PyErr_*`` function, and in such cases it is " @@ -253,7 +255,7 @@ msgid "" "can fail for a variety of reasons.)" msgstr "" -#: extending/extending.rst:174 +#: extending/extending.rst:176 msgid "" "To ignore an exception set by a function call that failed, the exception " "condition must be cleared explicitly by calling :c:func:`PyErr_Clear`. The " @@ -262,7 +264,7 @@ msgid "" "itself (possibly by trying something else, or pretending nothing went wrong)." msgstr "" -#: extending/extending.rst:180 +#: extending/extending.rst:182 msgid "" "Every failing :c:func:`malloc` call must be turned into an exception --- the " "direct caller of :c:func:`malloc` (or :c:func:`realloc`) must call :c:func:" @@ -271,7 +273,7 @@ msgid "" "so this note is only relevant to those who call :c:func:`malloc` directly." msgstr "" -#: extending/extending.rst:186 +#: extending/extending.rst:188 msgid "" "Also note that, with the important exception of :c:func:`PyArg_ParseTuple` " "and friends, functions that return an integer status usually return a " @@ -279,14 +281,14 @@ msgid "" "calls." msgstr "" -#: extending/extending.rst:190 +#: extending/extending.rst:192 msgid "" "Finally, be careful to clean up garbage (by making :c:func:`Py_XDECREF` or :" "c:func:`Py_DECREF` calls for objects you have already created) when you " "return an error indicator!" msgstr "" -#: extending/extending.rst:194 +#: extending/extending.rst:196 msgid "" "The choice of which exception to raise is entirely yours. There are " "predeclared C objects corresponding to all built-in Python exceptions, such " @@ -299,23 +301,23 @@ msgid "" "satisfy other conditions, :c:data:`PyExc_ValueError` is appropriate." msgstr "" -#: extending/extending.rst:204 +#: extending/extending.rst:206 msgid "" "You can also define a new exception that is unique to your module. For this, " "you usually declare a static object variable at the beginning of your file::" msgstr "" -#: extending/extending.rst:207 +#: extending/extending.rst:209 msgid "static PyObject *SpamError;" msgstr "" -#: extending/extending.rst:209 +#: extending/extending.rst:211 msgid "" "and initialize it in your module's initialization function (:c:func:`!" "PyInit_spam`) with an exception object::" msgstr "" -#: extending/extending.rst:212 +#: extending/extending.rst:214 msgid "" "PyMODINIT_FUNC\n" "PyInit_spam(void)\n" @@ -327,9 +329,7 @@ msgid "" " return NULL;\n" "\n" " SpamError = PyErr_NewException(\"spam.error\", NULL, NULL);\n" -" Py_XINCREF(SpamError);\n" -" if (PyModule_AddObject(m, \"error\", SpamError) < 0) {\n" -" Py_XDECREF(SpamError);\n" +" if (PyModule_AddObjectRef(m, \"error\", SpamError) < 0) {\n" " Py_CLEAR(SpamError);\n" " Py_DECREF(m);\n" " return NULL;\n" @@ -575,14 +575,15 @@ msgstr "" #: extending/extending.rst:386 msgid "" +"#define PY_SSIZE_T_CLEAN\n" +"#include \n" +"\n" "int\n" "main(int argc, char *argv[])\n" "{\n" -" wchar_t *program = Py_DecodeLocale(argv[0], NULL);\n" -" if (program == NULL) {\n" -" fprintf(stderr, \"Fatal error: cannot decode argv[0]\\n\");\n" -" exit(1);\n" -" }\n" +" PyStatus status;\n" +" PyConfig config;\n" +" PyConfig_InitPythonConfig(&config);\n" "\n" " /* Add a built-in module, before Py_Initialize */\n" " if (PyImport_AppendInittab(\"spam\", PyInit_spam) == -1) {\n" @@ -592,11 +593,19 @@ msgid "" " }\n" "\n" " /* Pass argv[0] to the Python interpreter */\n" -" Py_SetProgramName(program);\n" +" status = PyConfig_SetBytesString(&config, &config.program_name, " +"argv[0]);\n" +" if (PyStatus_Exception(status)) {\n" +" goto exception;\n" +" }\n" "\n" " /* Initialize the Python interpreter. Required.\n" " If this step fails, it will be a fatal error. */\n" -" Py_Initialize();\n" +" status = Py_InitializeFromConfig(&config);\n" +" if (PyStatus_Exception(status)) {\n" +" goto exception;\n" +" }\n" +" PyConfig_Clear(&config);\n" "\n" " /* Optionally import the module; alternatively,\n" " import can be deferred until the embedded script\n" @@ -607,14 +616,17 @@ msgid "" " fprintf(stderr, \"Error: could not import module 'spam'\\n\");\n" " }\n" "\n" -" ...\n" +" // ... use Python C API here ...\n" "\n" -" PyMem_RawFree(program);\n" " return 0;\n" +"\n" +" exception:\n" +" PyConfig_Clear(&config);\n" +" Py_ExitStatusException(status);\n" "}" msgstr "" -#: extending/extending.rst:425 +#: extending/extending.rst:436 msgid "" "Removing entries from ``sys.modules`` or importing compiled modules into " "multiple interpreters within a process (or following a :c:func:`fork` " @@ -623,14 +635,14 @@ msgid "" "initializing internal data structures." msgstr "" -#: extending/extending.rst:431 +#: extending/extending.rst:442 msgid "" "A more substantial example module is included in the Python source " "distribution as :file:`Modules/xxmodule.c`. This file may be used as a " "template or simply read as an example." msgstr "" -#: extending/extending.rst:437 +#: extending/extending.rst:448 msgid "" "Unlike our ``spam`` example, ``xxmodule`` uses *multi-phase initialization* " "(new in Python 3.5), where a PyModuleDef structure is returned from " @@ -638,11 +650,11 @@ msgid "" "For details on multi-phase initialization, see :PEP:`489`." msgstr "" -#: extending/extending.rst:446 +#: extending/extending.rst:457 msgid "Compilation and Linkage" msgstr "" -#: extending/extending.rst:448 +#: extending/extending.rst:459 msgid "" "There are two more things to do before you can use your new extension: " "compiling and linking it with the Python system. If you use dynamic " @@ -652,7 +664,7 @@ msgid "" "Windows (chapter :ref:`building-on-windows`) for more information about this." msgstr "" -#: extending/extending.rst:455 +#: extending/extending.rst:466 msgid "" "If you can't use dynamic loading, or if you want to make your module a " "permanent part of the Python interpreter, you will have to change the " @@ -662,11 +674,11 @@ msgid "" "line to the file :file:`Modules/Setup.local` describing your file:" msgstr "" -#: extending/extending.rst:462 +#: extending/extending.rst:473 msgid "spam spammodule.o" msgstr "" -#: extending/extending.rst:466 +#: extending/extending.rst:477 msgid "" "and rebuild the interpreter by running :program:`make` in the toplevel " "directory. You can also run :program:`make` in the :file:`Modules/` " @@ -675,21 +687,21 @@ msgid "" "the :file:`Setup` file.)" msgstr "" -#: extending/extending.rst:472 +#: extending/extending.rst:483 msgid "" "If your module requires additional libraries to link with, these can be " "listed on the line in the configuration file as well, for instance:" msgstr "" -#: extending/extending.rst:475 +#: extending/extending.rst:486 msgid "spam spammodule.o -lX11" msgstr "" -#: extending/extending.rst:483 +#: extending/extending.rst:494 msgid "Calling Python Functions from C" msgstr "" -#: extending/extending.rst:485 +#: extending/extending.rst:496 msgid "" "So far we have concentrated on making C functions callable from Python. The " "reverse is also useful: calling Python functions from C. This is especially " @@ -700,7 +712,7 @@ msgid "" "uses are also imaginable." msgstr "" -#: extending/extending.rst:493 +#: extending/extending.rst:504 msgid "" "Fortunately, the Python interpreter is easily called recursively, and there " "is a standard interface to call a Python function. (I won't dwell on how to " @@ -709,7 +721,7 @@ msgid "" "line option in :file:`Modules/main.c` from the Python source code.)" msgstr "" -#: extending/extending.rst:499 +#: extending/extending.rst:510 msgid "" "Calling a Python function is easy. First, the Python program must somehow " "pass you the Python function object. You should provide a function (or some " @@ -719,7 +731,7 @@ msgid "" "function might be part of a module definition::" msgstr "" -#: extending/extending.rst:506 +#: extending/extending.rst:517 msgid "" "static PyObject *my_callback = NULL;\n" "\n" @@ -746,7 +758,7 @@ msgid "" "}" msgstr "" -#: extending/extending.rst:529 +#: extending/extending.rst:540 msgid "" "This function must be registered with the interpreter using the :c:macro:" "`METH_VARARGS` flag; this is described in section :ref:`methodtable`. The :" @@ -754,7 +766,7 @@ msgid "" "section :ref:`parsetuple`." msgstr "" -#: extending/extending.rst:534 +#: extending/extending.rst:545 msgid "" "The macros :c:func:`Py_XINCREF` and :c:func:`Py_XDECREF` increment/decrement " "the reference count of an object and are safe in the presence of ``NULL`` " @@ -762,7 +774,7 @@ msgid "" "info on them in section :ref:`refcounts`." msgstr "" -#: extending/extending.rst:541 +#: extending/extending.rst:552 msgid "" "Later, when it is time to call the function, you call the C function :c:func:" "`PyObject_CallObject`. This function has two arguments, both pointers to " @@ -774,7 +786,7 @@ msgid "" "or more format codes between parentheses. For example::" msgstr "" -#: extending/extending.rst:550 +#: extending/extending.rst:561 msgid "" "int arg;\n" "PyObject *arglist;\n" @@ -788,7 +800,7 @@ msgid "" "Py_DECREF(arglist);" msgstr "" -#: extending/extending.rst:561 +#: extending/extending.rst:572 msgid "" ":c:func:`PyObject_CallObject` returns a Python object pointer: this is the " "return value of the Python function. :c:func:`PyObject_CallObject` is " @@ -797,7 +809,7 @@ msgid "" "`Py_DECREF`\\ -ed immediately after the :c:func:`PyObject_CallObject` call." msgstr "" -#: extending/extending.rst:568 +#: extending/extending.rst:579 msgid "" "The return value of :c:func:`PyObject_CallObject` is \"new\": either it is a " "brand new object, or it is an existing object whose reference count has been " @@ -806,7 +818,7 @@ msgid "" "not interested in its value." msgstr "" -#: extending/extending.rst:574 +#: extending/extending.rst:585 msgid "" "Before you do this, however, it is important to check that the return value " "isn't ``NULL``. If it is, the Python function terminated by raising an " @@ -817,7 +829,7 @@ msgid "" "should be cleared by calling :c:func:`PyErr_Clear`. For example::" msgstr "" -#: extending/extending.rst:582 +#: extending/extending.rst:593 msgid "" "if (result == NULL)\n" " return NULL; /* Pass error back */\n" @@ -825,7 +837,7 @@ msgid "" "Py_DECREF(result);" msgstr "" -#: extending/extending.rst:587 +#: extending/extending.rst:598 msgid "" "Depending on the desired interface to the Python callback function, you may " "also have to provide an argument list to :c:func:`PyObject_CallObject`. In " @@ -837,7 +849,7 @@ msgid "" "you want to pass an integral event code, you might use the following code::" msgstr "" -#: extending/extending.rst:596 +#: extending/extending.rst:607 msgid "" "PyObject *arglist;\n" "...\n" @@ -850,7 +862,7 @@ msgid "" "Py_DECREF(result);" msgstr "" -#: extending/extending.rst:606 +#: extending/extending.rst:617 msgid "" "Note the placement of ``Py_DECREF(arglist)`` immediately after the call, " "before the error check! Also note that strictly speaking this code is not " @@ -858,14 +870,14 @@ msgid "" "checked." msgstr "" -#: extending/extending.rst:610 +#: extending/extending.rst:621 msgid "" "You may also call a function with keyword arguments by using :c:func:" "`PyObject_Call`, which supports arguments and keyword arguments. As in the " "above example, we use :c:func:`Py_BuildValue` to construct the dictionary. ::" msgstr "" -#: extending/extending.rst:614 +#: extending/extending.rst:625 msgid "" "PyObject *dict;\n" "...\n" @@ -878,19 +890,19 @@ msgid "" "Py_DECREF(result);" msgstr "" -#: extending/extending.rst:628 +#: extending/extending.rst:639 msgid "Extracting Parameters in Extension Functions" msgstr "" -#: extending/extending.rst:632 +#: extending/extending.rst:643 msgid "The :c:func:`PyArg_ParseTuple` function is declared as follows::" msgstr "" -#: extending/extending.rst:634 +#: extending/extending.rst:645 msgid "int PyArg_ParseTuple(PyObject *arg, const char *format, ...);" msgstr "" -#: extending/extending.rst:636 +#: extending/extending.rst:647 msgid "" "The *arg* argument must be a tuple object containing an argument list passed " "from Python to a C function. The *format* argument must be a format string, " @@ -899,7 +911,7 @@ msgid "" "whose type is determined by the format string." msgstr "" -#: extending/extending.rst:642 +#: extending/extending.rst:653 msgid "" "Note that while :c:func:`PyArg_ParseTuple` checks that the Python arguments " "have the required types, it cannot check the validity of the addresses of C " @@ -907,23 +919,17 @@ msgid "" "probably crash or at least overwrite random bits in memory. So be careful!" msgstr "" -#: extending/extending.rst:647 +#: extending/extending.rst:658 msgid "" "Note that any Python object references which are provided to the caller are " "*borrowed* references; do not decrement their reference count!" msgstr "" -#: extending/extending.rst:650 +#: extending/extending.rst:661 msgid "Some example calls::" msgstr "" -#: extending/extending.rst:652 -msgid "" -"#define PY_SSIZE_T_CLEAN /* Make \"s#\" use Py_ssize_t rather than int. */\n" -"#include " -msgstr "" - -#: extending/extending.rst:657 +#: extending/extending.rst:668 msgid "" "int ok;\n" "int i, j;\n" @@ -935,27 +941,27 @@ msgid "" " /* Python call: f() */" msgstr "" -#: extending/extending.rst:668 +#: extending/extending.rst:679 msgid "" "ok = PyArg_ParseTuple(args, \"s\", &s); /* A string */\n" " /* Possible Python call: f('whoops!') */" msgstr "" -#: extending/extending.rst:673 +#: extending/extending.rst:684 msgid "" "ok = PyArg_ParseTuple(args, \"lls\", &k, &l, &s); /* Two longs and a string " "*/\n" " /* Possible Python call: f(1, 2, 'three') */" msgstr "" -#: extending/extending.rst:678 +#: extending/extending.rst:689 msgid "" "ok = PyArg_ParseTuple(args, \"(ii)s#\", &i, &j, &s, &size);\n" " /* A pair of ints and a string, whose size is also returned */\n" " /* Possible Python call: f((1, 2), 'three') */" msgstr "" -#: extending/extending.rst:684 +#: extending/extending.rst:695 msgid "" "{\n" " const char *file;\n" @@ -970,7 +976,7 @@ msgid "" "}" msgstr "" -#: extending/extending.rst:698 +#: extending/extending.rst:709 msgid "" "{\n" " int left, top, right, bottom, h, v;\n" @@ -982,7 +988,7 @@ msgid "" "}" msgstr "" -#: extending/extending.rst:709 +#: extending/extending.rst:720 msgid "" "{\n" " Py_complex c;\n" @@ -992,22 +998,23 @@ msgid "" "}" msgstr "" -#: extending/extending.rst:720 +#: extending/extending.rst:731 msgid "Keyword Parameters for Extension Functions" msgstr "" -#: extending/extending.rst:724 +#: extending/extending.rst:735 msgid "" "The :c:func:`PyArg_ParseTupleAndKeywords` function is declared as follows::" msgstr "" -#: extending/extending.rst:726 +#: extending/extending.rst:737 msgid "" "int PyArg_ParseTupleAndKeywords(PyObject *arg, PyObject *kwdict,\n" -" const char *format, char *kwlist[], ...);" +" const char *format, char * const " +"*kwlist, ...);" msgstr "" -#: extending/extending.rst:729 +#: extending/extending.rst:740 msgid "" "The *arg* and *format* parameters are identical to those of the :c:func:" "`PyArg_ParseTuple` function. The *kwdict* parameter is the dictionary of " @@ -1019,22 +1026,22 @@ msgid "" "raises an appropriate exception." msgstr "" -#: extending/extending.rst:739 +#: extending/extending.rst:750 msgid "" "Nested tuples cannot be parsed when using keyword arguments! Keyword " "parameters passed in which are not present in the *kwlist* will cause :exc:" "`TypeError` to be raised." msgstr "" -#: extending/extending.rst:745 +#: extending/extending.rst:756 msgid "" "Here is an example module which uses keywords, based on an example by Geoff " "Philbrick (philbrick@hks.com)::" msgstr "" -#: extending/extending.rst:748 +#: extending/extending.rst:759 msgid "" -"#define PY_SSIZE_T_CLEAN /* Make \"s#\" use Py_ssize_t rather than int. */\n" +"#define PY_SSIZE_T_CLEAN\n" "#include \n" "\n" "static PyObject *\n" @@ -1086,21 +1093,21 @@ msgid "" "}" msgstr "" -#: extending/extending.rst:800 +#: extending/extending.rst:811 msgid "Building Arbitrary Values" msgstr "" -#: extending/extending.rst:802 +#: extending/extending.rst:813 msgid "" "This function is the counterpart to :c:func:`PyArg_ParseTuple`. It is " "declared as follows::" msgstr "" -#: extending/extending.rst:805 +#: extending/extending.rst:816 msgid "PyObject *Py_BuildValue(const char *format, ...);" msgstr "" -#: extending/extending.rst:807 +#: extending/extending.rst:818 msgid "" "It recognizes a set of format units similar to the ones recognized by :c:" "func:`PyArg_ParseTuple`, but the arguments (which are input to the function, " @@ -1108,7 +1115,7 @@ msgid "" "object, suitable for returning from a C function called from Python." msgstr "" -#: extending/extending.rst:812 +#: extending/extending.rst:823 msgid "" "One difference with :c:func:`PyArg_ParseTuple`: while the latter requires " "its first argument to be a tuple (since Python argument lists are always " @@ -1120,12 +1127,12 @@ msgid "" "parenthesize the format string." msgstr "" -#: extending/extending.rst:820 +#: extending/extending.rst:831 msgid "" "Examples (to the left the call, to the right the resulting Python value):" msgstr "" -#: extending/extending.rst:822 +#: extending/extending.rst:833 msgid "" "Py_BuildValue(\"\") None\n" "Py_BuildValue(\"i\", 123) 123\n" @@ -1146,11 +1153,11 @@ msgid "" " 1, 2, 3, 4, 5, 6) (((1, 2), (3, 4)), (5, 6))" msgstr "" -#: extending/extending.rst:846 +#: extending/extending.rst:857 msgid "Reference Counts" msgstr "" -#: extending/extending.rst:848 +#: extending/extending.rst:859 msgid "" "In languages like C or C++, the programmer is responsible for dynamic " "allocation and deallocation of memory on the heap. In C, this is done using " @@ -1159,7 +1166,7 @@ msgid "" "restrict the following discussion to the C case." msgstr "" -#: extending/extending.rst:854 +#: extending/extending.rst:865 msgid "" "Every block of memory allocated with :c:func:`malloc` should eventually be " "returned to the pool of available memory by exactly one call to :c:func:" @@ -1174,7 +1181,7 @@ msgid "" "crashes." msgstr "" -#: extending/extending.rst:865 +#: extending/extending.rst:876 msgid "" "Common causes of memory leaks are unusual paths through the code. For " "instance, a function may allocate a block of memory, do some calculation, " @@ -1191,7 +1198,7 @@ msgid "" "of errors." msgstr "" -#: extending/extending.rst:878 +#: extending/extending.rst:889 msgid "" "Since Python makes heavy use of :c:func:`malloc` and :c:func:`free`, it " "needs a strategy to avoid memory leaks as well as the use of freed memory. " @@ -1202,7 +1209,7 @@ msgid "" "reference to the object has been deleted and the object is freed." msgstr "" -#: extending/extending.rst:886 +#: extending/extending.rst:897 msgid "" "An alternative strategy is called :dfn:`automatic garbage collection`. " "(Sometimes, reference counting is also referred to as a garbage collection " @@ -1218,7 +1225,7 @@ msgid "" "with reference counts." msgstr "" -#: extending/extending.rst:898 +#: extending/extending.rst:909 msgid "" "While Python uses the traditional reference counting implementation, it also " "offers a cycle detector that works to detect reference cycles. This allows " @@ -1232,7 +1239,7 @@ msgid "" "though there are no further references to the cycle itself." msgstr "" -#: extending/extending.rst:909 +#: extending/extending.rst:920 msgid "" "The cycle detector is able to detect garbage cycles and can reclaim them. " "The :mod:`gc` module exposes a way to run the detector (the :func:`~gc." @@ -1240,11 +1247,11 @@ msgid "" "disable the detector at runtime." msgstr "" -#: extending/extending.rst:918 +#: extending/extending.rst:929 msgid "Reference Counting in Python" msgstr "" -#: extending/extending.rst:920 +#: extending/extending.rst:931 msgid "" "There are two macros, ``Py_INCREF(x)`` and ``Py_DECREF(x)``, which handle " "the incrementing and decrementing of the reference count. :c:func:" @@ -1255,7 +1262,7 @@ msgid "" "object." msgstr "" -#: extending/extending.rst:927 +#: extending/extending.rst:938 msgid "" "The big question now remains: when to use ``Py_INCREF(x)`` and " "``Py_DECREF(x)``? Let's first introduce some terms. Nobody \"owns\" an " @@ -1268,7 +1275,7 @@ msgid "" "reference creates a memory leak." msgstr "" -#: extending/extending.rst:936 +#: extending/extending.rst:947 msgid "" "It is also possible to :dfn:`borrow` [#]_ a reference to an object. The " "borrower of a reference should not call :c:func:`Py_DECREF`. The borrower " @@ -1277,7 +1284,7 @@ msgid "" "risks using freed memory and should be avoided completely [#]_." msgstr "" -#: extending/extending.rst:942 +#: extending/extending.rst:953 msgid "" "The advantage of borrowing over owning a reference is that you don't need to " "take care of disposing of the reference on all possible paths through the " @@ -1288,7 +1295,7 @@ msgid "" "borrowed has in fact disposed of it." msgstr "" -#: extending/extending.rst:950 +#: extending/extending.rst:961 msgid "" "A borrowed reference can be changed into an owned reference by calling :c:" "func:`Py_INCREF`. This does not affect the status of the owner from which " @@ -1297,18 +1304,18 @@ msgid "" "properly, as well as the previous owner)." msgstr "" -#: extending/extending.rst:960 +#: extending/extending.rst:971 msgid "Ownership Rules" msgstr "" -#: extending/extending.rst:962 +#: extending/extending.rst:973 msgid "" "Whenever an object reference is passed into or out of a function, it is part " "of the function's interface specification whether ownership is transferred " "with the reference or not." msgstr "" -#: extending/extending.rst:966 +#: extending/extending.rst:977 msgid "" "Most functions that return a reference to an object pass on ownership with " "the reference. In particular, all functions whose function it is to create " @@ -1319,7 +1326,7 @@ msgid "" "reference to a cached item." msgstr "" -#: extending/extending.rst:974 +#: extending/extending.rst:985 msgid "" "Many functions that extract objects from other objects also transfer " "ownership with the reference, for instance :c:func:" @@ -1330,14 +1337,14 @@ msgid "" "list or dictionary." msgstr "" -#: extending/extending.rst:981 +#: extending/extending.rst:992 msgid "" "The function :c:func:`PyImport_AddModule` also returns a borrowed reference, " "even though it may actually create the object it returns: this is possible " "because an owned reference to the object is stored in ``sys.modules``." msgstr "" -#: extending/extending.rst:985 +#: extending/extending.rst:996 msgid "" "When you pass an object reference into another function, in general, the " "function borrows the reference from you --- if it needs to store it, it will " @@ -1348,7 +1355,7 @@ msgid "" "don't take over ownership --- they are \"normal.\")" msgstr "" -#: extending/extending.rst:993 +#: extending/extending.rst:1004 msgid "" "When a C function is called from Python, it borrows references to its " "arguments from the caller. The caller owns a reference to the object, so " @@ -1357,18 +1364,18 @@ msgid "" "turned into an owned reference by calling :c:func:`Py_INCREF`." msgstr "" -#: extending/extending.rst:999 +#: extending/extending.rst:1010 msgid "" "The object reference returned from a C function that is called from Python " "must be an owned reference --- ownership is transferred from the function to " "its caller." msgstr "" -#: extending/extending.rst:1007 +#: extending/extending.rst:1018 msgid "Thin Ice" msgstr "" -#: extending/extending.rst:1009 +#: extending/extending.rst:1020 msgid "" "There are a few situations where seemingly harmless use of a borrowed " "reference can lead to problems. These all have to do with implicit " @@ -1376,14 +1383,14 @@ msgid "" "dispose of it." msgstr "" -#: extending/extending.rst:1013 +#: extending/extending.rst:1024 msgid "" "The first and most important case to know about is using :c:func:`Py_DECREF` " "on an unrelated object while borrowing a reference to a list item. For " "instance::" msgstr "" -#: extending/extending.rst:1016 +#: extending/extending.rst:1027 msgid "" "void\n" "bug(PyObject *list)\n" @@ -1395,14 +1402,14 @@ msgid "" "}" msgstr "" -#: extending/extending.rst:1025 +#: extending/extending.rst:1036 msgid "" "This function first borrows a reference to ``list[0]``, then replaces " "``list[1]`` with the value ``0``, and finally prints the borrowed reference. " "Looks harmless, right? But it's not!" msgstr "" -#: extending/extending.rst:1029 +#: extending/extending.rst:1040 msgid "" "Let's follow the control flow into :c:func:`PyList_SetItem`. The list owns " "references to all its items, so when item 1 is replaced, it has to dispose " @@ -1412,7 +1419,7 @@ msgid "" "count of 1, disposing of it will call its :meth:`!__del__` method." msgstr "" -#: extending/extending.rst:1036 +#: extending/extending.rst:1047 msgid "" "Since it is written in Python, the :meth:`!__del__` method can execute " "arbitrary Python code. Could it perhaps do something to invalidate the " @@ -1423,13 +1430,13 @@ msgid "" "associated with it, thereby invalidating ``item``." msgstr "" -#: extending/extending.rst:1044 +#: extending/extending.rst:1055 msgid "" "The solution, once you know the source of the problem, is easy: temporarily " "increment the reference count. The correct version of the function reads::" msgstr "" -#: extending/extending.rst:1047 +#: extending/extending.rst:1058 msgid "" "void\n" "no_bug(PyObject *list)\n" @@ -1443,14 +1450,14 @@ msgid "" "}" msgstr "" -#: extending/extending.rst:1058 +#: extending/extending.rst:1069 msgid "" "This is a true story. An older version of Python contained variants of this " "bug and someone spent a considerable amount of time in a C debugger to " "figure out why his :meth:`!__del__` methods would fail..." msgstr "" -#: extending/extending.rst:1062 +#: extending/extending.rst:1073 msgid "" "The second case of problems with a borrowed reference is a variant involving " "threads. Normally, multiple threads in the Python interpreter can't get in " @@ -1463,7 +1470,7 @@ msgid "" "previous one::" msgstr "" -#: extending/extending.rst:1071 +#: extending/extending.rst:1082 msgid "" "void\n" "bug(PyObject *list)\n" @@ -1476,11 +1483,11 @@ msgid "" "}" msgstr "" -#: extending/extending.rst:1085 +#: extending/extending.rst:1096 msgid "NULL Pointers" msgstr "" -#: extending/extending.rst:1087 +#: extending/extending.rst:1098 msgid "" "In general, functions that take object references as arguments do not expect " "you to pass them ``NULL`` pointers, and will dump core (or cause later core " @@ -1492,21 +1499,21 @@ msgid "" "more slowly." msgstr "" -#: extending/extending.rst:1095 +#: extending/extending.rst:1106 msgid "" "It is better to test for ``NULL`` only at the \"source:\" when a pointer " "that may be ``NULL`` is received, for example, from :c:func:`malloc` or from " "a function that may raise an exception." msgstr "" -#: extending/extending.rst:1099 +#: extending/extending.rst:1110 msgid "" "The macros :c:func:`Py_INCREF` and :c:func:`Py_DECREF` do not check for " "``NULL`` pointers --- however, their variants :c:func:`Py_XINCREF` and :c:" "func:`Py_XDECREF` do." msgstr "" -#: extending/extending.rst:1103 +#: extending/extending.rst:1114 msgid "" "The macros for checking for a particular object type (``Pytype_Check()``) " "don't check for ``NULL`` pointers --- again, there is much code that calls " @@ -1515,24 +1522,24 @@ msgid "" "variants with ``NULL`` checking." msgstr "" -#: extending/extending.rst:1109 +#: extending/extending.rst:1120 msgid "" "The C function calling mechanism guarantees that the argument list passed to " "C functions (``args`` in the examples) is never ``NULL`` --- in fact it " "guarantees that it is always a tuple [#]_." msgstr "" -#: extending/extending.rst:1113 +#: extending/extending.rst:1124 msgid "" "It is a severe error to ever let a ``NULL`` pointer \"escape\" to the Python " "user." msgstr "" -#: extending/extending.rst:1124 +#: extending/extending.rst:1135 msgid "Writing Extensions in C++" msgstr "" -#: extending/extending.rst:1126 +#: extending/extending.rst:1137 msgid "" "It is possible to write extension modules in C++. Some restrictions apply. " "If the main program (the Python interpreter) is compiled and linked by the C " @@ -1545,11 +1552,11 @@ msgid "" "(all recent C++ compilers define this symbol)." msgstr "" -#: extending/extending.rst:1140 +#: extending/extending.rst:1151 msgid "Providing a C API for an Extension Module" msgstr "" -#: extending/extending.rst:1145 +#: extending/extending.rst:1156 msgid "" "Many extension modules just provide new functions and types to be used from " "Python, but sometimes the code in an extension module can be useful for " @@ -1560,7 +1567,7 @@ msgid "" "functions for direct manipulation from other extension modules." msgstr "" -#: extending/extending.rst:1153 +#: extending/extending.rst:1164 msgid "" "At first sight this seems easy: just write the functions (without declaring " "them ``static``, of course), provide an appropriate header file, and " @@ -1576,7 +1583,7 @@ msgid "" "call might not have been loaded yet!" msgstr "" -#: extending/extending.rst:1165 +#: extending/extending.rst:1176 msgid "" "Portability therefore requires not to make any assumptions about symbol " "visibility. This means that all symbols in extension modules should be " @@ -1586,7 +1593,7 @@ msgid "" "accessible from other extension modules must be exported in a different way." msgstr "" -#: extending/extending.rst:1172 +#: extending/extending.rst:1183 msgid "" "Python provides a special mechanism to pass C-level information (pointers) " "from one extension module to another one: Capsules. A Capsule is a Python " @@ -1598,7 +1605,7 @@ msgid "" "the Capsule." msgstr "" -#: extending/extending.rst:1180 +#: extending/extending.rst:1191 msgid "" "There are many ways in which Capsules can be used to export the C API of an " "extension module. Each function could get its own Capsule, or all C API " @@ -1608,7 +1615,7 @@ msgid "" "client modules." msgstr "" -#: extending/extending.rst:1186 +#: extending/extending.rst:1197 msgid "" "Whichever method you choose, it's important to name your Capsules properly. " "The function :c:func:`PyCapsule_New` takes a name parameter (:c:expr:`const " @@ -1618,17 +1625,17 @@ msgid "" "from another." msgstr "" -#: extending/extending.rst:1193 +#: extending/extending.rst:1204 msgid "" "In particular, Capsules used to expose C APIs should be given a name " "following this convention::" msgstr "" -#: extending/extending.rst:1196 +#: extending/extending.rst:1207 msgid "modulename.attributename" msgstr "" -#: extending/extending.rst:1198 +#: extending/extending.rst:1209 msgid "" "The convenience function :c:func:`PyCapsule_Import` makes it easy to load a " "C API provided via a Capsule, but only if the Capsule's name matches this " @@ -1636,7 +1643,7 @@ msgid "" "the Capsule they load contains the correct C API." msgstr "" -#: extending/extending.rst:1203 +#: extending/extending.rst:1214 msgid "" "The following example demonstrates an approach that puts most of the burden " "on the writer of the exporting module, which is appropriate for commonly " @@ -1647,7 +1654,7 @@ msgid "" "modules only have to call this macro before accessing the C API." msgstr "" -#: extending/extending.rst:1211 +#: extending/extending.rst:1222 msgid "" "The exporting module is a modification of the :mod:`!spam` module from " "section :ref:`extending-simpleexample`. The function :func:`!spam.system` " @@ -1658,13 +1665,13 @@ msgid "" "modules." msgstr "" -#: extending/extending.rst:1218 +#: extending/extending.rst:1229 msgid "" "The function :c:func:`!PySpam_System` is a plain C function, declared " "``static`` like everything else::" msgstr "" -#: extending/extending.rst:1221 +#: extending/extending.rst:1232 msgid "" "static int\n" "PySpam_System(const char *command)\n" @@ -1673,11 +1680,11 @@ msgid "" "}" msgstr "" -#: extending/extending.rst:1227 +#: extending/extending.rst:1238 msgid "The function :c:func:`!spam_system` is modified in a trivial way::" msgstr "" -#: extending/extending.rst:1229 +#: extending/extending.rst:1240 msgid "" "static PyObject *\n" "spam_system(PyObject *self, PyObject *args)\n" @@ -1692,25 +1699,25 @@ msgid "" "}" msgstr "" -#: extending/extending.rst:1241 +#: extending/extending.rst:1252 msgid "In the beginning of the module, right after the line ::" msgstr "" -#: extending/extending.rst:1243 +#: extending/extending.rst:1254 msgid "#include " msgstr "" -#: extending/extending.rst:1245 +#: extending/extending.rst:1256 msgid "two more lines must be added::" msgstr "" -#: extending/extending.rst:1247 +#: extending/extending.rst:1258 msgid "" "#define SPAM_MODULE\n" "#include \"spammodule.h\"" msgstr "" -#: extending/extending.rst:1250 +#: extending/extending.rst:1261 msgid "" "The ``#define`` is used to tell the header file that it is being included in " "the exporting module, not a client module. Finally, the module's " @@ -1718,7 +1725,7 @@ msgid "" "array::" msgstr "" -#: extending/extending.rst:1254 +#: extending/extending.rst:1265 msgid "" "PyMODINIT_FUNC\n" "PyInit_spam(void)\n" @@ -1738,8 +1745,7 @@ msgid "" " c_api_object = PyCapsule_New((void *)PySpam_API, \"spam._C_API\", " "NULL);\n" "\n" -" if (PyModule_AddObject(m, \"_C_API\", c_api_object) < 0) {\n" -" Py_XDECREF(c_api_object);\n" +" if (PyModule_Add(m, \"_C_API\", c_api_object) < 0) {\n" " Py_DECREF(m);\n" " return NULL;\n" " }\n" @@ -1748,19 +1754,19 @@ msgid "" "}" msgstr "" -#: extending/extending.rst:1280 +#: extending/extending.rst:1290 msgid "" "Note that ``PySpam_API`` is declared ``static``; otherwise the pointer array " "would disappear when :c:func:`!PyInit_spam` terminates!" msgstr "" -#: extending/extending.rst:1283 +#: extending/extending.rst:1293 msgid "" "The bulk of the work is in the header file :file:`spammodule.h`, which looks " "like this::" msgstr "" -#: extending/extending.rst:1286 +#: extending/extending.rst:1296 msgid "" "#ifndef Py_SPAMMODULE_H\n" "#define Py_SPAMMODULE_H\n" @@ -1812,14 +1818,14 @@ msgid "" "#endif /* !defined(Py_SPAMMODULE_H) */" msgstr "" -#: extending/extending.rst:1334 +#: extending/extending.rst:1344 msgid "" "All that a client module must do in order to have access to the function :c:" "func:`!PySpam_System` is to call the function (or rather macro) :c:func:`!" "import_spam` in its initialization function::" msgstr "" -#: extending/extending.rst:1338 +#: extending/extending.rst:1348 msgid "" "PyMODINIT_FUNC\n" "PyInit_client(void)\n" @@ -1836,14 +1842,14 @@ msgid "" "}" msgstr "" -#: extending/extending.rst:1352 +#: extending/extending.rst:1362 msgid "" "The main disadvantage of this approach is that the file :file:`spammodule.h` " "is rather complicated. However, the basic structure is the same for each " "function that is exported, so it has to be learned only once." msgstr "" -#: extending/extending.rst:1356 +#: extending/extending.rst:1366 msgid "" "Finally it should be mentioned that Capsules offer additional functionality, " "which is especially useful for memory allocation and deallocation of the " @@ -1853,47 +1859,47 @@ msgid "" "in the Python source code distribution)." msgstr "" -#: extending/extending.rst:1364 +#: extending/extending.rst:1374 msgid "Footnotes" msgstr "" -#: extending/extending.rst:1365 +#: extending/extending.rst:1375 msgid "" "An interface for this function already exists in the standard module :mod:" "`os` --- it was chosen as a simple and straightforward example." msgstr "" -#: extending/extending.rst:1368 +#: extending/extending.rst:1378 msgid "" "The metaphor of \"borrowing\" a reference is not completely correct: the " "owner still has a copy of the reference." msgstr "" -#: extending/extending.rst:1371 +#: extending/extending.rst:1381 msgid "" "Checking that the reference count is at least 1 **does not work** --- the " "reference count itself could be in freed memory and may thus be reused for " "another object!" msgstr "" -#: extending/extending.rst:1375 +#: extending/extending.rst:1385 msgid "" "These guarantees don't hold when you use the \"old\" style calling " "convention --- this is still found in much existing code." msgstr "" -#: extending/extending.rst:539 +#: extending/extending.rst:550 msgid "PyObject_CallObject (C function)" msgstr "" -#: extending/extending.rst:630 +#: extending/extending.rst:641 msgid "PyArg_ParseTuple (C function)" msgstr "" -#: extending/extending.rst:722 +#: extending/extending.rst:733 msgid "PyArg_ParseTupleAndKeywords (C function)" msgstr "" -#: extending/extending.rst:743 +#: extending/extending.rst:754 msgid "Philbrick, Geoff" msgstr "" diff --git a/extending/index.po b/extending/index.po index 66ae6659..04ccbed9 100644 --- a/extending/index.po +++ b/extending/index.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" diff --git a/extending/newtypes.po b/extending/newtypes.po index ea2ff458..97631f0c 100644 --- a/extending/newtypes.po +++ b/extending/newtypes.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -718,7 +718,7 @@ msgstr "" #: extending/newtypes.rst:451 msgid "" -":c:type:`!Py_hash_t` is a signed integer type with a platform-varying width. " +":c:type:`Py_hash_t` is a signed integer type with a platform-varying width. " "Returning ``-1`` from :c:member:`~PyTypeObject.tp_hash` indicates an error, " "which is why you should be careful to avoid returning it when hash " "computation is successful, as seen above." diff --git a/extending/newtypes_tutorial.po b/extending/newtypes_tutorial.po index 4145b0b0..5fc045f4 100644 --- a/extending/newtypes_tutorial.po +++ b/extending/newtypes_tutorial.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -105,9 +105,8 @@ msgid "" " if (m == NULL)\n" " return NULL;\n" "\n" -" Py_INCREF(&CustomType);\n" -" if (PyModule_AddObject(m, \"Custom\", (PyObject *) &CustomType) < 0) {\n" -" Py_DECREF(&CustomType);\n" +" if (PyModule_AddObjectRef(m, \"Custom\", (PyObject *) &CustomType) < 0) " +"{\n" " Py_DECREF(m);\n" " return NULL;\n" " }\n" @@ -342,33 +341,31 @@ msgstr "" #: extending/newtypes_tutorial.rst:183 msgid "" -"Py_INCREF(&CustomType);\n" -"if (PyModule_AddObject(m, \"Custom\", (PyObject *) &CustomType) < 0) {\n" -" Py_DECREF(&CustomType);\n" +"if (PyModule_AddObjectRef(m, \"Custom\", (PyObject *) &CustomType) < 0) {\n" " Py_DECREF(m);\n" " return NULL;\n" "}" msgstr "" -#: extending/newtypes_tutorial.rst:190 +#: extending/newtypes_tutorial.rst:188 msgid "" "This adds the type to the module dictionary. This allows us to create :" "class:`!Custom` instances by calling the :class:`!Custom` class:" msgstr "" -#: extending/newtypes_tutorial.rst:193 +#: extending/newtypes_tutorial.rst:191 msgid "" ">>> import custom\n" ">>> mycustom = custom.Custom()" msgstr "" -#: extending/newtypes_tutorial.rst:198 +#: extending/newtypes_tutorial.rst:196 msgid "" "That's it! All that remains is to build it; put the above code in a file " "called :file:`custom.c`," msgstr "" -#: extending/newtypes_tutorial.rst:201 +#: extending/newtypes_tutorial.rst:199 msgid "" "[build-system]\n" "requires = [\"setuptools\"]\n" @@ -379,53 +376,53 @@ msgid "" "version = \"1\"\n" msgstr "" -#: extending/newtypes_tutorial.rst:203 +#: extending/newtypes_tutorial.rst:201 msgid "in a file called :file:`pyproject.toml`, and" msgstr "" -#: extending/newtypes_tutorial.rst:205 +#: extending/newtypes_tutorial.rst:203 msgid "" "from setuptools import Extension, setup\n" "setup(ext_modules=[Extension(\"custom\", [\"custom.c\"])])" msgstr "" -#: extending/newtypes_tutorial.rst:210 +#: extending/newtypes_tutorial.rst:208 msgid "in a file called :file:`setup.py`; then typing" msgstr "" -#: extending/newtypes_tutorial.rst:212 extending/newtypes_tutorial.rst:527 +#: extending/newtypes_tutorial.rst:210 extending/newtypes_tutorial.rst:525 msgid "$ python -m pip install ." msgstr "" -#: extending/newtypes_tutorial.rst:216 +#: extending/newtypes_tutorial.rst:214 msgid "" "in a shell should produce a file :file:`custom.so` in a subdirectory and " "install it; now fire up Python --- you should be able to ``import custom`` " "and play around with ``Custom`` objects." msgstr "" -#: extending/newtypes_tutorial.rst:220 +#: extending/newtypes_tutorial.rst:218 msgid "That wasn't so hard, was it?" msgstr "" -#: extending/newtypes_tutorial.rst:222 +#: extending/newtypes_tutorial.rst:220 msgid "" "Of course, the current Custom type is pretty uninteresting. It has no data " "and doesn't do anything. It can't even be subclassed." msgstr "" -#: extending/newtypes_tutorial.rst:227 +#: extending/newtypes_tutorial.rst:225 msgid "Adding data and methods to the Basic example" msgstr "" -#: extending/newtypes_tutorial.rst:229 +#: extending/newtypes_tutorial.rst:227 msgid "" "Let's extend the basic example to add some data and methods. Let's also " "make the type usable as a base class. We'll create a new module, :mod:`!" "custom2` that adds these capabilities:" msgstr "" -#: extending/newtypes_tutorial.rst:233 +#: extending/newtypes_tutorial.rst:231 msgid "" "#define PY_SSIZE_T_CLEAN\n" "#include \n" @@ -560,11 +557,11 @@ msgid "" "}\n" msgstr "" -#: extending/newtypes_tutorial.rst:236 +#: extending/newtypes_tutorial.rst:234 msgid "This version of the module has a number of changes." msgstr "" -#: extending/newtypes_tutorial.rst:238 +#: extending/newtypes_tutorial.rst:236 msgid "" "The :class:`!Custom` type now has three data attributes in its C struct, " "*first*, *last*, and *number*. The *first* and *last* variables are Python " @@ -572,11 +569,11 @@ msgid "" "integer." msgstr "" -#: extending/newtypes_tutorial.rst:242 +#: extending/newtypes_tutorial.rst:240 msgid "The object structure is updated accordingly::" msgstr "" -#: extending/newtypes_tutorial.rst:244 +#: extending/newtypes_tutorial.rst:242 msgid "" "typedef struct {\n" " PyObject_HEAD\n" @@ -586,13 +583,13 @@ msgid "" "} CustomObject;" msgstr "" -#: extending/newtypes_tutorial.rst:251 +#: extending/newtypes_tutorial.rst:249 msgid "" "Because we now have data to manage, we have to be more careful about object " "allocation and deallocation. At a minimum, we need a deallocation method::" msgstr "" -#: extending/newtypes_tutorial.rst:254 +#: extending/newtypes_tutorial.rst:252 msgid "" "static void\n" "Custom_dealloc(CustomObject *self)\n" @@ -603,15 +600,15 @@ msgid "" "}" msgstr "" -#: extending/newtypes_tutorial.rst:262 +#: extending/newtypes_tutorial.rst:260 msgid "which is assigned to the :c:member:`~PyTypeObject.tp_dealloc` member::" msgstr "" -#: extending/newtypes_tutorial.rst:264 +#: extending/newtypes_tutorial.rst:262 msgid ".tp_dealloc = (destructor) Custom_dealloc," msgstr "" -#: extending/newtypes_tutorial.rst:266 +#: extending/newtypes_tutorial.rst:264 msgid "" "This method first clears the reference counts of the two Python attributes. :" "c:func:`Py_XDECREF` correctly handles the case where its argument is " @@ -622,7 +619,7 @@ msgid "" "an instance of a subclass." msgstr "" -#: extending/newtypes_tutorial.rst:275 +#: extending/newtypes_tutorial.rst:273 msgid "" "The explicit cast to ``destructor`` above is needed because we defined " "``Custom_dealloc`` to take a ``CustomObject *`` argument, but the " @@ -631,13 +628,13 @@ msgid "" "oriented polymorphism, in C!" msgstr "" -#: extending/newtypes_tutorial.rst:281 +#: extending/newtypes_tutorial.rst:279 msgid "" "We want to make sure that the first and last names are initialized to empty " "strings, so we provide a ``tp_new`` implementation::" msgstr "" -#: extending/newtypes_tutorial.rst:284 +#: extending/newtypes_tutorial.rst:282 msgid "" "static PyObject *\n" "Custom_new(PyTypeObject *type, PyObject *args, PyObject *kwds)\n" @@ -661,15 +658,15 @@ msgid "" "}" msgstr "" -#: extending/newtypes_tutorial.rst:305 +#: extending/newtypes_tutorial.rst:303 msgid "and install it in the :c:member:`~PyTypeObject.tp_new` member::" msgstr "" -#: extending/newtypes_tutorial.rst:307 +#: extending/newtypes_tutorial.rst:305 msgid ".tp_new = Custom_new," msgstr "" -#: extending/newtypes_tutorial.rst:309 +#: extending/newtypes_tutorial.rst:307 msgid "" "The ``tp_new`` handler is responsible for creating (as opposed to " "initializing) objects of the type. It is exposed in Python as the :meth:" @@ -680,7 +677,7 @@ msgid "" "``first`` and ``last`` attributes to non-``NULL`` default values." msgstr "" -#: extending/newtypes_tutorial.rst:317 +#: extending/newtypes_tutorial.rst:315 msgid "" "``tp_new`` is passed the type being instantiated (not necessarily " "``CustomType``, if a subclass is instantiated) and any arguments passed when " @@ -690,29 +687,29 @@ msgid "" "k.a. ``tp_init`` in C or ``__init__`` in Python) methods." msgstr "" -#: extending/newtypes_tutorial.rst:325 +#: extending/newtypes_tutorial.rst:323 msgid "" "``tp_new`` shouldn't call ``tp_init`` explicitly, as the interpreter will do " "it itself." msgstr "" -#: extending/newtypes_tutorial.rst:328 +#: extending/newtypes_tutorial.rst:326 msgid "" "The ``tp_new`` implementation calls the :c:member:`~PyTypeObject.tp_alloc` " "slot to allocate memory::" msgstr "" -#: extending/newtypes_tutorial.rst:331 +#: extending/newtypes_tutorial.rst:329 msgid "self = (CustomObject *) type->tp_alloc(type, 0);" msgstr "" -#: extending/newtypes_tutorial.rst:333 +#: extending/newtypes_tutorial.rst:331 msgid "" "Since memory allocation may fail, we must check the :c:member:`~PyTypeObject." "tp_alloc` result against ``NULL`` before proceeding." msgstr "" -#: extending/newtypes_tutorial.rst:337 +#: extending/newtypes_tutorial.rst:335 msgid "" "We didn't fill the :c:member:`~PyTypeObject.tp_alloc` slot ourselves. " "Rather :c:func:`PyType_Ready` fills it for us by inheriting it from our base " @@ -720,7 +717,7 @@ msgid "" "allocation strategy." msgstr "" -#: extending/newtypes_tutorial.rst:343 +#: extending/newtypes_tutorial.rst:341 msgid "" "If you are creating a co-operative :c:member:`~PyTypeObject.tp_new` (one " "that calls a base type's :c:member:`~PyTypeObject.tp_new` or :meth:`~object." @@ -733,13 +730,13 @@ msgid "" "subclasses without getting a :exc:`TypeError`.)" msgstr "" -#: extending/newtypes_tutorial.rst:353 +#: extending/newtypes_tutorial.rst:351 msgid "" "We also define an initialization function which accepts arguments to provide " "initial values for our instance::" msgstr "" -#: extending/newtypes_tutorial.rst:356 +#: extending/newtypes_tutorial.rst:354 msgid "" "static int\n" "Custom_init(CustomObject *self, PyObject *args, PyObject *kwds)\n" @@ -768,15 +765,15 @@ msgid "" "}" msgstr "" -#: extending/newtypes_tutorial.rst:382 +#: extending/newtypes_tutorial.rst:380 msgid "by filling the :c:member:`~PyTypeObject.tp_init` slot. ::" msgstr "" -#: extending/newtypes_tutorial.rst:384 +#: extending/newtypes_tutorial.rst:382 msgid ".tp_init = (initproc) Custom_init," msgstr "" -#: extending/newtypes_tutorial.rst:386 +#: extending/newtypes_tutorial.rst:384 msgid "" "The :c:member:`~PyTypeObject.tp_init` slot is exposed in Python as the :meth:" "`~object.__init__` method. It is used to initialize an object after it's " @@ -784,7 +781,7 @@ msgid "" "they should return either ``0`` on success or ``-1`` on error." msgstr "" -#: extending/newtypes_tutorial.rst:391 +#: extending/newtypes_tutorial.rst:389 msgid "" "Unlike the ``tp_new`` handler, there is no guarantee that ``tp_init`` is " "called at all (for example, the :mod:`pickle` module by default doesn't " @@ -795,7 +792,7 @@ msgid "" "``first`` member like this::" msgstr "" -#: extending/newtypes_tutorial.rst:399 +#: extending/newtypes_tutorial.rst:397 msgid "" "if (first) {\n" " Py_XDECREF(self->first);\n" @@ -804,7 +801,7 @@ msgid "" "}" msgstr "" -#: extending/newtypes_tutorial.rst:405 +#: extending/newtypes_tutorial.rst:403 msgid "" "But this would be risky. Our type doesn't restrict the type of the " "``first`` member, so it could be any kind of object. It could have a " @@ -814,37 +811,37 @@ msgid "" "accesses and modifies our object." msgstr "" -#: extending/newtypes_tutorial.rst:412 +#: extending/newtypes_tutorial.rst:410 msgid "" "To be paranoid and protect ourselves against this possibility, we almost " "always reassign members before decrementing their reference counts. When " "don't we have to do this?" msgstr "" -#: extending/newtypes_tutorial.rst:416 +#: extending/newtypes_tutorial.rst:414 msgid "when we absolutely know that the reference count is greater than 1;" msgstr "" -#: extending/newtypes_tutorial.rst:418 +#: extending/newtypes_tutorial.rst:416 msgid "" "when we know that deallocation of the object [#]_ will neither release the :" "term:`GIL` nor cause any calls back into our type's code;" msgstr "" -#: extending/newtypes_tutorial.rst:421 +#: extending/newtypes_tutorial.rst:419 msgid "" "when decrementing a reference count in a :c:member:`~PyTypeObject." "tp_dealloc` handler on a type which doesn't support cyclic garbage " "collection [#]_." msgstr "" -#: extending/newtypes_tutorial.rst:424 +#: extending/newtypes_tutorial.rst:422 msgid "" "We want to expose our instance variables as attributes. There are a number " "of ways to do that. The simplest way is to define member definitions::" msgstr "" -#: extending/newtypes_tutorial.rst:427 +#: extending/newtypes_tutorial.rst:425 msgid "" "static PyMemberDef Custom_members[] = {\n" " {\"first\", Py_T_OBJECT_EX, offsetof(CustomObject, first), 0,\n" @@ -857,23 +854,23 @@ msgid "" "};" msgstr "" -#: extending/newtypes_tutorial.rst:437 +#: extending/newtypes_tutorial.rst:435 msgid "" "and put the definitions in the :c:member:`~PyTypeObject.tp_members` slot::" msgstr "" -#: extending/newtypes_tutorial.rst:439 +#: extending/newtypes_tutorial.rst:437 msgid ".tp_members = Custom_members," msgstr "" -#: extending/newtypes_tutorial.rst:441 +#: extending/newtypes_tutorial.rst:439 msgid "" "Each member definition has a member name, type, offset, access flags and " "documentation string. See the :ref:`Generic-Attribute-Management` section " "below for details." msgstr "" -#: extending/newtypes_tutorial.rst:445 +#: extending/newtypes_tutorial.rst:443 msgid "" "A disadvantage of this approach is that it doesn't provide a way to restrict " "the types of objects that can be assigned to the Python attributes. We " @@ -884,13 +881,13 @@ msgid "" "deleted." msgstr "" -#: extending/newtypes_tutorial.rst:452 +#: extending/newtypes_tutorial.rst:450 msgid "" "We define a single method, :meth:`!Custom.name`, that outputs the objects " "name as the concatenation of the first and last names. ::" msgstr "" -#: extending/newtypes_tutorial.rst:455 +#: extending/newtypes_tutorial.rst:453 msgid "" "static PyObject *\n" "Custom_name(CustomObject *self, PyObject *Py_UNUSED(ignored))\n" @@ -907,7 +904,7 @@ msgid "" "}" msgstr "" -#: extending/newtypes_tutorial.rst:469 +#: extending/newtypes_tutorial.rst:467 msgid "" "The method is implemented as a C function that takes a :class:`!Custom` (or :" "class:`!Custom` subclass) instance as the first argument. Methods always " @@ -917,13 +914,13 @@ msgid "" "method is equivalent to the Python method:" msgstr "" -#: extending/newtypes_tutorial.rst:476 +#: extending/newtypes_tutorial.rst:474 msgid "" "def name(self):\n" " return \"%s %s\" % (self.first, self.last)" msgstr "" -#: extending/newtypes_tutorial.rst:481 +#: extending/newtypes_tutorial.rst:479 msgid "" "Note that we have to check for the possibility that our :attr:`!first` and :" "attr:`!last` members are ``NULL``. This is because they can be deleted, in " @@ -932,13 +929,13 @@ msgid "" "We'll see how to do that in the next section." msgstr "" -#: extending/newtypes_tutorial.rst:487 +#: extending/newtypes_tutorial.rst:485 msgid "" "Now that we've defined the method, we need to create an array of method " "definitions::" msgstr "" -#: extending/newtypes_tutorial.rst:490 +#: extending/newtypes_tutorial.rst:488 msgid "" "static PyMethodDef Custom_methods[] = {\n" " {\"name\", (PyCFunction) Custom_name, METH_NOARGS,\n" @@ -948,21 +945,21 @@ msgid "" "};" msgstr "" -#: extending/newtypes_tutorial.rst:497 +#: extending/newtypes_tutorial.rst:495 msgid "" "(note that we used the :c:macro:`METH_NOARGS` flag to indicate that the " "method is expecting no arguments other than *self*)" msgstr "" -#: extending/newtypes_tutorial.rst:500 +#: extending/newtypes_tutorial.rst:498 msgid "and assign it to the :c:member:`~PyTypeObject.tp_methods` slot::" msgstr "" -#: extending/newtypes_tutorial.rst:502 +#: extending/newtypes_tutorial.rst:500 msgid ".tp_methods = Custom_methods," msgstr "" -#: extending/newtypes_tutorial.rst:504 +#: extending/newtypes_tutorial.rst:502 msgid "" "Finally, we'll make our type usable as a base class for subclassing. We've " "written our methods carefully so far so that they don't make any assumptions " @@ -970,22 +967,22 @@ msgid "" "to add the :c:macro:`Py_TPFLAGS_BASETYPE` to our class flag definition::" msgstr "" -#: extending/newtypes_tutorial.rst:509 +#: extending/newtypes_tutorial.rst:507 msgid ".tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE," msgstr "" -#: extending/newtypes_tutorial.rst:511 +#: extending/newtypes_tutorial.rst:509 msgid "" "We rename :c:func:`!PyInit_custom` to :c:func:`!PyInit_custom2`, update the " "module name in the :c:type:`PyModuleDef` struct, and update the full class " "name in the :c:type:`PyTypeObject` struct." msgstr "" -#: extending/newtypes_tutorial.rst:515 +#: extending/newtypes_tutorial.rst:513 msgid "Finally, we update our :file:`setup.py` file to include the new module," msgstr "" -#: extending/newtypes_tutorial.rst:517 +#: extending/newtypes_tutorial.rst:515 msgid "" "from setuptools import Extension, setup\n" "setup(ext_modules=[\n" @@ -994,15 +991,15 @@ msgid "" "])" msgstr "" -#: extending/newtypes_tutorial.rst:525 +#: extending/newtypes_tutorial.rst:523 msgid "and then we re-install so that we can ``import custom2``:" msgstr "" -#: extending/newtypes_tutorial.rst:532 +#: extending/newtypes_tutorial.rst:530 msgid "Providing finer control over data attributes" msgstr "" -#: extending/newtypes_tutorial.rst:534 +#: extending/newtypes_tutorial.rst:532 msgid "" "In this section, we'll provide finer control over how the :attr:`!first` " "and :attr:`!last` attributes are set in the :class:`!Custom` example. In the " @@ -1011,7 +1008,7 @@ msgid "" "make sure that these attributes always contain strings." msgstr "" -#: extending/newtypes_tutorial.rst:540 +#: extending/newtypes_tutorial.rst:538 msgid "" "#define PY_SSIZE_T_CLEAN\n" "#include \n" @@ -1189,14 +1186,14 @@ msgid "" "}\n" msgstr "" -#: extending/newtypes_tutorial.rst:543 +#: extending/newtypes_tutorial.rst:541 msgid "" "To provide greater control, over the :attr:`!first` and :attr:`!last` " "attributes, we'll use custom getter and setter functions. Here are the " "functions for getting and setting the :attr:`!first` attribute::" msgstr "" -#: extending/newtypes_tutorial.rst:547 +#: extending/newtypes_tutorial.rst:545 msgid "" "static PyObject *\n" "Custom_getfirst(CustomObject *self, void *closure)\n" @@ -1227,7 +1224,7 @@ msgid "" "}" msgstr "" -#: extending/newtypes_tutorial.rst:574 +#: extending/newtypes_tutorial.rst:572 msgid "" "The getter function is passed a :class:`!Custom` object and a \"closure\", " "which is a void pointer. In this case, the closure is ignored. (The " @@ -1237,7 +1234,7 @@ msgid "" "data in the closure.)" msgstr "" -#: extending/newtypes_tutorial.rst:580 +#: extending/newtypes_tutorial.rst:578 msgid "" "The setter function is passed the :class:`!Custom` object, the new value, " "and the closure. The new value may be ``NULL``, in which case the attribute " @@ -1245,11 +1242,11 @@ msgid "" "deleted or if its new value is not a string." msgstr "" -#: extending/newtypes_tutorial.rst:585 +#: extending/newtypes_tutorial.rst:583 msgid "We create an array of :c:type:`PyGetSetDef` structures::" msgstr "" -#: extending/newtypes_tutorial.rst:587 +#: extending/newtypes_tutorial.rst:585 msgid "" "static PyGetSetDef Custom_getsetters[] = {\n" " {\"first\", (getter) Custom_getfirst, (setter) Custom_setfirst,\n" @@ -1260,26 +1257,26 @@ msgid "" "};" msgstr "" -#: extending/newtypes_tutorial.rst:595 +#: extending/newtypes_tutorial.rst:593 msgid "and register it in the :c:member:`~PyTypeObject.tp_getset` slot::" msgstr "" -#: extending/newtypes_tutorial.rst:597 +#: extending/newtypes_tutorial.rst:595 msgid ".tp_getset = Custom_getsetters," msgstr "" -#: extending/newtypes_tutorial.rst:599 +#: extending/newtypes_tutorial.rst:597 msgid "" "The last item in a :c:type:`PyGetSetDef` structure is the \"closure\" " "mentioned above. In this case, we aren't using a closure, so we just pass " "``NULL``." msgstr "" -#: extending/newtypes_tutorial.rst:602 +#: extending/newtypes_tutorial.rst:600 msgid "We also remove the member definitions for these attributes::" msgstr "" -#: extending/newtypes_tutorial.rst:604 +#: extending/newtypes_tutorial.rst:602 msgid "" "static PyMemberDef Custom_members[] = {\n" " {\"number\", Py_T_INT, offsetof(CustomObject, number), 0,\n" @@ -1288,13 +1285,13 @@ msgid "" "};" msgstr "" -#: extending/newtypes_tutorial.rst:610 +#: extending/newtypes_tutorial.rst:608 msgid "" "We also need to update the :c:member:`~PyTypeObject.tp_init` handler to only " "allow strings [#]_ to be passed::" msgstr "" -#: extending/newtypes_tutorial.rst:613 +#: extending/newtypes_tutorial.rst:611 msgid "" "static int\n" "Custom_init(CustomObject *self, PyObject *args, PyObject *kwds)\n" @@ -1323,7 +1320,7 @@ msgid "" "}" msgstr "" -#: extending/newtypes_tutorial.rst:639 +#: extending/newtypes_tutorial.rst:637 msgid "" "With these changes, we can assure that the ``first`` and ``last`` members " "are never ``NULL`` so we can remove checks for ``NULL`` values in almost all " @@ -1333,32 +1330,32 @@ msgid "" "possibility that the initialization of these members failed in ``tp_new``." msgstr "" -#: extending/newtypes_tutorial.rst:646 +#: extending/newtypes_tutorial.rst:644 msgid "" "We also rename the module initialization function and module name in the " "initialization function, as we did before, and we add an extra definition to " "the :file:`setup.py` file." msgstr "" -#: extending/newtypes_tutorial.rst:652 +#: extending/newtypes_tutorial.rst:650 msgid "Supporting cyclic garbage collection" msgstr "" -#: extending/newtypes_tutorial.rst:654 +#: extending/newtypes_tutorial.rst:652 msgid "" "Python has a :term:`cyclic garbage collector (GC) ` that " "can identify unneeded objects even when their reference counts are not zero. " "This can happen when objects are involved in cycles. For example, consider:" msgstr "" -#: extending/newtypes_tutorial.rst:658 +#: extending/newtypes_tutorial.rst:656 msgid "" ">>> l = []\n" ">>> l.append(l)\n" ">>> del l" msgstr "" -#: extending/newtypes_tutorial.rst:664 +#: extending/newtypes_tutorial.rst:662 msgid "" "In this example, we create a list that contains itself. When we delete it, " "it still has a reference from itself. Its reference count doesn't drop to " @@ -1366,7 +1363,7 @@ msgid "" "out that the list is garbage and free it." msgstr "" -#: extending/newtypes_tutorial.rst:669 +#: extending/newtypes_tutorial.rst:667 msgid "" "In the second version of the :class:`!Custom` example, we allowed any kind " "of object to be stored in the :attr:`!first` or :attr:`!last` attributes " @@ -1375,7 +1372,7 @@ msgid "" "those two reasons, :class:`!Custom` objects can participate in cycles:" msgstr "" -#: extending/newtypes_tutorial.rst:675 +#: extending/newtypes_tutorial.rst:673 msgid "" ">>> import custom3\n" ">>> class Derived(custom3.Custom): pass\n" @@ -1384,7 +1381,7 @@ msgid "" ">>> n.some_attribute = n" msgstr "" -#: extending/newtypes_tutorial.rst:683 +#: extending/newtypes_tutorial.rst:681 msgid "" "To allow a :class:`!Custom` instance participating in a reference cycle to " "be properly detected and collected by the cyclic GC, our :class:`!Custom` " @@ -1392,7 +1389,7 @@ msgid "" "these slots:" msgstr "" -#: extending/newtypes_tutorial.rst:687 +#: extending/newtypes_tutorial.rst:685 msgid "" "#define PY_SSIZE_T_CLEAN\n" "#include \n" @@ -1589,13 +1586,13 @@ msgid "" "}\n" msgstr "" -#: extending/newtypes_tutorial.rst:690 +#: extending/newtypes_tutorial.rst:688 msgid "" "First, the traversal method lets the cyclic GC know about subobjects that " "could participate in cycles::" msgstr "" -#: extending/newtypes_tutorial.rst:693 +#: extending/newtypes_tutorial.rst:691 msgid "" "static int\n" "Custom_traverse(CustomObject *self, visitproc visit, void *arg)\n" @@ -1615,7 +1612,7 @@ msgid "" "}" msgstr "" -#: extending/newtypes_tutorial.rst:710 +#: extending/newtypes_tutorial.rst:708 msgid "" "For each subobject that can participate in cycles, we need to call the :c:" "func:`!visit` function, which is passed to the traversal method. The :c:func:" @@ -1624,14 +1621,14 @@ msgid "" "be returned if it is non-zero." msgstr "" -#: extending/newtypes_tutorial.rst:716 +#: extending/newtypes_tutorial.rst:714 msgid "" "Python provides a :c:func:`Py_VISIT` macro that automates calling visit " "functions. With :c:func:`Py_VISIT`, we can minimize the amount of " "boilerplate in ``Custom_traverse``::" msgstr "" -#: extending/newtypes_tutorial.rst:720 +#: extending/newtypes_tutorial.rst:718 msgid "" "static int\n" "Custom_traverse(CustomObject *self, visitproc visit, void *arg)\n" @@ -1642,19 +1639,19 @@ msgid "" "}" msgstr "" -#: extending/newtypes_tutorial.rst:729 +#: extending/newtypes_tutorial.rst:727 msgid "" "The :c:member:`~PyTypeObject.tp_traverse` implementation must name its " "arguments exactly *visit* and *arg* in order to use :c:func:`Py_VISIT`." msgstr "" -#: extending/newtypes_tutorial.rst:732 +#: extending/newtypes_tutorial.rst:730 msgid "" "Second, we need to provide a method for clearing any subobjects that can " "participate in cycles::" msgstr "" -#: extending/newtypes_tutorial.rst:735 +#: extending/newtypes_tutorial.rst:733 msgid "" "static int\n" "Custom_clear(CustomObject *self)\n" @@ -1665,7 +1662,7 @@ msgid "" "}" msgstr "" -#: extending/newtypes_tutorial.rst:743 +#: extending/newtypes_tutorial.rst:741 msgid "" "Notice the use of the :c:func:`Py_CLEAR` macro. It is the recommended and " "safe way to clear data attributes of arbitrary types while decrementing " @@ -1675,11 +1672,11 @@ msgid "" "again (*especially* if there is a reference cycle)." msgstr "" -#: extending/newtypes_tutorial.rst:751 +#: extending/newtypes_tutorial.rst:749 msgid "You could emulate :c:func:`Py_CLEAR` by writing::" msgstr "" -#: extending/newtypes_tutorial.rst:753 +#: extending/newtypes_tutorial.rst:751 msgid "" "PyObject *tmp;\n" "tmp = self->first;\n" @@ -1687,14 +1684,14 @@ msgid "" "Py_XDECREF(tmp);" msgstr "" -#: extending/newtypes_tutorial.rst:758 +#: extending/newtypes_tutorial.rst:756 msgid "" "Nevertheless, it is much easier and less error-prone to always use :c:func:" "`Py_CLEAR` when deleting an attribute. Don't try to micro-optimize at the " "expense of robustness!" msgstr "" -#: extending/newtypes_tutorial.rst:762 +#: extending/newtypes_tutorial.rst:760 msgid "" "The deallocator ``Custom_dealloc`` may call arbitrary code when clearing " "attributes. It means the circular GC can be triggered inside the function. " @@ -1704,7 +1701,7 @@ msgid "" "`PyObject_GC_UnTrack` and ``Custom_clear``::" msgstr "" -#: extending/newtypes_tutorial.rst:769 +#: extending/newtypes_tutorial.rst:767 msgid "" "static void\n" "Custom_dealloc(CustomObject *self)\n" @@ -1715,17 +1712,17 @@ msgid "" "}" msgstr "" -#: extending/newtypes_tutorial.rst:777 +#: extending/newtypes_tutorial.rst:775 msgid "" "Finally, we add the :c:macro:`Py_TPFLAGS_HAVE_GC` flag to the class flags::" msgstr "" -#: extending/newtypes_tutorial.rst:779 +#: extending/newtypes_tutorial.rst:777 msgid "" ".tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE | Py_TPFLAGS_HAVE_GC," msgstr "" -#: extending/newtypes_tutorial.rst:781 +#: extending/newtypes_tutorial.rst:779 msgid "" "That's pretty much it. If we had written custom :c:member:`~PyTypeObject." "tp_alloc` or :c:member:`~PyTypeObject.tp_free` handlers, we'd need to modify " @@ -1733,11 +1730,11 @@ msgid "" "automatically provided." msgstr "" -#: extending/newtypes_tutorial.rst:787 +#: extending/newtypes_tutorial.rst:785 msgid "Subclassing other types" msgstr "" -#: extending/newtypes_tutorial.rst:789 +#: extending/newtypes_tutorial.rst:787 msgid "" "It is possible to create new extension types that are derived from existing " "types. It is easiest to inherit from the built in types, since an extension " @@ -1745,7 +1742,7 @@ msgid "" "share these :c:type:`PyTypeObject` structures between extension modules." msgstr "" -#: extending/newtypes_tutorial.rst:794 +#: extending/newtypes_tutorial.rst:792 msgid "" "In this example we will create a :class:`!SubList` type that inherits from " "the built-in :class:`list` type. The new type will be completely compatible " @@ -1753,7 +1750,7 @@ msgid "" "that increases an internal counter:" msgstr "" -#: extending/newtypes_tutorial.rst:799 +#: extending/newtypes_tutorial.rst:797 msgid "" ">>> import sublist\n" ">>> s = sublist.SubList(range(3))\n" @@ -1766,7 +1763,7 @@ msgid "" "2" msgstr "" -#: extending/newtypes_tutorial.rst:811 +#: extending/newtypes_tutorial.rst:809 msgid "" "#define PY_SSIZE_T_CLEAN\n" "#include \n" @@ -1828,10 +1825,8 @@ msgid "" " if (m == NULL)\n" " return NULL;\n" "\n" -" Py_INCREF(&SubListType);\n" -" if (PyModule_AddObject(m, \"SubList\", (PyObject *) &SubListType) < 0) " -"{\n" -" Py_DECREF(&SubListType);\n" +" if (PyModule_AddObjectRef(m, \"SubList\", (PyObject *) &SubListType) < " +"0) {\n" " Py_DECREF(m);\n" " return NULL;\n" " }\n" @@ -1840,14 +1835,14 @@ msgid "" "}\n" msgstr "" -#: extending/newtypes_tutorial.rst:814 +#: extending/newtypes_tutorial.rst:812 msgid "" "As you can see, the source code closely resembles the :class:`!Custom` " "examples in previous sections. We will break down the main differences " "between them. ::" msgstr "" -#: extending/newtypes_tutorial.rst:817 +#: extending/newtypes_tutorial.rst:815 msgid "" "typedef struct {\n" " PyListObject list;\n" @@ -1855,21 +1850,21 @@ msgid "" "} SubListObject;" msgstr "" -#: extending/newtypes_tutorial.rst:822 +#: extending/newtypes_tutorial.rst:820 msgid "" "The primary difference for derived type objects is that the base type's " "object structure must be the first value. The base type will already " "include the :c:func:`PyObject_HEAD` at the beginning of its structure." msgstr "" -#: extending/newtypes_tutorial.rst:826 +#: extending/newtypes_tutorial.rst:824 msgid "" "When a Python object is a :class:`!SubList` instance, its ``PyObject *`` " "pointer can be safely cast to both ``PyListObject *`` and ``SubListObject " "*``::" msgstr "" -#: extending/newtypes_tutorial.rst:829 +#: extending/newtypes_tutorial.rst:827 msgid "" "static int\n" "SubList_init(SubListObject *self, PyObject *args, PyObject *kwds)\n" @@ -1881,13 +1876,13 @@ msgid "" "}" msgstr "" -#: extending/newtypes_tutorial.rst:838 +#: extending/newtypes_tutorial.rst:836 msgid "" "We see above how to call through to the :meth:`~object.__init__` method of " "the base type." msgstr "" -#: extending/newtypes_tutorial.rst:841 +#: extending/newtypes_tutorial.rst:839 msgid "" "This pattern is important when writing a type with custom :c:member:" "`~PyTypeObject.tp_new` and :c:member:`~PyTypeObject.tp_dealloc` members. " @@ -1896,7 +1891,7 @@ msgid "" "the base class handle it by calling its own :c:member:`~PyTypeObject.tp_new`." msgstr "" -#: extending/newtypes_tutorial.rst:847 +#: extending/newtypes_tutorial.rst:845 msgid "" "The :c:type:`PyTypeObject` struct supports a :c:member:`~PyTypeObject." "tp_base` specifying the type's concrete base class. Due to cross-platform " @@ -1905,7 +1900,7 @@ msgid "" "function::" msgstr "" -#: extending/newtypes_tutorial.rst:853 +#: extending/newtypes_tutorial.rst:851 msgid "" "PyMODINIT_FUNC\n" "PyInit_sublist(void)\n" @@ -1919,10 +1914,8 @@ msgid "" " if (m == NULL)\n" " return NULL;\n" "\n" -" Py_INCREF(&SubListType);\n" -" if (PyModule_AddObject(m, \"SubList\", (PyObject *) &SubListType) < 0) " -"{\n" -" Py_DECREF(&SubListType);\n" +" if (PyModule_AddObjectRef(m, \"SubList\", (PyObject *) &SubListType) < " +"0) {\n" " Py_DECREF(m);\n" " return NULL;\n" " }\n" @@ -1931,7 +1924,7 @@ msgid "" "}" msgstr "" -#: extending/newtypes_tutorial.rst:875 +#: extending/newtypes_tutorial.rst:871 msgid "" "Before calling :c:func:`PyType_Ready`, the type structure must have the :c:" "member:`~PyTypeObject.tp_base` slot filled in. When we are deriving an " @@ -1940,29 +1933,29 @@ msgid "" "from the base type will be inherited." msgstr "" -#: extending/newtypes_tutorial.rst:881 +#: extending/newtypes_tutorial.rst:877 msgid "" "After that, calling :c:func:`PyType_Ready` and adding the type object to the " "module is the same as with the basic :class:`!Custom` examples." msgstr "" -#: extending/newtypes_tutorial.rst:886 +#: extending/newtypes_tutorial.rst:882 msgid "Footnotes" msgstr "" -#: extending/newtypes_tutorial.rst:887 +#: extending/newtypes_tutorial.rst:883 msgid "" "This is true when we know that the object is a basic type, like a string or " "a float." msgstr "" -#: extending/newtypes_tutorial.rst:890 +#: extending/newtypes_tutorial.rst:886 msgid "" "We relied on this in the :c:member:`~PyTypeObject.tp_dealloc` handler in " "this example, because our type doesn't support garbage collection." msgstr "" -#: extending/newtypes_tutorial.rst:893 +#: extending/newtypes_tutorial.rst:889 msgid "" "We now know that the first and last members are strings, so perhaps we could " "be less careful about decrementing their reference counts, however, we " @@ -1972,7 +1965,7 @@ msgid "" "objects." msgstr "" -#: extending/newtypes_tutorial.rst:899 +#: extending/newtypes_tutorial.rst:895 msgid "" "Also, even with our attributes restricted to strings instances, the user " "could pass arbitrary :class:`str` subclasses and therefore still create " diff --git a/extending/windows.po b/extending/windows.po index cddb9af8..1ac0c39f 100644 --- a/extending/windows.po +++ b/extending/windows.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" diff --git a/faq/design.po b/faq/design.po index 7309dd4c..11ff3cd9 100644 --- a/faq/design.po +++ b/faq/design.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" diff --git a/faq/extending.po b/faq/extending.po index 4b560881..a4224cfd 100644 --- a/faq/extending.po +++ b/faq/extending.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: 2024-10-31 12:22+0200\n" "Last-Translator: Panagiotis Skias \n" "Language-Team: PyGreece \n" diff --git a/faq/general.po b/faq/general.po index 496fe505..bcd7ebd2 100644 --- a/faq/general.po +++ b/faq/general.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -492,34 +492,34 @@ msgid "" "maintained anymore <373>`." msgstr "" -#: faq/general.rst:317 +#: faq/general.rst:318 msgid "How many people are using Python?" msgstr "" -#: faq/general.rst:319 +#: faq/general.rst:320 msgid "" "There are probably millions of users, though it's difficult to obtain an " "exact count." msgstr "" -#: faq/general.rst:322 +#: faq/general.rst:323 msgid "" "Python is available for free download, so there are no sales figures, and " "it's available from many different sites and packaged with many Linux " "distributions, so download statistics don't tell the whole story either." msgstr "" -#: faq/general.rst:326 +#: faq/general.rst:327 msgid "" "The comp.lang.python newsgroup is very active, but not all Python users post " "to the group or even read it." msgstr "" -#: faq/general.rst:331 +#: faq/general.rst:332 msgid "Have any significant projects been done in Python?" msgstr "" -#: faq/general.rst:333 +#: faq/general.rst:334 msgid "" "See https://www.python.org/about/success for a list of projects that use " "Python. Consulting the proceedings for `past Python conferences `_ and `the Zope application server `_." msgstr "" -#: faq/general.rst:360 +#: faq/general.rst:361 msgid "Is it reasonable to propose incompatible changes to Python?" msgstr "" -#: faq/general.rst:362 +#: faq/general.rst:363 msgid "" "In general, no. There are already millions of lines of Python code around " "the world, so any change in the language that invalidates more than a very " @@ -570,22 +570,22 @@ msgid "" "to invalidate them all at a single stroke." msgstr "" -#: faq/general.rst:369 +#: faq/general.rst:370 msgid "" "Providing a gradual upgrade path is necessary if a feature has to be " "changed. :pep:`5` describes the procedure followed for introducing backward-" "incompatible changes while minimizing disruption for users." msgstr "" -#: faq/general.rst:375 +#: faq/general.rst:376 msgid "Is Python a good language for beginning programmers?" msgstr "" -#: faq/general.rst:377 +#: faq/general.rst:378 msgid "Yes." msgstr "" -#: faq/general.rst:379 +#: faq/general.rst:380 msgid "" "It is still common to start students with a procedural and statically typed " "language such as Pascal, C, or a subset of C++ or Java. Students may be " @@ -598,7 +598,7 @@ msgid "" "with user-defined objects in their very first course." msgstr "" -#: faq/general.rst:389 +#: faq/general.rst:390 msgid "" "For a student who has never programmed before, using a statically typed " "language seems unnatural. It presents additional complexity that the " @@ -610,7 +610,7 @@ msgid "" "course." msgstr "" -#: faq/general.rst:397 +#: faq/general.rst:398 msgid "" "Many other aspects of Python make it a good first language. Like Java, " "Python has a large standard library so that students can be assigned " @@ -623,7 +623,7 @@ msgid "" "helpful in extending the students' reach." msgstr "" -#: faq/general.rst:406 +#: faq/general.rst:407 msgid "" "Python's interactive interpreter enables students to test language features " "while they're programming. They can keep a window with the interpreter " @@ -631,7 +631,7 @@ msgid "" "can't remember the methods for a list, they can do something like this::" msgstr "" -#: faq/general.rst:411 +#: faq/general.rst:412 msgid "" ">>> L = []\n" ">>> dir(L)\n" @@ -659,13 +659,13 @@ msgid "" "[1]" msgstr "" -#: faq/general.rst:435 +#: faq/general.rst:436 msgid "" "With the interpreter, documentation is never far from the student as they " "are programming." msgstr "" -#: faq/general.rst:438 +#: faq/general.rst:439 msgid "" "There are also good IDEs for Python. IDLE is a cross-platform IDE for " "Python that is written in Python using Tkinter. Emacs users will be happy to " @@ -676,7 +676,7 @@ msgid "" "Python editing environments." msgstr "" -#: faq/general.rst:446 +#: faq/general.rst:447 msgid "" "If you want to discuss Python's use in education, you may be interested in " "joining `the edu-sig mailing list \n" "Language-Team: LANGUAGE \n" @@ -76,24 +76,15 @@ msgstr "" #: faq/gui.rst:49 msgid "" -"To get truly stand-alone applications, the Tcl scripts that form the library " -"have to be integrated into the application as well. One tool supporting that " -"is SAM (stand-alone modules), which is part of the Tix distribution (https://" -"tix.sourceforge.net/)." +"Various third-party freeze libraries such as py2exe and cx_Freeze have " +"handling for Tkinter applications built-in." msgstr "" #: faq/gui.rst:54 -msgid "" -"Build Tix with SAM enabled, perform the appropriate call to :c:func:`!" -"Tclsam_init`, etc. inside Python's :file:`Modules/tkappinit.c`, and link " -"with libtclsam and libtksam (you might include the Tix libraries as well)." -msgstr "" - -#: faq/gui.rst:61 msgid "Can I have Tk events handled while waiting for I/O?" msgstr "" -#: faq/gui.rst:63 +#: faq/gui.rst:56 msgid "" "On platforms other than Windows, yes, and you don't even need threads! But " "you'll have to restructure your I/O code a bit. Tk has the equivalent of " @@ -102,18 +93,18 @@ msgid "" "file descriptor. See :ref:`tkinter-file-handlers`." msgstr "" -#: faq/gui.rst:71 +#: faq/gui.rst:64 msgid "I can't get key bindings to work in Tkinter: why?" msgstr "" -#: faq/gui.rst:73 +#: faq/gui.rst:66 msgid "" "An often-heard complaint is that event handlers :ref:`bound ` to events with the :meth:`!bind` method don't get handled even when " "the appropriate key is pressed." msgstr "" -#: faq/gui.rst:77 +#: faq/gui.rst:70 msgid "" "The most common cause is that the widget to which the binding applies " "doesn't have \"keyboard focus\". Check out the Tk documentation for the " diff --git a/faq/index.po b/faq/index.po index 6dd32bec..2ac3c1e9 100644 --- a/faq/index.po +++ b/faq/index.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: 2024-05-02 12:51+0000\n" "Last-Translator: Dimitrios Papadopoulos\n" "Language-Team: PyGreece \n" diff --git a/faq/installed.po b/faq/installed.po index 3ed468b1..f8c46e8d 100644 --- a/faq/installed.po +++ b/faq/installed.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: 2024-05-06 12:51+0000\n" "Last-Translator: Dimitrios Papadopoulos\n" "Language-Team: PyGreece \n" diff --git a/faq/library.po b/faq/library.po index ccccfa5f..fda33c9a 100644 --- a/faq/library.po +++ b/faq/library.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -555,7 +555,7 @@ msgstr "" msgid "Can't we get rid of the Global Interpreter Lock?" msgstr "" -#: faq/library.rst:410 +#: faq/library.rst:408 msgid "" "The :term:`global interpreter lock` (GIL) is often seen as a hindrance to " "Python's deployment on high-end multiprocessor server machines, because a " @@ -563,30 +563,45 @@ msgid "" "insistence that (almost) all Python code can only run while the GIL is held." msgstr "" -#: faq/library.rst:415 +#: faq/library.rst:413 msgid "" -"Back in the days of Python 1.5, Greg Stein actually implemented a " +"With the approval of :pep:`703` work is now underway to remove the GIL from " +"the CPython implementation of Python. Initially it will be implemented as " +"an optional compiler flag when building the interpreter, and so separate " +"builds will be available with and without the GIL. Long-term, the hope is " +"to settle on a single build, once the performance implications of removing " +"the GIL are fully understood. Python 3.13 is likely to be the first release " +"containing this work, although it may not be completely functional in this " +"release." +msgstr "" + +#: faq/library.rst:422 +msgid "" +"The current work to remove the GIL is based on a `fork of Python 3.9 with " +"the GIL removed `_ by Sam Gross. Prior " +"to that, in the days of Python 1.5, Greg Stein actually implemented a " "comprehensive patch set (the \"free threading\" patches) that removed the " -"GIL and replaced it with fine-grained locking. Adam Olsen recently did a " -"similar experiment in his `python-safethread `_ project. Unfortunately, both experiments " -"exhibited a sharp drop in single-thread performance (at least 30% slower), " -"due to the amount of fine-grained locking necessary to compensate for the " -"removal of the GIL." +"GIL and replaced it with fine-grained locking. Adam Olsen did a similar " +"experiment in his `python-safethread `_ project. Unfortunately, both of these earlier " +"experiments exhibited a sharp drop in single-thread performance (at least " +"30% slower), due to the amount of fine-grained locking necessary to " +"compensate for the removal of the GIL. The Python 3.9 fork is the first " +"attempt at removing the GIL with an acceptable performance impact." msgstr "" -#: faq/library.rst:423 +#: faq/library.rst:437 msgid "" -"This doesn't mean that you can't make good use of Python on multi-CPU " -"machines! You just have to be creative with dividing the work up between " -"multiple *processes* rather than multiple *threads*. The :class:" -"`~concurrent.futures.ProcessPoolExecutor` class in the new :mod:`concurrent." -"futures` module provides an easy way of doing so; the :mod:`multiprocessing` " -"module provides a lower-level API in case you want more control over " -"dispatching of tasks." +"The presence of the GIL in current Python releases doesn't mean that you " +"can't make good use of Python on multi-CPU machines! You just have to be " +"creative with dividing the work up between multiple *processes* rather than " +"multiple *threads*. The :class:`~concurrent.futures.ProcessPoolExecutor` " +"class in the new :mod:`concurrent.futures` module provides an easy way of " +"doing so; the :mod:`multiprocessing` module provides a lower-level API in " +"case you want more control over dispatching of tasks." msgstr "" -#: faq/library.rst:431 +#: faq/library.rst:446 msgid "" "Judicious use of C extensions will also help; if you use a C extension to " "perform a time-consuming task, the extension can release the GIL while the " @@ -595,48 +610,33 @@ msgid "" "`hashlib` already do this." msgstr "" -#: faq/library.rst:437 -msgid "" -"It has been suggested that the GIL should be a per-interpreter-state lock " -"rather than truly global; interpreters then wouldn't be able to share " -"objects. Unfortunately, this isn't likely to happen either. It would be a " -"tremendous amount of work, because many object implementations currently " -"have global state. For example, small integers and short strings are cached; " -"these caches would have to be moved to the interpreter state. Other object " -"types have their own free list; these free lists would have to be moved to " -"the interpreter state. And so on." -msgstr "" - -#: faq/library.rst:446 +#: faq/library.rst:452 msgid "" -"And I doubt that it can even be done in finite time, because the same " -"problem exists for 3rd party extensions. It is likely that 3rd party " -"extensions are being written at a faster rate than you can convert them to " -"store all their global state in the interpreter state." +"An alternative approach to reducing the impact of the GIL is to make the GIL " +"a per-interpreter-state lock rather than truly global. This was :ref:`first " +"implemented in Python 3.12 ` and is available in the C " +"API. A Python interface to it is expected in Python 3.13. The main " +"limitation to it at the moment is likely to be 3rd party extension modules, " +"since these must be written with multiple interpreters in mind in order to " +"be usable, so many older extension modules will not be usable." msgstr "" -#: faq/library.rst:451 -msgid "" -"And finally, once you have multiple interpreters not sharing any state, what " -"have you gained over running each interpreter in a separate process?" -msgstr "" - -#: faq/library.rst:456 +#: faq/library.rst:462 msgid "Input and Output" msgstr "" -#: faq/library.rst:459 +#: faq/library.rst:465 msgid "How do I delete a file? (And other file questions...)" msgstr "" -#: faq/library.rst:461 +#: faq/library.rst:467 msgid "" "Use ``os.remove(filename)`` or ``os.unlink(filename)``; for documentation, " "see the :mod:`os` module. The two functions are identical; :func:`~os." "unlink` is simply the name of the Unix system call for this function." msgstr "" -#: faq/library.rst:465 +#: faq/library.rst:471 msgid "" "To remove a directory, use :func:`os.rmdir`; use :func:`os.mkdir` to create " "one. ``os.makedirs(path)`` will create any intermediate directories in " @@ -645,11 +645,11 @@ msgid "" "directory tree and its contents, use :func:`shutil.rmtree`." msgstr "" -#: faq/library.rst:471 +#: faq/library.rst:477 msgid "To rename a file, use ``os.rename(old_path, new_path)``." msgstr "" -#: faq/library.rst:473 +#: faq/library.rst:479 msgid "" "To truncate a file, open it using ``f = open(filename, \"rb+\")``, and use " "``f.truncate(offset)``; offset defaults to the current seek position. " @@ -657,18 +657,18 @@ msgid "" "open`, where *fd* is the file descriptor (a small integer)." msgstr "" -#: faq/library.rst:478 +#: faq/library.rst:484 msgid "" "The :mod:`shutil` module also contains a number of functions to work on " "files including :func:`~shutil.copyfile`, :func:`~shutil.copytree`, and :" "func:`~shutil.rmtree`." msgstr "" -#: faq/library.rst:484 +#: faq/library.rst:490 msgid "How do I copy a file?" msgstr "" -#: faq/library.rst:486 +#: faq/library.rst:492 msgid "" "The :mod:`shutil` module contains a :func:`~shutil.copyfile` function. Note " "that on Windows NTFS volumes, it does not copy `alternate data streams " @@ -679,24 +679,24 @@ msgid "" "preserve most (though not all) of it." msgstr "" -#: faq/library.rst:497 +#: faq/library.rst:503 msgid "How do I read (or write) binary data?" msgstr "" -#: faq/library.rst:499 +#: faq/library.rst:505 msgid "" "To read or write complex binary data formats, it's best to use the :mod:" "`struct` module. It allows you to take a string containing binary data " "(usually numbers) and convert it to Python objects; and vice versa." msgstr "" -#: faq/library.rst:503 +#: faq/library.rst:509 msgid "" "For example, the following code reads two 2-byte integers and one 4-byte " "integer in big-endian format from a file::" msgstr "" -#: faq/library.rst:506 +#: faq/library.rst:512 msgid "" "import struct\n" "\n" @@ -705,20 +705,20 @@ msgid "" " x, y, z = struct.unpack(\">hhl\", s)" msgstr "" -#: faq/library.rst:512 +#: faq/library.rst:518 msgid "" "The '>' in the format string forces big-endian data; the letter 'h' reads " "one \"short integer\" (2 bytes), and 'l' reads one \"long integer\" (4 " "bytes) from the string." msgstr "" -#: faq/library.rst:516 +#: faq/library.rst:522 msgid "" "For data that is more regular (e.g. a homogeneous list of ints or floats), " "you can also use the :mod:`array` module." msgstr "" -#: faq/library.rst:521 +#: faq/library.rst:527 msgid "" "To read and write binary data, it is mandatory to open the file in binary " "mode (here, passing ``\"rb\"`` to :func:`open`). If you use ``\"r\"`` " @@ -726,11 +726,11 @@ msgid "" "will return :class:`str` objects rather than :class:`bytes` objects." msgstr "" -#: faq/library.rst:529 +#: faq/library.rst:535 msgid "I can't seem to use os.read() on a pipe created with os.popen(); why?" msgstr "" -#: faq/library.rst:531 +#: faq/library.rst:537 msgid "" ":func:`os.read` is a low-level function which takes a file descriptor, a " "small integer representing the opened file. :func:`os.popen` creates a high-" @@ -739,37 +739,37 @@ msgid "" "popen`, you need to use ``p.read(n)``." msgstr "" -#: faq/library.rst:617 +#: faq/library.rst:623 msgid "How do I access the serial (RS232) port?" msgstr "" -#: faq/library.rst:619 +#: faq/library.rst:625 msgid "For Win32, OSX, Linux, BSD, Jython, IronPython:" msgstr "" -#: faq/library.rst:621 +#: faq/library.rst:627 msgid ":pypi:`pyserial`" msgstr "" -#: faq/library.rst:623 +#: faq/library.rst:629 msgid "For Unix, see a Usenet post by Mitch Chapman:" msgstr "" -#: faq/library.rst:625 +#: faq/library.rst:631 msgid "https://groups.google.com/groups?selm=34A04430.CF9@ohioee.com" msgstr "" -#: faq/library.rst:629 +#: faq/library.rst:635 msgid "Why doesn't closing sys.stdout (stdin, stderr) really close it?" msgstr "" -#: faq/library.rst:631 +#: faq/library.rst:637 msgid "" "Python :term:`file objects ` are a high-level layer of " "abstraction on low-level C file descriptors." msgstr "" -#: faq/library.rst:634 +#: faq/library.rst:640 msgid "" "For most file objects you create in Python via the built-in :func:`open` " "function, ``f.close()`` marks the Python file object as being closed from " @@ -778,7 +778,7 @@ msgid "" "``f`` becomes garbage." msgstr "" -#: faq/library.rst:640 +#: faq/library.rst:646 msgid "" "But stdin, stdout and stderr are treated specially by Python, because of the " "special status also given to them by C. Running ``sys.stdout.close()`` " @@ -786,125 +786,70 @@ msgid "" "associated C file descriptor." msgstr "" -#: faq/library.rst:645 +#: faq/library.rst:651 msgid "" "To close the underlying C file descriptor for one of these three, you should " "first be sure that's what you really want to do (e.g., you may confuse " "extension modules trying to do I/O). If it is, use :func:`os.close`::" msgstr "" -#: faq/library.rst:649 +#: faq/library.rst:655 msgid "" "os.close(stdin.fileno())\n" "os.close(stdout.fileno())\n" "os.close(stderr.fileno())" msgstr "" -#: faq/library.rst:653 +#: faq/library.rst:659 msgid "Or you can use the numeric constants 0, 1 and 2, respectively." msgstr "" -#: faq/library.rst:657 +#: faq/library.rst:663 msgid "Network/Internet Programming" msgstr "" -#: faq/library.rst:660 +#: faq/library.rst:666 msgid "What WWW tools are there for Python?" msgstr "" -#: faq/library.rst:662 +#: faq/library.rst:668 msgid "" "See the chapters titled :ref:`internet` and :ref:`netdata` in the Library " "Reference Manual. Python has many modules that will help you build server-" "side and client-side web systems." msgstr "" -#: faq/library.rst:668 +#: faq/library.rst:674 msgid "" "A summary of available frameworks is maintained by Paul Boddie at https://" "wiki.python.org/moin/WebProgramming\\ ." msgstr "" -#: faq/library.rst:671 -msgid "" -"Cameron Laird maintains a useful set of pages about Python web technologies " -"at https://web.archive.org/web/20210224183619/http://phaseit.net/claird/comp." -"lang.python/web_python." -msgstr "" - -#: faq/library.rst:676 -msgid "How can I mimic CGI form submission (METHOD=POST)?" -msgstr "" - -#: faq/library.rst:678 -msgid "" -"I would like to retrieve web pages that are the result of POSTing a form. Is " -"there existing code that would let me do this easily?" -msgstr "" - -#: faq/library.rst:681 -msgid "Yes. Here's a simple example that uses :mod:`urllib.request`::" -msgstr "" - -#: faq/library.rst:683 -msgid "" -"#!/usr/local/bin/python\n" -"\n" -"import urllib.request\n" -"\n" -"# build the query string\n" -"qs = \"First=Josephine&MI=Q&Last=Public\"\n" -"\n" -"# connect and send the server a path\n" -"req = urllib.request.urlopen('http://www.some-server.out-there'\n" -" '/cgi-bin/some-cgi-script', data=qs)\n" -"with req:\n" -" msg, hdrs = req.read(), req.info()" -msgstr "" - -#: faq/library.rst:696 -msgid "" -"Note that in general for percent-encoded POST operations, query strings must " -"be quoted using :func:`urllib.parse.urlencode`. For example, to send " -"``name=Guy Steele, Jr.``::" -msgstr "" - -#: faq/library.rst:700 -msgid "" -">>> import urllib.parse\n" -">>> urllib.parse.urlencode({'name': 'Guy Steele, Jr.'})\n" -"'name=Guy+Steele%2C+Jr.'" -msgstr "" - -#: faq/library.rst:704 -msgid ":ref:`urllib-howto` for extensive examples." -msgstr "" - -#: faq/library.rst:708 +#: faq/library.rst:679 msgid "What module should I use to help with generating HTML?" msgstr "" -#: faq/library.rst:712 +#: faq/library.rst:683 msgid "" "You can find a collection of useful links on the `Web Programming wiki page " "`_." msgstr "" -#: faq/library.rst:717 +#: faq/library.rst:688 msgid "How do I send mail from a Python script?" msgstr "" -#: faq/library.rst:719 +#: faq/library.rst:690 msgid "Use the standard library module :mod:`smtplib`." msgstr "" -#: faq/library.rst:721 +#: faq/library.rst:692 msgid "" "Here's a very simple interactive mail sender that uses it. This method will " "work on any host that supports an SMTP listener. ::" msgstr "" -#: faq/library.rst:724 +#: faq/library.rst:695 msgid "" "import sys, smtplib\n" "\n" @@ -924,7 +869,7 @@ msgid "" "server.quit()" msgstr "" -#: faq/library.rst:741 +#: faq/library.rst:712 msgid "" "A Unix-only alternative uses sendmail. The location of the sendmail program " "varies between systems; sometimes it is ``/usr/lib/sendmail``, sometimes ``/" @@ -932,7 +877,7 @@ msgid "" "some sample code::" msgstr "" -#: faq/library.rst:746 +#: faq/library.rst:717 msgid "" "import os\n" "\n" @@ -948,17 +893,17 @@ msgid "" " print(\"Sendmail exit status\", sts)" msgstr "" -#: faq/library.rst:761 +#: faq/library.rst:732 msgid "How do I avoid blocking in the connect() method of a socket?" msgstr "" -#: faq/library.rst:763 +#: faq/library.rst:734 msgid "" "The :mod:`select` module is commonly used to help with asynchronous I/O on " "sockets." msgstr "" -#: faq/library.rst:766 +#: faq/library.rst:737 msgid "" "To prevent the TCP connect from blocking, you can set the socket to non-" "blocking mode. Then when you do the :meth:`~socket.socket.connect`, you " @@ -969,7 +914,7 @@ msgid "" "your system." msgstr "" -#: faq/library.rst:774 +#: faq/library.rst:745 msgid "" "You can use the :meth:`~socket.socket.connect_ex` method to avoid creating " "an exception. It will just return the errno value. To poll, you can call :" @@ -978,7 +923,7 @@ msgid "" "`select.select` to check if it's writable." msgstr "" -#: faq/library.rst:782 +#: faq/library.rst:753 msgid "" "The :mod:`asyncio` module provides a general purpose single-threaded and " "concurrent asynchronous library, which can be used for writing non-blocking " @@ -986,19 +931,19 @@ msgid "" "popular and feature-rich alternative." msgstr "" -#: faq/library.rst:790 +#: faq/library.rst:761 msgid "Databases" msgstr "" -#: faq/library.rst:793 +#: faq/library.rst:764 msgid "Are there any interfaces to database packages in Python?" msgstr "" -#: faq/library.rst:795 +#: faq/library.rst:766 msgid "Yes." msgstr "" -#: faq/library.rst:797 +#: faq/library.rst:768 msgid "" "Interfaces to disk-based hashes such as :mod:`DBM ` and :mod:`GDBM " "` are also included with standard Python. There is also the :mod:" @@ -1006,18 +951,18 @@ msgid "" "database." msgstr "" -#: faq/library.rst:802 +#: faq/library.rst:773 msgid "" "Support for most relational databases is available. See the " "`DatabaseProgramming wiki page `_ for details." msgstr "" -#: faq/library.rst:808 +#: faq/library.rst:779 msgid "How do you implement persistent objects in Python?" msgstr "" -#: faq/library.rst:810 +#: faq/library.rst:781 msgid "" "The :mod:`pickle` library module solves this in a very general way (though " "you still can't store things like open files, sockets or windows), and the :" @@ -1025,61 +970,61 @@ msgid "" "mappings containing arbitrary Python objects." msgstr "" -#: faq/library.rst:817 +#: faq/library.rst:788 msgid "Mathematics and Numerics" msgstr "" -#: faq/library.rst:820 +#: faq/library.rst:791 msgid "How do I generate random numbers in Python?" msgstr "" -#: faq/library.rst:822 +#: faq/library.rst:793 msgid "" "The standard module :mod:`random` implements a random number generator. " "Usage is simple::" msgstr "" -#: faq/library.rst:825 +#: faq/library.rst:796 msgid "" "import random\n" "random.random()" msgstr "" -#: faq/library.rst:828 +#: faq/library.rst:799 msgid "This returns a random floating-point number in the range [0, 1)." msgstr "" -#: faq/library.rst:830 +#: faq/library.rst:801 msgid "" "There are also many other specialized generators in this module, such as:" msgstr "" -#: faq/library.rst:832 +#: faq/library.rst:803 msgid "``randrange(a, b)`` chooses an integer in the range [a, b)." msgstr "" -#: faq/library.rst:833 +#: faq/library.rst:804 msgid "``uniform(a, b)`` chooses a floating-point number in the range [a, b)." msgstr "" -#: faq/library.rst:834 +#: faq/library.rst:805 msgid "" "``normalvariate(mean, sdev)`` samples the normal (Gaussian) distribution." msgstr "" -#: faq/library.rst:836 +#: faq/library.rst:807 msgid "Some higher-level functions operate on sequences directly, such as:" msgstr "" -#: faq/library.rst:838 +#: faq/library.rst:809 msgid "``choice(S)`` chooses a random element from a given sequence." msgstr "" -#: faq/library.rst:839 +#: faq/library.rst:810 msgid "``shuffle(L)`` shuffles a list in-place, i.e. permutes it randomly." msgstr "" -#: faq/library.rst:841 +#: faq/library.rst:812 msgid "" "There's also a ``Random`` class you can instantiate to create independent " "multiple random number generators." diff --git a/faq/programming.po b/faq/programming.po index 3dae4907..6dda3397 100644 --- a/faq/programming.po +++ b/faq/programming.po @@ -8,8 +8,8 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" -"PO-Revision-Date: 2025-05-02 23:51+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" +"PO-Revision-Date: 2025-05-05 22:13+0300\n" "Last-Translator: Panagiotis Skias \n" "Language-Team: PyGreece \n" "Language: el\n" @@ -1986,12 +1986,12 @@ msgid "" "'Hello, there!'\n" "\n" ">>> import array\n" -">>> a = array.array('u', s)\n" +">>> a = array.array('w', s)\n" ">>> print(a)\n" -"array('u', 'Hello, world')\n" +"array('w', 'Hello, world')\n" ">>> a[0] = 'y'\n" ">>> print(a)\n" -"array('u', 'yello, world')\n" +"array('w', 'yello, world')\n" ">>> a.tounicode()\n" "'yello, world'" msgstr "" @@ -2008,12 +2008,12 @@ msgstr "" "'Hello, there!'\n" "\n" ">>> import array\n" -">>> a = array.array('u', s)\n" +">>> a = array.array('w', s)\n" ">>> print(a)\n" -"array('u', 'Hello, world')\n" +"array('w', 'Hello, world')\n" ">>> a[0] = 'y'\n" ">>> print(a)\n" -"array('u', 'yello, world')\n" +"array('w', 'yello, world')\n" ">>> a.tounicode()\n" "'yello, world'" diff --git a/faq/windows.po b/faq/windows.po index de7b9e94..6c12d85e 100644 --- a/faq/windows.po +++ b/faq/windows.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: 2024-05-31 22:08+0300\n" "Last-Translator: Panagiotis Skias \n" "Language-Team: PyGreece \n" diff --git a/glossary.po b/glossary.po index 1d7b23ce..57287f1f 100644 --- a/glossary.po +++ b/glossary.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: 2025-05-03 18:04+0300\n" "Last-Translator: Panagiotis Skias \n" "Language-Team: PyGreece \n" @@ -28,64 +28,42 @@ msgstr "``>>>``" #: glossary.rst:12 msgid "" -"The default Python prompt of the interactive shell. Often seen for code " -"examples which can be executed interactively in the interpreter." +"The default Python prompt of the :term:`interactive` shell. Often seen for " +"code examples which can be executed interactively in the interpreter." msgstr "" -"Το προεπιλεγμένο Python prompt του διαδραστικού shell. Συχνά εμφανίζεται για " -"παραδείγματα κώδικα που μπορούν να εκτελεστούν διαδραστικά στον interpreter." +"Η προεπιλεγμένη Python εντολή του :term:`interactive` shell. Συχνά " +"εμφανίζεται για παραδείγματα κώδικα που μπορούν να εκτελεστούν διαδραστικά " +"στον interpreter." -#: glossary.rst:14 +#: glossary.rst:15 msgid "``...``" msgstr "``...``" -#: glossary.rst:16 +#: glossary.rst:17 msgid "Can refer to:" msgstr "Μπορεί να αναφέρεται σε:" -#: glossary.rst:18 +#: glossary.rst:19 msgid "" -"The default Python prompt of the interactive shell when entering the code " -"for an indented code block, when within a pair of matching left and right " -"delimiters (parentheses, square brackets, curly braces or triple quotes), or " -"after specifying a decorator." +"The default Python prompt of the :term:`interactive` shell when entering the " +"code for an indented code block, when within a pair of matching left and " +"right delimiters (parentheses, square brackets, curly braces or triple " +"quotes), or after specifying a decorator." msgstr "" -"Το προεπιλεγμένο Python prompt του διαδραστικού shell κατά την εισαγωγή του " -"κώδικα για ένα μπλοκ κώδικα με εσοχή, όταν βρίσκεται μέσα σε ένα ζεύγος " -"ταιριασμένων αριστερών και δεξιών delimiters (παρενθέσεις, αγκύλες, άγκιστρα " -"ή τριπλά εισαγωγικά), ή μετά τον καθορισμό ενός decorator." +"Η προεπιλεγμένη Python εντολή του :term:`interactive` shell κατά την " +"εισαγωγή του κώδικα για ένα μπλοκ κώδικα με εσοχή, όταν βρίσκεται μέσα σε " +"ένα ζεύγος ταιριασμένων αριστερών και δεξιών delimiters (παρενθέσεις, " +"αγκύλες, άγκιστρα ή τριπλά εισαγωγικά), ή μετά τον καθορισμό ενός decorator." -#: glossary.rst:23 +#: glossary.rst:24 msgid "The :const:`Ellipsis` built-in constant." msgstr "Η ενσωματωμένη σταθερά :const:`Ellipsis`." -#: glossary.rst:24 -msgid "2to3" -msgstr "2to3" - -#: glossary.rst:26 -msgid "" -"A tool that tries to convert Python 2.x code to Python 3.x code by handling " -"most of the incompatibilities which can be detected by parsing the source " -"and traversing the parse tree." -msgstr "" -"Ένα εργαλείο που προσπαθεί να μετατρέψει τον κώδικα Python 2.x σε κώδικα " -"Python 3.x διαχειρίζοντας τις περισσότερες ασυμβατότητες που μπορούν να " -"εντοπιστούν αναλύοντας την πηγή και διασχίζοντας το δέντρο ανάλυσης." - -#: glossary.rst:30 -msgid "" -"2to3 is available in the standard library as :mod:`lib2to3`; a standalone " -"entry point is provided as :file:`Tools/scripts/2to3`. See :ref:`2to3-" -"reference`." -msgstr "" -"2to3 είναι διαθέσιμο στην στάνταρ βιβλιοθήκη ως :mod:`lib2to3`, παρέχεται " -"ένα σημείο εισόδου ως :file:`Tools/scripts/2to3`. Βλ. :ref:`2to3-reference`." - -#: glossary.rst:33 +#: glossary.rst:25 msgid "abstract base class" msgstr "αφηρημένη βασική κλάση" -#: glossary.rst:35 +#: glossary.rst:27 msgid "" "Abstract base classes complement :term:`duck-typing` by providing a way to " "define interfaces when other techniques like :func:`hasattr` would be clumsy " @@ -110,11 +88,11 @@ msgstr "" "μονάδα :mod:`io`), εισαγωγή finders και loaders (στο module :mod:`importlib." "abc`). Μπορείτε να δημιουργήσετε τα δικά σας ABC με το module :mod:`abc`." -#: glossary.rst:46 +#: glossary.rst:38 msgid "annotation" msgstr "annotation" -#: glossary.rst:48 +#: glossary.rst:40 msgid "" "A label associated with a variable, a class attribute or a function " "parameter or return value, used by convention as a :term:`type hint`." @@ -123,7 +101,7 @@ msgstr "" "παράμετρος συνάρτησης ή τιμή που επιστρέφεται, που χρησιμοποιείται κατά " "σύμβαση ως :term:`type hint`." -#: glossary.rst:52 +#: glossary.rst:44 msgid "" "Annotations of local variables cannot be accessed at runtime, but " "annotations of global variables, class attributes, and functions are stored " @@ -136,7 +114,7 @@ msgstr "" "χαρακτηριστικό :attr:`__annotations__` των modules, των κλάσεων και των " "συναρτήσεων, αντίστοιχα." -#: glossary.rst:58 +#: glossary.rst:50 msgid "" "See :term:`variable annotation`, :term:`function annotation`, :pep:`484` " "and :pep:`526`, which describe this functionality. Also see :ref:" @@ -146,11 +124,11 @@ msgstr "" "και :pep:`526`, τα οποία περιγράφουν την λειτουργικότητα. Επίσης βλ. :ref:" "`annotations-howto` για τις βέλτιστες πρακτικές δουλεύοντας με annotations." -#: glossary.rst:62 +#: glossary.rst:54 msgid "argument" msgstr "όρισμα" -#: glossary.rst:64 +#: glossary.rst:56 msgid "" "A value passed to a :term:`function` (or :term:`method`) when calling the " "function. There are two kinds of argument:" @@ -158,7 +136,7 @@ msgstr "" "Μια τιμή μεταβιβάζεται σε μία :term:`function` (ή :term:`method`) κατά την " "κλήση της συνάρτησης. Υπάρχουν δύο είδη ορισμάτων:" -#: glossary.rst:67 +#: glossary.rst:59 msgid "" ":dfn:`keyword argument`: an argument preceded by an identifier (e.g. " "``name=``) in a function call or passed as a value in a dictionary preceded " @@ -170,7 +148,7 @@ msgstr "" "από ``**``. Για παράδειγμα, το ``3`` και το ``5`` αποτελούν ορίσματα λέξεων-" "κλειδιών στις ακόλουθες κλήσεις προς :func:`complex`::" -#: glossary.rst:72 +#: glossary.rst:64 msgid "" "complex(real=3, imag=5)\n" "complex(**{'real': 3, 'imag': 5})" @@ -178,7 +156,7 @@ msgstr "" "complex(real=3, imag=5)\n" "complex(**{'real': 3, 'imag': 5})" -#: glossary.rst:75 +#: glossary.rst:67 msgid "" ":dfn:`positional argument`: an argument that is not a keyword argument. " "Positional arguments can appear at the beginning of an argument list and/or " @@ -191,7 +169,7 @@ msgstr "" "παράδειγμα, το ``3`` και το ``5`` αποτελούν ορίσματα θέσης στις παρακάτω " "κλήσεις::" -#: glossary.rst:81 +#: glossary.rst:73 msgid "" "complex(3, 5)\n" "complex(*(3, 5))" @@ -199,7 +177,7 @@ msgstr "" "complex(3, 5)\n" "complex(*(3, 5))" -#: glossary.rst:84 +#: glossary.rst:76 msgid "" "Arguments are assigned to the named local variables in a function body. See " "the :ref:`calls` section for the rules governing this assignment. " @@ -212,7 +190,7 @@ msgstr "" "να αναπαραστήσει ένα όρισμα' η αξιολογούμενη τιμή εκχωρείται σε μια τοπική " "μεταβλητή." -#: glossary.rst:89 +#: glossary.rst:81 msgid "" "See also the :term:`parameter` glossary entry, the FAQ question on :ref:`the " "difference between arguments and parameters `, " @@ -222,11 +200,11 @@ msgstr "" "ερώτηση στο :ref:`η διαφορά μεταξύ ορισμάτων και παραμέτρων `, και :pep:`362`." -#: glossary.rst:92 +#: glossary.rst:84 msgid "asynchronous context manager" msgstr "ασύγχρονος διαχειριστής context" -#: glossary.rst:94 +#: glossary.rst:86 msgid "" "An object which controls the environment seen in an :keyword:`async with` " "statement by defining :meth:`~object.__aenter__` and :meth:`~object." @@ -236,11 +214,11 @@ msgstr "" "`async with` ορίζοντας τις μεθόδους :meth:`~object.__aenter__` και :meth:" "`~object.__aexit__`. Που εισήχθη από :pep:`492`." -#: glossary.rst:97 +#: glossary.rst:89 msgid "asynchronous generator" msgstr "ασύγχρονος generator" -#: glossary.rst:99 +#: glossary.rst:91 msgid "" "A function which returns an :term:`asynchronous generator iterator`. It " "looks like a coroutine function defined with :keyword:`async def` except " @@ -253,7 +231,7 @@ msgstr "" "σειράς τιμών που μπορούν να χρησιμοποιηθούν σε έναν :keyword:`async for` " "βρόχο." -#: glossary.rst:104 +#: glossary.rst:96 msgid "" "Usually refers to an asynchronous generator function, but may refer to an " "*asynchronous generator iterator* in some contexts. In cases where the " @@ -264,7 +242,7 @@ msgstr "" "περιπτώσεις όπου το επιδιωκόμενο νόημα δεν είναι σαφές, με την χρήση των " "πλήρων όρων αποφεύγεται η ασάφεια." -#: glossary.rst:108 +#: glossary.rst:100 msgid "" "An asynchronous generator function may contain :keyword:`await` expressions " "as well as :keyword:`async for`, and :keyword:`async with` statements." @@ -272,17 +250,17 @@ msgstr "" "Μια συνάρτηση ασύγχρονου generator μπορεί να περιέχει εκφράσεις :keyword:" "`await` , καθώς και δηλώσεις :keyword:`async for`, και :keyword:`async with`." -#: glossary.rst:111 +#: glossary.rst:103 msgid "asynchronous generator iterator" msgstr "ασύγχρονος generator iterator" -#: glossary.rst:113 +#: glossary.rst:105 msgid "An object created by a :term:`asynchronous generator` function." msgstr "" "Ένα αντικείμενο που δημιουργήθηκε από μια συνάρτηση :term:`asynchronous " "generator`." -#: glossary.rst:115 +#: glossary.rst:107 msgid "" "This is an :term:`asynchronous iterator` which when called using the :meth:" "`~object.__anext__` method returns an awaitable object which will execute " @@ -294,7 +272,7 @@ msgstr "" "αναμενόμενο αντικείμενο που θα εκτελέσει στο σώμα της συνάρτησης του " "ασύγχρονου generator μέχρι την επόμενη :keyword:`yield` έκφραση." -#: glossary.rst:120 +#: glossary.rst:112 msgid "" "Each :keyword:`yield` temporarily suspends processing, remembering the " "execution state (including local variables and pending try-statements). " @@ -309,11 +287,11 @@ msgstr "" "`~object.__anext__ `, συνεχίζει από εκεί που σταμάτησε. Βλ. :pep:`492` και :" "pep:`525`." -#: glossary.rst:125 +#: glossary.rst:117 msgid "asynchronous iterable" msgstr "ασύγχρονος iterable" -#: glossary.rst:127 +#: glossary.rst:119 msgid "" "An object, that can be used in an :keyword:`async for` statement. Must " "return an :term:`asynchronous iterator` from its :meth:`~object.__aiter__` " @@ -323,11 +301,11 @@ msgstr "" "for`. Πρέπει να επιστρέφει ένα :term:`asynchronous iterator` από την μέθοδο :" "meth:`~object.__aiter__`. Που εισήχθη από :pep:`492`." -#: glossary.rst:130 +#: glossary.rst:122 msgid "asynchronous iterator" msgstr "ασύγχρονος iterator" -#: glossary.rst:132 +#: glossary.rst:124 msgid "" "An object that implements the :meth:`~object.__aiter__` and :meth:`~object." "__anext__` methods. :meth:`~object.__anext__` must return an :term:" @@ -342,11 +320,11 @@ msgstr "" "__anext__` ενός ασύγχρονου iterator έως ότου εγείρει μια εξαίρεση :exc:" "`StopAsyncIteration`. Εισήχθη από :pep:`492`." -#: glossary.rst:137 +#: glossary.rst:129 msgid "attribute" msgstr "χαρακτηριστικό" -#: glossary.rst:139 +#: glossary.rst:131 msgid "" "A value associated with an object which is usually referenced by name using " "dotted expressions. For example, if an object *o* has an attribute *a* it " @@ -356,7 +334,7 @@ msgstr "" "χρησιμοποιώντας εκφράσεις με κουκκίδες. Για παράδειγμα, εάν ένα αντικείμενο " "*o* έχει ένα χαρακτηριστικό *a* θα αναφέρεται ως *o.a*." -#: glossary.rst:144 +#: glossary.rst:136 msgid "" "It is possible to give an object an attribute whose name is not an " "identifier as defined by :ref:`identifiers`, for example using :func:" @@ -371,11 +349,11 @@ msgstr "" "χρησιμοποιώντας τις τελείες, και αντί αυτού θα πρέπει να ανακτηθεί " "χρησιμοποιώντας :func:`getattr`." -#: glossary.rst:149 +#: glossary.rst:141 msgid "awaitable" msgstr "awaitable" -#: glossary.rst:151 +#: glossary.rst:143 msgid "" "An object that can be used in an :keyword:`await` expression. Can be a :" "term:`coroutine` or an object with an :meth:`~object.__await__` method. See " @@ -385,11 +363,11 @@ msgstr "" "Μπορεί να είναι :term:`coroutine` ή ένα αντικείμενο με μια :meth:`~object." "__await__` μέθοδο. Βλ. επίσης :pep:`492`." -#: glossary.rst:154 +#: glossary.rst:146 msgid "BDFL" msgstr "BDFL" -#: glossary.rst:156 +#: glossary.rst:148 msgid "" "Benevolent Dictator For Life, a.k.a. `Guido van Rossum `_, Python's creator." @@ -398,11 +376,11 @@ msgstr "" "ζωής, δηλαδή `Guido van Rossum `_, ο " "δημιουργός της Python." -#: glossary.rst:158 +#: glossary.rst:150 msgid "binary file" msgstr "δυαδικό αρχείο" -#: glossary.rst:160 +#: glossary.rst:152 msgid "" "A :term:`file object` able to read and write :term:`bytes-like objects " "`. Examples of binary files are files opened in binary " @@ -416,7 +394,7 @@ msgstr "" "data:`sys.stdin.buffer `, :data:`sys.stdout.buffer `, " "και στιγμιοτύπων των :class:`io.BytesIO` και :class:`gzip.GzipFile`." -#: glossary.rst:167 +#: glossary.rst:159 msgid "" "See also :term:`text file` for a file object able to read and write :class:" "`str` objects." @@ -424,11 +402,11 @@ msgstr "" "Βλ. επίσης :term:`text file` για ένα αντικείμενο τύπου αρχείο ικανό να " "διαβάσει και να γράψει :class:`str` αντικείμενα." -#: glossary.rst:169 +#: glossary.rst:161 msgid "borrowed reference" msgstr "δανεική αναφορά" -#: glossary.rst:171 +#: glossary.rst:163 msgid "" "In Python's C API, a borrowed reference is a reference to an object, where " "the code using the object does not own the reference. It becomes a dangling " @@ -442,7 +420,7 @@ msgstr "" "αφαιρέσει το τελευταίο :term:`strong reference` από το αντικείμενο και έτσι " "να το καταστρέψει." -#: glossary.rst:177 +#: glossary.rst:169 msgid "" "Calling :c:func:`Py_INCREF` on the :term:`borrowed reference` is recommended " "to convert it to a :term:`strong reference` in-place, except when the object " @@ -457,11 +435,11 @@ msgstr "" "c:func:`Py_NewRef` μπορεί να χρησιμοποιηθεί ώστε να δημιουργηθεί ένα :term:" "`ισχυρή αναφορά `." -#: glossary.rst:182 +#: glossary.rst:174 msgid "bytes-like object" msgstr "bytes-like αντικείμενα" -#: glossary.rst:184 +#: glossary.rst:176 msgid "" "An object that supports the :ref:`bufferobjects` and can export a C-:term:" "`contiguous` buffer. This includes all :class:`bytes`, :class:`bytearray`, " @@ -478,7 +456,7 @@ msgstr "" "διαχειρίζονται δυαδικά δεδομένα' αυτά περιλαμβάνουν συμπίεση αποθήκευση σε " "δυαδικό αρχείο και αποστολή μέσω socket." -#: glossary.rst:191 +#: glossary.rst:183 msgid "" "Some operations need the binary data to be mutable. The documentation often " "refers to these as \"read-write bytes-like objects\". Example mutable " @@ -497,11 +475,11 @@ msgstr "" "αυτών περιέχουν :class:`bytes` και ένα :class:`memoryview` ενός :class:" "`bytes` αντικειμένου." -#: glossary.rst:199 +#: glossary.rst:191 msgid "bytecode" msgstr "bytecode" -#: glossary.rst:201 +#: glossary.rst:193 msgid "" "Python source code is compiled into bytecode, the internal representation of " "a Python program in the CPython interpreter. The bytecode is also cached in " @@ -523,7 +501,7 @@ msgstr "" "εικονικών μηχανών Python, ούτε να είναι σταθερά μεταξύ των εκδόσεων της " "Python." -#: glossary.rst:211 +#: glossary.rst:203 msgid "" "A list of bytecode instructions can be found in the documentation for :ref:" "`the dis module `." @@ -531,11 +509,11 @@ msgstr "" "Μια λίστα από οδηγίες σχετικά με τα bytecode μπορεί να βρεθεί στην " "τεκμηρίωση για :ref:`το module dis `." -#: glossary.rst:213 +#: glossary.rst:205 msgid "callable" msgstr "callable" -#: glossary.rst:215 +#: glossary.rst:207 msgid "" "A callable is an object that can be called, possibly with a set of arguments " "(see :term:`argument`), with the following syntax::" @@ -543,11 +521,11 @@ msgstr "" "Ένα callable είναι ένα αντικείμενο που μπορεί να καλεστεί, πιθανά με ένα " "σύνολο ορισμάτων (βλ. :term:`argument`), με την παρακάτω σύνταξη::" -#: glossary.rst:218 +#: glossary.rst:210 msgid "callable(argument1, argument2, argumentN)" msgstr "callable(argument1, argument2, argumentN)" -#: glossary.rst:220 +#: glossary.rst:212 msgid "" "A :term:`function`, and by extension a :term:`method`, is a callable. An " "instance of a class that implements the :meth:`~object.__call__` method is " @@ -557,11 +535,11 @@ msgstr "" "Ένα στιγμιότυπο μια κλάσης που υλοποιεί τη μέθοδο :meth:`~object.__call__` " "είναι επίσης callable." -#: glossary.rst:223 +#: glossary.rst:215 msgid "callback" msgstr "callback" -#: glossary.rst:225 +#: glossary.rst:217 msgid "" "A subroutine function which is passed as an argument to be executed at some " "point in the future." @@ -569,11 +547,11 @@ msgstr "" "Μια subroutine συνάρτηση η οποία μεταβιβάζεται ως όρισμα που θα εκτελεστεί " "κάποια στιγμή στο μέλλον." -#: glossary.rst:227 +#: glossary.rst:219 msgid "class" msgstr "κλάση" -#: glossary.rst:229 +#: glossary.rst:221 msgid "" "A template for creating user-defined objects. Class definitions normally " "contain method definitions which operate on instances of the class." @@ -582,11 +560,11 @@ msgstr "" "ορισμοί κλάσεων συνήθως περιέχουν ορισμούς μεθόδων που λειτουργούν σε " "στιγμιότυπα της κλάσης." -#: glossary.rst:232 +#: glossary.rst:224 msgid "class variable" msgstr "μεταβλητή κλάσης" -#: glossary.rst:234 +#: glossary.rst:226 msgid "" "A variable defined in a class and intended to be modified only at class " "level (i.e., not in an instance of the class)." @@ -594,11 +572,72 @@ msgstr "" "Μια μεταβλητή που ορίζεται σε μια κλάση και προορίζεται να τροποποιηθεί μόνο " "σε επίπεδο κλάσης (δηλ. όχι σε ένα στιγμιότυπο μιας κλάσης)." -#: glossary.rst:236 +#: glossary.rst:228 +msgid "closure variable" +msgstr "μεταβλητή κλεισίματος" + +#: glossary.rst:230 +msgid "" +"A :term:`free variable` referenced from a :term:`nested scope` that is " +"defined in an outer scope rather than being resolved at runtime from the " +"globals or builtin namespaces. May be explicitly defined with the :keyword:" +"`nonlocal` keyword to allow write access, or implicitly defined if the " +"variable is only being read." +msgstr "" +"Ένας :term:`free variable` που αναφέρεται από ένα :term:`nested scope` και " +"ορίζεται σε μια εξωτερική περιοχή, αντί να επιλύεται δυναμικά κατά την " +"εκτέλεση από τα καθολικά ή ενσωματωμένα namespaces. Μπορεί να δηλωθεί ρητά " +"με τη δεσμευμένη λέξη-κλειδί :keyword:`nonlocal` ώστε να επιτραπεί η " +"εγγραφή, ή να θεωρηθεί ότι ορίζεται έμμεσα όταν η μεταβλητή χρησιμοποιείται " +"μόνο για ανάγνωση." + +#: glossary.rst:235 +msgid "" +"For example, in the ``inner`` function in the following code, both ``x`` and " +"``print`` are :term:`free variables `, but only ``x`` is a " +"*closure variable*::" +msgstr "" +"Για παράδειγμα, η συνάρτηση ``inner`` του παρακάτω κώδικα, τόσο η ``x`` όσο " +"και η ``print`` είναι :term:`free variables `, αλλά μόνο η " +"``x`` είναι μια *μεταβλητή κλεισίματος*::" + +#: glossary.rst:238 +msgid "" +"def outer():\n" +" x = 0\n" +" def inner():\n" +" nonlocal x\n" +" x += 1\n" +" print(x)\n" +" return inner" +msgstr "" +"def outer():\n" +" x = 0\n" +" def inner():\n" +" nonlocal x\n" +" x += 1\n" +" print(x)\n" +" return inner" + +#: glossary.rst:246 +msgid "" +"Due to the :attr:`codeobject.co_freevars` attribute (which, despite its " +"name, only includes the names of closure variables rather than listing all " +"referenced free variables), the more general :term:`free variable` term is " +"sometimes used even when the intended meaning is to refer specifically to " +"closure variables." +msgstr "" +"Λόγο του χαρακτηριστικού :attr:`codeobject.co_freevars` (το οποίο, παρά την " +"ονομασία του, περιλαμβάνει μόνο τα ονόματα των μεταβλητών κλεισίματος και " +"όχι όλες τις αναφερόμενες ελεύθερες μεταβλητές), χρησιμοποιείται μερικές " +"φορές ο πιο γενικός όρος :term:`free variable` ακόμη και όταν γίνεται ειδική " +"αναφορά σε μεταβλητές κλεισίματος." + +#: glossary.rst:250 msgid "complex number" msgstr "μιγαδικός αριθμός" -#: glossary.rst:238 +#: glossary.rst:252 msgid "" "An extension of the familiar real number system in which all numbers are " "expressed as a sum of a real part and an imaginary part. Imaginary numbers " @@ -622,45 +661,92 @@ msgstr "" "προηγμένο μαθηματικό χαρακτηριστικό. εάν δεν γνωρίζετε την ανάγκη τους, " "είναι σχεδόν σίγουρο ότι μπορείτε να τα αγνοήσετε με ασφάλεια." -#: glossary.rst:248 +#: glossary.rst:262 +msgid "context" +msgstr "context" + +#: glossary.rst:264 +msgid "" +"This term has different meanings depending on where and how it is used. Some " +"common meanings:" +msgstr "" +"Αυτό ο όρος έχει διαφορετικές σημασίες ανάλογα με το πού και πώς " +"χρησιμοποιείται. Μερικές κοινές έννοιες:" + +#: glossary.rst:267 +msgid "" +"The temporary state or environment established by a :term:`context manager` " +"via a :keyword:`with` statement." +msgstr "" +"Η προσωρινή κατάσταση ή το περιβάλλον που δημιουργείται από έναν :term:" +"`context manager` μέσω μιας δήλωσης :keyword:`with`." + +#: glossary.rst:269 +msgid "" +"The collection of key­value bindings associated with a particular :class:" +"`contextvars.Context` object and accessed via :class:`~contextvars." +"ContextVar` objects. Also see :term:`context variable`." +msgstr "" +"Το σύνολο των δεσμευμένων κλειδιού-τιμής που σχετίζονται με ένα συγκεκριμένο " +"αντικείμενο :class:`contextvars.Context` και προσπελάζονται μέσω " +"αντικειμένων :class:`~contextvars.ContextVar`. Βλ. επίσης :term:`context " +"variable`." + +#: glossary.rst:273 +msgid "" +"A :class:`contextvars.Context` object. Also see :term:`current context`." +msgstr "" +"Ένα αντικείμενο :class:`contextvars.Context`. Βλ. επίσης :term:`current " +"context`." + +#: glossary.rst:275 +msgid "context management protocol" +msgstr "πρωτόκολλο διαχείρισης περιβάλλοντος" + +#: glossary.rst:277 +msgid "" +"The :meth:`~object.__enter__` and :meth:`~object.__exit__` methods called by " +"the :keyword:`with` statement. See :pep:`343`." +msgstr "" +"Οι μέθοδοι :meth:`~object.__enter__` και :meth:`~object.__exit__` καλούνται " +"από τη δήλωση :keyword:`with`. Βλ. :pep:`343`." + +#: glossary.rst:279 msgid "context manager" msgstr "διαχειριστής context" -#: glossary.rst:250 +#: glossary.rst:281 msgid "" -"An object which controls the environment seen in a :keyword:`with` statement " -"by defining :meth:`~object.__enter__` and :meth:`~object.__exit__` methods. " -"See :pep:`343`." +"An object which implements the :term:`context management protocol` and " +"controls the environment seen in a :keyword:`with` statement. See :pep:" +"`343`." msgstr "" -"Ένα αντικείμενο που ελέγχει το περιβάλλον που εμφανίζεται σε μια δήλωση :" -"keyword:`with` ορίζοντας τις μεθόδους :meth:`~object.__enter__` και :meth:" -"`~object.__exit__`. Βλ. :pep:`343`." +"Ένα αντικείμενο που υλοποιεί το :term:`context management protocol` και " +"ελέγχει το περιβάλλον που είσαι ορατό μέσα σε μια δήλωση :keyword:`with`. " +"Βλ. :pep:`343`." -#: glossary.rst:253 +#: glossary.rst:284 msgid "context variable" msgstr "context μεταβλητή" -#: glossary.rst:255 +#: glossary.rst:286 msgid "" -"A variable which can have different values depending on its context. This is " -"similar to Thread-Local Storage in which each execution thread may have a " -"different value for a variable. However, with context variables, there may " -"be several contexts in one execution thread and the main usage for context " -"variables is to keep track of variables in concurrent asynchronous tasks. " -"See :mod:`contextvars`." +"A variable whose value depends on which context is the :term:`current " +"context`. Values are accessed via :class:`contextvars.ContextVar` objects. " +"Context variables are primarily used to isolate state between concurrent " +"asynchronous tasks." msgstr "" -"Μια μεταβλητή που μπορεί να έχει πολλές διαφορετικές τιμές ανάλογα με το " -"context. Αυτό είναι κοινό στο Thread-Local Storage όπου κάθε εκτέλεση του " -"νήματος μπορεί να έχει διαφορετική τιμή για μια μεταβλητή. Παρόλα αυτά, με " -"τις context μεταβλητές, μπορεί να υπάρχουν πολλά περιβάλλοντα σε ένα νήμα " -"εκτέλεσης και η κύρια χρήση για τις context μεταβλητές είναι η παρακολούθηση " -"των μεταβλητών σε ταυτόχρονες διεργασίες. Βλ. :mod:`contextvars`." +"Μια μεταβλητή της οποίας η τιμή εξαρτάται από το ποιο είναι το :term:" +"`current context`. Οι τιμές προσπελάζονται μέσω των αντικειμένων :class:" +"`contextvars.ContextVar`. Οι μεταβλητές συμφραζόμενων χρησιμοποιούνται " +"κυρίως για να απομονώσουν την κατάσταση μεταξύ ταυτόχρονων ασύγχρονων " +"εργασιών." -#: glossary.rst:262 +#: glossary.rst:290 msgid "contiguous" msgstr "contiguous" -#: glossary.rst:266 +#: glossary.rst:294 msgid "" "A buffer is considered contiguous exactly if it is either *C-contiguous* or " "*Fortran contiguous*. Zero-dimensional buffers are C and Fortran " @@ -679,11 +765,11 @@ msgstr "" "μνήμης. Ωστόσο, σε Fortran contiguous πίνακες, ο πρώτος δείκτης μεταβάλλεται " "πιο γρήγορα." -#: glossary.rst:274 +#: glossary.rst:302 msgid "coroutine" msgstr "coroutine" -#: glossary.rst:276 +#: glossary.rst:304 msgid "" "Coroutines are a more generalized form of subroutines. Subroutines are " "entered at one point and exited at another point. Coroutines can be " @@ -696,11 +782,11 @@ msgstr "" "Μπορούν να υλοποιήσουν με την δήλωση :keyword:`async def`. Βλ. επίσης :pep:" "`492`." -#: glossary.rst:281 +#: glossary.rst:309 msgid "coroutine function" msgstr "coroutine συνάρτηση" -#: glossary.rst:283 +#: glossary.rst:311 msgid "" "A function which returns a :term:`coroutine` object. A coroutine function " "may be defined with the :keyword:`async def` statement, and may contain :" @@ -712,11 +798,11 @@ msgstr "" "και μπορεί να περιέχει :keyword:`await`, :keyword:`async for`, και :keyword:" "`async with` λέξεις κλειδιά. Αυτές εισήχθησαν από το :pep:`492`." -#: glossary.rst:288 +#: glossary.rst:316 msgid "CPython" msgstr "CPython" -#: glossary.rst:290 +#: glossary.rst:318 msgid "" "The canonical implementation of the Python programming language, as " "distributed on `python.org `_. The term \"CPython\" " @@ -728,11 +814,32 @@ msgstr "" "όταν είναι απαραίτητο για την διάκριση αυτής της υλοποίησης από άλλες όπως η " "*Jython* ή η *IronPython*." -#: glossary.rst:294 +#: glossary.rst:322 +msgid "current context" +msgstr "τρέχον πλαίσιο" + +#: glossary.rst:324 +msgid "" +"The :term:`context` (:class:`contextvars.Context` object) that is currently " +"used by :class:`~contextvars.ContextVar` objects to access (get or set) the " +"values of :term:`context variables `. Each thread has its " +"own current context. Frameworks for executing asynchronous tasks (see :mod:" +"`asyncio`) associate each task with a context which becomes the current " +"context whenever the task starts or resumes execution." +msgstr "" +"Το :term:`context` (:class:`contextvars.Context` αντικείμενο) που " +"χρησιμοποιείται αυτή τη στιγμή από τα αντικείμενα :class:`~contextvars." +"ContextVar` για να προσπελάσει (να πάρει ή να ορίσει) τις τιμές των :term:" +"`context variables `. Κάθε νήμα έχει το δικό του τρέχον " +"συμφραζόμενο Τα πλαίσια για την εκτέλεση ασύγχρονων εργασιών (βλ. :mod:" +"`asyncio`) συνδέουν κάθε εργασία με ένα συμφραζόμενο, το οποίο γίνεται το " +"τρέχον συμφραζόμενο όποτε η εργασία ξεκινά ή συνεχίζει την εκτέλεση." + +#: glossary.rst:330 msgid "decorator" msgstr "decorator" -#: glossary.rst:296 +#: glossary.rst:332 msgid "" "A function returning another function, usually applied as a function " "transformation using the ``@wrapper`` syntax. Common examples for " @@ -743,7 +850,7 @@ msgstr "" "Συνηθισμένα παραδείγματα για τους decorators είναι :func:`classmethod` και :" "func:`staticmethod`." -#: glossary.rst:300 +#: glossary.rst:336 msgid "" "The decorator syntax is merely syntactic sugar, the following two function " "definitions are semantically equivalent::" @@ -751,7 +858,7 @@ msgstr "" "Η σύνταξη του decorator είναι απλώς καλλωπιστική, οι ακόλουθοι δύο ορισμοί " "συναρτήσεων είναι σημασιολογικά ισοδύναμοι::" -#: glossary.rst:303 +#: glossary.rst:339 msgid "" "def f(arg):\n" " ...\n" @@ -769,7 +876,7 @@ msgstr "" "def f(arg):\n" " ..." -#: glossary.rst:311 +#: glossary.rst:347 msgid "" "The same concept exists for classes, but is less commonly used there. See " "the documentation for :ref:`function definitions ` and :ref:`class " @@ -779,11 +886,11 @@ msgstr "" "εκεί. Βλ. την τεκμηρίωση για :ref:`function definitions ` και :ref:" "`class definitions ` για περισσότερα σχετικά με τους decorators." -#: glossary.rst:314 +#: glossary.rst:350 msgid "descriptor" msgstr "descriptor" -#: glossary.rst:316 +#: glossary.rst:352 msgid "" "Any object which defines the methods :meth:`~object.__get__`, :meth:`~object." "__set__`, or :meth:`~object.__delete__`. When a class attribute is a " @@ -806,7 +913,7 @@ msgstr "" "αποτελεί την βάση για πολλά χαρακτηριστικά όπως συναρτήσεις, μεθόδους, " "ιδιότητες, μέθοδοι κλάσης στατικές μέθοδοι, και αναφορά σε σούπερ κλάσεις." -#: glossary.rst:327 +#: glossary.rst:363 msgid "" "For more information about descriptors' methods, see :ref:`descriptors` or " "the :ref:`Descriptor How To Guide `." @@ -815,11 +922,11 @@ msgstr "" "see :ref:`descriptors` ή το :ref:`Πρακτικός οδηγός για τη χρήση του " "Descriptor `." -#: glossary.rst:329 +#: glossary.rst:365 msgid "dictionary" msgstr "λεξικό" -#: glossary.rst:331 +#: glossary.rst:367 msgid "" "An associative array, where arbitrary keys are mapped to values. The keys " "can be any object with :meth:`~object.__hash__` and :meth:`~object.__eq__` " @@ -829,11 +936,11 @@ msgstr "" "τιμές. Τα κλειδιά μπορεί να είναι οποιοδήποτε αντικείμενο με μεθόδους :meth:" "`~object.__hash__` και :meth:`~object.__eq__`. Ονομάζεται ως hash στο Perl." -#: glossary.rst:335 +#: glossary.rst:371 msgid "dictionary comprehension" msgstr "κατανόηση λεξικού" -#: glossary.rst:337 +#: glossary.rst:373 msgid "" "A compact way to process all or part of the elements in an iterable and " "return a dictionary with the results. ``results = {n: n ** 2 for n in " @@ -846,11 +953,11 @@ msgstr "" "κλειδί ``n`` που αντιστοιχίζεται με την τιμή ``n ** 2``. Βλ. :ref:" "`comprehensions`." -#: glossary.rst:341 +#: glossary.rst:377 msgid "dictionary view" msgstr "όψη λεξικού" -#: glossary.rst:343 +#: glossary.rst:379 msgid "" "The objects returned from :meth:`dict.keys`, :meth:`dict.values`, and :meth:" "`dict.items` are called dictionary views. They provide a dynamic view on the " @@ -865,11 +972,11 @@ msgstr "" "όψη λεξικού να γίνει μια πλήρης λίστα χρησιμοποιήστε το ``list(dictview)``. " "Βλ. :ref:`dict-views`." -#: glossary.rst:349 +#: glossary.rst:385 msgid "docstring" msgstr "docstring" -#: glossary.rst:351 +#: glossary.rst:387 msgid "" "A string literal which appears as the first expression in a class, function " "or module. While ignored when the suite is executed, it is recognized by " @@ -884,11 +991,11 @@ msgstr "" "περικλείει. Δεδομένου ότι είναι διαθέσιμο μέσω ενδοσκόπησης, το κανονικό " "μέρος για την τεκμηρίωση του αντικειμένου." -#: glossary.rst:357 +#: glossary.rst:393 msgid "duck-typing" msgstr "duck-typing" -#: glossary.rst:359 +#: glossary.rst:395 msgid "" "A programming style which does not look at an object's type to determine if " "it has the right interface; instead, the method or attribute is simply " @@ -911,11 +1018,11 @@ msgstr "" "με :term:`abstract base classes `.) Αντί αυτού, συνήθως " "χρησιμοποιεί δοκιμές :func:`hasattr` ή προγραμματισμό :term:`EAFP`." -#: glossary.rst:368 +#: glossary.rst:404 msgid "EAFP" msgstr "EAFP" -#: glossary.rst:370 +#: glossary.rst:406 msgid "" "Easier to ask for forgiveness than permission. This common Python coding " "style assumes the existence of valid keys or attributes and catches " @@ -932,11 +1039,11 @@ msgstr "" "αντίθεση με το στυλ που είναι :term:`LBYL` κοινό σε πολλές άλλες γλώσσες, " "όπως η C." -#: glossary.rst:376 +#: glossary.rst:412 msgid "expression" msgstr "έκφραση" -#: glossary.rst:378 +#: glossary.rst:414 msgid "" "A piece of syntax which can be evaluated to some value. In other words, an " "expression is an accumulation of expression elements like literals, names, " @@ -954,11 +1061,11 @@ msgstr "" "μπορούν να χρησιμοποιηθούν ως εκφράσεις, όπως το :keyword:`while`. Οι " "αναθέσεις τιμών είναι επίσης δηλώσεις όχι εκφράσεις." -#: glossary.rst:385 +#: glossary.rst:421 msgid "extension module" msgstr "module επέκτασης" -#: glossary.rst:387 +#: glossary.rst:423 msgid "" "A module written in C or C++, using Python's C API to interact with the core " "and with user code." @@ -966,11 +1073,11 @@ msgstr "" "Ένα module γραμμένο σε C ή C++, που χρησιμοποιείται από το C API της Python " "για να αλληλεπιδράσουν με τον πυρήνα και με τον κώδικα του χρήστη." -#: glossary.rst:389 +#: glossary.rst:425 msgid "f-string" msgstr "f-string" -#: glossary.rst:391 +#: glossary.rst:427 msgid "" "String literals prefixed with ``'f'`` or ``'F'`` are commonly called \"f-" "strings\" which is short for :ref:`formatted string literals `. " @@ -980,11 +1087,11 @@ msgstr "" "ονομάζονται συνήθως \"f-strings\" που είναι συντομογραφία του :ref:" "`formatted string literals `. Βλ. επίσης :pep:`498`." -#: glossary.rst:394 +#: glossary.rst:430 msgid "file object" msgstr "αντικείμενο αρχείου" -#: glossary.rst:396 +#: glossary.rst:432 msgid "" "An object exposing a file-oriented API (with methods such as :meth:`!read` " "or :meth:`!write`) to an underlying resource. Depending on the way it was " @@ -1001,7 +1108,7 @@ msgstr "" "buffers, sockets, pipes, κλπ.). Αντικείμενο αρχείου ονομάζονται επίσης :dfn:" "`file-like objects` ή :dfn:`streams`." -#: glossary.rst:404 +#: glossary.rst:440 msgid "" "There are actually three categories of file objects: raw :term:`binary files " "`, buffered :term:`binary files ` and :term:`text " @@ -1015,19 +1122,19 @@ msgstr "" "στην ενότητα :mod:`io`. Ο κανονικός τρόπος για να δημιουργήσετε ένα " "αντικείμενο αρχείου είναι χρησιμοποιώντας την συνάρτηση :func:`open`." -#: glossary.rst:409 +#: glossary.rst:445 msgid "file-like object" msgstr "αντικείμενο που μοιάζει με αρχείο" -#: glossary.rst:411 +#: glossary.rst:447 msgid "A synonym for :term:`file object`." msgstr "Ένα συνώνυμο με το :term:`file object`." -#: glossary.rst:412 +#: glossary.rst:448 msgid "filesystem encoding and error handler" msgstr "κωδικοποίηση συστήματος αρχείων και χειριστής σφαλμάτων" -#: glossary.rst:414 +#: glossary.rst:450 msgid "" "Encoding and error handler used by Python to decode bytes from the operating " "system and encode Unicode to the operating system." @@ -1036,7 +1143,7 @@ msgstr "" "την αποκωδικοποίηση των bytes από το λειτουργικό σύστημα και την " "κωδικοποίηση σε Unicode για το λειτουργικό σύστημα." -#: glossary.rst:417 +#: glossary.rst:453 msgid "" "The filesystem encoding must guarantee to successfully decode all bytes " "below 128. If the file system encoding fails to provide this guarantee, API " @@ -1047,7 +1154,7 @@ msgstr "" "αρχείων δεν παρέχει αυτήν την εγγύηση, οι συναρτήσεις API μπορούν να " "εγείρουν ένα :exc:`UnicodeError`." -#: glossary.rst:421 +#: glossary.rst:457 msgid "" "The :func:`sys.getfilesystemencoding` and :func:`sys." "getfilesystemencodeerrors` functions can be used to get the filesystem " @@ -1057,7 +1164,7 @@ msgstr "" "getfilesystemencodeerrors` μπορούν να χρησιμοποιηθούν για να λάβετε την " "κωδικοποίηση του συστήματος αρχείων και του χειριστή σφαλμάτων." -#: glossary.rst:425 +#: glossary.rst:461 msgid "" "The :term:`filesystem encoding and error handler` are configured at Python " "startup by the :c:func:`PyConfig_Read` function: see :c:member:`~PyConfig." @@ -1069,15 +1176,15 @@ msgstr "" "`~PyConfig.filesystem_encoding` και :c:member:`~PyConfig.filesystem_errors` " "μέλη του :c:type:`PyConfig`." -#: glossary.rst:430 +#: glossary.rst:466 msgid "See also the :term:`locale encoding`." msgstr "Βλ. επίσης το :term:`locale encoding`." -#: glossary.rst:431 +#: glossary.rst:467 msgid "finder" msgstr "finder" -#: glossary.rst:433 +#: glossary.rst:469 msgid "" "An object that tries to find the :term:`loader` for a module that is being " "imported." @@ -1085,7 +1192,7 @@ msgstr "" "Ένα αντικείμενο που προσπαθεί να βρει το :term:`loader` για ένα module που " "εισήχθη." -#: glossary.rst:436 +#: glossary.rst:472 msgid "" "There are two types of finder: :term:`meta path finders ` " "for use with :data:`sys.meta_path`, and :term:`path entry finders ` για χρήση με :data:`sys.path_hooks`." -#: glossary.rst:440 +#: glossary.rst:476 msgid "" "See :ref:`finders-and-loaders` and :mod:`importlib` for much more detail." msgstr "" "Βλ. :ref:`finders-and-loaders` και :mod:`importlib` για περισσότερες " "λεπτομέρειες." -#: glossary.rst:441 +#: glossary.rst:477 msgid "floor division" msgstr "ακέραια διαίρεση" -#: glossary.rst:443 +#: glossary.rst:479 msgid "" "Mathematical division that rounds down to nearest integer. The floor " "division operator is ``//``. For example, the expression ``11 // 4`` " @@ -1121,11 +1228,47 @@ msgstr "" "4`` κάνει ``-3`` επειδή αυτή είναι η στρογγυλοποίηση *προς τα κάτω* του " "``-2.75``. Βλ. :pep:`238`." -#: glossary.rst:448 +#: glossary.rst:484 +msgid "free threading" +msgstr "δωρεάν νήμα" + +#: glossary.rst:486 +msgid "" +"A threading model where multiple threads can run Python bytecode " +"simultaneously within the same interpreter. This is in contrast to the :" +"term:`global interpreter lock` which allows only one thread to execute " +"Python bytecode at a time. See :pep:`703`." +msgstr "" +"Ένα μοντέλο νημάτων όπου πολλά νήματα μπορούν να εκτελούν Python bytecode " +"ταυτόχρονα μέσα στον ίδιο διερμηνέα. Αυτό έρχεται σε αντίθεση με το :term:" +"`global interpreter lock`, το οποίο επιτρέπει σε ένα μόνο νήμα να εκτελεί " +"Python bytecode κάθε φορά. Δείτε το :pep:`703`." + +#: glossary.rst:490 +msgid "free variable" +msgstr "δωρεάν μεταβλητή" + +#: glossary.rst:492 +msgid "" +"Formally, as defined in the :ref:`language execution model `, a " +"free variable is any variable used in a namespace which is not a local " +"variable in that namespace. See :term:`closure variable` for an example. " +"Pragmatically, due to the name of the :attr:`codeobject.co_freevars` " +"attribute, the term is also sometimes used as a synonym for :term:`closure " +"variable`." +msgstr "" +"Τυπικά, όπως ορίζεται στο :ref:`language execution model `, μια " +"ελεύθερη μεταβλητή είναι οποιαδήποτε μεταβλητή χρησιμοποιείται σε ένα " +"namespace που δεν είναι τοπική μεταβλητή σε εκείνο το namespace. Δείτε το :" +"term:`closure variable` για παράδειγμα. Πρακτικά, λόγω του ονόματος του " +"χαρακτηριστικού :attr:`codeobject.co_freevars`, ο όρος χρησιμοποιείται " +"επίσης μερικές φορές ως συνώνυμο της :term:`closure variable`." + +#: glossary.rst:497 msgid "function" msgstr "συνάρτηση" -#: glossary.rst:450 +#: glossary.rst:499 msgid "" "A series of statements which returns some value to a caller. It can also be " "passed zero or more :term:`arguments ` which may be used in the " @@ -1137,16 +1280,16 @@ msgstr "" "` που μπορεί να χρησιμοποιηθεί για την εκτέλεση. Βλ. επίσης τις " "ενότητες :term:`parameter`, :term:`method`, και the :ref:`function`." -#: glossary.rst:454 +#: glossary.rst:503 msgid "function annotation" msgstr "συνάρτηση annotation" -#: glossary.rst:456 +#: glossary.rst:505 msgid "An :term:`annotation` of a function parameter or return value." msgstr "" "Ένας :term:`annotation` μιας παραμέτρου συνάρτησης ή μιας τιμής επιστροφής." -#: glossary.rst:458 +#: glossary.rst:507 msgid "" "Function annotations are usually used for :term:`type hints `: " "for example, this function is expected to take two :class:`int` arguments " @@ -1157,7 +1300,7 @@ msgstr "" "ορίσματα :class:`int` και επίσης αναμένεται να έχει μία επιστρεφόμενη τιμή :" "class:`int`::" -#: glossary.rst:463 +#: glossary.rst:512 msgid "" "def sum_two_numbers(a: int, b: int) -> int:\n" " return a + b" @@ -1165,12 +1308,12 @@ msgstr "" "def sum_two_numbers(a: int, b: int) -> int:\n" " return a + b" -#: glossary.rst:466 +#: glossary.rst:515 msgid "Function annotation syntax is explained in section :ref:`function`." msgstr "" "Η σύνταξη συνάρτησης annotation αναλύεται στην ενότητα :ref:`function`." -#: glossary.rst:468 +#: glossary.rst:517 msgid "" "See :term:`variable annotation` and :pep:`484`, which describe this " "functionality. Also see :ref:`annotations-howto` for best practices on " @@ -1180,11 +1323,11 @@ msgstr "" "λειτουργικότητα. Επίσης βλ. :ref:`annotations-howto` για τις καλύτερες " "πρακτικές δουλεύοντας με annotations." -#: glossary.rst:472 +#: glossary.rst:521 msgid "__future__" msgstr "__future__" -#: glossary.rst:474 +#: glossary.rst:523 msgid "" "A :ref:`future statement `, ``from __future__ import ``, " "directs the compiler to compile the current module using syntax or semantics " @@ -1203,7 +1346,7 @@ msgstr "" "προστέθηκε για πρώτη φορά στην γλώσσα και πότε θα γίνει (ή έγινε) η " "προεπιλογή::" -#: glossary.rst:482 +#: glossary.rst:531 msgid "" ">>> import __future__\n" ">>> __future__.division\n" @@ -1213,11 +1356,11 @@ msgstr "" ">>> __future__.division\n" "_Feature((2, 2, 0, 'alpha', 2), (3, 0, 0, 'alpha', 0), 8192)" -#: glossary.rst:485 +#: glossary.rst:534 msgid "garbage collection" msgstr "συλλογή απορριμάτων" -#: glossary.rst:487 +#: glossary.rst:536 msgid "" "The process of freeing memory when it is not used anymore. Python performs " "garbage collection via reference counting and a cyclic garbage collector " @@ -1230,11 +1373,11 @@ msgstr "" "τους κύκλους αναφοράς. Ο συλλέκτης απορριμάτων μπορεί να ελεγχθεί " "χρησιμοποιώντας το module :mod:`gc`." -#: glossary.rst:493 +#: glossary.rst:542 msgid "generator" msgstr "generator" -#: glossary.rst:495 +#: glossary.rst:544 msgid "" "A function which returns a :term:`generator iterator`. It looks like a " "normal function except that it contains :keyword:`yield` expressions for " @@ -1247,7 +1390,7 @@ msgstr "" "*for* ή που μπορούν να ανακτηθούν μία τη φορά με την συνάρτηση :func:`next` " "function." -#: glossary.rst:500 +#: glossary.rst:549 msgid "" "Usually refers to a generator function, but may refer to a *generator " "iterator* in some contexts. In cases where the intended meaning isn't " @@ -1258,15 +1401,15 @@ msgstr "" "επιδιωκόμενο νόημα δεν είναι σαφές, η χρήση των πλήρων όρων αποφεύγει την " "ασάφεια." -#: glossary.rst:503 +#: glossary.rst:552 msgid "generator iterator" msgstr "generator iterator" -#: glossary.rst:505 +#: glossary.rst:554 msgid "An object created by a :term:`generator` function." msgstr "Ένα αντικείμενο που δημιουργείται από μια συνάρτηση :term:`generator`." -#: glossary.rst:507 +#: glossary.rst:556 msgid "" "Each :keyword:`yield` temporarily suspends processing, remembering the " "execution state (including local variables and pending try-statements). " @@ -1279,23 +1422,23 @@ msgstr "" "συνεχίζει από εκεί που σταμάτησε (σε αντίθεση με τις συναρτήσεις που " "ξεκινούν από την αρχή σε κάθε επίκληση)." -#: glossary.rst:514 +#: glossary.rst:563 msgid "generator expression" msgstr "generator έκφραση" -#: glossary.rst:516 +#: glossary.rst:565 msgid "" -"An expression that returns an iterator. It looks like a normal expression " -"followed by a :keyword:`!for` clause defining a loop variable, range, and an " -"optional :keyword:`!if` clause. The combined expression generates values " -"for an enclosing function::" +"An :term:`expression` that returns an :term:`iterator`. It looks like a " +"normal expression followed by a :keyword:`!for` clause defining a loop " +"variable, range, and an optional :keyword:`!if` clause. The combined " +"expression generates values for an enclosing function::" msgstr "" -"Μια έκφραση που επιστρέφει έναν iterator. Μοιάζει με κανονική έκφραση που " -"ακολουθείται από μια πρόταση :keyword:`!for` που ορίζει μια μεταβλητή " -"βρόχου, ένα εύρος και μια προαιρετική πρόταση :keyword:`!if`. Η συνδυασμένη " -"έκφραση δημιουργεί τιμές για μια συνάρτηση εγκλεισμού::" +"Μια :term:`expression` που επιστρέφει έναν :term:`iterator`. Μοιάζει με " +"κανονική έκφραση που ακολουθείται από μια πρόταση :keyword:`!for` που ορίζει " +"μια μεταβλητή βρόχου, ένα εύρος και μια προαιρετική πρόταση :keyword:`!if`. " +"Η συνδυασμένη έκφραση δημιουργεί τιμές για μια συνάρτηση εγκλεισμού::" -#: glossary.rst:521 +#: glossary.rst:570 msgid "" ">>> sum(i*i for i in range(10)) # sum of squares 0, 1, 4, ... 81\n" "285" @@ -1303,11 +1446,11 @@ msgstr "" ">>> sum(i*i for i in range(10)) # sum of squares 0, 1, 4, ... 81\n" "285" -#: glossary.rst:523 +#: glossary.rst:572 msgid "generic function" msgstr "γενική συνάρτηση" -#: glossary.rst:525 +#: glossary.rst:574 msgid "" "A function composed of multiple functions implementing the same operation " "for different types. Which implementation should be used during a call is " @@ -1318,7 +1461,7 @@ msgstr "" "χρησιμοποιηθεί κατά τη διάρκεια μια κλήσης καθορίζεται από τον αλγόριθμο " "αποστολής." -#: glossary.rst:529 +#: glossary.rst:578 msgid "" "See also the :term:`single dispatch` glossary entry, the :func:`functools." "singledispatch` decorator, and :pep:`443`." @@ -1326,11 +1469,11 @@ msgstr "" "Βλ. επίσης την καταχώρηση του :term:`single dispatch`, τον decorator :func:" "`functools.singledispatch` και :pep:`443`." -#: glossary.rst:531 +#: glossary.rst:580 msgid "generic type" msgstr "γενικός τύπος" -#: glossary.rst:533 +#: glossary.rst:582 msgid "" "A :term:`type` that can be parameterized; typically a :ref:`container " "class` such as :class:`list` or :class:`dict`. Used for :" @@ -1341,7 +1484,7 @@ msgstr "" "Χρησιμοποιείται για :term:`type hints ` και :term:`annotations " "`." -#: glossary.rst:538 +#: glossary.rst:587 msgid "" "For more details, see :ref:`generic alias types`, :pep:" "`483`, :pep:`484`, :pep:`585`, and the :mod:`typing` module." @@ -1350,19 +1493,19 @@ msgstr "" "genericalias>` :pep:`483`, :pep:`484`, :pep:`585`, και το module :mod:" "`typing`." -#: glossary.rst:540 +#: glossary.rst:589 msgid "GIL" msgstr "GIL" -#: glossary.rst:542 +#: glossary.rst:591 msgid "See :term:`global interpreter lock`." msgstr "Βλ. :term:`global interpreter lock`." -#: glossary.rst:543 +#: glossary.rst:592 msgid "global interpreter lock" msgstr "global interpreter lock" -#: glossary.rst:545 +#: glossary.rst:594 msgid "" "The mechanism used by the :term:`CPython` interpreter to assure that only " "one thread executes Python :term:`bytecode` at a time. This simplifies the " @@ -1381,7 +1524,7 @@ msgstr "" "του μεγάλου μέρους του παραλληλισμού που παρέχουν οι μηχανές πολλαπλών " "επεξεργαστών." -#: glossary.rst:554 +#: glossary.rst:603 msgid "" "However, some extension modules, either standard or third-party, are " "designed so as to release the GIL when doing computationally intensive tasks " @@ -1393,26 +1536,29 @@ msgstr "" "εντατικών υπολογισμών όπως συμπίεση ή κατακερματισμός. Επίσης, το GIL " "απελευθερώνεται πάντα όταν εκτελείτε I/O." -#: glossary.rst:559 +#: glossary.rst:608 msgid "" -"Past efforts to create a \"free-threaded\" interpreter (one which locks " -"shared data at a much finer granularity) have not been successful because " -"performance suffered in the common single-processor case. It is believed " -"that overcoming this performance issue would make the implementation much " -"more complicated and therefore costlier to maintain." -msgstr "" -"Προηγούμενες προσπάθειες να δημιουργηθεί ένας διερμηνέας \"ελεύθερων-" -"νημάτων\" (αυτός που κλειδώνει τα κοινόχρηστα δεδομένα με πολύ πιο λεπτομερή " -"ευαισθησία) δεν ήταν επιτυχείς επειδή η απόδοση υποχώρησε στην κοινή " -"περίπτωση ενός επεξεργαστή. Πιστεύεται ότι η υπέρβαση αυτού του προβλήματος " -"απόδοσης θα κάνουν πολύ πιο περίπλοκη και επομένως πιο δαπανηρή στην " -"συντήρηση." - -#: glossary.rst:565 +"As of Python 3.13, the GIL can be disabled using the :option:`--disable-gil` " +"build configuration. After building Python with this option, code must be " +"run with :option:`-X gil=0 <-X>` or after setting the :envvar:`PYTHON_GIL=0 " +"` environment variable. This feature enables improved " +"performance for multi-threaded applications and makes it easier to use multi-" +"core CPUs efficiently. For more details, see :pep:`703`." +msgstr "" +"Από την έκδοση Python 3.13, ο GIL μπορεί να απενεργοποιηθεί χρησιμοποιώντας " +"τη ρύθμιση :option:`--disable-gil` κατά τη διαμόρφωση της κατασκευής. Μετά " +"την κατασκευή της Python με αυτήν με αυτήν την επιλογή, ο κώδικας πρέπει να " +"εκτελείται με την επιλογή :option:`-X gil=0 <-X>` ή αφού ρυθμιστεί η " +"μεταβλητή περιβάλλοντος :envvar:`PYTHON_GIL=0 `. Αυτή η " +"δυνατότητα επιτρέπει βελτιωμένη απόδοση για εφαρμογές πολλαπλών νημάτων και " +"διευκολύνει τη χρήση των επεξεργαστών πολλαπλών πυρήνων με αποδοτικό τρόπο. " +"Για περισσότερες λεπτομέρειες, δείτε το :pep:`703`." + +#: glossary.rst:614 msgid "hash-based pyc" msgstr "hash-based pyc" -#: glossary.rst:567 +#: glossary.rst:616 msgid "" "A bytecode cache file that uses the hash rather than the last-modified time " "of the corresponding source file to determine its validity. See :ref:`pyc-" @@ -1422,11 +1568,11 @@ msgstr "" "όχι τον χρόνο τροποποίησης του αντίστοιχου αρχείου προέλευσης για να " "προσδιορίσει την εγκυρότητα του. Βλ. :ref:`pyc-invalidation`." -#: glossary.rst:570 +#: glossary.rst:619 msgid "hashable" msgstr "hashable" -#: glossary.rst:572 +#: glossary.rst:621 msgid "" "An object is *hashable* if it has a hash value which never changes during " "its lifetime (it needs a :meth:`~object.__hash__` method), and can be " @@ -1440,7 +1586,7 @@ msgstr "" "που συγκρίνονται ως προς την ισότητα τους πρέπει να έχουν την ίδια τιμή " "κατακερματισμού." -#: glossary.rst:578 +#: glossary.rst:627 msgid "" "Hashability makes an object usable as a dictionary key and a set member, " "because these data structures use the hash value internally." @@ -1449,7 +1595,7 @@ msgstr "" "κλειδί λεξικού και ως μέλος ενός συνόλου, επειδή αυτές οι δομές δεδομένων " "χρησιμοποιούν τιμές κατακερματισμού." -#: glossary.rst:581 +#: glossary.rst:630 msgid "" "Most of Python's immutable built-in objects are hashable; mutable containers " "(such as lists or dictionaries) are not; immutable containers (such as " @@ -1466,11 +1612,11 @@ msgstr "" "μπορούν να κατακερματιστούν από προεπιλογή. Όλα συγκρίνονται άνισα εκτός από " "τον εαυτό τους) και η τιμή κατακερματισμού τους προέρχεται από το :func:`id`." -#: glossary.rst:588 +#: glossary.rst:637 msgid "IDLE" msgstr "IDLE" -#: glossary.rst:590 +#: glossary.rst:639 msgid "" "An Integrated Development and Learning Environment for Python. :ref:`idle` " "is a basic editor and interpreter environment which ships with the standard " @@ -1480,11 +1626,11 @@ msgstr "" "`idle` είναι ένα βασικό περιβάλλον επεξεργασίας και διερμηνέα που " "συνοδεύεται από την τυπική διανομή της Python." -#: glossary.rst:593 +#: glossary.rst:642 msgid "immortal" msgstr "Αθάνατο" -#: glossary.rst:595 +#: glossary.rst:644 msgid "" "*Immortal objects* are a CPython implementation detail introduced in :pep:" "`683`." @@ -1492,7 +1638,7 @@ msgstr "" "*Αθάνατα αντικείμενα* είναι μια λεπτομέρεια υλοποίησης της CPython που " "εισήχθη στην :pep:`683`." -#: glossary.rst:598 +#: glossary.rst:647 msgid "" "If an object is immortal, its :term:`reference count` is never modified, and " "therefore it is never deallocated while the interpreter is running. For " @@ -1502,11 +1648,11 @@ msgstr "" "τροποποιείται, και επομένως δεν εκχωρείται ποτέ ενώ εκτελείται ο διερμηνέας. " "Για παράδειγμα, :const:`True` και :const:`None` είναι αθάνατα στην CPython." -#: glossary.rst:601 +#: glossary.rst:650 msgid "immutable" msgstr "immutable" -#: glossary.rst:603 +#: glossary.rst:652 msgid "" "An object with a fixed value. Immutable objects include numbers, strings " "and tuples. Such an object cannot be altered. A new object has to be " @@ -1520,11 +1666,11 @@ msgstr "" "αποθηκευτεί μια διαφορετική τιμή. Παίζουν σημαντικό ρόλο σε μέρη όπου μια " "σταθερά απαιτείται, για παράδειγμα ως κλειδί σε ένα λεξικό." -#: glossary.rst:608 +#: glossary.rst:657 msgid "import path" msgstr "εισαγόμενο path" -#: glossary.rst:610 +#: glossary.rst:659 msgid "" "A list of locations (or :term:`path entries `) that are searched " "by the :term:`path based finder` for modules to import. During import, this " @@ -1537,11 +1683,11 @@ msgstr "" "από :data:`sys.path`, αλλά για τα υποπακέτα μπορεί επίσης να έρθει από το " "χαρακτηριστικό του πακέτου γονέα ``__path__``." -#: glossary.rst:615 +#: glossary.rst:664 msgid "importing" msgstr "εισαγωγή" -#: glossary.rst:617 +#: glossary.rst:666 msgid "" "The process by which Python code in one module is made available to Python " "code in another module." @@ -1549,11 +1695,11 @@ msgstr "" "Η διαδικασία κατά την οποία ο κώδικας της Python σε ένα module είναι " "διαθέσιμη στον κώδικα Python ενός άλλου module." -#: glossary.rst:619 +#: glossary.rst:668 msgid "importer" msgstr "εισαγωγέας" -#: glossary.rst:621 +#: glossary.rst:670 msgid "" "An object that both finds and loads a module; both a :term:`finder` and :" "term:`loader` object." @@ -1561,30 +1707,32 @@ msgstr "" "Ένα αντικείμενο μπορεί και να αναζητεί και να φορτώνει ένα module' και ένα :" "term:`finder` και :term:`loader` αντικείμενο." -#: glossary.rst:623 +#: glossary.rst:672 msgid "interactive" msgstr "διαδραστικός" -#: glossary.rst:625 +#: glossary.rst:674 msgid "" "Python has an interactive interpreter which means you can enter statements " "and expressions at the interpreter prompt, immediately execute them and see " "their results. Just launch ``python`` with no arguments (possibly by " "selecting it from your computer's main menu). It is a very powerful way to " -"test out new ideas or inspect modules and packages (remember ``help(x)``)." +"test out new ideas or inspect modules and packages (remember ``help(x)``). " +"For more on interactive mode, see :ref:`tut-interac`." msgstr "" "Η Python έχει έναν διαδραστικό διερμηνέα όπου σημαίνει ότι μπορείς να " "εισάγεις δηλώσεις και εκφράσεις στην εισαγωγή εντολών του διερμηνέα, " -"εκτελώντας τες άμεσα και εμφανίζοντας τα αντικείμενα. Απλώς εκκινήστε την " +"εκτελώντας τες άμεσα και εμφανίζοντας τα αποτελέσματα. Απλώς εκκινήστε την " "``python`` χωρίς ορίσματα (πιθανώς επιλέγοντας το από το κύριο μενού του " "υπολογιστή σας). Αποτελεί έναν αποδοτικό τρόπο για να δοκιμάστε νέες ιδέες ή " -"να εξετάστε λειτουργικές μονάδες και πακέτα (θυμηθείτε ``help(x)``)." +"να εξετάστε modules και πακέτα (θυμηθείτε ``help(x)``). Για περισσότερα " +"σχετικά με τη διαδραστική λειτουργία, δείτε :ref:`tut-interac`." -#: glossary.rst:631 +#: glossary.rst:681 msgid "interpreted" msgstr "interpreted" -#: glossary.rst:633 +#: glossary.rst:683 msgid "" "Python is an interpreted language, as opposed to a compiled one, though the " "distinction can be blurry because of the presence of the bytecode compiler. " @@ -1601,11 +1749,11 @@ msgstr "" "εντοπισμού σφαλμάτων από τις μεταγλωττισμένες, αν και τα προγράμματά τους " "γενικά εκτελούνται πιο αργά. Βλ. επίσης :term:`interactive`." -#: glossary.rst:640 +#: glossary.rst:690 msgid "interpreter shutdown" msgstr "τερματισμός λειτουργίας διερμηνέα" -#: glossary.rst:642 +#: glossary.rst:692 msgid "" "When asked to shut down, the Python interpreter enters a special phase where " "it gradually releases all allocated resources, such as modules and various " @@ -1627,7 +1775,7 @@ msgstr "" "βασίζεται ενδέχεται να μην λειτουργούν πλέον (συνήθη παραδείγματα είναι οι " "λειτουργικές μονάδες βιβλιοθήκης ή ο μηχανισμός ειδοποιήσεων)." -#: glossary.rst:651 +#: glossary.rst:701 msgid "" "The main reason for interpreter shutdown is that the ``__main__`` module or " "the script being run has finished executing." @@ -1635,11 +1783,11 @@ msgstr "" "Ο βασικός λόγος τερματισμού λειτουργίας του διερμηνέα είναι ότι το " "``__main__`` module ή ολοκληρώθηκε η εκτέλεση του κώδικα που έτρεχε." -#: glossary.rst:653 +#: glossary.rst:703 msgid "iterable" msgstr "iterable" -#: glossary.rst:655 +#: glossary.rst:705 msgid "" "An object capable of returning its members one at a time. Examples of " "iterables include all sequence types (such as :class:`list`, :class:`str`, " @@ -1656,7 +1804,7 @@ msgstr "" "__iter__` ή με μία μέθοδο :meth:`~object.__getitem__` που υλοποιεί τη " "σημασιολογία :term:`sequence`." -#: glossary.rst:663 +#: glossary.rst:713 msgid "" "Iterables can be used in a :keyword:`for` loop and in many other places " "where a sequence is needed (:func:`zip`, :func:`map`, ...). When an " @@ -1680,11 +1828,11 @@ msgstr "" "του βρόχου. Βλ. επίσης :term:`iterator`, :term:`sequence`, και :term:" "`generator`." -#: glossary.rst:673 +#: glossary.rst:723 msgid "iterator" msgstr "iterator" -#: glossary.rst:675 +#: glossary.rst:725 msgid "" "An object representing a stream of data. Repeated calls to the iterator's :" "meth:`~iterator.__next__` method (or passing it to the built-in function :" @@ -1719,23 +1867,26 @@ msgstr "" "εξαντλημένο αντικείμενο iterator που χρησιμοποιήθηκε στο προηγούμενο πέρασμα " "iteration , κάνοντας το να φαίνεται σαν ένα άδειο κοντέινερ." -#: glossary.rst:690 +#: glossary.rst:740 msgid "More information can be found in :ref:`typeiter`." msgstr "Περισσότερες πληροφορίες μπορούν να βρεθούν στο :ref:`typeiter`." -#: glossary.rst:694 +#: glossary.rst:744 msgid "" "CPython does not consistently apply the requirement that an iterator define :" -"meth:`~iterator.__iter__`." +"meth:`~iterator.__iter__`. And also please note that the free-threading " +"CPython does not guarantee the thread-safety of iterator operations." msgstr "" "Το CPython δεν εφαρμόζει με συνέπεια την απαίτηση να ορίζει ένας iterator :" -"meth:`~iterator.__iter__`." +"meth:`~iterator.__iter__`. Επίσης σημειώστε ότι η έκδοση CPython με ελεύθερη " +"υποστήριξη νημάτων δεν εγγυάται την ασφάλεια νημάτων για διαδικασίες με " +"iterators." -#: glossary.rst:696 +#: glossary.rst:749 msgid "key function" msgstr "συνάρτηση key" -#: glossary.rst:698 +#: glossary.rst:751 msgid "" "A key function or collation function is a callable that returns a value used " "for sorting or ordering. For example, :func:`locale.strxfrm` is used to " @@ -1747,7 +1898,7 @@ msgstr "" "κλειδιού ταξινόμησης που γνωρίζει τις συμβάσεις ταξινόμησης για " "συγκεκριμένες τοπικές ρυθμίσεις." -#: glossary.rst:703 +#: glossary.rst:756 msgid "" "A number of tools in Python accept key functions to control how elements are " "ordered or grouped. They include :func:`min`, :func:`max`, :func:`sorted`, :" @@ -1760,7 +1911,7 @@ msgstr "" "`heapq.merge`, :func:`heapq.nsmallest`, :func:`heapq. nlargest`, και :func:" "`itertools.groupby`." -#: glossary.rst:709 +#: glossary.rst:762 msgid "" "There are several ways to create a key function. For example. the :meth:" "`str.lower` method can serve as a key function for case insensitive sorts. " @@ -1780,19 +1931,19 @@ msgstr "" "TO` για παραδείγματα δημιουργίας και χρήσης βασικών " "συναρτήσεων." -#: glossary.rst:716 +#: glossary.rst:769 msgid "keyword argument" msgstr "όρισμα keyword" -#: glossary.rst:1024 +#: glossary.rst:1086 msgid "See :term:`argument`." msgstr "Βλ. :term:`argument`." -#: glossary.rst:719 +#: glossary.rst:772 msgid "lambda" msgstr "lambda" -#: glossary.rst:721 +#: glossary.rst:774 msgid "" "An anonymous inline function consisting of a single :term:`expression` which " "is evaluated when the function is called. The syntax to create a lambda " @@ -1803,11 +1954,11 @@ msgstr "" "τη δημιουργία μιας συνάρτησης lambda είναι ``lambda [parameters]: " "expression``" -#: glossary.rst:724 +#: glossary.rst:777 msgid "LBYL" msgstr "LBYL" -#: glossary.rst:726 +#: glossary.rst:779 msgid "" "Look before you leap. This coding style explicitly tests for pre-conditions " "before making calls or lookups. This style contrasts with the :term:`EAFP` " @@ -1819,7 +1970,7 @@ msgstr "" "έρχεται σε αντίθεση με την προσέγγιση :term:`EAFP` και χαρακτηρίζεται από " "την παρουσία πολλών δηλώσεων :keyword:`if`." -#: glossary.rst:731 +#: glossary.rst:784 msgid "" "In a multi-threaded environment, the LBYL approach can risk introducing a " "race condition between \"the looking\" and \"the leaping\". For example, " @@ -1834,19 +1985,19 @@ msgstr "" "το *mapping* μετά τη δοκιμή, αλλά πριν από την αναζήτηση. Αυτό το πρόβλημα " "μπορεί να λυθεί με κλειδώματα ή χρησιμοποιώντας την προσέγγιση EAFP." -#: glossary.rst:736 +#: glossary.rst:789 msgid "lexical analyzer" -msgstr "" +msgstr "λεξικός αναλυτής" -#: glossary.rst:739 +#: glossary.rst:792 msgid "Formal name for the *tokenizer*; see :term:`token`." -msgstr "" +msgstr "Επίσημη ονομασία για τον *tokenizer* · βλ. :term:`token`." -#: glossary.rst:740 +#: glossary.rst:793 msgid "list" msgstr "λίστα" -#: glossary.rst:742 +#: glossary.rst:795 msgid "" "A built-in Python :term:`sequence`. Despite its name it is more akin to an " "array in other languages than to a linked list since access to elements is " @@ -1856,11 +2007,11 @@ msgstr "" "περισσότερο με έναν πίνακα σε άλλες γλώσσες παρά με μια συνδεδεμένη λίστα, " "καθώς η πρόσβαση στα στοιχεί είναι *O*\\ (1)." -#: glossary.rst:745 +#: glossary.rst:798 msgid "list comprehension" msgstr "list comprehension" -#: glossary.rst:747 +#: glossary.rst:800 msgid "" "A compact way to process all or part of the elements in a sequence and " "return a list with the results. ``result = ['{:#04x}'.format(x) for x in " @@ -1875,11 +2026,11 @@ msgstr "" "από 0 έως 255. Η πρόταση :keyword:`if` είναι προαιρετική. Εάν παραλειφθεί, " "όλα τα στοιχεία στο ``range(256)`` υποβάλλονται σε επεξεργασία." -#: glossary.rst:753 +#: glossary.rst:806 msgid "loader" msgstr "loader" -#: glossary.rst:755 +#: glossary.rst:808 msgid "" "An object that loads a module. It must define the :meth:`!exec_module` and :" "meth:`!create_module` methods to implement the :class:`~importlib.abc." @@ -1891,23 +2042,23 @@ msgstr "" "class:`~importlib.abc.Loader`. Ένας loader συνήθως επιστρέφεται με ένα :term:" "`finder`. Δείτε επίσης:" -#: glossary.rst:761 +#: glossary.rst:814 msgid ":ref:`finders-and-loaders`" msgstr ":ref:`finders-and-loaders`" -#: glossary.rst:762 +#: glossary.rst:815 msgid ":class:`importlib.abc.Loader`" msgstr ":class:`importlib.abc.Loader`" -#: glossary.rst:763 +#: glossary.rst:816 msgid ":pep:`302`" msgstr ":pep:`302`" -#: glossary.rst:764 +#: glossary.rst:817 msgid "locale encoding" msgstr "τοπική κωδικοποίηση" -#: glossary.rst:766 +#: glossary.rst:819 msgid "" "On Unix, it is the encoding of the LC_CTYPE locale. It can be set with :func:" "`locale.setlocale(locale.LC_CTYPE, new_locale) `." @@ -1916,40 +2067,40 @@ msgstr "" "ρυθμιστεί με :func:`locale.setlocale(locale.LC_CTYPE, new_locale) `." -#: glossary.rst:769 +#: glossary.rst:822 msgid "On Windows, it is the ANSI code page (ex: ``\"cp1252\"``)." msgstr "Στα Windows, είναι η code page ANSI (π.χ. ``\"cp1252\"``)." -#: glossary.rst:771 +#: glossary.rst:824 msgid "" "On Android and VxWorks, Python uses ``\"utf-8\"`` as the locale encoding." msgstr "" "Στο Android και το VxWorks, η Python χρησιμοποιεί το ``\"utf-8\"`` ως τοπική " "κωδικοποίηση." -#: glossary.rst:773 +#: glossary.rst:826 msgid ":func:`locale.getencoding` can be used to get the locale encoding." msgstr "" ":func:`locale.getencoding` μπορεί να χρησιμοποιηθεί για την ανάκτηση της " "τοπικής κωδικοποίησης." -#: glossary.rst:775 +#: glossary.rst:828 msgid "See also the :term:`filesystem encoding and error handler`." msgstr "Βλ. επίσης το :term:`filesystem encoding and error handler`." -#: glossary.rst:776 +#: glossary.rst:829 msgid "magic method" msgstr "μαγική μέθοδος" -#: glossary.rst:780 +#: glossary.rst:833 msgid "An informal synonym for :term:`special method`." msgstr "Ένα άτυπο συνώνυμο για :term:`special method`." -#: glossary.rst:781 +#: glossary.rst:834 msgid "mapping" msgstr "mapping" -#: glossary.rst:783 +#: glossary.rst:836 msgid "" "A container object that supports arbitrary key lookups and implements the " "methods specified in the :class:`collections.abc.Mapping` or :class:" @@ -1965,11 +2116,11 @@ msgstr "" "class:`dict`, :class:`collections.defaultdict`, :class:`collections." "OrderedDict` και :class:`collections.Counter`." -#: glossary.rst:789 +#: glossary.rst:842 msgid "meta path finder" msgstr "meta path finder" -#: glossary.rst:791 +#: glossary.rst:844 msgid "" "A :term:`finder` returned by a search of :data:`sys.meta_path`. Meta path " "finders are related to, but different from :term:`path entry finders `." -#: glossary.rst:795 +#: glossary.rst:848 msgid "" "See :class:`importlib.abc.MetaPathFinder` for the methods that meta path " "finders implement." @@ -1987,11 +2138,11 @@ msgstr "" "Βλ. :class:`importlib.abc.MetaPathFinder` για τις μεθόδους που υλοποιούν οι " "meta path finders." -#: glossary.rst:797 +#: glossary.rst:850 msgid "metaclass" msgstr "μετα-κλάση" -#: glossary.rst:799 +#: glossary.rst:852 msgid "" "The class of a class. Class definitions create a class name, a class " "dictionary, and a list of base classes. The metaclass is responsible for " @@ -2015,15 +2166,15 @@ msgstr "" "ασφάλειας νημάτων, την παρακολούθηση δημιουργίας αντικειμένων, την υλοποίηση " "*singletons*, και πολλές άλλες εργασίες." -#: glossary.rst:809 +#: glossary.rst:862 msgid "More information can be found in :ref:`metaclasses`." msgstr "Περισσότερες πληροφορίες μπορούν να βρεθούν στο :ref:`metaclasses`." -#: glossary.rst:1165 +#: glossary.rst:1231 msgid "method" msgstr "μέθοδος" -#: glossary.rst:812 +#: glossary.rst:865 msgid "" "A function which is defined inside a class body. If called as an attribute " "of an instance of that class, the method will get the instance object as its " @@ -2035,11 +2186,11 @@ msgstr "" "αντικείμενο περίπτωσης ως πρώτο της :term:`argument` (το οποίο συνήθως " "ονομάζεται ``self``). Βλ. :term:`function` και :term:`nested scope`." -#: glossary.rst:816 +#: glossary.rst:869 msgid "method resolution order" msgstr "σειρά ανάλυσης μεθόδων" -#: glossary.rst:818 +#: glossary.rst:871 msgid "" "Method Resolution Order is the order in which base classes are searched for " "a member during lookup. See :ref:`python_2.3_mro` for details of the " @@ -2050,11 +2201,11 @@ msgstr "" "για λεπτομέρειες του αλγορίθμου που χρησιμοποιείται από τον διερμηνέα της " "Python από την έκδοση 2.3." -#: glossary.rst:821 +#: glossary.rst:874 msgid "module" msgstr "module" -#: glossary.rst:823 +#: glossary.rst:876 msgid "" "An object that serves as an organizational unit of Python code. Modules " "have a namespace containing arbitrary Python objects. Modules are loaded " @@ -2065,15 +2216,15 @@ msgstr "" "Python. Τα modules φορτώνονται στην Python με την διαδικασία :term:" "`importing`." -#: glossary.rst:827 +#: glossary.rst:880 msgid "See also :term:`package`." msgstr "Βλ. επίσης :term:`package`." -#: glossary.rst:828 +#: glossary.rst:881 msgid "module spec" msgstr "τεχνικές προδιαγραφές module" -#: glossary.rst:830 +#: glossary.rst:883 msgid "" "A namespace containing the import-related information used to load a module. " "An instance of :class:`importlib.machinery.ModuleSpec`." @@ -2082,23 +2233,23 @@ msgstr "" "που χρησιμοποιούνται για την φόρτωση ενός module. Μια περίπτωση του :class:" "`importlib.machinery.ModuleSpec`." -#: glossary.rst:833 +#: glossary.rst:886 msgid "See also :ref:`module-specs`." msgstr "Βλ. επίσης :ref:`module-specs`." -#: glossary.rst:834 +#: glossary.rst:887 msgid "MRO" msgstr "MRO" -#: glossary.rst:836 +#: glossary.rst:889 msgid "See :term:`method resolution order`." msgstr "Βλ. :term:`method resolution order`." -#: glossary.rst:837 +#: glossary.rst:890 msgid "mutable" msgstr "mutable" -#: glossary.rst:839 +#: glossary.rst:892 msgid "" "Mutable objects can change their value but keep their :func:`id`. See also :" "term:`immutable`." @@ -2106,11 +2257,11 @@ msgstr "" "Τα ευμετάβλητα αντικείμενα μπορούν να αλλάξουν τις τιμές αλλά να κρατήσουν " "τα :func:`id`. Βλ. επίσης :term:`immutable`." -#: glossary.rst:841 +#: glossary.rst:894 msgid "named tuple" msgstr "named tuple" -#: glossary.rst:843 +#: glossary.rst:896 msgid "" "The term \"named tuple\" applies to any type or class that inherits from " "tuple and whose indexable elements are also accessible using named " @@ -2121,7 +2272,7 @@ msgstr "" "ευρετηριοποιηθούν είναι προσβάσιμα χρησιμοποιώντας επώνυμα χαρακτηριστικά. " "Ο τύπος ή η κλάση μπορεί να έχει και άλλα χαρακτηριστικά." -#: glossary.rst:847 +#: glossary.rst:900 msgid "" "Several built-in types are named tuples, including the values returned by :" "func:`time.localtime` and :func:`os.stat`. Another example is :data:`sys." @@ -2131,7 +2282,7 @@ msgstr "" "που επιστρέφονται από :func:`time.localtime` και :func:`os.stat`. Ένα άλλο " "παράδειγμα είναι το :data:`sys.float_info`::" -#: glossary.rst:851 +#: glossary.rst:904 msgid "" ">>> sys.float_info[1] # indexed access\n" "1024\n" @@ -2147,7 +2298,7 @@ msgstr "" ">>> isinstance(sys.float_info, tuple) # kind of tuple\n" "True" -#: glossary.rst:858 +#: glossary.rst:911 msgid "" "Some named tuples are built-in types (such as the above examples). " "Alternatively, a named tuple can be created from a regular class definition " @@ -2166,11 +2317,11 @@ msgstr "" "τελευταίες τεχνικές προσθέτουν επίσης μερικές επιπλέον μεθόδους που μπορεί " "να μην βρεθούν σε χειρόγραφες ή ενσωματωμένες πλειάδες με όνομα." -#: glossary.rst:866 +#: glossary.rst:919 msgid "namespace" msgstr "namespace" -#: glossary.rst:868 +#: glossary.rst:921 msgid "" "The place where a variable is stored. Namespaces are implemented as " "dictionaries. There are the local, global and built-in namespaces as well " @@ -2192,11 +2343,11 @@ msgstr "" "seed` ή :func:`itertools.islice` καθιστά σαφές ότι αυτές οι συναρτήσεις " "υλοποιούνται από τα module :mod:`random` και :mod:`itertools`, αντίστοιχα." -#: glossary.rst:878 +#: glossary.rst:931 msgid "namespace package" msgstr "πακέτο namespace" -#: glossary.rst:880 +#: glossary.rst:933 msgid "" "A :term:`package` which serves only as a container for subpackages. " "Namespace packages may have no physical representation, and specifically are " @@ -2207,7 +2358,7 @@ msgstr "" "συγκεκριμένα να μην είναι σαν ένα :term:`regular package` επειδή δεν έχουν " "το ``__init__.py`` αρχείο." -#: glossary.rst:885 +#: glossary.rst:938 msgid "" "Namespace packages allow several individually installable packages to have a " "common parent package. Otherwise, it is recommended to use a :term:`regular " @@ -2217,22 +2368,22 @@ msgstr "" "εγκατάστασης μεμονωμένα να έχουν ένα κοινό γονικό πακέτο. Διαφορετικά, " "συνίσταται η χρήση ενός :term:`regular package`." -#: glossary.rst:888 +#: glossary.rst:941 msgid "" "For more information, see :pep:`420` and :ref:`reference-namespace-package`." msgstr "" "Για περισσότερες πληροφορίες, δείτε το :pep:`420` και το :ref:`reference-" "namespace-package`." -#: glossary.rst:890 +#: glossary.rst:943 msgid "See also :term:`module`." msgstr "Βλ. επίσης :term:`module`." -#: glossary.rst:891 +#: glossary.rst:944 msgid "nested scope" msgstr "nested scope" -#: glossary.rst:893 +#: glossary.rst:946 msgid "" "The ability to refer to a variable in an enclosing definition. For " "instance, a function defined inside another function can refer to variables " @@ -2249,11 +2400,11 @@ msgstr "" "Ομοίως, οι καθολικές μεταβλητές διαβάζουν και γράφουν στον καθολικό χώρο " "ονομάτων. Το :keyword:`nonlocal` επιτρέπει την εγγραφή σε εξωτερικά πεδία." -#: glossary.rst:900 +#: glossary.rst:953 msgid "new-style class" msgstr "κλάση νέου στυλ" -#: glossary.rst:902 +#: glossary.rst:955 msgid "" "Old name for the flavor of classes now used for all class objects. In " "earlier Python versions, only new-style classes could use Python's newer, " @@ -2266,11 +2417,11 @@ msgstr "" "όπως :attr:`~object.__slots__`, descriptors, ιδιότητες :meth:`~object." "__getattribute__`, μέθοδοι κλάσης, και στατικές μέθοδοι." -#: glossary.rst:907 +#: glossary.rst:960 msgid "object" msgstr "αντικείμενο" -#: glossary.rst:909 +#: glossary.rst:962 msgid "" "Any data with state (attributes or value) and defined behavior (methods). " "Also the ultimate base class of any :term:`new-style class`." @@ -2279,11 +2430,35 @@ msgstr "" "συμπεριφορά (μέθοδοι). Επίσης, η τελική βασική κλάση οποιασδήποτε :term:`new-" "style class`." -#: glossary.rst:912 +#: glossary.rst:965 +msgid "optimized scope" +msgstr "βελτιστοποιημένο πεδίο ορατότητας (scope)" + +#: glossary.rst:967 +msgid "" +"A scope where target local variable names are reliably known to the compiler " +"when the code is compiled, allowing optimization of read and write access to " +"these names. The local namespaces for functions, generators, coroutines, " +"comprehensions, and generator expressions are optimized in this fashion. " +"Note: most interpreter optimizations are applied to all scopes, only those " +"relying on a known set of local and nonlocal variable names are restricted " +"to optimized scopes." +msgstr "" +"Ένα πεδίο ορατότητας (scope) όπου τα ονόματα των τοπικών μεταβλητών είναι " +"γνωστό με βεβαιότητα στον μεταγλωττιστή κατά τη μεταγλώττιση του κώδικα, " +"επιτρέποντας τη βελτιστοποίηση της πρόσβασης για ανάγνωση και εγγραφή σε " +"αυτά τα ονόματα. Οι τοπικοί χώροι ονομάτων για συναρτήσεις, γεννήτριες, " +"συναρτήσεις coroutine, συμπτύξεις (comprehensions) και εκφράσεις γεννητριών " +"βελτιστοποιούνται με αυτόν τον τρόπο. Σημείωση: οι περισσότερες " +"βελτιστοποιήσεις του διερμηνέα εφαρμόζονται σε όλα τα πεδία ορατότητας· μόνο " +"εκείνες που βασίζονται σε γνωστό σύνολο τοπικών και μη τοπικών μεταβλητών " +"περιορίζονται σε βελτιστοποιημένα πεδία ορατότητας." + +#: glossary.rst:974 msgid "package" msgstr "πακέτο" -#: glossary.rst:914 +#: glossary.rst:976 msgid "" "A Python :term:`module` which can contain submodules or recursively, " "subpackages. Technically, a package is a Python module with a ``__path__`` " @@ -2293,15 +2468,15 @@ msgstr "" "υποπακέτα. Τεχνικά, ένα πακέτο είναι μια λειτουργική μονάδα Python με ένα " "``__path__`` χαρακτηριστικό." -#: glossary.rst:918 +#: glossary.rst:980 msgid "See also :term:`regular package` and :term:`namespace package`." msgstr "Βλ. επίσης :term:`regular package` και :term:`namespace package`." -#: glossary.rst:919 +#: glossary.rst:981 msgid "parameter" msgstr "παράμετρος" -#: glossary.rst:921 +#: glossary.rst:983 msgid "" "A named entity in a :term:`function` (or method) definition that specifies " "an :term:`argument` (or in some cases, arguments) that the function can " @@ -2311,7 +2486,7 @@ msgstr "" "καθορίζει ένα :term:`argument` (ή σε ορισμένες περιπτώσεις, ορίσματα) που " "μπορεί να δεχθεί η συνάρτηση. Υπάρχουν πέντε είδη παραμέτρων:" -#: glossary.rst:925 +#: glossary.rst:987 msgid "" ":dfn:`positional-or-keyword`: specifies an argument that can be passed " "either :term:`positionally ` or as a :term:`keyword argument " @@ -2323,11 +2498,11 @@ msgstr "" "`. Αυτό είναι το προεπιλεγμένο είδος παραμέτρου, για παράδειγμα " "*foo* και *bar* στα ακόλουθα::" -#: glossary.rst:930 +#: glossary.rst:992 msgid "def func(foo, bar=None): ..." msgstr "def func(foo, bar=None): ..." -#: glossary.rst:934 +#: glossary.rst:996 msgid "" ":dfn:`positional-only`: specifies an argument that can be supplied only by " "position. Positional-only parameters can be defined by including a ``/`` " @@ -2339,11 +2514,11 @@ msgstr "" "χαρακτήρα ``/`` στη λίστα παραμέτρων του ορισμού συνάρτησης μετά από αυτές, " "για παράδειγμα *posonly1* και *posonly2* στα εξής::" -#: glossary.rst:939 +#: glossary.rst:1001 msgid "def func(posonly1, posonly2, /, positional_or_keyword): ..." msgstr "def func(posonly1, posonly2, /, positional_or_keyword): ..." -#: glossary.rst:943 +#: glossary.rst:1005 msgid "" ":dfn:`keyword-only`: specifies an argument that can be supplied only by " "keyword. Keyword-only parameters can be defined by including a single var-" @@ -2357,11 +2532,11 @@ msgstr "" "του ορισμού συνάρτησης πριν από αυτές, για παράδειγμα *kw_only1* και " "*kw_only2* στα ακόλουθα::" -#: glossary.rst:949 +#: glossary.rst:1011 msgid "def func(arg, *, kw_only1, kw_only2): ..." msgstr "def func(arg, *, kw_only1, kw_only2): ..." -#: glossary.rst:951 +#: glossary.rst:1013 msgid "" ":dfn:`var-positional`: specifies that an arbitrary sequence of positional " "arguments can be provided (in addition to any positional arguments already " @@ -2375,11 +2550,11 @@ msgstr "" "προσαρτώντας το όνομα της παραμέτρου με ``*``, για παράδειγμα *args* στα " "ακόλουθα::" -#: glossary.rst:957 +#: glossary.rst:1019 msgid "def func(*args, **kwargs): ..." msgstr "def func(*args, **kwargs): ..." -#: glossary.rst:959 +#: glossary.rst:1021 msgid "" ":dfn:`var-keyword`: specifies that arbitrarily many keyword arguments can be " "provided (in addition to any keyword arguments already accepted by other " @@ -2392,7 +2567,7 @@ msgstr "" "οριστεί προσαρτώντας το όνομα της παραμέτρου με ``**``, για παράδειγμα " "*kwargs* όπως παραπάνω." -#: glossary.rst:965 +#: glossary.rst:1027 msgid "" "Parameters can specify both optional and required arguments, as well as " "default values for some optional arguments." @@ -2401,7 +2576,7 @@ msgstr "" "απαιτούμενα ορίσματα , καθώς και προεπιλεγμένες τιμές για ορισμένα " "προαιρετικά ορίσματα." -#: glossary.rst:968 +#: glossary.rst:1030 msgid "" "See also the :term:`argument` glossary entry, the FAQ question on :ref:`the " "difference between arguments and parameters `, " @@ -2413,11 +2588,11 @@ msgstr "" "parameter>`, την κλάση :class:`inspect.Parameter`, την ενότητα :ref:" "`function` και :pep:`362`." -#: glossary.rst:972 +#: glossary.rst:1034 msgid "path entry" msgstr "path entry" -#: glossary.rst:974 +#: glossary.rst:1036 msgid "" "A single location on the :term:`import path` which the :term:`path based " "finder` consults to find modules for importing." @@ -2425,11 +2600,11 @@ msgstr "" "Μια μεμονωμένη τοποθεσία στο :term:`import path` την οποία συμβουλεύεται ο :" "term:`path based finder` για να βρει modules για εισαγωγή." -#: glossary.rst:976 +#: glossary.rst:1038 msgid "path entry finder" msgstr "path entry finder" -#: glossary.rst:978 +#: glossary.rst:1040 msgid "" "A :term:`finder` returned by a callable on :data:`sys.path_hooks` (i.e. a :" "term:`path entry hook`) which knows how to locate modules given a :term:" @@ -2439,7 +2614,7 @@ msgstr "" "path_hooks` (δηλαδή ένα :term:`path entry hook`) που ξέρει πως να εντοπίζει " "modules με :term:`path entry`." -#: glossary.rst:982 +#: glossary.rst:1044 msgid "" "See :class:`importlib.abc.PathEntryFinder` for the methods that path entry " "finders implement." @@ -2447,11 +2622,11 @@ msgstr "" "Βλ. :class:`importlib.abc.PathEntryFinder` για τις μεθόδους που ο entry " "finder διαδρομής υλοποιεί." -#: glossary.rst:984 +#: glossary.rst:1046 msgid "path entry hook" msgstr "path entry hook" -#: glossary.rst:986 +#: glossary.rst:1048 msgid "" "A callable on the :data:`sys.path_hooks` list which returns a :term:`path " "entry finder` if it knows how to find modules on a specific :term:`path " @@ -2461,11 +2636,11 @@ msgstr "" "term:`path entry finder` εάν ξέρει πως να βρίσκει module σε μια " "συγκεκριμένη :term:`path entry`." -#: glossary.rst:989 +#: glossary.rst:1051 msgid "path based finder" msgstr "path based finder" -#: glossary.rst:991 +#: glossary.rst:1053 msgid "" "One of the default :term:`meta path finders ` which " "searches an :term:`import path` for modules." @@ -2473,11 +2648,11 @@ msgstr "" "Ένα από τα προεπιλεγμένα :term:`meta path finders ` που " "αναζητά ένα :term:`import path` για modules." -#: glossary.rst:993 +#: glossary.rst:1055 msgid "path-like object" msgstr "path-like αντικείμενο" -#: glossary.rst:995 +#: glossary.rst:1057 msgid "" "An object representing a file system path. A path-like object is either a :" "class:`str` or :class:`bytes` object representing a path, or an object " @@ -2498,11 +2673,11 @@ msgstr "" "ενός αποτελέσματος :class:`str` ή :class:`bytes`, αντίστοιχα. Εισήχθη από " "τον :pep:`519`." -#: glossary.rst:1003 +#: glossary.rst:1065 msgid "PEP" msgstr "PEP" -#: glossary.rst:1005 +#: glossary.rst:1067 msgid "" "Python Enhancement Proposal. A PEP is a design document providing " "information to the Python community, or describing a new feature for Python " @@ -2515,7 +2690,7 @@ msgstr "" "μια συνοπτική τεχνική προδιαγραφή και μια λογική για τα προτεινόμενα " "χαρακτηριστικά." -#: glossary.rst:1011 +#: glossary.rst:1073 msgid "" "PEPs are intended to be the primary mechanisms for proposing major new " "features, for collecting community input on an issue, and for documenting " @@ -2529,15 +2704,15 @@ msgstr "" "στην Python. Ο συγγραφέας του PEP είναι υπεύθυνος για την οικοδόμηση " "συναίνεσης εντός της κοινότητας και την τεκμηρίωση αντίθετων απόψεων." -#: glossary.rst:1017 +#: glossary.rst:1079 msgid "See :pep:`1`." msgstr "Βλ. :pep:`1`." -#: glossary.rst:1018 +#: glossary.rst:1080 msgid "portion" msgstr "τμήμα" -#: glossary.rst:1020 +#: glossary.rst:1082 msgid "" "A set of files in a single directory (possibly stored in a zip file) that " "contribute to a namespace package, as defined in :pep:`420`." @@ -2546,15 +2721,15 @@ msgstr "" "αρχείο *zip*) που συμβάλλουν σε ένα namespace πακέτο, όπως ορίζεται στο :pep:" "`420`." -#: glossary.rst:1022 +#: glossary.rst:1084 msgid "positional argument" msgstr "όρισμα θέσης" -#: glossary.rst:1025 +#: glossary.rst:1087 msgid "provisional API" msgstr "provisional API" -#: glossary.rst:1027 +#: glossary.rst:1089 msgid "" "A provisional API is one which has been deliberately excluded from the " "standard library's backwards compatibility guarantees. While major changes " @@ -2573,7 +2748,7 @@ msgstr "" "αποκαλυφθούν σοβαρά θεμελιώδη ελαττώματα που παραλείφθηκαν πριν από τη " "συμπερίληψη του API." -#: glossary.rst:1036 +#: glossary.rst:1098 msgid "" "Even for provisional APIs, backwards incompatible changes are seen as a " "\"solution of last resort\" - every attempt will still be made to find a " @@ -2583,7 +2758,7 @@ msgstr "" "\"λύση έσχατης ανάγκης\"- θα εξακολουθεί να γίνεται κάθε προσπάθεια για να " "βρεθεί μια λύση backwards συμβατή σε τυχόν εντοπισμένα προβλήματα." -#: glossary.rst:1040 +#: glossary.rst:1102 msgid "" "This process allows the standard library to continue to evolve over time, " "without locking in problematic design errors for extended periods of time. " @@ -2594,19 +2769,19 @@ msgstr "" "σφάλματα σχεδιασμού για εκτεταμένες χρονικές περιόδους. Βλ. :pep:`411` για " "περισσότερες λεπτομέρειες." -#: glossary.rst:1043 +#: glossary.rst:1105 msgid "provisional package" msgstr "provisional πακέτο" -#: glossary.rst:1045 +#: glossary.rst:1107 msgid "See :term:`provisional API`." msgstr "Βλ. :term:`provisional API`." -#: glossary.rst:1046 +#: glossary.rst:1108 msgid "Python 3000" msgstr "Python 3000" -#: glossary.rst:1048 +#: glossary.rst:1110 msgid "" "Nickname for the Python 3.x release line (coined long ago when the release " "of version 3 was something in the distant future.) This is also abbreviated " @@ -2616,11 +2791,11 @@ msgstr "" "όταν η κυκλοφορία της έκδοσης 3 ήταν κάτι στο μακρινό μέλλον.) Αυτό " "ονομάζεται επίσης ως συντομογραφία \"Py3k\"." -#: glossary.rst:1051 +#: glossary.rst:1113 msgid "Pythonic" msgstr "Pythonic" -#: glossary.rst:1053 +#: glossary.rst:1115 msgid "" "An idea or piece of code which closely follows the most common idioms of the " "Python language, rather than implementing code using concepts common to " @@ -2637,7 +2812,7 @@ msgstr "" "κατασκευής, έτσι οι άνθρωποι που δεν είναι εξοικειωμένοι με την Python " "χρησιμοποιούν μερικές φορές έναν αριθμητικό μετρητή::" -#: glossary.rst:1060 +#: glossary.rst:1122 msgid "" "for i in range(len(food)):\n" " print(food[i])" @@ -2645,11 +2820,11 @@ msgstr "" "for i in range(len(food)):\n" " print(food[i])" -#: glossary.rst:1063 +#: glossary.rst:1125 msgid "As opposed to the cleaner, Pythonic method::" msgstr "Αντίθετα, μια πιο καθαρή μέθοδος Pythonic::" -#: glossary.rst:1065 +#: glossary.rst:1127 msgid "" "for piece in food:\n" " print(piece)" @@ -2657,11 +2832,11 @@ msgstr "" "for piece in food:\n" " print(piece)" -#: glossary.rst:1067 +#: glossary.rst:1129 msgid "qualified name" msgstr "αναγνωρισμένο όνομα" -#: glossary.rst:1069 +#: glossary.rst:1131 msgid "" "A dotted name showing the \"path\" from a module's global scope to a class, " "function or method defined in that module, as defined in :pep:`3155`. For " @@ -2673,7 +2848,7 @@ msgstr "" "ενότητα, όπως ορίζεται στο :pep:`3155`. Για συναρτήσεις και κλάσεις ανώτατου " "επιπέδου, το αναγνωρισμένο όνομα είναι ίδιο με το όνομα του αντικειμένου::" -#: glossary.rst:1074 +#: glossary.rst:1136 msgid "" ">>> class C:\n" "... class D:\n" @@ -2699,7 +2874,7 @@ msgstr "" ">>> C.D.meth.__qualname__\n" "'C.D.meth'" -#: glossary.rst:1086 +#: glossary.rst:1148 msgid "" "When used to refer to modules, the *fully qualified name* means the entire " "dotted path to the module, including any parent packages, e.g. ``email.mime." @@ -2709,7 +2884,7 @@ msgstr "" "όνομα* σημαίνει ολόκληρο το διακεκομμένο path προς το module, " "συμπεριλαμβανομένων τυχόν γονικών πακέτων π.χ. ``email.mime.text``::" -#: glossary.rst:1090 +#: glossary.rst:1152 msgid "" ">>> import email.mime.text\n" ">>> email.mime.text.__name__\n" @@ -2719,34 +2894,34 @@ msgstr "" ">>> email.mime.text.__name__\n" "'email.mime.text'" -#: glossary.rst:1093 +#: glossary.rst:1155 msgid "reference count" msgstr "πλήθος αναφοράς" -#: glossary.rst:1095 +#: glossary.rst:1157 msgid "" "The number of references to an object. When the reference count of an " -"object drops to zero, it is deallocated. Some objects are \"immortal\" and " -"have reference counts that are never modified, and therefore the objects are " -"never deallocated. Reference counting is generally not visible to Python " -"code, but it is a key element of the :term:`CPython` implementation. " +"object drops to zero, it is deallocated. Some objects are :term:`immortal` " +"and have reference counts that are never modified, and therefore the objects " +"are never deallocated. Reference counting is generally not visible to " +"Python code, but it is a key element of the :term:`CPython` implementation. " "Programmers can call the :func:`sys.getrefcount` function to return the " "reference count for a particular object." msgstr "" "Ο αριθμός των αναφορών σε ένα αντικείμενο. Όταν το πλήθος αναφορών ενός " -"αντικειμένου πέσει στο μηδέν, κατανέμεται. Μερικά αντικείμενα είναι " -"\"αθάνατα\" και έχουν πλήθος αναφορών που δεν τροποποιούνται ποτέ και " +"αντικειμένου πέσει στο μηδέν, κατανέμεται. Μερικά αντικείμενα είναι :term:" +"`immortal` και έχουν πλήθος αναφορών που δεν τροποποιούνται ποτέ και " "επομένως τα αντικείμενα δεν κατανέμονται ποτέ. Η καταμέτρηση αναφορών γενικά " -"δεν είναι ορατή στον κώδικα της Python. αλλά είναι βασικοί στοιχείο της " +"δεν είναι ορατή στον κώδικα της Python, αλλά είναι βασικό στοιχείο της " "υλοποίησης :term:`CPython`. Οι προγραμματιστές μπορούν να καλέσουν τη " "συνάρτηση :func:`sys.getrefcount` για να επιστρέψουν το πλήθος αναφοράς για " "ένα συγκεκριμένο αντικείμενο." -#: glossary.rst:1103 +#: glossary.rst:1165 msgid "regular package" msgstr "κανονικό πακέτο" -#: glossary.rst:1105 +#: glossary.rst:1167 msgid "" "A traditional :term:`package`, such as a directory containing an ``__init__." "py`` file." @@ -2754,15 +2929,27 @@ msgstr "" "Ένα παραδοσιακό :term:`package`, όπως ένας κατάλογος που περιέχει ένα " "``__init__.py`` αρχείο." -#: glossary.rst:1108 +#: glossary.rst:1170 msgid "See also :term:`namespace package`." msgstr "Βλ. επίσης :term:`namespace package`." -#: glossary.rst:1109 +#: glossary.rst:1171 +msgid "REPL" +msgstr "REPL" + +#: glossary.rst:1173 +msgid "" +"An acronym for the \"read–eval–print loop\", another name for the :term:" +"`interactive` interpreter shell." +msgstr "" +"Ακρωνύμιο του \"read–eval–print loop\", άλλη ονομασία για το :term:" +"`interactive` περιβάλλον του διερμηνέα." + +#: glossary.rst:1175 msgid "__slots__" msgstr "__slots__" -#: glossary.rst:1111 +#: glossary.rst:1177 msgid "" "A declaration inside a class that saves memory by pre-declaring space for " "instance attributes and eliminating instance dictionaries. Though popular, " @@ -2776,11 +2963,11 @@ msgstr "" "σωστή και προορίζεται καλύτερα για σπάνιες περιπτώσεις όπου υπάρχει μεγάλος " "αριθμός στιγμιοτύπων σε μια εφαρμογή κρίσιμης-μνήμης." -#: glossary.rst:1116 +#: glossary.rst:1182 msgid "sequence" msgstr "ακολουθία" -#: glossary.rst:1118 +#: glossary.rst:1184 msgid "" "An :term:`iterable` which supports efficient element access using integer " "indices via the :meth:`~object.__getitem__` special method and defines a :" @@ -2801,7 +2988,7 @@ msgstr "" "ακολουθία επειδή οι αναζητήσεις χρησιμοποιούν αυθαίρετα :term:`hashable` " "κλειδιά παρά ακέραιοι." -#: glossary.rst:1127 +#: glossary.rst:1193 msgid "" "The :class:`collections.abc.Sequence` abstract base class defines a much " "richer interface that goes beyond just :meth:`~object.__getitem__` and :meth:" @@ -2820,11 +3007,11 @@ msgstr "" "σχετικά με τις μεθόδους ακολουθίας γενικά, ανατρέξτε στο :ref:`Common " "Sequence Operations `." -#: glossary.rst:1136 +#: glossary.rst:1202 msgid "set comprehension" msgstr "set comprehension" -#: glossary.rst:1138 +#: glossary.rst:1204 msgid "" "A compact way to process all or part of the elements in an iterable and " "return a set with the results. ``results = {c for c in 'abracadabra' if c " @@ -2836,11 +3023,11 @@ msgstr "" "c in 'abracadabra' if c not in 'abc'}`` δημιουργεί το σύνολο συμβολοσειρών " "``{'r', 'd'}``. Βλ. :ref:`comprehensions`." -#: glossary.rst:1142 +#: glossary.rst:1208 msgid "single dispatch" msgstr "μοναδικό dispatch" -#: glossary.rst:1144 +#: glossary.rst:1210 msgid "" "A form of :term:`generic function` dispatch where the implementation is " "chosen based on the type of a single argument." @@ -2848,11 +3035,11 @@ msgstr "" "Μια μορφή dispatch :term:`generic function` όπου η υλοποίηση επιλέγεται με " "βάση τον τύπο ενός μεμονωμένου ορίσματος." -#: glossary.rst:1146 +#: glossary.rst:1212 msgid "slice" msgstr "slice" -#: glossary.rst:1148 +#: glossary.rst:1214 msgid "" "An object usually containing a portion of a :term:`sequence`. A slice is " "created using the subscript notation, ``[]`` with colons between numbers " @@ -2865,11 +3052,11 @@ msgstr "" "``variable_name[1:3:5]``. Η σημείωση αγκύλης (subscript) χρησιμοποιεί " "εσωτερικά αντικείμενα :class:`slice`." -#: glossary.rst:1152 +#: glossary.rst:1218 msgid "soft deprecated" msgstr "απαρχαιωμένη με ήπιο τρόπο" -#: glossary.rst:1154 +#: glossary.rst:1220 msgid "" "A soft deprecated API should not be used in new code, but it is safe for " "already existing code to use it. The API remains documented and tested, but " @@ -2879,7 +3066,7 @@ msgstr "" "κώδικα, αλλά είναι ασφαλές σε ήδη υπάρχοντα κώδικα να το χρησιμοποιεί. Το " "API παραμένει τεκμηριωμένο και δοκιμασμένο, αλλά δεν θα ενισχυθεί περαιτέρω." -#: glossary.rst:1158 +#: glossary.rst:1224 msgid "" "Soft deprecation, unlike normal deprecation, does not plan on removing the " "API and will not emit warnings." @@ -2887,7 +3074,7 @@ msgstr "" "Η κατάργηση με ήπιο τρόπο, σε αντίθεση με την κανονική κατάργηση, δεν " "σχεδιάζει την κατάργηση του API και δεν θα εκπέμπει ειδοποιήσεις" -#: glossary.rst:1161 +#: glossary.rst:1227 msgid "" "See `PEP 387: Soft Deprecation `_." @@ -2895,11 +3082,11 @@ msgstr "" "Δείτε `PEP 387: Soft Deprecation `_." -#: glossary.rst:1163 +#: glossary.rst:1229 msgid "special method" msgstr "ειδική μέθοδος" -#: glossary.rst:1167 +#: glossary.rst:1233 msgid "" "A method that is called implicitly by Python to execute a certain operation " "on a type, such as addition. Such methods have names starting and ending " @@ -2911,11 +3098,11 @@ msgstr "" "έχουνε ονόματα που ξεκινούν και τελειώνουν με διπλές κάτω παύλες. Οι ειδικές " "μέθοδοι τεκμηριώνονται στο :ref:`specialnames`." -#: glossary.rst:1171 +#: glossary.rst:1237 msgid "statement" msgstr "δήλωση" -#: glossary.rst:1173 +#: glossary.rst:1239 msgid "" "A statement is part of a suite (a \"block\" of code). A statement is either " "an :term:`expression` or one of several constructs with a keyword, such as :" @@ -2925,11 +3112,11 @@ msgstr "" "είναι είτε ένας :term:`expression` είτε μια από πολλές δομές με μια λέξη-" "κλειδί όπως :keyword:`if`, :keyword:`while` ή :keyword:`for`." -#: glossary.rst:1176 +#: glossary.rst:1242 msgid "static type checker" msgstr "ελεγκτής στατικού τύπου" -#: glossary.rst:1178 +#: glossary.rst:1244 msgid "" "An external tool that reads Python code and analyzes it, looking for issues " "such as incorrect types. See also :term:`type hints ` and the :" @@ -2939,11 +3126,11 @@ msgstr "" "αναζητώντας προβλήματα όπως λανθασμένοι τύποι. Βλ. επίσης :term:`type hints " "` και το module :mod:`typing`." -#: glossary.rst:1181 +#: glossary.rst:1247 msgid "strong reference" msgstr "strong reference" -#: glossary.rst:1183 +#: glossary.rst:1249 msgid "" "In Python's C API, a strong reference is a reference to an object which is " "owned by the code holding the reference. The strong reference is taken by " @@ -2956,7 +3143,7 @@ msgstr "" "δημιουργείται και απελευθερώνεται με :c:func:`Py_DECREF` όταν διαγραφεί η " "αναφορά." -#: glossary.rst:1189 +#: glossary.rst:1255 msgid "" "The :c:func:`Py_NewRef` function can be used to create a strong reference to " "an object. Usually, the :c:func:`Py_DECREF` function must be called on the " @@ -2968,15 +3155,15 @@ msgstr "" "`Py_DECREF` πρέπει να καλείται στην ισχυρή αναφορά πριν βγει από το εύρος " "της ισχυρής αναφοράς, για να αποφευχθεί η διαρροή μιας αναφοράς." -#: glossary.rst:1194 +#: glossary.rst:1260 msgid "See also :term:`borrowed reference`." msgstr "Βλ. επίσης :term:`borrowed reference`." -#: glossary.rst:1195 +#: glossary.rst:1261 msgid "text encoding" msgstr "κωδικοποίηση κειμένου" -#: glossary.rst:1197 +#: glossary.rst:1263 msgid "" "A string in Python is a sequence of Unicode code points (in range " "``U+0000``--``U+10FFFF``). To store or transfer a string, it needs to be " @@ -2986,7 +3173,7 @@ msgstr "" "εύρος ``U+0000``--``U+10FFFF``). Για να αποθηκεύσετε ή να μεταφέρετε μια " "συμβολοσειρά, πρέπει να σειριοποιηθεί ως δυαδική ακολουθία." -#: glossary.rst:1201 +#: glossary.rst:1267 msgid "" "Serializing a string into a sequence of bytes is known as \"encoding\", and " "recreating the string from the sequence of bytes is known as \"decoding\"." @@ -2995,7 +3182,7 @@ msgstr "" "\"κωδικοποίηση\" , και η αναδημιουργία της συμβολοσειράς από την δυαδική " "ακολουθία είναι γνωστή ως \"αποκωδικοποίηση\"." -#: glossary.rst:1204 +#: glossary.rst:1270 msgid "" "There are a variety of different text serialization :ref:`codecs `, which are collectively referred to as \"text encodings\"." @@ -3004,11 +3191,11 @@ msgstr "" "`, οι οποίοι συλλογικά αναφέρονται ως \"κωδικοποιήσεις " "κειμένου\"." -#: glossary.rst:1207 +#: glossary.rst:1273 msgid "text file" msgstr "αρχείο κειμένου" -#: glossary.rst:1209 +#: glossary.rst:1275 msgid "" "A :term:`file object` able to read and write :class:`str` objects. Often, a " "text file actually accesses a byte-oriented datastream and handles the :term:" @@ -3023,7 +3210,7 @@ msgstr "" "κειμένου (``'r'`` ή ``'w'``), :data:`sys.stdin`, :data:`sys.stdout`, και " "στιγμιότυπα του :class:`io.StringIO`." -#: glossary.rst:1216 +#: glossary.rst:1282 msgid "" "See also :term:`binary file` for a file object able to read and write :term:" "`bytes-like objects `." @@ -3031,28 +3218,35 @@ msgstr "" "Βλ. επίσης :term:`binary file` για ένα αντικείμενο αρχείου με δυνατότητα " "ανάγνωσης και εγγραφής :term:`δυαδικά αντικείμενα `." -#: glossary.rst:1218 +#: glossary.rst:1284 msgid "token" -msgstr "" +msgstr "λεκτικό σύμβολο (token)" -#: glossary.rst:1221 +#: glossary.rst:1287 msgid "" "A small unit of source code, generated by the :ref:`lexical analyzer " "` (also called the *tokenizer*). Names, numbers, strings, " "operators, newlines and similar are represented by tokens." msgstr "" +"Μια μικρή μονάδα πηγαίου κώδικα, που παράγεται από τον :ref:`lexical " +"analyzer ` (γνωστό και ως *αναλυτή (tokenizer)*). Ονόματα, αριθμοί, " +"συμβολοσειρές, τελεστές αλλαγές γραμμής και παρόμοια στοιχεία αναπαρίστανται " +"ως λεκτικά σύμβολα (tokens)." -#: glossary.rst:1226 +#: glossary.rst:1292 msgid "" "The :mod:`tokenize` module exposes Python's lexical analyzer. The :mod:" "`token` module contains information on the various types of tokens." msgstr "" +"Το module :mod:`tokenize` εκθέτει τον λεξικό αναλυτή της Python. Το module :" +"mod:`token` περιέχει πληροφορίες για τους διάφορους τύπους λεκτικών συμβόλων " +"(tokens)." -#: glossary.rst:1229 +#: glossary.rst:1295 msgid "triple-quoted string" msgstr "συμβολοσειρά τριπλών εισαγωγικών" -#: glossary.rst:1231 +#: glossary.rst:1297 msgid "" "A string which is bound by three instances of either a quotation mark (\") " "or an apostrophe ('). While they don't provide any functionality not " @@ -3070,11 +3264,11 @@ msgstr "" "γραμμές χωρίς τη χρήση του χαρακτήρα συνέχεια, καθιστώντας τα ιδιαίτερα " "χρήσιμα κατά τη σύνταξη εγγράφων με συμβολοσειρές." -#: glossary.rst:1238 +#: glossary.rst:1304 msgid "type" msgstr "τύπος" -#: glossary.rst:1240 +#: glossary.rst:1306 msgid "" "The type of a Python object determines what kind of object it is; every " "object has a type. An object's type is accessible as its :attr:`~object." @@ -3085,17 +3279,17 @@ msgstr "" "το χαρακτηριστικό :attr:`~object.__class__` ή μπορεί να ανακτηθεί με " "``type(obj)``." -#: glossary.rst:1244 +#: glossary.rst:1310 msgid "type alias" msgstr "type alias" -#: glossary.rst:1246 +#: glossary.rst:1312 msgid "A synonym for a type, created by assigning the type to an identifier." msgstr "" "Ένα συνώνυμο για έναν τύπο, που δημιουργείται με την ανάθεση τύπου σε ένα " "αναγνωριστικό." -#: glossary.rst:1248 +#: glossary.rst:1314 msgid "" "Type aliases are useful for simplifying :term:`type hints `. For " "example::" @@ -3103,7 +3297,7 @@ msgstr "" "Τα type aliases είναι χρήσιμα για την απλοποίηση :term:`type alias `. Για παράδειγμα::" -#: glossary.rst:1251 +#: glossary.rst:1317 msgid "" "def remove_gray_shades(\n" " colors: list[tuple[int, int, int]]) -> list[tuple[int, int, int]]:\n" @@ -3113,11 +3307,11 @@ msgstr "" " colors: list[tuple[int, int, int]]) -> list[tuple[int, int, int]]:\n" " pass" -#: glossary.rst:1255 +#: glossary.rst:1321 msgid "could be made more readable like this::" msgstr "μπορεί να γίνει πιο ευανάγνωστο όπως::" -#: glossary.rst:1257 +#: glossary.rst:1323 msgid "" "Color = tuple[int, int, int]\n" "\n" @@ -3129,16 +3323,16 @@ msgstr "" "def remove_gray_shades(colors: list[Color]) -> list[Color]:\n" " pass" -#: glossary.rst:1276 +#: glossary.rst:1342 msgid "See :mod:`typing` and :pep:`484`, which describe this functionality." msgstr "" "Βλ. :mod:`typing` και :pep:`484`, που περιγράφει αυτήν την λειτουργικότητα." -#: glossary.rst:1263 +#: glossary.rst:1329 msgid "type hint" msgstr "type hint" -#: glossary.rst:1265 +#: glossary.rst:1331 msgid "" "An :term:`annotation` that specifies the expected type for a variable, a " "class attribute, or a function parameter or return value." @@ -3147,7 +3341,7 @@ msgstr "" "μεταβλητή, ένα χαρακτηριστικό κλάσης ή μια παράμετρο συνάρτησης ή τιμή " "επιστροφής." -#: glossary.rst:1268 +#: glossary.rst:1334 msgid "" "Type hints are optional and are not enforced by Python but they are useful " "to :term:`static type checkers `. They can also aid " @@ -3158,7 +3352,7 @@ msgstr "" "checker>`. Μπορούν επίσης να βοηθήσουν τους IDEs με τη συμπλήρωση και την " "αναδιαμόρφωση κώδικα." -#: glossary.rst:1272 +#: glossary.rst:1338 msgid "" "Type hints of global variables, class attributes, and functions, but not " "local variables, can be accessed using :func:`typing.get_type_hints`." @@ -3167,11 +3361,11 @@ msgstr "" "κλάσης και συναρτήσεις , αλλά όχι τοπικές μεταβλητές, μπορούν να " "προσπελαστούν χρησιμοποιώντας το :func:`typing.get_type_hints`." -#: glossary.rst:1277 +#: glossary.rst:1343 msgid "universal newlines" msgstr "καθολικές νέες γραμμές" -#: glossary.rst:1279 +#: glossary.rst:1345 msgid "" "A manner of interpreting text streams in which all of the following are " "recognized as ending a line: the Unix end-of-line convention ``'\\n'``, the " @@ -3185,22 +3379,22 @@ msgstr "" "Βλ. :pep:`278` και :pep:`3116`, καθώς και :func:`bytes.splitlines` για " "πρόσθετη χρήση." -#: glossary.rst:1284 +#: glossary.rst:1350 msgid "variable annotation" msgstr "annotation μεταβλητής" -#: glossary.rst:1286 +#: glossary.rst:1352 msgid "An :term:`annotation` of a variable or a class attribute." msgstr "Ένας :term:`annotation` μια μεταβλητής ή ενός χαρακτηριστικού κλάσης." -#: glossary.rst:1288 +#: glossary.rst:1354 msgid "" "When annotating a variable or a class attribute, assignment is optional::" msgstr "" "Όταν annotating μια μεταβλητή ή ένα χαρακτηριστικό κλάσης, η ανάθεση είναι " "προαιρετική::" -#: glossary.rst:1290 +#: glossary.rst:1356 msgid "" "class C:\n" " field: 'annotation'" @@ -3208,7 +3402,7 @@ msgstr "" "class C:\n" " field: 'annotation'" -#: glossary.rst:1293 +#: glossary.rst:1359 msgid "" "Variable annotations are usually used for :term:`type hints `: " "for example this variable is expected to take :class:`int` values::" @@ -3217,16 +3411,16 @@ msgstr "" "`: για παράδειγμα αυτή η μεταβλητή αναμένεται να λάβει τιμές :" "class:`int`::" -#: glossary.rst:1297 +#: glossary.rst:1363 msgid "count: int = 0" msgstr "count: int = 0" -#: glossary.rst:1299 +#: glossary.rst:1365 msgid "Variable annotation syntax is explained in section :ref:`annassign`." msgstr "" "Η σύνταξη annotation μεταβλητής περιγράφεται στην ενότητα :ref:`annassign`." -#: glossary.rst:1301 +#: glossary.rst:1367 msgid "" "See :term:`function annotation`, :pep:`484` and :pep:`526`, which describe " "this functionality. Also see :ref:`annotations-howto` for best practices on " @@ -3236,11 +3430,11 @@ msgstr "" "αυτή τη λειτουργία. Δείτε επίσης :ref:`annotations-howto` για βέλτιστες " "πρακτικές σχετικά με την εργασία με σχολιασμούς." -#: glossary.rst:1305 +#: glossary.rst:1371 msgid "virtual environment" msgstr "virtual environment" -#: glossary.rst:1307 +#: glossary.rst:1373 msgid "" "A cooperatively isolated runtime environment that allows Python users and " "applications to install and upgrade Python distribution packages without " @@ -3252,15 +3446,15 @@ msgstr "" "πακέτα διανομής Python χωρίς να παρεμβαίνουν στη συμπεριφορά άλλων εφαρμογών " "Python που εκτελούνται στο ίδιο σύστημα." -#: glossary.rst:1312 +#: glossary.rst:1378 msgid "See also :mod:`venv`." msgstr "Βλ. επίσης :mod:`venv`." -#: glossary.rst:1313 +#: glossary.rst:1379 msgid "virtual machine" msgstr "virtual machine" -#: glossary.rst:1315 +#: glossary.rst:1381 msgid "" "A computer defined entirely in software. Python's virtual machine executes " "the :term:`bytecode` emitted by the bytecode compiler." @@ -3269,11 +3463,11 @@ msgstr "" "της Python εκτελεί το :term:`bytecode` που εκπέμπεται από τον μεταγλωττιστή " "bytecode." -#: glossary.rst:1317 +#: glossary.rst:1383 msgid "Zen of Python" msgstr "Zen της Python" -#: glossary.rst:1319 +#: glossary.rst:1385 msgid "" "Listing of Python design principles and philosophies that are helpful in " "understanding and using the language. The listing can be found by typing " @@ -3283,18 +3477,78 @@ msgstr "" "κατανόηση και τη χρήση της γλώσσας. Ο κατάλογος μπορεί να βρεθεί " "πληκτρολογώντας \"``import this``\" στην διαδραστική κονσόλα." -#: glossary.rst:264 +#: glossary.rst:292 msgid "C-contiguous" msgstr "C-contiguous" -#: glossary.rst:264 +#: glossary.rst:292 msgid "Fortran contiguous" msgstr "Fortran contiguous" -#: glossary.rst:778 +#: glossary.rst:831 msgid "magic" msgstr "magic" -#: glossary.rst:1165 +#: glossary.rst:1231 msgid "special" msgstr "special" + +#~ msgid "2to3" +#~ msgstr "2to3" + +#~ msgid "" +#~ "A tool that tries to convert Python 2.x code to Python 3.x code by " +#~ "handling most of the incompatibilities which can be detected by parsing " +#~ "the source and traversing the parse tree." +#~ msgstr "" +#~ "Ένα εργαλείο που προσπαθεί να μετατρέψει τον κώδικα Python 2.x σε κώδικα " +#~ "Python 3.x διαχειρίζοντας τις περισσότερες ασυμβατότητες που μπορούν να " +#~ "εντοπιστούν αναλύοντας την πηγή και διασχίζοντας το δέντρο ανάλυσης." + +#~ msgid "" +#~ "2to3 is available in the standard library as :mod:`lib2to3`; a standalone " +#~ "entry point is provided as :file:`Tools/scripts/2to3`. See :ref:`2to3-" +#~ "reference`." +#~ msgstr "" +#~ "2to3 είναι διαθέσιμο στην στάνταρ βιβλιοθήκη ως :mod:`lib2to3`, παρέχεται " +#~ "ένα σημείο εισόδου ως :file:`Tools/scripts/2to3`. Βλ. :ref:`2to3-" +#~ "reference`." + +#~ msgid "" +#~ "An object which controls the environment seen in a :keyword:`with` " +#~ "statement by defining :meth:`~object.__enter__` and :meth:`~object." +#~ "__exit__` methods. See :pep:`343`." +#~ msgstr "" +#~ "Ένα αντικείμενο που ελέγχει το περιβάλλον που εμφανίζεται σε μια δήλωση :" +#~ "keyword:`with` ορίζοντας τις μεθόδους :meth:`~object.__enter__` και :meth:" +#~ "`~object.__exit__`. Βλ. :pep:`343`." + +#~ msgid "" +#~ "A variable which can have different values depending on its context. This " +#~ "is similar to Thread-Local Storage in which each execution thread may " +#~ "have a different value for a variable. However, with context variables, " +#~ "there may be several contexts in one execution thread and the main usage " +#~ "for context variables is to keep track of variables in concurrent " +#~ "asynchronous tasks. See :mod:`contextvars`." +#~ msgstr "" +#~ "Μια μεταβλητή που μπορεί να έχει πολλές διαφορετικές τιμές ανάλογα με το " +#~ "context. Αυτό είναι κοινό στο Thread-Local Storage όπου κάθε εκτέλεση του " +#~ "νήματος μπορεί να έχει διαφορετική τιμή για μια μεταβλητή. Παρόλα αυτά, " +#~ "με τις context μεταβλητές, μπορεί να υπάρχουν πολλά περιβάλλοντα σε ένα " +#~ "νήμα εκτέλεσης και η κύρια χρήση για τις context μεταβλητές είναι η " +#~ "παρακολούθηση των μεταβλητών σε ταυτόχρονες διεργασίες. Βλ. :mod:" +#~ "`contextvars`." + +#~ msgid "" +#~ "Past efforts to create a \"free-threaded\" interpreter (one which locks " +#~ "shared data at a much finer granularity) have not been successful because " +#~ "performance suffered in the common single-processor case. It is believed " +#~ "that overcoming this performance issue would make the implementation much " +#~ "more complicated and therefore costlier to maintain." +#~ msgstr "" +#~ "Προηγούμενες προσπάθειες να δημιουργηθεί ένας διερμηνέας \"ελεύθερων-" +#~ "νημάτων\" (αυτός που κλειδώνει τα κοινόχρηστα δεδομένα με πολύ πιο " +#~ "λεπτομερή ευαισθησία) δεν ήταν επιτυχείς επειδή η απόδοση υποχώρησε στην " +#~ "κοινή περίπτωση ενός επεξεργαστή. Πιστεύεται ότι η υπέρβαση αυτού του " +#~ "προβλήματος απόδοσης θα κάνουν πολύ πιο περίπλοκη και επομένως πιο " +#~ "δαπανηρή στην συντήρηση." diff --git a/howto/annotations.po b/howto/annotations.po index 196a74e0..e9b2fbc6 100644 --- a/howto/annotations.po +++ b/howto/annotations.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" diff --git a/howto/argparse-optparse.po b/howto/argparse-optparse.po index aa46ae37..14737cf3 100644 --- a/howto/argparse-optparse.po +++ b/howto/argparse-optparse.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -17,61 +17,77 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -#: howto/argparse-optparse.rst:7 -msgid "Upgrading optparse code" +#: howto/argparse-optparse.rst:8 +msgid "Migrating ``optparse`` code to ``argparse``" msgstr "" -#: howto/argparse-optparse.rst:9 +#: howto/argparse-optparse.rst:10 msgid "" -"Originally, the :mod:`argparse` module had attempted to maintain " -"compatibility with :mod:`optparse`. However, :mod:`optparse` was difficult " -"to extend transparently, particularly with the changes required to support " -"``nargs=`` specifiers and better usage messages. When most everything in :" -"mod:`optparse` had either been copy-pasted over or monkey-patched, it no " -"longer seemed practical to try to maintain the backwards compatibility." +"The :mod:`argparse` module offers several higher level features not natively " +"provided by the :mod:`optparse` module, including:" msgstr "" -#: howto/argparse-optparse.rst:16 -msgid "" -"The :mod:`argparse` module improves on the :mod:`optparse` module in a " -"number of ways including:" -msgstr "" - -#: howto/argparse-optparse.rst:19 +#: howto/argparse-optparse.rst:13 msgid "Handling positional arguments." msgstr "" -#: howto/argparse-optparse.rst:20 +#: howto/argparse-optparse.rst:14 msgid "Supporting subcommands." msgstr "" -#: howto/argparse-optparse.rst:21 +#: howto/argparse-optparse.rst:15 msgid "Allowing alternative option prefixes like ``+`` and ``/``." msgstr "" -#: howto/argparse-optparse.rst:22 +#: howto/argparse-optparse.rst:16 msgid "Handling zero-or-more and one-or-more style arguments." msgstr "" -#: howto/argparse-optparse.rst:23 +#: howto/argparse-optparse.rst:17 msgid "Producing more informative usage messages." msgstr "" -#: howto/argparse-optparse.rst:24 +#: howto/argparse-optparse.rst:18 msgid "Providing a much simpler interface for custom ``type`` and ``action``." msgstr "" -#: howto/argparse-optparse.rst:26 -msgid "A partial upgrade path from :mod:`optparse` to :mod:`argparse`:" +#: howto/argparse-optparse.rst:20 +msgid "" +"Originally, the :mod:`argparse` module attempted to maintain compatibility " +"with :mod:`optparse`. However, the fundamental design differences between " +"supporting declarative command line option processing (while leaving " +"positional argument processing to application code), and supporting both " +"named options and positional arguments in the declarative interface mean " +"that the API has diverged from that of ``optparse`` over time." +msgstr "" + +#: howto/argparse-optparse.rst:27 +msgid "" +"As described in :ref:`choosing-an-argument-parser`, applications that are " +"currently using :mod:`optparse` and are happy with the way it works can just " +"continue to use ``optparse``." msgstr "" -#: howto/argparse-optparse.rst:28 +#: howto/argparse-optparse.rst:31 +msgid "" +"Application developers that are considering migrating should also review the " +"list of intrinsic behavioural differences described in that section before " +"deciding whether or not migration is desirable." +msgstr "" + +#: howto/argparse-optparse.rst:35 +msgid "" +"For applications that do choose to migrate from :mod:`optparse` to :mod:" +"`argparse`, the following suggestions should be helpful:" +msgstr "" + +#: howto/argparse-optparse.rst:38 msgid "" "Replace all :meth:`optparse.OptionParser.add_option` calls with :meth:" "`ArgumentParser.add_argument` calls." msgstr "" -#: howto/argparse-optparse.rst:31 +#: howto/argparse-optparse.rst:41 msgid "" "Replace ``(options, args) = parser.parse_args()`` with ``args = parser." "parse_args()`` and add additional :meth:`ArgumentParser.add_argument` calls " @@ -79,39 +95,39 @@ msgid "" "``options``, now in the :mod:`argparse` context is called ``args``." msgstr "" -#: howto/argparse-optparse.rst:36 +#: howto/argparse-optparse.rst:46 msgid "" "Replace :meth:`optparse.OptionParser.disable_interspersed_args` by using :" "meth:`~ArgumentParser.parse_intermixed_args` instead of :meth:" "`~ArgumentParser.parse_args`." msgstr "" -#: howto/argparse-optparse.rst:40 +#: howto/argparse-optparse.rst:50 msgid "" "Replace callback actions and the ``callback_*`` keyword arguments with " "``type`` or ``action`` arguments." msgstr "" -#: howto/argparse-optparse.rst:43 +#: howto/argparse-optparse.rst:53 msgid "" "Replace string names for ``type`` keyword arguments with the corresponding " "type objects (e.g. int, float, complex, etc)." msgstr "" -#: howto/argparse-optparse.rst:46 +#: howto/argparse-optparse.rst:56 msgid "" "Replace :class:`optparse.Values` with :class:`Namespace` and :exc:`optparse." "OptionError` and :exc:`optparse.OptionValueError` with :exc:`ArgumentError`." msgstr "" -#: howto/argparse-optparse.rst:50 +#: howto/argparse-optparse.rst:60 msgid "" "Replace strings with implicit arguments such as ``%default`` or ``%prog`` " "with the standard Python syntax to use dictionaries to format strings, that " "is, ``%(default)s`` and ``%(prog)s``." msgstr "" -#: howto/argparse-optparse.rst:54 +#: howto/argparse-optparse.rst:64 msgid "" "Replace the OptionParser constructor ``version`` argument with a call to " "``parser.add_argument('--version', action='version', version='\n" "Language-Team: LANGUAGE \n" @@ -37,23 +37,29 @@ msgstr "" #: howto/argparse.rst:16 msgid "" -"There are two other modules that fulfill the same task, namely :mod:`getopt` " -"(an equivalent for ``getopt()`` from the C language) and the deprecated :mod:" -"`optparse`. Note also that :mod:`argparse` is based on :mod:`optparse`, and " -"therefore very similar in terms of usage." +"The standard library includes two other libraries directly related to " +"command-line parameter processing: the lower level :mod:`optparse` module " +"(which may require more code to configure for a given application, but also " +"allows an application to request behaviors that ``argparse`` doesn't " +"support), and the very low level :mod:`getopt` (which specifically serves as " +"an equivalent to the :c:func:`!getopt` family of functions available to C " +"programmers). While neither of those modules is covered directly in this " +"guide, many of the core concepts in ``argparse`` first originated in " +"``optparse``, so some aspects of this tutorial will also be relevant to " +"``optparse`` users." msgstr "" -#: howto/argparse.rst:24 +#: howto/argparse.rst:29 msgid "Concepts" msgstr "" -#: howto/argparse.rst:26 +#: howto/argparse.rst:31 msgid "" "Let's show the sort of functionality that we are going to explore in this " "introductory tutorial by making use of the :command:`ls` command:" msgstr "" -#: howto/argparse.rst:29 +#: howto/argparse.rst:34 msgid "" "$ ls\n" "cpython devguide prog.py pypy rm-unused-function.patch\n" @@ -73,17 +79,17 @@ msgid "" "..." msgstr "" -#: howto/argparse.rst:48 +#: howto/argparse.rst:53 msgid "A few concepts we can learn from the four commands:" msgstr "" -#: howto/argparse.rst:50 +#: howto/argparse.rst:55 msgid "" "The :command:`ls` command is useful when run without any options at all. It " "defaults to displaying the contents of the current directory." msgstr "" -#: howto/argparse.rst:53 +#: howto/argparse.rst:58 msgid "" "If we want beyond what it provides by default, we tell it a bit more. In " "this case, we want it to display a different directory, ``pypy``. What we " @@ -95,40 +101,40 @@ msgid "" "want it copied to*." msgstr "" -#: howto/argparse.rst:62 +#: howto/argparse.rst:67 msgid "" "Now, say we want to change behaviour of the program. In our example, we " "display more info for each file instead of just showing the file names. The " "``-l`` in that case is known as an optional argument." msgstr "" -#: howto/argparse.rst:66 +#: howto/argparse.rst:71 msgid "" "That's a snippet of the help text. It's very useful in that you can come " "across a program you have never used before, and can figure out how it works " "simply by reading its help text." msgstr "" -#: howto/argparse.rst:72 +#: howto/argparse.rst:77 msgid "The basics" msgstr "" -#: howto/argparse.rst:74 +#: howto/argparse.rst:79 msgid "Let us start with a very simple example which does (almost) nothing::" msgstr "" -#: howto/argparse.rst:76 +#: howto/argparse.rst:81 msgid "" "import argparse\n" "parser = argparse.ArgumentParser()\n" "parser.parse_args()" msgstr "" -#: howto/argparse.rst:188 howto/argparse.rst:209 +#: howto/argparse.rst:193 howto/argparse.rst:214 msgid "Following is a result of running the code:" msgstr "" -#: howto/argparse.rst:82 +#: howto/argparse.rst:87 msgid "" "$ python prog.py\n" "$ python prog.py --help\n" @@ -144,23 +150,23 @@ msgid "" "prog.py: error: unrecognized arguments: foo" msgstr "" -#: howto/argparse.rst:254 howto/argparse.rst:298 +#: howto/argparse.rst:259 howto/argparse.rst:303 msgid "Here is what is happening:" msgstr "" -#: howto/argparse.rst:99 +#: howto/argparse.rst:104 msgid "" "Running the script without any options results in nothing displayed to " "stdout. Not so useful." msgstr "" -#: howto/argparse.rst:102 +#: howto/argparse.rst:107 msgid "" "The second one starts to display the usefulness of the :mod:`argparse` " "module. We have done almost nothing, but already we get a nice help message." msgstr "" -#: howto/argparse.rst:105 +#: howto/argparse.rst:110 msgid "" "The ``--help`` option, which can also be shortened to ``-h``, is the only " "option we get for free (i.e. no need to specify it). Specifying anything " @@ -168,15 +174,15 @@ msgid "" "also for free." msgstr "" -#: howto/argparse.rst:112 +#: howto/argparse.rst:117 msgid "Introducing Positional arguments" msgstr "" -#: howto/argparse.rst:114 +#: howto/argparse.rst:119 msgid "An example::" msgstr "" -#: howto/argparse.rst:116 +#: howto/argparse.rst:121 msgid "" "import argparse\n" "parser = argparse.ArgumentParser()\n" @@ -185,11 +191,11 @@ msgid "" "print(args.echo)" msgstr "" -#: howto/argparse.rst:122 +#: howto/argparse.rst:127 msgid "And running the code:" msgstr "" -#: howto/argparse.rst:124 +#: howto/argparse.rst:129 msgid "" "$ python prog.py\n" "usage: prog.py [-h] echo\n" @@ -206,11 +212,11 @@ msgid "" "foo" msgstr "" -#: howto/argparse.rst:140 +#: howto/argparse.rst:145 msgid "Here is what's happening:" msgstr "" -#: howto/argparse.rst:142 +#: howto/argparse.rst:147 msgid "" "We've added the :meth:`~ArgumentParser.add_argument` method, which is what " "we use to specify which command-line options the program is willing to " @@ -218,17 +224,17 @@ msgid "" "function." msgstr "" -#: howto/argparse.rst:146 +#: howto/argparse.rst:151 msgid "Calling our program now requires us to specify an option." msgstr "" -#: howto/argparse.rst:148 +#: howto/argparse.rst:153 msgid "" "The :meth:`~ArgumentParser.parse_args` method actually returns some data " "from the options specified, in this case, ``echo``." msgstr "" -#: howto/argparse.rst:151 +#: howto/argparse.rst:156 msgid "" "The variable is some form of 'magic' that :mod:`argparse` performs for free " "(i.e. no need to specify which variable that value is stored in). You will " @@ -236,7 +242,7 @@ msgid "" "``echo``." msgstr "" -#: howto/argparse.rst:156 +#: howto/argparse.rst:161 msgid "" "Note however that, although the help display looks nice and all, it " "currently is not as helpful as it can be. For example we see that we got " @@ -245,7 +251,7 @@ msgid "" "useful::" msgstr "" -#: howto/argparse.rst:161 +#: howto/argparse.rst:166 msgid "" "import argparse\n" "parser = argparse.ArgumentParser()\n" @@ -254,11 +260,11 @@ msgid "" "print(args.echo)" msgstr "" -#: howto/argparse.rst:167 +#: howto/argparse.rst:172 msgid "And we get:" msgstr "" -#: howto/argparse.rst:169 +#: howto/argparse.rst:174 msgid "" "$ python prog.py -h\n" "usage: prog.py [-h] echo\n" @@ -270,11 +276,11 @@ msgid "" " -h, --help show this help message and exit" msgstr "" -#: howto/argparse.rst:180 +#: howto/argparse.rst:185 msgid "Now, how about doing something even more useful::" msgstr "" -#: howto/argparse.rst:182 +#: howto/argparse.rst:187 msgid "" "import argparse\n" "parser = argparse.ArgumentParser()\n" @@ -284,7 +290,7 @@ msgid "" "print(args.square**2)" msgstr "" -#: howto/argparse.rst:190 +#: howto/argparse.rst:195 msgid "" "$ python prog.py 4\n" "Traceback (most recent call last):\n" @@ -293,14 +299,14 @@ msgid "" "TypeError: unsupported operand type(s) for ** or pow(): 'str' and 'int'" msgstr "" -#: howto/argparse.rst:198 +#: howto/argparse.rst:203 msgid "" "That didn't go so well. That's because :mod:`argparse` treats the options we " "give it as strings, unless we tell it otherwise. So, let's tell :mod:" "`argparse` to treat that input as an integer::" msgstr "" -#: howto/argparse.rst:202 +#: howto/argparse.rst:207 msgid "" "import argparse\n" "parser = argparse.ArgumentParser()\n" @@ -311,7 +317,7 @@ msgid "" "print(args.square**2)" msgstr "" -#: howto/argparse.rst:211 +#: howto/argparse.rst:216 msgid "" "$ python prog.py 4\n" "16\n" @@ -320,23 +326,23 @@ msgid "" "prog.py: error: argument square: invalid int value: 'four'" msgstr "" -#: howto/argparse.rst:219 +#: howto/argparse.rst:224 msgid "" "That went well. The program now even helpfully quits on bad illegal input " "before proceeding." msgstr "" -#: howto/argparse.rst:224 +#: howto/argparse.rst:229 msgid "Introducing Optional arguments" msgstr "" -#: howto/argparse.rst:226 +#: howto/argparse.rst:231 msgid "" "So far we have been playing with positional arguments. Let us have a look on " "how to add optional ones::" msgstr "" -#: howto/argparse.rst:229 +#: howto/argparse.rst:234 msgid "" "import argparse\n" "parser = argparse.ArgumentParser()\n" @@ -346,11 +352,11 @@ msgid "" " print(\"verbosity turned on\")" msgstr "" -#: howto/argparse.rst:282 howto/argparse.rst:432 +#: howto/argparse.rst:287 howto/argparse.rst:437 msgid "And the output:" msgstr "" -#: howto/argparse.rst:238 +#: howto/argparse.rst:243 msgid "" "$ python prog.py --verbosity 1\n" "verbosity turned on\n" @@ -367,13 +373,13 @@ msgid "" "prog.py: error: argument --verbosity: expected one argument" msgstr "" -#: howto/argparse.rst:256 +#: howto/argparse.rst:261 msgid "" "The program is written so as to display something when ``--verbosity`` is " "specified and display nothing when not." msgstr "" -#: howto/argparse.rst:259 +#: howto/argparse.rst:264 msgid "" "To show that the option is actually optional, there is no error when running " "the program without it. Note that by default, if an optional argument isn't " @@ -382,24 +388,24 @@ msgid "" "keyword:`if` statement." msgstr "" -#: howto/argparse.rst:265 +#: howto/argparse.rst:270 msgid "The help message is a bit different." msgstr "" -#: howto/argparse.rst:267 +#: howto/argparse.rst:272 msgid "" "When using the ``--verbosity`` option, one must also specify some value, any " "value." msgstr "" -#: howto/argparse.rst:270 +#: howto/argparse.rst:275 msgid "" "The above example accepts arbitrary integer values for ``--verbosity``, but " "for our simple program, only two values are actually useful, ``True`` or " "``False``. Let's modify the code accordingly::" msgstr "" -#: howto/argparse.rst:274 +#: howto/argparse.rst:279 msgid "" "import argparse\n" "parser = argparse.ArgumentParser()\n" @@ -410,7 +416,7 @@ msgid "" " print(\"verbosity turned on\")" msgstr "" -#: howto/argparse.rst:284 +#: howto/argparse.rst:289 msgid "" "$ python prog.py --verbose\n" "verbosity turned on\n" @@ -425,7 +431,7 @@ msgid "" " --verbose increase output verbosity" msgstr "" -#: howto/argparse.rst:300 +#: howto/argparse.rst:305 msgid "" "The option is now more of a flag than something that requires a value. We " "even changed the name of the option to match that idea. Note that we now " @@ -434,28 +440,28 @@ msgid "" "``args.verbose``. Not specifying it implies ``False``." msgstr "" -#: howto/argparse.rst:307 +#: howto/argparse.rst:312 msgid "" "It complains when you specify a value, in true spirit of what flags actually " "are." msgstr "" -#: howto/argparse.rst:310 +#: howto/argparse.rst:315 msgid "Notice the different help text." msgstr "" -#: howto/argparse.rst:314 +#: howto/argparse.rst:319 msgid "Short options" msgstr "" -#: howto/argparse.rst:316 +#: howto/argparse.rst:321 msgid "" "If you are familiar with command line usage, you will notice that I haven't " "yet touched on the topic of short versions of the options. It's quite " "simple::" msgstr "" -#: howto/argparse.rst:320 +#: howto/argparse.rst:325 msgid "" "import argparse\n" "parser = argparse.ArgumentParser()\n" @@ -467,11 +473,11 @@ msgid "" " print(\"verbosity turned on\")" msgstr "" -#: howto/argparse.rst:328 +#: howto/argparse.rst:333 msgid "And here goes:" msgstr "" -#: howto/argparse.rst:330 +#: howto/argparse.rst:335 msgid "" "$ python prog.py -v\n" "verbosity turned on\n" @@ -483,19 +489,19 @@ msgid "" " -v, --verbose increase output verbosity" msgstr "" -#: howto/argparse.rst:341 +#: howto/argparse.rst:346 msgid "Note that the new ability is also reflected in the help text." msgstr "" -#: howto/argparse.rst:345 +#: howto/argparse.rst:350 msgid "Combining Positional and Optional arguments" msgstr "" -#: howto/argparse.rst:347 +#: howto/argparse.rst:352 msgid "Our program keeps growing in complexity::" msgstr "" -#: howto/argparse.rst:349 +#: howto/argparse.rst:354 msgid "" "import argparse\n" "parser = argparse.ArgumentParser()\n" @@ -511,11 +517,11 @@ msgid "" " print(answer)" msgstr "" -#: howto/argparse.rst:362 +#: howto/argparse.rst:367 msgid "And now the output:" msgstr "" -#: howto/argparse.rst:364 +#: howto/argparse.rst:369 msgid "" "$ python prog.py\n" "usage: prog.py [-h] [-v] square\n" @@ -528,21 +534,21 @@ msgid "" "the square of 4 equals 16" msgstr "" -#: howto/argparse.rst:376 +#: howto/argparse.rst:381 msgid "We've brought back a positional argument, hence the complaint." msgstr "" -#: howto/argparse.rst:378 +#: howto/argparse.rst:383 msgid "Note that the order does not matter." msgstr "" -#: howto/argparse.rst:380 +#: howto/argparse.rst:385 msgid "" "How about we give this program of ours back the ability to have multiple " "verbosity values, and actually get to use them::" msgstr "" -#: howto/argparse.rst:383 +#: howto/argparse.rst:388 msgid "" "import argparse\n" "parser = argparse.ArgumentParser()\n" @@ -560,7 +566,7 @@ msgid "" " print(answer)" msgstr "" -#: howto/argparse.rst:400 +#: howto/argparse.rst:405 msgid "" "$ python prog.py 4\n" "16\n" @@ -575,14 +581,14 @@ msgid "" "16" msgstr "" -#: howto/argparse.rst:414 +#: howto/argparse.rst:419 msgid "" "These all look good except the last one, which exposes a bug in our program. " "Let's fix it by restricting the values the ``--verbosity`` option can " "accept::" msgstr "" -#: howto/argparse.rst:417 +#: howto/argparse.rst:422 msgid "" "import argparse\n" "parser = argparse.ArgumentParser()\n" @@ -600,7 +606,7 @@ msgid "" " print(answer)" msgstr "" -#: howto/argparse.rst:434 +#: howto/argparse.rst:439 msgid "" "$ python prog.py 4 -v 3\n" "usage: prog.py [-h] [-v {0,1,2}] square\n" @@ -614,24 +620,24 @@ msgid "" "\n" "options:\n" " -h, --help show this help message and exit\n" -" -v {0,1,2}, --verbosity {0,1,2}\n" +" -v, --verbosity {0,1,2}\n" " increase output verbosity" msgstr "" -#: howto/argparse.rst:450 +#: howto/argparse.rst:455 msgid "" "Note that the change also reflects both in the error message as well as the " "help string." msgstr "" -#: howto/argparse.rst:453 +#: howto/argparse.rst:458 msgid "" "Now, let's use a different approach of playing with verbosity, which is " "pretty common. It also matches the way the CPython executable handles its " "own verbosity argument (check the output of ``python --help``)::" msgstr "" -#: howto/argparse.rst:457 +#: howto/argparse.rst:462 msgid "" "import argparse\n" "parser = argparse.ArgumentParser()\n" @@ -649,13 +655,13 @@ msgid "" " print(answer)" msgstr "" -#: howto/argparse.rst:472 +#: howto/argparse.rst:477 msgid "" "We have introduced another action, \"count\", to count the number of " "occurrences of specific options." msgstr "" -#: howto/argparse.rst:476 +#: howto/argparse.rst:481 msgid "" "$ python prog.py 4\n" "16\n" @@ -681,50 +687,50 @@ msgid "" "16" msgstr "" -#: howto/argparse.rst:501 +#: howto/argparse.rst:506 msgid "" "Yes, it's now more of a flag (similar to ``action=\"store_true\"``) in the " "previous version of our script. That should explain the complaint." msgstr "" -#: howto/argparse.rst:504 +#: howto/argparse.rst:509 msgid "It also behaves similar to \"store_true\" action." msgstr "" -#: howto/argparse.rst:506 +#: howto/argparse.rst:511 msgid "" "Now here's a demonstration of what the \"count\" action gives. You've " "probably seen this sort of usage before." msgstr "" -#: howto/argparse.rst:509 +#: howto/argparse.rst:514 msgid "" "And if you don't specify the ``-v`` flag, that flag is considered to have " "``None`` value." msgstr "" -#: howto/argparse.rst:512 +#: howto/argparse.rst:517 msgid "" "As should be expected, specifying the long form of the flag, we should get " "the same output." msgstr "" -#: howto/argparse.rst:515 +#: howto/argparse.rst:520 msgid "" "Sadly, our help output isn't very informative on the new ability our script " "has acquired, but that can always be fixed by improving the documentation " "for our script (e.g. via the ``help`` keyword argument)." msgstr "" -#: howto/argparse.rst:519 +#: howto/argparse.rst:524 msgid "That last output exposes a bug in our program." msgstr "" -#: howto/argparse.rst:522 +#: howto/argparse.rst:527 msgid "Let's fix::" msgstr "" -#: howto/argparse.rst:524 +#: howto/argparse.rst:529 msgid "" "import argparse\n" "parser = argparse.ArgumentParser()\n" @@ -744,11 +750,11 @@ msgid "" " print(answer)" msgstr "" -#: howto/argparse.rst:541 +#: howto/argparse.rst:546 msgid "And this is what it gives:" msgstr "" -#: howto/argparse.rst:543 +#: howto/argparse.rst:548 msgid "" "$ python prog.py 4 -vvv\n" "the square of 4 equals 16\n" @@ -761,21 +767,21 @@ msgid "" "TypeError: '>=' not supported between instances of 'NoneType' and 'int'" msgstr "" -#: howto/argparse.rst:556 +#: howto/argparse.rst:561 msgid "" "First output went well, and fixes the bug we had before. That is, we want " "any value >= 2 to be as verbose as possible." msgstr "" -#: howto/argparse.rst:559 +#: howto/argparse.rst:564 msgid "Third output not so good." msgstr "" -#: howto/argparse.rst:561 +#: howto/argparse.rst:566 msgid "Let's fix that bug::" msgstr "" -#: howto/argparse.rst:563 +#: howto/argparse.rst:568 msgid "" "import argparse\n" "parser = argparse.ArgumentParser()\n" @@ -793,7 +799,7 @@ msgid "" " print(answer)" msgstr "" -#: howto/argparse.rst:578 +#: howto/argparse.rst:583 msgid "" "We've just introduced yet another keyword, ``default``. We've set it to " "``0`` in order to make it comparable to the other int values. Remember that " @@ -802,34 +808,34 @@ msgid "" "`TypeError` exception)." msgstr "" -#: howto/argparse.rst:585 +#: howto/argparse.rst:590 msgid "And:" msgstr "" -#: howto/argparse.rst:587 +#: howto/argparse.rst:592 msgid "" "$ python prog.py 4\n" "16" msgstr "" -#: howto/argparse.rst:592 +#: howto/argparse.rst:597 msgid "" "You can go quite far just with what we've learned so far, and we have only " "scratched the surface. The :mod:`argparse` module is very powerful, and " "we'll explore a bit more of it before we end this tutorial." msgstr "" -#: howto/argparse.rst:599 +#: howto/argparse.rst:604 msgid "Getting a little more advanced" msgstr "" -#: howto/argparse.rst:601 +#: howto/argparse.rst:606 msgid "" "What if we wanted to expand our tiny program to perform other powers, not " "just squares::" msgstr "" -#: howto/argparse.rst:604 +#: howto/argparse.rst:609 msgid "" "import argparse\n" "parser = argparse.ArgumentParser()\n" @@ -846,11 +852,11 @@ msgid "" " print(answer)" msgstr "" -#: howto/argparse.rst:656 howto/argparse.rst:872 +#: howto/argparse.rst:661 howto/argparse.rst:877 msgid "Output:" msgstr "" -#: howto/argparse.rst:620 +#: howto/argparse.rst:625 msgid "" "$ python prog.py\n" "usage: prog.py [-h] [-v] x y\n" @@ -869,14 +875,14 @@ msgid "" "4^2 == 16" msgstr "" -#: howto/argparse.rst:639 +#: howto/argparse.rst:644 msgid "" "Notice that so far we've been using verbosity level to *change* the text " "that gets displayed. The following example instead uses verbosity level to " "display *more* text instead::" msgstr "" -#: howto/argparse.rst:643 +#: howto/argparse.rst:648 msgid "" "import argparse\n" "parser = argparse.ArgumentParser()\n" @@ -892,7 +898,7 @@ msgid "" "print(answer)" msgstr "" -#: howto/argparse.rst:658 +#: howto/argparse.rst:663 msgid "" "$ python prog.py 4 2\n" "16\n" @@ -903,18 +909,18 @@ msgid "" "4^2 == 16" msgstr "" -#: howto/argparse.rst:672 +#: howto/argparse.rst:677 msgid "Specifying ambiguous arguments" msgstr "" -#: howto/argparse.rst:674 +#: howto/argparse.rst:679 msgid "" "When there is ambiguity in deciding whether an argument is positional or for " "an argument, ``--`` can be used to tell :meth:`~ArgumentParser.parse_args` " "that everything after that is a positional argument::" msgstr "" -#: howto/argparse.rst:678 +#: howto/argparse.rst:683 msgid "" ">>> parser = argparse.ArgumentParser(prog='PROG')\n" ">>> parser.add_argument('-n', nargs='+')\n" @@ -936,11 +942,11 @@ msgid "" "Namespace(args=['2', '3'], n=['1'])" msgstr "" -#: howto/argparse.rst:699 +#: howto/argparse.rst:704 msgid "Conflicting options" msgstr "" -#: howto/argparse.rst:701 +#: howto/argparse.rst:706 msgid "" "So far, we have been working with two methods of an :class:`argparse." "ArgumentParser` instance. Let's introduce a third one, :meth:" @@ -950,7 +956,7 @@ msgid "" "``--quiet`` option, which will be the opposite of the ``--verbose`` one::" msgstr "" -#: howto/argparse.rst:709 +#: howto/argparse.rst:714 msgid "" "import argparse\n" "\n" @@ -971,13 +977,13 @@ msgid "" " print(f\"{args.x}^{args.y} == {answer}\")" msgstr "" -#: howto/argparse.rst:727 +#: howto/argparse.rst:732 msgid "" "Our program is now simpler, and we've lost some functionality for the sake " "of demonstration. Anyways, here's the output:" msgstr "" -#: howto/argparse.rst:730 +#: howto/argparse.rst:735 msgid "" "$ python prog.py 4 2\n" "4^2 == 16\n" @@ -993,20 +999,20 @@ msgid "" "prog.py: error: argument -q/--quiet: not allowed with argument -v/--verbose" msgstr "" -#: howto/argparse.rst:745 +#: howto/argparse.rst:750 msgid "" "That should be easy to follow. I've added that last output so you can see " "the sort of flexibility you get, i.e. mixing long form options with short " "form ones." msgstr "" -#: howto/argparse.rst:749 +#: howto/argparse.rst:754 msgid "" "Before we conclude, you probably want to tell your users the main purpose of " "your program, just in case they don't know::" msgstr "" -#: howto/argparse.rst:752 +#: howto/argparse.rst:757 msgid "" "import argparse\n" "\n" @@ -1028,14 +1034,14 @@ msgid "" " print(f\"{args.x}^{args.y} == {answer}\")" msgstr "" -#: howto/argparse.rst:770 +#: howto/argparse.rst:775 msgid "" "Note that slight difference in the usage text. Note the ``[-v | -q]``, which " "tells us that we can either use ``-v`` or ``-q``, but not both at the same " "time:" msgstr "" -#: howto/argparse.rst:801 +#: howto/argparse.rst:806 msgid "" "$ python prog.py --help\n" "usage: prog.py [-h] [-v | -q] x y\n" @@ -1052,11 +1058,11 @@ msgid "" " -q, --quiet" msgstr "" -#: howto/argparse.rst:792 +#: howto/argparse.rst:797 msgid "How to translate the argparse output" msgstr "" -#: howto/argparse.rst:794 +#: howto/argparse.rst:799 msgid "" "The output of the :mod:`argparse` module such as its help text and error " "messages are all made translatable using the :mod:`gettext` module. This " @@ -1064,64 +1070,64 @@ msgid "" "See also :ref:`i18n-howto`." msgstr "" -#: howto/argparse.rst:799 +#: howto/argparse.rst:804 msgid "For instance, in this :mod:`argparse` output:" msgstr "" -#: howto/argparse.rst:817 +#: howto/argparse.rst:822 msgid "" "The strings ``usage:``, ``positional arguments:``, ``options:`` and ``show " "this help message and exit`` are all translatable." msgstr "" -#: howto/argparse.rst:820 +#: howto/argparse.rst:825 msgid "" "In order to translate these strings, they must first be extracted into a ``." "po`` file. For example, using `Babel `__, run this " "command:" msgstr "" -#: howto/argparse.rst:824 +#: howto/argparse.rst:829 msgid "$ pybabel extract -o messages.po /usr/lib/python3.12/argparse.py" msgstr "" -#: howto/argparse.rst:828 +#: howto/argparse.rst:833 msgid "" "This command will extract all translatable strings from the :mod:`argparse` " "module and output them into a file named ``messages.po``. This command " "assumes that your Python installation is in ``/usr/lib``." msgstr "" -#: howto/argparse.rst:832 +#: howto/argparse.rst:837 msgid "" "You can find out the location of the :mod:`argparse` module on your system " "using this script::" msgstr "" -#: howto/argparse.rst:835 +#: howto/argparse.rst:840 msgid "" "import argparse\n" "print(argparse.__file__)" msgstr "" -#: howto/argparse.rst:838 +#: howto/argparse.rst:843 msgid "" "Once the messages in the ``.po`` file are translated and the translations " "are installed using :mod:`gettext`, :mod:`argparse` will be able to display " "the translated messages." msgstr "" -#: howto/argparse.rst:842 +#: howto/argparse.rst:847 msgid "" "To translate your own strings in the :mod:`argparse` output, use :mod:" "`gettext`." msgstr "" -#: howto/argparse.rst:845 +#: howto/argparse.rst:850 msgid "Custom type converters" msgstr "" -#: howto/argparse.rst:847 +#: howto/argparse.rst:852 msgid "" "The :mod:`argparse` module allows you to specify custom type converters for " "your command-line arguments. This allows you to modify user input before " @@ -1129,7 +1135,7 @@ msgid "" "need to pre-process the input before it is used in your program." msgstr "" -#: howto/argparse.rst:852 +#: howto/argparse.rst:857 msgid "" "When using a custom type converter, you can use any callable that takes a " "single string argument (the argument value) and returns the converted value. " @@ -1137,13 +1143,13 @@ msgid "" "action class with the **action** parameter instead." msgstr "" -#: howto/argparse.rst:857 +#: howto/argparse.rst:862 msgid "" "For example, let's say you want to handle arguments with different prefixes " "and process them accordingly::" msgstr "" -#: howto/argparse.rst:860 +#: howto/argparse.rst:865 msgid "" "import argparse\n" "\n" @@ -1158,30 +1164,30 @@ msgid "" "print(args)" msgstr "" -#: howto/argparse.rst:874 +#: howto/argparse.rst:879 msgid "" "$ python prog.py -a value1 +a value2\n" "Namespace(a=[('-', 'value1'), ('+', 'value2')])" msgstr "" -#: howto/argparse.rst:879 +#: howto/argparse.rst:884 msgid "In this example, we:" msgstr "" -#: howto/argparse.rst:881 +#: howto/argparse.rst:886 msgid "" "Created a parser with custom prefix characters using the ``prefix_chars`` " "parameter." msgstr "" -#: howto/argparse.rst:884 +#: howto/argparse.rst:889 msgid "" "Defined two arguments, ``-a`` and ``+a``, which used the ``type`` parameter " "to create custom type converters to store the value in a tuple with the " "prefix." msgstr "" -#: howto/argparse.rst:887 +#: howto/argparse.rst:892 msgid "" "Without the custom type converters, the arguments would have treated the ``-" "a`` and ``+a`` as the same argument, which would have been undesirable. By " @@ -1189,11 +1195,11 @@ msgid "" "arguments." msgstr "" -#: howto/argparse.rst:892 +#: howto/argparse.rst:897 msgid "Conclusion" msgstr "" -#: howto/argparse.rst:894 +#: howto/argparse.rst:899 msgid "" "The :mod:`argparse` module offers a lot more than shown here. Its docs are " "quite detailed and thorough, and full of examples. Having gone through this " diff --git a/howto/clinic.po b/howto/clinic.po index 889ccba1..7d016add 100644 --- a/howto/clinic.po +++ b/howto/clinic.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" diff --git a/howto/cporting.po b/howto/cporting.po index ad14e136..424f4cda 100644 --- a/howto/cporting.po +++ b/howto/cporting.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" diff --git a/howto/curses.po b/howto/curses.po index 6f098996..56ca5b00 100644 --- a/howto/curses.po +++ b/howto/curses.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -234,8 +234,8 @@ msgid "" " v = i-10\n" " stdscr.addstr(i, 0, '10 divided by {} is {}'.format(v, 10/v))\n" "\n" -" stdscr.refresh()\n" -" stdscr.getkey()\n" +" stdscr.refresh()\n" +" stdscr.getkey()\n" "\n" "wrapper(main)" msgstr "" diff --git a/howto/descriptor.po b/howto/descriptor.po index 745d78db..3960652b 100644 --- a/howto/descriptor.po +++ b/howto/descriptor.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -548,8 +548,9 @@ msgid "" "\n" " def validate(self, value):\n" " if value not in self.options:\n" -" raise ValueError(f'Expected {value!r} to be one of {self.options!" -"r}')\n" +" raise ValueError(\n" +" f'Expected {value!r} to be one of {self.options!r}'\n" +" )\n" "\n" "class Number(Validator):\n" "\n" @@ -594,15 +595,15 @@ msgid "" " )" msgstr "" -#: howto/descriptor.rst:437 +#: howto/descriptor.rst:439 msgid "Practical application" msgstr "" -#: howto/descriptor.rst:439 +#: howto/descriptor.rst:441 msgid "Here's how the data validators can be used in a real class:" msgstr "" -#: howto/descriptor.rst:441 +#: howto/descriptor.rst:443 msgid "" "class Component:\n" "\n" @@ -616,11 +617,11 @@ msgid "" " self.quantity = quantity" msgstr "" -#: howto/descriptor.rst:454 +#: howto/descriptor.rst:456 msgid "The descriptors prevent invalid instances from being created:" msgstr "" -#: howto/descriptor.rst:456 +#: howto/descriptor.rst:458 msgid "" ">>> Component('Widget', 'metal', 5) # Blocked: 'Widget' is not all " "uppercase\n" @@ -638,6 +639,7 @@ msgid "" "Traceback (most recent call last):\n" " ...\n" "ValueError: Expected -5 to be at least 0\n" +"\n" ">>> Component('WIDGET', 'metal', 'V') # Blocked: 'V' isn't a number\n" "Traceback (most recent call last):\n" " ...\n" @@ -646,37 +648,37 @@ msgid "" ">>> c = Component('WIDGET', 'metal', 5) # Allowed: The inputs are valid" msgstr "" -#: howto/descriptor.rst:481 +#: howto/descriptor.rst:484 msgid "Technical Tutorial" msgstr "" -#: howto/descriptor.rst:483 +#: howto/descriptor.rst:486 msgid "" "What follows is a more technical tutorial for the mechanics and details of " "how descriptors work." msgstr "" -#: howto/descriptor.rst:488 +#: howto/descriptor.rst:491 msgid "Abstract" msgstr "" -#: howto/descriptor.rst:490 +#: howto/descriptor.rst:493 msgid "" "Defines descriptors, summarizes the protocol, and shows how descriptors are " "called. Provides an example showing how object relational mappings work." msgstr "" -#: howto/descriptor.rst:493 +#: howto/descriptor.rst:496 msgid "" "Learning about descriptors not only provides access to a larger toolset, it " "creates a deeper understanding of how Python works." msgstr "" -#: howto/descriptor.rst:498 +#: howto/descriptor.rst:501 msgid "Definition and introduction" msgstr "" -#: howto/descriptor.rst:500 +#: howto/descriptor.rst:503 msgid "" "In general, a descriptor is an attribute value that has one of the methods " "in the descriptor protocol. Those methods are :meth:`~object.__get__`, :" @@ -684,7 +686,7 @@ msgid "" "methods are defined for an attribute, it is said to be a :term:`descriptor`." msgstr "" -#: howto/descriptor.rst:505 +#: howto/descriptor.rst:508 msgid "" "The default behavior for attribute access is to get, set, or delete the " "attribute from an object's dictionary. For instance, ``a.x`` has a lookup " @@ -696,7 +698,7 @@ msgid "" "methods were defined." msgstr "" -#: howto/descriptor.rst:514 +#: howto/descriptor.rst:517 msgid "" "Descriptors are a powerful, general purpose protocol. They are the " "mechanism behind properties, methods, static methods, class methods, and :" @@ -705,30 +707,30 @@ msgid "" "Python programs." msgstr "" -#: howto/descriptor.rst:522 +#: howto/descriptor.rst:525 msgid "Descriptor protocol" msgstr "" -#: howto/descriptor.rst:524 +#: howto/descriptor.rst:527 msgid "``descr.__get__(self, obj, type=None)``" msgstr "" -#: howto/descriptor.rst:526 +#: howto/descriptor.rst:529 msgid "``descr.__set__(self, obj, value)``" msgstr "" -#: howto/descriptor.rst:528 +#: howto/descriptor.rst:531 msgid "``descr.__delete__(self, obj)``" msgstr "" -#: howto/descriptor.rst:530 +#: howto/descriptor.rst:533 msgid "" "That is all there is to it. Define any of these methods and an object is " "considered a descriptor and can override default behavior upon being looked " "up as an attribute." msgstr "" -#: howto/descriptor.rst:534 +#: howto/descriptor.rst:537 msgid "" "If an object defines :meth:`~object.__set__` or :meth:`~object.__delete__`, " "it is considered a data descriptor. Descriptors that only define :meth:" @@ -736,7 +738,7 @@ msgid "" "methods but other uses are possible)." msgstr "" -#: howto/descriptor.rst:539 +#: howto/descriptor.rst:542 msgid "" "Data and non-data descriptors differ in how overrides are calculated with " "respect to entries in an instance's dictionary. If an instance's dictionary " @@ -745,7 +747,7 @@ msgid "" "name as a non-data descriptor, the dictionary entry takes precedence." msgstr "" -#: howto/descriptor.rst:545 +#: howto/descriptor.rst:548 msgid "" "To make a read-only data descriptor, define both :meth:`~object.__get__` " "and :meth:`~object.__set__` with the :meth:`~object.__set__` raising an :exc:" @@ -753,23 +755,23 @@ msgid "" "with an exception raising placeholder is enough to make it a data descriptor." msgstr "" -#: howto/descriptor.rst:552 +#: howto/descriptor.rst:555 msgid "Overview of descriptor invocation" msgstr "" -#: howto/descriptor.rst:554 +#: howto/descriptor.rst:557 msgid "" "A descriptor can be called directly with ``desc.__get__(obj)`` or ``desc." "__get__(None, cls)``." msgstr "" -#: howto/descriptor.rst:557 +#: howto/descriptor.rst:560 msgid "" "But it is more common for a descriptor to be invoked automatically from " "attribute access." msgstr "" -#: howto/descriptor.rst:560 +#: howto/descriptor.rst:563 msgid "" "The expression ``obj.x`` looks up the attribute ``x`` in the chain of " "namespaces for ``obj``. If the search finds a descriptor outside of the " @@ -777,17 +779,17 @@ msgid "" "invoked according to the precedence rules listed below." msgstr "" -#: howto/descriptor.rst:565 +#: howto/descriptor.rst:568 msgid "" "The details of invocation depend on whether ``obj`` is an object, class, or " "instance of super." msgstr "" -#: howto/descriptor.rst:570 +#: howto/descriptor.rst:573 msgid "Invocation from an instance" msgstr "" -#: howto/descriptor.rst:572 +#: howto/descriptor.rst:575 msgid "" "Instance lookup scans through a chain of namespaces giving data descriptors " "the highest priority, followed by instance variables, then non-data " @@ -795,19 +797,19 @@ msgid "" "it is provided." msgstr "" -#: howto/descriptor.rst:577 +#: howto/descriptor.rst:580 msgid "" "If a descriptor is found for ``a.x``, then it is invoked with: ``desc." "__get__(a, type(a))``." msgstr "" -#: howto/descriptor.rst:580 +#: howto/descriptor.rst:583 msgid "" "The logic for a dotted lookup is in :meth:`object.__getattribute__`. Here " "is a pure Python equivalent:" msgstr "" -#: howto/descriptor.rst:583 +#: howto/descriptor.rst:586 msgid "" "def find_name_in_mro(cls, name, default):\n" " \"Emulate _PyType_Lookup() in Objects/typeobject.c\"\n" @@ -836,7 +838,7 @@ msgid "" " raise AttributeError(name)" msgstr "" -#: howto/descriptor.rst:719 +#: howto/descriptor.rst:722 msgid "" "Note, there is no :meth:`~object.__getattr__` hook in the :meth:`~object." "__getattribute__` code. That is why calling :meth:`~object." @@ -844,7 +846,7 @@ msgid "" "meth:`~object.__getattr__` entirely." msgstr "" -#: howto/descriptor.rst:723 +#: howto/descriptor.rst:726 msgid "" "Instead, it is the dot operator and the :func:`getattr` function that are " "responsible for invoking :meth:`~object.__getattr__` whenever :meth:`~object." @@ -852,7 +854,7 @@ msgid "" "encapsulated in a helper function:" msgstr "" -#: howto/descriptor.rst:728 +#: howto/descriptor.rst:731 msgid "" "def getattr_hook(obj, name):\n" " \"Emulate slot_tp_getattr_hook() in Objects/typeobject.c\"\n" @@ -864,11 +866,11 @@ msgid "" " return type(obj).__getattr__(obj, name) # __getattr__" msgstr "" -#: howto/descriptor.rst:773 +#: howto/descriptor.rst:776 msgid "Invocation from a class" msgstr "" -#: howto/descriptor.rst:775 +#: howto/descriptor.rst:778 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." @@ -876,27 +878,27 @@ msgid "" "through the class's :term:`method resolution order`." msgstr "" -#: howto/descriptor.rst:780 +#: howto/descriptor.rst:783 msgid "If a descriptor is found, it is invoked with ``desc.__get__(None, A)``." msgstr "" -#: howto/descriptor.rst:782 +#: howto/descriptor.rst:785 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:787 +#: howto/descriptor.rst:790 msgid "Invocation from super" msgstr "" -#: howto/descriptor.rst:789 +#: howto/descriptor.rst:792 msgid "" "The logic for super's dotted lookup is in the :meth:`~object." "__getattribute__` method for object returned by :func:`super`." msgstr "" -#: howto/descriptor.rst:792 +#: howto/descriptor.rst:795 msgid "" "A dotted lookup such as ``super(A, obj).m`` searches ``obj.__class__." "__mro__`` for the base class ``B`` immediately following ``A`` and then " @@ -904,7 +906,7 @@ msgid "" "returned unchanged." msgstr "" -#: howto/descriptor.rst:797 +#: howto/descriptor.rst:800 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 " @@ -912,38 +914,38 @@ msgid "" "#cooperation>`_." msgstr "" -#: howto/descriptor.rst:804 +#: howto/descriptor.rst:807 msgid "Summary of invocation logic" msgstr "" -#: howto/descriptor.rst:806 +#: howto/descriptor.rst:809 msgid "" "The mechanism for descriptors is embedded in the :meth:`~object." "__getattribute__` methods for :class:`object`, :class:`type`, and :func:" "`super`." msgstr "" -#: howto/descriptor.rst:809 +#: howto/descriptor.rst:812 msgid "The important points to remember are:" msgstr "" -#: howto/descriptor.rst:811 +#: howto/descriptor.rst:814 msgid "Descriptors are invoked by the :meth:`~object.__getattribute__` method." msgstr "" -#: howto/descriptor.rst:813 +#: howto/descriptor.rst:816 msgid "" "Classes inherit this machinery from :class:`object`, :class:`type`, or :func:" "`super`." msgstr "" -#: howto/descriptor.rst:816 +#: howto/descriptor.rst:819 msgid "" "Overriding :meth:`~object.__getattribute__` prevents automatic descriptor " "calls because all the descriptor logic is in that method." msgstr "" -#: howto/descriptor.rst:819 +#: howto/descriptor.rst:822 msgid "" ":meth:`!object.__getattribute__` and :meth:`!type.__getattribute__` make " "different calls to :meth:`~object.__get__`. The first includes the instance " @@ -951,19 +953,19 @@ msgid "" "always includes the class." msgstr "" -#: howto/descriptor.rst:824 +#: howto/descriptor.rst:827 msgid "Data descriptors always override instance dictionaries." msgstr "" -#: howto/descriptor.rst:826 +#: howto/descriptor.rst:829 msgid "Non-data descriptors may be overridden by instance dictionaries." msgstr "" -#: howto/descriptor.rst:830 +#: howto/descriptor.rst:833 msgid "Automatic name notification" msgstr "" -#: howto/descriptor.rst:832 +#: howto/descriptor.rst:835 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` " @@ -973,38 +975,38 @@ msgid "" "used, and the *name* is the class variable the descriptor was assigned to." msgstr "" -#: howto/descriptor.rst:839 +#: howto/descriptor.rst:842 msgid "" "The implementation details are in :c:func:`!type_new` and :c:func:`!" "set_names` in :source:`Objects/typeobject.c`." msgstr "" -#: howto/descriptor.rst:842 +#: howto/descriptor.rst:845 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:`~object.__set_name__` will need to be called manually." msgstr "" -#: howto/descriptor.rst:848 +#: howto/descriptor.rst:851 msgid "ORM example" msgstr "" -#: howto/descriptor.rst:850 +#: howto/descriptor.rst:853 msgid "" "The following code is a simplified skeleton showing how data descriptors " "could be used to implement an `object relational mapping `_." msgstr "" -#: howto/descriptor.rst:854 +#: howto/descriptor.rst:857 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:858 +#: howto/descriptor.rst:861 msgid "" "class Field:\n" "\n" @@ -1022,14 +1024,14 @@ msgid "" " conn.commit()" msgstr "" -#: howto/descriptor.rst:873 +#: howto/descriptor.rst:876 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:877 +#: howto/descriptor.rst:880 msgid "" "class Movie:\n" " table = 'Movies' # Table name\n" @@ -1051,23 +1053,23 @@ msgid "" " self.key = key" msgstr "" -#: howto/descriptor.rst:898 +#: howto/descriptor.rst:901 msgid "To use the models, first connect to the database::" msgstr "" -#: howto/descriptor.rst:900 +#: howto/descriptor.rst:903 msgid "" ">>> import sqlite3\n" ">>> conn = sqlite3.connect('entertainment.db')" msgstr "" -#: howto/descriptor.rst:903 +#: howto/descriptor.rst:906 msgid "" "An interactive session shows how data is retrieved from the database and how " "it can be updated:" msgstr "" -#: howto/descriptor.rst:931 +#: howto/descriptor.rst:934 msgid "" ">>> Movie('Star Wars').director\n" "'George Lucas'\n" @@ -1083,11 +1085,11 @@ msgid "" "'J.J. Abrams'" msgstr "" -#: howto/descriptor.rst:952 +#: howto/descriptor.rst:955 msgid "Pure Python Equivalents" msgstr "" -#: howto/descriptor.rst:954 +#: howto/descriptor.rst:957 msgid "" "The descriptor protocol is simple and offers exciting possibilities. " "Several use cases are so common that they have been prepackaged into built-" @@ -1095,27 +1097,27 @@ msgid "" "\\_\\_slots\\_\\_ are all based on the descriptor protocol." msgstr "" -#: howto/descriptor.rst:961 +#: howto/descriptor.rst:964 msgid "Properties" msgstr "" -#: howto/descriptor.rst:963 +#: howto/descriptor.rst:966 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:966 +#: howto/descriptor.rst:969 msgid "property(fget=None, fset=None, fdel=None, doc=None) -> property" msgstr "" -#: howto/descriptor.rst:968 +#: howto/descriptor.rst:971 msgid "" "The documentation shows a typical use to define a managed attribute ``x``:" msgstr "" -#: howto/descriptor.rst:970 +#: howto/descriptor.rst:973 msgid "" "class C:\n" " def getx(self): return self.__x\n" @@ -1124,13 +1126,14 @@ msgid "" " x = property(getx, setx, delx, \"I'm the 'x' property.\")" msgstr "" -#: howto/descriptor.rst:992 +#: howto/descriptor.rst:995 msgid "" "To see how :func:`property` is implemented in terms of the descriptor " -"protocol, here is a pure Python equivalent:" +"protocol, here is a pure Python equivalent that implements most of the core " +"functionality:" msgstr "" -#: howto/descriptor.rst:995 +#: howto/descriptor.rst:998 msgid "" "class Property:\n" " \"Emulate PyProperty_Type() in Objects/descrobject.c\"\n" @@ -1142,61 +1145,45 @@ msgid "" " if doc is None and fget is not None:\n" " doc = fget.__doc__\n" " self.__doc__ = doc\n" -" self._name = ''\n" "\n" " def __set_name__(self, owner, name):\n" -" self._name = name\n" +" self.__name__ = name\n" "\n" " def __get__(self, obj, objtype=None):\n" " if obj is None:\n" " return self\n" " if self.fget is None:\n" -" raise AttributeError(\n" -" f'property {self._name!r} of {type(obj).__name__!r} object " -"has no getter'\n" -" )\n" +" raise AttributeError\n" " return self.fget(obj)\n" "\n" " def __set__(self, obj, value):\n" " if self.fset is None:\n" -" raise AttributeError(\n" -" f'property {self._name!r} of {type(obj).__name__!r} object " -"has no setter'\n" -" )\n" +" raise AttributeError\n" " self.fset(obj, value)\n" "\n" " def __delete__(self, obj):\n" " if self.fdel is None:\n" -" raise AttributeError(\n" -" f'property {self._name!r} of {type(obj).__name__!r} object " -"has no deleter'\n" -" )\n" +" raise AttributeError\n" " self.fdel(obj)\n" "\n" " def getter(self, fget):\n" -" prop = type(self)(fget, self.fset, self.fdel, self.__doc__)\n" -" prop._name = self._name\n" -" return prop\n" +" return type(self)(fget, self.fset, self.fdel, self.__doc__)\n" "\n" " def setter(self, fset):\n" -" prop = type(self)(self.fget, fset, self.fdel, self.__doc__)\n" -" prop._name = self._name\n" -" return prop\n" +" return type(self)(self.fget, fset, self.fdel, self.__doc__)\n" "\n" " def deleter(self, fdel):\n" -" prop = type(self)(self.fget, self.fset, fdel, self.__doc__)\n" -" prop._name = self._name\n" -" return prop" +" return type(self)(self.fget, self.fset, fdel, self.__doc__)" msgstr "" -#: howto/descriptor.rst:1132 +#: howto/descriptor.rst:1122 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:1136 +#: howto/descriptor.rst:1126 msgid "" "For instance, a spreadsheet class may grant access to a cell value through " "``Cell('b10').value``. Subsequent improvements to the program require the " @@ -1206,7 +1193,7 @@ msgid "" "descriptor:" msgstr "" -#: howto/descriptor.rst:1142 +#: howto/descriptor.rst:1132 msgid "" "class Cell:\n" " ...\n" @@ -1218,23 +1205,23 @@ msgid "" " return self._value" msgstr "" -#: howto/descriptor.rst:1153 +#: howto/descriptor.rst:1143 msgid "" "Either the built-in :func:`property` or our :func:`!Property` equivalent " "would work in this example." msgstr "" -#: howto/descriptor.rst:1158 +#: howto/descriptor.rst:1148 msgid "Functions and methods" msgstr "" -#: howto/descriptor.rst:1160 +#: howto/descriptor.rst:1150 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:1163 +#: howto/descriptor.rst:1153 msgid "" "Functions stored in class dictionaries get turned into methods when invoked. " "Methods only differ from regular functions in that the object instance is " @@ -1242,13 +1229,13 @@ msgid "" "*self* but could be called *this* or any other variable name." msgstr "" -#: howto/descriptor.rst:1168 +#: howto/descriptor.rst:1158 msgid "" "Methods can be created manually with :class:`types.MethodType` which is " "roughly equivalent to:" msgstr "" -#: howto/descriptor.rst:1171 +#: howto/descriptor.rst:1161 msgid "" "class MethodType:\n" " \"Emulate PyMethod_Type in Objects/classobject.c\"\n" @@ -1260,10 +1247,24 @@ msgid "" " def __call__(self, *args, **kwargs):\n" " func = self.__func__\n" " obj = self.__self__\n" -" return func(obj, *args, **kwargs)" +" return func(obj, *args, **kwargs)\n" +"\n" +" def __getattribute__(self, name):\n" +" \"Emulate method_getset() in Objects/classobject.c\"\n" +" if name == '__doc__':\n" +" return self.__func__.__doc__\n" +" return object.__getattribute__(self, name)\n" +"\n" +" def __getattr__(self, name):\n" +" \"Emulate method_getattro() in Objects/classobject.c\"\n" +" return getattr(self.__func__, name)\n" +"\n" +" def __get__(self, obj, objtype=None):\n" +" \"Emulate method_descr_get() in Objects/classobject.c\"\n" +" return self" msgstr "" -#: howto/descriptor.rst:1185 +#: howto/descriptor.rst:1189 msgid "" "To support automatic creation of methods, functions include the :meth:" "`~object.__get__` method for binding methods during attribute access. This " @@ -1271,7 +1272,7 @@ msgid "" "during dotted lookup from an instance. Here's how it works:" msgstr "" -#: howto/descriptor.rst:1190 +#: howto/descriptor.rst:1194 msgid "" "class Function:\n" " ...\n" @@ -1283,75 +1284,78 @@ msgid "" " return MethodType(self, obj)" msgstr "" -#: howto/descriptor.rst:1201 +#: howto/descriptor.rst:1205 msgid "" "Running the following class in the interpreter shows how the function " "descriptor works in practice:" msgstr "" -#: howto/descriptor.rst:1204 +#: howto/descriptor.rst:1208 msgid "" "class D:\n" -" def f(self, x):\n" -" return x" +" def f(self):\n" +" return self\n" +"\n" +"class D2:\n" +" pass" msgstr "" -#: howto/descriptor.rst:1210 +#: howto/descriptor.rst:1226 msgid "" "The function has a :term:`qualified name` attribute to support introspection:" msgstr "" -#: howto/descriptor.rst:1212 +#: howto/descriptor.rst:1228 msgid "" ">>> D.f.__qualname__\n" "'D.f'" msgstr "" -#: howto/descriptor.rst:1217 +#: howto/descriptor.rst:1233 msgid "" "Accessing the function through the class dictionary does not invoke :meth:" "`~object.__get__`. Instead, it just returns the underlying function object::" msgstr "" -#: howto/descriptor.rst:1220 +#: howto/descriptor.rst:1236 msgid "" ">>> D.__dict__['f']\n" "" msgstr "" -#: howto/descriptor.rst:1223 +#: howto/descriptor.rst:1239 msgid "" "Dotted access from a class calls :meth:`~object.__get__` which just returns " "the underlying function unchanged::" msgstr "" -#: howto/descriptor.rst:1226 +#: howto/descriptor.rst:1242 msgid "" ">>> D.f\n" "" msgstr "" -#: howto/descriptor.rst:1229 +#: howto/descriptor.rst:1245 msgid "" "The interesting behavior occurs during dotted access from an instance. The " "dotted lookup calls :meth:`~object.__get__` which returns a bound method " "object::" msgstr "" -#: howto/descriptor.rst:1232 +#: howto/descriptor.rst:1248 msgid "" ">>> d = D()\n" ">>> d.f\n" ">" msgstr "" -#: howto/descriptor.rst:1236 +#: howto/descriptor.rst:1252 msgid "" "Internally, the bound method stores the underlying function and the bound " "instance::" msgstr "" -#: howto/descriptor.rst:1239 +#: howto/descriptor.rst:1255 msgid "" ">>> d.f.__func__\n" "\n" @@ -1360,23 +1364,23 @@ msgid "" "<__main__.D object at 0x00B18C90>" msgstr "" -#: howto/descriptor.rst:1245 +#: howto/descriptor.rst:1261 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:1250 +#: howto/descriptor.rst:1266 msgid "Kinds of methods" msgstr "" -#: howto/descriptor.rst:1252 +#: howto/descriptor.rst:1268 msgid "" "Non-data descriptors provide a simple mechanism for variations on the usual " "patterns of binding functions into methods." msgstr "" -#: howto/descriptor.rst:1255 +#: howto/descriptor.rst:1271 msgid "" "To recap, functions have a :meth:`~object.__get__` method so that they can " "be converted to a method when accessed as attributes. The non-data " @@ -1384,55 +1388,55 @@ msgid "" "Calling ``cls.f(*args)`` becomes ``f(*args)``." msgstr "" -#: howto/descriptor.rst:1260 +#: howto/descriptor.rst:1276 msgid "This chart summarizes the binding and its two most useful variants:" msgstr "" -#: howto/descriptor.rst:1263 +#: howto/descriptor.rst:1279 msgid "Transformation" msgstr "" -#: howto/descriptor.rst:1263 +#: howto/descriptor.rst:1279 msgid "Called from an object" msgstr "" -#: howto/descriptor.rst:1263 +#: howto/descriptor.rst:1279 msgid "Called from a class" msgstr "" -#: howto/descriptor.rst:1266 +#: howto/descriptor.rst:1282 msgid "function" msgstr "" -#: howto/descriptor.rst:1266 +#: howto/descriptor.rst:1282 msgid "f(obj, \\*args)" msgstr "" -#: howto/descriptor.rst:1268 +#: howto/descriptor.rst:1284 msgid "f(\\*args)" msgstr "" -#: howto/descriptor.rst:1268 +#: howto/descriptor.rst:1284 msgid "staticmethod" msgstr "" -#: howto/descriptor.rst:1270 +#: howto/descriptor.rst:1286 msgid "classmethod" msgstr "" -#: howto/descriptor.rst:1270 +#: howto/descriptor.rst:1286 msgid "f(type(obj), \\*args)" msgstr "" -#: howto/descriptor.rst:1270 +#: howto/descriptor.rst:1286 msgid "f(cls, \\*args)" msgstr "" -#: howto/descriptor.rst:1275 +#: howto/descriptor.rst:1291 msgid "Static methods" msgstr "" -#: howto/descriptor.rst:1277 +#: howto/descriptor.rst:1293 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." @@ -1441,13 +1445,13 @@ msgid "" "a class." msgstr "" -#: howto/descriptor.rst:1283 +#: howto/descriptor.rst:1299 msgid "" "Good candidates for static methods are methods that do not reference the " "``self`` variable." msgstr "" -#: howto/descriptor.rst:1286 +#: howto/descriptor.rst:1302 msgid "" "For instance, a statistics package may include a container class for " "experimental data. The class provides normal methods for computing the " @@ -1456,16 +1460,16 @@ msgid "" "but do not depend on the data. For instance, ``erf(x)`` is handy conversion " "routine that comes up in statistical work but does not directly depend on a " "particular dataset. It can be called either from an object or the class: " -"``s.erf(1.5) --> .9332`` or ``Sample.erf(1.5) --> .9332``." +"``s.erf(1.5) --> 0.9332`` or ``Sample.erf(1.5) --> 0.9332``." msgstr "" -#: howto/descriptor.rst:1295 +#: howto/descriptor.rst:1311 msgid "" "Since static methods return the underlying function with no changes, the " "example calls are unexciting:" msgstr "" -#: howto/descriptor.rst:1298 +#: howto/descriptor.rst:1314 msgid "" "class E:\n" " @staticmethod\n" @@ -1473,7 +1477,7 @@ msgid "" " return x * 10" msgstr "" -#: howto/descriptor.rst:1305 +#: howto/descriptor.rst:1321 msgid "" ">>> E.f(3)\n" "30\n" @@ -1481,13 +1485,13 @@ msgid "" "30" msgstr "" -#: howto/descriptor.rst:1312 +#: howto/descriptor.rst:1328 msgid "" "Using the non-data descriptor protocol, a pure Python version of :func:" "`staticmethod` would look like this:" msgstr "" -#: howto/descriptor.rst:1315 +#: howto/descriptor.rst:1331 msgid "" "import functools\n" "\n" @@ -1505,7 +1509,7 @@ msgid "" " return self.f(*args, **kwds)" msgstr "" -#: howto/descriptor.rst:1332 +#: howto/descriptor.rst:1348 msgid "" "The :func:`functools.update_wrapper` call adds a ``__wrapped__`` attribute " "that refers to the underlying function. Also it carries forward the " @@ -1514,18 +1518,18 @@ msgid "" "__doc__`, and :attr:`~function.__annotations__`." msgstr "" -#: howto/descriptor.rst:1401 +#: howto/descriptor.rst:1417 msgid "Class methods" msgstr "" -#: howto/descriptor.rst:1403 +#: howto/descriptor.rst:1419 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:1407 +#: howto/descriptor.rst:1423 msgid "" "class F:\n" " @classmethod\n" @@ -1533,7 +1537,7 @@ msgid "" " return cls.__name__, x" msgstr "" -#: howto/descriptor.rst:1414 +#: howto/descriptor.rst:1430 msgid "" ">>> F.f(3)\n" "('F', 3)\n" @@ -1541,7 +1545,7 @@ msgid "" "('F', 3)" msgstr "" -#: howto/descriptor.rst:1421 +#: howto/descriptor.rst:1437 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 " @@ -1550,7 +1554,7 @@ msgid "" "of keys. The pure Python equivalent is:" msgstr "" -#: howto/descriptor.rst:1427 +#: howto/descriptor.rst:1443 msgid "" "class Dict(dict):\n" " @classmethod\n" @@ -1562,11 +1566,11 @@ msgid "" " return d" msgstr "" -#: howto/descriptor.rst:1438 +#: howto/descriptor.rst:1454 msgid "Now a new dictionary of unique keys can be constructed like this:" msgstr "" -#: howto/descriptor.rst:1440 +#: howto/descriptor.rst:1456 msgid "" ">>> d = Dict.fromkeys('abracadabra')\n" ">>> type(d) is Dict\n" @@ -1575,13 +1579,13 @@ msgid "" "{'a': None, 'b': None, 'r': None, 'c': None, 'd': None}" msgstr "" -#: howto/descriptor.rst:1448 +#: howto/descriptor.rst:1464 msgid "" "Using the non-data descriptor protocol, a pure Python version of :func:" "`classmethod` would look like this:" msgstr "" -#: howto/descriptor.rst:1451 +#: howto/descriptor.rst:1467 msgid "" "import functools\n" "\n" @@ -1595,37 +1599,10 @@ msgid "" " def __get__(self, obj, cls=None):\n" " if cls is None:\n" " cls = type(obj)\n" -" if hasattr(type(self.f), '__get__'):\n" -" # This code path was added in Python 3.9\n" -" # and was deprecated in Python 3.11.\n" -" return self.f.__get__(cls, cls)\n" " return MethodType(self.f, cls)" msgstr "" -#: howto/descriptor.rst:1526 -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 " -"decorators. For example, a classmethod and property could be chained " -"together. In Python 3.11, this functionality was deprecated." -msgstr "" - -#: howto/descriptor.rst:1531 -msgid "" -"class G:\n" -" @classmethod\n" -" @property\n" -" def __doc__(cls):\n" -" return f'A doc for {cls.__name__!r}'" -msgstr "" - -#: howto/descriptor.rst:1539 -msgid "" -">>> G.__doc__\n" -"\"A doc for 'G'\"" -msgstr "" - -#: howto/descriptor.rst:1544 +#: howto/descriptor.rst:1529 msgid "" "The :func:`functools.update_wrapper` call in ``ClassMethod`` adds a " "``__wrapped__`` attribute that refers to the underlying function. Also it " @@ -1635,30 +1612,30 @@ msgid "" "__annotations__`." msgstr "" -#: howto/descriptor.rst:1553 +#: howto/descriptor.rst:1538 msgid "Member objects and __slots__" msgstr "" -#: howto/descriptor.rst:1555 +#: howto/descriptor.rst:1540 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:1559 +#: howto/descriptor.rst:1544 msgid "" "1. Provides immediate detection of bugs due to misspelled attribute " "assignments. Only attribute names specified in ``__slots__`` are allowed:" msgstr "" -#: howto/descriptor.rst:1562 +#: howto/descriptor.rst:1547 msgid "" "class Vehicle:\n" " __slots__ = ('id_number', 'make', 'model')" msgstr "" -#: howto/descriptor.rst:1567 +#: howto/descriptor.rst:1552 msgid "" ">>> auto = Vehicle()\n" ">>> auto.id_nubmer = 'VYE483814LQEX'\n" @@ -1667,13 +1644,13 @@ msgid "" "AttributeError: 'Vehicle' object has no attribute 'id_nubmer'" msgstr "" -#: howto/descriptor.rst:1575 +#: howto/descriptor.rst:1560 msgid "" "2. Helps create immutable objects where descriptors manage access to private " "attributes stored in ``__slots__``:" msgstr "" -#: howto/descriptor.rst:1578 +#: howto/descriptor.rst:1563 msgid "" "class Immutable:\n" "\n" @@ -1693,7 +1670,7 @@ msgid "" " return self._name" msgstr "" -#: howto/descriptor.rst:1596 +#: howto/descriptor.rst:1581 msgid "" ">>> mark = Immutable('Botany', 'Mark Watney')\n" ">>> mark.dept\n" @@ -1708,7 +1685,7 @@ msgid "" "AttributeError: 'Immutable' object has no attribute 'location'" msgstr "" -#: howto/descriptor.rst:1610 +#: howto/descriptor.rst:1595 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 " @@ -1716,19 +1693,19 @@ msgid "" "only matters when a large number of instances are going to be created." msgstr "" -#: howto/descriptor.rst:1615 +#: howto/descriptor.rst:1600 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:1618 +#: howto/descriptor.rst:1603 msgid "" "5. Blocks tools like :func:`functools.cached_property` which require an " "instance dictionary to function correctly:" msgstr "" -#: howto/descriptor.rst:1621 +#: howto/descriptor.rst:1606 msgid "" "from functools import cached_property\n" "\n" @@ -1741,7 +1718,7 @@ msgid "" " for n in reversed(range(100_000)))" msgstr "" -#: howto/descriptor.rst:1633 +#: howto/descriptor.rst:1618 msgid "" ">>> CP().pi\n" "Traceback (most recent call last):\n" @@ -1749,7 +1726,7 @@ msgid "" "TypeError: No '__dict__' attribute on 'CP' instance to cache 'pi' property." msgstr "" -#: howto/descriptor.rst:1640 +#: howto/descriptor.rst:1625 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 " @@ -1759,7 +1736,7 @@ msgid "" "managed by member descriptors:" msgstr "" -#: howto/descriptor.rst:1647 +#: howto/descriptor.rst:1632 msgid "" "null = object()\n" "\n" @@ -1798,13 +1775,13 @@ msgid "" " return f''" msgstr "" -#: howto/descriptor.rst:1685 +#: howto/descriptor.rst:1670 msgid "" "The :meth:`!type.__new__` method takes care of adding member objects to " "class variables:" msgstr "" -#: howto/descriptor.rst:1688 +#: howto/descriptor.rst:1673 msgid "" "class Type(type):\n" " 'Simulate how the type metaclass adds member objects for slots'\n" @@ -1818,14 +1795,14 @@ msgid "" " return type.__new__(mcls, clsname, bases, mapping, **kwargs)" msgstr "" -#: howto/descriptor.rst:1701 +#: howto/descriptor.rst:1686 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:1705 +#: howto/descriptor.rst:1690 msgid "" "class Object:\n" " 'Simulate how object.__new__() allocates memory for __slots__'\n" @@ -1857,13 +1834,13 @@ msgid "" " super().__delattr__(name)" msgstr "" -#: howto/descriptor.rst:1736 +#: howto/descriptor.rst:1721 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:1739 +#: howto/descriptor.rst:1724 msgid "" "class H(Object, metaclass=Type):\n" " 'Instance variables stored in slots'\n" @@ -1875,12 +1852,12 @@ msgid "" " self.y = y" msgstr "" -#: howto/descriptor.rst:1750 +#: howto/descriptor.rst:1735 msgid "" "At this point, the metaclass has loaded member objects for *x* and *y*::" msgstr "" -#: howto/descriptor.rst:1752 +#: howto/descriptor.rst:1737 msgid "" ">>> from pprint import pp\n" ">>> pp(dict(vars(H)))\n" @@ -1892,13 +1869,13 @@ msgid "" " 'y': }" msgstr "" -#: howto/descriptor.rst:1771 +#: howto/descriptor.rst:1756 msgid "" "When instances are created, they have a ``slot_values`` list where the " "attributes are stored:" msgstr "" -#: howto/descriptor.rst:1774 +#: howto/descriptor.rst:1759 msgid "" ">>> h = H(10, 20)\n" ">>> vars(h)\n" @@ -1908,11 +1885,11 @@ msgid "" "{'_slotvalues': [55, 20]}" msgstr "" -#: howto/descriptor.rst:1783 +#: howto/descriptor.rst:1768 msgid "Misspelled or unassigned attributes will raise an exception:" msgstr "" -#: howto/descriptor.rst:1785 +#: howto/descriptor.rst:1770 msgid "" ">>> h.xz\n" "Traceback (most recent call last):\n" diff --git a/howto/enum.po b/howto/enum.po index ed7e19f0..6ae2315d 100644 --- a/howto/enum.po +++ b/howto/enum.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -767,8 +767,8 @@ msgstr "" #: howto/enum.rst:503 msgid "" -"Use the :func:`!dataclass` argument ``repr=False`` to use the standard :func:" -"`repr`." +"Use the :func:`~dataclasses.dataclass` argument ``repr=False`` to use the " +"standard :func:`repr`." msgstr "" #: howto/enum.rst:506 @@ -778,14 +778,35 @@ msgid "" msgstr "" #: howto/enum.rst:512 +msgid "" +"Adding :func:`~dataclasses.dataclass` decorator to :class:`Enum` and its " +"subclasses is not supported. It will not raise any errors, but it will " +"produce very strange results at runtime, such as members being equal to each " +"other::" +msgstr "" + +#: howto/enum.rst:517 +msgid "" +">>> @dataclass # don't do this: it does not make any sense\n" +"... class Color(Enum):\n" +"... RED = 1\n" +"... BLUE = 2\n" +"...\n" +">>> Color.RED is Color.BLUE\n" +"False\n" +">>> Color.RED == Color.BLUE # problem is here: they should not be equal\n" +"True" +msgstr "" + +#: howto/enum.rst:529 msgid "Pickling" msgstr "" -#: howto/enum.rst:514 +#: howto/enum.rst:531 msgid "Enumerations can be pickled and unpickled::" msgstr "" -#: howto/enum.rst:516 +#: howto/enum.rst:533 msgid "" ">>> from test.test_enum import Fruit\n" ">>> from pickle import dumps, loads\n" @@ -793,49 +814,49 @@ msgid "" "True" msgstr "" -#: howto/enum.rst:521 +#: howto/enum.rst:538 msgid "" "The usual restrictions for pickling apply: picklable enums must be defined " "in the top level of a module, since unpickling requires them to be " "importable from that module." msgstr "" -#: howto/enum.rst:527 +#: howto/enum.rst:544 msgid "" "With pickle protocol version 4 it is possible to easily pickle enums nested " "in other classes." msgstr "" -#: howto/enum.rst:530 +#: howto/enum.rst:547 msgid "" "It is possible to modify how enum members are pickled/unpickled by defining :" "meth:`~object.__reduce_ex__` in the enumeration class. The default method " "is by-value, but enums with complicated values may want to use by-name::" msgstr "" -#: howto/enum.rst:534 +#: howto/enum.rst:551 msgid "" ">>> import enum\n" ">>> class MyEnum(enum.Enum):\n" "... __reduce_ex__ = enum.pickle_by_enum_name" msgstr "" -#: howto/enum.rst:540 +#: howto/enum.rst:557 msgid "" "Using by-name for flags is not recommended, as unnamed aliases will not " "unpickle." msgstr "" -#: howto/enum.rst:545 +#: howto/enum.rst:562 msgid "Functional API" msgstr "" -#: howto/enum.rst:547 +#: howto/enum.rst:564 msgid "" "The :class:`Enum` class is callable, providing the following functional API::" msgstr "" -#: howto/enum.rst:549 +#: howto/enum.rst:566 msgid "" ">>> Animal = Enum('Animal', 'ANT BEE CAT DOG')\n" ">>> Animal\n" @@ -846,13 +867,13 @@ msgid "" "[, , , ]" msgstr "" -#: howto/enum.rst:557 +#: howto/enum.rst:574 msgid "" "The semantics of this API resemble :class:`~collections.namedtuple`. The " "first argument of the call to :class:`Enum` is the name of the enumeration." msgstr "" -#: howto/enum.rst:560 +#: howto/enum.rst:577 msgid "" "The second argument is the *source* of enumeration member names. It can be " "a whitespace-separated string of names, a sequence of names, a sequence of 2-" @@ -864,7 +885,7 @@ msgid "" "assignment to :class:`!Animal` is equivalent to::" msgstr "" -#: howto/enum.rst:569 +#: howto/enum.rst:586 msgid "" ">>> class Animal(Enum):\n" "... ANT = 1\n" @@ -874,14 +895,14 @@ msgid "" "..." msgstr "" -#: howto/enum.rst:576 +#: howto/enum.rst:593 msgid "" "The reason for defaulting to ``1`` as the starting number and not ``0`` is " "that ``0`` is ``False`` in a boolean sense, but by default enum members all " "evaluate to ``True``." msgstr "" -#: howto/enum.rst:580 +#: howto/enum.rst:597 msgid "" "Pickling enums created with the functional API can be tricky as frame stack " "implementation details are used to try and figure out which module the " @@ -890,18 +911,18 @@ msgid "" "Jython). The solution is to specify the module name explicitly as follows::" msgstr "" -#: howto/enum.rst:586 +#: howto/enum.rst:603 msgid ">>> Animal = Enum('Animal', 'ANT BEE CAT DOG', module=__name__)" msgstr "" -#: howto/enum.rst:590 +#: howto/enum.rst:607 msgid "" "If ``module`` is not supplied, and Enum cannot determine what it is, the new " "Enum members will not be unpicklable; to keep errors closer to the source, " "pickling will be disabled." msgstr "" -#: howto/enum.rst:594 +#: howto/enum.rst:611 msgid "" "The new pickle protocol 4 also, in some circumstances, relies on :attr:" "`~type.__qualname__` being set to the location where pickle will be able to " @@ -909,16 +930,16 @@ msgid "" "SomeData in the global scope::" msgstr "" -#: howto/enum.rst:599 +#: howto/enum.rst:616 msgid "" ">>> Animal = Enum('Animal', 'ANT BEE CAT DOG', qualname='SomeData.Animal')" msgstr "" -#: howto/enum.rst:601 +#: howto/enum.rst:618 msgid "The complete signature is::" msgstr "" -#: howto/enum.rst:603 +#: howto/enum.rst:620 msgid "" "Enum(\n" " value='NewEnumName',\n" @@ -931,73 +952,73 @@ msgid "" " )" msgstr "" -#: howto/enum.rst:613 +#: howto/enum.rst:630 msgid "*value*: What the new enum class will record as its name." msgstr "" -#: howto/enum.rst:615 +#: howto/enum.rst:632 msgid "" "*names*: The enum members. This can be a whitespace- or comma-separated " "string (values will start at 1 unless otherwise specified)::" msgstr "" -#: howto/enum.rst:618 +#: howto/enum.rst:635 msgid "'RED GREEN BLUE' | 'RED,GREEN,BLUE' | 'RED, GREEN, BLUE'" msgstr "" -#: howto/enum.rst:620 +#: howto/enum.rst:637 msgid "or an iterator of names::" msgstr "" -#: howto/enum.rst:622 +#: howto/enum.rst:639 msgid "['RED', 'GREEN', 'BLUE']" msgstr "" -#: howto/enum.rst:624 +#: howto/enum.rst:641 msgid "or an iterator of (name, value) pairs::" msgstr "" -#: howto/enum.rst:626 +#: howto/enum.rst:643 msgid "[('CYAN', 4), ('MAGENTA', 5), ('YELLOW', 6)]" msgstr "" -#: howto/enum.rst:628 +#: howto/enum.rst:645 msgid "or a mapping::" msgstr "" -#: howto/enum.rst:630 +#: howto/enum.rst:647 msgid "{'CHARTREUSE': 7, 'SEA_GREEN': 11, 'ROSEMARY': 42}" msgstr "" -#: howto/enum.rst:632 +#: howto/enum.rst:649 msgid "*module*: name of module where new enum class can be found." msgstr "" -#: howto/enum.rst:634 +#: howto/enum.rst:651 msgid "*qualname*: where in module new enum class can be found." msgstr "" -#: howto/enum.rst:636 +#: howto/enum.rst:653 msgid "*type*: type to mix in to new enum class." msgstr "" -#: howto/enum.rst:638 +#: howto/enum.rst:655 msgid "*start*: number to start counting at if only names are passed in." msgstr "" -#: howto/enum.rst:640 +#: howto/enum.rst:657 msgid "The *start* parameter was added." msgstr "" -#: howto/enum.rst:645 +#: howto/enum.rst:662 msgid "Derived Enumerations" msgstr "" -#: howto/enum.rst:648 +#: howto/enum.rst:665 msgid "IntEnum" msgstr "" -#: howto/enum.rst:650 +#: howto/enum.rst:667 msgid "" "The first variation of :class:`Enum` that is provided is also a subclass of :" "class:`int`. Members of an :class:`IntEnum` can be compared to integers; by " @@ -1005,7 +1026,7 @@ msgid "" "each other::" msgstr "" -#: howto/enum.rst:655 +#: howto/enum.rst:672 msgid "" ">>> from enum import IntEnum\n" ">>> class Shape(IntEnum):\n" @@ -1024,13 +1045,13 @@ msgid "" "True" msgstr "" -#: howto/enum.rst:671 +#: howto/enum.rst:688 msgid "" "However, they still can't be compared to standard :class:`Enum` " "enumerations::" msgstr "" -#: howto/enum.rst:673 +#: howto/enum.rst:690 msgid "" ">>> class Shape(IntEnum):\n" "... CIRCLE = 1\n" @@ -1044,12 +1065,12 @@ msgid "" "False" msgstr "" -#: howto/enum.rst:684 +#: howto/enum.rst:701 msgid "" ":class:`IntEnum` values behave like integers in other ways you'd expect::" msgstr "" -#: howto/enum.rst:686 +#: howto/enum.rst:703 msgid "" ">>> int(Shape.CIRCLE)\n" "1\n" @@ -1059,11 +1080,11 @@ msgid "" "[0, 1]" msgstr "" -#: howto/enum.rst:695 +#: howto/enum.rst:712 msgid "StrEnum" msgstr "" -#: howto/enum.rst:697 +#: howto/enum.rst:714 msgid "" "The second variation of :class:`Enum` that is provided is also a subclass " "of :class:`str`. Members of a :class:`StrEnum` can be compared to strings; " @@ -1071,11 +1092,11 @@ msgid "" "each other." msgstr "" -#: howto/enum.rst:706 +#: howto/enum.rst:723 msgid "IntFlag" msgstr "" -#: howto/enum.rst:708 +#: howto/enum.rst:725 msgid "" "The next variation of :class:`Enum` provided, :class:`IntFlag`, is also " "based on :class:`int`. The difference being :class:`IntFlag` members can be " @@ -1085,23 +1106,23 @@ msgid "" "is used." msgstr "" -#: howto/enum.rst:716 +#: howto/enum.rst:733 msgid "" "Any operation on an :class:`IntFlag` member besides the bit-wise operations " "will lose the :class:`IntFlag` membership." msgstr "" -#: howto/enum.rst:719 +#: howto/enum.rst:736 msgid "" "Bit-wise operations that result in invalid :class:`IntFlag` values will lose " "the :class:`IntFlag` membership. See :class:`FlagBoundary` for details." msgstr "" -#: howto/enum.rst:726 +#: howto/enum.rst:743 msgid "Sample :class:`IntFlag` class::" msgstr "" -#: howto/enum.rst:728 +#: howto/enum.rst:745 msgid "" ">>> from enum import IntFlag\n" ">>> class Perm(IntFlag):\n" @@ -1118,11 +1139,11 @@ msgid "" "True" msgstr "" -#: howto/enum.rst:742 +#: howto/enum.rst:759 msgid "It is also possible to name the combinations::" msgstr "" -#: howto/enum.rst:744 +#: howto/enum.rst:761 msgid "" ">>> class Perm(IntFlag):\n" "... R = 4\n" @@ -1138,20 +1159,20 @@ msgid "" "" msgstr "" -#: howto/enum.rst:759 +#: howto/enum.rst:776 msgid "" "Named combinations are considered aliases. Aliases do not show up during " "iteration, but can be returned from by-value lookups." msgstr "" -#: howto/enum.rst:764 +#: howto/enum.rst:781 msgid "" "Another important difference between :class:`IntFlag` and :class:`Enum` is " "that if no flags are set (the value is 0), its boolean evaluation is :data:" "`False`::" msgstr "" -#: howto/enum.rst:767 +#: howto/enum.rst:784 msgid "" ">>> Perm.R & Perm.X\n" "\n" @@ -1159,13 +1180,13 @@ msgid "" "False" msgstr "" -#: howto/enum.rst:772 +#: howto/enum.rst:789 msgid "" "Because :class:`IntFlag` members are also subclasses of :class:`int` they " "can be combined with them (but may lose :class:`IntFlag` membership::" msgstr "" -#: howto/enum.rst:775 +#: howto/enum.rst:792 msgid "" ">>> Perm.X | 4\n" "\n" @@ -1174,33 +1195,33 @@ msgid "" "9" msgstr "" -#: howto/enum.rst:783 +#: howto/enum.rst:800 msgid "" "The negation operator, ``~``, always returns an :class:`IntFlag` member with " "a positive value::" msgstr "" -#: howto/enum.rst:786 +#: howto/enum.rst:803 msgid "" ">>> (~Perm.X).value == (Perm.R|Perm.W).value == 6\n" "True" msgstr "" -#: howto/enum.rst:789 +#: howto/enum.rst:806 msgid ":class:`IntFlag` members can also be iterated over::" msgstr "" -#: howto/enum.rst:791 +#: howto/enum.rst:808 msgid "" ">>> list(RW)\n" "[, ]" msgstr "" -#: howto/enum.rst:798 +#: howto/enum.rst:815 msgid "Flag" msgstr "" -#: howto/enum.rst:800 +#: howto/enum.rst:817 msgid "" "The last variation is :class:`Flag`. Like :class:`IntFlag`, :class:`Flag` " "members can be combined using the bitwise operators (&, \\|, ^, ~). Unlike :" @@ -1210,13 +1231,13 @@ msgid "" "value and let :class:`Flag` select an appropriate value." msgstr "" -#: howto/enum.rst:809 +#: howto/enum.rst:826 msgid "" "Like :class:`IntFlag`, if a combination of :class:`Flag` members results in " "no flags being set, the boolean evaluation is :data:`False`::" msgstr "" -#: howto/enum.rst:812 +#: howto/enum.rst:829 msgid "" ">>> from enum import Flag, auto\n" ">>> class Color(Flag):\n" @@ -1230,13 +1251,13 @@ msgid "" "False" msgstr "" -#: howto/enum.rst:823 +#: howto/enum.rst:840 msgid "" "Individual flags should have values that are powers of two (1, 2, 4, " "8, ...), while combinations of flags will not::" msgstr "" -#: howto/enum.rst:826 +#: howto/enum.rst:843 msgid "" ">>> class Color(Flag):\n" "... RED = auto()\n" @@ -1248,13 +1269,13 @@ msgid "" "" msgstr "" -#: howto/enum.rst:835 +#: howto/enum.rst:852 msgid "" "Giving a name to the \"no flags set\" condition does not change its boolean " "value::" msgstr "" -#: howto/enum.rst:838 +#: howto/enum.rst:855 msgid "" ">>> class Color(Flag):\n" "... BLACK = 0\n" @@ -1268,18 +1289,18 @@ msgid "" "False" msgstr "" -#: howto/enum.rst:849 +#: howto/enum.rst:866 msgid ":class:`Flag` members can also be iterated over::" msgstr "" -#: howto/enum.rst:851 +#: howto/enum.rst:868 msgid "" ">>> purple = Color.RED | Color.BLUE\n" ">>> list(purple)\n" "[, ]" msgstr "" -#: howto/enum.rst:859 +#: howto/enum.rst:876 msgid "" "For the majority of new code, :class:`Enum` and :class:`Flag` are strongly " "recommended, since :class:`IntEnum` and :class:`IntFlag` break some semantic " @@ -1290,48 +1311,48 @@ msgid "" "enumerations, or for interoperability with other systems." msgstr "" -#: howto/enum.rst:869 +#: howto/enum.rst:886 msgid "Others" msgstr "" -#: howto/enum.rst:871 +#: howto/enum.rst:888 msgid "" "While :class:`IntEnum` is part of the :mod:`enum` module, it would be very " "simple to implement independently::" msgstr "" -#: howto/enum.rst:874 +#: howto/enum.rst:891 msgid "" -"class IntEnum(int, Enum):\n" +"class IntEnum(int, ReprEnum): # or Enum instead of ReprEnum\n" " pass" msgstr "" -#: howto/enum.rst:877 +#: howto/enum.rst:894 msgid "" "This demonstrates how similar derived enumerations can be defined; for " "example a :class:`!FloatEnum` that mixes in :class:`float` instead of :class:" "`int`." msgstr "" -#: howto/enum.rst:880 +#: howto/enum.rst:897 msgid "Some rules:" msgstr "" -#: howto/enum.rst:882 +#: howto/enum.rst:899 msgid "" -"When subclassing :class:`Enum`, mix-in types must appear before :class:" -"`Enum` itself in the sequence of bases, as in the :class:`IntEnum` example " -"above." +"When subclassing :class:`Enum`, mix-in types must appear before the :class:" +"`Enum` class itself in the sequence of bases, as in the :class:`IntEnum` " +"example above." msgstr "" -#: howto/enum.rst:885 +#: howto/enum.rst:902 msgid "" "Mix-in types must be subclassable. For example, :class:`bool` and :class:" "`range` are not subclassable and will throw an error during Enum creation if " "used as the mix-in type." msgstr "" -#: howto/enum.rst:888 +#: howto/enum.rst:905 msgid "" "While :class:`Enum` can have members of any type, once you mix in an " "additional type, all the members must have values of that type, e.g. :class:" @@ -1339,20 +1360,20 @@ msgid "" "methods and don't specify another type." msgstr "" -#: howto/enum.rst:892 +#: howto/enum.rst:909 msgid "" "When another data type is mixed in, the :attr:`~Enum.value` attribute is " "*not the same* as the enum member itself, although it is equivalent and will " "compare equal." msgstr "" -#: howto/enum.rst:895 +#: howto/enum.rst:912 msgid "" "A ``data type`` is a mixin that defines :meth:`~object.__new__`, or a :class:" "`~dataclasses.dataclass`" msgstr "" -#: howto/enum.rst:897 +#: howto/enum.rst:914 msgid "" "%-style formatting: ``%s`` and ``%r`` call the :class:`Enum` class's :meth:" "`~object.__str__` and :meth:`~object.__repr__` respectively; other codes " @@ -1360,13 +1381,13 @@ msgid "" "type." msgstr "" -#: howto/enum.rst:900 +#: howto/enum.rst:917 msgid "" ":ref:`Formatted string literals `, :meth:`str.format`, and :func:" "`format` will use the enum's :meth:`~object.__str__` method." msgstr "" -#: howto/enum.rst:905 +#: howto/enum.rst:922 msgid "" "Because :class:`IntEnum`, :class:`IntFlag`, and :class:`StrEnum` are " "designed to be drop-in replacements for existing constants, their :meth:" @@ -1374,11 +1395,11 @@ msgid "" "__str__` method." msgstr "" -#: howto/enum.rst:913 +#: howto/enum.rst:930 msgid "When to use :meth:`~object.__new__` vs. :meth:`~object.__init__`" msgstr "" -#: howto/enum.rst:915 +#: howto/enum.rst:932 msgid "" ":meth:`~object.__new__` must be used whenever you want to customize the " "actual value of the :class:`Enum` member. Any other modifications may go in " @@ -1386,13 +1407,13 @@ msgid "" "`~object.__init__` being preferred." msgstr "" -#: howto/enum.rst:919 +#: howto/enum.rst:936 msgid "" "For example, if you want to pass several items to the constructor, but only " "want one of them to be the value::" msgstr "" -#: howto/enum.rst:922 +#: howto/enum.rst:939 msgid "" ">>> class Coordinate(bytes, Enum):\n" "... \"\"\"\n" @@ -1417,27 +1438,27 @@ msgid "" "Coordinate.VY" msgstr "" -#: howto/enum.rst:946 +#: howto/enum.rst:963 msgid "" "*Do not* call ``super().__new__()``, as the lookup-only ``__new__`` is the " "one that is found; instead, use the data type directly." msgstr "" -#: howto/enum.rst:951 +#: howto/enum.rst:968 msgid "Finer Points" msgstr "" -#: howto/enum.rst:954 +#: howto/enum.rst:971 msgid "Supported ``__dunder__`` names" msgstr "" -#: howto/enum.rst:956 +#: howto/enum.rst:973 msgid "" ":attr:`~enum.EnumType.__members__` is a read-only ordered mapping of " "``member_name``:``member`` items. It is only available on the class." msgstr "" -#: howto/enum.rst:959 +#: howto/enum.rst:976 msgid "" ":meth:`~object.__new__`, if specified, must create and return the enum " "members; it is also a very good idea to set the member's :attr:`~Enum." @@ -1445,74 +1466,86 @@ msgid "" "used." msgstr "" -#: howto/enum.rst:965 +#: howto/enum.rst:982 msgid "Supported ``_sunder_`` names" msgstr "" -#: howto/enum.rst:967 +#: howto/enum.rst:984 msgid ":attr:`~Enum._name_` -- name of the member" msgstr "" -#: howto/enum.rst:968 -msgid "" -":attr:`~Enum._value_` -- value of the member; can be set / modified in " -"``__new__``" +#: howto/enum.rst:985 +msgid ":attr:`~Enum._value_` -- value of the member; can be set in ``__new__``" msgstr "" -#: howto/enum.rst:970 +#: howto/enum.rst:986 msgid "" ":meth:`~Enum._missing_` -- a lookup function used when a value is not found; " "may be overridden" msgstr "" -#: howto/enum.rst:972 +#: howto/enum.rst:988 msgid "" ":attr:`~Enum._ignore_` -- a list of names, either as a :class:`list` or a :" "class:`str`, that will not be transformed into members, and will be removed " "from the final class" msgstr "" -#: howto/enum.rst:975 +#: howto/enum.rst:991 msgid "" -":attr:`~Enum._order_` -- used in Python 2/3 code to ensure member order is " -"consistent (class attribute, removed during class creation)" +":meth:`~Enum._generate_next_value_` -- used to get an appropriate value for " +"an enum member; may be overridden" msgstr "" -#: howto/enum.rst:977 +#: howto/enum.rst:993 msgid "" -":meth:`~Enum._generate_next_value_` -- used by the `Functional API`_ and by :" -"class:`auto` to get an appropriate value for an enum member; may be " -"overridden" +":meth:`~EnumType._add_alias_` -- adds a new name as an alias to an existing " +"member." msgstr "" -#: howto/enum.rst:983 +#: howto/enum.rst:995 msgid "" -"For standard :class:`Enum` classes the next value chosen is the last value " -"seen incremented by one." +":meth:`~EnumType._add_value_alias_` -- adds a new value as an alias to an " +"existing member. See `MultiValueEnum`_ for an example." msgstr "" -#: howto/enum.rst:986 +#: howto/enum.rst:1000 +msgid "" +"For standard :class:`Enum` classes the next value chosen is the highest " +"value seen incremented by one." +msgstr "" + +#: howto/enum.rst:1003 msgid "" "For :class:`Flag` classes the next value chosen will be the next highest " -"power-of-two, regardless of the last value seen." +"power-of-two." msgstr "" -#: howto/enum.rst:989 +#: howto/enum.rst:1006 +msgid "" +"Prior versions would use the last seen value instead of the highest value." +msgstr "" + +#: howto/enum.rst:1009 msgid "``_missing_``, ``_order_``, ``_generate_next_value_``" msgstr "" -#: howto/enum.rst:990 +#: howto/enum.rst:1010 msgid "``_ignore_``" msgstr "" -#: howto/enum.rst:992 +#: howto/enum.rst:1011 +msgid "``_add_alias_``, ``_add_value_alias_``" +msgstr "" + +#: howto/enum.rst:1013 msgid "" "To help keep Python 2 / Python 3 code in sync an :attr:`~Enum._order_` " "attribute can be provided. It will be checked against the actual order of " "the enumeration and raise an error if the two do not match::" msgstr "" -#: howto/enum.rst:996 +#: howto/enum.rst:1017 msgid "" ">>> class Color(Enum):\n" "... _order_ = 'RED GREEN BLUE'\n" @@ -1527,27 +1560,27 @@ msgid "" " ['RED', 'GREEN', 'BLUE']" msgstr "" -#: howto/enum.rst:1010 +#: howto/enum.rst:1031 msgid "" "In Python 2 code the :attr:`~Enum._order_` attribute is necessary as " "definition order is lost before it can be recorded." msgstr "" -#: howto/enum.rst:1015 +#: howto/enum.rst:1036 msgid "_Private__names" msgstr "" -#: howto/enum.rst:1017 +#: howto/enum.rst:1038 msgid "" ":ref:`Private names ` are not converted to enum " "members, but remain normal attributes." msgstr "" -#: howto/enum.rst:1024 +#: howto/enum.rst:1045 msgid "``Enum`` member type" msgstr "" -#: howto/enum.rst:1026 +#: howto/enum.rst:1047 msgid "" "Enum members are instances of their enum class, and are normally accessed as " "``EnumClass.member``. In certain situations, such as writing custom enum " @@ -1557,18 +1590,18 @@ msgid "" "strongly recommended." msgstr "" -#: howto/enum.rst:1037 +#: howto/enum.rst:1058 msgid "Creating members that are mixed with other data types" msgstr "" -#: howto/enum.rst:1039 +#: howto/enum.rst:1060 msgid "" "When subclassing other data types, such as :class:`int` or :class:`str`, " "with an :class:`Enum`, all values after the ``=`` are passed to that data " "type's constructor. For example::" msgstr "" -#: howto/enum.rst:1043 +#: howto/enum.rst:1064 msgid "" ">>> class MyEnum(IntEnum): # help(int) -> int(x, base=10) -> integer\n" "... example = '11', 16 # so x='11' and base=16\n" @@ -1577,11 +1610,11 @@ msgid "" "17" msgstr "" -#: howto/enum.rst:1051 +#: howto/enum.rst:1072 msgid "Boolean value of ``Enum`` classes and members" msgstr "" -#: howto/enum.rst:1053 +#: howto/enum.rst:1074 msgid "" "Enum classes that are mixed with non-:class:`Enum` types (such as :class:" "`int`, :class:`str`, etc.) are evaluated according to the mixed-in type's " @@ -1590,28 +1623,28 @@ msgid "" "your class::" msgstr "" -#: howto/enum.rst:1059 +#: howto/enum.rst:1080 msgid "" "def __bool__(self):\n" " return bool(self.value)" msgstr "" -#: howto/enum.rst:1062 +#: howto/enum.rst:1083 msgid "Plain :class:`Enum` classes always evaluate as :data:`True`." msgstr "" -#: howto/enum.rst:1066 +#: howto/enum.rst:1087 msgid "``Enum`` classes with methods" msgstr "" -#: howto/enum.rst:1068 +#: howto/enum.rst:1089 msgid "" "If you give your enum subclass extra methods, like the `Planet`_ class " "below, those methods will show up in a :func:`dir` of the member, but not of " "the class::" msgstr "" -#: howto/enum.rst:1072 +#: howto/enum.rst:1093 msgid "" ">>> dir(Planet)\n" "['EARTH', 'JUPITER', 'MARS', 'MERCURY', 'NEPTUNE', 'SATURN', 'URANUS', " @@ -1621,17 +1654,17 @@ msgid "" "'surface_gravity', 'value']" msgstr "" -#: howto/enum.rst:1079 +#: howto/enum.rst:1100 msgid "Combining members of ``Flag``" msgstr "" -#: howto/enum.rst:1081 +#: howto/enum.rst:1102 msgid "" "Iterating over a combination of :class:`Flag` members will only return the " "members that are comprised of a single bit::" msgstr "" -#: howto/enum.rst:1084 +#: howto/enum.rst:1105 msgid "" ">>> class Color(Flag):\n" "... RED = auto()\n" @@ -1647,15 +1680,15 @@ msgid "" "" msgstr "" -#: howto/enum.rst:1099 +#: howto/enum.rst:1120 msgid "``Flag`` and ``IntFlag`` minutia" msgstr "" -#: howto/enum.rst:1101 +#: howto/enum.rst:1122 msgid "Using the following snippet for our examples::" msgstr "" -#: howto/enum.rst:1103 +#: howto/enum.rst:1124 msgid "" ">>> class Color(IntFlag):\n" "... BLACK = 0\n" @@ -1667,35 +1700,35 @@ msgid "" "..." msgstr "" -#: howto/enum.rst:1112 +#: howto/enum.rst:1133 msgid "the following are true:" msgstr "" -#: howto/enum.rst:1114 +#: howto/enum.rst:1135 msgid "single-bit flags are canonical" msgstr "" -#: howto/enum.rst:1115 +#: howto/enum.rst:1136 msgid "multi-bit and zero-bit flags are aliases" msgstr "" -#: howto/enum.rst:1116 +#: howto/enum.rst:1137 msgid "only canonical flags are returned during iteration::" msgstr "" -#: howto/enum.rst:1118 +#: howto/enum.rst:1139 msgid "" ">>> list(Color.WHITE)\n" "[, , ]" msgstr "" -#: howto/enum.rst:1121 +#: howto/enum.rst:1142 msgid "" "negating a flag or flag set returns a new flag/flag set with the " "corresponding positive integer value::" msgstr "" -#: howto/enum.rst:1124 +#: howto/enum.rst:1145 msgid "" ">>> Color.BLUE\n" "\n" @@ -1704,11 +1737,11 @@ msgid "" "" msgstr "" -#: howto/enum.rst:1130 +#: howto/enum.rst:1151 msgid "names of pseudo-flags are constructed from their members' names::" msgstr "" -#: howto/enum.rst:1132 +#: howto/enum.rst:1153 msgid "" ">>> (Color.RED | Color.GREEN).name\n" "'RED|GREEN'\n" @@ -1722,11 +1755,11 @@ msgid "" "True" msgstr "" -#: howto/enum.rst:1143 +#: howto/enum.rst:1164 msgid "multi-bit flags, aka aliases, can be returned from operations::" msgstr "" -#: howto/enum.rst:1145 +#: howto/enum.rst:1166 msgid "" ">>> Color.RED | Color.BLUE\n" "\n" @@ -1738,25 +1771,25 @@ msgid "" "" msgstr "" -#: howto/enum.rst:1154 +#: howto/enum.rst:1175 msgid "" "membership / containment checking: zero-valued flags are always considered " "to be contained::" msgstr "" -#: howto/enum.rst:1157 +#: howto/enum.rst:1178 msgid "" ">>> Color.BLACK in Color.WHITE\n" "True" msgstr "" -#: howto/enum.rst:1160 +#: howto/enum.rst:1181 msgid "" "otherwise, only if all bits of one flag are in the other flag will True be " "returned::" msgstr "" -#: howto/enum.rst:1163 +#: howto/enum.rst:1184 msgid "" ">>> Color.PURPLE in Color.WHITE\n" "True\n" @@ -1765,62 +1798,62 @@ msgid "" "False" msgstr "" -#: howto/enum.rst:1169 +#: howto/enum.rst:1190 msgid "" "There is a new boundary mechanism that controls how out-of-range / invalid " "bits are handled: ``STRICT``, ``CONFORM``, ``EJECT``, and ``KEEP``:" msgstr "" -#: howto/enum.rst:1172 +#: howto/enum.rst:1193 msgid "STRICT --> raises an exception when presented with invalid values" msgstr "" -#: howto/enum.rst:1173 +#: howto/enum.rst:1194 msgid "CONFORM --> discards any invalid bits" msgstr "" -#: howto/enum.rst:1174 +#: howto/enum.rst:1195 msgid "EJECT --> lose Flag status and become a normal int with the given value" msgstr "" -#: howto/enum.rst:1175 +#: howto/enum.rst:1196 msgid "KEEP --> keep the extra bits" msgstr "" -#: howto/enum.rst:1177 +#: howto/enum.rst:1198 msgid "keeps Flag status and extra bits" msgstr "" -#: howto/enum.rst:1178 +#: howto/enum.rst:1199 msgid "extra bits do not show up in iteration" msgstr "" -#: howto/enum.rst:1179 +#: howto/enum.rst:1200 msgid "extra bits do show up in repr() and str()" msgstr "" -#: howto/enum.rst:1181 +#: howto/enum.rst:1202 msgid "" "The default for Flag is ``STRICT``, the default for ``IntFlag`` is " "``EJECT``, and the default for ``_convert_`` is ``KEEP`` (see ``ssl." "Options`` for an example of when ``KEEP`` is needed)." msgstr "" -#: howto/enum.rst:1189 +#: howto/enum.rst:1210 msgid "How are Enums and Flags different?" msgstr "" -#: howto/enum.rst:1191 +#: howto/enum.rst:1212 msgid "" "Enums have a custom metaclass that affects many aspects of both derived :" "class:`Enum` classes and their instances (members)." msgstr "" -#: howto/enum.rst:1196 +#: howto/enum.rst:1217 msgid "Enum Classes" msgstr "" -#: howto/enum.rst:1198 +#: howto/enum.rst:1219 msgid "" "The :class:`EnumType` metaclass is responsible for providing the :meth:" "`~object.__contains__`, :meth:`~object.__dir__`, :meth:`~object.__iter__` " @@ -1832,11 +1865,11 @@ msgid "" "`~object.__repr__`)." msgstr "" -#: howto/enum.rst:1207 +#: howto/enum.rst:1228 msgid "Flag Classes" msgstr "" -#: howto/enum.rst:1209 +#: howto/enum.rst:1230 msgid "" "Flags have an expanded view of aliasing: to be canonical, the value of a " "flag needs to be a power-of-two value, and not a duplicate name. So, in " @@ -1845,11 +1878,11 @@ msgid "" "considered an alias." msgstr "" -#: howto/enum.rst:1215 +#: howto/enum.rst:1236 msgid "Enum Members (aka instances)" msgstr "" -#: howto/enum.rst:1217 +#: howto/enum.rst:1238 msgid "" "The most interesting thing about enum members is that they are singletons. :" "class:`EnumType` creates them all while it is creating the enum class " @@ -1858,55 +1891,55 @@ msgid "" "instances." msgstr "" -#: howto/enum.rst:1223 +#: howto/enum.rst:1244 msgid "Flag Members" msgstr "" -#: howto/enum.rst:1225 +#: howto/enum.rst:1246 msgid "" "Flag members can be iterated over just like the :class:`Flag` class, and " "only the canonical members will be returned. For example::" msgstr "" -#: howto/enum.rst:1228 +#: howto/enum.rst:1249 msgid "" ">>> list(Color)\n" "[, , ]" msgstr "" -#: howto/enum.rst:1231 +#: howto/enum.rst:1252 msgid "(Note that ``BLACK``, ``PURPLE``, and ``WHITE`` do not show up.)" msgstr "" -#: howto/enum.rst:1233 +#: howto/enum.rst:1254 msgid "" "Inverting a flag member returns the corresponding positive value, rather " "than a negative value --- for example::" msgstr "" -#: howto/enum.rst:1236 +#: howto/enum.rst:1257 msgid "" ">>> ~Color.RED\n" "" msgstr "" -#: howto/enum.rst:1239 +#: howto/enum.rst:1260 msgid "" "Flag members have a length corresponding to the number of power-of-two " "values they contain. For example::" msgstr "" -#: howto/enum.rst:1242 +#: howto/enum.rst:1263 msgid "" ">>> len(Color.PURPLE)\n" "2" msgstr "" -#: howto/enum.rst:1249 +#: howto/enum.rst:1270 msgid "Enum Cookbook" msgstr "" -#: howto/enum.rst:1252 +#: howto/enum.rst:1273 msgid "" "While :class:`Enum`, :class:`IntEnum`, :class:`StrEnum`, :class:`Flag`, and :" "class:`IntFlag` are expected to cover the majority of use-cases, they cannot " @@ -1914,50 +1947,50 @@ msgid "" "that can be used directly, or as examples for creating one's own." msgstr "" -#: howto/enum.rst:1259 +#: howto/enum.rst:1280 msgid "Omitting values" msgstr "" -#: howto/enum.rst:1261 +#: howto/enum.rst:1282 msgid "" "In many use-cases, one doesn't care what the actual value of an enumeration " "is. There are several ways to define this type of simple enumeration:" msgstr "" -#: howto/enum.rst:1264 +#: howto/enum.rst:1285 msgid "use instances of :class:`auto` for the value" msgstr "" -#: howto/enum.rst:1265 +#: howto/enum.rst:1286 msgid "use instances of :class:`object` as the value" msgstr "" -#: howto/enum.rst:1266 +#: howto/enum.rst:1287 msgid "use a descriptive string as the value" msgstr "" -#: howto/enum.rst:1267 +#: howto/enum.rst:1288 msgid "" "use a tuple as the value and a custom :meth:`~object.__new__` to replace the " "tuple with an :class:`int` value" msgstr "" -#: howto/enum.rst:1270 +#: howto/enum.rst:1291 msgid "" "Using any of these methods signifies to the user that these values are not " "important, and also enables one to add, remove, or reorder members without " "having to renumber the remaining members." msgstr "" -#: howto/enum.rst:1276 +#: howto/enum.rst:1297 msgid "Using :class:`auto`" msgstr "" -#: howto/enum.rst:1278 +#: howto/enum.rst:1299 msgid "Using :class:`auto` would look like::" msgstr "" -#: howto/enum.rst:1280 +#: howto/enum.rst:1301 msgid "" ">>> class Color(Enum):\n" "... RED = auto()\n" @@ -1968,15 +2001,15 @@ msgid "" "" msgstr "" -#: howto/enum.rst:1290 +#: howto/enum.rst:1311 msgid "Using :class:`object`" msgstr "" -#: howto/enum.rst:1292 +#: howto/enum.rst:1313 msgid "Using :class:`object` would look like::" msgstr "" -#: howto/enum.rst:1294 +#: howto/enum.rst:1315 msgid "" ">>> class Color(Enum):\n" "... RED = object()\n" @@ -1987,13 +2020,13 @@ msgid "" ">" msgstr "" -#: howto/enum.rst:1302 +#: howto/enum.rst:1323 msgid "" "This is also a good example of why you might want to write your own :meth:" "`~object.__repr__`::" msgstr "" -#: howto/enum.rst:1305 +#: howto/enum.rst:1326 msgid "" ">>> class Color(Enum):\n" "... RED = object()\n" @@ -2006,15 +2039,15 @@ msgid "" "" msgstr "" -#: howto/enum.rst:1318 +#: howto/enum.rst:1339 msgid "Using a descriptive string" msgstr "" -#: howto/enum.rst:1320 +#: howto/enum.rst:1341 msgid "Using a string as the value would look like::" msgstr "" -#: howto/enum.rst:1322 +#: howto/enum.rst:1343 msgid "" ">>> class Color(Enum):\n" "... RED = 'stop'\n" @@ -2025,15 +2058,15 @@ msgid "" "" msgstr "" -#: howto/enum.rst:1332 +#: howto/enum.rst:1353 msgid "Using a custom :meth:`~object.__new__`" msgstr "" -#: howto/enum.rst:1334 +#: howto/enum.rst:1355 msgid "Using an auto-numbering :meth:`~object.__new__` would look like::" msgstr "" -#: howto/enum.rst:1336 +#: howto/enum.rst:1357 msgid "" ">>> class AutoNumber(Enum):\n" "... def __new__(cls):\n" @@ -2051,13 +2084,13 @@ msgid "" "" msgstr "" -#: howto/enum.rst:1351 +#: howto/enum.rst:1372 msgid "" "To make a more general purpose ``AutoNumber``, add ``*args`` to the " "signature::" msgstr "" -#: howto/enum.rst:1353 +#: howto/enum.rst:1374 msgid "" ">>> class AutoNumber(Enum):\n" "... def __new__(cls, *args): # this is the only change from above\n" @@ -2068,13 +2101,13 @@ msgid "" "..." msgstr "" -#: howto/enum.rst:1361 +#: howto/enum.rst:1382 msgid "" "Then when you inherit from ``AutoNumber`` you can write your own " "``__init__`` to handle any extra arguments::" msgstr "" -#: howto/enum.rst:1364 +#: howto/enum.rst:1385 msgid "" ">>> class Swatch(AutoNumber):\n" "... def __init__(self, pantone='unknown'):\n" @@ -2091,35 +2124,35 @@ msgid "" "'unknown'" msgstr "" -#: howto/enum.rst:1380 +#: howto/enum.rst:1401 msgid "" "The :meth:`~object.__new__` method, if defined, is used during creation of " "the Enum members; it is then replaced by Enum's :meth:`~object.__new__` " "which is used after class creation for lookup of existing members." msgstr "" -#: howto/enum.rst:1386 +#: howto/enum.rst:1407 msgid "" "*Do not* call ``super().__new__()``, as the lookup-only ``__new__`` is the " "one that is found; instead, use the data type directly -- e.g.::" msgstr "" -#: howto/enum.rst:1389 +#: howto/enum.rst:1410 msgid "obj = int.__new__(cls, value)" msgstr "" -#: howto/enum.rst:1393 +#: howto/enum.rst:1414 msgid "OrderedEnum" msgstr "" -#: howto/enum.rst:1395 +#: howto/enum.rst:1416 msgid "" "An ordered enumeration that is not based on :class:`IntEnum` and so " "maintains the normal :class:`Enum` invariants (such as not being comparable " "to other enumerations)::" msgstr "" -#: howto/enum.rst:1399 +#: howto/enum.rst:1420 msgid "" ">>> class OrderedEnum(Enum):\n" "... def __ge__(self, other):\n" @@ -2150,17 +2183,17 @@ msgid "" "True" msgstr "" -#: howto/enum.rst:1429 +#: howto/enum.rst:1450 msgid "DuplicateFreeEnum" msgstr "" -#: howto/enum.rst:1431 +#: howto/enum.rst:1452 msgid "" "Raises an error if a duplicate member value is found instead of creating an " "alias::" msgstr "" -#: howto/enum.rst:1434 +#: howto/enum.rst:1455 msgid "" ">>> class DuplicateFreeEnum(Enum):\n" "... def __init__(self, *args):\n" @@ -2184,24 +2217,52 @@ msgid "" "ValueError: aliases not allowed in DuplicateFreeEnum: 'GRENE' --> 'GREEN'" msgstr "" -#: howto/enum.rst:1456 +#: howto/enum.rst:1477 msgid "" "This is a useful example for subclassing Enum to add or change other " "behaviors as well as disallowing aliases. If the only desired change is " "disallowing aliases, the :func:`unique` decorator can be used instead." msgstr "" -#: howto/enum.rst:1462 +#: howto/enum.rst:1483 +msgid "MultiValueEnum" +msgstr "" + +#: howto/enum.rst:1485 +msgid "Supports having more than one value per member::" +msgstr "" + +#: howto/enum.rst:1487 +msgid "" +">>> class MultiValueEnum(Enum):\n" +"... def __new__(cls, value, *values):\n" +"... self = object.__new__(cls)\n" +"... self._value_ = value\n" +"... for v in values:\n" +"... self._add_value_alias_(v)\n" +"... return self\n" +"...\n" +">>> class DType(MultiValueEnum):\n" +"... float32 = 'f', 8\n" +"... double64 = 'd', 9\n" +"...\n" +">>> DType('f')\n" +"\n" +">>> DType(9)\n" +"" +msgstr "" + +#: howto/enum.rst:1506 msgid "Planet" msgstr "" -#: howto/enum.rst:1464 +#: howto/enum.rst:1508 msgid "" "If :meth:`~object.__new__` or :meth:`~object.__init__` is defined, the value " "of the enum member will be passed to those methods::" msgstr "" -#: howto/enum.rst:1467 +#: howto/enum.rst:1511 msgid "" ">>> class Planet(Enum):\n" "... MERCURY = (3.303e+23, 2.4397e6)\n" @@ -2227,15 +2288,15 @@ msgid "" "9.802652743337129" msgstr "" -#: howto/enum.rst:1493 +#: howto/enum.rst:1537 msgid "TimePeriod" msgstr "" -#: howto/enum.rst:1495 +#: howto/enum.rst:1539 msgid "An example to show the :attr:`~Enum._ignore_` attribute in use::" msgstr "" -#: howto/enum.rst:1497 +#: howto/enum.rst:1541 msgid "" ">>> from datetime import timedelta\n" ">>> class Period(timedelta, Enum):\n" @@ -2253,11 +2314,11 @@ msgid "" "timedelta(days=366)>]" msgstr "" -#: howto/enum.rst:1514 +#: howto/enum.rst:1558 msgid "Subclassing EnumType" msgstr "" -#: howto/enum.rst:1516 +#: howto/enum.rst:1560 msgid "" "While most enum needs can be met by customizing :class:`Enum` subclasses, " "either with class decorators or custom functions, :class:`EnumType` can be " diff --git a/howto/free-threading-extensions.po b/howto/free-threading-extensions.po new file mode 100644 index 00000000..acf4dd1a --- /dev/null +++ b/howto/free-threading-extensions.po @@ -0,0 +1,450 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) 2001-2025, Python Software Foundation +# This file is distributed under the same license as the Python package. +# FIRST AUTHOR , YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: Python 3.13\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#: howto/free-threading-extensions.rst:7 +msgid "C API Extension Support for Free Threading" +msgstr "" + +#: howto/free-threading-extensions.rst:9 +msgid "" +"Starting with the 3.13 release, CPython has experimental support for running " +"with the :term:`global interpreter lock` (GIL) disabled in a configuration " +"called :term:`free threading`. This document describes how to adapt C API " +"extensions to support free threading." +msgstr "" + +#: howto/free-threading-extensions.rst:16 +msgid "Identifying the Free-Threaded Build in C" +msgstr "" + +#: howto/free-threading-extensions.rst:18 +msgid "" +"The CPython C API exposes the ``Py_GIL_DISABLED`` macro: in the free-" +"threaded build it's defined to ``1``, and in the regular build it's not " +"defined. You can use it to enable code that only runs under the free-" +"threaded build::" +msgstr "" + +#: howto/free-threading-extensions.rst:22 +msgid "" +"#ifdef Py_GIL_DISABLED\n" +"/* code that only runs in the free-threaded build */\n" +"#endif" +msgstr "" + +#: howto/free-threading-extensions.rst:27 +msgid "Module Initialization" +msgstr "" + +#: howto/free-threading-extensions.rst:29 +msgid "" +"Extension modules need to explicitly indicate that they support running with " +"the GIL disabled; otherwise importing the extension will raise a warning and " +"enable the GIL at runtime." +msgstr "" + +#: howto/free-threading-extensions.rst:33 +msgid "" +"There are two ways to indicate that an extension module supports running " +"with the GIL disabled depending on whether the extension uses multi-phase or " +"single-phase initialization." +msgstr "" + +#: howto/free-threading-extensions.rst:38 +msgid "Multi-Phase Initialization" +msgstr "" + +#: howto/free-threading-extensions.rst:40 +msgid "" +"Extensions that use multi-phase initialization (i.e., :c:func:" +"`PyModuleDef_Init`) should add a :c:data:`Py_mod_gil` slot in the module " +"definition. If your extension supports older versions of CPython, you " +"should guard the slot with a :c:data:`PY_VERSION_HEX` check." +msgstr "" + +#: howto/free-threading-extensions.rst:47 +msgid "" +"static struct PyModuleDef_Slot module_slots[] = {\n" +" ...\n" +"#if PY_VERSION_HEX >= 0x030D0000\n" +" {Py_mod_gil, Py_MOD_GIL_NOT_USED},\n" +"#endif\n" +" {0, NULL}\n" +"};\n" +"\n" +"static struct PyModuleDef moduledef = {\n" +" PyModuleDef_HEAD_INIT,\n" +" .m_slots = module_slots,\n" +" ...\n" +"};" +msgstr "" + +#: howto/free-threading-extensions.rst:63 +msgid "Single-Phase Initialization" +msgstr "" + +#: howto/free-threading-extensions.rst:65 +msgid "" +"Extensions that use single-phase initialization (i.e., :c:func:" +"`PyModule_Create`) should call :c:func:`PyUnstable_Module_SetGIL` to " +"indicate that they support running with the GIL disabled. The function is " +"only defined in the free-threaded build, so you should guard the call with " +"``#ifdef Py_GIL_DISABLED`` to avoid compilation errors in the regular build." +msgstr "" + +#: howto/free-threading-extensions.rst:73 +msgid "" +"static struct PyModuleDef moduledef = {\n" +" PyModuleDef_HEAD_INIT,\n" +" ...\n" +"};\n" +"\n" +"PyMODINIT_FUNC\n" +"PyInit_mymodule(void)\n" +"{\n" +" PyObject *m = PyModule_Create(&moduledef);\n" +" if (m == NULL) {\n" +" return NULL;\n" +" }\n" +"#ifdef Py_GIL_DISABLED\n" +" PyUnstable_Module_SetGIL(m, Py_MOD_GIL_NOT_USED);\n" +"#endif\n" +" return m;\n" +"}" +msgstr "" + +#: howto/free-threading-extensions.rst:93 +msgid "General API Guidelines" +msgstr "" + +#: howto/free-threading-extensions.rst:95 +msgid "Most of the C API is thread-safe, but there are some exceptions." +msgstr "" + +#: howto/free-threading-extensions.rst:97 +msgid "" +"**Struct Fields**: Accessing fields in Python C API objects or structs " +"directly is not thread-safe if the field may be concurrently modified." +msgstr "" + +#: howto/free-threading-extensions.rst:99 +msgid "" +"**Macros**: Accessor macros like :c:macro:`PyList_GET_ITEM` and :c:macro:" +"`PyList_SET_ITEM` do not perform any error checking or locking. These macros " +"are not thread-safe if the container object may be modified concurrently." +msgstr "" + +#: howto/free-threading-extensions.rst:103 +msgid "" +"**Borrowed References**: C API functions that return :term:`borrowed " +"references ` may not be thread-safe if the containing " +"object is modified concurrently. See the section on :ref:`borrowed " +"references ` for more information." +msgstr "" + +#: howto/free-threading-extensions.rst:110 +msgid "Container Thread Safety" +msgstr "" + +#: howto/free-threading-extensions.rst:112 +msgid "" +"Containers like :c:struct:`PyListObject`, :c:struct:`PyDictObject`, and :c:" +"struct:`PySetObject` perform internal locking in the free-threaded build. " +"For example, the :c:func:`PyList_Append` will lock the list before appending " +"an item." +msgstr "" + +#: howto/free-threading-extensions.rst:120 +msgid "``PyDict_Next``" +msgstr "" + +#: howto/free-threading-extensions.rst:122 +msgid "" +"A notable exception is :c:func:`PyDict_Next`, which does not lock the " +"dictionary. You should use :c:macro:`Py_BEGIN_CRITICAL_SECTION` to protect " +"the dictionary while iterating over it if the dictionary may be concurrently " +"modified::" +msgstr "" + +#: howto/free-threading-extensions.rst:127 +msgid "" +"Py_BEGIN_CRITICAL_SECTION(dict);\n" +"PyObject *key, *value;\n" +"Py_ssize_t pos = 0;\n" +"while (PyDict_Next(dict, &pos, &key, &value)) {\n" +" ...\n" +"}\n" +"Py_END_CRITICAL_SECTION();" +msgstr "" + +#: howto/free-threading-extensions.rst:137 +msgid "Borrowed References" +msgstr "" + +#: howto/free-threading-extensions.rst:141 +msgid "" +"Some C API functions return :term:`borrowed references `. These APIs are not thread-safe if the containing object is " +"modified concurrently. For example, it's not safe to use :c:func:" +"`PyList_GetItem` if the list may be modified concurrently." +msgstr "" + +#: howto/free-threading-extensions.rst:146 +msgid "" +"The following table lists some borrowed reference APIs and their " +"replacements that return :term:`strong references `." +msgstr "" + +#: howto/free-threading-extensions.rst:150 +msgid "Borrowed reference API" +msgstr "" + +#: howto/free-threading-extensions.rst:150 +msgid "Strong reference API" +msgstr "" + +#: howto/free-threading-extensions.rst:152 +msgid ":c:func:`PyList_GetItem`" +msgstr "" + +#: howto/free-threading-extensions.rst:152 +msgid ":c:func:`PyList_GetItemRef`" +msgstr "" + +#: howto/free-threading-extensions.rst:154 +msgid ":c:func:`PyDict_GetItem`" +msgstr "" + +#: howto/free-threading-extensions.rst:154 +#: howto/free-threading-extensions.rst:156 +msgid ":c:func:`PyDict_GetItemRef`" +msgstr "" + +#: howto/free-threading-extensions.rst:156 +msgid ":c:func:`PyDict_GetItemWithError`" +msgstr "" + +#: howto/free-threading-extensions.rst:158 +msgid ":c:func:`PyDict_GetItemString`" +msgstr "" + +#: howto/free-threading-extensions.rst:158 +msgid ":c:func:`PyDict_GetItemStringRef`" +msgstr "" + +#: howto/free-threading-extensions.rst:160 +msgid ":c:func:`PyDict_SetDefault`" +msgstr "" + +#: howto/free-threading-extensions.rst:160 +msgid ":c:func:`PyDict_SetDefaultRef`" +msgstr "" + +#: howto/free-threading-extensions.rst:162 +msgid ":c:func:`PyDict_Next`" +msgstr "" + +#: howto/free-threading-extensions.rst:162 +msgid "none (see :ref:`PyDict_Next`)" +msgstr "" + +#: howto/free-threading-extensions.rst:164 +msgid ":c:func:`PyWeakref_GetObject`" +msgstr "" + +#: howto/free-threading-extensions.rst:164 +#: howto/free-threading-extensions.rst:166 +msgid ":c:func:`PyWeakref_GetRef`" +msgstr "" + +#: howto/free-threading-extensions.rst:166 +msgid ":c:func:`PyWeakref_GET_OBJECT`" +msgstr "" + +#: howto/free-threading-extensions.rst:168 +msgid ":c:func:`PyImport_AddModule`" +msgstr "" + +#: howto/free-threading-extensions.rst:168 +msgid ":c:func:`PyImport_AddModuleRef`" +msgstr "" + +#: howto/free-threading-extensions.rst:171 +msgid "" +"Not all APIs that return borrowed references are problematic. For example, :" +"c:func:`PyTuple_GetItem` is safe because tuples are immutable. Similarly, " +"not all uses of the above APIs are problematic. For example, :c:func:" +"`PyDict_GetItem` is often used for parsing keyword argument dictionaries in " +"function calls; those keyword argument dictionaries are effectively private " +"(not accessible by other threads), so using borrowed references in that " +"context is safe." +msgstr "" + +#: howto/free-threading-extensions.rst:179 +msgid "" +"Some of these functions were added in Python 3.13. You can use the " +"`pythoncapi-compat `_ package " +"to provide implementations of these functions for older Python versions." +msgstr "" + +#: howto/free-threading-extensions.rst:187 +msgid "Memory Allocation APIs" +msgstr "" + +#: howto/free-threading-extensions.rst:189 +msgid "" +"Python's memory management C API provides functions in three different :ref:" +"`allocation domains `: \"raw\", \"mem\", and \"object\". " +"For thread-safety, the free-threaded build requires that only Python objects " +"are allocated using the object domain, and that all Python object are " +"allocated using that domain. This differs from the prior Python versions, " +"where this was only a best practice and not a hard requirement." +msgstr "" + +#: howto/free-threading-extensions.rst:198 +msgid "" +"Search for uses of :c:func:`PyObject_Malloc` in your extension and check " +"that the allocated memory is used for Python objects. Use :c:func:" +"`PyMem_Malloc` to allocate buffers instead of :c:func:`PyObject_Malloc`." +msgstr "" + +#: howto/free-threading-extensions.rst:205 +msgid "Thread State and GIL APIs" +msgstr "" + +#: howto/free-threading-extensions.rst:207 +msgid "" +"Python provides a set of functions and macros to manage thread state and the " +"GIL, such as:" +msgstr "" + +#: howto/free-threading-extensions.rst:210 +msgid ":c:func:`PyGILState_Ensure` and :c:func:`PyGILState_Release`" +msgstr "" + +#: howto/free-threading-extensions.rst:211 +msgid ":c:func:`PyEval_SaveThread` and :c:func:`PyEval_RestoreThread`" +msgstr "" + +#: howto/free-threading-extensions.rst:212 +msgid ":c:macro:`Py_BEGIN_ALLOW_THREADS` and :c:macro:`Py_END_ALLOW_THREADS`" +msgstr "" + +#: howto/free-threading-extensions.rst:214 +msgid "" +"These functions should still be used in the free-threaded build to manage " +"thread state even when the :term:`GIL` is disabled. For example, if you " +"create a thread outside of Python, you must call :c:func:`PyGILState_Ensure` " +"before calling into the Python API to ensure that the thread has a valid " +"Python thread state." +msgstr "" + +#: howto/free-threading-extensions.rst:220 +msgid "" +"You should continue to call :c:func:`PyEval_SaveThread` or :c:macro:" +"`Py_BEGIN_ALLOW_THREADS` around blocking operations, such as I/O or lock " +"acquisitions, to allow other threads to run the :term:`cyclic garbage " +"collector `." +msgstr "" + +#: howto/free-threading-extensions.rst:227 +msgid "Protecting Internal Extension State" +msgstr "" + +#: howto/free-threading-extensions.rst:229 +msgid "" +"Your extension may have internal state that was previously protected by the " +"GIL. You may need to add locking to protect this state. The approach will " +"depend on your extension, but some common patterns include:" +msgstr "" + +#: howto/free-threading-extensions.rst:233 +msgid "" +"**Caches**: global caches are a common source of shared state. Consider " +"using a lock to protect the cache or disabling it in the free-threaded build " +"if the cache is not critical for performance." +msgstr "" + +#: howto/free-threading-extensions.rst:236 +msgid "" +"**Global State**: global state may need to be protected by a lock or moved " +"to thread local storage. C11 and C++11 provide the ``thread_local`` or " +"``_Thread_local`` for `thread-local storage `_." +msgstr "" + +#: howto/free-threading-extensions.rst:243 +msgid "Building Extensions for the Free-Threaded Build" +msgstr "" + +#: howto/free-threading-extensions.rst:245 +msgid "" +"C API extensions need to be built specifically for the free-threaded build. " +"The wheels, shared libraries, and binaries are indicated by a ``t`` suffix." +msgstr "" + +#: howto/free-threading-extensions.rst:248 +msgid "" +"`pypa/manylinux `_ supports the free-" +"threaded build, with the ``t`` suffix, such as ``python3.13t``." +msgstr "" + +#: howto/free-threading-extensions.rst:250 +msgid "" +"`pypa/cibuildwheel `_ supports the " +"free-threaded build if you set `CIBW_FREE_THREADED_SUPPORT `_." +msgstr "" + +#: howto/free-threading-extensions.rst:255 +msgid "Limited C API and Stable ABI" +msgstr "" + +#: howto/free-threading-extensions.rst:257 +msgid "" +"The free-threaded build does not currently support the :ref:`Limited C API " +"` or the stable ABI. If you use `setuptools `_ to build your extension and " +"currently set ``py_limited_api=True`` you can use ``py_limited_api=not " +"sysconfig.get_config_var(\"Py_GIL_DISABLED\")`` to opt out of the limited " +"API when building with the free-threaded build." +msgstr "" + +#: howto/free-threading-extensions.rst:265 +msgid "" +"You will need to build separate wheels specifically for the free-threaded " +"build. If you currently use the stable ABI, you can continue to build a " +"single wheel for multiple non-free-threaded Python versions." +msgstr "" + +#: howto/free-threading-extensions.rst:271 +msgid "Windows" +msgstr "" + +#: howto/free-threading-extensions.rst:273 +msgid "" +"Due to a limitation of the official Windows installer, you will need to " +"manually define ``Py_GIL_DISABLED=1`` when building extensions from source." +msgstr "" + +#: howto/free-threading-extensions.rst:278 +msgid "" +"`Porting Extension Modules to Support Free-Threading `_: A community-maintained porting guide for " +"extension authors." +msgstr "" diff --git a/howto/free-threading-python.po b/howto/free-threading-python.po new file mode 100644 index 00000000..5d49546c --- /dev/null +++ b/howto/free-threading-python.po @@ -0,0 +1,256 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) 2001-2025, Python Software Foundation +# This file is distributed under the same license as the Python package. +# FIRST AUTHOR , YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: Python 3.13\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#: howto/free-threading-python.rst:5 +msgid "Python experimental support for free threading" +msgstr "" + +#: howto/free-threading-python.rst:7 +msgid "" +"Starting with the 3.13 release, CPython has experimental support for a build " +"of Python called :term:`free threading` where the :term:`global interpreter " +"lock` (GIL) is disabled. Free-threaded execution allows for full " +"utilization of the available processing power by running threads in parallel " +"on available CPU cores. While not all software will benefit from this " +"automatically, programs designed with threading in mind will run faster on " +"multi-core hardware." +msgstr "" + +#: howto/free-threading-python.rst:14 +msgid "" +"**The free-threaded mode is experimental** and work is ongoing to improve " +"it: expect some bugs and a substantial single-threaded performance hit." +msgstr "" + +#: howto/free-threading-python.rst:17 +msgid "" +"This document describes the implications of free threading for Python code. " +"See :ref:`freethreading-extensions-howto` for information on how to write C " +"extensions that support the free-threaded build." +msgstr "" + +#: howto/free-threading-python.rst:23 +msgid "" +":pep:`703` – Making the Global Interpreter Lock Optional in CPython for an " +"overall description of free-threaded Python." +msgstr "" + +#: howto/free-threading-python.rst:28 +msgid "Installation" +msgstr "" + +#: howto/free-threading-python.rst:30 +msgid "" +"Starting with Python 3.13, the official macOS and Windows installers " +"optionally support installing free-threaded Python binaries. The installers " +"are available at https://www.python.org/downloads/." +msgstr "" + +#: howto/free-threading-python.rst:34 +msgid "" +"For information on other platforms, see the `Installing a Free-Threaded " +"Python `_, a " +"community-maintained installation guide for installing free-threaded Python." +msgstr "" + +#: howto/free-threading-python.rst:38 +msgid "" +"When building CPython from source, the :option:`--disable-gil` configure " +"option should be used to build a free-threaded Python interpreter." +msgstr "" + +#: howto/free-threading-python.rst:43 +msgid "Identifying free-threaded Python" +msgstr "" + +#: howto/free-threading-python.rst:45 +msgid "" +"To check if the current interpreter supports free-threading, :option:`python " +"-VV <-V>` and :data:`sys.version` contain \"experimental free-threading " +"build\". The new :func:`sys._is_gil_enabled` function can be used to check " +"whether the GIL is actually disabled in the running process." +msgstr "" + +#: howto/free-threading-python.rst:50 +msgid "" +"The ``sysconfig.get_config_var(\"Py_GIL_DISABLED\")`` configuration variable " +"can be used to determine whether the build supports free threading. If the " +"variable is set to ``1``, then the build supports free threading. This is " +"the recommended mechanism for decisions related to the build configuration." +msgstr "" + +#: howto/free-threading-python.rst:57 +msgid "The global interpreter lock in free-threaded Python" +msgstr "" + +#: howto/free-threading-python.rst:59 +msgid "" +"Free-threaded builds of CPython support optionally running with the GIL " +"enabled at runtime using the environment variable :envvar:`PYTHON_GIL` or " +"the command-line option :option:`-X gil`." +msgstr "" + +#: howto/free-threading-python.rst:63 +msgid "" +"The GIL may also automatically be enabled when importing a C-API extension " +"module that is not explicitly marked as supporting free threading. A " +"warning will be printed in this case." +msgstr "" + +#: howto/free-threading-python.rst:67 +msgid "" +"In addition to individual package documentation, the following websites " +"track the status of popular packages support for free threading:" +msgstr "" + +#: howto/free-threading-python.rst:70 +msgid "https://py-free-threading.github.io/tracking/" +msgstr "" + +#: howto/free-threading-python.rst:71 +msgid "https://hugovk.github.io/free-threaded-wheels/" +msgstr "" + +#: howto/free-threading-python.rst:75 +msgid "Thread safety" +msgstr "" + +#: howto/free-threading-python.rst:77 +msgid "" +"The free-threaded build of CPython aims to provide similar thread-safety " +"behavior at the Python level to the default GIL-enabled build. Built-in " +"types like :class:`dict`, :class:`list`, and :class:`set` use internal locks " +"to protect against concurrent modifications in ways that behave similarly to " +"the GIL. However, Python has not historically guaranteed specific behavior " +"for concurrent modifications to these built-in types, so this should be " +"treated as a description of the current implementation, not a guarantee of " +"current or future behavior." +msgstr "" + +#: howto/free-threading-python.rst:88 +msgid "" +"It's recommended to use the :class:`threading.Lock` or other synchronization " +"primitives instead of relying on the internal locks of built-in types, when " +"possible." +msgstr "" + +#: howto/free-threading-python.rst:94 +msgid "Known limitations" +msgstr "" + +#: howto/free-threading-python.rst:96 +msgid "" +"This section describes known limitations of the free-threaded CPython build." +msgstr "" + +#: howto/free-threading-python.rst:99 +msgid "Immortalization" +msgstr "" + +#: howto/free-threading-python.rst:101 +msgid "" +"The free-threaded build of the 3.13 release makes some objects :term:" +"`immortal`. Immortal objects are not deallocated and have reference counts " +"that are never modified. This is done to avoid reference count contention " +"that would prevent efficient multi-threaded scaling." +msgstr "" + +#: howto/free-threading-python.rst:106 +msgid "" +"An object will be made immortal when a new thread is started for the first " +"time after the main thread is running. The following objects are " +"immortalized:" +msgstr "" + +#: howto/free-threading-python.rst:109 +msgid "" +":ref:`function ` objects declared at the module level" +msgstr "" + +#: howto/free-threading-python.rst:110 +msgid ":ref:`method ` descriptors" +msgstr "" + +#: howto/free-threading-python.rst:111 +msgid ":ref:`code ` objects" +msgstr "" + +#: howto/free-threading-python.rst:112 +msgid ":term:`module` objects and their dictionaries" +msgstr "" + +#: howto/free-threading-python.rst:113 +msgid ":ref:`classes ` (type objects)" +msgstr "" + +#: howto/free-threading-python.rst:115 +msgid "" +"Because immortal objects are never deallocated, applications that create " +"many objects of these types may see increased memory usage. This is " +"expected to be addressed in the 3.14 release." +msgstr "" + +#: howto/free-threading-python.rst:119 +msgid "" +"Additionally, numeric and string literals in the code as well as strings " +"returned by :func:`sys.intern` are also immortalized. This behavior is " +"expected to remain in the 3.14 free-threaded build." +msgstr "" + +#: howto/free-threading-python.rst:125 +msgid "Frame objects" +msgstr "" + +#: howto/free-threading-python.rst:127 +msgid "" +"It is not safe to access :ref:`frame ` objects from other " +"threads and doing so may cause your program to crash . This means that :" +"func:`sys._current_frames` is generally not safe to use in a free-threaded " +"build. Functions like :func:`inspect.currentframe` and :func:`sys." +"_getframe` are generally safe as long as the resulting frame object is not " +"passed to another thread." +msgstr "" + +#: howto/free-threading-python.rst:135 +msgid "Iterators" +msgstr "" + +#: howto/free-threading-python.rst:137 +msgid "" +"Sharing the same iterator object between multiple threads is generally not " +"safe and threads may see duplicate or missing elements when iterating or " +"crash the interpreter." +msgstr "" + +#: howto/free-threading-python.rst:143 +msgid "Single-threaded performance" +msgstr "" + +#: howto/free-threading-python.rst:145 +msgid "" +"The free-threaded build has additional overhead when executing Python code " +"compared to the default GIL-enabled build. In 3.13, this overhead is about " +"40% on the `pyperformance `_ suite. " +"Programs that spend most of their time in C extensions or I/O will see less " +"of an impact. The largest impact is because the specializing adaptive " +"interpreter (:pep:`659`) is disabled in the free-threaded build. We expect " +"to re-enable it in a thread-safe way in the 3.14 release. This overhead is " +"expected to be reduced in upcoming Python release. We are aiming for an " +"overhead of 10% or less on the pyperformance suite compared to the default " +"GIL-enabled build." +msgstr "" diff --git a/howto/functional.po b/howto/functional.po index e92bc12b..78cf3b17 100644 --- a/howto/functional.po +++ b/howto/functional.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" diff --git a/howto/gdb_helpers.po b/howto/gdb_helpers.po index 1807961b..9989c1dc 100644 --- a/howto/gdb_helpers.po +++ b/howto/gdb_helpers.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" diff --git a/howto/index.po b/howto/index.po index b65fa8cc..da11b9fe 100644 --- a/howto/index.po +++ b/howto/index.po @@ -8,8 +8,8 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-02-17 21:03+0100\n" -"PO-Revision-Date: 2025-04-10 15:57+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" +"PO-Revision-Date: 2025-05-05 22:15+0300\n" "Last-Translator: ALEXANDROS TZIORAS alextzioras23@gmail.com\n" "Language-Team: Language-Team: PyGreece \n" "Language: \n" @@ -33,94 +33,106 @@ msgstr "" "συλλογή είναι μια προσπάθεια να προωθηθεί η τεκμηρίωση που είναι πιο " "λεπτομερής από την Αναφορά της Βιβλιοθήκης Python." -#: howto/index.rst:35 +#: howto/index.rst:38 msgid "General:" msgstr "Γενικά:" -#: howto/index.rst:37 +#: howto/index.rst:40 msgid ":ref:`annotations-howto`" msgstr ":ref:`annotations-howto`" -#: howto/index.rst:38 +#: howto/index.rst:41 msgid ":ref:`argparse-tutorial`" msgstr ":ref:`argparse-tutorial`" -#: howto/index.rst:39 +#: howto/index.rst:42 msgid ":ref:`descriptorhowto`" msgstr ":ref:`descriptorhowto`" -#: howto/index.rst:40 +#: howto/index.rst:43 msgid ":ref:`enum-howto`" msgstr ":ref:`enum-howto`" -#: howto/index.rst:41 +#: howto/index.rst:44 msgid ":ref:`functional-howto`" msgstr ":ref:`functional-howto`" -#: howto/index.rst:42 +#: howto/index.rst:45 msgid ":ref:`ipaddress-howto`" msgstr ":ref:`ipaddress-howto`" -#: howto/index.rst:43 +#: howto/index.rst:46 msgid ":ref:`logging-howto`" msgstr ":ref:`logging-howto`" -#: howto/index.rst:44 +#: howto/index.rst:47 msgid ":ref:`logging-cookbook`" msgstr ":ref:`logging-cookbook`" -#: howto/index.rst:45 +#: howto/index.rst:48 msgid ":ref:`regex-howto`" msgstr ":ref:`regex-howto`" -#: howto/index.rst:46 +#: howto/index.rst:49 msgid ":ref:`sortinghowto`" msgstr ":ref:`sortinghowto`" -#: howto/index.rst:47 +#: howto/index.rst:50 msgid ":ref:`unicode-howto`" msgstr ":ref:`unicode-howto`" -#: howto/index.rst:48 +#: howto/index.rst:51 msgid ":ref:`urllib-howto`" msgstr ":ref:`urllib-howto`" -#: howto/index.rst:50 +#: howto/index.rst:53 msgid "Advanced development:" msgstr "Προχωρημένη ανάπτυξη:" -#: howto/index.rst:52 +#: howto/index.rst:55 msgid ":ref:`curses-howto`" msgstr ":ref:`curses-howto`" -#: howto/index.rst:53 +#: howto/index.rst:56 +msgid ":ref:`freethreading-python-howto`" +msgstr ":ref:`freethreading-python-howto`" + +#: howto/index.rst:57 +msgid ":ref:`freethreading-extensions-howto`" +msgstr ":ref:`freethreading-extensions-howto`" + +#: howto/index.rst:58 msgid ":ref:`isolating-extensions-howto`" msgstr ":ref:`isolating-extensions-howto`" -#: howto/index.rst:54 +#: howto/index.rst:59 msgid ":ref:`python_2.3_mro`" msgstr ":ref:`python_2.3_mro`" -#: howto/index.rst:55 +#: howto/index.rst:60 msgid ":ref:`socket-howto`" msgstr ":ref:`socket-howto`" -#: howto/index.rst:56 +#: howto/index.rst:61 +msgid ":ref:`timerfd-howto`" +msgstr ":ref:`timerfd-howto`" + +#: howto/index.rst:62 msgid ":ref:`cporting-howto`" msgstr ":ref:`cporting-howto`" -#: howto/index.rst:58 +#: howto/index.rst:64 msgid "Debugging and profiling:" msgstr "Αποσφαλμάτωση και σκιαγράφηση:" -#: howto/index.rst:60 +#: howto/index.rst:66 msgid ":ref:`gdb`" msgstr ":ref:`gdb`" -#: howto/index.rst:61 +#: howto/index.rst:67 msgid ":ref:`instrumentation`" msgstr ":ref:`instrumentation`" -#: howto/index.rst:62 +#: howto/index.rst:68 msgid ":ref:`perf_profiling`" msgstr ":ref:`perf_profiling`" diff --git a/howto/instrumentation.po b/howto/instrumentation.po index 9eee34dd..4840d338 100644 --- a/howto/instrumentation.po +++ b/howto/instrumentation.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" diff --git a/howto/ipaddress.po b/howto/ipaddress.po index 1b071c05..0d4bb507 100644 --- a/howto/ipaddress.po +++ b/howto/ipaddress.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" diff --git a/howto/isolating-extensions.po b/howto/isolating-extensions.po index 6a9f4f99..ccb2a47b 100644 --- a/howto/isolating-extensions.po +++ b/howto/isolating-extensions.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" diff --git a/howto/logging-cookbook.po b/howto/logging-cookbook.po index 6c8a653e..a6898f62 100644 --- a/howto/logging-cookbook.po +++ b/howto/logging-cookbook.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -444,10 +444,11 @@ msgstr "" #: howto/logging-cookbook.rst:335 msgid "" "This configuration does *almost* what we want, except that ``sys.stdout`` " -"would show messages of severity ``ERROR`` and above as well as ``INFO`` and " -"``WARNING`` messages. To prevent this, we can set up a filter which excludes " -"those messages and add it to the relevant handler. This can be configured by " -"adding a ``filters`` section parallel to ``formatters`` and ``handlers``:" +"would show messages of severity ``ERROR`` and only events of this severity " +"and higher will be tracked as well as ``INFO`` and ``WARNING`` messages. To " +"prevent this, we can set up a filter which excludes those messages and add " +"it to the relevant handler. This can be configured by adding a ``filters`` " +"section parallel to ``formatters`` and ``handlers``:" msgstr "" #: howto/logging-cookbook.rst:341 @@ -1672,14 +1673,11 @@ msgstr "" msgid "" "You could also write your own handler which uses the :class:" "`~multiprocessing.Lock` class from the :mod:`multiprocessing` module to " -"serialize access to the file from your processes. The existing :class:" -"`FileHandler` and subclasses do not make use of :mod:`multiprocessing` at " -"present, though they may do so in the future. Note that at present, the :mod:" -"`multiprocessing` module does not provide working lock functionality on all " -"platforms (see https://bugs.python.org/issue3770)." +"serialize access to the file from your processes. The stdlib :class:" +"`FileHandler` and subclasses do not make use of :mod:`multiprocessing`." msgstr "" -#: howto/logging-cookbook.rst:1291 +#: howto/logging-cookbook.rst:1288 msgid "" "Alternatively, you can use a ``Queue`` and a :class:`QueueHandler` to send " "all logging events to one of the processes in your multi-process " @@ -1694,7 +1692,7 @@ msgid "" "requirements::" msgstr "" -#: howto/logging-cookbook.rst:1302 +#: howto/logging-cookbook.rst:1299 msgid "" "# You'll need these imports in your own code\n" "import logging\n" @@ -1814,13 +1812,13 @@ msgid "" " main()" msgstr "" -#: howto/logging-cookbook.rst:1407 +#: howto/logging-cookbook.rst:1404 msgid "" "A variant of the above script keeps the logging in the main process, in a " "separate thread::" msgstr "" -#: howto/logging-cookbook.rst:1410 +#: howto/logging-cookbook.rst:1407 msgid "" "import logging\n" "import logging.config\n" @@ -1917,7 +1915,7 @@ msgid "" " lp.join()" msgstr "" -#: howto/logging-cookbook.rst:1502 +#: howto/logging-cookbook.rst:1499 msgid "" "This variant shows how you can e.g. apply configuration for particular " "loggers - e.g. the ``foo`` logger has a special handler which stores all " @@ -1927,36 +1925,36 @@ msgid "" "appropriate destinations." msgstr "" -#: howto/logging-cookbook.rst:1509 +#: howto/logging-cookbook.rst:1506 msgid "Using concurrent.futures.ProcessPoolExecutor" msgstr "" -#: howto/logging-cookbook.rst:1511 +#: howto/logging-cookbook.rst:1508 msgid "" "If you want to use :class:`concurrent.futures.ProcessPoolExecutor` to start " "your worker processes, you need to create the queue slightly differently. " "Instead of" msgstr "" -#: howto/logging-cookbook.rst:1515 +#: howto/logging-cookbook.rst:1512 msgid "queue = multiprocessing.Queue(-1)" msgstr "" -#: howto/logging-cookbook.rst:1519 +#: howto/logging-cookbook.rst:1516 msgid "you should use" msgstr "" -#: howto/logging-cookbook.rst:1521 +#: howto/logging-cookbook.rst:1518 msgid "" "queue = multiprocessing.Manager().Queue(-1) # also works with the examples " "above" msgstr "" -#: howto/logging-cookbook.rst:1525 +#: howto/logging-cookbook.rst:1522 msgid "and you can then replace the worker creation from this::" msgstr "" -#: howto/logging-cookbook.rst:1527 +#: howto/logging-cookbook.rst:1524 msgid "" "workers = []\n" "for i in range(10):\n" @@ -1968,22 +1966,22 @@ msgid "" " w.join()" msgstr "" -#: howto/logging-cookbook.rst:1536 +#: howto/logging-cookbook.rst:1533 msgid "to this (remembering to first import :mod:`concurrent.futures`)::" msgstr "" -#: howto/logging-cookbook.rst:1538 +#: howto/logging-cookbook.rst:1535 msgid "" "with concurrent.futures.ProcessPoolExecutor(max_workers=10) as executor:\n" " for i in range(10):\n" " executor.submit(worker_process, queue, worker_configurer)" msgstr "" -#: howto/logging-cookbook.rst:1543 +#: howto/logging-cookbook.rst:1540 msgid "Deploying Web applications using Gunicorn and uWSGI" msgstr "" -#: howto/logging-cookbook.rst:1545 +#: howto/logging-cookbook.rst:1542 msgid "" "When deploying Web applications using `Gunicorn `_ or " "`uWSGI `_ (or similar), " @@ -1995,11 +1993,11 @@ msgid "" "listener in production`_ for more details." msgstr "" -#: howto/logging-cookbook.rst:1555 +#: howto/logging-cookbook.rst:1552 msgid "Using file rotation" msgstr "" -#: howto/logging-cookbook.rst:1560 +#: howto/logging-cookbook.rst:1557 msgid "" "Sometimes you want to let a log file grow to a certain size, then open a new " "file and log to that. You may want to keep a certain number of these files, " @@ -2008,7 +2006,7 @@ msgid "" "usage pattern, the logging package provides a :class:`RotatingFileHandler`::" msgstr "" -#: howto/logging-cookbook.rst:1566 +#: howto/logging-cookbook.rst:1563 msgid "" "import glob\n" "import logging\n" @@ -2037,13 +2035,13 @@ msgid "" " print(filename)" msgstr "" -#: howto/logging-cookbook.rst:1592 +#: howto/logging-cookbook.rst:1589 msgid "" "The result should be 6 separate files, each with part of the log history for " "the application:" msgstr "" -#: howto/logging-cookbook.rst:1595 +#: howto/logging-cookbook.rst:1592 msgid "" "logging_rotatingfile_example.out\n" "logging_rotatingfile_example.out.1\n" @@ -2053,7 +2051,7 @@ msgid "" "logging_rotatingfile_example.out.5" msgstr "" -#: howto/logging-cookbook.rst:1604 +#: howto/logging-cookbook.rst:1601 msgid "" "The most current file is always :file:`logging_rotatingfile_example.out`, " "and each time it reaches the size limit it is renamed with the suffix " @@ -2061,17 +2059,17 @@ msgid "" "(``.1`` becomes ``.2``, etc.) and the ``.6`` file is erased." msgstr "" -#: howto/logging-cookbook.rst:1609 +#: howto/logging-cookbook.rst:1606 msgid "" "Obviously this example sets the log length much too small as an extreme " "example. You would want to set *maxBytes* to an appropriate value." msgstr "" -#: howto/logging-cookbook.rst:1617 +#: howto/logging-cookbook.rst:1614 msgid "Use of alternative formatting styles" msgstr "" -#: howto/logging-cookbook.rst:1619 +#: howto/logging-cookbook.rst:1616 msgid "" "When logging was added to the Python standard library, the only way of " "formatting messages with variable content was to use the %-formatting " @@ -2080,7 +2078,7 @@ msgid "" "Python 2.6)." msgstr "" -#: howto/logging-cookbook.rst:1625 +#: howto/logging-cookbook.rst:1622 msgid "" "Logging (as of 3.2) provides improved support for these two additional " "formatting styles. The :class:`Formatter` class been enhanced to take an " @@ -2093,7 +2091,7 @@ msgid "" "session to show the possibilities:" msgstr "" -#: howto/logging-cookbook.rst:1635 +#: howto/logging-cookbook.rst:1632 msgid "" ">>> import logging\n" ">>> root = logging.getLogger()\n" @@ -2118,21 +2116,21 @@ msgid "" ">>>" msgstr "" -#: howto/logging-cookbook.rst:1659 +#: howto/logging-cookbook.rst:1656 msgid "" "Note that the formatting of logging messages for final output to logs is " "completely independent of how an individual logging message is constructed. " "That can still use %-formatting, as shown here::" msgstr "" -#: howto/logging-cookbook.rst:1663 +#: howto/logging-cookbook.rst:1660 msgid "" ">>> logger.error('This is an%s %s %s', 'other,', 'ERROR,', 'message')\n" "2010-10-28 15:19:29,833 foo.bar ERROR This is another, ERROR, message\n" ">>>" msgstr "" -#: howto/logging-cookbook.rst:1667 +#: howto/logging-cookbook.rst:1664 msgid "" "Logging calls (``logger.debug()``, ``logger.info()`` etc.) only take " "positional parameters for the actual logging message itself, with keyword " @@ -2148,7 +2146,7 @@ msgid "" "strings." msgstr "" -#: howto/logging-cookbook.rst:1680 +#: howto/logging-cookbook.rst:1677 msgid "" "There is, however, a way that you can use {}- and $- formatting to construct " "your individual log messages. Recall that for a message you can use an " @@ -2157,7 +2155,7 @@ msgid "" "the following two classes::" msgstr "" -#: howto/logging-cookbook.rst:1686 howto/logging-cookbook.rst:2774 +#: howto/logging-cookbook.rst:1683 howto/logging-cookbook.rst:2771 msgid "" "class BraceMessage:\n" " def __init__(self, fmt, /, *args, **kwargs):\n" @@ -2178,7 +2176,7 @@ msgid "" " return Template(self.fmt).substitute(**self.kwargs)" msgstr "" -#: howto/logging-cookbook.rst:1704 +#: howto/logging-cookbook.rst:1701 msgid "" "Either of these can be used in place of a format string, to allow {}- or $-" "formatting to be used to build the actual \"message\" part which appears in " @@ -2189,14 +2187,14 @@ msgid "" "used as a synonym/alias for :func:`gettext.gettext` or its brethren)." msgstr "" -#: howto/logging-cookbook.rst:1712 +#: howto/logging-cookbook.rst:1709 msgid "" "The above classes are not included in Python, though they're easy enough to " "copy and paste into your own code. They can be used as follows (assuming " "that they're declared in a module called ``wherever``):" msgstr "" -#: howto/logging-cookbook.rst:1716 +#: howto/logging-cookbook.rst:1713 msgid "" ">>> from wherever import BraceMessage as __\n" ">>> print(__('Message with {0} {name}', 2, name='placeholders'))\n" @@ -2215,14 +2213,14 @@ msgid "" ">>>" msgstr "" -#: howto/logging-cookbook.rst:1734 +#: howto/logging-cookbook.rst:1731 msgid "" "While the above examples use ``print()`` to show how the formatting works, " "you would of course use ``logger.debug()`` or similar to actually log using " "this approach." msgstr "" -#: howto/logging-cookbook.rst:1738 +#: howto/logging-cookbook.rst:1735 msgid "" "One thing to note is that you pay no significant performance penalty with " "this approach: the actual formatting happens not when you make the logging " @@ -2233,13 +2231,13 @@ msgid "" "sugar for a constructor call to one of the :samp:`{XXX}Message` classes." msgstr "" -#: howto/logging-cookbook.rst:1746 +#: howto/logging-cookbook.rst:1743 msgid "" "If you prefer, you can use a :class:`LoggerAdapter` to achieve a similar " "effect to the above, as in the following example::" msgstr "" -#: howto/logging-cookbook.rst:1749 +#: howto/logging-cookbook.rst:1746 msgid "" "import logging\n" "\n" @@ -2268,17 +2266,17 @@ msgid "" " main()" msgstr "" -#: howto/logging-cookbook.rst:1775 +#: howto/logging-cookbook.rst:1772 msgid "" "The above script should log the message ``Hello, world!`` when run with " "Python 3.8 or later." msgstr "" -#: howto/logging-cookbook.rst:1784 +#: howto/logging-cookbook.rst:1781 msgid "Customizing ``LogRecord``" msgstr "" -#: howto/logging-cookbook.rst:1786 +#: howto/logging-cookbook.rst:1783 msgid "" "Every logging event is represented by a :class:`LogRecord` instance. When an " "event is logged and not filtered out by a logger's level, a :class:" @@ -2289,13 +2287,13 @@ msgid "" "was done:" msgstr "" -#: howto/logging-cookbook.rst:1793 +#: howto/logging-cookbook.rst:1790 msgid "" ":meth:`Logger.makeRecord`, which is called in the normal process of logging " "an event. This invoked :class:`LogRecord` directly to create an instance." msgstr "" -#: howto/logging-cookbook.rst:1796 +#: howto/logging-cookbook.rst:1793 msgid "" ":func:`makeLogRecord`, which is called with a dictionary containing " "attributes to be added to the LogRecord. This is typically invoked when a " @@ -2304,27 +2302,27 @@ msgid "" "`~handlers.HTTPHandler`)." msgstr "" -#: howto/logging-cookbook.rst:1802 +#: howto/logging-cookbook.rst:1799 msgid "" "This has usually meant that if you need to do anything special with a :class:" "`LogRecord`, you've had to do one of the following." msgstr "" -#: howto/logging-cookbook.rst:1805 +#: howto/logging-cookbook.rst:1802 msgid "" "Create your own :class:`Logger` subclass, which overrides :meth:`Logger." "makeRecord`, and set it using :func:`~logging.setLoggerClass` before any " "loggers that you care about are instantiated." msgstr "" -#: howto/logging-cookbook.rst:1808 +#: howto/logging-cookbook.rst:1805 msgid "" "Add a :class:`Filter` to a logger or handler, which does the necessary " "special manipulation you need when its :meth:`~Filter.filter` method is " "called." msgstr "" -#: howto/logging-cookbook.rst:1812 +#: howto/logging-cookbook.rst:1809 msgid "" "The first approach would be a little unwieldy in the scenario where (say) " "several different libraries wanted to do different things. Each would " @@ -2332,7 +2330,7 @@ msgid "" "last would win." msgstr "" -#: howto/logging-cookbook.rst:1817 +#: howto/logging-cookbook.rst:1814 msgid "" "The second approach works reasonably well for many cases, but does not allow " "you to e.g. use a specialized subclass of :class:`LogRecord`. Library " @@ -2341,11 +2339,11 @@ msgid "" "would do simply by adding new packages or modules and doing ::" msgstr "" -#: howto/logging-cookbook.rst:1823 +#: howto/logging-cookbook.rst:1820 msgid "logger = logging.getLogger(__name__)" msgstr "" -#: howto/logging-cookbook.rst:1825 +#: howto/logging-cookbook.rst:1822 msgid "" "at module level). It's probably one too many things to think about. " "Developers could also add the filter to a :class:`~logging.NullHandler` " @@ -2355,7 +2353,7 @@ msgid "" "developer." msgstr "" -#: howto/logging-cookbook.rst:1831 +#: howto/logging-cookbook.rst:1828 msgid "" "In Python 3.2 and later, :class:`~logging.LogRecord` creation is done " "through a factory, which you can specify. The factory is just a callable you " @@ -2365,7 +2363,7 @@ msgid "" "`LogRecord` is the default setting for the factory." msgstr "" -#: howto/logging-cookbook.rst:1838 +#: howto/logging-cookbook.rst:1835 msgid "" "This approach allows a custom factory to control all aspects of LogRecord " "creation. For example, you could return a subclass, or just add some " @@ -2373,7 +2371,7 @@ msgid "" "this::" msgstr "" -#: howto/logging-cookbook.rst:1842 +#: howto/logging-cookbook.rst:1839 msgid "" "old_factory = logging.getLogRecordFactory()\n" "\n" @@ -2385,7 +2383,7 @@ msgid "" "logging.setLogRecordFactory(record_factory)" msgstr "" -#: howto/logging-cookbook.rst:1851 +#: howto/logging-cookbook.rst:1848 msgid "" "This pattern allows different libraries to chain factories together, and as " "long as they don't overwrite each other's attributes or unintentionally " @@ -2395,22 +2393,22 @@ msgid "" "used when the use of a :class:`Filter` does not provide the desired result." msgstr "" -#: howto/logging-cookbook.rst:1863 +#: howto/logging-cookbook.rst:1860 msgid "Subclassing QueueHandler and QueueListener- a ZeroMQ example" msgstr "" -#: howto/logging-cookbook.rst:1866 howto/logging-cookbook.rst:1999 +#: howto/logging-cookbook.rst:1863 howto/logging-cookbook.rst:1996 msgid "Subclass ``QueueHandler``" msgstr "" -#: howto/logging-cookbook.rst:1868 +#: howto/logging-cookbook.rst:1865 msgid "" "You can use a :class:`QueueHandler` subclass to send messages to other kinds " "of queues, for example a ZeroMQ 'publish' socket. In the example below,the " "socket is created separately and passed to the handler (as its 'queue')::" msgstr "" -#: howto/logging-cookbook.rst:1872 +#: howto/logging-cookbook.rst:1869 msgid "" "import zmq # using pyzmq, the Python binding for ZeroMQ\n" "import json # for serializing records portably\n" @@ -2427,13 +2425,13 @@ msgid "" "handler = ZeroMQSocketHandler(sock)" msgstr "" -#: howto/logging-cookbook.rst:1887 +#: howto/logging-cookbook.rst:1884 msgid "" "Of course there are other ways of organizing this, for example passing in " "the data needed by the handler to create the socket::" msgstr "" -#: howto/logging-cookbook.rst:1890 +#: howto/logging-cookbook.rst:1887 msgid "" "class ZeroMQSocketHandler(QueueHandler):\n" " def __init__(self, uri, socktype=zmq.PUB, ctx=None):\n" @@ -2449,17 +2447,17 @@ msgid "" " self.queue.close()" msgstr "" -#: howto/logging-cookbook.rst:1905 howto/logging-cookbook.rst:1935 +#: howto/logging-cookbook.rst:1902 howto/logging-cookbook.rst:1932 msgid "Subclass ``QueueListener``" msgstr "" -#: howto/logging-cookbook.rst:1907 +#: howto/logging-cookbook.rst:1904 msgid "" "You can also subclass :class:`QueueListener` to get messages from other " "kinds of queues, for example a ZeroMQ 'subscribe' socket. Here's an example::" msgstr "" -#: howto/logging-cookbook.rst:1910 +#: howto/logging-cookbook.rst:1907 msgid "" "class ZeroMQSocketListener(QueueListener):\n" " def __init__(self, uri, /, *handlers, **kwargs):\n" @@ -2475,11 +2473,11 @@ msgid "" " return logging.makeLogRecord(msg)" msgstr "" -#: howto/logging-cookbook.rst:1925 +#: howto/logging-cookbook.rst:1922 msgid "Subclassing QueueHandler and QueueListener- a ``pynng`` example" msgstr "" -#: howto/logging-cookbook.rst:1927 +#: howto/logging-cookbook.rst:1924 msgid "" "In a similar way to the above section, we can implement a listener and " "handler using :pypi:`pynng`, which is a Python binding to `NNG `_ of the Django documentation." msgstr "" -#: howto/logging-cookbook.rst:2173 +#: howto/logging-cookbook.rst:2170 msgid "Using a rotator and namer to customize log rotation processing" msgstr "" -#: howto/logging-cookbook.rst:2175 +#: howto/logging-cookbook.rst:2172 msgid "" "An example of how you can define a namer and rotator is given in the " "following runnable script, which shows gzip compression of the log file::" msgstr "" -#: howto/logging-cookbook.rst:2178 +#: howto/logging-cookbook.rst:2175 msgid "" "import gzip\n" "import logging\n" @@ -2785,12 +2783,12 @@ msgid "" " root.info(f'Message no. {i + 1}')" msgstr "" -#: howto/logging-cookbook.rst:2206 +#: howto/logging-cookbook.rst:2203 msgid "" "After running this, you will see six new files, five of which are compressed:" msgstr "" -#: howto/logging-cookbook.rst:2208 +#: howto/logging-cookbook.rst:2205 msgid "" "$ ls rotated.log*\n" "rotated.log rotated.log.2.gz rotated.log.4.gz\n" @@ -2801,11 +2799,11 @@ msgid "" "2023-01-20 02:28:17,767 Message no. 998" msgstr "" -#: howto/logging-cookbook.rst:2219 +#: howto/logging-cookbook.rst:2216 msgid "A more elaborate multiprocessing example" msgstr "" -#: howto/logging-cookbook.rst:2221 +#: howto/logging-cookbook.rst:2218 msgid "" "The following working example shows how logging can be used with " "multiprocessing using configuration files. The configurations are fairly " @@ -2813,7 +2811,7 @@ msgid "" "in a real multiprocessing scenario." msgstr "" -#: howto/logging-cookbook.rst:2226 +#: howto/logging-cookbook.rst:2223 msgid "" "In the example, the main process spawns a listener process and some worker " "processes. Each of the main process, the listener and the workers have three " @@ -2826,13 +2824,13 @@ msgid "" "own scenario." msgstr "" -#: howto/logging-cookbook.rst:2236 +#: howto/logging-cookbook.rst:2233 msgid "" "Here's the script - the docstrings and the comments hopefully explain how it " "works::" msgstr "" -#: howto/logging-cookbook.rst:2239 +#: howto/logging-cookbook.rst:2236 msgid "" "import logging\n" "import logging.config\n" @@ -3055,11 +3053,11 @@ msgid "" " main()" msgstr "" -#: howto/logging-cookbook.rst:2448 +#: howto/logging-cookbook.rst:2445 msgid "Inserting a BOM into messages sent to a SysLogHandler" msgstr "" -#: howto/logging-cookbook.rst:2450 +#: howto/logging-cookbook.rst:2447 msgid "" ":rfc:`5424` requires that a Unicode message be sent to a syslog daemon as a " "set of bytes which have the following structure: an optional pure-ASCII " @@ -3068,7 +3066,7 @@ msgid "" "<5424#section-6>`.)" msgstr "" -#: howto/logging-cookbook.rst:2456 +#: howto/logging-cookbook.rst:2453 msgid "" "In Python 3.1, code was added to :class:`~logging.handlers.SysLogHandler` to " "insert a BOM into the message, but unfortunately, it was implemented " @@ -3076,7 +3074,7 @@ msgid "" "hence not allowing any pure-ASCII component to appear before it." msgstr "" -#: howto/logging-cookbook.rst:2462 +#: howto/logging-cookbook.rst:2459 msgid "" "As this behaviour is broken, the incorrect BOM insertion code is being " "removed from Python 3.2.4 and later. However, it is not being replaced, and " @@ -3085,37 +3083,37 @@ msgid "" "encoded using UTF-8, then you need to do the following:" msgstr "" -#: howto/logging-cookbook.rst:2468 +#: howto/logging-cookbook.rst:2465 msgid "" "Attach a :class:`~logging.Formatter` instance to your :class:`~logging." "handlers.SysLogHandler` instance, with a format string such as::" msgstr "" -#: howto/logging-cookbook.rst:2472 +#: howto/logging-cookbook.rst:2469 msgid "'ASCII section\\ufeffUnicode section'" msgstr "" -#: howto/logging-cookbook.rst:2474 +#: howto/logging-cookbook.rst:2471 msgid "" "The Unicode code point U+FEFF, when encoded using UTF-8, will be encoded as " "a UTF-8 BOM -- the byte-string ``b'\\xef\\xbb\\xbf'``." msgstr "" -#: howto/logging-cookbook.rst:2477 +#: howto/logging-cookbook.rst:2474 msgid "" "Replace the ASCII section with whatever placeholders you like, but make sure " "that the data that appears in there after substitution is always ASCII (that " "way, it will remain unchanged after UTF-8 encoding)." msgstr "" -#: howto/logging-cookbook.rst:2481 +#: howto/logging-cookbook.rst:2478 msgid "" "Replace the Unicode section with whatever placeholders you like; if the data " "which appears there after substitution contains characters outside the ASCII " "range, that's fine -- it will be encoded using UTF-8." msgstr "" -#: howto/logging-cookbook.rst:2485 +#: howto/logging-cookbook.rst:2482 msgid "" "The formatted message *will* be encoded using UTF-8 encoding by " "``SysLogHandler``. If you follow the above rules, you should be able to " @@ -3124,11 +3122,11 @@ msgid "" "daemon may complain." msgstr "" -#: howto/logging-cookbook.rst:2492 +#: howto/logging-cookbook.rst:2489 msgid "Implementing structured logging" msgstr "" -#: howto/logging-cookbook.rst:2494 +#: howto/logging-cookbook.rst:2491 msgid "" "Although most logging messages are intended for reading by humans, and thus " "not readily machine-parseable, there might be circumstances where you want " @@ -3140,7 +3138,7 @@ msgid "" "machine-parseable manner::" msgstr "" -#: howto/logging-cookbook.rst:2502 +#: howto/logging-cookbook.rst:2499 msgid "" "import json\n" "import logging\n" @@ -3159,29 +3157,29 @@ msgid "" "logging.info(_('message 1', foo='bar', bar='baz', num=123, fnum=123.456))" msgstr "" -#: howto/logging-cookbook.rst:2518 +#: howto/logging-cookbook.rst:2515 msgid "If the above script is run, it prints:" msgstr "" -#: howto/logging-cookbook.rst:2520 +#: howto/logging-cookbook.rst:2517 msgid "" "message 1 >>> {\"fnum\": 123.456, \"num\": 123, \"bar\": \"baz\", \"foo\": " "\"bar\"}" msgstr "" -#: howto/logging-cookbook.rst:2524 howto/logging-cookbook.rst:2566 +#: howto/logging-cookbook.rst:2521 howto/logging-cookbook.rst:2563 msgid "" "Note that the order of items might be different according to the version of " "Python used." msgstr "" -#: howto/logging-cookbook.rst:2527 +#: howto/logging-cookbook.rst:2524 msgid "" "If you need more specialised processing, you can use a custom JSON encoder, " "as in the following complete example::" msgstr "" -#: howto/logging-cookbook.rst:2530 +#: howto/logging-cookbook.rst:2527 msgid "" "import json\n" "import logging\n" @@ -3214,19 +3212,19 @@ msgid "" " main()" msgstr "" -#: howto/logging-cookbook.rst:2560 +#: howto/logging-cookbook.rst:2557 msgid "When the above script is run, it prints:" msgstr "" -#: howto/logging-cookbook.rst:2562 +#: howto/logging-cookbook.rst:2559 msgid "message 1 >>> {\"snowman\": \"\\u2603\", \"set_value\": [1, 2, 3]}" msgstr "" -#: howto/logging-cookbook.rst:2575 +#: howto/logging-cookbook.rst:2572 msgid "Customizing handlers with :func:`dictConfig`" msgstr "" -#: howto/logging-cookbook.rst:2577 +#: howto/logging-cookbook.rst:2574 msgid "" "There are times when you want to customize logging handlers in particular " "ways, and if you use :func:`dictConfig` you may be able to do this without " @@ -3236,7 +3234,7 @@ msgid "" "customize handler creation using a plain function such as::" msgstr "" -#: howto/logging-cookbook.rst:2584 +#: howto/logging-cookbook.rst:2581 msgid "" "def owned_file_handler(filename, mode='a', encoding=None, owner=None):\n" " if owner:\n" @@ -3246,13 +3244,13 @@ msgid "" " return logging.FileHandler(filename, mode, encoding)" msgstr "" -#: howto/logging-cookbook.rst:2591 +#: howto/logging-cookbook.rst:2588 msgid "" "You can then specify, in a logging configuration passed to :func:" "`dictConfig`, that a logging handler be created by calling this function::" msgstr "" -#: howto/logging-cookbook.rst:2594 +#: howto/logging-cookbook.rst:2591 msgid "" "LOGGING = {\n" " 'version': 1,\n" @@ -3285,14 +3283,14 @@ msgid "" "}" msgstr "" -#: howto/logging-cookbook.rst:2624 +#: howto/logging-cookbook.rst:2621 msgid "" "In this example I am setting the ownership using the ``pulse`` user and " "group, just for the purposes of illustration. Putting it together into a " "working script, ``chowntest.py``::" msgstr "" -#: howto/logging-cookbook.rst:2628 +#: howto/logging-cookbook.rst:2625 msgid "" "import logging, logging.config, os, shutil\n" "\n" @@ -3338,11 +3336,11 @@ msgid "" "logger.debug('A debug message')" msgstr "" -#: howto/logging-cookbook.rst:2671 +#: howto/logging-cookbook.rst:2668 msgid "To run this, you will probably need to run as ``root``:" msgstr "" -#: howto/logging-cookbook.rst:2673 +#: howto/logging-cookbook.rst:2670 msgid "" "$ sudo python3.3 chowntest.py\n" "$ cat chowntest.log\n" @@ -3351,7 +3349,7 @@ msgid "" "-rw-r--r-- 1 pulse pulse 55 2013-11-05 09:34 chowntest.log" msgstr "" -#: howto/logging-cookbook.rst:2681 +#: howto/logging-cookbook.rst:2678 msgid "" "Note that this example uses Python 3.3 because that's where :func:`shutil." "chown` makes an appearance. This approach should work with any Python " @@ -3360,25 +3358,25 @@ msgid "" "change using e.g. :func:`os.chown`." msgstr "" -#: howto/logging-cookbook.rst:2687 +#: howto/logging-cookbook.rst:2684 msgid "" "In practice, the handler-creating function may be in a utility module " "somewhere in your project. Instead of the line in the configuration::" msgstr "" -#: howto/logging-cookbook.rst:2690 +#: howto/logging-cookbook.rst:2687 msgid "'()': owned_file_handler," msgstr "" -#: howto/logging-cookbook.rst:2692 +#: howto/logging-cookbook.rst:2689 msgid "you could use e.g.::" msgstr "" -#: howto/logging-cookbook.rst:2694 +#: howto/logging-cookbook.rst:2691 msgid "'()': 'ext://project.util.owned_file_handler'," msgstr "" -#: howto/logging-cookbook.rst:2696 +#: howto/logging-cookbook.rst:2693 msgid "" "where ``project.util`` can be replaced with the actual name of the package " "where the function resides. In the above working script, using ``'ext://" @@ -3386,25 +3384,25 @@ msgid "" "resolved by :func:`dictConfig` from the ``ext://`` specification." msgstr "" -#: howto/logging-cookbook.rst:2701 +#: howto/logging-cookbook.rst:2698 msgid "" "This example hopefully also points the way to how you could implement other " "types of file change - e.g. setting specific POSIX permission bits - in the " "same way, using :func:`os.chmod`." msgstr "" -#: howto/logging-cookbook.rst:2705 +#: howto/logging-cookbook.rst:2702 msgid "" "Of course, the approach could also be extended to types of handler other " "than a :class:`~logging.FileHandler` - for example, one of the rotating file " "handlers, or a different type of handler altogether." msgstr "" -#: howto/logging-cookbook.rst:2715 +#: howto/logging-cookbook.rst:2712 msgid "Using particular formatting styles throughout your application" msgstr "" -#: howto/logging-cookbook.rst:2717 +#: howto/logging-cookbook.rst:2714 msgid "" "In Python 3.2, the :class:`~logging.Formatter` gained a ``style`` keyword " "parameter which, while defaulting to ``%`` for backward compatibility, " @@ -3415,7 +3413,7 @@ msgid "" "is constructed." msgstr "" -#: howto/logging-cookbook.rst:2724 +#: howto/logging-cookbook.rst:2721 msgid "" "Logging calls (:meth:`~Logger.debug`, :meth:`~Logger.info` etc.) only take " "positional parameters for the actual logging message itself, with keyword " @@ -3430,7 +3428,7 @@ msgid "" "calls which are out there in existing code will be using %-format strings." msgstr "" -#: howto/logging-cookbook.rst:2736 +#: howto/logging-cookbook.rst:2733 msgid "" "There have been suggestions to associate format styles with specific " "loggers, but that approach also runs into backward compatibility problems " @@ -3438,7 +3436,7 @@ msgid "" "formatting." msgstr "" -#: howto/logging-cookbook.rst:2740 +#: howto/logging-cookbook.rst:2737 msgid "" "For logging to work interoperably between any third-party libraries and your " "code, decisions about formatting need to be made at the level of the " @@ -3446,11 +3444,11 @@ msgid "" "formatting styles can be accommodated." msgstr "" -#: howto/logging-cookbook.rst:2747 +#: howto/logging-cookbook.rst:2744 msgid "Using LogRecord factories" msgstr "" -#: howto/logging-cookbook.rst:2749 +#: howto/logging-cookbook.rst:2746 msgid "" "In Python 3.2, along with the :class:`~logging.Formatter` changes mentioned " "above, the logging package gained the ability to allow users to set their " @@ -3465,17 +3463,17 @@ msgid "" "implementation does." msgstr "" -#: howto/logging-cookbook.rst:2760 +#: howto/logging-cookbook.rst:2757 msgid "" "Refer to the reference documentation on :func:`setLogRecordFactory` and :" "class:`LogRecord` for more information." msgstr "" -#: howto/logging-cookbook.rst:2765 +#: howto/logging-cookbook.rst:2762 msgid "Using custom message objects" msgstr "" -#: howto/logging-cookbook.rst:2767 +#: howto/logging-cookbook.rst:2764 msgid "" "There is another, perhaps simpler way that you can use {}- and $- formatting " "to construct your individual log messages. You may recall (from :ref:" @@ -3485,7 +3483,7 @@ msgid "" "following two classes::" msgstr "" -#: howto/logging-cookbook.rst:2792 +#: howto/logging-cookbook.rst:2789 msgid "" "Either of these can be used in place of a format string, to allow {}- or $-" "formatting to be used to build the actual \"message\" part which appears in " @@ -3496,13 +3494,13 @@ msgid "" "using ``_`` for localization)." msgstr "" -#: howto/logging-cookbook.rst:2800 +#: howto/logging-cookbook.rst:2797 msgid "" "Examples of this approach are given below. Firstly, formatting with :meth:" "`str.format`::" msgstr "" -#: howto/logging-cookbook.rst:2803 +#: howto/logging-cookbook.rst:2800 msgid "" ">>> __ = BraceMessage\n" ">>> print(__('Message with {0} {1}', 2, 'placeholders'))\n" @@ -3517,11 +3515,11 @@ msgid "" "Message with coordinates: (0.50, 0.50)" msgstr "" -#: howto/logging-cookbook.rst:2814 +#: howto/logging-cookbook.rst:2811 msgid "Secondly, formatting with :class:`string.Template`::" msgstr "" -#: howto/logging-cookbook.rst:2816 +#: howto/logging-cookbook.rst:2813 msgid "" ">>> __ = DollarMessage\n" ">>> print(__('Message with $num $what', num=2, what='placeholders'))\n" @@ -3529,7 +3527,7 @@ msgid "" ">>>" msgstr "" -#: howto/logging-cookbook.rst:2821 +#: howto/logging-cookbook.rst:2818 msgid "" "One thing to note is that you pay no significant performance penalty with " "this approach: the actual formatting happens not when you make the logging " @@ -3541,11 +3539,11 @@ msgid "" "shown above." msgstr "" -#: howto/logging-cookbook.rst:2835 +#: howto/logging-cookbook.rst:2832 msgid "Configuring filters with :func:`dictConfig`" msgstr "" -#: howto/logging-cookbook.rst:2837 +#: howto/logging-cookbook.rst:2834 msgid "" "You *can* configure filters using :func:`~logging.config.dictConfig`, though " "it might not be obvious at first glance how to do it (hence this recipe). " @@ -3560,7 +3558,7 @@ msgid "" "complete example::" msgstr "" -#: howto/logging-cookbook.rst:2848 +#: howto/logging-cookbook.rst:2845 msgid "" "import logging\n" "import logging.config\n" @@ -3605,26 +3603,26 @@ msgid "" " logging.debug('hello - noshow')" msgstr "" -#: howto/logging-cookbook.rst:2890 +#: howto/logging-cookbook.rst:2887 msgid "" "This example shows how you can pass configuration data to the callable which " "constructs the instance, in the form of keyword parameters. When run, the " "above script will print:" msgstr "" -#: howto/logging-cookbook.rst:2894 +#: howto/logging-cookbook.rst:2891 msgid "changed: hello" msgstr "" -#: howto/logging-cookbook.rst:2898 +#: howto/logging-cookbook.rst:2895 msgid "which shows that the filter is working as configured." msgstr "" -#: howto/logging-cookbook.rst:2900 +#: howto/logging-cookbook.rst:2897 msgid "A couple of extra points to note:" msgstr "" -#: howto/logging-cookbook.rst:2902 +#: howto/logging-cookbook.rst:2899 msgid "" "If you can't refer to the callable directly in the configuration (e.g. if it " "lives in a different module, and you can't import it directly where the " @@ -3634,7 +3632,7 @@ msgid "" "the above example." msgstr "" -#: howto/logging-cookbook.rst:2909 +#: howto/logging-cookbook.rst:2906 msgid "" "As well as for filters, this technique can also be used to configure custom " "handlers and formatters. See :ref:`logging-config-dict-userdef` for more " @@ -3643,11 +3641,11 @@ msgid "" "above." msgstr "" -#: howto/logging-cookbook.rst:2918 +#: howto/logging-cookbook.rst:2915 msgid "Customized exception formatting" msgstr "" -#: howto/logging-cookbook.rst:2920 +#: howto/logging-cookbook.rst:2917 msgid "" "There might be times when you want to do customized exception formatting - " "for argument's sake, let's say you want exactly one line per logged event, " @@ -3655,7 +3653,7 @@ msgid "" "formatter class, as shown in the following example::" msgstr "" -#: howto/logging-cookbook.rst:2925 +#: howto/logging-cookbook.rst:2922 msgid "" "import logging\n" "\n" @@ -3694,11 +3692,11 @@ msgid "" " main()" msgstr "" -#: howto/logging-cookbook.rst:2961 +#: howto/logging-cookbook.rst:2958 msgid "When run, this produces a file with exactly two lines:" msgstr "" -#: howto/logging-cookbook.rst:2963 +#: howto/logging-cookbook.rst:2960 msgid "" "28/01/2015 07:21:23|INFO|Sample message|\n" "28/01/2015 07:21:23|ERROR|ZeroDivisionError: integer division or modulo by " @@ -3707,18 +3705,18 @@ msgid "" "zero'|" msgstr "" -#: howto/logging-cookbook.rst:2968 +#: howto/logging-cookbook.rst:2965 msgid "" "While the above treatment is simplistic, it points the way to how exception " "information can be formatted to your liking. The :mod:`traceback` module may " "be helpful for more specialized needs." msgstr "" -#: howto/logging-cookbook.rst:2975 +#: howto/logging-cookbook.rst:2972 msgid "Speaking logging messages" msgstr "" -#: howto/logging-cookbook.rst:2977 +#: howto/logging-cookbook.rst:2974 msgid "" "There might be situations when it is desirable to have logging messages " "rendered in an audible rather than a visible format. This is easy to do if " @@ -3735,7 +3733,7 @@ msgid "" "approach, which assumes that the ``espeak`` TTS package is available::" msgstr "" -#: howto/logging-cookbook.rst:2990 +#: howto/logging-cookbook.rst:2987 msgid "" "import logging\n" "import subprocess\n" @@ -3767,24 +3765,24 @@ msgid "" " sys.exit(main())" msgstr "" -#: howto/logging-cookbook.rst:3019 +#: howto/logging-cookbook.rst:3016 msgid "" "When run, this script should say \"Hello\" and then \"Goodbye\" in a female " "voice." msgstr "" -#: howto/logging-cookbook.rst:3021 +#: howto/logging-cookbook.rst:3018 msgid "" "The above approach can, of course, be adapted to other TTS systems and even " "other systems altogether which can process messages via external programs " "run from a command line." msgstr "" -#: howto/logging-cookbook.rst:3029 +#: howto/logging-cookbook.rst:3026 msgid "Buffering logging messages and outputting them conditionally" msgstr "" -#: howto/logging-cookbook.rst:3031 +#: howto/logging-cookbook.rst:3028 msgid "" "There might be situations where you want to log messages in a temporary area " "and only output them if a certain condition occurs. For example, you may " @@ -3794,7 +3792,7 @@ msgid "" "debug information to be output as well as the error." msgstr "" -#: howto/logging-cookbook.rst:3038 +#: howto/logging-cookbook.rst:3035 msgid "" "Here is an example which shows how you could do this using a decorator for " "your functions where you want logging to behave this way. It makes use of " @@ -3807,7 +3805,7 @@ msgid "" "subclass of ``MemoryHandler`` if you want custom flushing behavior." msgstr "" -#: howto/logging-cookbook.rst:3048 +#: howto/logging-cookbook.rst:3045 msgid "" "The example script has a simple function, ``foo``, which just cycles through " "all the logging levels, writing to ``sys.stderr`` to say what level it's " @@ -3816,7 +3814,7 @@ msgid "" "levels - otherwise, it only logs at DEBUG, INFO and WARNING levels." msgstr "" -#: howto/logging-cookbook.rst:3054 +#: howto/logging-cookbook.rst:3051 msgid "" "The script just arranges to decorate ``foo`` with a decorator which will do " "the conditional logging that's required. The decorator takes a logger as a " @@ -3828,11 +3826,11 @@ msgid "" "respectively." msgstr "" -#: howto/logging-cookbook.rst:3062 +#: howto/logging-cookbook.rst:3059 msgid "Here's the script::" msgstr "" -#: howto/logging-cookbook.rst:3064 +#: howto/logging-cookbook.rst:3061 msgid "" "import logging\n" "from logging.handlers import MemoryHandler\n" @@ -3898,11 +3896,11 @@ msgid "" " assert decorated_foo(True)" msgstr "" -#: howto/logging-cookbook.rst:3125 +#: howto/logging-cookbook.rst:3122 msgid "When this script is run, the following output should be observed:" msgstr "" -#: howto/logging-cookbook.rst:3127 +#: howto/logging-cookbook.rst:3124 msgid "" "Calling undecorated foo with False\n" "about to log at DEBUG ...\n" @@ -3931,29 +3929,29 @@ msgid "" "Actually logged at CRITICAL" msgstr "" -#: howto/logging-cookbook.rst:3155 +#: howto/logging-cookbook.rst:3152 msgid "" "As you can see, actual logging output only occurs when an event is logged " "whose severity is ERROR or greater, but in that case, any previous events at " "lower severities are also logged." msgstr "" -#: howto/logging-cookbook.rst:3159 +#: howto/logging-cookbook.rst:3156 msgid "You can of course use the conventional means of decoration::" msgstr "" -#: howto/logging-cookbook.rst:3161 +#: howto/logging-cookbook.rst:3158 msgid "" "@log_if_errors(logger)\n" "def foo(fail=False):\n" " ..." msgstr "" -#: howto/logging-cookbook.rst:3169 +#: howto/logging-cookbook.rst:3166 msgid "Sending logging messages to email, with buffering" msgstr "" -#: howto/logging-cookbook.rst:3171 +#: howto/logging-cookbook.rst:3168 msgid "" "To illustrate how you can send log messages via email, so that a set number " "of messages are sent per email, you can subclass :class:`~logging.handlers." @@ -3964,7 +3962,7 @@ msgid "" "argument to see the required and optional arguments.)" msgstr "" -#: howto/logging-cookbook.rst:3179 +#: howto/logging-cookbook.rst:3176 msgid "" "import logging\n" "import logging.handlers\n" @@ -4032,7 +4030,7 @@ msgid "" " h.close()" msgstr "" -#: howto/logging-cookbook.rst:3243 +#: howto/logging-cookbook.rst:3240 msgid "" "If you run this script and your SMTP server is correctly set up, you should " "find that it sends eleven emails to the addressee you specify. The first ten " @@ -4040,17 +4038,17 @@ msgid "" "messages. That makes up 102 messages as specified in the script." msgstr "" -#: howto/logging-cookbook.rst:3251 +#: howto/logging-cookbook.rst:3248 msgid "Formatting times using UTC (GMT) via configuration" msgstr "" -#: howto/logging-cookbook.rst:3253 +#: howto/logging-cookbook.rst:3250 msgid "" "Sometimes you want to format times using UTC, which can be done using a " "class such as ``UTCFormatter``, shown below::" msgstr "" -#: howto/logging-cookbook.rst:3256 +#: howto/logging-cookbook.rst:3253 msgid "" "import logging\n" "import time\n" @@ -4059,7 +4057,7 @@ msgid "" " converter = time.gmtime" msgstr "" -#: howto/logging-cookbook.rst:3262 +#: howto/logging-cookbook.rst:3259 msgid "" "and you can then use the ``UTCFormatter`` in your code instead of :class:" "`~logging.Formatter`. If you want to do that via configuration, you can use " @@ -4067,7 +4065,7 @@ msgid "" "the following complete example::" msgstr "" -#: howto/logging-cookbook.rst:3267 +#: howto/logging-cookbook.rst:3264 msgid "" "import logging\n" "import logging.config\n" @@ -4108,27 +4106,27 @@ msgid "" " logging.warning('The local time is %s', time.asctime())" msgstr "" -#: howto/logging-cookbook.rst:3305 +#: howto/logging-cookbook.rst:3302 msgid "When this script is run, it should print something like:" msgstr "" -#: howto/logging-cookbook.rst:3307 +#: howto/logging-cookbook.rst:3304 msgid "" "2015-10-17 12:53:29,501 The local time is Sat Oct 17 13:53:29 2015\n" "2015-10-17 13:53:29,501 The local time is Sat Oct 17 13:53:29 2015" msgstr "" -#: howto/logging-cookbook.rst:3312 +#: howto/logging-cookbook.rst:3309 msgid "" "showing how the time is formatted both as local time and UTC, one for each " "handler." msgstr "" -#: howto/logging-cookbook.rst:3319 +#: howto/logging-cookbook.rst:3316 msgid "Using a context manager for selective logging" msgstr "" -#: howto/logging-cookbook.rst:3321 +#: howto/logging-cookbook.rst:3318 msgid "" "There are times when it would be useful to temporarily change the logging " "configuration and revert it back after doing something. For this, a context " @@ -4138,7 +4136,7 @@ msgid "" "scope of the context manager::" msgstr "" -#: howto/logging-cookbook.rst:3328 +#: howto/logging-cookbook.rst:3325 msgid "" "import logging\n" "import sys\n" @@ -4167,7 +4165,7 @@ msgid "" " # implicit return of None => don't swallow exceptions" msgstr "" -#: howto/logging-cookbook.rst:3354 +#: howto/logging-cookbook.rst:3351 msgid "" "If you specify a level value, the logger's level is set to that value in the " "scope of the with block covered by the context manager. If you specify a " @@ -4176,13 +4174,13 @@ msgid "" "block exit - you could do this if you don't need the handler any more." msgstr "" -#: howto/logging-cookbook.rst:3360 +#: howto/logging-cookbook.rst:3357 msgid "" "To illustrate how it works, we can add the following block of code to the " "above::" msgstr "" -#: howto/logging-cookbook.rst:3363 +#: howto/logging-cookbook.rst:3360 msgid "" "if __name__ == '__main__':\n" " logger = logging.getLogger('foo')\n" @@ -4202,7 +4200,7 @@ msgid "" " logger.debug('7. This should not appear.')" msgstr "" -#: howto/logging-cookbook.rst:3378 +#: howto/logging-cookbook.rst:3375 msgid "" "We initially set the logger's level to ``INFO``, so message #1 appears and " "message #2 doesn't. We then change the level to ``DEBUG`` temporarily in the " @@ -4215,11 +4213,11 @@ msgid "" "(like message #1) whereas message #7 doesn't (just like message #2)." msgstr "" -#: howto/logging-cookbook.rst:3388 +#: howto/logging-cookbook.rst:3385 msgid "If we run the resulting script, the result is as follows:" msgstr "" -#: howto/logging-cookbook.rst:3390 +#: howto/logging-cookbook.rst:3387 msgid "" "$ python logctx.py\n" "1. This should appear just once on stderr.\n" @@ -4229,23 +4227,23 @@ msgid "" "6. This should appear just once on stderr." msgstr "" -#: howto/logging-cookbook.rst:3399 +#: howto/logging-cookbook.rst:3396 msgid "" "If we run it again, but pipe ``stderr`` to ``/dev/null``, we see the " "following, which is the only message written to ``stdout``:" msgstr "" -#: howto/logging-cookbook.rst:3402 +#: howto/logging-cookbook.rst:3399 msgid "" "$ python logctx.py 2>/dev/null\n" "5. This should appear twice - once on stderr and once on stdout." msgstr "" -#: howto/logging-cookbook.rst:3407 +#: howto/logging-cookbook.rst:3404 msgid "Once again, but piping ``stdout`` to ``/dev/null``, we get:" msgstr "" -#: howto/logging-cookbook.rst:3409 +#: howto/logging-cookbook.rst:3406 msgid "" "$ python logctx.py >/dev/null\n" "1. This should appear just once on stderr.\n" @@ -4254,42 +4252,42 @@ msgid "" "6. This should appear just once on stderr." msgstr "" -#: howto/logging-cookbook.rst:3417 +#: howto/logging-cookbook.rst:3414 msgid "" "In this case, the message #5 printed to ``stdout`` doesn't appear, as " "expected." msgstr "" -#: howto/logging-cookbook.rst:3419 +#: howto/logging-cookbook.rst:3416 msgid "" "Of course, the approach described here can be generalised, for example to " "attach logging filters temporarily. Note that the above code works in Python " "2 as well as Python 3." msgstr "" -#: howto/logging-cookbook.rst:3427 +#: howto/logging-cookbook.rst:3424 msgid "A CLI application starter template" msgstr "" -#: howto/logging-cookbook.rst:3429 +#: howto/logging-cookbook.rst:3426 msgid "Here's an example which shows how you can:" msgstr "" -#: howto/logging-cookbook.rst:3431 +#: howto/logging-cookbook.rst:3428 msgid "Use a logging level based on command-line arguments" msgstr "" -#: howto/logging-cookbook.rst:3432 +#: howto/logging-cookbook.rst:3429 msgid "" "Dispatch to multiple subcommands in separate files, all logging at the same " "level in a consistent way" msgstr "" -#: howto/logging-cookbook.rst:3434 +#: howto/logging-cookbook.rst:3431 msgid "Make use of simple, minimal configuration" msgstr "" -#: howto/logging-cookbook.rst:3436 +#: howto/logging-cookbook.rst:3433 msgid "" "Suppose we have a command-line application whose job is to stop, start or " "restart some services. This could be organised for the purposes of " @@ -4300,7 +4298,7 @@ msgid "" "``logging.INFO``. Here's one way that ``app.py`` could be written::" msgstr "" -#: howto/logging-cookbook.rst:3444 +#: howto/logging-cookbook.rst:3441 msgid "" "import argparse\n" "import importlib\n" @@ -4347,13 +4345,13 @@ msgid "" " sys.exit(main())" msgstr "" -#: howto/logging-cookbook.rst:3485 +#: howto/logging-cookbook.rst:3482 msgid "" "And the ``start``, ``stop`` and ``restart`` commands can be implemented in " "separate modules, like so for starting::" msgstr "" -#: howto/logging-cookbook.rst:3488 +#: howto/logging-cookbook.rst:3485 msgid "" "# start.py\n" "import logging\n" @@ -4366,11 +4364,11 @@ msgid "" " logger.info('Started the \\'%s\\' service.', options.name)" msgstr "" -#: howto/logging-cookbook.rst:3498 +#: howto/logging-cookbook.rst:3495 msgid "and thus for stopping::" msgstr "" -#: howto/logging-cookbook.rst:3500 +#: howto/logging-cookbook.rst:3497 msgid "" "# stop.py\n" "import logging\n" @@ -4392,11 +4390,11 @@ msgid "" " logger.info('Stopped the %s service%s.', services, plural)" msgstr "" -#: howto/logging-cookbook.rst:3519 +#: howto/logging-cookbook.rst:3516 msgid "and similarly for restarting::" msgstr "" -#: howto/logging-cookbook.rst:3521 +#: howto/logging-cookbook.rst:3518 msgid "" "# restart.py\n" "import logging\n" @@ -4418,13 +4416,13 @@ msgid "" " logger.info('Restarted the %s service%s.', services, plural)" msgstr "" -#: howto/logging-cookbook.rst:3540 +#: howto/logging-cookbook.rst:3537 msgid "" "If we run this application with the default log level, we get output like " "this:" msgstr "" -#: howto/logging-cookbook.rst:3542 +#: howto/logging-cookbook.rst:3539 msgid "" "$ python app.py start foo\n" "INFO start Started the 'foo' service.\n" @@ -4436,19 +4434,19 @@ msgid "" "INFO restart Restarted the 'foo', 'bar' and 'baz' services." msgstr "" -#: howto/logging-cookbook.rst:3553 +#: howto/logging-cookbook.rst:3550 msgid "" "The first word is the logging level, and the second word is the module or " "package name of the place where the event was logged." msgstr "" -#: howto/logging-cookbook.rst:3556 +#: howto/logging-cookbook.rst:3553 msgid "" "If we change the logging level, then we can change the information sent to " "the log. For example, if we want more information:" msgstr "" -#: howto/logging-cookbook.rst:3559 +#: howto/logging-cookbook.rst:3556 msgid "" "$ python app.py --log-level DEBUG start foo\n" "DEBUG start About to start foo\n" @@ -4463,28 +4461,28 @@ msgid "" "INFO restart Restarted the 'foo', 'bar' and 'baz' services." msgstr "" -#: howto/logging-cookbook.rst:3573 +#: howto/logging-cookbook.rst:3570 msgid "And if we want less:" msgstr "" -#: howto/logging-cookbook.rst:3575 +#: howto/logging-cookbook.rst:3572 msgid "" "$ python app.py --log-level WARNING start foo\n" "$ python app.py --log-level WARNING stop foo bar\n" "$ python app.py --log-level WARNING restart foo bar baz" msgstr "" -#: howto/logging-cookbook.rst:3581 +#: howto/logging-cookbook.rst:3578 msgid "" "In this case, the commands don't print anything to the console, since " "nothing at ``WARNING`` level or above is logged by them." msgstr "" -#: howto/logging-cookbook.rst:3587 +#: howto/logging-cookbook.rst:3584 msgid "A Qt GUI for logging" msgstr "" -#: howto/logging-cookbook.rst:3589 +#: howto/logging-cookbook.rst:3586 msgid "" "A question that comes up from time to time is about how to log to a GUI " "application. The `Qt `_ framework is a popular cross-" @@ -4492,7 +4490,7 @@ msgid "" "`PyQt5` libraries." msgstr "" -#: howto/logging-cookbook.rst:3594 +#: howto/logging-cookbook.rst:3591 msgid "" "The following example shows how to log to a Qt GUI. This introduces a simple " "``QtHandler`` class which takes a callable, which should be a slot in the " @@ -4502,14 +4500,14 @@ msgid "" "logging messages at random levels with random short delays in between)." msgstr "" -#: howto/logging-cookbook.rst:3601 +#: howto/logging-cookbook.rst:3598 msgid "" "The worker thread is implemented using Qt's ``QThread`` class rather than " "the :mod:`threading` module, as there are circumstances where one has to use " "``QThread``, which offers better integration with other ``Qt`` components." msgstr "" -#: howto/logging-cookbook.rst:3605 +#: howto/logging-cookbook.rst:3602 msgid "" "The code should work with recent releases of any of ``PySide6``, ``PyQt6``, " "``PySide2`` or ``PyQt5``. You should be able to adapt the approach to " @@ -4517,7 +4515,7 @@ msgid "" "more detailed information." msgstr "" -#: howto/logging-cookbook.rst:3610 +#: howto/logging-cookbook.rst:3607 msgid "" "import datetime\n" "import logging\n" @@ -4768,11 +4766,11 @@ msgid "" " main()" msgstr "" -#: howto/logging-cookbook.rst:3842 +#: howto/logging-cookbook.rst:3839 msgid "Logging to syslog with RFC5424 support" msgstr "" -#: howto/logging-cookbook.rst:3844 +#: howto/logging-cookbook.rst:3841 msgid "" "Although :rfc:`5424` dates from 2009, most syslog servers are configured by " "default to use the older :rfc:`3164`, which hails from 2001. When " @@ -4782,14 +4780,14 @@ msgid "" "handlers.SysLogHandler` functionality has not been updated." msgstr "" -#: howto/logging-cookbook.rst:3851 +#: howto/logging-cookbook.rst:3848 msgid "" "RFC 5424 contains some useful features such as support for structured data, " "and if you need to be able to log to a syslog server with support for it, " "you can do so with a subclassed handler which looks something like this::" msgstr "" -#: howto/logging-cookbook.rst:3855 +#: howto/logging-cookbook.rst:3852 msgid "" "import datetime\n" "import logging.handlers\n" @@ -4859,7 +4857,7 @@ msgid "" "{sdata} {msg}'" msgstr "" -#: howto/logging-cookbook.rst:3917 +#: howto/logging-cookbook.rst:3914 msgid "" "You'll need to be familiar with RFC 5424 to fully understand the above code, " "and it may be that you have slightly different needs (e.g. for how you pass " @@ -4868,7 +4866,7 @@ msgid "" "using something like this::" msgstr "" -#: howto/logging-cookbook.rst:3922 +#: howto/logging-cookbook.rst:3919 msgid "" "sd = {\n" " 'foo@12345': {'bar': 'baz', 'baz': 'bozz', 'fizz': r'buzz'},\n" @@ -4879,11 +4877,11 @@ msgid "" "logger.debug('Message %d', i, extra=extra)" msgstr "" -#: howto/logging-cookbook.rst:3931 +#: howto/logging-cookbook.rst:3928 msgid "How to treat a logger like an output stream" msgstr "" -#: howto/logging-cookbook.rst:3933 +#: howto/logging-cookbook.rst:3930 msgid "" "Sometimes, you need to interface to a third-party API which expects a file-" "like object to write to, but you want to direct the API's output to a " @@ -4891,7 +4889,7 @@ msgid "" "API. Here's a short script illustrating such a class:" msgstr "" -#: howto/logging-cookbook.rst:3938 +#: howto/logging-cookbook.rst:3935 msgid "" "import logging\n" "\n" @@ -4929,23 +4927,23 @@ msgid "" " main()" msgstr "" -#: howto/logging-cookbook.rst:3973 +#: howto/logging-cookbook.rst:3970 msgid "When this script is run, it prints" msgstr "" -#: howto/logging-cookbook.rst:3975 +#: howto/logging-cookbook.rst:3972 msgid "" "INFO:demo:An INFO message\n" "DEBUG:demo:A DEBUG message" msgstr "" -#: howto/logging-cookbook.rst:3980 +#: howto/logging-cookbook.rst:3977 msgid "" "You could also use ``LoggerWriter`` to redirect ``sys.stdout`` and ``sys." "stderr`` by doing something like this:" msgstr "" -#: howto/logging-cookbook.rst:3983 +#: howto/logging-cookbook.rst:3980 msgid "" "import sys\n" "\n" @@ -4953,7 +4951,7 @@ msgid "" "sys.stderr = LoggerWriter(logger, logging.WARNING)" msgstr "" -#: howto/logging-cookbook.rst:3990 +#: howto/logging-cookbook.rst:3987 msgid "" "You should do this *after* configuring logging for your needs. In the above " "example, the :func:`~logging.basicConfig` call does this (using the ``sys." @@ -4961,7 +4959,7 @@ msgid "" "Then, you'd get this kind of result:" msgstr "" -#: howto/logging-cookbook.rst:3995 +#: howto/logging-cookbook.rst:3992 msgid "" ">>> print('Foo')\n" "INFO:demo:Foo\n" @@ -4970,31 +4968,31 @@ msgid "" ">>>" msgstr "" -#: howto/logging-cookbook.rst:4003 +#: howto/logging-cookbook.rst:4000 msgid "" "Of course, the examples above show output according to the format used by :" "func:`~logging.basicConfig`, but you can use a different formatter when you " "configure logging." msgstr "" -#: howto/logging-cookbook.rst:4007 +#: howto/logging-cookbook.rst:4004 msgid "" "Note that with the above scheme, you are somewhat at the mercy of buffering " "and the sequence of write calls which you are intercepting. For example, " "with the definition of ``LoggerWriter`` above, if you have the snippet" msgstr "" -#: howto/logging-cookbook.rst:4011 +#: howto/logging-cookbook.rst:4008 msgid "" "sys.stderr = LoggerWriter(logger, logging.WARNING)\n" "1 / 0" msgstr "" -#: howto/logging-cookbook.rst:4016 +#: howto/logging-cookbook.rst:4013 msgid "then running the script results in" msgstr "" -#: howto/logging-cookbook.rst:4018 +#: howto/logging-cookbook.rst:4015 msgid "" "WARNING:demo:Traceback (most recent call last):\n" "\n" @@ -5013,7 +5011,7 @@ msgid "" "WARNING:demo:division by zero" msgstr "" -#: howto/logging-cookbook.rst:4034 +#: howto/logging-cookbook.rst:4031 msgid "" "As you can see, this output isn't ideal. That's because the underlying code " "which writes to ``sys.stderr`` makes multiple writes, each of which results " @@ -5023,7 +5021,7 @@ msgid "" "``LoggerWriter``:" msgstr "" -#: howto/logging-cookbook.rst:4040 +#: howto/logging-cookbook.rst:4037 msgid "" "class BufferingLoggerWriter(LoggerWriter):\n" " def __init__(self, logger, level):\n" @@ -5043,13 +5041,13 @@ msgid "" " self.logger.log(self.level, part)" msgstr "" -#: howto/logging-cookbook.rst:4059 +#: howto/logging-cookbook.rst:4056 msgid "" "This just buffers up stuff until a newline is seen, and then logs complete " "lines. With this approach, you get better output:" msgstr "" -#: howto/logging-cookbook.rst:4062 +#: howto/logging-cookbook.rst:4059 msgid "" "WARNING:demo:Traceback (most recent call last):\n" "WARNING:demo: File \"/home/runner/cookbook-loggerwriter/main.py\", line 55, " @@ -5061,11 +5059,11 @@ msgid "" "WARNING:demo:ZeroDivisionError: division by zero" msgstr "" -#: howto/logging-cookbook.rst:4075 +#: howto/logging-cookbook.rst:4072 msgid "Patterns to avoid" msgstr "" -#: howto/logging-cookbook.rst:4077 +#: howto/logging-cookbook.rst:4074 msgid "" "Although the preceding sections have described ways of doing things you " "might need to do or deal with, it is worth mentioning some usage patterns " @@ -5073,11 +5071,11 @@ msgid "" "The following sections are in no particular order." msgstr "" -#: howto/logging-cookbook.rst:4083 +#: howto/logging-cookbook.rst:4080 msgid "Opening the same log file multiple times" msgstr "" -#: howto/logging-cookbook.rst:4085 +#: howto/logging-cookbook.rst:4082 msgid "" "On Windows, you will generally not be able to open the same file multiple " "times as this will lead to a \"file is in use by another process\" error. " @@ -5085,32 +5083,32 @@ msgid "" "file multiple times. This could be done accidentally, for example by:" msgstr "" -#: howto/logging-cookbook.rst:4090 +#: howto/logging-cookbook.rst:4087 msgid "" "Adding a file handler more than once which references the same file (e.g. by " "a copy/paste/forget-to-change error)." msgstr "" -#: howto/logging-cookbook.rst:4093 +#: howto/logging-cookbook.rst:4090 msgid "" "Opening two files that look different, as they have different names, but are " "the same because one is a symbolic link to the other." msgstr "" -#: howto/logging-cookbook.rst:4096 +#: howto/logging-cookbook.rst:4093 msgid "" "Forking a process, following which both parent and child have a reference to " "the same file. This might be through use of the :mod:`multiprocessing` " "module, for example." msgstr "" -#: howto/logging-cookbook.rst:4100 +#: howto/logging-cookbook.rst:4097 msgid "" "Opening a file multiple times might *appear* to work most of the time, but " "can lead to a number of problems in practice:" msgstr "" -#: howto/logging-cookbook.rst:4103 +#: howto/logging-cookbook.rst:4100 msgid "" "Logging output can be garbled because multiple threads or processes try to " "write to the same file. Although logging guards against concurrent use of " @@ -5119,7 +5117,7 @@ msgid "" "different handler instances which happen to point to the same file." msgstr "" -#: howto/logging-cookbook.rst:4109 +#: howto/logging-cookbook.rst:4106 msgid "" "An attempt to delete a file (e.g. during file rotation) silently fails, " "because there is another reference pointing to it. This can lead to " @@ -5129,17 +5127,17 @@ msgid "" "being supposedly in place." msgstr "" -#: howto/logging-cookbook.rst:4116 +#: howto/logging-cookbook.rst:4113 msgid "" "Use the techniques outlined in :ref:`multiple-processes` to circumvent such " "issues." msgstr "" -#: howto/logging-cookbook.rst:4120 +#: howto/logging-cookbook.rst:4117 msgid "Using loggers as attributes in a class or passing them as parameters" msgstr "" -#: howto/logging-cookbook.rst:4122 +#: howto/logging-cookbook.rst:4119 msgid "" "While there might be unusual cases where you'll need to do this, in general " "there is no point because loggers are singletons. Code can always access a " @@ -5150,13 +5148,13 @@ msgid "" "module (and not the class) is the unit of software decomposition." msgstr "" -#: howto/logging-cookbook.rst:4131 +#: howto/logging-cookbook.rst:4128 msgid "" "Adding handlers other than :class:`~logging.NullHandler` to a logger in a " "library" msgstr "" -#: howto/logging-cookbook.rst:4133 +#: howto/logging-cookbook.rst:4130 msgid "" "Configuring logging by adding handlers, formatters and filters is the " "responsibility of the application developer, not the library developer. If " @@ -5164,11 +5162,11 @@ msgid "" "your loggers other than a :class:`~logging.NullHandler` instance." msgstr "" -#: howto/logging-cookbook.rst:4139 +#: howto/logging-cookbook.rst:4136 msgid "Creating a lot of loggers" msgstr "" -#: howto/logging-cookbook.rst:4141 +#: howto/logging-cookbook.rst:4138 msgid "" "Loggers are singletons that are never freed during a script execution, and " "so creating lots of loggers will use up memory which can't then be freed. " @@ -5179,38 +5177,38 @@ msgid "" "occasionally slightly more fine-grained than that)." msgstr "" -#: howto/logging-cookbook.rst:4152 +#: howto/logging-cookbook.rst:4149 msgid "Other resources" msgstr "" -#: howto/logging-cookbook.rst:4156 +#: howto/logging-cookbook.rst:4153 msgid "Module :mod:`logging`" msgstr "" -#: howto/logging-cookbook.rst:4157 +#: howto/logging-cookbook.rst:4154 msgid "API reference for the logging module." msgstr "" -#: howto/logging-cookbook.rst:4159 +#: howto/logging-cookbook.rst:4156 msgid "Module :mod:`logging.config`" msgstr "" -#: howto/logging-cookbook.rst:4160 +#: howto/logging-cookbook.rst:4157 msgid "Configuration API for the logging module." msgstr "" -#: howto/logging-cookbook.rst:4162 +#: howto/logging-cookbook.rst:4159 msgid "Module :mod:`logging.handlers`" msgstr "" -#: howto/logging-cookbook.rst:4163 +#: howto/logging-cookbook.rst:4160 msgid "Useful handlers included with the logging module." msgstr "" -#: howto/logging-cookbook.rst:4165 +#: howto/logging-cookbook.rst:4162 msgid ":ref:`Basic Tutorial `" msgstr "" -#: howto/logging-cookbook.rst:4167 +#: howto/logging-cookbook.rst:4164 msgid ":ref:`Advanced Tutorial `" msgstr "" diff --git a/howto/logging.po b/howto/logging.po index adb7a560..2aa102c4 100644 --- a/howto/logging.po +++ b/howto/logging.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -137,7 +137,7 @@ msgid "" "below (in increasing order of severity):" msgstr "" -#: howto/logging.rst:876 +#: howto/logging.rst:875 msgid "Level" msgstr "" @@ -145,7 +145,7 @@ msgstr "" msgid "When it's used" msgstr "" -#: howto/logging.rst:886 +#: howto/logging.rst:885 msgid "``DEBUG``" msgstr "" @@ -154,7 +154,7 @@ msgid "" "Detailed information, typically of interest only when diagnosing problems." msgstr "" -#: howto/logging.rst:884 +#: howto/logging.rst:883 msgid "``INFO``" msgstr "" @@ -162,7 +162,7 @@ msgstr "" msgid "Confirmation that things are working as expected." msgstr "" -#: howto/logging.rst:882 +#: howto/logging.rst:881 msgid "``WARNING``" msgstr "" @@ -173,7 +173,7 @@ msgid "" "working as expected." msgstr "" -#: howto/logging.rst:880 +#: howto/logging.rst:879 msgid "``ERROR``" msgstr "" @@ -183,7 +183,7 @@ msgid "" "some function." msgstr "" -#: howto/logging.rst:878 +#: howto/logging.rst:877 msgid "``CRITICAL``" msgstr "" @@ -195,42 +195,42 @@ msgstr "" #: howto/logging.rst:97 msgid "" -"The default level is ``WARNING``, which means that only events of this level " -"and above will be tracked, unless the logging package is configured to do " -"otherwise." +"The default level is ``WARNING``, which means that only events of this " +"severity and higher will be tracked, unless the logging package is " +"configured to do otherwise." msgstr "" -#: howto/logging.rst:101 +#: howto/logging.rst:100 msgid "" "Events that are tracked can be handled in different ways. The simplest way " "of handling tracked events is to print them to the console. Another common " "way is to write them to a disk file." msgstr "" -#: howto/logging.rst:109 +#: howto/logging.rst:108 msgid "A simple example" msgstr "" -#: howto/logging.rst:111 +#: howto/logging.rst:110 msgid "A very simple example is::" msgstr "" -#: howto/logging.rst:113 +#: howto/logging.rst:112 msgid "" "import logging\n" "logging.warning('Watch out!') # will print a message to the console\n" "logging.info('I told you so') # will not print anything" msgstr "" -#: howto/logging.rst:117 +#: howto/logging.rst:116 msgid "If you type these lines into a script and run it, you'll see:" msgstr "" -#: howto/logging.rst:119 +#: howto/logging.rst:118 msgid "WARNING:root:Watch out!" msgstr "" -#: howto/logging.rst:123 +#: howto/logging.rst:122 msgid "" "printed out on the console. The ``INFO`` message doesn't appear because the " "default level is ``WARNING``. The printed message includes the indication of " @@ -239,7 +239,7 @@ msgid "" "need that; formatting options will also be explained later." msgstr "" -#: howto/logging.rst:129 +#: howto/logging.rst:128 msgid "" "Notice that in this example, we use functions directly on the ``logging`` " "module, like ``logging.debug``, rather than creating a logger and calling " @@ -251,11 +251,11 @@ msgid "" "methods." msgstr "" -#: howto/logging.rst:138 +#: howto/logging.rst:137 msgid "Logging to a file" msgstr "" -#: howto/logging.rst:140 +#: howto/logging.rst:139 msgid "" "A very common situation is that of recording logging events in a file, so " "let's look at that next. Be sure to try the following in a newly started " @@ -263,7 +263,7 @@ msgid "" "above::" msgstr "" -#: howto/logging.rst:144 +#: howto/logging.rst:143 msgid "" "import logging\n" "logger = logging.getLogger(__name__)\n" @@ -275,7 +275,7 @@ msgid "" "logger.error('And non-ASCII stuff, too, like Øresund and Malmö')" msgstr "" -#: howto/logging.rst:152 +#: howto/logging.rst:151 msgid "" "The *encoding* argument was added. In earlier Python versions, or if not " "specified, the encoding used is the default value used by :func:`open`. " @@ -284,13 +284,13 @@ msgid "" "values and the default, see the documentation for :func:`open`." msgstr "" -#: howto/logging.rst:159 +#: howto/logging.rst:158 msgid "" "And now if we open the file and look at what we have, we should find the log " "messages:" msgstr "" -#: howto/logging.rst:162 +#: howto/logging.rst:161 msgid "" "DEBUG:__main__:This message should go to the log file\n" "INFO:__main__:So should this\n" @@ -298,40 +298,40 @@ msgid "" "ERROR:__main__:And non-ASCII stuff, too, like Øresund and Malmö" msgstr "" -#: howto/logging.rst:169 +#: howto/logging.rst:168 msgid "" "This example also shows how you can set the logging level which acts as the " "threshold for tracking. In this case, because we set the threshold to " "``DEBUG``, all of the messages were printed." msgstr "" -#: howto/logging.rst:173 +#: howto/logging.rst:172 msgid "" "If you want to set the logging level from a command-line option such as:" msgstr "" -#: howto/logging.rst:175 +#: howto/logging.rst:174 msgid "--log=INFO" msgstr "" -#: howto/logging.rst:179 +#: howto/logging.rst:178 msgid "" "and you have the value of the parameter passed for ``--log`` in some " "variable *loglevel*, you can use::" msgstr "" -#: howto/logging.rst:182 +#: howto/logging.rst:181 msgid "getattr(logging, loglevel.upper())" msgstr "" -#: howto/logging.rst:184 +#: howto/logging.rst:183 msgid "" "to get the value which you'll pass to :func:`basicConfig` via the *level* " "argument. You may want to error check any user input value, perhaps as in " "the following example::" msgstr "" -#: howto/logging.rst:188 +#: howto/logging.rst:187 msgid "" "# assuming loglevel is bound to the string value obtained from the\n" "# command line argument. Convert to upper case to allow the user to\n" @@ -342,14 +342,14 @@ msgid "" "logging.basicConfig(level=numeric_level, ...)" msgstr "" -#: howto/logging.rst:196 +#: howto/logging.rst:195 msgid "" "The call to :func:`basicConfig` should come *before* any calls to a logger's " "methods such as :meth:`~Logger.debug`, :meth:`~Logger.info`, etc. Otherwise, " "that logging event may not be handled in the desired manner." msgstr "" -#: howto/logging.rst:200 +#: howto/logging.rst:199 msgid "" "If you run the above script several times, the messages from successive runs " "are appended to the file *example.log*. If you want each run to start " @@ -357,43 +357,43 @@ msgid "" "*filemode* argument, by changing the call in the above example to::" msgstr "" -#: howto/logging.rst:205 +#: howto/logging.rst:204 msgid "" "logging.basicConfig(filename='example.log', filemode='w', level=logging." "DEBUG)" msgstr "" -#: howto/logging.rst:207 +#: howto/logging.rst:206 msgid "" "The output will be the same as before, but the log file is no longer " "appended to, so the messages from earlier runs are lost." msgstr "" -#: howto/logging.rst:212 +#: howto/logging.rst:211 msgid "Logging variable data" msgstr "" -#: howto/logging.rst:214 +#: howto/logging.rst:213 msgid "" "To log variable data, use a format string for the event description message " "and append the variable data as arguments. For example::" msgstr "" -#: howto/logging.rst:217 +#: howto/logging.rst:216 msgid "" "import logging\n" "logging.warning('%s before you %s', 'Look', 'leap!')" msgstr "" -#: howto/logging.rst:220 +#: howto/logging.rst:219 msgid "will display:" msgstr "" -#: howto/logging.rst:222 +#: howto/logging.rst:221 msgid "WARNING:root:Look before you leap!" msgstr "" -#: howto/logging.rst:226 +#: howto/logging.rst:225 msgid "" "As you can see, merging of variable data into the event description message " "uses the old, %-style of string formatting. This is for backwards " @@ -403,17 +403,17 @@ msgid "" "tutorial: see :ref:`formatting-styles` for more information." msgstr "" -#: howto/logging.rst:235 +#: howto/logging.rst:234 msgid "Changing the format of displayed messages" msgstr "" -#: howto/logging.rst:237 +#: howto/logging.rst:236 msgid "" "To change the format which is used to display messages, you need to specify " "the format you want to use::" msgstr "" -#: howto/logging.rst:240 +#: howto/logging.rst:239 msgid "" "import logging\n" "logging.basicConfig(format='%(levelname)s:%(message)s', level=logging." @@ -423,18 +423,18 @@ msgid "" "logging.warning('And this, too')" msgstr "" -#: howto/logging.rst:246 +#: howto/logging.rst:245 msgid "which would print:" msgstr "" -#: howto/logging.rst:248 +#: howto/logging.rst:247 msgid "" "DEBUG:This message should appear on the console\n" "INFO:So should this\n" "WARNING:And this, too" msgstr "" -#: howto/logging.rst:254 +#: howto/logging.rst:253 msgid "" "Notice that the 'root' which appeared in earlier examples has disappeared. " "For a full set of things that can appear in format strings, you can refer to " @@ -444,39 +444,39 @@ msgid "" "This is described in the next section." msgstr "" -#: howto/logging.rst:263 +#: howto/logging.rst:262 msgid "Displaying the date/time in messages" msgstr "" -#: howto/logging.rst:265 +#: howto/logging.rst:264 msgid "" "To display the date and time of an event, you would place '%(asctime)s' in " "your format string::" msgstr "" -#: howto/logging.rst:268 +#: howto/logging.rst:267 msgid "" "import logging\n" "logging.basicConfig(format='%(asctime)s %(message)s')\n" "logging.warning('is when this event was logged.')" msgstr "" -#: howto/logging.rst:272 +#: howto/logging.rst:271 msgid "which should print something like this:" msgstr "" -#: howto/logging.rst:274 +#: howto/logging.rst:273 msgid "2010-12-12 11:41:42,612 is when this event was logged." msgstr "" -#: howto/logging.rst:278 +#: howto/logging.rst:277 msgid "" "The default format for date/time display (shown above) is like ISO8601 or :" "rfc:`3339`. If you need more control over the formatting of the date/time, " "provide a *datefmt* argument to ``basicConfig``, as in this example::" msgstr "" -#: howto/logging.rst:282 +#: howto/logging.rst:281 msgid "" "import logging\n" "logging.basicConfig(format='%(asctime)s %(message)s', datefmt='%m/%d/%Y %I:" @@ -484,25 +484,25 @@ msgid "" "logging.warning('is when this event was logged.')" msgstr "" -#: howto/logging.rst:286 +#: howto/logging.rst:285 msgid "which would display something like this:" msgstr "" -#: howto/logging.rst:288 +#: howto/logging.rst:287 msgid "12/12/2010 11:46:36 AM is when this event was logged." msgstr "" -#: howto/logging.rst:292 +#: howto/logging.rst:291 msgid "" "The format of the *datefmt* argument is the same as supported by :func:`time." "strftime`." msgstr "" -#: howto/logging.rst:297 +#: howto/logging.rst:296 msgid "Next Steps" msgstr "" -#: howto/logging.rst:299 +#: howto/logging.rst:298 msgid "" "That concludes the basic tutorial. It should be enough to get you up and " "running with logging. There's a lot more that the logging package offers, " @@ -511,7 +511,7 @@ msgid "" "of your favourite beverage and carry on." msgstr "" -#: howto/logging.rst:305 +#: howto/logging.rst:304 msgid "" "If your logging needs are simple, then use the above examples to incorporate " "logging into your own scripts, and if you run into problems or don't " @@ -520,50 +520,50 @@ msgid "" "should receive help before too long." msgstr "" -#: howto/logging.rst:311 +#: howto/logging.rst:310 msgid "" "Still here? You can carry on reading the next few sections, which provide a " "slightly more advanced/in-depth tutorial than the basic one above. After " "that, you can take a look at the :ref:`logging-cookbook`." msgstr "" -#: howto/logging.rst:319 +#: howto/logging.rst:318 msgid "Advanced Logging Tutorial" msgstr "" -#: howto/logging.rst:321 +#: howto/logging.rst:320 msgid "" "The logging library takes a modular approach and offers several categories " "of components: loggers, handlers, filters, and formatters." msgstr "" -#: howto/logging.rst:324 +#: howto/logging.rst:323 msgid "Loggers expose the interface that application code directly uses." msgstr "" -#: howto/logging.rst:325 +#: howto/logging.rst:324 msgid "" "Handlers send the log records (created by loggers) to the appropriate " "destination." msgstr "" -#: howto/logging.rst:327 +#: howto/logging.rst:326 msgid "" "Filters provide a finer grained facility for determining which log records " "to output." msgstr "" -#: howto/logging.rst:329 +#: howto/logging.rst:328 msgid "Formatters specify the layout of log records in the final output." msgstr "" -#: howto/logging.rst:331 +#: howto/logging.rst:330 msgid "" "Log event information is passed between loggers, handlers, filters and " "formatters in a :class:`LogRecord` instance." msgstr "" -#: howto/logging.rst:334 +#: howto/logging.rst:333 msgid "" "Logging is performed by calling methods on instances of the :class:`Logger` " "class (hereafter called :dfn:`loggers`). Each instance has a name, and they " @@ -574,23 +574,23 @@ msgid "" "originates." msgstr "" -#: howto/logging.rst:341 +#: howto/logging.rst:340 msgid "" "A good convention to use when naming loggers is to use a module-level " "logger, in each module which uses logging, named as follows::" msgstr "" -#: howto/logging.rst:344 +#: howto/logging.rst:343 msgid "logger = logging.getLogger(__name__)" msgstr "" -#: howto/logging.rst:346 +#: howto/logging.rst:345 msgid "" "This means that logger names track the package/module hierarchy, and it's " "intuitively obvious where events are logged just from the logger name." msgstr "" -#: howto/logging.rst:349 +#: howto/logging.rst:348 msgid "" "The root of the hierarchy of loggers is called the root logger. That's the " "logger used by the functions :func:`debug`, :func:`info`, :func:`warning`, :" @@ -599,7 +599,7 @@ msgid "" "root logger's name is printed as 'root' in the logged output." msgstr "" -#: howto/logging.rst:355 +#: howto/logging.rst:354 msgid "" "It is, of course, possible to log messages to different destinations. " "Support is included in the package for writing log messages to files, HTTP " @@ -610,7 +610,7 @@ msgid "" "built-in handler classes." msgstr "" -#: howto/logging.rst:362 +#: howto/logging.rst:361 msgid "" "By default, no destination is set for any logging messages. You can specify " "a destination (such as console or file) by using :func:`basicConfig` as in " @@ -622,36 +622,36 @@ msgid "" "message output." msgstr "" -#: howto/logging.rst:370 +#: howto/logging.rst:369 msgid "The default format set by :func:`basicConfig` for messages is:" msgstr "" -#: howto/logging.rst:372 +#: howto/logging.rst:371 msgid "severity:logger name:message" msgstr "" -#: howto/logging.rst:376 +#: howto/logging.rst:375 msgid "" "You can change this by passing a format string to :func:`basicConfig` with " "the *format* keyword argument. For all options regarding how a format string " "is constructed, see :ref:`formatter-objects`." msgstr "" -#: howto/logging.rst:381 +#: howto/logging.rst:380 msgid "Logging Flow" msgstr "" -#: howto/logging.rst:383 +#: howto/logging.rst:382 msgid "" "The flow of log event information in loggers and handlers is illustrated in " "the following diagram." msgstr "" -#: howto/logging.rst:434 +#: howto/logging.rst:433 msgid "Loggers" msgstr "" -#: howto/logging.rst:436 +#: howto/logging.rst:435 msgid "" ":class:`Logger` objects have a threefold job. First, they expose several " "methods to application code so that applications can log messages at " @@ -661,17 +661,17 @@ msgid "" "handlers." msgstr "" -#: howto/logging.rst:442 +#: howto/logging.rst:441 msgid "" "The most widely used methods on logger objects fall into two categories: " "configuration and message sending." msgstr "" -#: howto/logging.rst:445 +#: howto/logging.rst:444 msgid "These are the most common configuration methods:" msgstr "" -#: howto/logging.rst:447 +#: howto/logging.rst:446 msgid "" ":meth:`Logger.setLevel` specifies the lowest-severity log message a logger " "will handle, where debug is the lowest built-in severity level and critical " @@ -680,32 +680,32 @@ msgid "" "messages and will ignore DEBUG messages." msgstr "" -#: howto/logging.rst:453 +#: howto/logging.rst:452 msgid "" ":meth:`Logger.addHandler` and :meth:`Logger.removeHandler` add and remove " "handler objects from the logger object. Handlers are covered in more detail " "in :ref:`handler-basic`." msgstr "" -#: howto/logging.rst:457 +#: howto/logging.rst:456 msgid "" ":meth:`Logger.addFilter` and :meth:`Logger.removeFilter` add and remove " "filter objects from the logger object. Filters are covered in more detail " "in :ref:`filter`." msgstr "" -#: howto/logging.rst:461 +#: howto/logging.rst:460 msgid "" "You don't need to always call these methods on every logger you create. See " "the last two paragraphs in this section." msgstr "" -#: howto/logging.rst:464 +#: howto/logging.rst:463 msgid "" "With the logger object configured, the following methods create log messages:" msgstr "" -#: howto/logging.rst:466 +#: howto/logging.rst:465 msgid "" ":meth:`Logger.debug`, :meth:`Logger.info`, :meth:`Logger.warning`, :meth:" "`Logger.error`, and :meth:`Logger.critical` all create log records with a " @@ -718,14 +718,14 @@ msgid "" "exception information." msgstr "" -#: howto/logging.rst:476 +#: howto/logging.rst:475 msgid "" ":meth:`Logger.exception` creates a log message similar to :meth:`Logger." "error`. The difference is that :meth:`Logger.exception` dumps a stack trace " "along with it. Call this method only from an exception handler." msgstr "" -#: howto/logging.rst:480 +#: howto/logging.rst:479 msgid "" ":meth:`Logger.log` takes a log level as an explicit argument. This is a " "little more verbose for logging messages than using the log level " @@ -733,7 +733,7 @@ msgid "" "levels." msgstr "" -#: howto/logging.rst:484 +#: howto/logging.rst:483 msgid "" ":func:`getLogger` returns a reference to a logger instance with the " "specified name if it is provided, or ``root`` if not. The names are period-" @@ -745,7 +745,7 @@ msgid "" "descendants of ``foo``." msgstr "" -#: howto/logging.rst:492 +#: howto/logging.rst:491 msgid "" "Loggers have a concept of *effective level*. If a level is not explicitly " "set on a logger, the level of its parent is used instead as its effective " @@ -757,7 +757,7 @@ msgid "" "handlers." msgstr "" -#: howto/logging.rst:500 +#: howto/logging.rst:499 msgid "" "Child loggers propagate messages up to the handlers associated with their " "ancestor loggers. Because of this, it is unnecessary to define and configure " @@ -767,11 +767,11 @@ msgid "" "attribute of a logger to ``False``.)" msgstr "" -#: howto/logging.rst:511 +#: howto/logging.rst:510 msgid "Handlers" msgstr "" -#: howto/logging.rst:513 +#: howto/logging.rst:512 msgid "" ":class:`~logging.Handler` objects are responsible for dispatching the " "appropriate log messages (based on the log messages' severity) to the " @@ -784,14 +784,14 @@ msgid "" "of a specific severity to a specific location." msgstr "" -#: howto/logging.rst:523 +#: howto/logging.rst:522 msgid "" "The standard library includes quite a few handler types (see :ref:`useful-" "handlers`); the tutorials use mainly :class:`StreamHandler` and :class:" "`FileHandler` in its examples." msgstr "" -#: howto/logging.rst:527 +#: howto/logging.rst:526 msgid "" "There are very few methods in a handler for application developers to " "concern themselves with. The only handler methods that seem relevant for " @@ -799,7 +799,7 @@ msgid "" "not creating custom handlers) are the following configuration methods:" msgstr "" -#: howto/logging.rst:532 +#: howto/logging.rst:531 msgid "" "The :meth:`~Handler.setLevel` method, just as in logger objects, specifies " "the lowest severity that will be dispatched to the appropriate destination. " @@ -809,19 +809,19 @@ msgid "" "send on." msgstr "" -#: howto/logging.rst:538 +#: howto/logging.rst:537 msgid "" ":meth:`~Handler.setFormatter` selects a Formatter object for this handler to " "use." msgstr "" -#: howto/logging.rst:541 +#: howto/logging.rst:540 msgid "" ":meth:`~Handler.addFilter` and :meth:`~Handler.removeFilter` respectively " "configure and deconfigure filter objects on handlers." msgstr "" -#: howto/logging.rst:544 +#: howto/logging.rst:543 msgid "" "Application code should not directly instantiate and use instances of :class:" "`Handler`. Instead, the :class:`Handler` class is a base class that defines " @@ -829,11 +829,11 @@ msgid "" "behavior that child classes can use (or override)." msgstr "" -#: howto/logging.rst:551 +#: howto/logging.rst:550 msgid "Formatters" msgstr "" -#: howto/logging.rst:553 +#: howto/logging.rst:552 msgid "" "Formatter objects configure the final order, structure, and contents of the " "log message. Unlike the base :class:`logging.Handler` class, application " @@ -843,24 +843,24 @@ msgid "" "string and a style indicator." msgstr "" -#: howto/logging.rst:562 +#: howto/logging.rst:561 msgid "" "If there is no message format string, the default is to use the raw " "message. If there is no date format string, the default date format is:" msgstr "" -#: howto/logging.rst:565 +#: howto/logging.rst:564 msgid "%Y-%m-%d %H:%M:%S" msgstr "" -#: howto/logging.rst:569 +#: howto/logging.rst:568 msgid "" "with the milliseconds tacked on at the end. The ``style`` is one of ``'%'``, " "``'{'``, or ``'$'``. If one of these is not specified, then ``'%'`` will be " "used." msgstr "" -#: howto/logging.rst:572 +#: howto/logging.rst:571 msgid "" "If the ``style`` is ``'%'``, the message format string uses ``%()s`` styled string substitution; the possible keys are documented in :" @@ -870,22 +870,22 @@ msgid "" "should conform to what is expected by :meth:`string.Template.substitute`." msgstr "" -#: howto/logging.rst:579 +#: howto/logging.rst:578 msgid "Added the ``style`` parameter." msgstr "" -#: howto/logging.rst:582 +#: howto/logging.rst:581 msgid "" "The following message format string will log the time in a human-readable " "format, the severity of the message, and the contents of the message, in " "that order::" msgstr "" -#: howto/logging.rst:586 +#: howto/logging.rst:585 msgid "'%(asctime)s - %(levelname)s - %(message)s'" msgstr "" -#: howto/logging.rst:588 +#: howto/logging.rst:587 msgid "" "Formatters use a user-configurable function to convert the creation time of " "a record to a tuple. By default, :func:`time.localtime` is used; to change " @@ -896,40 +896,40 @@ msgid "" "in the Formatter class (to ``time.gmtime`` for GMT display)." msgstr "" -#: howto/logging.rst:598 +#: howto/logging.rst:597 msgid "Configuring Logging" msgstr "" -#: howto/logging.rst:602 +#: howto/logging.rst:601 msgid "Programmers can configure logging in three ways:" msgstr "" -#: howto/logging.rst:604 +#: howto/logging.rst:603 msgid "" "Creating loggers, handlers, and formatters explicitly using Python code that " "calls the configuration methods listed above." msgstr "" -#: howto/logging.rst:606 +#: howto/logging.rst:605 msgid "" "Creating a logging config file and reading it using the :func:`fileConfig` " "function." msgstr "" -#: howto/logging.rst:608 +#: howto/logging.rst:607 msgid "" "Creating a dictionary of configuration information and passing it to the :" "func:`dictConfig` function." msgstr "" -#: howto/logging.rst:611 +#: howto/logging.rst:610 msgid "" "For the reference documentation on the last two options, see :ref:`logging-" "config-api`. The following example configures a very simple logger, a " "console handler, and a simple formatter using Python code::" msgstr "" -#: howto/logging.rst:615 +#: howto/logging.rst:614 msgid "" "import logging\n" "\n" @@ -959,12 +959,12 @@ msgid "" "logger.critical('critical message')" msgstr "" -#: howto/logging.rst:641 +#: howto/logging.rst:640 msgid "" "Running this module from the command line produces the following output:" msgstr "" -#: howto/logging.rst:643 +#: howto/logging.rst:642 msgid "" "$ python simple_logging_module.py\n" "2005-03-19 15:10:26,618 - simple_example - DEBUG - debug message\n" @@ -974,14 +974,14 @@ msgid "" "2005-03-19 15:10:26,773 - simple_example - CRITICAL - critical message" msgstr "" -#: howto/logging.rst:652 +#: howto/logging.rst:651 msgid "" "The following Python module creates a logger, handler, and formatter nearly " "identical to those in the example listed above, with the only difference " "being the names of the objects::" msgstr "" -#: howto/logging.rst:656 +#: howto/logging.rst:655 msgid "" "import logging\n" "import logging.config\n" @@ -999,11 +999,11 @@ msgid "" "logger.critical('critical message')" msgstr "" -#: howto/logging.rst:671 +#: howto/logging.rst:670 msgid "Here is the logging.conf file:" msgstr "" -#: howto/logging.rst:673 +#: howto/logging.rst:672 msgid "" "[loggers]\n" "keys=root,simpleExample\n" @@ -1034,12 +1034,12 @@ msgid "" "format=%(asctime)s - %(name)s - %(levelname)s - %(message)s" msgstr "" -#: howto/logging.rst:703 +#: howto/logging.rst:702 msgid "" "The output is nearly identical to that of the non-config-file-based example:" msgstr "" -#: howto/logging.rst:705 +#: howto/logging.rst:704 msgid "" "$ python simple_logging_config.py\n" "2005-03-19 15:38:55,977 - simpleExample - DEBUG - debug message\n" @@ -1049,14 +1049,14 @@ msgid "" "2005-03-19 15:38:56,130 - simpleExample - CRITICAL - critical message" msgstr "" -#: howto/logging.rst:714 +#: howto/logging.rst:713 msgid "" "You can see that the config file approach has a few advantages over the " "Python code approach, mainly separation of configuration and code and the " "ability of noncoders to easily modify the logging properties." msgstr "" -#: howto/logging.rst:718 +#: howto/logging.rst:717 msgid "" "The :func:`fileConfig` function takes a default parameter, " "``disable_existing_loggers``, which defaults to ``True`` for reasons of " @@ -1067,7 +1067,7 @@ msgid "" "information, and specify ``False`` for this parameter if you wish." msgstr "" -#: howto/logging.rst:726 +#: howto/logging.rst:725 msgid "" "The dictionary passed to :func:`dictConfig` can also specify a Boolean value " "with key ``disable_existing_loggers``, which if not specified explicitly in " @@ -1076,7 +1076,7 @@ msgid "" "want - in which case, provide the key explicitly with a value of ``False``." msgstr "" -#: howto/logging.rst:736 +#: howto/logging.rst:735 msgid "" "Note that the class names referenced in config files need to be either " "relative to the logging module, or absolute values which can be resolved " @@ -1087,7 +1087,7 @@ msgid "" "path)." msgstr "" -#: howto/logging.rst:744 +#: howto/logging.rst:743 msgid "" "In Python 3.2, a new means of configuring logging has been introduced, using " "dictionaries to hold configuration information. This provides a superset of " @@ -1102,13 +1102,13 @@ msgid "" "a socket, or use whatever approach makes sense for your application." msgstr "" -#: howto/logging.rst:756 +#: howto/logging.rst:755 msgid "" "Here's an example of the same configuration as above, in YAML format for the " "new dictionary-based approach:" msgstr "" -#: howto/logging.rst:759 +#: howto/logging.rst:758 msgid "" "version: 1\n" "formatters:\n" @@ -1130,24 +1130,24 @@ msgid "" " handlers: [console]" msgstr "" -#: howto/logging.rst:780 +#: howto/logging.rst:779 msgid "" "For more information about logging using a dictionary, see :ref:`logging-" "config-api`." msgstr "" -#: howto/logging.rst:784 +#: howto/logging.rst:783 msgid "What happens if no configuration is provided" msgstr "" -#: howto/logging.rst:786 +#: howto/logging.rst:785 msgid "" "If no logging configuration is provided, it is possible to have a situation " "where a logging event needs to be output, but no handlers can be found to " "output the event." msgstr "" -#: howto/logging.rst:790 +#: howto/logging.rst:789 msgid "" "The event is output using a 'handler of last resort', stored in :data:" "`lastResort`. This internal handler is not associated with any logger, and " @@ -1159,32 +1159,32 @@ msgid "" "severities will be output." msgstr "" -#: howto/logging.rst:801 +#: howto/logging.rst:800 msgid "For versions of Python prior to 3.2, the behaviour is as follows:" msgstr "" -#: howto/logging.rst:803 +#: howto/logging.rst:802 msgid "" "If :data:`raiseExceptions` is ``False`` (production mode), the event is " "silently dropped." msgstr "" -#: howto/logging.rst:806 +#: howto/logging.rst:805 msgid "" "If :data:`raiseExceptions` is ``True`` (development mode), a message 'No " "handlers could be found for logger X.Y.Z' is printed once." msgstr "" -#: howto/logging.rst:809 +#: howto/logging.rst:808 msgid "" "To obtain the pre-3.2 behaviour, :data:`lastResort` can be set to ``None``." msgstr "" -#: howto/logging.rst:815 +#: howto/logging.rst:814 msgid "Configuring Logging for a Library" msgstr "" -#: howto/logging.rst:817 +#: howto/logging.rst:816 msgid "" "When developing a library which uses logging, you should take care to " "document how the library uses logging - for example, the names of loggers " @@ -1195,7 +1195,7 @@ msgid "" "is regarded as the best default behaviour." msgstr "" -#: howto/logging.rst:825 +#: howto/logging.rst:824 msgid "" "If for some reason you *don't* want these messages printed in the absence of " "any logging configuration, you can attach a do-nothing handler to the top-" @@ -1207,7 +1207,7 @@ msgid "" "to those handlers, as normal." msgstr "" -#: howto/logging.rst:834 +#: howto/logging.rst:833 msgid "" "A do-nothing handler is included in the logging package: :class:`~logging." "NullHandler` (since Python 3.1). An instance of this handler could be added " @@ -1218,20 +1218,20 @@ msgid "" "etc. then the code::" msgstr "" -#: howto/logging.rst:842 +#: howto/logging.rst:841 msgid "" "import logging\n" "logging.getLogger('foo').addHandler(logging.NullHandler())" msgstr "" -#: howto/logging.rst:845 +#: howto/logging.rst:844 msgid "" "should have the desired effect. If an organisation produces a number of " "libraries, then the logger name specified can be 'orgname.foo' rather than " "just 'foo'." msgstr "" -#: howto/logging.rst:849 +#: howto/logging.rst:848 msgid "" "It is strongly advised that you *do not log to the root logger* in your " "library. Instead, use a logger with a unique and easily identifiable name, " @@ -1241,7 +1241,7 @@ msgid "" "library as they wish." msgstr "" -#: howto/logging.rst:856 +#: howto/logging.rst:855 msgid "" "It is strongly advised that you *do not add any handlers other than* :class:" "`~logging.NullHandler` *to your library's loggers*. This is because the " @@ -1252,11 +1252,11 @@ msgid "" "carry out unit tests and deliver logs which suit their requirements." msgstr "" -#: howto/logging.rst:867 +#: howto/logging.rst:866 msgid "Logging Levels" msgstr "" -#: howto/logging.rst:869 +#: howto/logging.rst:868 msgid "" "The numeric values of logging levels are given in the following table. These " "are primarily of interest if you want to define your own levels, and need " @@ -1265,39 +1265,39 @@ msgid "" "value; the predefined name is lost." msgstr "" -#: howto/logging.rst:876 +#: howto/logging.rst:875 msgid "Numeric value" msgstr "" -#: howto/logging.rst:878 +#: howto/logging.rst:877 msgid "50" msgstr "" -#: howto/logging.rst:880 +#: howto/logging.rst:879 msgid "40" msgstr "" -#: howto/logging.rst:882 +#: howto/logging.rst:881 msgid "30" msgstr "" -#: howto/logging.rst:884 +#: howto/logging.rst:883 msgid "20" msgstr "" -#: howto/logging.rst:886 +#: howto/logging.rst:885 msgid "10" msgstr "" -#: howto/logging.rst:888 +#: howto/logging.rst:887 msgid "``NOTSET``" msgstr "" -#: howto/logging.rst:888 +#: howto/logging.rst:887 msgid "0" msgstr "" -#: howto/logging.rst:891 +#: howto/logging.rst:890 msgid "" "Levels can also be associated with loggers, being set either by the " "developer or through loading a saved logging configuration. When a logging " @@ -1307,14 +1307,14 @@ msgid "" "basic mechanism controlling the verbosity of logging output." msgstr "" -#: howto/logging.rst:898 +#: howto/logging.rst:897 msgid "" "Logging messages are encoded as instances of the :class:`~logging.LogRecord` " "class. When a logger decides to actually log an event, a :class:`~logging." "LogRecord` instance is created from the logging message." msgstr "" -#: howto/logging.rst:902 +#: howto/logging.rst:901 msgid "" "Logging messages are subjected to a dispatch mechanism through the use of :" "dfn:`handlers`, which are instances of subclasses of the :class:`Handler` " @@ -1331,7 +1331,7 @@ msgid "" "at which point the passing to ancestor handlers stops)." msgstr "" -#: howto/logging.rst:916 +#: howto/logging.rst:915 msgid "" "Just as for loggers, handlers can have levels associated with them. A " "handler's level acts as a filter in the same way as a logger's level does. " @@ -1341,11 +1341,11 @@ msgid "" "`~Handler.emit`." msgstr "" -#: howto/logging.rst:925 +#: howto/logging.rst:924 msgid "Custom Levels" msgstr "" -#: howto/logging.rst:927 +#: howto/logging.rst:926 msgid "" "Defining your own levels is possible, but should not be necessary, as the " "existing levels have been chosen on the basis of practical experience. " @@ -1358,27 +1358,27 @@ msgid "" "given numeric value might mean different things for different libraries." msgstr "" -#: howto/logging.rst:940 +#: howto/logging.rst:939 msgid "Useful Handlers" msgstr "" -#: howto/logging.rst:942 +#: howto/logging.rst:941 msgid "" "In addition to the base :class:`Handler` class, many useful subclasses are " "provided:" msgstr "" -#: howto/logging.rst:945 +#: howto/logging.rst:944 msgid "" ":class:`StreamHandler` instances send messages to streams (file-like " "objects)." msgstr "" -#: howto/logging.rst:948 +#: howto/logging.rst:947 msgid ":class:`FileHandler` instances send messages to disk files." msgstr "" -#: howto/logging.rst:950 +#: howto/logging.rst:949 msgid "" ":class:`~handlers.BaseRotatingHandler` is the base class for handlers that " "rotate log files at a certain point. It is not meant to be instantiated " @@ -1386,61 +1386,61 @@ msgid "" "`~handlers.TimedRotatingFileHandler`." msgstr "" -#: howto/logging.rst:955 +#: howto/logging.rst:954 msgid "" ":class:`~handlers.RotatingFileHandler` instances send messages to disk " "files, with support for maximum log file sizes and log file rotation." msgstr "" -#: howto/logging.rst:958 +#: howto/logging.rst:957 msgid "" ":class:`~handlers.TimedRotatingFileHandler` instances send messages to disk " "files, rotating the log file at certain timed intervals." msgstr "" -#: howto/logging.rst:961 +#: howto/logging.rst:960 msgid "" ":class:`~handlers.SocketHandler` instances send messages to TCP/IP sockets. " "Since 3.4, Unix domain sockets are also supported." msgstr "" -#: howto/logging.rst:964 +#: howto/logging.rst:963 msgid "" ":class:`~handlers.DatagramHandler` instances send messages to UDP sockets. " "Since 3.4, Unix domain sockets are also supported." msgstr "" -#: howto/logging.rst:967 +#: howto/logging.rst:966 msgid "" ":class:`~handlers.SMTPHandler` instances send messages to a designated email " "address." msgstr "" -#: howto/logging.rst:970 +#: howto/logging.rst:969 msgid "" ":class:`~handlers.SysLogHandler` instances send messages to a Unix syslog " "daemon, possibly on a remote machine." msgstr "" -#: howto/logging.rst:973 +#: howto/logging.rst:972 msgid "" ":class:`~handlers.NTEventLogHandler` instances send messages to a Windows " "NT/2000/XP event log." msgstr "" -#: howto/logging.rst:976 +#: howto/logging.rst:975 msgid "" ":class:`~handlers.MemoryHandler` instances send messages to a buffer in " "memory, which is flushed whenever specific criteria are met." msgstr "" -#: howto/logging.rst:979 +#: howto/logging.rst:978 msgid "" ":class:`~handlers.HTTPHandler` instances send messages to an HTTP server " "using either ``GET`` or ``POST`` semantics." msgstr "" -#: howto/logging.rst:982 +#: howto/logging.rst:981 msgid "" ":class:`~handlers.WatchedFileHandler` instances watch the file they are " "logging to. If the file changes, it is closed and reopened using the file " @@ -1448,13 +1448,13 @@ msgid "" "support the underlying mechanism used." msgstr "" -#: howto/logging.rst:987 +#: howto/logging.rst:986 msgid "" ":class:`~handlers.QueueHandler` instances send messages to a queue, such as " "those implemented in the :mod:`queue` or :mod:`multiprocessing` modules." msgstr "" -#: howto/logging.rst:990 +#: howto/logging.rst:989 msgid "" ":class:`NullHandler` instances do nothing with error messages. They are used " "by library developers who want to use logging, but want to avoid the 'No " @@ -1463,15 +1463,15 @@ msgid "" "more information." msgstr "" -#: howto/logging.rst:996 +#: howto/logging.rst:995 msgid "The :class:`NullHandler` class." msgstr "" -#: howto/logging.rst:999 +#: howto/logging.rst:998 msgid "The :class:`~handlers.QueueHandler` class." msgstr "" -#: howto/logging.rst:1002 +#: howto/logging.rst:1001 msgid "" "The :class:`NullHandler`, :class:`StreamHandler` and :class:`FileHandler` " "classes are defined in the core logging package. The other handlers are " @@ -1479,14 +1479,14 @@ msgid "" "module, :mod:`logging.config`, for configuration functionality.)" msgstr "" -#: howto/logging.rst:1007 +#: howto/logging.rst:1006 msgid "" "Logged messages are formatted for presentation through instances of the :" "class:`Formatter` class. They are initialized with a format string suitable " "for use with the % operator and a dictionary." msgstr "" -#: howto/logging.rst:1011 +#: howto/logging.rst:1010 msgid "" "For formatting multiple messages in a batch, instances of :class:" "`BufferingFormatter` can be used. In addition to the format string (which is " @@ -1494,7 +1494,7 @@ msgid "" "trailer format strings." msgstr "" -#: howto/logging.rst:1016 +#: howto/logging.rst:1015 msgid "" "When filtering based on logger level and/or handler level is not enough, " "instances of :class:`Filter` can be added to both :class:`Logger` and :class:" @@ -1504,18 +1504,18 @@ msgid "" "value, the message is not processed further." msgstr "" -#: howto/logging.rst:1023 +#: howto/logging.rst:1022 msgid "" "The basic :class:`Filter` functionality allows filtering by specific logger " "name. If this feature is used, messages sent to the named logger and its " "children are allowed through the filter, and all others dropped." msgstr "" -#: howto/logging.rst:1031 +#: howto/logging.rst:1030 msgid "Exceptions raised during logging" msgstr "" -#: howto/logging.rst:1033 +#: howto/logging.rst:1032 msgid "" "The logging package is designed to swallow exceptions which occur while " "logging in production. This is so that errors which occur while handling " @@ -1523,7 +1523,7 @@ msgid "" "errors - do not cause the application using logging to terminate prematurely." msgstr "" -#: howto/logging.rst:1038 +#: howto/logging.rst:1037 msgid "" ":class:`SystemExit` and :class:`KeyboardInterrupt` exceptions are never " "swallowed. Other exceptions which occur during the :meth:`~Handler.emit` " @@ -1531,7 +1531,7 @@ msgid "" "handleError` method." msgstr "" -#: howto/logging.rst:1043 +#: howto/logging.rst:1042 msgid "" "The default implementation of :meth:`~Handler.handleError` in :class:" "`Handler` checks to see if a module-level variable, :data:`raiseExceptions`, " @@ -1539,7 +1539,7 @@ msgid "" "the exception is swallowed." msgstr "" -#: howto/logging.rst:1049 +#: howto/logging.rst:1048 msgid "" "The default value of :data:`raiseExceptions` is ``True``. This is because " "during development, you typically want to be notified of any exceptions that " @@ -1547,11 +1547,11 @@ msgid "" "production usage." msgstr "" -#: howto/logging.rst:1059 +#: howto/logging.rst:1058 msgid "Using arbitrary objects as messages" msgstr "" -#: howto/logging.rst:1061 +#: howto/logging.rst:1060 msgid "" "In the preceding sections and examples, it has been assumed that the message " "passed when logging the event is a string. However, this is not the only " @@ -1563,11 +1563,11 @@ msgid "" "the wire." msgstr "" -#: howto/logging.rst:1072 +#: howto/logging.rst:1071 msgid "Optimization" msgstr "" -#: howto/logging.rst:1074 +#: howto/logging.rst:1073 msgid "" "Formatting of message arguments is deferred until it cannot be avoided. " "However, computing the arguments passed to the logging method can also be " @@ -1578,20 +1578,20 @@ msgid "" "code like this::" msgstr "" -#: howto/logging.rst:1082 +#: howto/logging.rst:1081 msgid "" "if logger.isEnabledFor(logging.DEBUG):\n" " logger.debug('Message with %s, %s', expensive_func1(),\n" " expensive_func2())" msgstr "" -#: howto/logging.rst:1086 +#: howto/logging.rst:1085 msgid "" "so that if the logger's threshold is set above ``DEBUG``, the calls to " "``expensive_func1`` and ``expensive_func2`` are never made." msgstr "" -#: howto/logging.rst:1089 +#: howto/logging.rst:1088 msgid "" "In some cases, :meth:`~Logger.isEnabledFor` can itself be more expensive " "than you'd like (e.g. for deeply nested loggers where an explicit level is " @@ -1603,7 +1603,7 @@ msgid "" "while the application is running (which is not all that common)." msgstr "" -#: howto/logging.rst:1098 +#: howto/logging.rst:1097 msgid "" "There are other optimizations which can be made for specific applications " "which need more precise control over what logging information is collected. " @@ -1611,94 +1611,94 @@ msgid "" "you don't need:" msgstr "" -#: howto/logging.rst:1104 +#: howto/logging.rst:1103 msgid "What you don't want to collect" msgstr "" -#: howto/logging.rst:1104 +#: howto/logging.rst:1103 msgid "How to avoid collecting it" msgstr "" -#: howto/logging.rst:1106 +#: howto/logging.rst:1105 msgid "Information about where calls were made from." msgstr "" -#: howto/logging.rst:1106 +#: howto/logging.rst:1105 msgid "" "Set ``logging._srcfile`` to ``None``. This avoids calling :func:`sys." "_getframe`, which may help to speed up your code in environments like PyPy " "(which can't speed up code that uses :func:`sys._getframe`)." msgstr "" -#: howto/logging.rst:1112 +#: howto/logging.rst:1111 msgid "Threading information." msgstr "" -#: howto/logging.rst:1112 +#: howto/logging.rst:1111 msgid "Set ``logging.logThreads`` to ``False``." msgstr "" -#: howto/logging.rst:1114 +#: howto/logging.rst:1113 msgid "Current process ID (:func:`os.getpid`)" msgstr "" -#: howto/logging.rst:1114 +#: howto/logging.rst:1113 msgid "Set ``logging.logProcesses`` to ``False``." msgstr "" -#: howto/logging.rst:1116 +#: howto/logging.rst:1115 msgid "" "Current process name when using ``multiprocessing`` to manage multiple " "processes." msgstr "" -#: howto/logging.rst:1116 +#: howto/logging.rst:1115 msgid "Set ``logging.logMultiprocessing`` to ``False``." msgstr "" -#: howto/logging.rst:1119 +#: howto/logging.rst:1118 msgid "Current :class:`asyncio.Task` name when using ``asyncio``." msgstr "" -#: howto/logging.rst:1119 +#: howto/logging.rst:1118 msgid "Set ``logging.logAsyncioTasks`` to ``False``." msgstr "" -#: howto/logging.rst:1123 +#: howto/logging.rst:1122 msgid "" "Also note that the core logging module only includes the basic handlers. If " "you don't import :mod:`logging.handlers` and :mod:`logging.config`, they " "won't take up any memory." msgstr "" -#: howto/logging.rst:1130 +#: howto/logging.rst:1129 msgid "Other resources" msgstr "" -#: howto/logging.rst:1134 +#: howto/logging.rst:1133 msgid "Module :mod:`logging`" msgstr "" -#: howto/logging.rst:1135 +#: howto/logging.rst:1134 msgid "API reference for the logging module." msgstr "" -#: howto/logging.rst:1137 +#: howto/logging.rst:1136 msgid "Module :mod:`logging.config`" msgstr "" -#: howto/logging.rst:1138 +#: howto/logging.rst:1137 msgid "Configuration API for the logging module." msgstr "" -#: howto/logging.rst:1140 +#: howto/logging.rst:1139 msgid "Module :mod:`logging.handlers`" msgstr "" -#: howto/logging.rst:1141 +#: howto/logging.rst:1140 msgid "Useful handlers included with the logging module." msgstr "" -#: howto/logging.rst:1143 +#: howto/logging.rst:1142 msgid ":ref:`A logging cookbook `" msgstr "" diff --git a/howto/mro.po b/howto/mro.po index 6f2d128d..b89977d7 100644 --- a/howto/mro.po +++ b/howto/mro.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" diff --git a/howto/perf_profiling.po b/howto/perf_profiling.po index 4c6c8b56..f646772c 100644 --- a/howto/perf_profiling.po +++ b/howto/perf_profiling.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -255,7 +255,8 @@ msgstr "" #: howto/perf_profiling.rst:165 msgid "" -"$ PYTHONPERFSUPPORT=1 python script.py\n" +"$ PYTHONPERFSUPPORT=1 perf record -F 9999 -g -o perf.data python my_script." +"py\n" "$ perf report -g -i perf.data" msgstr "" @@ -265,7 +266,7 @@ msgstr "" #: howto/perf_profiling.rst:170 msgid "" -"$ python -X perf script.py\n" +"$ perf record -F 9999 -g -o perf.data python -X perf my_script.py\n" "$ perf report -g -i perf.data" msgstr "" @@ -290,7 +291,7 @@ msgstr "" #: howto/perf_profiling.rst:187 msgid "" -"$ python ./example.py\n" +"$ perf record -F 9999 -g -o perf.data python ./example.py\n" "$ perf report -g -i perf.data" msgstr "" @@ -323,3 +324,130 @@ msgid "" "compiled with frame pointers and therefore it may not be able to show Python " "functions in the output of ``perf``." msgstr "" + +#: howto/perf_profiling.rst:211 +msgid "How to work without frame pointers" +msgstr "" + +#: howto/perf_profiling.rst:213 +msgid "" +"If you are working with a Python interpreter that has been compiled without " +"frame pointers, you can still use the ``perf`` profiler, but the overhead " +"will be a bit higher because Python needs to generate unwinding information " +"for every Python function call on the fly. Additionally, ``perf`` will take " +"more time to process the data because it will need to use the DWARF " +"debugging information to unwind the stack and this is a slow process." +msgstr "" + +#: howto/perf_profiling.rst:220 +msgid "" +"To enable this mode, you can use the environment variable :envvar:" +"`PYTHON_PERF_JIT_SUPPORT` or the :option:`-X perf_jit <-X>` option, which " +"will enable the JIT mode for the ``perf`` profiler." +msgstr "" + +#: howto/perf_profiling.rst:226 +msgid "" +"Due to a bug in the ``perf`` tool, only ``perf`` versions higher than v6.8 " +"will work with the JIT mode. The fix was also backported to the v6.7.2 " +"version of the tool." +msgstr "" + +#: howto/perf_profiling.rst:230 +msgid "" +"Note that when checking the version of the ``perf`` tool (which can be done " +"by running ``perf version``) you must take into account that some distros " +"add some custom version numbers including a ``-`` character. This means " +"that ``perf 6.7-3`` is not necessarily ``perf 6.7.3``." +msgstr "" + +#: howto/perf_profiling.rst:235 +msgid "" +"When using the perf JIT mode, you need an extra step before you can run " +"``perf report``. You need to call the ``perf inject`` command to inject the " +"JIT information into the ``perf.data`` file.::" +msgstr "" + +#: howto/perf_profiling.rst:239 +msgid "" +"$ perf record -F 9999 -g -k 1 --call-graph dwarf -o perf.data python -" +"Xperf_jit my_script.py\n" +"$ perf inject -i perf.data --jit --output perf.jit.data\n" +"$ perf report -g -i perf.jit.data" +msgstr "" + +#: howto/perf_profiling.rst:243 +msgid "or using the environment variable::" +msgstr "" + +#: howto/perf_profiling.rst:245 +msgid "" +"$ PYTHON_PERF_JIT_SUPPORT=1 perf record -F 9999 -g --call-graph dwarf -o " +"perf.data python my_script.py\n" +"$ perf inject -i perf.data --jit --output perf.jit.data\n" +"$ perf report -g -i perf.jit.data" +msgstr "" + +#: howto/perf_profiling.rst:249 +msgid "" +"``perf inject --jit`` command will read ``perf.data``, automatically pick up " +"the perf dump file that Python creates (in ``/tmp/perf-$PID.dump``), and " +"then create ``perf.jit.data`` which merges all the JIT information together. " +"It should also create a lot of ``jitted-XXXX-N.so`` files in the current " +"directory which are ELF images for all the JIT trampolines that were created " +"by Python." +msgstr "" + +#: howto/perf_profiling.rst:257 +msgid "" +"When using ``--call-graph dwarf``, the ``perf`` tool will take snapshots of " +"the stack of the process being profiled and save the information in the " +"``perf.data`` file. By default, the size of the stack dump is 8192 bytes, " +"but you can change the size by passing it after a comma like ``--call-graph " +"dwarf,16384``." +msgstr "" + +#: howto/perf_profiling.rst:263 +msgid "" +"The size of the stack dump is important because if the size is too small " +"``perf`` will not be able to unwind the stack and the output will be " +"incomplete. On the other hand, if the size is too big, then ``perf`` won't " +"be able to sample the process as frequently as it would like as the overhead " +"will be higher." +msgstr "" + +#: howto/perf_profiling.rst:269 +msgid "" +"The stack size is particularly important when profiling Python code compiled " +"with low optimization levels (like ``-O0``), as these builds tend to have " +"larger stack frames. If you are compiling Python with ``-O0`` and not seeing " +"Python functions in your profiling output, try increasing the stack dump " +"size to 65528 bytes (the maximum)::" +msgstr "" + +#: howto/perf_profiling.rst:275 +msgid "" +"$ perf record -F 9999 -g -k 1 --call-graph dwarf,65528 -o perf.data python -" +"Xperf_jit my_script.py" +msgstr "" + +#: howto/perf_profiling.rst:277 +msgid "Different compilation flags can significantly impact stack sizes:" +msgstr "" + +#: howto/perf_profiling.rst:279 +msgid "" +"Builds with ``-O0`` typically have much larger stack frames than those with " +"``-O1`` or higher" +msgstr "" + +#: howto/perf_profiling.rst:280 +msgid "" +"Adding optimizations (``-O1``, ``-O2``, etc.) typically reduces stack size" +msgstr "" + +#: howto/perf_profiling.rst:281 +msgid "" +"Frame pointers (``-fno-omit-frame-pointer``) generally provide more reliable " +"stack unwinding" +msgstr "" diff --git a/howto/pyporting.po b/howto/pyporting.po index 0223b777..4c7da2ad 100644 --- a/howto/pyporting.po +++ b/howto/pyporting.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: 2024-12-06 13:40+0200\n" "Last-Translator: Marios Giannopoulos \n" "Language-Team: PyGreece \n" diff --git a/howto/regex.po b/howto/regex.po index ae9da180..8d7d858b 100644 --- a/howto/regex.po +++ b/howto/regex.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" diff --git a/howto/sockets.po b/howto/sockets.po index cc37caf7..bc832879 100644 --- a/howto/sockets.po +++ b/howto/sockets.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" diff --git a/howto/sorting.po b/howto/sorting.po index 6143f74b..5d9e1108 100644 --- a/howto/sorting.po +++ b/howto/sorting.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" diff --git a/howto/timerfd.po b/howto/timerfd.po new file mode 100644 index 00000000..014086a6 --- /dev/null +++ b/howto/timerfd.po @@ -0,0 +1,284 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) 2001-2025, Python Software Foundation +# This file is distributed under the same license as the Python package. +# FIRST AUTHOR , YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: Python 3.13\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#: howto/timerfd.rst:5 +msgid "timer file descriptor HOWTO" +msgstr "" + +#: howto/timerfd.rst:0 +msgid "Release" +msgstr "" + +#: howto/timerfd.rst:7 +msgid "1.13" +msgstr "" + +#: howto/timerfd.rst:9 +msgid "" +"This HOWTO discusses Python's support for the linux timer file descriptor." +msgstr "" + +#: howto/timerfd.rst:13 +msgid "Examples" +msgstr "" + +#: howto/timerfd.rst:15 +msgid "" +"The following example shows how to use a timer file descriptor to execute a " +"function twice a second:" +msgstr "" + +#: howto/timerfd.rst:18 +msgid "" +"# Practical scripts should use really use a non-blocking timer,\n" +"# we use a blocking timer here for simplicity.\n" +"import os, time\n" +"\n" +"# Create the timer file descriptor\n" +"fd = os.timerfd_create(time.CLOCK_REALTIME)\n" +"\n" +"# Start the timer in 1 second, with an interval of half a second\n" +"os.timerfd_settime(fd, initial=1, interval=0.5)\n" +"\n" +"try:\n" +" # Process timer events four times.\n" +" for _ in range(4):\n" +" # read() will block until the timer expires\n" +" _ = os.read(fd, 8)\n" +" print(\"Timer expired\")\n" +"finally:\n" +" # Remember to close the timer file descriptor!\n" +" os.close(fd)" +msgstr "" + +#: howto/timerfd.rst:40 +msgid "" +"To avoid the precision loss caused by the :class:`float` type, timer file " +"descriptors allow specifying initial expiration and interval in integer " +"nanoseconds with ``_ns`` variants of the functions." +msgstr "" + +#: howto/timerfd.rst:44 +msgid "" +"This example shows how :func:`~select.epoll` can be used with timer file " +"descriptors to wait until the file descriptor is ready for reading:" +msgstr "" + +#: howto/timerfd.rst:47 +msgid "" +"import os, time, select, socket, sys\n" +"\n" +"# Create an epoll object\n" +"ep = select.epoll()\n" +"\n" +"# In this example, use loopback address to send \"stop\" command to the " +"server.\n" +"#\n" +"# $ telnet 127.0.0.1 1234\n" +"# Trying 127.0.0.1...\n" +"# Connected to 127.0.0.1.\n" +"# Escape character is '^]'.\n" +"# stop\n" +"# Connection closed by foreign host.\n" +"#\n" +"sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)\n" +"sock.bind((\"127.0.0.1\", 1234))\n" +"sock.setblocking(False)\n" +"sock.listen(1)\n" +"ep.register(sock, select.EPOLLIN)\n" +"\n" +"# Create timer file descriptors in non-blocking mode.\n" +"num = 3\n" +"fds = []\n" +"for _ in range(num):\n" +" fd = os.timerfd_create(time.CLOCK_REALTIME, flags=os.TFD_NONBLOCK)\n" +" fds.append(fd)\n" +" # Register the timer file descriptor for read events\n" +" ep.register(fd, select.EPOLLIN)\n" +"\n" +"# Start the timer with os.timerfd_settime_ns() in nanoseconds.\n" +"# Timer 1 fires every 0.25 seconds; timer 2 every 0.5 seconds; etc\n" +"for i, fd in enumerate(fds, start=1):\n" +" one_sec_in_nsec = 10**9\n" +" i = i * one_sec_in_nsec\n" +" os.timerfd_settime_ns(fd, initial=i//4, interval=i//4)\n" +"\n" +"timeout = 3\n" +"try:\n" +" conn = None\n" +" is_active = True\n" +" while is_active:\n" +" # Wait for the timer to expire for 3 seconds.\n" +" # epoll.poll() returns a list of (fd, event) pairs.\n" +" # fd is a file descriptor.\n" +" # sock and conn[=returned value of socket.accept()] are socket " +"objects, not file descriptors.\n" +" # So use sock.fileno() and conn.fileno() to get the file " +"descriptors.\n" +" events = ep.poll(timeout)\n" +"\n" +" # If more than one timer file descriptors are ready for reading at " +"once,\n" +" # epoll.poll() returns a list of (fd, event) pairs.\n" +" #\n" +" # In this example settings,\n" +" # 1st timer fires every 0.25 seconds in 0.25 seconds. (0.25, 0.5, " +"0.75, 1.0, ...)\n" +" # 2nd timer every 0.5 seconds in 0.5 seconds. (0.5, 1.0, 1.5, " +"2.0, ...)\n" +" # 3rd timer every 0.75 seconds in 0.75 seconds. (0.75, 1.5, 2.25, " +"3.0, ...)\n" +" #\n" +" # In 0.25 seconds, only 1st timer fires.\n" +" # In 0.5 seconds, 1st timer and 2nd timer fires at once.\n" +" # In 0.75 seconds, 1st timer and 3rd timer fires at once.\n" +" # In 1.5 seconds, 1st timer, 2nd timer and 3rd timer fires at " +"once.\n" +" #\n" +" # If a timer file descriptor is signaled more than once since\n" +" # the last os.read() call, os.read() returns the number of signaled\n" +" # as host order of class bytes.\n" +" print(f\"Signaled events={events}\")\n" +" for fd, event in events:\n" +" if event & select.EPOLLIN:\n" +" if fd == sock.fileno():\n" +" # Check if there is a connection request.\n" +" print(f\"Accepting connection {fd}\")\n" +" conn, addr = sock.accept()\n" +" conn.setblocking(False)\n" +" print(f\"Accepted connection {conn} from {addr}\")\n" +" ep.register(conn, select.EPOLLIN)\n" +" elif conn and fd == conn.fileno():\n" +" # Check if there is data to read.\n" +" print(f\"Reading data {fd}\")\n" +" data = conn.recv(1024)\n" +" if data:\n" +" # You should catch UnicodeDecodeError exception for " +"safety.\n" +" cmd = data.decode()\n" +" if cmd.startswith(\"stop\"):\n" +" print(f\"Stopping server\")\n" +" is_active = False\n" +" else:\n" +" print(f\"Unknown command: {cmd}\")\n" +" else:\n" +" # No more data, close connection\n" +" print(f\"Closing connection {fd}\")\n" +" ep.unregister(conn)\n" +" conn.close()\n" +" conn = None\n" +" elif fd in fds:\n" +" print(f\"Reading timer {fd}\")\n" +" count = int.from_bytes(os.read(fd, 8), byteorder=sys." +"byteorder)\n" +" print(f\"Timer {fds.index(fd) + 1} expired {count} " +"times\")\n" +" else:\n" +" print(f\"Unknown file descriptor {fd}\")\n" +"finally:\n" +" for fd in fds:\n" +" ep.unregister(fd)\n" +" os.close(fd)\n" +" ep.close()" +msgstr "" + +#: howto/timerfd.rst:153 +msgid "" +"This example shows how :func:`~select.select` can be used with timer file " +"descriptors to wait until the file descriptor is ready for reading:" +msgstr "" + +#: howto/timerfd.rst:156 +msgid "" +"import os, time, select, socket, sys\n" +"\n" +"# In this example, use loopback address to send \"stop\" command to the " +"server.\n" +"#\n" +"# $ telnet 127.0.0.1 1234\n" +"# Trying 127.0.0.1...\n" +"# Connected to 127.0.0.1.\n" +"# Escape character is '^]'.\n" +"# stop\n" +"# Connection closed by foreign host.\n" +"#\n" +"sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)\n" +"sock.bind((\"127.0.0.1\", 1234))\n" +"sock.setblocking(False)\n" +"sock.listen(1)\n" +"\n" +"# Create timer file descriptors in non-blocking mode.\n" +"num = 3\n" +"fds = [os.timerfd_create(time.CLOCK_REALTIME, flags=os.TFD_NONBLOCK)\n" +" for _ in range(num)]\n" +"select_fds = fds + [sock]\n" +"\n" +"# Start the timers with os.timerfd_settime() in seconds.\n" +"# Timer 1 fires every 0.25 seconds; timer 2 every 0.5 seconds; etc\n" +"for i, fd in enumerate(fds, start=1):\n" +" os.timerfd_settime(fd, initial=i/4, interval=i/4)\n" +"\n" +"timeout = 3\n" +"try:\n" +" conn = None\n" +" is_active = True\n" +" while is_active:\n" +" # Wait for the timer to expire for 3 seconds.\n" +" # select.select() returns a list of file descriptors or objects.\n" +" rfd, wfd, xfd = select.select(select_fds, select_fds, select_fds, " +"timeout)\n" +" for fd in rfd:\n" +" if fd == sock:\n" +" # Check if there is a connection request.\n" +" print(f\"Accepting connection {fd}\")\n" +" conn, addr = sock.accept()\n" +" conn.setblocking(False)\n" +" print(f\"Accepted connection {conn} from {addr}\")\n" +" select_fds.append(conn)\n" +" elif conn and fd == conn:\n" +" # Check if there is data to read.\n" +" print(f\"Reading data {fd}\")\n" +" data = conn.recv(1024)\n" +" if data:\n" +" # You should catch UnicodeDecodeError exception for " +"safety.\n" +" cmd = data.decode()\n" +" if cmd.startswith(\"stop\"):\n" +" print(f\"Stopping server\")\n" +" is_active = False\n" +" else:\n" +" print(f\"Unknown command: {cmd}\")\n" +" else:\n" +" # No more data, close connection\n" +" print(f\"Closing connection {fd}\")\n" +" select_fds.remove(conn)\n" +" conn.close()\n" +" conn = None\n" +" elif fd in fds:\n" +" print(f\"Reading timer {fd}\")\n" +" count = int.from_bytes(os.read(fd, 8), byteorder=sys." +"byteorder)\n" +" print(f\"Timer {fds.index(fd) + 1} expired {count} times\")\n" +" else:\n" +" print(f\"Unknown file descriptor {fd}\")\n" +"finally:\n" +" for fd in fds:\n" +" os.close(fd)\n" +" sock.close()\n" +" sock = None" +msgstr "" diff --git a/howto/unicode.po b/howto/unicode.po index 8454b0be..f0259707 100644 --- a/howto/unicode.po +++ b/howto/unicode.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" diff --git a/howto/urllib2.po b/howto/urllib2.po index b2ae5a27..0b9f531c 100644 --- a/howto/urllib2.po +++ b/howto/urllib2.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" diff --git a/installing/index.po b/installing/index.po index a43e8e74..d59af072 100644 --- a/installing/index.po +++ b/installing/index.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" diff --git a/library/__future__.po b/library/__future__.po index b5086548..4d3970dd 100644 --- a/library/__future__.po +++ b/library/__future__.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" diff --git a/library/__main__.po b/library/__main__.po index 93cd3f13..70e9f4fb 100644 --- a/library/__main__.po +++ b/library/__main__.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" diff --git a/library/_thread.po b/library/_thread.po index 9c75aa9c..ffaf450c 100644 --- a/library/_thread.po +++ b/library/_thread.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -145,11 +145,15 @@ msgid "" "after which the value may be recycled by the OS)." msgstr "" -#: library/_thread.rst:145 +#: library/_thread.rst:148 msgid "Availability" msgstr "" -#: library/_thread.rst:130 +#: library/_thread.rst:127 +msgid "Added support for GNU/kFreeBSD." +msgstr "" + +#: library/_thread.rst:133 msgid "" "Return the thread stack size used when creating new threads. The optional " "*size* argument specifies the stack size to be used for subsequently created " @@ -168,22 +172,22 @@ msgid "" "information)." msgstr "" -#: library/_thread.rst:147 +#: library/_thread.rst:150 msgid "Unix platforms with POSIX threads support." msgstr "" -#: library/_thread.rst:152 +#: library/_thread.rst:155 msgid "" "The maximum value allowed for the *timeout* parameter of :meth:`Lock.acquire " "`. Specifying a timeout greater than this value will " "raise an :exc:`OverflowError`." msgstr "" -#: library/_thread.rst:159 +#: library/_thread.rst:162 msgid "Lock objects have the following methods:" msgstr "" -#: library/_thread.rst:164 +#: library/_thread.rst:167 msgid "" "Without any optional argument, this method acquires the lock " "unconditionally, if necessary waiting until it is released by another thread " @@ -191,7 +195,7 @@ msgid "" "existence)." msgstr "" -#: library/_thread.rst:168 +#: library/_thread.rst:171 msgid "" "If the *blocking* argument is present, the action depends on its value: if " "it is false, the lock is only acquired if it can be acquired immediately " @@ -199,7 +203,7 @@ msgid "" "as above." msgstr "" -#: library/_thread.rst:173 +#: library/_thread.rst:176 msgid "" "If the floating-point *timeout* argument is present and positive, it " "specifies the maximum wait time in seconds before returning. A negative " @@ -207,39 +211,39 @@ msgid "" "*timeout* if *blocking* is false." msgstr "" -#: library/_thread.rst:178 +#: library/_thread.rst:181 msgid "" "The return value is ``True`` if the lock is acquired successfully, ``False`` " "if not." msgstr "" -#: library/_thread.rst:181 +#: library/_thread.rst:184 msgid "The *timeout* parameter is new." msgstr "" -#: library/_thread.rst:184 +#: library/_thread.rst:187 msgid "Lock acquires can now be interrupted by signals on POSIX." msgstr "" -#: library/_thread.rst:190 +#: library/_thread.rst:193 msgid "" "Releases the lock. The lock must have been acquired earlier, but not " "necessarily by the same thread." msgstr "" -#: library/_thread.rst:196 +#: library/_thread.rst:199 msgid "" "Return the status of the lock: ``True`` if it has been acquired by some " "thread, ``False`` if not." msgstr "" -#: library/_thread.rst:199 +#: library/_thread.rst:202 msgid "" "In addition to these methods, lock objects can also be used via the :keyword:" "`with` statement, e.g.::" msgstr "" -#: library/_thread.rst:202 +#: library/_thread.rst:205 msgid "" "import _thread\n" "\n" @@ -249,23 +253,23 @@ msgid "" " print(\"a_lock is locked while this executes\")" msgstr "" -#: library/_thread.rst:209 +#: library/_thread.rst:212 msgid "**Caveats:**" msgstr "" -#: library/_thread.rst:213 +#: library/_thread.rst:216 msgid "" "Interrupts always go to the main thread (the :exc:`KeyboardInterrupt` " "exception will be received by that thread.)" msgstr "" -#: library/_thread.rst:216 +#: library/_thread.rst:219 msgid "" "Calling :func:`sys.exit` or raising the :exc:`SystemExit` exception is " "equivalent to calling :func:`_thread.exit`." msgstr "" -#: library/_thread.rst:219 +#: library/_thread.rst:222 msgid "" "It is platform-dependent whether the :meth:`~threading.Lock.acquire` method " "on a lock can be interrupted (so that the :exc:`KeyboardInterrupt` exception " @@ -274,7 +278,7 @@ msgid "" "Windows." msgstr "" -#: library/_thread.rst:225 +#: library/_thread.rst:228 msgid "" "When the main thread exits, it is system defined whether the other threads " "survive. On most systems, they are killed without executing :keyword:" @@ -309,10 +313,10 @@ msgstr "" msgid "POSIX" msgstr "" -#: library/_thread.rst:211 +#: library/_thread.rst:214 msgid "module" msgstr "" -#: library/_thread.rst:211 +#: library/_thread.rst:214 msgid "signal" msgstr "" diff --git a/library/abc.po b/library/abc.po index 92e7f603..2ac9db8b 100644 --- a/library/abc.po +++ b/library/abc.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" diff --git a/library/aifc.po b/library/aifc.po index cbf2b54a..71e2bcd7 100644 --- a/library/aifc.po +++ b/library/aifc.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: 2024-12-23 14:33+0200\n" "Last-Translator: Marios Giannopoulos \n" "Language-Team: PyGreece \n" @@ -18,365 +18,337 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" #: library/aifc.rst:2 -msgid ":mod:`aifc` --- Read and write AIFF and AIFC files" +#, fuzzy +msgid ":mod:`!aifc` --- Read and write AIFF and AIFC files" msgstr ":mod:`aifc` --- Ανάγνωση και εγγραφή AIFF και AIFC αρχείων" -#: library/aifc.rst:8 -msgid "**Source code:** :source:`Lib/aifc.py`" -msgstr "**Πηγαίος κώδικας:** :source:`Lib/aifc.py`" - -#: library/aifc.rst:16 -msgid "" -"The :mod:`aifc` module is deprecated (see :pep:`PEP 594 <594#aifc>` for " -"details)." -msgstr "" -"Το module :mod:`aifc` είναι κατηργημένο (δείτε το :pep:`PEP 594 <594#aifc>` " -"για λεπτομέρειες)." - -#: library/aifc.rst:22 -msgid "" -"This module provides support for reading and writing AIFF and AIFF-C files. " -"AIFF is Audio Interchange File Format, a format for storing digital audio " -"samples in a file. AIFF-C is a newer version of the format that includes " -"the ability to compress the audio data." -msgstr "" -"Το module παρέχει υποστήριξη για την ανάγνωση και την εγγραφή AIFF και AIFF-" -"C αρχείων. Το AIFF είναι η μορφή ήχου Audio Interchange File Format, μια " -"μορφή για την αποθήκευση ψηφιακών δειγμάτων ήχου σε ένα αρχείο. Το AIFF-C " -"είναι μια νεότερη έκδοση της μορφής που περιλαμβάνει την δυνατότητα " -"συμπίεσης των δεδομένων ήχου." - -#: library/aifc.rst:27 -msgid "" -"Audio files have a number of parameters that describe the audio data. The " -"sampling rate or frame rate is the number of times per second the sound is " -"sampled. The number of channels indicate if the audio is mono, stereo, or " -"quadro. Each frame consists of one sample per channel. The sample size is " -"the size in bytes of each sample. Thus a frame consists of ``nchannels * " -"samplesize`` bytes, and a second's worth of audio consists of ``nchannels * " -"samplesize * framerate`` bytes." -msgstr "" -"Τα αρχεία ήχου έχουν έναν αριθμό παραμέτρων που περιγράφουν τα δεδομένα " -"ήχου. Η συχνότητα δειγματοληψίας ή ο ρυθμός καρέ είναι ο αριθμός των φορών " -"ανά δευτερόλεπτο που δειγματοληπτείται ο ήχος. Ο αριθμός των καναλιών " -"δείχνει αν ο ήχος είναι μονοφωνικός, στερεοφωνικός ή τετραφωνικός. Κάθε καρέ " -"αποτελείται από ένα δείγμα ανά κανάλι. Το μέγεθος δείγματος είναι το μέγεθος " -"σε bytes του κάθε δείγματος. Έτσι ένα καρέ αποτελείται από ``nchannels * " -"samplesize`` bytes, και ένα δευτερόλεπτο ήχου από ``nchannels * samplesize * " -"framerate`` bytes." - -#: library/aifc.rst:35 -msgid "" -"For example, CD quality audio has a sample size of two bytes (16 bits), uses " -"two channels (stereo) and has a frame rate of 44,100 frames/second. This " -"gives a frame size of 4 bytes (2\\*2), and a second's worth occupies " -"2\\*2\\*44100 bytes (176,400 bytes)." -msgstr "" -"Για παράδειγμα, ο ήχος ποιότητας CD έχει μέγεθος δείγματος δύο bytes (16 " -"bits), χρησιμοποιεί δύο κανάλια (στερεοφωνικός ήχος) και έχει ρυθμό καρέ " -"44.100 καρέ/δευτερόλεπτο. Αυτό δίνει μέγεθος καρέ 4 bytes (2\\*2), και ένα " -"δευτερόλεπτο καταλαμβάνει 2\\*2\\*44100 bytes (176.400 bytes). " - -#: library/aifc.rst:40 -msgid "Module :mod:`aifc` defines the following function:" -msgstr "Το module :mod:`aifc` ορίζει την ακόλουθη συνάρτηση:" - -#: library/aifc.rst:45 -msgid "" -"Open an AIFF or AIFF-C file and return an object instance with methods that " -"are described below. The argument *file* is either a string naming a file " -"or a :term:`file object`. *mode* must be ``'r'`` or ``'rb'`` when the file " -"must be opened for reading, or ``'w'`` or ``'wb'`` when the file must be " -"opened for writing. If omitted, ``file.mode`` is used if it exists, " -"otherwise ``'rb'`` is used. When used for writing, the file object should " -"be seekable, unless you know ahead of time how many samples you are going to " -"write in total and use :meth:`writeframesraw` and :meth:`setnframes`. The :" -"func:`.open` function may be used in a :keyword:`with` statement. When the :" -"keyword:`!with` block completes, the :meth:`~aifc.close` method is called." -msgstr "" -"Ανοίγει ένα αρχείο AIFF ή AIFF-C και επιστρέφει ένα στιγμιότυπο αντικειμένου " -"με μεθόδους που περιγράφονται παρακάτω. Η παράμετρος *file* είναι είτε μια " -"συμβολοσειρά που καθορίζει το όνομα του αρχείου είτε ένα :term:`file " -"object`. Η παράμετρος *mode* πρέπει να είναι ``'r'`` ή ``'rb'`` όταν το " -"αρχείο πρέπει να ανοίξει για ανάγνωση, ή ``'w'`` ή ``'wb'`` όταν το αρχείο " -"πρέπει να ανοίξει για εγγραφή. Αν παραληφθεί, χρησιμοποιείται το ``file." -"mode`` αν υπάρχει, διαφορετικά χρησιμοποιείται το ``'rb'``. Όταν " -"χρησιμοποιείται για εγγραφή, το αντικείμενο αρχείου θα πρέπει να είναι " -"αναζητήσιμο, εκτός αν γνωρίζετε εκ των προτέρων πόσα δείγματα θα γράψετε " -"συνολικά και χρησιμοποιήσετε τις μεθόδους :meth:`writeframesraw` και :meth:" -"`setnframes`. Η συνάρτηση :func:`.open` μπορεί να χρησιμοποιηθεί σε μια " -"δήλωση :keyword:`with`. Όταν ολοκληρωθεί το μπλοκ :keyword:`!with`, καλείται " -"η μέθοδος :meth:`~aifc.close`." - -#: library/aifc.rst:56 -msgid "Support for the :keyword:`with` statement was added." -msgstr "Προστέθηκε υποστήριξη για τη δήλωση :keyword:`with`." - -#: library/aifc.rst:59 -msgid "" -"Objects returned by :func:`.open` when a file is opened for reading have the " -"following methods:" -msgstr "" -"Τα αντικείμενα που επιστρέφονται από τη συνάρτηση :func:`.open` όταν ένα " -"αρχείο είναι ανοιχτό για ανάγνωση διαθέτουν τις παρακάτω μεθόδους: " - -#: library/aifc.rst:65 -msgid "Return the number of audio channels (1 for mono, 2 for stereo)." -msgstr "" -"Επιστρέφει τον αριθμό των καναλιών ήχου (1 για μονοφωνικό ήχο, 2 για " -"στερεοφωνικό ήχο)." - -#: library/aifc.rst:70 -msgid "Return the size in bytes of individual samples." -msgstr "Επιστρέφει το μέγεθος σε bytes των μεμονωμένων δειγμάτων." - -#: library/aifc.rst:75 -msgid "Return the sampling rate (number of audio frames per second)." -msgstr "" -"Επιστρέφει το ρυθμό δειγματοληψίας (αριθμός καρέ ήχου ανά δευτερόλεπτο)." - -#: library/aifc.rst:80 -msgid "Return the number of audio frames in the file." -msgstr "Επιστρέφει τον αριθμό των καρέ ήχου στο αρχείο." - -#: library/aifc.rst:85 -msgid "" -"Return a bytes array of length 4 describing the type of compression used in " -"the audio file. For AIFF files, the returned value is ``b'NONE'``." -msgstr "" -"Επιστρέφει έναν πίνακα από bytes μήκους 4 που περιγράφει τον τύπο συμπίεσης " -"που χρησιμοποιείται στο αρχείο ήχου. Για τα αρχεία AIFF, η επιστρεφόμενη " -"τιμή είναι ``b'NONE'``." - -#: library/aifc.rst:92 -msgid "" -"Return a bytes array convertible to a human-readable description of the type " -"of compression used in the audio file. For AIFF files, the returned value " -"is ``b'not compressed'``." -msgstr "" -"Επιστρέφει έναν πίνακα από bytes που μπορεί να μετατραπεί σε αναγνώσιμη " -"περιγραφή του τύπου συμπίεσης που χρησιμοποιείται στο αρχείο ήχου. Για τα " -"αρχεία AIFF, η επιστρεφόμενη τιμή είναι ``b'not compressed'``." - -#: library/aifc.rst:99 -msgid "" -"Returns a :func:`~collections.namedtuple` ``(nchannels, sampwidth, " -"framerate, nframes, comptype, compname)``, equivalent to output of the :meth:" -"`get\\*` methods." -msgstr "" -"Επιστρέφει μια πλειάδα :func:`~collections.namedtuple` ``(nchannels, " -"sampwidth, framerate, nframes, comptype, compname)``, η οποία είναι " -"ισοδύναμη με την έξοδο των μεθόδων :meth:`get\\*`." - -#: library/aifc.rst:106 -msgid "" -"Return a list of markers in the audio file. A marker consists of a tuple of " -"three elements. The first is the mark ID (an integer), the second is the " -"mark position in frames from the beginning of the data (an integer), the " -"third is the name of the mark (a string)." -msgstr "" -"Επιστρέφει μια λίστα με δείκτες στο αρχείο ήχου. Ένας δείκτης αποτελείται " -"από μια πλειάδα με τρία στοιχεία. Το πρώτο είναι το αναγνωριστικό του δείκτη " -"(ένας ακέραιος), το δεύτερο είναι η θέση του δείκτη σε καρέ από την αρχή των " -"δεδομένων (ένας ακέραιος), το τρίτο είναι το όνομα του δείκτη (μια " -"συμβολοσειρά)." - -#: library/aifc.rst:114 -msgid "" -"Return the tuple as described in :meth:`getmarkers` for the mark with the " -"given *id*." -msgstr "" -"Επιστρέφει την πλειάδα όπως περιγράφεται στη μέθοδο :meth:`getmarkers` για " -"το δείκτη με το δοσμένο *id*. " - -#: library/aifc.rst:120 -msgid "" -"Read and return the next *nframes* frames from the audio file. The returned " -"data is a string containing for each frame the uncompressed samples of all " -"channels." -msgstr "" -"Διαβάζει και επιστρέφει τα επόμενα *nframes* καρέ από το αρχείο ήχου. Τα " -"δεδομένα που επιστρέφονται είναι μια αλυσίδα που περιέχει για κάθε καρέ τα " -"αποσυμπιεσμένα δείγματα όλων των καναλιών." - -#: library/aifc.rst:127 -msgid "" -"Rewind the read pointer. The next :meth:`readframes` will start from the " -"beginning." -msgstr "" -"Επαναφέρει τον δείκτη ανάγνωσης. Η επόμενη μέθοδος :meth:`readframes` θα " -"ξεκινήσει από την αρχή." - -#: library/aifc.rst:133 -msgid "Seek to the specified frame number." -msgstr "Μετακινεί το δείκτη στο καθορισμένο αριθμό καρέ." - -#: library/aifc.rst:138 -msgid "Return the current frame number." -msgstr "Επιστρέφει τον τρέχοντα αριθμό καρέ." - -#: library/aifc.rst:143 -msgid "" -"Close the AIFF file. After calling this method, the object can no longer be " -"used." -msgstr "" -"Κλείνει το αρχείο AIFF. Μετά την κλήση αυτής της μεθόδου, το αντικείμενο δεν " -"μπορεί πλέον να χρησιμοποιηθεί." - -#: library/aifc.rst:146 -msgid "" -"Objects returned by :func:`.open` when a file is opened for writing have all " -"the above methods, except for :meth:`readframes` and :meth:`setpos`. In " -"addition the following methods exist. The :meth:`get\\*` methods can only " -"be called after the corresponding :meth:`set\\*` methods have been called. " -"Before the first :meth:`writeframes` or :meth:`writeframesraw`, all " -"parameters except for the number of frames must be filled in." -msgstr "" -"Τα αντικείμενα που επιστρέφονται από τη συνάρτηση :func:`.open` όταν ένα " -"αρχείο ανοίγεται για εγγραφή έχουν όλες τις παραπάνω μεθόδους, εκτός από τις " -"μεθόδους :meth:`readframes` και :meth:`setpos`. Επίσης, υπάρχουν οι εξής " -"μέθοδοι. Οι μέθοδοι :meth:`get\\*` μπορούν να κληθούν μόνο αφού έχουν κληθεί " -"οι αντίστοιχες μέθοδοι :meth:`set\\*`. Πριν την πρώτη κλήση των μεθόδων :" -"meth:`writeframes` ή :meth:`writeframesraw`, όλες οι παράμετροι εκτός από " -"τον αριθμό των καρέ πρέπει να είναι συμπληρωμένες." - -#: library/aifc.rst:156 -msgid "" -"Create an AIFF file. The default is that an AIFF-C file is created, unless " -"the name of the file ends in ``'.aiff'`` in which case the default is an " -"AIFF file." -msgstr "" -"Δημιουργία αρχείου AIFF. Η προεπιλογή είναι να δημιουργηθεί ένα αρχείο AIFF-" -"C, εκτός αν το όνομα του αρχείου λήγει σε ``'.aiff'`` οπότε η προεπιλογή " -"είναι ένα αρχείο AIFF." - -#: library/aifc.rst:162 -msgid "" -"Create an AIFF-C file. The default is that an AIFF-C file is created, " -"unless the name of the file ends in ``'.aiff'`` in which case the default is " -"an AIFF file." -msgstr "" -"Δημιουργία αρχείου AIFF-C. Η προεπιλογή είναι να δημιουργηθεί ένα αρχείο " -"AIFF-C, εκτός αν το όνομα του αρχείου λήγει σε ``'.aiff'`` οπότε η " -"προεπιλογή είναι ένα αρχείο AIFF." - -#: library/aifc.rst:169 -msgid "Specify the number of channels in the audio file." -msgstr "Καθορίζει τον αριθμό των καναλιών στο αρχείο ήχου." - -#: library/aifc.rst:174 -msgid "Specify the size in bytes of audio samples." -msgstr "Καθορίζει το μέγεθος σε bytes των δειγμάτων ήχου." - -#: library/aifc.rst:179 -msgid "Specify the sampling frequency in frames per second." -msgstr "Καθορίζει τη συχνότητα δειγματοληψίας σε καρέ ανά δευτερόλεπτο." - -#: library/aifc.rst:184 -msgid "" -"Specify the number of frames that are to be written to the audio file. If " -"this parameter is not set, or not set correctly, the file needs to support " -"seeking." -msgstr "" -"Καθορίστε τον αριθμό των καρέ που πρέπει να εγγραφούν στο αρχείο ήχου. Εάν " -"αυτή η παράμετρος δεν έχει ρυθμιστεί ή δεν έχει ρυθμιστεί σωστά, το αρχείο " -"πρέπει να υποστηρίζει αναζήτηση. " - -#: library/aifc.rst:195 -msgid "" -"Specify the compression type. If not specified, the audio data will not be " -"compressed. In AIFF files, compression is not possible. The name parameter " -"should be a human-readable description of the compression type as a bytes " -"array, the type parameter should be a bytes array of length 4. Currently " -"the following compression types are supported: ``b'NONE'``, ``b'ULAW'``, " -"``b'ALAW'``, ``b'G722'``." -msgstr "" -"Καθορίζει τον τύπο συμπίεσης. Εάν δεν καθοριστεί, τα δεδομένα ήχου δεν θα " -"συμπιεστούν. Στα αρχεία AIFF, η συμπίεση δεν είναι δυνατή. Η παράμετρος " -"όνομα θα πρέπει να είναι μια αναγνώσιμη περιγραφή του τύπου συμπίεσης ως " -"πίνακας byte, ενώ η παράμετρος τύπος θα πρέπει να είναι ένας πίνακας από " -"bytes μήκους 4. Προς το παρόν υποστηρίζονται οι εξής τύποι συμπίεσης: " -"``b'NONE'``, ``b'ULAW'``, ``b'ALAW'``, ``b'G722'``." - -#: library/aifc.rst:205 -msgid "" -"Set all the above parameters at once. The argument is a tuple consisting of " -"the various parameters. This means that it is possible to use the result of " -"a :meth:`getparams` call as argument to :meth:`setparams`." -msgstr "" -"Ορίζει όλες τις παραμέτρους παραπάνω ταυτόχρονα. Η παράμετρος είναι μια " -"πλειάδα που αποτελείται από τις διάφορες παραμέτρους. Αυτό σημαίνει ότι " -"είναι δυνατό να χρησιμοποιηθεί το αποτέλεσμα μιας κλήσης μεθόδου :meth:" -"`getparams` ως παράμετρος στην μέθοδο :meth:`setparams`." - -#: library/aifc.rst:212 -msgid "" -"Add a mark with the given id (larger than 0), and the given name at the " -"given position. This method can be called at any time before :meth:`close`." -msgstr "" -"Προσθέστε ένα δείκτη με το δοσμένο αναγνωριστικό (μεγαλύτερο από 0), και το " -"δοσμένο όνομα στη δοσμένη θέση. Αυτή η μέθοδος μπορεί να κληθεί οποιαδήποτε " -"στιγμή πριν από την μέθοδο :meth:`close`." - -#: library/aifc.rst:219 -msgid "" -"Return the current write position in the output file. Useful in combination " -"with :meth:`setmark`." -msgstr "" -"Επιστρέφει την τρέχουσα θέση εγγραφής στο αρχείο εξόδου. Χρήσιμο σε " -"συνδυασμό με τη μέθοδο :meth:`setmark`." - -#: library/aifc.rst:225 -msgid "" -"Write data to the output file. This method can only be called after the " -"audio file parameters have been set." -msgstr "" -"Γράφει δεδομένα στο αρχείο εξόδου. Αυτή η μέθοδος μπορεί να κληθεί μόνο μετά " -"τη ρύθμιση των παραμέτρων του αρχείου ήχου." - -#: library/aifc.rst:237 -msgid "Any :term:`bytes-like object` is now accepted." -msgstr "" -"Τώρα γίνονται αποδεκτά όλα τα αντικείμενα τύπου :term:`bytes-like object`." - -#: library/aifc.rst:234 +#: library/aifc.rst:10 msgid "" -"Like :meth:`writeframes`, except that the header of the audio file is not " -"updated." +"This module is no longer part of the Python standard library. It was :ref:" +"`removed in Python 3.13 ` after being deprecated in " +"Python 3.11. The removal was decided in :pep:`594`." msgstr "" -"Όπως η μέθοδος :meth:`writeframes`, εκτός από το γεγονός ότι η κεφαλίδα του " -"αρχείου ήχου δεν ενημερώνεται." -#: library/aifc.rst:244 +#: library/aifc.rst:14 msgid "" -"Close the AIFF file. The header of the file is updated to reflect the " -"actual size of the audio data. After calling this method, the object can no " -"longer be used." +"The last version of Python that provided the :mod:`!aifc` module was `Python " +"3.12 `_." msgstr "" -"Κλείστε το αρχείο AIFF. Η κεφαλίδα του αρχείου ενημερώνεται για να αντανακλά " -"το πραγματικό μέγεθος των δεδομένων ήχου. Μετά την κλήση αυτής της μεθόδου, " -"το αντικείμενο δεν μπορεί να χρησιμοποιηθεί πια." - -#: library/aifc.rst:10 -msgid "Audio Interchange File Format" -msgstr "Audio Interchange File Format" - -#: library/aifc.rst:10 -msgid "AIFF" -msgstr "AIFF" - -#: library/aifc.rst:10 -msgid "AIFF-C" -msgstr "AIFF-C" - -#: library/aifc.rst:190 -msgid "u-LAW" -msgstr "u-LAW" - -#: library/aifc.rst:190 -msgid "A-LAW" -msgstr "A-LAW" -#: library/aifc.rst:190 -msgid "G.722" -msgstr "G.722" +#~ msgid "**Source code:** :source:`Lib/aifc.py`" +#~ msgstr "**Πηγαίος κώδικας:** :source:`Lib/aifc.py`" + +#~ msgid "" +#~ "The :mod:`aifc` module is deprecated (see :pep:`PEP 594 <594#aifc>` for " +#~ "details)." +#~ msgstr "" +#~ "Το module :mod:`aifc` είναι κατηργημένο (δείτε το :pep:`PEP 594 " +#~ "<594#aifc>` για λεπτομέρειες)." + +#~ msgid "" +#~ "This module provides support for reading and writing AIFF and AIFF-C " +#~ "files. AIFF is Audio Interchange File Format, a format for storing " +#~ "digital audio samples in a file. AIFF-C is a newer version of the format " +#~ "that includes the ability to compress the audio data." +#~ msgstr "" +#~ "Το module παρέχει υποστήριξη για την ανάγνωση και την εγγραφή AIFF και " +#~ "AIFF-C αρχείων. Το AIFF είναι η μορφή ήχου Audio Interchange File Format, " +#~ "μια μορφή για την αποθήκευση ψηφιακών δειγμάτων ήχου σε ένα αρχείο. Το " +#~ "AIFF-C είναι μια νεότερη έκδοση της μορφής που περιλαμβάνει την " +#~ "δυνατότητα συμπίεσης των δεδομένων ήχου." + +#~ msgid "" +#~ "Audio files have a number of parameters that describe the audio data. The " +#~ "sampling rate or frame rate is the number of times per second the sound " +#~ "is sampled. The number of channels indicate if the audio is mono, " +#~ "stereo, or quadro. Each frame consists of one sample per channel. The " +#~ "sample size is the size in bytes of each sample. Thus a frame consists " +#~ "of ``nchannels * samplesize`` bytes, and a second's worth of audio " +#~ "consists of ``nchannels * samplesize * framerate`` bytes." +#~ msgstr "" +#~ "Τα αρχεία ήχου έχουν έναν αριθμό παραμέτρων που περιγράφουν τα δεδομένα " +#~ "ήχου. Η συχνότητα δειγματοληψίας ή ο ρυθμός καρέ είναι ο αριθμός των " +#~ "φορών ανά δευτερόλεπτο που δειγματοληπτείται ο ήχος. Ο αριθμός των " +#~ "καναλιών δείχνει αν ο ήχος είναι μονοφωνικός, στερεοφωνικός ή " +#~ "τετραφωνικός. Κάθε καρέ αποτελείται από ένα δείγμα ανά κανάλι. Το μέγεθος " +#~ "δείγματος είναι το μέγεθος σε bytes του κάθε δείγματος. Έτσι ένα καρέ " +#~ "αποτελείται από ``nchannels * samplesize`` bytes, και ένα δευτερόλεπτο " +#~ "ήχου από ``nchannels * samplesize * framerate`` bytes." + +#~ msgid "" +#~ "For example, CD quality audio has a sample size of two bytes (16 bits), " +#~ "uses two channels (stereo) and has a frame rate of 44,100 frames/second. " +#~ "This gives a frame size of 4 bytes (2\\*2), and a second's worth occupies " +#~ "2\\*2\\*44100 bytes (176,400 bytes)." +#~ msgstr "" +#~ "Για παράδειγμα, ο ήχος ποιότητας CD έχει μέγεθος δείγματος δύο bytes (16 " +#~ "bits), χρησιμοποιεί δύο κανάλια (στερεοφωνικός ήχος) και έχει ρυθμό καρέ " +#~ "44.100 καρέ/δευτερόλεπτο. Αυτό δίνει μέγεθος καρέ 4 bytes (2\\*2), και " +#~ "ένα δευτερόλεπτο καταλαμβάνει 2\\*2\\*44100 bytes (176.400 bytes). " + +#~ msgid "Module :mod:`aifc` defines the following function:" +#~ msgstr "Το module :mod:`aifc` ορίζει την ακόλουθη συνάρτηση:" + +#~ msgid "" +#~ "Open an AIFF or AIFF-C file and return an object instance with methods " +#~ "that are described below. The argument *file* is either a string naming " +#~ "a file or a :term:`file object`. *mode* must be ``'r'`` or ``'rb'`` when " +#~ "the file must be opened for reading, or ``'w'`` or ``'wb'`` when the " +#~ "file must be opened for writing. If omitted, ``file.mode`` is used if it " +#~ "exists, otherwise ``'rb'`` is used. When used for writing, the file " +#~ "object should be seekable, unless you know ahead of time how many samples " +#~ "you are going to write in total and use :meth:`writeframesraw` and :meth:" +#~ "`setnframes`. The :func:`.open` function may be used in a :keyword:`with` " +#~ "statement. When the :keyword:`!with` block completes, the :meth:`~aifc." +#~ "close` method is called." +#~ msgstr "" +#~ "Ανοίγει ένα αρχείο AIFF ή AIFF-C και επιστρέφει ένα στιγμιότυπο " +#~ "αντικειμένου με μεθόδους που περιγράφονται παρακάτω. Η παράμετρος *file* " +#~ "είναι είτε μια συμβολοσειρά που καθορίζει το όνομα του αρχείου είτε ένα :" +#~ "term:`file object`. Η παράμετρος *mode* πρέπει να είναι ``'r'`` ή " +#~ "``'rb'`` όταν το αρχείο πρέπει να ανοίξει για ανάγνωση, ή ``'w'`` ή " +#~ "``'wb'`` όταν το αρχείο πρέπει να ανοίξει για εγγραφή. Αν παραληφθεί, " +#~ "χρησιμοποιείται το ``file.mode`` αν υπάρχει, διαφορετικά χρησιμοποιείται " +#~ "το ``'rb'``. Όταν χρησιμοποιείται για εγγραφή, το αντικείμενο αρχείου θα " +#~ "πρέπει να είναι αναζητήσιμο, εκτός αν γνωρίζετε εκ των προτέρων πόσα " +#~ "δείγματα θα γράψετε συνολικά και χρησιμοποιήσετε τις μεθόδους :meth:" +#~ "`writeframesraw` και :meth:`setnframes`. Η συνάρτηση :func:`.open` μπορεί " +#~ "να χρησιμοποιηθεί σε μια δήλωση :keyword:`with`. Όταν ολοκληρωθεί το " +#~ "μπλοκ :keyword:`!with`, καλείται η μέθοδος :meth:`~aifc.close`." + +#~ msgid "Support for the :keyword:`with` statement was added." +#~ msgstr "Προστέθηκε υποστήριξη για τη δήλωση :keyword:`with`." + +#~ msgid "" +#~ "Objects returned by :func:`.open` when a file is opened for reading have " +#~ "the following methods:" +#~ msgstr "" +#~ "Τα αντικείμενα που επιστρέφονται από τη συνάρτηση :func:`.open` όταν ένα " +#~ "αρχείο είναι ανοιχτό για ανάγνωση διαθέτουν τις παρακάτω μεθόδους: " + +#~ msgid "Return the number of audio channels (1 for mono, 2 for stereo)." +#~ msgstr "" +#~ "Επιστρέφει τον αριθμό των καναλιών ήχου (1 για μονοφωνικό ήχο, 2 για " +#~ "στερεοφωνικό ήχο)." + +#~ msgid "Return the size in bytes of individual samples." +#~ msgstr "Επιστρέφει το μέγεθος σε bytes των μεμονωμένων δειγμάτων." + +#~ msgid "Return the sampling rate (number of audio frames per second)." +#~ msgstr "" +#~ "Επιστρέφει το ρυθμό δειγματοληψίας (αριθμός καρέ ήχου ανά δευτερόλεπτο)." + +#~ msgid "Return the number of audio frames in the file." +#~ msgstr "Επιστρέφει τον αριθμό των καρέ ήχου στο αρχείο." + +#~ msgid "" +#~ "Return a bytes array of length 4 describing the type of compression used " +#~ "in the audio file. For AIFF files, the returned value is ``b'NONE'``." +#~ msgstr "" +#~ "Επιστρέφει έναν πίνακα από bytes μήκους 4 που περιγράφει τον τύπο " +#~ "συμπίεσης που χρησιμοποιείται στο αρχείο ήχου. Για τα αρχεία AIFF, η " +#~ "επιστρεφόμενη τιμή είναι ``b'NONE'``." + +#~ msgid "" +#~ "Return a bytes array convertible to a human-readable description of the " +#~ "type of compression used in the audio file. For AIFF files, the returned " +#~ "value is ``b'not compressed'``." +#~ msgstr "" +#~ "Επιστρέφει έναν πίνακα από bytes που μπορεί να μετατραπεί σε αναγνώσιμη " +#~ "περιγραφή του τύπου συμπίεσης που χρησιμοποιείται στο αρχείο ήχου. Για τα " +#~ "αρχεία AIFF, η επιστρεφόμενη τιμή είναι ``b'not compressed'``." + +#~ msgid "" +#~ "Returns a :func:`~collections.namedtuple` ``(nchannels, sampwidth, " +#~ "framerate, nframes, comptype, compname)``, equivalent to output of the :" +#~ "meth:`get\\*` methods." +#~ msgstr "" +#~ "Επιστρέφει μια πλειάδα :func:`~collections.namedtuple` ``(nchannels, " +#~ "sampwidth, framerate, nframes, comptype, compname)``, η οποία είναι " +#~ "ισοδύναμη με την έξοδο των μεθόδων :meth:`get\\*`." + +#~ msgid "" +#~ "Return a list of markers in the audio file. A marker consists of a tuple " +#~ "of three elements. The first is the mark ID (an integer), the second is " +#~ "the mark position in frames from the beginning of the data (an integer), " +#~ "the third is the name of the mark (a string)." +#~ msgstr "" +#~ "Επιστρέφει μια λίστα με δείκτες στο αρχείο ήχου. Ένας δείκτης αποτελείται " +#~ "από μια πλειάδα με τρία στοιχεία. Το πρώτο είναι το αναγνωριστικό του " +#~ "δείκτη (ένας ακέραιος), το δεύτερο είναι η θέση του δείκτη σε καρέ από " +#~ "την αρχή των δεδομένων (ένας ακέραιος), το τρίτο είναι το όνομα του " +#~ "δείκτη (μια συμβολοσειρά)." + +#~ msgid "" +#~ "Return the tuple as described in :meth:`getmarkers` for the mark with the " +#~ "given *id*." +#~ msgstr "" +#~ "Επιστρέφει την πλειάδα όπως περιγράφεται στη μέθοδο :meth:`getmarkers` " +#~ "για το δείκτη με το δοσμένο *id*. " + +#~ msgid "" +#~ "Read and return the next *nframes* frames from the audio file. The " +#~ "returned data is a string containing for each frame the uncompressed " +#~ "samples of all channels." +#~ msgstr "" +#~ "Διαβάζει και επιστρέφει τα επόμενα *nframes* καρέ από το αρχείο ήχου. Τα " +#~ "δεδομένα που επιστρέφονται είναι μια αλυσίδα που περιέχει για κάθε καρέ " +#~ "τα αποσυμπιεσμένα δείγματα όλων των καναλιών." + +#~ msgid "" +#~ "Rewind the read pointer. The next :meth:`readframes` will start from the " +#~ "beginning." +#~ msgstr "" +#~ "Επαναφέρει τον δείκτη ανάγνωσης. Η επόμενη μέθοδος :meth:`readframes` θα " +#~ "ξεκινήσει από την αρχή." + +#~ msgid "Seek to the specified frame number." +#~ msgstr "Μετακινεί το δείκτη στο καθορισμένο αριθμό καρέ." + +#~ msgid "Return the current frame number." +#~ msgstr "Επιστρέφει τον τρέχοντα αριθμό καρέ." + +#~ msgid "" +#~ "Close the AIFF file. After calling this method, the object can no longer " +#~ "be used." +#~ msgstr "" +#~ "Κλείνει το αρχείο AIFF. Μετά την κλήση αυτής της μεθόδου, το αντικείμενο " +#~ "δεν μπορεί πλέον να χρησιμοποιηθεί." + +#~ msgid "" +#~ "Objects returned by :func:`.open` when a file is opened for writing have " +#~ "all the above methods, except for :meth:`readframes` and :meth:`setpos`. " +#~ "In addition the following methods exist. The :meth:`get\\*` methods can " +#~ "only be called after the corresponding :meth:`set\\*` methods have been " +#~ "called. Before the first :meth:`writeframes` or :meth:`writeframesraw`, " +#~ "all parameters except for the number of frames must be filled in." +#~ msgstr "" +#~ "Τα αντικείμενα που επιστρέφονται από τη συνάρτηση :func:`.open` όταν ένα " +#~ "αρχείο ανοίγεται για εγγραφή έχουν όλες τις παραπάνω μεθόδους, εκτός από " +#~ "τις μεθόδους :meth:`readframes` και :meth:`setpos`. Επίσης, υπάρχουν οι " +#~ "εξής μέθοδοι. Οι μέθοδοι :meth:`get\\*` μπορούν να κληθούν μόνο αφού " +#~ "έχουν κληθεί οι αντίστοιχες μέθοδοι :meth:`set\\*`. Πριν την πρώτη κλήση " +#~ "των μεθόδων :meth:`writeframes` ή :meth:`writeframesraw`, όλες οι " +#~ "παράμετροι εκτός από τον αριθμό των καρέ πρέπει να είναι συμπληρωμένες." + +#~ msgid "" +#~ "Create an AIFF file. The default is that an AIFF-C file is created, " +#~ "unless the name of the file ends in ``'.aiff'`` in which case the default " +#~ "is an AIFF file." +#~ msgstr "" +#~ "Δημιουργία αρχείου AIFF. Η προεπιλογή είναι να δημιουργηθεί ένα αρχείο " +#~ "AIFF-C, εκτός αν το όνομα του αρχείου λήγει σε ``'.aiff'`` οπότε η " +#~ "προεπιλογή είναι ένα αρχείο AIFF." + +#~ msgid "" +#~ "Create an AIFF-C file. The default is that an AIFF-C file is created, " +#~ "unless the name of the file ends in ``'.aiff'`` in which case the default " +#~ "is an AIFF file." +#~ msgstr "" +#~ "Δημιουργία αρχείου AIFF-C. Η προεπιλογή είναι να δημιουργηθεί ένα αρχείο " +#~ "AIFF-C, εκτός αν το όνομα του αρχείου λήγει σε ``'.aiff'`` οπότε η " +#~ "προεπιλογή είναι ένα αρχείο AIFF." + +#~ msgid "Specify the number of channels in the audio file." +#~ msgstr "Καθορίζει τον αριθμό των καναλιών στο αρχείο ήχου." + +#~ msgid "Specify the size in bytes of audio samples." +#~ msgstr "Καθορίζει το μέγεθος σε bytes των δειγμάτων ήχου." + +#~ msgid "Specify the sampling frequency in frames per second." +#~ msgstr "Καθορίζει τη συχνότητα δειγματοληψίας σε καρέ ανά δευτερόλεπτο." + +#~ msgid "" +#~ "Specify the number of frames that are to be written to the audio file. If " +#~ "this parameter is not set, or not set correctly, the file needs to " +#~ "support seeking." +#~ msgstr "" +#~ "Καθορίστε τον αριθμό των καρέ που πρέπει να εγγραφούν στο αρχείο ήχου. " +#~ "Εάν αυτή η παράμετρος δεν έχει ρυθμιστεί ή δεν έχει ρυθμιστεί σωστά, το " +#~ "αρχείο πρέπει να υποστηρίζει αναζήτηση. " + +#~ msgid "" +#~ "Specify the compression type. If not specified, the audio data will not " +#~ "be compressed. In AIFF files, compression is not possible. The name " +#~ "parameter should be a human-readable description of the compression type " +#~ "as a bytes array, the type parameter should be a bytes array of length " +#~ "4. Currently the following compression types are supported: ``b'NONE'``, " +#~ "``b'ULAW'``, ``b'ALAW'``, ``b'G722'``." +#~ msgstr "" +#~ "Καθορίζει τον τύπο συμπίεσης. Εάν δεν καθοριστεί, τα δεδομένα ήχου δεν θα " +#~ "συμπιεστούν. Στα αρχεία AIFF, η συμπίεση δεν είναι δυνατή. Η παράμετρος " +#~ "όνομα θα πρέπει να είναι μια αναγνώσιμη περιγραφή του τύπου συμπίεσης ως " +#~ "πίνακας byte, ενώ η παράμετρος τύπος θα πρέπει να είναι ένας πίνακας από " +#~ "bytes μήκους 4. Προς το παρόν υποστηρίζονται οι εξής τύποι συμπίεσης: " +#~ "``b'NONE'``, ``b'ULAW'``, ``b'ALAW'``, ``b'G722'``." + +#~ msgid "" +#~ "Set all the above parameters at once. The argument is a tuple consisting " +#~ "of the various parameters. This means that it is possible to use the " +#~ "result of a :meth:`getparams` call as argument to :meth:`setparams`." +#~ msgstr "" +#~ "Ορίζει όλες τις παραμέτρους παραπάνω ταυτόχρονα. Η παράμετρος είναι μια " +#~ "πλειάδα που αποτελείται από τις διάφορες παραμέτρους. Αυτό σημαίνει ότι " +#~ "είναι δυνατό να χρησιμοποιηθεί το αποτέλεσμα μιας κλήσης μεθόδου :meth:" +#~ "`getparams` ως παράμετρος στην μέθοδο :meth:`setparams`." + +#~ msgid "" +#~ "Add a mark with the given id (larger than 0), and the given name at the " +#~ "given position. This method can be called at any time before :meth:" +#~ "`close`." +#~ msgstr "" +#~ "Προσθέστε ένα δείκτη με το δοσμένο αναγνωριστικό (μεγαλύτερο από 0), και " +#~ "το δοσμένο όνομα στη δοσμένη θέση. Αυτή η μέθοδος μπορεί να κληθεί " +#~ "οποιαδήποτε στιγμή πριν από την μέθοδο :meth:`close`." + +#~ msgid "" +#~ "Return the current write position in the output file. Useful in " +#~ "combination with :meth:`setmark`." +#~ msgstr "" +#~ "Επιστρέφει την τρέχουσα θέση εγγραφής στο αρχείο εξόδου. Χρήσιμο σε " +#~ "συνδυασμό με τη μέθοδο :meth:`setmark`." + +#~ msgid "" +#~ "Write data to the output file. This method can only be called after the " +#~ "audio file parameters have been set." +#~ msgstr "" +#~ "Γράφει δεδομένα στο αρχείο εξόδου. Αυτή η μέθοδος μπορεί να κληθεί μόνο " +#~ "μετά τη ρύθμιση των παραμέτρων του αρχείου ήχου." + +#~ msgid "Any :term:`bytes-like object` is now accepted." +#~ msgstr "" +#~ "Τώρα γίνονται αποδεκτά όλα τα αντικείμενα τύπου :term:`bytes-like object`." + +#~ msgid "" +#~ "Like :meth:`writeframes`, except that the header of the audio file is not " +#~ "updated." +#~ msgstr "" +#~ "Όπως η μέθοδος :meth:`writeframes`, εκτός από το γεγονός ότι η κεφαλίδα " +#~ "του αρχείου ήχου δεν ενημερώνεται." + +#~ msgid "" +#~ "Close the AIFF file. The header of the file is updated to reflect the " +#~ "actual size of the audio data. After calling this method, the object can " +#~ "no longer be used." +#~ msgstr "" +#~ "Κλείστε το αρχείο AIFF. Η κεφαλίδα του αρχείου ενημερώνεται για να " +#~ "αντανακλά το πραγματικό μέγεθος των δεδομένων ήχου. Μετά την κλήση αυτής " +#~ "της μεθόδου, το αντικείμενο δεν μπορεί να χρησιμοποιηθεί πια." + +#~ msgid "Audio Interchange File Format" +#~ msgstr "Audio Interchange File Format" + +#~ msgid "AIFF" +#~ msgstr "AIFF" + +#~ msgid "AIFF-C" +#~ msgstr "AIFF-C" + +#~ msgid "u-LAW" +#~ msgstr "u-LAW" + +#~ msgid "A-LAW" +#~ msgstr "A-LAW" + +#~ msgid "G.722" +#~ msgstr "G.722" diff --git a/library/allos.po b/library/allos.po index 39d43ee4..639a89a0 100644 --- a/library/allos.po +++ b/library/allos.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" diff --git a/library/archiving.po b/library/archiving.po index 807fc2ff..d7b65f53 100644 --- a/library/archiving.po +++ b/library/archiving.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" diff --git a/library/argparse.po b/library/argparse.po index d3730cbb..1c72a513 100644 --- a/library/argparse.po +++ b/library/argparse.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -27,18 +27,31 @@ msgstr "" msgid "**Source code:** :source:`Lib/argparse.py`" msgstr "" +#: library/argparse.rst:16 +msgid "" +"While :mod:`argparse` is the default recommended standard library module for " +"implementing basic command line applications, authors with more exacting " +"requirements for exactly how their command line applications behave may find " +"it doesn't provide the necessary level of control. Refer to :ref:`choosing-" +"an-argument-parser` for alternatives to consider when ``argparse`` doesn't " +"support behaviors that the application requires (such as entirely disabling " +"support for interspersed options and positional arguments, or accepting " +"option parameter values that start with ``-`` even when they correspond to " +"another defined option)." +msgstr "" + #: library/argparse.rst:-1 msgid "Tutorial" msgstr "" -#: library/argparse.rst:18 +#: library/argparse.rst:30 msgid "" "This page contains the API reference information. For a more gentle " "introduction to Python command-line parsing, have a look at the :ref:" "`argparse tutorial `." msgstr "" -#: library/argparse.rst:22 +#: library/argparse.rst:34 msgid "" "The :mod:`!argparse` module makes it easy to write user-friendly command-" "line interfaces. The program defines what arguments it requires, and :mod:`!" @@ -48,7 +61,7 @@ msgid "" "invalid arguments." msgstr "" -#: library/argparse.rst:28 +#: library/argparse.rst:40 msgid "" "The :mod:`!argparse` module's support for command-line interfaces is built " "around an instance of :class:`argparse.ArgumentParser`. It is a container " @@ -56,7 +69,7 @@ msgid "" "whole::" msgstr "" -#: library/argparse.rst:32 +#: library/argparse.rst:44 msgid "" "parser = argparse.ArgumentParser(\n" " prog='ProgramName',\n" @@ -64,14 +77,14 @@ msgid "" " epilog='Text at the bottom of help')" msgstr "" -#: library/argparse.rst:37 +#: library/argparse.rst:49 msgid "" "The :meth:`ArgumentParser.add_argument` method attaches individual argument " "specifications to the parser. It supports positional arguments, options " "that accept values, and on/off flags::" msgstr "" -#: library/argparse.rst:41 +#: library/argparse.rst:53 msgid "" "parser.add_argument('filename') # positional argument\n" "parser.add_argument('-c', '--count') # option that takes a value\n" @@ -79,154 +92,154 @@ msgid "" " action='store_true') # on/off flag" msgstr "" -#: library/argparse.rst:46 +#: library/argparse.rst:58 msgid "" "The :meth:`ArgumentParser.parse_args` method runs the parser and places the " "extracted data in a :class:`argparse.Namespace` object::" msgstr "" -#: library/argparse.rst:49 +#: library/argparse.rst:61 msgid "" "args = parser.parse_args()\n" "print(args.filename, args.count, args.verbose)" msgstr "" -#: library/argparse.rst:53 +#: library/argparse.rst:65 msgid "" "If you're looking for a guide about how to upgrade :mod:`optparse` code to :" "mod:`!argparse`, see :ref:`Upgrading Optparse Code `." msgstr "" -#: library/argparse.rst:57 +#: library/argparse.rst:69 msgid "ArgumentParser objects" msgstr "" -#: library/argparse.rst:66 +#: library/argparse.rst:78 msgid "" "Create a new :class:`ArgumentParser` object. All parameters should be passed " "as keyword arguments. Each parameter has its own more detailed description " "below, but in short they are:" msgstr "" -#: library/argparse.rst:70 +#: library/argparse.rst:82 msgid "" "prog_ - The name of the program (default: ``os.path.basename(sys.argv[0])``)" msgstr "" -#: library/argparse.rst:73 +#: library/argparse.rst:85 msgid "" "usage_ - The string describing the program usage (default: generated from " "arguments added to parser)" msgstr "" -#: library/argparse.rst:76 +#: library/argparse.rst:88 msgid "" "description_ - Text to display before the argument help (by default, no text)" msgstr "" -#: library/argparse.rst:79 +#: library/argparse.rst:91 msgid "epilog_ - Text to display after the argument help (by default, no text)" msgstr "" -#: library/argparse.rst:81 +#: library/argparse.rst:93 msgid "" "parents_ - A list of :class:`ArgumentParser` objects whose arguments should " "also be included" msgstr "" -#: library/argparse.rst:84 +#: library/argparse.rst:96 msgid "formatter_class_ - A class for customizing the help output" msgstr "" -#: library/argparse.rst:86 +#: library/argparse.rst:98 msgid "" "prefix_chars_ - The set of characters that prefix optional arguments " "(default: '-')" msgstr "" -#: library/argparse.rst:89 +#: library/argparse.rst:101 msgid "" "fromfile_prefix_chars_ - The set of characters that prefix files from which " "additional arguments should be read (default: ``None``)" msgstr "" -#: library/argparse.rst:92 +#: library/argparse.rst:104 msgid "" "argument_default_ - The global default value for arguments (default: " "``None``)" msgstr "" -#: library/argparse.rst:95 +#: library/argparse.rst:107 msgid "" "conflict_handler_ - The strategy for resolving conflicting optionals " "(usually unnecessary)" msgstr "" -#: library/argparse.rst:98 +#: library/argparse.rst:110 msgid "" "add_help_ - Add a ``-h/--help`` option to the parser (default: ``True``)" msgstr "" -#: library/argparse.rst:100 +#: library/argparse.rst:112 msgid "" "allow_abbrev_ - Allows long options to be abbreviated if the abbreviation is " "unambiguous. (default: ``True``)" msgstr "" -#: library/argparse.rst:103 +#: library/argparse.rst:115 msgid "" "exit_on_error_ - Determines whether or not :class:`!ArgumentParser` exits " "with error info when an error occurs. (default: ``True``)" msgstr "" -#: library/argparse.rst:106 +#: library/argparse.rst:118 msgid "*allow_abbrev* parameter was added." msgstr "" -#: library/argparse.rst:109 +#: library/argparse.rst:121 msgid "" "In previous versions, *allow_abbrev* also disabled grouping of short flags " "such as ``-vv`` to mean ``-v -v``." msgstr "" -#: library/argparse.rst:113 +#: library/argparse.rst:125 msgid "*exit_on_error* parameter was added." msgstr "" -#: library/argparse.rst:596 +#: library/argparse.rst:610 msgid "The following sections describe how each of these are used." msgstr "" -#: library/argparse.rst:122 +#: library/argparse.rst:134 msgid "prog" msgstr "" -#: library/argparse.rst:125 +#: library/argparse.rst:137 msgid "" "By default, :class:`ArgumentParser` calculates the name of the program to " "display in help messages depending on the way the Python interpreter was run:" msgstr "" -#: library/argparse.rst:128 +#: library/argparse.rst:140 msgid "" "The :func:`base name ` of ``sys.argv[0]`` if a file was " "passed as argument." msgstr "" -#: library/argparse.rst:130 +#: library/argparse.rst:142 msgid "" "The Python interpreter name followed by ``sys.argv[0]`` if a directory or a " "zipfile was passed as argument." msgstr "" -#: library/argparse.rst:132 +#: library/argparse.rst:144 msgid "" "The Python interpreter name followed by ``-m`` followed by the module or " "package name if the :option:`-m` option was used." msgstr "" -#: library/argparse.rst:135 +#: library/argparse.rst:147 msgid "" "This default is almost always desirable because it will make the help " "messages match the string that was used to invoke the program on the command " @@ -234,7 +247,7 @@ msgid "" "supplied using the ``prog=`` argument to :class:`ArgumentParser`::" msgstr "" -#: library/argparse.rst:140 +#: library/argparse.rst:152 msgid "" ">>> parser = argparse.ArgumentParser(prog='myprogram')\n" ">>> parser.print_help()\n" @@ -244,14 +257,14 @@ msgid "" " -h, --help show this help message and exit" msgstr "" -#: library/argparse.rst:147 +#: library/argparse.rst:159 msgid "" "Note that the program name, whether determined from ``sys.argv[0]`` or from " "the ``prog=`` argument, is available to help messages using the ``%(prog)s`` " "format specifier." msgstr "" -#: library/argparse.rst:153 +#: library/argparse.rst:165 msgid "" ">>> parser = argparse.ArgumentParser(prog='myprogram')\n" ">>> parser.add_argument('--foo', help='foo of the %(prog)s program')\n" @@ -263,18 +276,18 @@ msgid "" " --foo FOO foo of the myprogram program" msgstr "" -#: library/argparse.rst:164 +#: library/argparse.rst:176 msgid "usage" msgstr "" -#: library/argparse.rst:166 +#: library/argparse.rst:178 msgid "" "By default, :class:`ArgumentParser` calculates the usage message from the " "arguments it contains. The default message can be overridden with the " "``usage=`` keyword argument::" msgstr "" -#: library/argparse.rst:170 +#: library/argparse.rst:182 msgid "" ">>> parser = argparse.ArgumentParser(prog='PROG', usage='%(prog)s " "[options]')\n" @@ -291,17 +304,17 @@ msgid "" " --foo [FOO] foo help" msgstr "" -#: library/argparse.rst:183 +#: library/argparse.rst:195 msgid "" "The ``%(prog)s`` format specifier is available to fill in the program name " "in your usage messages." msgstr "" -#: library/argparse.rst:190 +#: library/argparse.rst:202 msgid "description" msgstr "" -#: library/argparse.rst:192 +#: library/argparse.rst:204 msgid "" "Most calls to the :class:`ArgumentParser` constructor will use the " "``description=`` keyword argument. This argument gives a brief description " @@ -310,24 +323,24 @@ msgid "" "messages for the various arguments." msgstr "" -#: library/argparse.rst:198 +#: library/argparse.rst:210 msgid "" "By default, the description will be line-wrapped so that it fits within the " "given space. To change this behavior, see the formatter_class_ argument." msgstr "" -#: library/argparse.rst:203 +#: library/argparse.rst:215 msgid "epilog" msgstr "" -#: library/argparse.rst:205 +#: library/argparse.rst:217 msgid "" "Some programs like to display additional description of the program after " "the description of the arguments. Such text can be specified using the " "``epilog=`` argument to :class:`ArgumentParser`::" msgstr "" -#: library/argparse.rst:209 +#: library/argparse.rst:221 msgid "" ">>> parser = argparse.ArgumentParser(\n" "... description='A foo that bars',\n" @@ -343,18 +356,18 @@ msgid "" "And that's how you'd foo a bar" msgstr "" -#: library/argparse.rst:222 +#: library/argparse.rst:234 msgid "" "As with the description_ argument, the ``epilog=`` text is by default line-" "wrapped, but this behavior can be adjusted with the formatter_class_ " "argument to :class:`ArgumentParser`." msgstr "" -#: library/argparse.rst:228 +#: library/argparse.rst:240 msgid "parents" msgstr "" -#: library/argparse.rst:230 +#: library/argparse.rst:242 msgid "" "Sometimes, several parsers share a common set of arguments. Rather than " "repeating the definitions of these arguments, a single parser with all the " @@ -365,7 +378,7 @@ msgid "" "object being constructed::" msgstr "" -#: library/argparse.rst:237 +#: library/argparse.rst:249 msgid "" ">>> parent_parser = argparse.ArgumentParser(add_help=False)\n" ">>> parent_parser.add_argument('--parent', type=int)\n" @@ -381,32 +394,32 @@ msgid "" "Namespace(bar='YYY', parent=None)" msgstr "" -#: library/argparse.rst:250 +#: library/argparse.rst:262 msgid "" "Note that most parent parsers will specify ``add_help=False``. Otherwise, " "the :class:`ArgumentParser` will see two ``-h/--help`` options (one in the " "parent and one in the child) and raise an error." msgstr "" -#: library/argparse.rst:255 +#: library/argparse.rst:267 msgid "" "You must fully initialize the parsers before passing them via ``parents=``. " "If you change the parent parsers after the child parser, those changes will " "not be reflected in the child." msgstr "" -#: library/argparse.rst:263 +#: library/argparse.rst:275 msgid "formatter_class" msgstr "" -#: library/argparse.rst:265 +#: library/argparse.rst:277 msgid "" ":class:`ArgumentParser` objects allow the help formatting to be customized " "by specifying an alternate formatting class. Currently, there are four such " "classes:" msgstr "" -#: library/argparse.rst:274 +#: library/argparse.rst:286 msgid "" ":class:`RawDescriptionHelpFormatter` and :class:`RawTextHelpFormatter` give " "more control over how textual descriptions are displayed. By default, :class:" @@ -414,7 +427,7 @@ msgid "" "command-line help messages::" msgstr "" -#: library/argparse.rst:279 +#: library/argparse.rst:291 msgid "" ">>> parser = argparse.ArgumentParser(\n" "... prog='PROG',\n" @@ -438,14 +451,14 @@ msgid "" "will be wrapped across a couple lines" msgstr "" -#: library/argparse.rst:299 +#: library/argparse.rst:311 msgid "" "Passing :class:`RawDescriptionHelpFormatter` as ``formatter_class=`` " "indicates that description_ and epilog_ are already correctly formatted and " "should not be line-wrapped::" msgstr "" -#: library/argparse.rst:303 +#: library/argparse.rst:315 msgid "" ">>> parser = argparse.ArgumentParser(\n" "... prog='PROG',\n" @@ -470,7 +483,7 @@ msgid "" " -h, --help show this help message and exit" msgstr "" -#: library/argparse.rst:325 +#: library/argparse.rst:337 msgid "" ":class:`RawTextHelpFormatter` maintains whitespace for all sorts of help " "text, including argument descriptions. However, multiple newlines are " @@ -478,13 +491,13 @@ msgid "" "between the newlines." msgstr "" -#: library/argparse.rst:330 +#: library/argparse.rst:342 msgid "" ":class:`ArgumentDefaultsHelpFormatter` automatically adds information about " "default values to each of the argument help messages::" msgstr "" -#: library/argparse.rst:333 +#: library/argparse.rst:345 msgid "" ">>> parser = argparse.ArgumentParser(\n" "... prog='PROG',\n" @@ -502,14 +515,14 @@ msgid "" " --foo FOO FOO! (default: 42)" msgstr "" -#: library/argparse.rst:348 +#: library/argparse.rst:360 msgid "" ":class:`MetavarTypeHelpFormatter` uses the name of the type_ argument for " "each argument as the display name for its values (rather than using the " "dest_ as the regular formatter does)::" msgstr "" -#: library/argparse.rst:352 +#: library/argparse.rst:364 msgid "" ">>> parser = argparse.ArgumentParser(\n" "... prog='PROG',\n" @@ -527,11 +540,11 @@ msgid "" " --foo int" msgstr "" -#: library/argparse.rst:369 +#: library/argparse.rst:381 msgid "prefix_chars" msgstr "" -#: library/argparse.rst:371 +#: library/argparse.rst:383 msgid "" "Most command-line options will use ``-`` as the prefix, e.g. ``-f/--foo``. " "Parsers that need to support different or additional prefix characters, e.g. " @@ -539,7 +552,7 @@ msgid "" "``prefix_chars=`` argument to the :class:`ArgumentParser` constructor::" msgstr "" -#: library/argparse.rst:377 +#: library/argparse.rst:389 msgid "" ">>> parser = argparse.ArgumentParser(prog='PROG', prefix_chars='-+')\n" ">>> parser.add_argument('+f')\n" @@ -548,18 +561,18 @@ msgid "" "Namespace(bar='Y', f='X')" msgstr "" -#: library/argparse.rst:383 +#: library/argparse.rst:395 msgid "" "The ``prefix_chars=`` argument defaults to ``'-'``. Supplying a set of " "characters that does not include ``-`` will cause ``-f/--foo`` options to be " "disallowed." msgstr "" -#: library/argparse.rst:389 +#: library/argparse.rst:401 msgid "fromfile_prefix_chars" msgstr "" -#: library/argparse.rst:391 +#: library/argparse.rst:403 msgid "" "Sometimes, when dealing with a particularly long argument list, it may make " "sense to keep the list of arguments in a file rather than typing it out at " @@ -569,7 +582,7 @@ msgid "" "by the arguments they contain. For example::" msgstr "" -#: library/argparse.rst:398 +#: library/argparse.rst:410 msgid "" ">>> with open('args.txt', 'w', encoding=sys.getfilesystemencoding()) as fp:\n" "... fp.write('-f\\nbar')\n" @@ -580,7 +593,7 @@ msgid "" "Namespace(f='bar')" msgstr "" -#: library/argparse.rst:406 +#: library/argparse.rst:418 msgid "" "Arguments read from a file must by default be one per line (but see also :" "meth:`~ArgumentParser.convert_arg_line_to_args`) and are treated as if they " @@ -590,19 +603,19 @@ msgid "" "f', 'bar']``." msgstr "" -#: library/argparse.rst:412 +#: library/argparse.rst:424 msgid "" ":class:`ArgumentParser` uses :term:`filesystem encoding and error handler` " "to read the file containing arguments." msgstr "" -#: library/argparse.rst:415 +#: library/argparse.rst:427 msgid "" "The ``fromfile_prefix_chars=`` argument defaults to ``None``, meaning that " "arguments will never be treated as file references." msgstr "" -#: library/argparse.rst:418 +#: library/argparse.rst:430 msgid "" ":class:`ArgumentParser` changed encoding and errors to read arguments files " "from default (e.g. :func:`locale.getpreferredencoding(False) >> parser = argparse.ArgumentParser(argument_default=argparse.SUPPRESS)\n" ">>> parser.add_argument('--foo')\n" @@ -638,22 +651,22 @@ msgid "" "Namespace()" msgstr "" -#: library/argparse.rst:448 +#: library/argparse.rst:460 msgid "allow_abbrev" msgstr "" -#: library/argparse.rst:450 +#: library/argparse.rst:462 msgid "" "Normally, when you pass an argument list to the :meth:`~ArgumentParser." "parse_args` method of an :class:`ArgumentParser`, it :ref:`recognizes " "abbreviations ` of long options." msgstr "" -#: library/argparse.rst:454 +#: library/argparse.rst:466 msgid "This feature can be disabled by setting ``allow_abbrev`` to ``False``::" msgstr "" -#: library/argparse.rst:456 +#: library/argparse.rst:468 msgid "" ">>> parser = argparse.ArgumentParser(prog='PROG', allow_abbrev=False)\n" ">>> parser.add_argument('--foobar', action='store_true')\n" @@ -663,11 +676,11 @@ msgid "" "PROG: error: unrecognized arguments: --foon" msgstr "" -#: library/argparse.rst:467 +#: library/argparse.rst:479 msgid "conflict_handler" msgstr "" -#: library/argparse.rst:469 +#: library/argparse.rst:481 msgid "" ":class:`ArgumentParser` objects do not allow two actions with the same " "option string. By default, :class:`ArgumentParser` objects raise an " @@ -675,7 +688,7 @@ msgid "" "that is already in use::" msgstr "" -#: library/argparse.rst:474 +#: library/argparse.rst:486 msgid "" ">>> parser = argparse.ArgumentParser(prog='PROG')\n" ">>> parser.add_argument('-f', '--foo', help='old foo help')\n" @@ -685,7 +698,7 @@ msgid "" "ArgumentError: argument --foo: conflicting option string(s): --foo" msgstr "" -#: library/argparse.rst:481 +#: library/argparse.rst:493 msgid "" "Sometimes (e.g. when using parents_) it may be useful to simply override any " "older arguments with the same option string. To get this behavior, the " @@ -693,7 +706,7 @@ msgid "" "of :class:`ArgumentParser`::" msgstr "" -#: library/argparse.rst:486 +#: library/argparse.rst:498 msgid "" ">>> parser = argparse.ArgumentParser(prog='PROG', " "conflict_handler='resolve')\n" @@ -708,7 +721,7 @@ msgid "" " --foo FOO new foo help" msgstr "" -#: library/argparse.rst:497 +#: library/argparse.rst:509 msgid "" "Note that :class:`ArgumentParser` objects only remove an action if all of " "its option strings are overridden. So, in the example above, the old ``-f/--" @@ -716,25 +729,25 @@ msgid "" "option string was overridden." msgstr "" -#: library/argparse.rst:504 +#: library/argparse.rst:516 msgid "add_help" msgstr "" -#: library/argparse.rst:506 +#: library/argparse.rst:518 msgid "" "By default, :class:`ArgumentParser` objects add an option which simply " "displays the parser's help message. If ``-h`` or ``--help`` is supplied at " "the command line, the :class:`!ArgumentParser` help will be printed." msgstr "" -#: library/argparse.rst:510 +#: library/argparse.rst:522 msgid "" "Occasionally, it may be useful to disable the addition of this help option. " "This can be achieved by passing ``False`` as the ``add_help=`` argument to :" "class:`ArgumentParser`::" msgstr "" -#: library/argparse.rst:514 +#: library/argparse.rst:526 msgid "" ">>> parser = argparse.ArgumentParser(prog='PROG', add_help=False)\n" ">>> parser.add_argument('--foo', help='foo help')\n" @@ -745,7 +758,7 @@ msgid "" " --foo FOO foo help" msgstr "" -#: library/argparse.rst:522 +#: library/argparse.rst:534 msgid "" "The help option is typically ``-h/--help``. The exception to this is if the " "``prefix_chars=`` is specified and does not include ``-``, in which case ``-" @@ -753,7 +766,7 @@ msgid "" "in ``prefix_chars`` is used to prefix the help options::" msgstr "" -#: library/argparse.rst:528 +#: library/argparse.rst:540 msgid "" ">>> parser = argparse.ArgumentParser(prog='PROG', prefix_chars='+/')\n" ">>> parser.print_help()\n" @@ -763,24 +776,24 @@ msgid "" " +h, ++help show this help message and exit" msgstr "" -#: library/argparse.rst:537 +#: library/argparse.rst:549 msgid "exit_on_error" msgstr "" -#: library/argparse.rst:539 +#: library/argparse.rst:551 msgid "" "Normally, when you pass an invalid argument list to the :meth:" "`~ArgumentParser.parse_args` method of an :class:`ArgumentParser`, it will " "print a *message* to :data:`sys.stderr` and exit with a status code of 2." msgstr "" -#: library/argparse.rst:543 +#: library/argparse.rst:555 msgid "" "If the user would like to catch errors manually, the feature can be enabled " "by setting ``exit_on_error`` to ``False``::" msgstr "" -#: library/argparse.rst:546 +#: library/argparse.rst:558 msgid "" ">>> parser = argparse.ArgumentParser(exit_on_error=False)\n" ">>> parser.add_argument('--integers', type=int)\n" @@ -795,77 +808,81 @@ msgid "" "Catching an argumentError" msgstr "" -#: library/argparse.rst:560 +#: library/argparse.rst:572 msgid "The add_argument() method" msgstr "" -#: library/argparse.rst:566 +#: library/argparse.rst:578 msgid "" "Define how a single command-line argument should be parsed. Each parameter " "has its own more detailed description below, but in short they are:" msgstr "" -#: library/argparse.rst:569 +#: library/argparse.rst:581 msgid "" "`name or flags`_ - Either a name or a list of option strings, e.g. ``'foo'`` " "or ``'-f', '--foo'``." msgstr "" -#: library/argparse.rst:572 +#: library/argparse.rst:584 msgid "" "action_ - The basic type of action to be taken when this argument is " "encountered at the command line." msgstr "" -#: library/argparse.rst:575 +#: library/argparse.rst:587 msgid "nargs_ - The number of command-line arguments that should be consumed." msgstr "" -#: library/argparse.rst:577 +#: library/argparse.rst:589 msgid "" "const_ - A constant value required by some action_ and nargs_ selections." msgstr "" -#: library/argparse.rst:579 +#: library/argparse.rst:591 msgid "" "default_ - The value produced if the argument is absent from the command " "line and if it is absent from the namespace object." msgstr "" -#: library/argparse.rst:582 +#: library/argparse.rst:594 msgid "" "type_ - The type to which the command-line argument should be converted." msgstr "" -#: library/argparse.rst:584 +#: library/argparse.rst:596 msgid "choices_ - A sequence of the allowable values for the argument." msgstr "" -#: library/argparse.rst:586 +#: library/argparse.rst:598 msgid "" "required_ - Whether or not the command-line option may be omitted (optionals " "only)." msgstr "" -#: library/argparse.rst:589 +#: library/argparse.rst:601 msgid "help_ - A brief description of what the argument does." msgstr "" -#: library/argparse.rst:591 +#: library/argparse.rst:603 msgid "metavar_ - A name for the argument in usage messages." msgstr "" -#: library/argparse.rst:593 +#: library/argparse.rst:605 msgid "" "dest_ - The name of the attribute to be added to the object returned by :" "meth:`parse_args`." msgstr "" -#: library/argparse.rst:602 +#: library/argparse.rst:608 +msgid "deprecated_ - Whether or not use of the argument is deprecated." +msgstr "" + +#: library/argparse.rst:616 msgid "name or flags" msgstr "" -#: library/argparse.rst:604 +#: library/argparse.rst:618 msgid "" "The :meth:`~ArgumentParser.add_argument` method must know whether an " "optional argument, like ``-f`` or ``--foo``, or a positional argument, like " @@ -874,30 +891,30 @@ msgid "" "or a simple argument name." msgstr "" -#: library/argparse.rst:610 +#: library/argparse.rst:624 msgid "For example, an optional argument could be created like::" msgstr "" -#: library/argparse.rst:612 +#: library/argparse.rst:626 msgid ">>> parser.add_argument('-f', '--foo')" msgstr "" -#: library/argparse.rst:614 +#: library/argparse.rst:628 msgid "while a positional argument could be created like::" msgstr "" -#: library/argparse.rst:616 +#: library/argparse.rst:630 msgid ">>> parser.add_argument('bar')" msgstr "" -#: library/argparse.rst:618 +#: library/argparse.rst:632 msgid "" "When :meth:`~ArgumentParser.parse_args` is called, optional arguments will " "be identified by the ``-`` prefix, and the remaining arguments will be " "assumed to be positional::" msgstr "" -#: library/argparse.rst:622 +#: library/argparse.rst:636 msgid "" ">>> parser = argparse.ArgumentParser(prog='PROG')\n" ">>> parser.add_argument('-f', '--foo')\n" @@ -911,11 +928,11 @@ msgid "" "PROG: error: the following arguments are required: bar" msgstr "" -#: library/argparse.rst:637 +#: library/argparse.rst:651 msgid "action" msgstr "" -#: library/argparse.rst:639 +#: library/argparse.rst:653 msgid "" ":class:`ArgumentParser` objects associate command-line arguments with " "actions. These actions can do just about anything with the command-line " @@ -925,13 +942,13 @@ msgid "" "be handled. The supplied actions are:" msgstr "" -#: library/argparse.rst:645 +#: library/argparse.rst:659 msgid "" "``'store'`` - This just stores the argument's value. This is the default " "action." msgstr "" -#: library/argparse.rst:648 +#: library/argparse.rst:662 msgid "" "``'store_const'`` - This stores the value specified by the const_ keyword " "argument; note that the const_ keyword argument defaults to ``None``. The " @@ -939,7 +956,7 @@ msgid "" "specify some sort of flag. For example::" msgstr "" -#: library/argparse.rst:653 +#: library/argparse.rst:667 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument('--foo', action='store_const', const=42)\n" @@ -947,7 +964,7 @@ msgid "" "Namespace(foo=42)" msgstr "" -#: library/argparse.rst:658 +#: library/argparse.rst:672 msgid "" "``'store_true'`` and ``'store_false'`` - These are special cases of " "``'store_const'`` used for storing the values ``True`` and ``False`` " @@ -955,7 +972,7 @@ msgid "" "``True`` respectively::" msgstr "" -#: library/argparse.rst:663 +#: library/argparse.rst:677 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument('--foo', action='store_true')\n" @@ -965,7 +982,7 @@ msgid "" "Namespace(foo=True, bar=False, baz=True)" msgstr "" -#: library/argparse.rst:670 +#: library/argparse.rst:684 msgid "" "``'append'`` - This stores a list, and appends each argument value to the " "list. It is useful to allow an option to be specified multiple times. If the " @@ -974,7 +991,7 @@ msgid "" "after those default values. Example usage::" msgstr "" -#: library/argparse.rst:676 +#: library/argparse.rst:690 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument('--foo', action='append')\n" @@ -982,7 +999,7 @@ msgid "" "Namespace(foo=['1', '2'])" msgstr "" -#: library/argparse.rst:681 +#: library/argparse.rst:695 msgid "" "``'append_const'`` - This stores a list, and appends the value specified by " "the const_ keyword argument to the list; note that the const_ keyword " @@ -991,7 +1008,7 @@ msgid "" "example::" msgstr "" -#: library/argparse.rst:687 +#: library/argparse.rst:701 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument('--str', dest='types', action='append_const', " @@ -1002,7 +1019,7 @@ msgid "" "Namespace(types=[, ])" msgstr "" -#: library/argparse.rst:693 +#: library/argparse.rst:707 msgid "" "``'extend'`` - This stores a list and appends each item from the multi-value " "argument list to it. The ``'extend'`` action is typically used with the " @@ -1011,7 +1028,7 @@ msgid "" "will be appended to the list. Example usage::" msgstr "" -#: library/argparse.rst:701 +#: library/argparse.rst:715 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument(\"--foo\", action=\"extend\", nargs=\"+\", " @@ -1021,13 +1038,13 @@ msgid "" "Namespace(foo=['f1', 'f2', 'f3', 'f4'])" msgstr "" -#: library/argparse.rst:708 +#: library/argparse.rst:722 msgid "" "``'count'`` - This counts the number of times a keyword argument occurs. For " "example, this is useful for increasing verbosity levels::" msgstr "" -#: library/argparse.rst:711 +#: library/argparse.rst:725 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument('--verbose', '-v', action='count', default=0)\n" @@ -1035,11 +1052,11 @@ msgid "" "Namespace(verbose=3)" msgstr "" -#: library/argparse.rst:716 +#: library/argparse.rst:730 msgid "Note, the *default* will be ``None`` unless explicitly set to *0*." msgstr "" -#: library/argparse.rst:718 +#: library/argparse.rst:732 msgid "" "``'help'`` - This prints a complete help message for all the options in the " "current parser and then exits. By default a help action is automatically " @@ -1047,14 +1064,14 @@ msgid "" "output is created." msgstr "" -#: library/argparse.rst:723 +#: library/argparse.rst:737 msgid "" "``'version'`` - This expects a ``version=`` keyword argument in the :meth:" "`~ArgumentParser.add_argument` call, and prints version information and " "exits when invoked::" msgstr "" -#: library/argparse.rst:727 +#: library/argparse.rst:741 msgid "" ">>> import argparse\n" ">>> parser = argparse.ArgumentParser(prog='PROG')\n" @@ -1064,13 +1081,13 @@ msgid "" "PROG 2.0" msgstr "" -#: library/argparse.rst:733 +#: library/argparse.rst:747 msgid "" "Only actions that consume command-line arguments (e.g. ``'store'``, " "``'append'`` or ``'extend'``) can be used with positional arguments." msgstr "" -#: library/argparse.rst:738 +#: library/argparse.rst:752 msgid "" "You may also specify an arbitrary action by passing an :class:`Action` " "subclass or other object that implements the same interface. The :class:`!" @@ -1078,7 +1095,7 @@ msgid "" "boolean actions such as ``--foo`` and ``--no-foo``::" msgstr "" -#: library/argparse.rst:743 +#: library/argparse.rst:757 msgid "" ">>> import argparse\n" ">>> parser = argparse.ArgumentParser()\n" @@ -1087,7 +1104,7 @@ msgid "" "Namespace(foo=False)" msgstr "" -#: library/argparse.rst:751 +#: library/argparse.rst:765 msgid "" "The recommended way to create a custom action is to extend :class:`Action`, " "overriding the :meth:`!__call__` method and optionally the :meth:`!__init__` " @@ -1096,11 +1113,11 @@ msgid "" "their registered name." msgstr "" -#: library/argparse.rst:756 +#: library/argparse.rst:770 msgid "An example of a custom action::" msgstr "" -#: library/argparse.rst:758 +#: library/argparse.rst:772 msgid "" ">>> class FooAction(argparse.Action):\n" "... def __init__(self, option_strings, dest, nargs=None, **kwargs):\n" @@ -1121,15 +1138,15 @@ msgid "" "Namespace(bar='1', foo='2')" msgstr "" -#: library/argparse.rst:776 +#: library/argparse.rst:790 msgid "For more details, see :class:`Action`." msgstr "" -#: library/argparse.rst:782 +#: library/argparse.rst:796 msgid "nargs" msgstr "" -#: library/argparse.rst:784 +#: library/argparse.rst:798 msgid "" ":class:`ArgumentParser` objects usually associate a single command-line " "argument with a single action to be taken. The ``nargs`` keyword argument " @@ -1138,13 +1155,13 @@ msgid "" "are:" msgstr "" -#: library/argparse.rst:789 +#: library/argparse.rst:803 msgid "" "``N`` (an integer). ``N`` arguments from the command line will be gathered " "together into a list. For example::" msgstr "" -#: library/argparse.rst:792 +#: library/argparse.rst:806 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument('--foo', nargs=2)\n" @@ -1153,13 +1170,13 @@ msgid "" "Namespace(bar=['c'], foo=['a', 'b'])" msgstr "" -#: library/argparse.rst:798 +#: library/argparse.rst:812 msgid "" "Note that ``nargs=1`` produces a list of one item. This is different from " "the default, in which the item is produced by itself." msgstr "" -#: library/argparse.rst:803 +#: library/argparse.rst:817 msgid "" "``'?'``. One argument will be consumed from the command line if possible, " "and produced as a single item. If no command-line argument is present, the " @@ -1169,7 +1186,7 @@ msgid "" "produced. Some examples to illustrate this::" msgstr "" -#: library/argparse.rst:810 +#: library/argparse.rst:824 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument('--foo', nargs='?', const='c', default='d')\n" @@ -1182,13 +1199,13 @@ msgid "" "Namespace(bar='d', foo='d')" msgstr "" -#: library/argparse.rst:820 +#: library/argparse.rst:834 msgid "" "One of the more common uses of ``nargs='?'`` is to allow optional input and " "output files::" msgstr "" -#: library/argparse.rst:823 +#: library/argparse.rst:837 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument('infile', nargs='?', type=argparse.FileType('r'),\n" @@ -1203,7 +1220,7 @@ msgid "" " outfile=<_io.TextIOWrapper name='' encoding='UTF-8'>)" msgstr "" -#: library/argparse.rst:837 +#: library/argparse.rst:851 msgid "" "``'*'``. All command-line arguments present are gathered into a list. Note " "that it generally doesn't make much sense to have more than one positional " @@ -1211,7 +1228,7 @@ msgid "" "``nargs='*'`` is possible. For example::" msgstr "" -#: library/argparse.rst:842 +#: library/argparse.rst:856 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument('--foo', nargs='*')\n" @@ -1221,14 +1238,14 @@ msgid "" "Namespace(bar=['1', '2'], baz=['a', 'b'], foo=['x', 'y'])" msgstr "" -#: library/argparse.rst:851 +#: library/argparse.rst:865 msgid "" "``'+'``. Just like ``'*'``, all command-line args present are gathered into " "a list. Additionally, an error message will be generated if there wasn't at " "least one command-line argument present. For example::" msgstr "" -#: library/argparse.rst:855 +#: library/argparse.rst:869 msgid "" ">>> parser = argparse.ArgumentParser(prog='PROG')\n" ">>> parser.add_argument('foo', nargs='+')\n" @@ -1239,7 +1256,7 @@ msgid "" "PROG: error: the following arguments are required: foo" msgstr "" -#: library/argparse.rst:863 +#: library/argparse.rst:877 msgid "" "If the ``nargs`` keyword argument is not provided, the number of arguments " "consumed is determined by the action_. Generally this means a single " @@ -1248,11 +1265,11 @@ msgid "" "``'store_const'``) set ``nargs=0``." msgstr "" -#: library/argparse.rst:873 +#: library/argparse.rst:887 msgid "const" msgstr "" -#: library/argparse.rst:875 +#: library/argparse.rst:889 msgid "" "The ``const`` argument of :meth:`~ArgumentParser.add_argument` is used to " "hold constant values that are not read from the command line but are " @@ -1260,7 +1277,7 @@ msgid "" "common uses of it are:" msgstr "" -#: library/argparse.rst:879 +#: library/argparse.rst:893 msgid "" "When :meth:`~ArgumentParser.add_argument` is called with " "``action='store_const'`` or ``action='append_const'``. These actions add " @@ -1270,7 +1287,7 @@ msgid "" "receive a default value of ``None``." msgstr "" -#: library/argparse.rst:887 +#: library/argparse.rst:901 msgid "" "When :meth:`~ArgumentParser.add_argument` is called with option strings " "(like ``-f`` or ``--foo``) and ``nargs='?'``. This creates an optional " @@ -1280,17 +1297,17 @@ msgid "" "to be ``None`` instead. See the nargs_ description for examples." msgstr "" -#: library/argparse.rst:894 +#: library/argparse.rst:908 msgid "" "``const=None`` by default, including when ``action='append_const'`` or " "``action='store_const'``." msgstr "" -#: library/argparse.rst:901 +#: library/argparse.rst:915 msgid "default" msgstr "" -#: library/argparse.rst:903 +#: library/argparse.rst:917 msgid "" "All optional arguments and some positional arguments may be omitted at the " "command line. The ``default`` keyword argument of :meth:`~ArgumentParser." @@ -1300,7 +1317,7 @@ msgid "" "command line::" msgstr "" -#: library/argparse.rst:910 +#: library/argparse.rst:924 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument('--foo', default=42)\n" @@ -1310,13 +1327,13 @@ msgid "" "Namespace(foo=42)" msgstr "" -#: library/argparse.rst:917 +#: library/argparse.rst:931 msgid "" "If the target namespace already has an attribute set, the action *default* " "will not overwrite it::" msgstr "" -#: library/argparse.rst:920 +#: library/argparse.rst:934 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument('--foo', default=42)\n" @@ -1324,7 +1341,7 @@ msgid "" "Namespace(foo=101)" msgstr "" -#: library/argparse.rst:925 +#: library/argparse.rst:939 msgid "" "If the ``default`` value is a string, the parser parses the value as if it " "were a command-line argument. In particular, the parser applies any type_ " @@ -1332,7 +1349,7 @@ msgid "" "`Namespace` return value. Otherwise, the parser uses the value as is::" msgstr "" -#: library/argparse.rst:930 +#: library/argparse.rst:944 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument('--length', default='10', type=int)\n" @@ -1341,13 +1358,13 @@ msgid "" "Namespace(length=10, width=10.5)" msgstr "" -#: library/argparse.rst:936 +#: library/argparse.rst:950 msgid "" "For positional arguments with nargs_ equal to ``?`` or ``*``, the " "``default`` value is used when no command-line argument was present::" msgstr "" -#: library/argparse.rst:939 +#: library/argparse.rst:953 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument('foo', nargs='?', default=42)\n" @@ -1357,20 +1374,20 @@ msgid "" "Namespace(foo=42)" msgstr "" -#: library/argparse.rst:946 +#: library/argparse.rst:960 msgid "" "For required_ arguments, the ``default`` value is ignored. For example, this " "applies to positional arguments with nargs_ values other than ``?`` or " "``*``, or optional arguments marked as ``required=True``." msgstr "" -#: library/argparse.rst:950 +#: library/argparse.rst:964 msgid "" "Providing ``default=argparse.SUPPRESS`` causes no attribute to be added if " "the command-line argument was not present::" msgstr "" -#: library/argparse.rst:953 +#: library/argparse.rst:967 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument('--foo', default=argparse.SUPPRESS)\n" @@ -1380,11 +1397,11 @@ msgid "" "Namespace(foo='1')" msgstr "" -#: library/argparse.rst:964 +#: library/argparse.rst:978 msgid "type" msgstr "" -#: library/argparse.rst:966 +#: library/argparse.rst:980 msgid "" "By default, the parser reads command-line arguments in as simple strings. " "However, quite often the command-line string should instead be interpreted " @@ -1393,13 +1410,13 @@ msgid "" "checking and type conversions to be performed." msgstr "" -#: library/argparse.rst:972 +#: library/argparse.rst:986 msgid "" "If the type_ keyword is used with the default_ keyword, the type converter " "is only applied if the default is a string." msgstr "" -#: library/argparse.rst:975 +#: library/argparse.rst:989 msgid "" "The argument to ``type`` can be a callable that accepts a single string or " "the name of a registered type (see :meth:`~ArgumentParser.register`) If the " @@ -1408,11 +1425,11 @@ msgid "" "is displayed. Other exception types are not handled." msgstr "" -#: library/argparse.rst:981 +#: library/argparse.rst:995 msgid "Common built-in types and functions can be used as type converters:" msgstr "" -#: library/argparse.rst:983 +#: library/argparse.rst:997 msgid "" "import argparse\n" "import pathlib\n" @@ -1427,11 +1444,11 @@ msgid "" "parser.add_argument('datapath', type=pathlib.Path)" msgstr "" -#: library/argparse.rst:996 +#: library/argparse.rst:1010 msgid "User defined functions can be used as well:" msgstr "" -#: library/argparse.rst:998 +#: library/argparse.rst:1012 msgid "" ">>> def hyphenated(string):\n" "... return '-'.join([word[:4] for word in string.casefold().split()])\n" @@ -1442,14 +1459,14 @@ msgid "" "Namespace(short_title='\"the-tale-of-two-citi')" msgstr "" -#: library/argparse.rst:1008 +#: library/argparse.rst:1022 msgid "" "The :func:`bool` function is not recommended as a type converter. All it " "does is convert empty strings to ``False`` and non-empty strings to " "``True``. This is usually not what is desired." msgstr "" -#: library/argparse.rst:1012 +#: library/argparse.rst:1026 msgid "" "In general, the ``type`` keyword is a convenience that should only be used " "for simple conversions that can only raise one of the three supported " @@ -1457,7 +1474,7 @@ msgid "" "management should be done downstream after the arguments are parsed." msgstr "" -#: library/argparse.rst:1017 +#: library/argparse.rst:1031 msgid "" "For example, JSON or YAML conversions have complex error cases that require " "better reporting than can be given by the ``type`` keyword. A :exc:`~json." @@ -1465,7 +1482,7 @@ msgid "" "exception would not be handled at all." msgstr "" -#: library/argparse.rst:1022 +#: library/argparse.rst:1036 msgid "" "Even :class:`~argparse.FileType` has its limitations for use with the " "``type`` keyword. If one argument uses :class:`~argparse.FileType` and then " @@ -1475,17 +1492,17 @@ msgid "" "files." msgstr "" -#: library/argparse.rst:1029 +#: library/argparse.rst:1043 msgid "" "For type checkers that simply check against a fixed set of values, consider " "using the choices_ keyword instead." msgstr "" -#: library/argparse.rst:1036 +#: library/argparse.rst:1050 msgid "choices" msgstr "" -#: library/argparse.rst:1038 +#: library/argparse.rst:1052 msgid "" "Some command-line arguments should be selected from a restricted set of " "values. These can be handled by passing a sequence object as the *choices* " @@ -1494,7 +1511,7 @@ msgid "" "be displayed if the argument was not one of the acceptable values::" msgstr "" -#: library/argparse.rst:1044 +#: library/argparse.rst:1058 msgid "" ">>> parser = argparse.ArgumentParser(prog='game.py')\n" ">>> parser.add_argument('move', choices=['rock', 'paper', 'scissors'])\n" @@ -1506,26 +1523,26 @@ msgid "" "'paper', 'scissors')" msgstr "" -#: library/argparse.rst:1053 +#: library/argparse.rst:1067 msgid "" "Note that inclusion in the *choices* sequence is checked after any type_ " "conversions have been performed, so the type of the objects in the *choices* " "sequence should match the type_ specified." msgstr "" -#: library/argparse.rst:1057 +#: library/argparse.rst:1071 msgid "" "Any sequence can be passed as the *choices* value, so :class:`list` " "objects, :class:`tuple` objects, and custom sequences are all supported." msgstr "" -#: library/argparse.rst:1060 +#: library/argparse.rst:1074 msgid "" "Use of :class:`enum.Enum` is not recommended because it is difficult to " "control its appearance in usage, help, and error messages." msgstr "" -#: library/argparse.rst:1063 +#: library/argparse.rst:1077 msgid "" "Formatted choices override the default *metavar* which is normally derived " "from *dest*. This is usually what you want because the user never sees the " @@ -1533,11 +1550,11 @@ msgid "" "are many choices), just specify an explicit metavar_." msgstr "" -#: library/argparse.rst:1072 +#: library/argparse.rst:1086 msgid "required" msgstr "" -#: library/argparse.rst:1074 +#: library/argparse.rst:1088 msgid "" "In general, the :mod:`!argparse` module assumes that flags like ``-f`` and " "``--bar`` indicate *optional* arguments, which can always be omitted at the " @@ -1545,7 +1562,7 @@ msgid "" "the ``required=`` keyword argument to :meth:`~ArgumentParser.add_argument`::" msgstr "" -#: library/argparse.rst:1079 +#: library/argparse.rst:1093 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument('--foo', required=True)\n" @@ -1556,24 +1573,24 @@ msgid "" ": error: the following arguments are required: --foo" msgstr "" -#: library/argparse.rst:1087 +#: library/argparse.rst:1101 msgid "" "As the example shows, if an option is marked as ``required``, :meth:" "`~ArgumentParser.parse_args` will report an error if that option is not " "present at the command line." msgstr "" -#: library/argparse.rst:1093 +#: library/argparse.rst:1107 msgid "" "Required options are generally considered bad form because users expect " "*options* to be *optional*, and thus they should be avoided when possible." msgstr "" -#: library/argparse.rst:1100 +#: library/argparse.rst:1114 msgid "help" msgstr "" -#: library/argparse.rst:1102 +#: library/argparse.rst:1116 msgid "" "The ``help`` value is a string containing a brief description of the " "argument. When a user requests help (usually by using ``-h`` or ``--help`` " @@ -1581,7 +1598,7 @@ msgid "" "each argument." msgstr "" -#: library/argparse.rst:1107 +#: library/argparse.rst:1121 msgid "" "The ``help`` strings can include various format specifiers to avoid " "repetition of things like the program name or the argument default_. The " @@ -1590,7 +1607,7 @@ msgid "" "``%(type)s``, etc.::" msgstr "" -#: library/argparse.rst:1112 +#: library/argparse.rst:1126 msgid "" ">>> parser = argparse.ArgumentParser(prog='frobble')\n" ">>> parser.add_argument('bar', nargs='?', type=int, default=42,\n" @@ -1605,19 +1622,19 @@ msgid "" " -h, --help show this help message and exit" msgstr "" -#: library/argparse.rst:1124 +#: library/argparse.rst:1138 msgid "" "As the help string supports %-formatting, if you want a literal ``%`` to " "appear in the help string, you must escape it as ``%%``." msgstr "" -#: library/argparse.rst:1127 +#: library/argparse.rst:1141 msgid "" ":mod:`!argparse` supports silencing the help entry for certain options, by " "setting the ``help`` value to ``argparse.SUPPRESS``::" msgstr "" -#: library/argparse.rst:1130 +#: library/argparse.rst:1144 msgid "" ">>> parser = argparse.ArgumentParser(prog='frobble')\n" ">>> parser.add_argument('--foo', help=argparse.SUPPRESS)\n" @@ -1628,11 +1645,11 @@ msgid "" " -h, --help show this help message and exit" msgstr "" -#: library/argparse.rst:1142 +#: library/argparse.rst:1156 msgid "metavar" msgstr "" -#: library/argparse.rst:1144 +#: library/argparse.rst:1158 msgid "" "When :class:`ArgumentParser` generates help messages, it needs some way to " "refer to each expected argument. By default, :class:`!ArgumentParser` " @@ -1644,7 +1661,7 @@ msgid "" "command-line argument will be referred to as ``FOO``. An example::" msgstr "" -#: library/argparse.rst:1153 +#: library/argparse.rst:1167 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument('--foo')\n" @@ -1662,11 +1679,11 @@ msgid "" " --foo FOO" msgstr "" -#: library/argparse.rst:1168 +#: library/argparse.rst:1182 msgid "An alternative name can be specified with ``metavar``::" msgstr "" -#: library/argparse.rst:1170 +#: library/argparse.rst:1184 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument('--foo', metavar='YYY')\n" @@ -1684,21 +1701,21 @@ msgid "" " --foo YYY" msgstr "" -#: library/argparse.rst:1185 +#: library/argparse.rst:1199 msgid "" "Note that ``metavar`` only changes the *displayed* name - the name of the " "attribute on the :meth:`~ArgumentParser.parse_args` object is still " "determined by the dest_ value." msgstr "" -#: library/argparse.rst:1189 +#: library/argparse.rst:1203 msgid "" "Different values of ``nargs`` may cause the metavar to be used multiple " "times. Providing a tuple to ``metavar`` specifies a different display for " "each of the arguments::" msgstr "" -#: library/argparse.rst:1193 +#: library/argparse.rst:1207 msgid "" ">>> parser = argparse.ArgumentParser(prog='PROG')\n" ">>> parser.add_argument('-x', nargs=2)\n" @@ -1712,11 +1729,11 @@ msgid "" " --foo bar baz" msgstr "" -#: library/argparse.rst:1208 +#: library/argparse.rst:1222 msgid "dest" msgstr "" -#: library/argparse.rst:1210 +#: library/argparse.rst:1224 msgid "" "Most :class:`ArgumentParser` actions add some value as an attribute of the " "object returned by :meth:`~ArgumentParser.parse_args`. The name of this " @@ -1726,7 +1743,7 @@ msgid "" "add_argument`::" msgstr "" -#: library/argparse.rst:1217 +#: library/argparse.rst:1231 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument('bar')\n" @@ -1734,7 +1751,7 @@ msgid "" "Namespace(bar='XXX')" msgstr "" -#: library/argparse.rst:1222 +#: library/argparse.rst:1236 msgid "" "For optional argument actions, the value of ``dest`` is normally inferred " "from the option strings. :class:`ArgumentParser` generates the value of " @@ -1746,7 +1763,7 @@ msgid "" "below illustrate this behavior::" msgstr "" -#: library/argparse.rst:1231 +#: library/argparse.rst:1245 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument('-f', '--foo-bar', '--foo')\n" @@ -1757,11 +1774,11 @@ msgid "" "Namespace(foo_bar='1', x='2')" msgstr "" -#: library/argparse.rst:1239 +#: library/argparse.rst:1253 msgid "``dest`` allows a custom attribute name to be provided::" msgstr "" -#: library/argparse.rst:1241 +#: library/argparse.rst:1255 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument('--foo', dest='bar')\n" @@ -1769,11 +1786,38 @@ msgid "" "Namespace(bar='XXX')" msgstr "" -#: library/argparse.rst:1247 +#: library/argparse.rst:1264 +msgid "deprecated" +msgstr "" + +#: library/argparse.rst:1266 +msgid "" +"During a project's lifetime, some arguments may need to be removed from the " +"command line. Before removing them, you should inform your users that the " +"arguments are deprecated and will be removed. The ``deprecated`` keyword " +"argument of :meth:`~ArgumentParser.add_argument`, which defaults to " +"``False``, specifies if the argument is deprecated and will be removed in " +"the future. For arguments, if ``deprecated`` is ``True``, then a warning " +"will be printed to :data:`sys.stderr` when the argument is used::" +msgstr "" + +#: library/argparse.rst:1276 +msgid "" +">>> import argparse\n" +">>> parser = argparse.ArgumentParser(prog='snake.py')\n" +">>> parser.add_argument('--legs', default=0, type=int, deprecated=True)\n" +">>> parser.parse_args([])\n" +"Namespace(legs=0)\n" +">>> parser.parse_args(['--legs', '4'])\n" +"snake.py: warning: option '--legs' is deprecated\n" +"Namespace(legs=4)" +msgstr "" + +#: library/argparse.rst:1289 msgid "Action classes" msgstr "" -#: library/argparse.rst:1249 +#: library/argparse.rst:1291 msgid "" ":class:`!Action` classes implement the Action API, a callable which returns " "a callable which processes arguments from the command-line. Any object which " @@ -1781,7 +1825,7 @@ msgid "" "`~ArgumentParser.add_argument`." msgstr "" -#: library/argparse.rst:1258 +#: library/argparse.rst:1300 msgid "" ":class:`!Action` objects are used by an :class:`ArgumentParser` to represent " "the information needed to parse a single argument from one or more strings " @@ -1790,7 +1834,7 @@ msgid "" "`ArgumentParser.add_argument` except for the ``action`` itself." msgstr "" -#: library/argparse.rst:1264 +#: library/argparse.rst:1306 msgid "" "Instances of :class:`!Action` (or return value of any callable to the " "``action`` parameter) should have attributes :attr:`!dest`, :attr:`!" @@ -1799,46 +1843,46 @@ msgid "" "is to call :meth:`!Action.__init__`." msgstr "" -#: library/argparse.rst:1272 +#: library/argparse.rst:1314 msgid "" ":class:`!Action` instances should be callable, so subclasses must override " "the :meth:`!__call__` method, which should accept four parameters:" msgstr "" -#: library/argparse.rst:1275 +#: library/argparse.rst:1317 msgid "" "*parser* - The :class:`ArgumentParser` object which contains this action." msgstr "" -#: library/argparse.rst:1277 +#: library/argparse.rst:1319 msgid "" "*namespace* - The :class:`Namespace` object that will be returned by :meth:" "`~ArgumentParser.parse_args`. Most actions add an attribute to this object " "using :func:`setattr`." msgstr "" -#: library/argparse.rst:1281 +#: library/argparse.rst:1323 msgid "" "*values* - The associated command-line arguments, with any type conversions " "applied. Type conversions are specified with the type_ keyword argument to :" "meth:`~ArgumentParser.add_argument`." msgstr "" -#: library/argparse.rst:1285 +#: library/argparse.rst:1327 msgid "" "*option_string* - The option string that was used to invoke this action. The " "``option_string`` argument is optional, and will be absent if the action is " "associated with a positional argument." msgstr "" -#: library/argparse.rst:1289 +#: library/argparse.rst:1331 msgid "" "The :meth:`!__call__` method may perform arbitrary actions, but will " "typically set attributes on the ``namespace`` based on ``dest`` and " "``values``." msgstr "" -#: library/argparse.rst:1294 +#: library/argparse.rst:1336 msgid "" ":class:`!Action` subclasses can define a :meth:`!format_usage` method that " "takes no argument and return a string which will be used when printing the " @@ -1846,47 +1890,47 @@ msgid "" "will be used." msgstr "" -#: library/argparse.rst:1300 +#: library/argparse.rst:1342 msgid "The parse_args() method" msgstr "" -#: library/argparse.rst:1304 +#: library/argparse.rst:1346 msgid "" "Convert argument strings to objects and assign them as attributes of the " "namespace. Return the populated namespace." msgstr "" -#: library/argparse.rst:1307 +#: library/argparse.rst:1349 msgid "" "Previous calls to :meth:`add_argument` determine exactly what objects are " "created and how they are assigned. See the documentation for :meth:`!" "add_argument` for details." msgstr "" -#: library/argparse.rst:1311 +#: library/argparse.rst:1353 msgid "" "args_ - List of strings to parse. The default is taken from :data:`sys." "argv`." msgstr "" -#: library/argparse.rst:1314 +#: library/argparse.rst:1356 msgid "" "namespace_ - An object to take the attributes. The default is a new empty :" "class:`Namespace` object." msgstr "" -#: library/argparse.rst:1319 +#: library/argparse.rst:1361 msgid "Option value syntax" msgstr "" -#: library/argparse.rst:1321 +#: library/argparse.rst:1363 msgid "" "The :meth:`~ArgumentParser.parse_args` method supports several ways of " "specifying the value of an option (if it takes one). In the simplest case, " "the option and its value are passed as two separate arguments::" msgstr "" -#: library/argparse.rst:1325 +#: library/argparse.rst:1367 msgid "" ">>> parser = argparse.ArgumentParser(prog='PROG')\n" ">>> parser.add_argument('-x')\n" @@ -1897,38 +1941,38 @@ msgid "" "Namespace(foo='FOO', x=None)" msgstr "" -#: library/argparse.rst:1333 +#: library/argparse.rst:1375 msgid "" "For long options (options with names longer than a single character), the " "option and value can also be passed as a single command-line argument, using " "``=`` to separate them::" msgstr "" -#: library/argparse.rst:1337 +#: library/argparse.rst:1379 msgid "" ">>> parser.parse_args(['--foo=FOO'])\n" "Namespace(foo='FOO', x=None)" msgstr "" -#: library/argparse.rst:1340 +#: library/argparse.rst:1382 msgid "" "For short options (options only one character long), the option and its " "value can be concatenated::" msgstr "" -#: library/argparse.rst:1343 +#: library/argparse.rst:1385 msgid "" ">>> parser.parse_args(['-xX'])\n" "Namespace(foo=None, x='X')" msgstr "" -#: library/argparse.rst:1346 +#: library/argparse.rst:1388 msgid "" "Several short options can be joined together, using only a single ``-`` " "prefix, as long as only the last option (or none of them) requires a value::" msgstr "" -#: library/argparse.rst:1349 +#: library/argparse.rst:1391 msgid "" ">>> parser = argparse.ArgumentParser(prog='PROG')\n" ">>> parser.add_argument('-x', action='store_true')\n" @@ -1938,11 +1982,11 @@ msgid "" "Namespace(x=True, y=True, z='Z')" msgstr "" -#: library/argparse.rst:1358 +#: library/argparse.rst:1400 msgid "Invalid arguments" msgstr "" -#: library/argparse.rst:1360 +#: library/argparse.rst:1402 msgid "" "While parsing the command line, :meth:`~ArgumentParser.parse_args` checks " "for a variety of errors, including ambiguous options, invalid types, invalid " @@ -1950,7 +1994,7 @@ msgid "" "an error, it exits and prints the error along with a usage message::" msgstr "" -#: library/argparse.rst:1365 +#: library/argparse.rst:1407 msgid "" ">>> parser = argparse.ArgumentParser(prog='PROG')\n" ">>> parser.add_argument('--foo', type=int)\n" @@ -1972,11 +2016,11 @@ msgid "" "PROG: error: extra arguments found: badger" msgstr "" -#: library/argparse.rst:1386 +#: library/argparse.rst:1428 msgid "Arguments containing ``-``" msgstr "" -#: library/argparse.rst:1388 +#: library/argparse.rst:1430 msgid "" "The :meth:`~ArgumentParser.parse_args` method attempts to give errors " "whenever the user has clearly made a mistake, but some situations are " @@ -1988,7 +2032,7 @@ msgid "" "negative numbers::" msgstr "" -#: library/argparse.rst:1396 +#: library/argparse.rst:1438 msgid "" ">>> parser = argparse.ArgumentParser(prog='PROG')\n" ">>> parser.add_argument('-x')\n" @@ -2021,7 +2065,7 @@ msgid "" "PROG: error: argument -1: expected one argument" msgstr "" -#: library/argparse.rst:1426 +#: library/argparse.rst:1468 msgid "" "If you have positional arguments that must begin with ``-`` and don't look " "like negative numbers, you can insert the pseudo-argument ``'--'`` which " @@ -2029,30 +2073,30 @@ msgid "" "positional argument::" msgstr "" -#: library/argparse.rst:1431 +#: library/argparse.rst:1473 msgid "" ">>> parser.parse_args(['--', '-f'])\n" "Namespace(foo='-f', one=None)" msgstr "" -#: library/argparse.rst:1434 +#: library/argparse.rst:1476 msgid "" "See also :ref:`the argparse howto on ambiguous arguments ` for more details." msgstr "" -#: library/argparse.rst:1440 +#: library/argparse.rst:1482 msgid "Argument abbreviations (prefix matching)" msgstr "" -#: library/argparse.rst:1442 +#: library/argparse.rst:1484 msgid "" "The :meth:`~ArgumentParser.parse_args` method :ref:`by default " "` allows long options to be abbreviated to a prefix, if the " "abbreviation is unambiguous (the prefix matches a unique option)::" msgstr "" -#: library/argparse.rst:1446 +#: library/argparse.rst:1488 msgid "" ">>> parser = argparse.ArgumentParser(prog='PROG')\n" ">>> parser.add_argument('-bacon')\n" @@ -2066,17 +2110,17 @@ msgid "" "PROG: error: ambiguous option: -ba could match -badger, -bacon" msgstr "" -#: library/argparse.rst:1457 +#: library/argparse.rst:1499 msgid "" "An error is produced for arguments that could produce more than one options. " "This feature can be disabled by setting :ref:`allow_abbrev` to ``False``." msgstr "" -#: library/argparse.rst:1463 +#: library/argparse.rst:1505 msgid "Beyond ``sys.argv``" msgstr "" -#: library/argparse.rst:1465 +#: library/argparse.rst:1507 msgid "" "Sometimes it may be useful to have an :class:`ArgumentParser` parse " "arguments other than those of :data:`sys.argv`. This can be accomplished by " @@ -2084,7 +2128,7 @@ msgid "" "useful for testing at the interactive prompt::" msgstr "" -#: library/argparse.rst:1470 +#: library/argparse.rst:1512 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument(\n" @@ -2099,24 +2143,24 @@ msgid "" "Namespace(accumulate=, integers=[1, 2, 3, 4])" msgstr "" -#: library/argparse.rst:1485 +#: library/argparse.rst:1527 msgid "The Namespace object" msgstr "" -#: library/argparse.rst:1489 +#: library/argparse.rst:1531 msgid "" "Simple class used by default by :meth:`~ArgumentParser.parse_args` to create " "an object holding attributes and return it." msgstr "" -#: library/argparse.rst:1492 +#: library/argparse.rst:1534 msgid "" "This class is deliberately simple, just an :class:`object` subclass with a " "readable string representation. If you prefer to have dict-like view of the " "attributes, you can use the standard Python idiom, :func:`vars`::" msgstr "" -#: library/argparse.rst:1496 +#: library/argparse.rst:1538 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument('--foo')\n" @@ -2125,14 +2169,14 @@ msgid "" "{'foo': 'BAR'}" msgstr "" -#: library/argparse.rst:1502 +#: library/argparse.rst:1544 msgid "" "It may also be useful to have an :class:`ArgumentParser` assign attributes " "to an already existing object, rather than a new :class:`Namespace` object. " "This can be achieved by specifying the ``namespace=`` keyword argument::" msgstr "" -#: library/argparse.rst:1506 +#: library/argparse.rst:1548 msgid "" ">>> class C:\n" "... pass\n" @@ -2145,15 +2189,15 @@ msgid "" "'BAR'" msgstr "" -#: library/argparse.rst:1518 +#: library/argparse.rst:1560 msgid "Other utilities" msgstr "" -#: library/argparse.rst:1521 +#: library/argparse.rst:1563 msgid "Sub-commands" msgstr "" -#: library/argparse.rst:1528 +#: library/argparse.rst:1570 msgid "" "Many programs split up their functionality into a number of subcommands, for " "example, the ``svn`` program can invoke subcommands like ``svn checkout``, " @@ -2168,69 +2212,69 @@ msgid "" "returns an :class:`!ArgumentParser` object that can be modified as usual." msgstr "" -#: library/argparse.rst:1540 +#: library/argparse.rst:1582 msgid "Description of parameters:" msgstr "" -#: library/argparse.rst:1542 +#: library/argparse.rst:1584 msgid "" "*title* - title for the sub-parser group in help output; by default " "\"subcommands\" if description is provided, otherwise uses title for " "positional arguments" msgstr "" -#: library/argparse.rst:1546 +#: library/argparse.rst:1588 msgid "" "*description* - description for the sub-parser group in help output, by " "default ``None``" msgstr "" -#: library/argparse.rst:1549 +#: library/argparse.rst:1591 msgid "" "*prog* - usage information that will be displayed with sub-command help, by " "default the name of the program and any positional arguments before the " "subparser argument" msgstr "" -#: library/argparse.rst:1553 +#: library/argparse.rst:1595 msgid "" "*parser_class* - class which will be used to create sub-parser instances, by " "default the class of the current parser (e.g. :class:`ArgumentParser`)" msgstr "" -#: library/argparse.rst:1556 +#: library/argparse.rst:1598 msgid "" "action_ - the basic type of action to be taken when this argument is " "encountered at the command line" msgstr "" -#: library/argparse.rst:1559 +#: library/argparse.rst:1601 msgid "" "dest_ - name of the attribute under which sub-command name will be stored; " "by default ``None`` and no value is stored" msgstr "" -#: library/argparse.rst:1562 +#: library/argparse.rst:1604 msgid "" "required_ - Whether or not a subcommand must be provided, by default " "``False`` (added in 3.7)" msgstr "" -#: library/argparse.rst:1565 +#: library/argparse.rst:1607 msgid "help_ - help for sub-parser group in help output, by default ``None``" msgstr "" -#: library/argparse.rst:1567 +#: library/argparse.rst:1609 msgid "" "metavar_ - string presenting available subcommands in help; by default it is " "``None`` and presents subcommands in form {cmd1, cmd2, ..}" msgstr "" -#: library/argparse.rst:1570 +#: library/argparse.rst:1612 msgid "Some example usage::" msgstr "" -#: library/argparse.rst:1572 +#: library/argparse.rst:1614 msgid "" ">>> # create the top-level parser\n" ">>> parser = argparse.ArgumentParser(prog='PROG')\n" @@ -2253,7 +2297,7 @@ msgid "" "Namespace(baz='Z', foo=True)" msgstr "" -#: library/argparse.rst:1591 +#: library/argparse.rst:1633 msgid "" "Note that the object returned by :meth:`parse_args` will only contain " "attributes for the main parser and the subparser that was selected by the " @@ -2263,7 +2307,7 @@ msgid "" "``baz`` attributes are present." msgstr "" -#: library/argparse.rst:1598 +#: library/argparse.rst:1640 msgid "" "Similarly, when a help message is requested from a subparser, only the help " "for that particular parser will be printed. The help message will not " @@ -2272,7 +2316,7 @@ msgid "" "to :meth:`~_SubParsersAction.add_parser` as above.)" msgstr "" -#: library/argparse.rst:1606 +#: library/argparse.rst:1648 msgid "" ">>> parser.parse_args(['--help'])\n" "usage: PROG [-h] [--foo] {a,b} ...\n" @@ -2303,14 +2347,14 @@ msgid "" " --baz {X,Y,Z} baz help" msgstr "" -#: library/argparse.rst:1634 +#: library/argparse.rst:1676 msgid "" "The :meth:`add_subparsers` method also supports ``title`` and " "``description`` keyword arguments. When either is present, the subparser's " "commands will appear in their own group in the help output. For example::" msgstr "" -#: library/argparse.rst:1638 +#: library/argparse.rst:1680 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> subparsers = parser.add_subparsers(title='subcommands',\n" @@ -2330,14 +2374,15 @@ msgid "" " {foo,bar} additional help" msgstr "" -#: library/argparse.rst:1655 +#: library/argparse.rst:1697 msgid "" -"Furthermore, ``add_parser`` supports an additional ``aliases`` argument, " -"which allows multiple strings to refer to the same subparser. This example, " -"like ``svn``, aliases ``co`` as a shorthand for ``checkout``::" +"Furthermore, :meth:`~_SubParsersAction.add_parser` supports an additional " +"*aliases* argument, which allows multiple strings to refer to the same " +"subparser. This example, like ``svn``, aliases ``co`` as a shorthand for " +"``checkout``::" msgstr "" -#: library/argparse.rst:1659 +#: library/argparse.rst:1702 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> subparsers = parser.add_subparsers()\n" @@ -2347,15 +2392,21 @@ msgid "" "Namespace(foo='bar')" msgstr "" -#: library/argparse.rst:1666 +#: library/argparse.rst:1709 msgid "" -"One particularly effective way of handling sub-commands is to combine the " -"use of the :meth:`add_subparsers` method with calls to :meth:`set_defaults` " -"so that each subparser knows which Python function it should execute. For " +":meth:`~_SubParsersAction.add_parser` supports also an additional " +"*deprecated* argument, which allows to deprecate the subparser." +msgstr "" + +#: library/argparse.rst:1723 +msgid "" +"One particularly effective way of handling subcommands is to combine the use " +"of the :meth:`add_subparsers` method with calls to :meth:`set_defaults` so " +"that each subparser knows which Python function it should execute. For " "example::" msgstr "" -#: library/argparse.rst:1671 +#: library/argparse.rst:1728 msgid "" ">>> # subcommand functions\n" ">>> def foo(args):\n" @@ -2390,7 +2441,7 @@ msgid "" "((XYZYX))" msgstr "" -#: library/argparse.rst:1703 +#: library/argparse.rst:1760 msgid "" "This way, you can let :meth:`parse_args` do the job of calling the " "appropriate function after argument parsing is complete. Associating " @@ -2400,7 +2451,7 @@ msgid "" "argument to the :meth:`add_subparsers` call will work::" msgstr "" -#: library/argparse.rst:1710 +#: library/argparse.rst:1767 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> subparsers = parser.add_subparsers(dest='subparser_name')\n" @@ -2412,15 +2463,15 @@ msgid "" "Namespace(subparser_name='2', y='frobble')" msgstr "" -#: library/argparse.rst:1719 +#: library/argparse.rst:1776 msgid "New *required* keyword-only parameter." msgstr "" -#: library/argparse.rst:1724 +#: library/argparse.rst:1781 msgid "FileType objects" msgstr "" -#: library/argparse.rst:1728 +#: library/argparse.rst:1785 msgid "" "The :class:`FileType` factory creates objects that can be passed to the type " "argument of :meth:`ArgumentParser.add_argument`. Arguments that have :class:" @@ -2429,7 +2480,7 @@ msgid "" "the :func:`open` function for more details)::" msgstr "" -#: library/argparse.rst:1734 +#: library/argparse.rst:1791 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument('--raw', type=argparse.FileType('wb', 0))\n" @@ -2440,14 +2491,14 @@ msgid "" "raw=<_io.FileIO name='raw.dat' mode='wb'>)" msgstr "" -#: library/argparse.rst:1740 +#: library/argparse.rst:1797 msgid "" "FileType objects understand the pseudo-argument ``'-'`` and automatically " "convert this into :data:`sys.stdin` for readable :class:`FileType` objects " "and :data:`sys.stdout` for writable :class:`FileType` objects::" msgstr "" -#: library/argparse.rst:1744 +#: library/argparse.rst:1801 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument('infile', type=argparse.FileType('r'))\n" @@ -2455,15 +2506,15 @@ msgid "" "Namespace(infile=<_io.TextIOWrapper name='' encoding='UTF-8'>)" msgstr "" -#: library/argparse.rst:1749 +#: library/argparse.rst:1806 msgid "Added the *encodings* and *errors* parameters." msgstr "" -#: library/argparse.rst:1754 +#: library/argparse.rst:1811 msgid "Argument groups" msgstr "" -#: library/argparse.rst:1759 +#: library/argparse.rst:1816 msgid "" "By default, :class:`ArgumentParser` groups command-line arguments into " "\"positional arguments\" and \"options\" when displaying help messages. When " @@ -2472,7 +2523,7 @@ msgid "" "method::" msgstr "" -#: library/argparse.rst:1765 +#: library/argparse.rst:1822 msgid "" ">>> parser = argparse.ArgumentParser(prog='PROG', add_help=False)\n" ">>> group = parser.add_argument_group('group')\n" @@ -2486,7 +2537,7 @@ msgid "" " --foo FOO foo help" msgstr "" -#: library/argparse.rst:1776 +#: library/argparse.rst:1833 msgid "" "The :meth:`add_argument_group` method returns an argument group object which " "has an :meth:`~ArgumentParser.add_argument` method just like a regular :" @@ -2497,7 +2548,7 @@ msgid "" "this display::" msgstr "" -#: library/argparse.rst:1784 +#: library/argparse.rst:1841 msgid "" ">>> parser = argparse.ArgumentParser(prog='PROG', add_help=False)\n" ">>> group1 = parser.add_argument_group('group1', 'group1 description')\n" @@ -2518,7 +2569,7 @@ msgid "" " --bar BAR bar help" msgstr "" -#: library/argparse.rst:1802 +#: library/argparse.rst:1859 msgid "" "The optional, keyword-only parameters argument_default_ and " "conflict_handler_ allow for finer-grained control of the behavior of the " @@ -2527,13 +2578,13 @@ msgid "" "rather than the entire parser." msgstr "" -#: library/argparse.rst:1807 +#: library/argparse.rst:1864 msgid "" "Note that any arguments not in your user-defined groups will end up back in " "the usual \"positional arguments\" and \"optional arguments\" sections." msgstr "" -#: library/argparse.rst:1810 +#: library/argparse.rst:1867 msgid "" "Calling :meth:`add_argument_group` on an argument group is deprecated. This " "feature was never supported and does not always work correctly. The function " @@ -2541,18 +2592,18 @@ msgid "" "future." msgstr "" -#: library/argparse.rst:1818 +#: library/argparse.rst:1875 msgid "Mutual exclusion" msgstr "" -#: library/argparse.rst:1822 +#: library/argparse.rst:1879 msgid "" "Create a mutually exclusive group. :mod:`!argparse` will make sure that only " "one of the arguments in the mutually exclusive group was present on the " "command line::" msgstr "" -#: library/argparse.rst:1826 +#: library/argparse.rst:1883 msgid "" ">>> parser = argparse.ArgumentParser(prog='PROG')\n" ">>> group = parser.add_mutually_exclusive_group()\n" @@ -2567,14 +2618,14 @@ msgid "" "PROG: error: argument --bar: not allowed with argument --foo" msgstr "" -#: library/argparse.rst:1838 +#: library/argparse.rst:1895 msgid "" "The :meth:`add_mutually_exclusive_group` method also accepts a *required* " "argument, to indicate that at least one of the mutually exclusive arguments " "is required::" msgstr "" -#: library/argparse.rst:1842 +#: library/argparse.rst:1899 msgid "" ">>> parser = argparse.ArgumentParser(prog='PROG')\n" ">>> group = parser.add_mutually_exclusive_group(required=True)\n" @@ -2585,7 +2636,7 @@ msgid "" "PROG: error: one of the arguments --foo --bar is required" msgstr "" -#: library/argparse.rst:1850 +#: library/argparse.rst:1907 msgid "" "Note that currently mutually exclusive argument groups do not support the " "*title* and *description* arguments of :meth:`~ArgumentParser." @@ -2593,7 +2644,7 @@ msgid "" "argument group that has a title and description. For example::" msgstr "" -#: library/argparse.rst:1856 +#: library/argparse.rst:1913 msgid "" ">>> parser = argparse.ArgumentParser(prog='PROG')\n" ">>> group = parser.add_argument_group('Group title', 'Group description')\n" @@ -2613,7 +2664,7 @@ msgid "" " --bar BAR bar help" msgstr "" -#: library/argparse.rst:1873 +#: library/argparse.rst:1930 msgid "" "Calling :meth:`add_argument_group` or :meth:`add_mutually_exclusive_group` " "on a mutually exclusive group is deprecated. These features were never " @@ -2621,11 +2672,11 @@ msgid "" "by accident through inheritance and will be removed in the future." msgstr "" -#: library/argparse.rst:1881 +#: library/argparse.rst:1938 msgid "Parser defaults" msgstr "" -#: library/argparse.rst:1885 +#: library/argparse.rst:1942 msgid "" "Most of the time, the attributes of the object returned by :meth:" "`parse_args` will be fully determined by inspecting the command-line " @@ -2634,7 +2685,7 @@ msgid "" "command line to be added::" msgstr "" -#: library/argparse.rst:1891 +#: library/argparse.rst:1948 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument('foo', type=int)\n" @@ -2643,12 +2694,12 @@ msgid "" "Namespace(bar=42, baz='badger', foo=736)" msgstr "" -#: library/argparse.rst:1897 +#: library/argparse.rst:1954 msgid "" "Note that parser-level defaults always override argument-level defaults::" msgstr "" -#: library/argparse.rst:1899 +#: library/argparse.rst:1956 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument('--foo', default='bar')\n" @@ -2657,20 +2708,20 @@ msgid "" "Namespace(foo='spam')" msgstr "" -#: library/argparse.rst:1905 +#: library/argparse.rst:1962 msgid "" "Parser-level defaults can be particularly useful when working with multiple " "parsers. See the :meth:`~ArgumentParser.add_subparsers` method for an " "example of this type." msgstr "" -#: library/argparse.rst:1911 +#: library/argparse.rst:1968 msgid "" "Get the default value for a namespace attribute, as set by either :meth:" "`~ArgumentParser.add_argument` or by :meth:`~ArgumentParser.set_defaults`::" msgstr "" -#: library/argparse.rst:1915 +#: library/argparse.rst:1972 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument('--foo', default='badger')\n" @@ -2678,54 +2729,54 @@ msgid "" "'badger'" msgstr "" -#: library/argparse.rst:1922 +#: library/argparse.rst:1979 msgid "Printing help" msgstr "" -#: library/argparse.rst:1924 +#: library/argparse.rst:1981 msgid "" "In most typical applications, :meth:`~ArgumentParser.parse_args` will take " "care of formatting and printing any usage or error messages. However, " "several formatting methods are available:" msgstr "" -#: library/argparse.rst:1930 +#: library/argparse.rst:1987 msgid "" "Print a brief description of how the :class:`ArgumentParser` should be " "invoked on the command line. If *file* is ``None``, :data:`sys.stdout` is " "assumed." msgstr "" -#: library/argparse.rst:1936 +#: library/argparse.rst:1993 msgid "" "Print a help message, including the program usage and information about the " "arguments registered with the :class:`ArgumentParser`. If *file* is " "``None``, :data:`sys.stdout` is assumed." msgstr "" -#: library/argparse.rst:1940 +#: library/argparse.rst:1997 msgid "" "There are also variants of these methods that simply return a string instead " "of printing it:" msgstr "" -#: library/argparse.rst:1945 +#: library/argparse.rst:2002 msgid "" "Return a string containing a brief description of how the :class:" "`ArgumentParser` should be invoked on the command line." msgstr "" -#: library/argparse.rst:1950 +#: library/argparse.rst:2007 msgid "" "Return a string containing a help message, including the program usage and " "information about the arguments registered with the :class:`ArgumentParser`." msgstr "" -#: library/argparse.rst:1955 +#: library/argparse.rst:2012 msgid "Partial parsing" msgstr "" -#: library/argparse.rst:1959 +#: library/argparse.rst:2016 msgid "" "Sometimes a script may only parse a few of the command-line arguments, " "passing the remaining arguments on to another script or program. In these " @@ -2736,7 +2787,7 @@ msgid "" "remaining argument strings." msgstr "" -#: library/argparse.rst:1968 +#: library/argparse.rst:2025 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument('--foo', action='store_true')\n" @@ -2745,7 +2796,7 @@ msgid "" "(Namespace(bar='BAR', foo=True), ['--badger', 'spam'])" msgstr "" -#: library/argparse.rst:1975 +#: library/argparse.rst:2032 msgid "" ":ref:`Prefix matching ` rules apply to :meth:" "`~ArgumentParser.parse_known_args`. The parser may consume an option even if " @@ -2753,11 +2804,11 @@ msgid "" "remaining arguments list." msgstr "" -#: library/argparse.rst:1982 +#: library/argparse.rst:2039 msgid "Customizing file parsing" msgstr "" -#: library/argparse.rst:1986 +#: library/argparse.rst:2043 msgid "" "Arguments that are read from a file (see the *fromfile_prefix_chars* keyword " "argument to the :class:`ArgumentParser` constructor) are read one argument " @@ -2765,38 +2816,38 @@ msgid "" "reading." msgstr "" -#: library/argparse.rst:1991 +#: library/argparse.rst:2048 msgid "" "This method takes a single argument *arg_line* which is a string read from " "the argument file. It returns a list of arguments parsed from this string. " "The method is called once per line read from the argument file, in order." msgstr "" -#: library/argparse.rst:1995 +#: library/argparse.rst:2052 msgid "" "A useful override of this method is one that treats each space-separated " "word as an argument. The following example demonstrates how to do this::" msgstr "" -#: library/argparse.rst:1998 +#: library/argparse.rst:2055 msgid "" "class MyArgumentParser(argparse.ArgumentParser):\n" " def convert_arg_line_to_args(self, arg_line):\n" " return arg_line.split()" msgstr "" -#: library/argparse.rst:2004 +#: library/argparse.rst:2061 msgid "Exiting methods" msgstr "" -#: library/argparse.rst:2008 +#: library/argparse.rst:2065 msgid "" "This method terminates the program, exiting with the specified *status* and, " "if given, it prints a *message* to :data:`sys.stderr` before that. The user " "can override this method to handle these steps differently::" msgstr "" -#: library/argparse.rst:2012 +#: library/argparse.rst:2069 msgid "" "class ErrorCatchingArgumentParser(argparse.ArgumentParser):\n" " def exit(self, status=0, message=None):\n" @@ -2805,17 +2856,17 @@ msgid "" " exit(status)" msgstr "" -#: library/argparse.rst:2020 +#: library/argparse.rst:2077 msgid "" "This method prints a usage message, including the *message*, to :data:`sys." "stderr` and terminates the program with a status code of 2." msgstr "" -#: library/argparse.rst:2025 +#: library/argparse.rst:2082 msgid "Intermixed parsing" msgstr "" -#: library/argparse.rst:2030 +#: library/argparse.rst:2087 msgid "" "A number of Unix commands allow the user to intermix optional arguments with " "positional arguments. The :meth:`~ArgumentParser.parse_intermixed_args` " @@ -2823,7 +2874,7 @@ msgid "" "parsing style." msgstr "" -#: library/argparse.rst:2035 +#: library/argparse.rst:2092 msgid "" "These parsers do not support all the :mod:`!argparse` features, and will " "raise exceptions if unsupported features are used. In particular, " @@ -2831,7 +2882,7 @@ msgid "" "positionals are not supported." msgstr "" -#: library/argparse.rst:2040 +#: library/argparse.rst:2097 msgid "" "The following example shows the difference between :meth:`~ArgumentParser." "parse_known_args` and :meth:`~ArgumentParser.parse_intermixed_args`: the " @@ -2839,7 +2890,7 @@ msgid "" "collects all the positionals into ``rest``. ::" msgstr "" -#: library/argparse.rst:2046 +#: library/argparse.rst:2103 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument('--foo')\n" @@ -2851,7 +2902,7 @@ msgid "" "Namespace(cmd='doit', foo='bar', rest=[1, 2, 3])" msgstr "" -#: library/argparse.rst:2055 +#: library/argparse.rst:2112 msgid "" ":meth:`~ArgumentParser.parse_known_intermixed_args` returns a two item tuple " "containing the populated namespace and the list of remaining argument " @@ -2859,11 +2910,11 @@ msgid "" "there are any remaining unparsed argument strings." msgstr "" -#: library/argparse.rst:2064 +#: library/argparse.rst:2121 msgid "Registering custom types or actions" msgstr "" -#: library/argparse.rst:2068 +#: library/argparse.rst:2125 msgid "" "Sometimes it's desirable to use a custom string in error messages to provide " "more user-friendly output. In these cases, :meth:`!register` can be used to " @@ -2871,7 +2922,7 @@ msgid "" "the type by their registered name instead of their callable name." msgstr "" -#: library/argparse.rst:2073 +#: library/argparse.rst:2130 msgid "" "The :meth:`!register` method accepts three arguments - a *registry_name*, " "specifying the internal registry where the object will be stored (e.g., " @@ -2879,12 +2930,12 @@ msgid "" "be registered, and object, the callable to be registered." msgstr "" -#: library/argparse.rst:2078 +#: library/argparse.rst:2135 msgid "" "The following example shows how to register a custom type with a parser::" msgstr "" -#: library/argparse.rst:2080 +#: library/argparse.rst:2137 msgid "" ">>> import argparse\n" ">>> parser = argparse.ArgumentParser()\n" @@ -2900,41 +2951,41 @@ msgid "" "PROG: error: argument --foo: invalid 'hexadecimal integer' value: '1.2'" msgstr "" -#: library/argparse.rst:2092 +#: library/argparse.rst:2149 msgid "Exceptions" msgstr "" -#: library/argparse.rst:2096 +#: library/argparse.rst:2153 msgid "An error from creating or using an argument (optional or positional)." msgstr "" -#: library/argparse.rst:2098 +#: library/argparse.rst:2155 msgid "" "The string value of this exception is the message, augmented with " "information about the argument that caused it." msgstr "" -#: library/argparse.rst:2103 +#: library/argparse.rst:2160 msgid "" "Raised when something goes wrong converting a command line string to a type." msgstr "" -#: library/argparse.rst:2107 +#: library/argparse.rst:2164 msgid "Guides and Tutorials" msgstr "" -#: library/argparse.rst:801 +#: library/argparse.rst:815 msgid "? (question mark)" msgstr "" -#: library/argparse.rst:835 library/argparse.rst:849 +#: library/argparse.rst:849 library/argparse.rst:863 msgid "in argparse module" msgstr "" -#: library/argparse.rst:835 +#: library/argparse.rst:849 msgid "* (asterisk)" msgstr "" -#: library/argparse.rst:849 +#: library/argparse.rst:863 msgid "+ (plus)" msgstr "" diff --git a/library/array.po b/library/array.po index 6987a313..9024111e 100644 --- a/library/array.po +++ b/library/array.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -59,8 +59,8 @@ msgstr "" msgid "signed char" msgstr "" -#: library/array.rst:23 library/array.rst:29 library/array.rst:33 -#: library/array.rst:37 library/array.rst:41 +#: library/array.rst:23 library/array.rst:31 library/array.rst:35 +#: library/array.rst:39 library/array.rst:43 msgid "int" msgstr "" @@ -84,11 +84,11 @@ msgstr "" msgid "wchar_t" msgstr "" -#: library/array.rst:25 +#: library/array.rst:27 msgid "Unicode character" msgstr "" -#: library/array.rst:27 library/array.rst:31 library/array.rst:33 +#: library/array.rst:29 library/array.rst:33 library/array.rst:35 msgid "2" msgstr "" @@ -97,128 +97,140 @@ msgid "\\(1)" msgstr "" #: library/array.rst:27 -msgid "``'h'``" +msgid "``'w'``" msgstr "" #: library/array.rst:27 -msgid "signed short" +msgid "Py_UCS4" +msgstr "" + +#: library/array.rst:37 library/array.rst:45 +msgid "4" msgstr "" #: library/array.rst:29 -msgid "``'H'``" +msgid "``'h'``" msgstr "" #: library/array.rst:29 -msgid "unsigned short" +msgid "signed short" msgstr "" #: library/array.rst:31 -msgid "``'i'``" +msgid "``'H'``" msgstr "" #: library/array.rst:31 -msgid "signed int" +msgid "unsigned short" msgstr "" #: library/array.rst:33 -msgid "``'I'``" +msgid "``'i'``" msgstr "" #: library/array.rst:33 -msgid "unsigned int" +msgid "signed int" msgstr "" #: library/array.rst:35 -msgid "``'l'``" +msgid "``'I'``" msgstr "" #: library/array.rst:35 -msgid "signed long" +msgid "unsigned int" msgstr "" -#: library/array.rst:37 library/array.rst:43 -msgid "4" +#: library/array.rst:37 +msgid "``'l'``" msgstr "" #: library/array.rst:37 +msgid "signed long" +msgstr "" + +#: library/array.rst:39 msgid "``'L'``" msgstr "" -#: library/array.rst:37 +#: library/array.rst:39 msgid "unsigned long" msgstr "" -#: library/array.rst:39 +#: library/array.rst:41 msgid "``'q'``" msgstr "" -#: library/array.rst:39 +#: library/array.rst:41 msgid "signed long long" msgstr "" -#: library/array.rst:41 library/array.rst:45 +#: library/array.rst:43 library/array.rst:47 msgid "8" msgstr "" -#: library/array.rst:41 +#: library/array.rst:43 msgid "``'Q'``" msgstr "" -#: library/array.rst:41 +#: library/array.rst:43 msgid "unsigned long long" msgstr "" -#: library/array.rst:43 +#: library/array.rst:45 msgid "``'f'``" msgstr "" -#: library/array.rst:45 +#: library/array.rst:47 msgid "float" msgstr "" -#: library/array.rst:45 +#: library/array.rst:47 msgid "``'d'``" msgstr "" -#: library/array.rst:45 +#: library/array.rst:47 msgid "double" msgstr "" -#: library/array.rst:48 +#: library/array.rst:50 msgid "Notes:" msgstr "" -#: library/array.rst:51 +#: library/array.rst:53 msgid "It can be 16 bits or 32 bits depending on the platform." msgstr "" -#: library/array.rst:53 +#: library/array.rst:55 msgid "" "``array('u')`` now uses :c:type:`wchar_t` as C type instead of deprecated " "``Py_UNICODE``. This change doesn't affect its behavior because " "``Py_UNICODE`` is alias of :c:type:`wchar_t` since Python 3.3." msgstr "" -#: library/array.rst:61 +#: library/array.rst:60 +msgid "Please migrate to ``'w'`` typecode." +msgstr "" + +#: library/array.rst:64 msgid "" "The actual representation of values is determined by the machine " "architecture (strictly speaking, by the C implementation). The actual size " "can be accessed through the :attr:`array.itemsize` attribute." msgstr "" -#: library/array.rst:65 +#: library/array.rst:68 msgid "The module defines the following item:" msgstr "" -#: library/array.rst:70 +#: library/array.rst:73 msgid "A string with all available type codes." msgstr "" -#: library/array.rst:73 +#: library/array.rst:76 msgid "The module defines the following type:" msgstr "" -#: library/array.rst:78 +#: library/array.rst:81 msgid "" "A new array whose items are restricted by *typecode*, and initialized from " "the optional *initializer* value, which must be a :class:`bytes` or :class:" @@ -226,7 +238,7 @@ msgid "" "appropriate type." msgstr "" -#: library/array.rst:83 +#: library/array.rst:86 msgid "" "If given a :class:`bytes` or :class:`bytearray` object, the initializer is " "passed to the new array's :meth:`frombytes` method; if given a Unicode " @@ -235,7 +247,7 @@ msgid "" "to add initial items to the array." msgstr "" -#: library/array.rst:90 +#: library/array.rst:93 msgid "" "Array objects support the ordinary sequence operations of indexing, slicing, " "concatenation, and multiplication. When using slice assignment, the " @@ -245,25 +257,25 @@ msgid "" "object>` are supported." msgstr "" -#: library/array.rst:96 +#: library/array.rst:99 msgid "" "Raises an :ref:`auditing event ` ``array.__new__`` with arguments " "``typecode``, ``initializer``." msgstr "" -#: library/array.rst:101 +#: library/array.rst:104 msgid "The typecode character used to create the array." msgstr "" -#: library/array.rst:106 +#: library/array.rst:109 msgid "The length in bytes of one array item in the internal representation." msgstr "" -#: library/array.rst:111 +#: library/array.rst:114 msgid "Append a new item with value *x* to the end of the array." msgstr "" -#: library/array.rst:116 +#: library/array.rst:119 msgid "" "Return a tuple ``(address, length)`` giving the current memory address and " "the length in elements of the buffer used to hold array's contents. The " @@ -275,7 +287,7 @@ msgid "" "it." msgstr "" -#: library/array.rst:126 +#: library/array.rst:129 msgid "" "When using array objects from code written in C or C++ (the only way to " "effectively make use of this information), it makes more sense to use the " @@ -284,7 +296,7 @@ msgid "" "interface is documented in :ref:`bufferobjects`." msgstr "" -#: library/array.rst:135 +#: library/array.rst:138 msgid "" "\"Byteswap\" all items of the array. This is only supported for values " "which are 1, 2, 4, or 8 bytes in size; for other types of values, :exc:" @@ -292,11 +304,11 @@ msgid "" "written on a machine with a different byte order." msgstr "" -#: library/array.rst:143 +#: library/array.rst:146 msgid "Return the number of occurrences of *x* in the array." msgstr "" -#: library/array.rst:148 +#: library/array.rst:151 msgid "" "Append items from *iterable* to the end of the array. If *iterable* is " "another array, it must have *exactly* the same type code; if not, :exc:" @@ -304,18 +316,18 @@ msgid "" "iterable and its elements must be the right type to be appended to the array." msgstr "" -#: library/array.rst:156 +#: library/array.rst:159 msgid "" "Appends items from the :term:`bytes-like object`, interpreting its content " "as an array of machine values (as if it had been read from a file using the :" "meth:`fromfile` method)." msgstr "" -#: library/array.rst:160 +#: library/array.rst:163 msgid ":meth:`!fromstring` is renamed to :meth:`frombytes` for clarity." msgstr "" -#: library/array.rst:166 +#: library/array.rst:169 msgid "" "Read *n* items (as machine values) from the :term:`file object` *f* and " "append them to the end of the array. If less than *n* items are available, :" @@ -323,21 +335,21 @@ msgid "" "inserted into the array." msgstr "" -#: library/array.rst:174 +#: library/array.rst:177 msgid "" "Append items from the list. This is equivalent to ``for x in list: a." "append(x)`` except that if there is a type error, the array is unchanged." msgstr "" -#: library/array.rst:180 +#: library/array.rst:183 msgid "" "Extends this array with data from the given Unicode string. The array must " -"have type code ``'u'``; otherwise a :exc:`ValueError` is raised. Use ``array." -"frombytes(unicodestring.encode(enc))`` to append Unicode data to an array of " -"some other type." +"have type code ``'u'`` or ``'w'``; otherwise a :exc:`ValueError` is raised. " +"Use ``array.frombytes(unicodestring.encode(enc))`` to append Unicode data to " +"an array of some other type." msgstr "" -#: library/array.rst:188 +#: library/array.rst:191 msgid "" "Return the smallest *i* such that *i* is the index of the first occurrence " "of *x* in the array. The optional arguments *start* and *stop* can be " @@ -345,100 +357,95 @@ msgid "" "`ValueError` if *x* is not found." msgstr "" -#: library/array.rst:193 +#: library/array.rst:196 msgid "Added optional *start* and *stop* parameters." msgstr "" -#: library/array.rst:199 +#: library/array.rst:202 msgid "" "Insert a new item with value *x* in the array before position *i*. Negative " "values are treated as being relative to the end of the array." msgstr "" -#: library/array.rst:205 +#: library/array.rst:208 msgid "" "Removes the item with the index *i* from the array and returns it. The " "optional argument defaults to ``-1``, so that by default the last item is " "removed and returned." msgstr "" -#: library/array.rst:212 +#: library/array.rst:215 msgid "Remove the first occurrence of *x* from the array." msgstr "" -#: library/array.rst:217 +#: library/array.rst:220 +msgid "Remove all elements from the array." +msgstr "" + +#: library/array.rst:227 msgid "Reverse the order of the items in the array." msgstr "" -#: library/array.rst:222 +#: library/array.rst:232 msgid "" "Convert the array to an array of machine values and return the bytes " "representation (the same sequence of bytes that would be written to a file " "by the :meth:`tofile` method.)" msgstr "" -#: library/array.rst:226 +#: library/array.rst:236 msgid ":meth:`!tostring` is renamed to :meth:`tobytes` for clarity." msgstr "" -#: library/array.rst:232 +#: library/array.rst:242 msgid "Write all items (as machine values) to the :term:`file object` *f*." msgstr "" -#: library/array.rst:237 +#: library/array.rst:247 msgid "Convert the array to an ordinary list with the same items." msgstr "" -#: library/array.rst:242 +#: library/array.rst:252 msgid "" -"Convert the array to a Unicode string. The array must have a type ``'u'``; " -"otherwise a :exc:`ValueError` is raised. Use ``array.tobytes().decode(enc)`` " -"to obtain a Unicode string from an array of some other type." +"Convert the array to a Unicode string. The array must have a type ``'u'`` " +"or ``'w'``; otherwise a :exc:`ValueError` is raised. Use ``array.tobytes()." +"decode(enc)`` to obtain a Unicode string from an array of some other type." msgstr "" -#: library/array.rst:247 +#: library/array.rst:257 msgid "" "The string representation of array objects has the form ``array(typecode, " "initializer)``. The *initializer* is omitted if the array is empty, " -"otherwise it is a Unicode string if the *typecode* is ``'u'``, otherwise it " -"is a list of numbers. The string representation is guaranteed to be able to " -"be converted back to an array with the same type and value using :func:" -"`eval`, so long as the :class:`~array.array` class has been imported using " -"``from array import array``. Variables ``inf`` and ``nan`` must also be " -"defined if it contains corresponding floating-point values. Examples::" +"otherwise it is a Unicode string if the *typecode* is ``'u'`` or ``'w'``, " +"otherwise it is a list of numbers. The string representation is guaranteed " +"to be able to be converted back to an array with the same type and value " +"using :func:`eval`, so long as the :class:`~array.array` class has been " +"imported using ``from array import array``. Variables ``inf`` and ``nan`` " +"must also be defined if it contains corresponding floating-point values. " +"Examples::" msgstr "" -#: library/array.rst:259 +#: library/array.rst:269 msgid "" "array('l')\n" -"array('u', 'hello \\u2641')\n" +"array('w', 'hello \\u2641')\n" "array('l', [1, 2, 3, 4, 5])\n" "array('d', [1.0, 2.0, 3.14, -inf, nan])" msgstr "" -#: library/array.rst:267 +#: library/array.rst:277 msgid "Module :mod:`struct`" msgstr "" -#: library/array.rst:268 +#: library/array.rst:278 msgid "Packing and unpacking of heterogeneous binary data." msgstr "" -#: library/array.rst:270 -msgid "Module :mod:`xdrlib`" -msgstr "" - -#: library/array.rst:271 -msgid "" -"Packing and unpacking of External Data Representation (XDR) data as used in " -"some remote procedure call systems." -msgstr "" - -#: library/array.rst:274 +#: library/array.rst:280 msgid "`NumPy `_" msgstr "" -#: library/array.rst:275 +#: library/array.rst:281 msgid "The NumPy package defines another array type." msgstr "" diff --git a/library/ast.po b/library/ast.po index 2e6bcd0f..32a6aa3b 100644 --- a/library/ast.po +++ b/library/ast.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -217,9 +217,9 @@ msgid "" "\n" " type_ignore = TypeIgnore(int lineno, string tag)\n" "\n" -" type_param = TypeVar(identifier name, expr? bound)\n" -" | ParamSpec(identifier name)\n" -" | TypeVarTuple(identifier name)\n" +" type_param = TypeVar(identifier name, expr? bound, expr? default_value)\n" +" | ParamSpec(identifier name, expr? default_value)\n" +" | TypeVarTuple(identifier name, expr? default_value)\n" " attributes (int lineno, int col_offset, int end_lineno, int " "end_col_offset)\n" "}\n" @@ -250,7 +250,7 @@ msgstr "" #: library/ast.rst:64 msgid "" -"Each concrete class has an attribute :attr:`_fields` which gives the names " +"Each concrete class has an attribute :attr:`!_fields` which gives the names " "of all child nodes." msgstr "" @@ -270,8 +270,21 @@ msgid "" "compiling an AST with :func:`compile`." msgstr "" +#: library/ast.rst:79 +msgid "" +"The :attr:`!_field_types` attribute on each concrete class is a dictionary " +"mapping field names (as also listed in :attr:`_fields`) to their types." +msgstr "" + #: library/ast.rst:82 msgid "" +">>> ast.TypeVar._field_types\n" +"{'name': , 'bound': ast.expr | None, 'default_value': ast.expr " +"| None}" +msgstr "" + +#: library/ast.rst:94 +msgid "" "Instances of :class:`ast.expr` and :class:`ast.stmt` subclasses have :attr:" "`lineno`, :attr:`col_offset`, :attr:`end_lineno`, and :attr:`end_col_offset` " "attributes. The :attr:`lineno` and :attr:`end_lineno` are the first and " @@ -282,7 +295,7 @@ msgid "" "internally." msgstr "" -#: library/ast.rst:91 +#: library/ast.rst:103 msgid "" "Note that the end positions are not required by the compiler and are " "therefore optional. The end offset is *after* the last symbol, for example " @@ -290,62 +303,56 @@ msgid "" "``source_line[node.col_offset : node.end_col_offset]``." msgstr "" -#: library/ast.rst:96 +#: library/ast.rst:108 msgid "" "The constructor of a class :class:`ast.T` parses its arguments as follows:" msgstr "" -#: library/ast.rst:98 +#: library/ast.rst:110 msgid "" "If there are positional arguments, there must be as many as there are items " "in :attr:`T._fields`; they will be assigned as attributes of these names." msgstr "" -#: library/ast.rst:100 +#: library/ast.rst:112 msgid "" "If there are keyword arguments, they will set the attributes of the same " "names to the given values." msgstr "" -#: library/ast.rst:103 +#: library/ast.rst:115 msgid "" "For example, to create and populate an :class:`ast.UnaryOp` node, you could " "use ::" msgstr "" -#: library/ast.rst:106 +#: library/ast.rst:118 msgid "" -"node = ast.UnaryOp()\n" -"node.op = ast.USub()\n" -"node.operand = ast.Constant()\n" -"node.operand.value = 5\n" -"node.operand.lineno = 0\n" -"node.operand.col_offset = 0\n" -"node.lineno = 0\n" -"node.col_offset = 0" -msgstr "" - -#: library/ast.rst:115 -msgid "or the more compact ::" +"node = ast.UnaryOp(ast.USub(), ast.Constant(5, lineno=0, col_offset=0),\n" +" lineno=0, col_offset=0)" msgstr "" -#: library/ast.rst:117 +#: library/ast.rst:121 msgid "" -"node = ast.UnaryOp(ast.USub(), ast.Constant(5, lineno=0, col_offset=0),\n" -" lineno=0, col_offset=0)" +"If a field that is optional in the grammar is omitted from the constructor, " +"it defaults to ``None``. If a list field is omitted, it defaults to the " +"empty list. If a field of type :class:`!ast.expr_context` is omitted, it " +"defaults to :class:`Load() `. If any other field is omitted, a :" +"exc:`DeprecationWarning` is raised and the AST node will not have this " +"field. In Python 3.15, this condition will raise an error." msgstr "" -#: library/ast.rst:122 +#: library/ast.rst:130 msgid "Class :class:`ast.Constant` is now used for all constants." msgstr "" -#: library/ast.rst:126 +#: library/ast.rst:134 msgid "" "Simple indices are represented by their value, extended slices are " "represented as tuples." msgstr "" -#: library/ast.rst:131 +#: library/ast.rst:139 msgid "" "Old classes :class:`!ast.Num`, :class:`!ast.Str`, :class:`!ast.Bytes`, :" "class:`!ast.NameConstant` and :class:`!ast.Ellipsis` are still available, " @@ -353,41 +360,50 @@ msgid "" "instantiating them will return an instance of a different class." msgstr "" -#: library/ast.rst:138 +#: library/ast.rst:146 msgid "" "Old classes :class:`!ast.Index` and :class:`!ast.ExtSlice` are still " "available, but they will be removed in future Python releases. In the " "meantime, instantiating them will return an instance of a different class." msgstr "" -#: library/ast.rst:144 +#: library/ast.rst:153 +msgid "" +"Previous versions of Python allowed the creation of AST nodes that were " +"missing required fields. Similarly, AST node constructors allowed arbitrary " +"keyword arguments that were set as attributes of the AST node, even if they " +"did not match any of the fields of the AST node. This behavior is deprecated " +"and will be removed in Python 3.15." +msgstr "" + +#: library/ast.rst:160 msgid "" "The descriptions of the specific node classes displayed here were initially " "adapted from the fantastic `Green Tree Snakes `__ project and all its contributors." msgstr "" -#: library/ast.rst:153 +#: library/ast.rst:169 msgid "Root nodes" msgstr "" -#: library/ast.rst:157 +#: library/ast.rst:173 msgid "" "A Python module, as with :ref:`file input `. Node type generated " "by :func:`ast.parse` in the default ``\"exec\"`` *mode*." msgstr "" -#: library/ast.rst:160 +#: library/ast.rst:176 msgid "``body`` is a :class:`list` of the module's :ref:`ast-statements`." msgstr "" -#: library/ast.rst:162 +#: library/ast.rst:178 msgid "" "``type_ignores`` is a :class:`list` of the module's type ignore comments; " "see :func:`ast.parse` for more details." msgstr "" -#: library/ast.rst:165 +#: library/ast.rst:181 msgid "" ">>> print(ast.dump(ast.parse('x = 1'), indent=4))\n" "Module(\n" @@ -395,40 +411,39 @@ msgid "" " Assign(\n" " targets=[\n" " Name(id='x', ctx=Store())],\n" -" value=Constant(value=1))],\n" -" type_ignores=[])" +" value=Constant(value=1))])" msgstr "" -#: library/ast.rst:179 +#: library/ast.rst:194 msgid "" "A single Python :ref:`expression input `. Node type " "generated by :func:`ast.parse` when *mode* is ``\"eval\"``." msgstr "" -#: library/ast.rst:182 +#: library/ast.rst:197 msgid "" "``body`` is a single node, one of the :ref:`expression types `." msgstr "" -#: library/ast.rst:255 +#: library/ast.rst:270 msgid "" ">>> print(ast.dump(ast.parse('123', mode='eval'), indent=4))\n" "Expression(\n" " body=Constant(value=123))" msgstr "" -#: library/ast.rst:194 +#: library/ast.rst:209 msgid "" "A single :ref:`interactive input `, like in :ref:`tut-interac`. " "Node type generated by :func:`ast.parse` when *mode* is ``\"single\"``." msgstr "" -#: library/ast.rst:197 +#: library/ast.rst:212 msgid "``body`` is a :class:`list` of :ref:`statement nodes `." msgstr "" -#: library/ast.rst:199 +#: library/ast.rst:214 msgid "" ">>> print(ast.dump(ast.parse('x = 1; y = 2', mode='single'), indent=4))\n" "Interactive(\n" @@ -443,34 +458,34 @@ msgid "" " value=Constant(value=2))])" msgstr "" -#: library/ast.rst:216 +#: library/ast.rst:231 msgid "" "A representation of an old-style type comments for functions, as Python " "versions prior to 3.5 didn't support :pep:`484` annotations. Node type " "generated by :func:`ast.parse` when *mode* is ``\"func_type\"``." msgstr "" -#: library/ast.rst:220 +#: library/ast.rst:235 msgid "Such type comments would look like this::" msgstr "" -#: library/ast.rst:222 +#: library/ast.rst:237 msgid "" "def sum_two_number(a, b):\n" " # type: (int, int) -> int\n" " return a + b" msgstr "" -#: library/ast.rst:226 +#: library/ast.rst:241 msgid "" "``argtypes`` is a :class:`list` of :ref:`expression nodes `." msgstr "" -#: library/ast.rst:228 +#: library/ast.rst:243 msgid "``returns`` is a single :ref:`expression node `." msgstr "" -#: library/ast.rst:230 +#: library/ast.rst:245 msgid "" ">>> print(ast.dump(ast.parse('(int, str) -> List[int]', mode='func_type'), " "indent=4))\n" @@ -484,11 +499,11 @@ msgid "" " ctx=Load()))" msgstr "" -#: library/ast.rst:246 +#: library/ast.rst:261 msgid "Literals" msgstr "" -#: library/ast.rst:250 +#: library/ast.rst:265 msgid "" "A constant value. The ``value`` attribute of the ``Constant`` literal " "contains the Python object it represents. The values represented can be " @@ -497,53 +512,53 @@ msgid "" "constant." msgstr "" -#: library/ast.rst:264 +#: library/ast.rst:279 msgid "" "Node representing a single formatting field in an f-string. If the string " "contains a single formatting field and nothing else the node can be isolated " "otherwise it appears in :class:`JoinedStr`." msgstr "" -#: library/ast.rst:268 +#: library/ast.rst:283 msgid "" "``value`` is any expression node (such as a literal, a variable, or a " "function call)." msgstr "" -#: library/ast.rst:270 +#: library/ast.rst:285 msgid "``conversion`` is an integer:" msgstr "" -#: library/ast.rst:272 +#: library/ast.rst:287 msgid "-1: no formatting" msgstr "" -#: library/ast.rst:273 +#: library/ast.rst:288 msgid "115: ``!s`` string formatting" msgstr "" -#: library/ast.rst:274 +#: library/ast.rst:289 msgid "114: ``!r`` repr formatting" msgstr "" -#: library/ast.rst:275 +#: library/ast.rst:290 msgid "97: ``!a`` ascii formatting" msgstr "" -#: library/ast.rst:277 +#: library/ast.rst:292 msgid "" "``format_spec`` is a :class:`JoinedStr` node representing the formatting of " "the value, or ``None`` if no format was specified. Both ``conversion`` and " "``format_spec`` can be set at the same time." msgstr "" -#: library/ast.rst:284 +#: library/ast.rst:299 msgid "" "An f-string, comprising a series of :class:`FormattedValue` and :class:" "`Constant` nodes." msgstr "" -#: library/ast.rst:287 +#: library/ast.rst:302 msgid "" ">>> print(ast.dump(ast.parse('f\"sin({a}) is {sin(a):.3}\"', mode='eval'), " "indent=4))\n" @@ -559,22 +574,21 @@ msgid "" " value=Call(\n" " func=Name(id='sin', ctx=Load()),\n" " args=[\n" -" Name(id='a', ctx=Load())],\n" -" keywords=[]),\n" +" Name(id='a', ctx=Load())]),\n" " conversion=-1,\n" " format_spec=JoinedStr(\n" " values=[\n" " Constant(value='.3')]))]))" msgstr "" -#: library/ast.rst:313 +#: library/ast.rst:327 msgid "" "A list or tuple. ``elts`` holds a list of nodes representing the elements. " "``ctx`` is :class:`Store` if the container is an assignment target (i.e. " "``(x,y)=something``), and :class:`Load` otherwise." msgstr "" -#: library/ast.rst:317 +#: library/ast.rst:331 msgid "" ">>> print(ast.dump(ast.parse('[1, 2, 3]', mode='eval'), indent=4))\n" "Expression(\n" @@ -594,11 +608,11 @@ msgid "" " ctx=Load()))" msgstr "" -#: library/ast.rst:339 +#: library/ast.rst:353 msgid "A set. ``elts`` holds a list of nodes representing the set's elements." msgstr "" -#: library/ast.rst:341 +#: library/ast.rst:355 msgid "" ">>> print(ast.dump(ast.parse('{1, 2, 3}', mode='eval'), indent=4))\n" "Expression(\n" @@ -609,21 +623,21 @@ msgid "" " Constant(value=3)]))" msgstr "" -#: library/ast.rst:354 +#: library/ast.rst:368 msgid "" "A dictionary. ``keys`` and ``values`` hold lists of nodes representing the " "keys and the values respectively, in matching order (what would be returned " "when calling :code:`dictionary.keys()` and :code:`dictionary.values()`)." msgstr "" -#: library/ast.rst:358 +#: library/ast.rst:372 msgid "" "When doing dictionary unpacking using dictionary literals the expression to " "be expanded goes in the ``values`` list, with a ``None`` at the " "corresponding position in ``keys``." msgstr "" -#: library/ast.rst:362 +#: library/ast.rst:376 msgid "" ">>> print(ast.dump(ast.parse('{\"a\":1, **d}', mode='eval'), indent=4))\n" "Expression(\n" @@ -636,31 +650,30 @@ msgid "" " Name(id='d', ctx=Load())]))" msgstr "" -#: library/ast.rst:376 +#: library/ast.rst:390 msgid "Variables" msgstr "" -#: library/ast.rst:380 +#: library/ast.rst:394 msgid "" "A variable name. ``id`` holds the name as a string, and ``ctx`` is one of " "the following types." msgstr "" -#: library/ast.rst:388 +#: library/ast.rst:402 msgid "" "Variable references can be used to load the value of a variable, to assign a " "new value to it, or to delete it. Variable references are given a context to " "distinguish these cases." msgstr "" -#: library/ast.rst:392 +#: library/ast.rst:406 msgid "" ">>> print(ast.dump(ast.parse('a'), indent=4))\n" "Module(\n" " body=[\n" " Expr(\n" -" value=Name(id='a', ctx=Load()))],\n" -" type_ignores=[])\n" +" value=Name(id='a', ctx=Load()))])\n" "\n" ">>> print(ast.dump(ast.parse('a = 1'), indent=4))\n" "Module(\n" @@ -668,26 +681,24 @@ msgid "" " Assign(\n" " targets=[\n" " Name(id='a', ctx=Store())],\n" -" value=Constant(value=1))],\n" -" type_ignores=[])\n" +" value=Constant(value=1))])\n" "\n" ">>> print(ast.dump(ast.parse('del a'), indent=4))\n" "Module(\n" " body=[\n" " Delete(\n" " targets=[\n" -" Name(id='a', ctx=Del())])],\n" -" type_ignores=[])" +" Name(id='a', ctx=Del())])])" msgstr "" -#: library/ast.rst:421 +#: library/ast.rst:432 msgid "" "A ``*var`` variable reference. ``value`` holds the variable, typically a :" "class:`Name` node. This type must be used when building a :class:`Call` node " "with ``*args``." msgstr "" -#: library/ast.rst:425 +#: library/ast.rst:436 msgid "" ">>> print(ast.dump(ast.parse('a, *b = it'), indent=4))\n" "Module(\n" @@ -701,15 +712,14 @@ msgid "" " value=Name(id='b', ctx=Store()),\n" " ctx=Store())],\n" " ctx=Store())],\n" -" value=Name(id='it', ctx=Load()))],\n" -" type_ignores=[])" +" value=Name(id='it', ctx=Load()))])" msgstr "" -#: library/ast.rst:446 +#: library/ast.rst:456 msgid "Expressions" msgstr "" -#: library/ast.rst:450 +#: library/ast.rst:460 msgid "" "When an expression, such as a function call, appears as a statement by " "itself with its return value not used or stored, it is wrapped in this " @@ -718,7 +728,7 @@ msgid "" "`YieldFrom` node." msgstr "" -#: library/ast.rst:455 +#: library/ast.rst:465 msgid "" ">>> print(ast.dump(ast.parse('-a'), indent=4))\n" "Module(\n" @@ -726,23 +736,22 @@ msgid "" " Expr(\n" " value=UnaryOp(\n" " op=USub(),\n" -" operand=Name(id='a', ctx=Load())))],\n" -" type_ignores=[])" +" operand=Name(id='a', ctx=Load())))])" msgstr "" -#: library/ast.rst:469 +#: library/ast.rst:478 msgid "" "A unary operation. ``op`` is the operator, and ``operand`` any expression " "node." msgstr "" -#: library/ast.rst:478 +#: library/ast.rst:487 msgid "" "Unary operator tokens. :class:`Not` is the ``not`` keyword, :class:`Invert` " "is the ``~`` operator." msgstr "" -#: library/ast.rst:481 +#: library/ast.rst:490 msgid "" ">>> print(ast.dump(ast.parse('not x', mode='eval'), indent=4))\n" "Expression(\n" @@ -751,13 +760,13 @@ msgid "" " operand=Name(id='x', ctx=Load())))" msgstr "" -#: library/ast.rst:492 +#: library/ast.rst:501 msgid "" "A binary operation (like addition or division). ``op`` is the operator, and " "``left`` and ``right`` are any expression nodes." msgstr "" -#: library/ast.rst:495 +#: library/ast.rst:504 msgid "" ">>> print(ast.dump(ast.parse('x + y', mode='eval'), indent=4))\n" "Expression(\n" @@ -767,11 +776,11 @@ msgid "" " right=Name(id='y', ctx=Load())))" msgstr "" -#: library/ast.rst:519 +#: library/ast.rst:528 msgid "Binary operator tokens." msgstr "" -#: library/ast.rst:524 +#: library/ast.rst:533 msgid "" "A boolean operation, 'or' or 'and'. ``op`` is :class:`Or` or :class:`And`. " "``values`` are the values involved. Consecutive operations with the same " @@ -779,11 +788,11 @@ msgid "" "values." msgstr "" -#: library/ast.rst:529 +#: library/ast.rst:538 msgid "This doesn't include ``not``, which is a :class:`UnaryOp`." msgstr "" -#: library/ast.rst:531 +#: library/ast.rst:540 msgid "" ">>> print(ast.dump(ast.parse('x or y', mode='eval'), indent=4))\n" "Expression(\n" @@ -794,18 +803,18 @@ msgid "" " Name(id='y', ctx=Load())]))" msgstr "" -#: library/ast.rst:545 +#: library/ast.rst:554 msgid "Boolean operator tokens." msgstr "" -#: library/ast.rst:550 +#: library/ast.rst:559 msgid "" "A comparison of two or more values. ``left`` is the first value in the " "comparison, ``ops`` the list of operators, and ``comparators`` the list of " "values after the first element in the comparison." msgstr "" -#: library/ast.rst:554 +#: library/ast.rst:563 msgid "" ">>> print(ast.dump(ast.parse('1 <= a < 10', mode='eval'), indent=4))\n" "Expression(\n" @@ -819,33 +828,33 @@ msgid "" " Constant(value=10)]))" msgstr "" -#: library/ast.rst:579 +#: library/ast.rst:588 msgid "Comparison operator tokens." msgstr "" -#: library/ast.rst:584 +#: library/ast.rst:593 msgid "" "A function call. ``func`` is the function, which will often be a :class:" "`Name` or :class:`Attribute` object. Of the arguments:" msgstr "" -#: library/ast.rst:587 +#: library/ast.rst:596 msgid "``args`` holds a list of the arguments passed by position." msgstr "" -#: library/ast.rst:588 +#: library/ast.rst:597 msgid "" "``keywords`` holds a list of :class:`.keyword` objects representing " "arguments passed by keyword." msgstr "" -#: library/ast.rst:591 +#: library/ast.rst:600 msgid "" -"When creating a ``Call`` node, ``args`` and ``keywords`` are required, but " -"they can be empty lists." +"The ``args`` and ``keywords`` arguments are optional and default to empty " +"lists." msgstr "" -#: library/ast.rst:594 +#: library/ast.rst:602 msgid "" ">>> print(ast.dump(ast.parse('func(a, b=c, *d, **e)', mode='eval'), " "indent=4))\n" @@ -865,19 +874,19 @@ msgid "" " value=Name(id='e', ctx=Load()))]))" msgstr "" -#: library/ast.rst:615 +#: library/ast.rst:623 msgid "" "A keyword argument to a function call or class definition. ``arg`` is a raw " "string of the parameter name, ``value`` is a node to pass in." msgstr "" -#: library/ast.rst:621 +#: library/ast.rst:629 msgid "" "An expression such as ``a if b else c``. Each field holds a single node, so " "in the following example, all three are :class:`Name` nodes." msgstr "" -#: library/ast.rst:624 +#: library/ast.rst:632 msgid "" ">>> print(ast.dump(ast.parse('a if b else c', mode='eval'), indent=4))\n" "Expression(\n" @@ -887,7 +896,7 @@ msgid "" " orelse=Name(id='c', ctx=Load())))" msgstr "" -#: library/ast.rst:636 +#: library/ast.rst:644 msgid "" "Attribute access, e.g. ``d.keys``. ``value`` is a node, typically a :class:" "`Name`. ``attr`` is a bare string giving the name of the attribute, and " @@ -895,7 +904,7 @@ msgid "" "the attribute is acted on." msgstr "" -#: library/ast.rst:641 +#: library/ast.rst:649 msgid "" ">>> print(ast.dump(ast.parse('snake.colour', mode='eval'), indent=4))\n" "Expression(\n" @@ -905,7 +914,7 @@ msgid "" " ctx=Load()))" msgstr "" -#: library/ast.rst:653 +#: library/ast.rst:661 msgid "" "A named expression. This AST node is produced by the assignment expressions " "operator (also known as the walrus operator). As opposed to the :class:" @@ -913,7 +922,7 @@ msgid "" "case both ``target`` and ``value`` must be single nodes." msgstr "" -#: library/ast.rst:658 +#: library/ast.rst:666 msgid "" ">>> print(ast.dump(ast.parse('(x := 4)', mode='eval'), indent=4))\n" "Expression(\n" @@ -922,11 +931,11 @@ msgid "" " value=Constant(value=4)))" msgstr "" -#: library/ast.rst:669 +#: library/ast.rst:677 msgid "Subscripting" msgstr "" -#: library/ast.rst:673 +#: library/ast.rst:681 msgid "" "A subscript, such as ``l[1]``. ``value`` is the subscripted object (usually " "sequence or mapping). ``slice`` is an index, slice or key. It can be a :" @@ -934,7 +943,7 @@ msgid "" "`Store` or :class:`Del` according to the action performed with the subscript." msgstr "" -#: library/ast.rst:679 +#: library/ast.rst:687 msgid "" ">>> print(ast.dump(ast.parse('l[1:2, 3]', mode='eval'), indent=4))\n" "Expression(\n" @@ -950,14 +959,14 @@ msgid "" " ctx=Load()))" msgstr "" -#: library/ast.rst:697 +#: library/ast.rst:705 msgid "" "Regular slicing (on the form ``lower:upper`` or ``lower:upper:step``). Can " "occur only inside the *slice* field of :class:`Subscript`, either directly " "or as an element of :class:`Tuple`." msgstr "" -#: library/ast.rst:701 +#: library/ast.rst:709 msgid "" ">>> print(ast.dump(ast.parse('l[1:2]', mode='eval'), indent=4))\n" "Expression(\n" @@ -969,25 +978,27 @@ msgid "" " ctx=Load()))" msgstr "" -#: library/ast.rst:714 +#: library/ast.rst:722 msgid "Comprehensions" msgstr "" -#: library/ast.rst:721 +#: library/ast.rst:729 msgid "" "List and set comprehensions, generator expressions, and dictionary " "comprehensions. ``elt`` (or ``key`` and ``value``) is a single node " "representing the part that will be evaluated for each item." msgstr "" -#: library/ast.rst:725 +#: library/ast.rst:733 msgid "``generators`` is a list of :class:`comprehension` nodes." msgstr "" -#: library/ast.rst:727 +#: library/ast.rst:735 msgid "" -">>> print(ast.dump(ast.parse('[x for x in numbers]', mode='eval'), " -"indent=4))\n" +">>> print(ast.dump(\n" +"... ast.parse('[x for x in numbers]', mode='eval'),\n" +"... indent=4,\n" +"... ))\n" "Expression(\n" " body=ListComp(\n" " elt=Name(id='x', ctx=Load()),\n" @@ -995,10 +1006,11 @@ msgid "" " comprehension(\n" " target=Name(id='x', ctx=Store()),\n" " iter=Name(id='numbers', ctx=Load()),\n" -" ifs=[],\n" " is_async=0)]))\n" -">>> print(ast.dump(ast.parse('{x: x**2 for x in numbers}', mode='eval'), " -"indent=4))\n" +">>> print(ast.dump(\n" +"... ast.parse('{x: x**2 for x in numbers}', mode='eval'),\n" +"... indent=4,\n" +"... ))\n" "Expression(\n" " body=DictComp(\n" " key=Name(id='x', ctx=Load()),\n" @@ -1010,10 +1022,11 @@ msgid "" " comprehension(\n" " target=Name(id='x', ctx=Store()),\n" " iter=Name(id='numbers', ctx=Load()),\n" -" ifs=[],\n" " is_async=0)]))\n" -">>> print(ast.dump(ast.parse('{x for x in numbers}', mode='eval'), " -"indent=4))\n" +">>> print(ast.dump(\n" +"... ast.parse('{x for x in numbers}', mode='eval'),\n" +"... indent=4,\n" +"... ))\n" "Expression(\n" " body=SetComp(\n" " elt=Name(id='x', ctx=Load()),\n" @@ -1021,11 +1034,10 @@ msgid "" " comprehension(\n" " target=Name(id='x', ctx=Store()),\n" " iter=Name(id='numbers', ctx=Load()),\n" -" ifs=[],\n" " is_async=0)]))" msgstr "" -#: library/ast.rst:767 +#: library/ast.rst:781 msgid "" "One ``for`` clause in a comprehension. ``target`` is the reference to use " "for each element - typically a :class:`Name` or :class:`Tuple` node. " @@ -1033,13 +1045,13 @@ msgid "" "expressions: each ``for`` clause can have multiple ``ifs``." msgstr "" -#: library/ast.rst:772 +#: library/ast.rst:786 msgid "" "``is_async`` indicates a comprehension is asynchronous (using an ``async " "for`` instead of ``for``). The value is an integer (0 or 1)." msgstr "" -#: library/ast.rst:775 +#: library/ast.rst:789 msgid "" ">>> print(ast.dump(ast.parse('[ord(c) for line in file for c in line]', " "mode='eval'),\n" @@ -1049,18 +1061,15 @@ msgid "" " elt=Call(\n" " func=Name(id='ord', ctx=Load()),\n" " args=[\n" -" Name(id='c', ctx=Load())],\n" -" keywords=[]),\n" +" Name(id='c', ctx=Load())]),\n" " generators=[\n" " comprehension(\n" " target=Name(id='line', ctx=Store()),\n" " iter=Name(id='file', ctx=Load()),\n" -" ifs=[],\n" " is_async=0),\n" " comprehension(\n" " target=Name(id='c', ctx=Store()),\n" " iter=Name(id='line', ctx=Load()),\n" -" ifs=[],\n" " is_async=0)]))\n" "\n" ">>> print(ast.dump(ast.parse('(n**2 for n in it if n>5 if n<10)', " @@ -1100,33 +1109,32 @@ msgid "" " comprehension(\n" " target=Name(id='i', ctx=Store()),\n" " iter=Name(id='soc', ctx=Load()),\n" -" ifs=[],\n" " is_async=1)]))" msgstr "" -#: library/ast.rst:841 +#: library/ast.rst:851 msgid "Statements" msgstr "" -#: library/ast.rst:845 +#: library/ast.rst:855 msgid "" "An assignment. ``targets`` is a list of nodes, and ``value`` is a single " "node." msgstr "" -#: library/ast.rst:847 +#: library/ast.rst:857 msgid "" "Multiple nodes in ``targets`` represents assigning the same value to each. " "Unpacking is represented by putting a :class:`Tuple` or :class:`List` within " "``targets``." msgstr "" -#: library/ast.rst:1165 library/ast.rst:1895 +#: library/ast.rst:1158 library/ast.rst:1918 msgid "" "``type_comment`` is an optional string with the type annotation as a comment." msgstr "" -#: library/ast.rst:855 +#: library/ast.rst:865 msgid "" ">>> print(ast.dump(ast.parse('a = b = 1'), indent=4)) # Multiple assignment\n" "Module(\n" @@ -1135,8 +1143,7 @@ msgid "" " targets=[\n" " Name(id='a', ctx=Store()),\n" " Name(id='b', ctx=Store())],\n" -" value=Constant(value=1))],\n" -" type_ignores=[])\n" +" value=Constant(value=1))])\n" "\n" ">>> print(ast.dump(ast.parse('a,b = c'), indent=4)) # Unpacking\n" "Module(\n" @@ -1148,11 +1155,10 @@ msgid "" " Name(id='a', ctx=Store()),\n" " Name(id='b', ctx=Store())],\n" " ctx=Store())],\n" -" value=Name(id='c', ctx=Load()))],\n" -" type_ignores=[])" +" value=Name(id='c', ctx=Load()))])" msgstr "" -#: library/ast.rst:883 +#: library/ast.rst:891 msgid "" "An assignment with a type annotation. ``target`` is a single node and can be " "a :class:`Name`, an :class:`Attribute` or a :class:`Subscript`. " @@ -1160,7 +1166,7 @@ msgid "" "`Name` node. ``value`` is a single optional node." msgstr "" -#: library/ast.rst:888 +#: library/ast.rst:896 msgid "" "``simple`` is always either 0 (indicating a \"complex\" target) or 1 " "(indicating a \"simple\" target). A \"simple\" target consists solely of a :" @@ -1169,7 +1175,7 @@ msgid "" "`~object.__annotations__` dictionary of modules and classes." msgstr "" -#: library/ast.rst:894 +#: library/ast.rst:902 msgid "" ">>> print(ast.dump(ast.parse('c: int'), indent=4))\n" "Module(\n" @@ -1177,8 +1183,7 @@ msgid "" " AnnAssign(\n" " target=Name(id='c', ctx=Store()),\n" " annotation=Name(id='int', ctx=Load()),\n" -" simple=1)],\n" -" type_ignores=[])\n" +" simple=1)])\n" "\n" ">>> print(ast.dump(ast.parse('(a): int = 1'), indent=4)) # Annotation with " "parenthesis\n" @@ -1188,8 +1193,7 @@ msgid "" " target=Name(id='a', ctx=Store()),\n" " annotation=Name(id='int', ctx=Load()),\n" " value=Constant(value=1),\n" -" simple=0)],\n" -" type_ignores=[])\n" +" simple=0)])\n" "\n" ">>> print(ast.dump(ast.parse('a.b: int'), indent=4)) # Attribute annotation\n" "Module(\n" @@ -1200,8 +1204,7 @@ msgid "" " attr='b',\n" " ctx=Store()),\n" " annotation=Name(id='int', ctx=Load()),\n" -" simple=0)],\n" -" type_ignores=[])\n" +" simple=0)])\n" "\n" ">>> print(ast.dump(ast.parse('a[1]: int'), indent=4)) # Subscript " "annotation\n" @@ -1213,11 +1216,10 @@ msgid "" " slice=Constant(value=1),\n" " ctx=Store()),\n" " annotation=Name(id='int', ctx=Load()),\n" -" simple=0)],\n" -" type_ignores=[])" +" simple=0)])" msgstr "" -#: library/ast.rst:942 +#: library/ast.rst:946 msgid "" "Augmented assignment, such as ``a += 1``. In the following example, " "``target`` is a :class:`Name` node for ``x`` (with the :class:`Store` " @@ -1225,13 +1227,13 @@ msgid "" "value for 1." msgstr "" -#: library/ast.rst:947 +#: library/ast.rst:951 msgid "" "The ``target`` attribute cannot be of class :class:`Tuple` or :class:`List`, " "unlike the targets of :class:`Assign`." msgstr "" -#: library/ast.rst:950 +#: library/ast.rst:954 msgid "" ">>> print(ast.dump(ast.parse('x += 2'), indent=4))\n" "Module(\n" @@ -1239,52 +1241,49 @@ msgid "" " AugAssign(\n" " target=Name(id='x', ctx=Store()),\n" " op=Add(),\n" -" value=Constant(value=2))],\n" -" type_ignores=[])" +" value=Constant(value=2))])" msgstr "" -#: library/ast.rst:964 +#: library/ast.rst:967 msgid "" "A ``raise`` statement. ``exc`` is the exception object to be raised, " "normally a :class:`Call` or :class:`Name`, or ``None`` for a standalone " "``raise``. ``cause`` is the optional part for ``y`` in ``raise x from y``." msgstr "" -#: library/ast.rst:968 +#: library/ast.rst:971 msgid "" ">>> print(ast.dump(ast.parse('raise x from y'), indent=4))\n" "Module(\n" " body=[\n" " Raise(\n" " exc=Name(id='x', ctx=Load()),\n" -" cause=Name(id='y', ctx=Load()))],\n" -" type_ignores=[])" +" cause=Name(id='y', ctx=Load()))])" msgstr "" -#: library/ast.rst:981 +#: library/ast.rst:983 msgid "" "An assertion. ``test`` holds the condition, such as a :class:`Compare` node. " "``msg`` holds the failure message." msgstr "" -#: library/ast.rst:984 +#: library/ast.rst:986 msgid "" ">>> print(ast.dump(ast.parse('assert x,y'), indent=4))\n" "Module(\n" " body=[\n" " Assert(\n" " test=Name(id='x', ctx=Load()),\n" -" msg=Name(id='y', ctx=Load()))],\n" -" type_ignores=[])" +" msg=Name(id='y', ctx=Load()))])" msgstr "" -#: library/ast.rst:997 +#: library/ast.rst:998 msgid "" "Represents a ``del`` statement. ``targets`` is a list of nodes, such as :" "class:`Name`, :class:`Attribute` or :class:`Subscript` nodes." msgstr "" -#: library/ast.rst:1000 +#: library/ast.rst:1001 msgid "" ">>> print(ast.dump(ast.parse('del x,y,z'), indent=4))\n" "Module(\n" @@ -1293,8 +1292,7 @@ msgid "" " targets=[\n" " Name(id='x', ctx=Del()),\n" " Name(id='y', ctx=Del()),\n" -" Name(id='z', ctx=Del())])],\n" -" type_ignores=[])" +" Name(id='z', ctx=Del())])])" msgstr "" #: library/ast.rst:1015 @@ -1306,11 +1304,10 @@ msgid "" ">>> print(ast.dump(ast.parse('pass'), indent=4))\n" "Module(\n" " body=[\n" -" Pass()],\n" -" type_ignores=[])" +" Pass()])" msgstr "" -#: library/ast.rst:1028 +#: library/ast.rst:1027 msgid "" "A :ref:`type alias ` created through the :keyword:`type` " "statement. ``name`` is the name of the alias, ``type_params`` is a list of :" @@ -1318,33 +1315,31 @@ msgid "" "type alias." msgstr "" -#: library/ast.rst:1033 +#: library/ast.rst:1032 msgid "" ">>> print(ast.dump(ast.parse('type Alias = int'), indent=4))\n" "Module(\n" " body=[\n" " TypeAlias(\n" " name=Name(id='Alias', ctx=Store()),\n" -" type_params=[],\n" -" value=Name(id='int', ctx=Load()))],\n" -" type_ignores=[])" +" value=Name(id='int', ctx=Load()))])" msgstr "" -#: library/ast.rst:1046 +#: library/ast.rst:1043 msgid "" "Other statements which are only applicable inside functions or loops are " "described in other sections." msgstr "" -#: library/ast.rst:1050 +#: library/ast.rst:1047 msgid "Imports" msgstr "" -#: library/ast.rst:1054 +#: library/ast.rst:1051 msgid "An import statement. ``names`` is a list of :class:`alias` nodes." msgstr "" -#: library/ast.rst:1056 +#: library/ast.rst:1053 msgid "" ">>> print(ast.dump(ast.parse('import x,y,z'), indent=4))\n" "Module(\n" @@ -1353,11 +1348,10 @@ msgid "" " names=[\n" " alias(name='x'),\n" " alias(name='y'),\n" -" alias(name='z')])],\n" -" type_ignores=[])" +" alias(name='z')])])" msgstr "" -#: library/ast.rst:1071 +#: library/ast.rst:1067 msgid "" "Represents ``from x import y``. ``module`` is a raw string of the 'from' " "name, without any leading dots, or ``None`` for statements such as ``from . " @@ -1365,7 +1359,7 @@ msgid "" "import (0 means absolute import)." msgstr "" -#: library/ast.rst:1076 +#: library/ast.rst:1072 msgid "" ">>> print(ast.dump(ast.parse('from y import x,y,z'), indent=4))\n" "Module(\n" @@ -1376,17 +1370,16 @@ msgid "" " alias(name='x'),\n" " alias(name='y'),\n" " alias(name='z')],\n" -" level=0)],\n" -" type_ignores=[])" +" level=0)])" msgstr "" -#: library/ast.rst:1093 +#: library/ast.rst:1088 msgid "" "Both parameters are raw strings of the names. ``asname`` can be ``None`` if " "the regular name is to be used." msgstr "" -#: library/ast.rst:1096 +#: library/ast.rst:1091 msgid "" ">>> print(ast.dump(ast.parse('from ..foo.bar import a as b, c'), indent=4))\n" "Module(\n" @@ -1396,34 +1389,33 @@ msgid "" " names=[\n" " alias(name='a', asname='b'),\n" " alias(name='c')],\n" -" level=2)],\n" -" type_ignores=[])" +" level=2)])" msgstr "" -#: library/ast.rst:1110 +#: library/ast.rst:1104 msgid "Control flow" msgstr "" -#: library/ast.rst:1113 +#: library/ast.rst:1107 msgid "" "Optional clauses such as ``else`` are stored as an empty list if they're not " "present." msgstr "" -#: library/ast.rst:1118 +#: library/ast.rst:1112 msgid "" "An ``if`` statement. ``test`` holds a single node, such as a :class:" "`Compare` node. ``body`` and ``orelse`` each hold a list of nodes." msgstr "" -#: library/ast.rst:1121 +#: library/ast.rst:1115 msgid "" "``elif`` clauses don't have a special representation in the AST, but rather " "appear as extra :class:`If` nodes within the ``orelse`` section of the " "previous one." msgstr "" -#: library/ast.rst:1125 +#: library/ast.rst:1119 msgid "" ">>> print(ast.dump(ast.parse(\"\"\"\n" "... if x:\n" @@ -1448,11 +1440,10 @@ msgid "" " value=Constant(value=Ellipsis))],\n" " orelse=[\n" " Expr(\n" -" value=Constant(value=Ellipsis))])])],\n" -" type_ignores=[])" +" value=Constant(value=Ellipsis))])])])" msgstr "" -#: library/ast.rst:1156 +#: library/ast.rst:1149 msgid "" "A ``for`` loop. ``target`` holds the variable(s) the loop assigns to, as a " "single :class:`Name`, :class:`Tuple`, :class:`List`, :class:`Attribute` or :" @@ -1462,7 +1453,7 @@ msgid "" "via a ``break`` statement." msgstr "" -#: library/ast.rst:1167 +#: library/ast.rst:1160 msgid "" ">>> print(ast.dump(ast.parse(\"\"\"\n" "... for x in y:\n" @@ -1480,19 +1471,18 @@ msgid "" " value=Constant(value=Ellipsis))],\n" " orelse=[\n" " Expr(\n" -" value=Constant(value=Ellipsis))])],\n" -" type_ignores=[])" +" value=Constant(value=Ellipsis))])])" msgstr "" -#: library/ast.rst:1191 +#: library/ast.rst:1183 msgid "" "A ``while`` loop. ``test`` holds the condition, such as a :class:`Compare` " "node." msgstr "" -#: library/ast.rst:1194 +#: library/ast.rst:1186 msgid "" -">> print(ast.dump(ast.parse(\"\"\"\n" +">>> print(ast.dump(ast.parse(\"\"\"\n" "... while x:\n" "... ...\n" "... else:\n" @@ -1507,15 +1497,14 @@ msgid "" " value=Constant(value=Ellipsis))],\n" " orelse=[\n" " Expr(\n" -" value=Constant(value=Ellipsis))])],\n" -" type_ignores=[])" +" value=Constant(value=Ellipsis))])])" msgstr "" -#: library/ast.rst:1218 +#: library/ast.rst:1209 msgid "The ``break`` and ``continue`` statements." msgstr "" -#: library/ast.rst:1220 +#: library/ast.rst:1211 msgid "" ">>> print(ast.dump(ast.parse(\"\"\"\\\n" "... for a in b:\n" @@ -1541,18 +1530,16 @@ msgid "" " body=[\n" " Break()],\n" " orelse=[\n" -" Continue()])],\n" -" orelse=[])],\n" -" type_ignores=[])" +" Continue()])])])" msgstr "" -#: library/ast.rst:1253 +#: library/ast.rst:1242 msgid "" "``try`` blocks. All attributes are list of nodes to execute, except for " "``handlers``, which is a list of :class:`ExceptHandler` nodes." msgstr "" -#: library/ast.rst:1256 +#: library/ast.rst:1245 msgid "" ">>> print(ast.dump(ast.parse(\"\"\"\n" "... try:\n" @@ -1589,18 +1576,17 @@ msgid "" " value=Constant(value=Ellipsis))],\n" " finalbody=[\n" " Expr(\n" -" value=Constant(value=Ellipsis))])],\n" -" type_ignores=[])" +" value=Constant(value=Ellipsis))])])" msgstr "" -#: library/ast.rst:1299 +#: library/ast.rst:1287 msgid "" "``try`` blocks which are followed by ``except*`` clauses. The attributes are " "the same as for :class:`Try` but the :class:`ExceptHandler` nodes in " "``handlers`` are interpreted as ``except*`` blocks rather then ``except``." msgstr "" -#: library/ast.rst:1303 +#: library/ast.rst:1291 msgid "" ">>> print(ast.dump(ast.parse(\"\"\"\n" "... try:\n" @@ -1619,13 +1605,10 @@ msgid "" " type=Name(id='Exception', ctx=Load()),\n" " body=[\n" " Expr(\n" -" value=Constant(value=Ellipsis))])],\n" -" orelse=[],\n" -" finalbody=[])],\n" -" type_ignores=[])" +" value=Constant(value=Ellipsis))])])])" msgstr "" -#: library/ast.rst:1331 +#: library/ast.rst:1316 msgid "" "A single ``except`` clause. ``type`` is the exception type it will match, " "typically a :class:`Name` node (or ``None`` for a catch-all ``except:`` " @@ -1633,7 +1616,7 @@ msgid "" "``None`` if the clause doesn't have ``as foo``. ``body`` is a list of nodes." msgstr "" -#: library/ast.rst:1336 +#: library/ast.rst:1321 msgid "" ">>> print(ast.dump(ast.parse(\"\"\"\\\n" "... try:\n" @@ -1654,20 +1637,17 @@ msgid "" " ExceptHandler(\n" " type=Name(id='TypeError', ctx=Load()),\n" " body=[\n" -" Pass()])],\n" -" orelse=[],\n" -" finalbody=[])],\n" -" type_ignores=[])" +" Pass()])])])" msgstr "" -#: library/ast.rst:1365 +#: library/ast.rst:1347 msgid "" "A ``with`` block. ``items`` is a list of :class:`withitem` nodes " "representing the context managers, and ``body`` is the indented block inside " "the context." msgstr "" -#: library/ast.rst:1375 +#: library/ast.rst:1357 msgid "" "A single context manager in a ``with`` block. ``context_expr`` is the " "context manager, often a :class:`Call` node. ``optional_vars`` is a :class:" @@ -1675,7 +1655,7 @@ msgid "" "if that isn't used." msgstr "" -#: library/ast.rst:1380 +#: library/ast.rst:1362 msgid "" ">>> print(ast.dump(ast.parse(\"\"\"\\\n" "... with a as b, c as d:\n" @@ -1697,23 +1677,21 @@ msgid "" " func=Name(id='something', ctx=Load()),\n" " args=[\n" " Name(id='b', ctx=Load()),\n" -" Name(id='d', ctx=Load())],\n" -" keywords=[]))])],\n" -" type_ignores=[])" +" Name(id='d', ctx=Load())]))])])" msgstr "" -#: library/ast.rst:1408 +#: library/ast.rst:1388 msgid "Pattern matching" msgstr "" -#: library/ast.rst:1413 +#: library/ast.rst:1393 msgid "" "A ``match`` statement. ``subject`` holds the subject of the match (the " "object that is being matched against the cases) and ``cases`` contains an " "iterable of :class:`match_case` nodes with the different cases." msgstr "" -#: library/ast.rst:1421 +#: library/ast.rst:1401 msgid "" "A single case pattern in a ``match`` statement. ``pattern`` contains the " "match pattern that the subject will be matched against. Note that the :class:" @@ -1721,19 +1699,19 @@ msgid "" "expressions, even when they share the same syntax." msgstr "" -#: library/ast.rst:1426 +#: library/ast.rst:1406 msgid "" "The ``guard`` attribute contains an expression that will be evaluated if the " "pattern matches the subject." msgstr "" -#: library/ast.rst:1429 +#: library/ast.rst:1409 msgid "" "``body`` contains a list of nodes to execute if the pattern matches and the " "result of evaluating the guard expression is true." msgstr "" -#: library/ast.rst:1432 +#: library/ast.rst:1412 msgid "" ">>> print(ast.dump(ast.parse(\"\"\"\n" "... match x:\n" @@ -1762,17 +1740,13 @@ msgid "" " value=Constant(value=Ellipsis))]),\n" " match_case(\n" " pattern=MatchClass(\n" -" cls=Name(id='tuple', ctx=Load()),\n" -" patterns=[],\n" -" kwd_attrs=[],\n" -" kwd_patterns=[]),\n" +" cls=Name(id='tuple', ctx=Load())),\n" " body=[\n" " Expr(\n" -" value=Constant(value=Ellipsis))])])],\n" -" type_ignores=[])" +" value=Constant(value=Ellipsis))])])])" msgstr "" -#: library/ast.rst:1474 +#: library/ast.rst:1450 msgid "" "A match literal or value pattern that compares by equality. ``value`` is an " "expression node. Permitted value nodes are restricted as described in the " @@ -1780,7 +1754,7 @@ msgid "" "equal to the evaluated value." msgstr "" -#: library/ast.rst:1479 +#: library/ast.rst:1455 msgid "" ">>> print(ast.dump(ast.parse(\"\"\"\n" "... match x:\n" @@ -1797,18 +1771,17 @@ msgid "" " value=Constant(value='Relevant')),\n" " body=[\n" " Expr(\n" -" value=Constant(value=Ellipsis))])])],\n" -" type_ignores=[])" +" value=Constant(value=Ellipsis))])])])" msgstr "" -#: library/ast.rst:1503 +#: library/ast.rst:1478 msgid "" "A match literal pattern that compares by identity. ``value`` is the " "singleton to be compared against: ``None``, ``True``, or ``False``. This " "pattern succeeds if the match subject is the given constant." msgstr "" -#: library/ast.rst:1507 +#: library/ast.rst:1482 msgid "" ">>> print(ast.dump(ast.parse(\"\"\"\n" "... match x:\n" @@ -1824,11 +1797,10 @@ msgid "" " pattern=MatchSingleton(value=None),\n" " body=[\n" " Expr(\n" -" value=Constant(value=Ellipsis))])])],\n" -" type_ignores=[])" +" value=Constant(value=Ellipsis))])])])" msgstr "" -#: library/ast.rst:1530 +#: library/ast.rst:1504 msgid "" "A match sequence pattern. ``patterns`` contains the patterns to be matched " "against the subject elements if the subject is a sequence. Matches a " @@ -1836,7 +1808,7 @@ msgid "" "otherwise matches a fixed length sequence." msgstr "" -#: library/ast.rst:1535 +#: library/ast.rst:1509 msgid "" ">>> print(ast.dump(ast.parse(\"\"\"\n" "... match x:\n" @@ -1857,11 +1829,10 @@ msgid "" " value=Constant(value=2))]),\n" " body=[\n" " Expr(\n" -" value=Constant(value=Ellipsis))])])],\n" -" type_ignores=[])" +" value=Constant(value=Ellipsis))])])])" msgstr "" -#: library/ast.rst:1563 +#: library/ast.rst:1536 msgid "" "Matches the rest of the sequence in a variable length match sequence " "pattern. If ``name`` is not ``None``, a list containing the remaining " @@ -1869,7 +1840,7 @@ msgid "" "successful." msgstr "" -#: library/ast.rst:1567 +#: library/ast.rst:1540 msgid "" ">>> print(ast.dump(ast.parse(\"\"\"\n" "... match x:\n" @@ -1900,11 +1871,10 @@ msgid "" " MatchStar()]),\n" " body=[\n" " Expr(\n" -" value=Constant(value=Ellipsis))])])],\n" -" type_ignores=[])" +" value=Constant(value=Ellipsis))])])])" msgstr "" -#: library/ast.rst:1605 +#: library/ast.rst:1577 msgid "" "A match mapping pattern. ``keys`` is a sequence of expression nodes. " "``patterns`` is a corresponding sequence of pattern nodes. ``rest`` is an " @@ -1913,7 +1883,7 @@ msgid "" "statement documentation." msgstr "" -#: library/ast.rst:1611 +#: library/ast.rst:1583 msgid "" "This pattern succeeds if the subject is a mapping, all evaluated key " "expressions are present in the mapping, and the value corresponding to each " @@ -1922,7 +1892,7 @@ msgid "" "overall mapping pattern is successful." msgstr "" -#: library/ast.rst:1617 +#: library/ast.rst:1589 msgid "" ">>> print(ast.dump(ast.parse(\"\"\"\n" "... match x:\n" @@ -1948,15 +1918,13 @@ msgid "" " Expr(\n" " value=Constant(value=Ellipsis))]),\n" " match_case(\n" -" pattern=MatchMapping(keys=[], patterns=[], " -"rest='rest'),\n" +" pattern=MatchMapping(rest='rest'),\n" " body=[\n" " Expr(\n" -" value=Constant(value=Ellipsis))])])],\n" -" type_ignores=[])" +" value=Constant(value=Ellipsis))])])])" msgstr "" -#: library/ast.rst:1653 +#: library/ast.rst:1624 msgid "" "A match class pattern. ``cls`` is an expression giving the nominal class to " "be matched. ``patterns`` is a sequence of pattern nodes to be matched " @@ -1967,21 +1935,21 @@ msgid "" "pattern)." msgstr "" -#: library/ast.rst:1660 +#: library/ast.rst:1631 msgid "" "This pattern succeeds if the subject is an instance of the nominated class, " "all positional patterns match the corresponding class-defined attributes, " "and any specified keyword attributes match their corresponding pattern." msgstr "" -#: library/ast.rst:1664 +#: library/ast.rst:1635 msgid "" "Note: classes may define a property that returns self in order to match a " "pattern node against the instance being matched. Several builtin types are " "also matched that way, as described in the match statement documentation." msgstr "" -#: library/ast.rst:1668 +#: library/ast.rst:1639 msgid "" ">>> print(ast.dump(ast.parse(\"\"\"\n" "... match x:\n" @@ -2002,16 +1970,13 @@ msgid "" " MatchValue(\n" " value=Constant(value=0)),\n" " MatchValue(\n" -" value=Constant(value=0))],\n" -" kwd_attrs=[],\n" -" kwd_patterns=[]),\n" +" value=Constant(value=0))]),\n" " body=[\n" " Expr(\n" " value=Constant(value=Ellipsis))]),\n" " match_case(\n" " pattern=MatchClass(\n" " cls=Name(id='Point3D', ctx=Load()),\n" -" patterns=[],\n" " kwd_attrs=[\n" " 'x',\n" " 'y',\n" @@ -2025,11 +1990,10 @@ msgid "" " value=Constant(value=0))]),\n" " body=[\n" " Expr(\n" -" value=Constant(value=Ellipsis))])])],\n" -" type_ignores=[])" +" value=Constant(value=Ellipsis))])])])" msgstr "" -#: library/ast.rst:1719 +#: library/ast.rst:1686 msgid "" "A match \"as-pattern\", capture pattern or wildcard pattern. ``pattern`` " "contains the match pattern that the subject will be matched against. If the " @@ -2037,14 +2001,14 @@ msgid "" "and will always succeed." msgstr "" -#: library/ast.rst:1724 +#: library/ast.rst:1691 msgid "" "The ``name`` attribute contains the name that will be bound if the pattern " "is successful. If ``name`` is ``None``, ``pattern`` must also be ``None`` " "and the node represents the wildcard pattern." msgstr "" -#: library/ast.rst:1728 +#: library/ast.rst:1695 msgid "" ">>> print(ast.dump(ast.parse(\"\"\"\n" "... match x:\n" @@ -2071,11 +2035,10 @@ msgid "" " pattern=MatchAs(),\n" " body=[\n" " Expr(\n" -" value=Constant(value=Ellipsis))])])],\n" -" type_ignores=[])" +" value=Constant(value=Ellipsis))])])])" msgstr "" -#: library/ast.rst:1762 +#: library/ast.rst:1728 msgid "" "A match \"or-pattern\". An or-pattern matches each of its subpatterns in " "turn to the subject, until one succeeds. The or-pattern is then deemed to " @@ -2084,7 +2047,7 @@ msgid "" "matched against the subject." msgstr "" -#: library/ast.rst:1768 +#: library/ast.rst:1734 msgid "" ">>> print(ast.dump(ast.parse(\"\"\"\n" "... match x:\n" @@ -2105,30 +2068,74 @@ msgid "" " MatchAs(name='y')]),\n" " body=[\n" " Expr(\n" -" value=Constant(value=Ellipsis))])])],\n" -" type_ignores=[])" +" value=Constant(value=Ellipsis))])])])" msgstr "" -#: library/ast.rst:1797 -msgid "Type parameters" +#: library/ast.rst:1761 +msgid "Type annotations" +msgstr "" + +#: library/ast.rst:1765 +msgid "" +"A ``# type: ignore`` comment located at *lineno*. *tag* is the optional tag " +"specified by the form ``# type: ignore ``." +msgstr "" + +#: library/ast.rst:1768 +msgid "" +">>> print(ast.dump(ast.parse('x = 1 # type: ignore', type_comments=True), " +"indent=4))\n" +"Module(\n" +" body=[\n" +" Assign(\n" +" targets=[\n" +" Name(id='x', ctx=Store())],\n" +" value=Constant(value=1))],\n" +" type_ignores=[\n" +" TypeIgnore(lineno=1, tag='')])\n" +">>> print(ast.dump(ast.parse('x: bool = 1 # type: ignore[assignment]', " +"type_comments=True), indent=4))\n" +"Module(\n" +" body=[\n" +" AnnAssign(\n" +" target=Name(id='x', ctx=Store()),\n" +" annotation=Name(id='bool', ctx=Load()),\n" +" value=Constant(value=1),\n" +" simple=1)],\n" +" type_ignores=[\n" +" TypeIgnore(lineno=1, tag='[assignment]')])" +msgstr "" + +#: library/ast.rst:1791 +msgid "" +":class:`!TypeIgnore` nodes are not generated when the *type_comments* " +"parameter is set to ``False`` (default). See :func:`ast.parse` for more " +"details." msgstr "" #: library/ast.rst:1799 +msgid "Type parameters" +msgstr "" + +#: library/ast.rst:1801 msgid "" ":ref:`Type parameters ` can exist on classes, functions, and " "type aliases." msgstr "" -#: library/ast.rst:1804 +#: library/ast.rst:1806 msgid "" "A :class:`typing.TypeVar`. ``name`` is the name of the type variable. " "``bound`` is the bound or constraints, if any. If ``bound`` is a :class:" -"`Tuple`, it represents constraints; otherwise it represents the bound." +"`Tuple`, it represents constraints; otherwise it represents the bound. " +"``default_value`` is the default value; if the :class:`!TypeVar` has no " +"default, this attribute will be set to ``None``." msgstr "" -#: library/ast.rst:1808 +#: library/ast.rst:1812 msgid "" -">>> print(ast.dump(ast.parse(\"type Alias[T: int] = list[T]\"), indent=4))\n" +">>> print(ast.dump(ast.parse(\"type Alias[T: int = bool] = list[T]\"), " +"indent=4))\n" "Module(\n" " body=[\n" " TypeAlias(\n" @@ -2136,30 +2143,41 @@ msgid "" " type_params=[\n" " TypeVar(\n" " name='T',\n" -" bound=Name(id='int', ctx=Load()))],\n" +" bound=Name(id='int', ctx=Load()),\n" +" default_value=Name(id='bool', ctx=Load()))],\n" " value=Subscript(\n" " value=Name(id='list', ctx=Load()),\n" " slice=Name(id='T', ctx=Load()),\n" -" ctx=Load()))],\n" -" type_ignores=[])" +" ctx=Load()))])" +msgstr "" + +#: library/ast.rst:1866 library/ast.rst:1898 +msgid "Added the *default_value* parameter." msgstr "" -#: library/ast.rst:1829 +#: library/ast.rst:1836 msgid "" "A :class:`typing.ParamSpec`. ``name`` is the name of the parameter " -"specification." +"specification. ``default_value`` is the default value; if the :class:`!" +"ParamSpec` has no default, this attribute will be set to ``None``." msgstr "" -#: library/ast.rst:1831 +#: library/ast.rst:1840 msgid "" -">>> print(ast.dump(ast.parse(\"type Alias[**P] = Callable[P, int]\"), " -"indent=4))\n" +">>> print(ast.dump(ast.parse(\"type Alias[**P = [int, str]] = Callable[P, " +"int]\"), indent=4))\n" "Module(\n" " body=[\n" " TypeAlias(\n" " name=Name(id='Alias', ctx=Store()),\n" " type_params=[\n" -" ParamSpec(name='P')],\n" +" ParamSpec(\n" +" name='P',\n" +" default_value=List(\n" +" elts=[\n" +" Name(id='int', ctx=Load()),\n" +" Name(id='str', ctx=Load())],\n" +" ctx=Load()))],\n" " value=Subscript(\n" " value=Name(id='Callable', ctx=Load()),\n" " slice=Tuple(\n" @@ -2167,25 +2185,28 @@ msgid "" " Name(id='P', ctx=Load()),\n" " Name(id='int', ctx=Load())],\n" " ctx=Load()),\n" -" ctx=Load()))],\n" -" type_ignores=[])" +" ctx=Load()))])" msgstr "" -#: library/ast.rst:1854 +#: library/ast.rst:1871 msgid "" "A :class:`typing.TypeVarTuple`. ``name`` is the name of the type variable " -"tuple." +"tuple. ``default_value`` is the default value; if the :class:`!TypeVarTuple` " +"has no default, this attribute will be set to ``None``." msgstr "" -#: library/ast.rst:1856 +#: library/ast.rst:1875 msgid "" -">>> print(ast.dump(ast.parse(\"type Alias[*Ts] = tuple[*Ts]\"), indent=4))\n" +">>> print(ast.dump(ast.parse(\"type Alias[*Ts = ()] = tuple[*Ts]\"), " +"indent=4))\n" "Module(\n" " body=[\n" " TypeAlias(\n" " name=Name(id='Alias', ctx=Store()),\n" " type_params=[\n" -" TypeVarTuple(name='Ts')],\n" +" TypeVarTuple(\n" +" name='Ts',\n" +" default_value=Tuple(ctx=Load()))],\n" " value=Subscript(\n" " value=Name(id='tuple', ctx=Load()),\n" " slice=Tuple(\n" @@ -2194,55 +2215,54 @@ msgid "" " value=Name(id='Ts', ctx=Load()),\n" " ctx=Load())],\n" " ctx=Load()),\n" -" ctx=Load()))],\n" -" type_ignores=[])" +" ctx=Load()))])" msgstr "" -#: library/ast.rst:1879 +#: library/ast.rst:1902 msgid "Function and class definitions" msgstr "" -#: library/ast.rst:1883 +#: library/ast.rst:1906 msgid "A function definition." msgstr "" -#: library/ast.rst:1885 +#: library/ast.rst:1908 msgid "``name`` is a raw string of the function name." msgstr "" -#: library/ast.rst:1886 +#: library/ast.rst:1909 msgid "``args`` is an :class:`arguments` node." msgstr "" -#: library/ast.rst:1887 +#: library/ast.rst:1910 msgid "``body`` is the list of nodes inside the function." msgstr "" -#: library/ast.rst:1888 +#: library/ast.rst:1911 msgid "" "``decorator_list`` is the list of decorators to be applied, stored outermost " "first (i.e. the first in the list will be applied last)." msgstr "" -#: library/ast.rst:1890 +#: library/ast.rst:1913 msgid "``returns`` is the return annotation." msgstr "" -#: library/ast.rst:2067 +#: library/ast.rst:2077 msgid "``type_params`` is a list of :ref:`type parameters `." msgstr "" -#: library/ast.rst:2096 library/ast.rst:2107 +#: library/ast.rst:2104 library/ast.rst:2115 msgid "Added ``type_params``." msgstr "" -#: library/ast.rst:1903 +#: library/ast.rst:1926 msgid "" "``lambda`` is a minimal function definition that can be used inside an " "expression. Unlike :class:`FunctionDef`, ``body`` holds a single node." msgstr "" -#: library/ast.rst:1906 +#: library/ast.rst:1929 msgid "" ">>> print(ast.dump(ast.parse('lambda x,y: ...'), indent=4))\n" "Module(\n" @@ -2250,57 +2270,52 @@ msgid "" " Expr(\n" " value=Lambda(\n" " args=arguments(\n" -" posonlyargs=[],\n" " args=[\n" " arg(arg='x'),\n" -" arg(arg='y')],\n" -" kwonlyargs=[],\n" -" kw_defaults=[],\n" -" defaults=[]),\n" -" body=Constant(value=Ellipsis)))],\n" -" type_ignores=[])" +" arg(arg='y')]),\n" +" body=Constant(value=Ellipsis)))])" msgstr "" -#: library/ast.rst:1927 +#: library/ast.rst:1945 msgid "The arguments for a function." msgstr "" -#: library/ast.rst:1929 +#: library/ast.rst:1947 msgid "" "``posonlyargs``, ``args`` and ``kwonlyargs`` are lists of :class:`arg` nodes." msgstr "" -#: library/ast.rst:1930 +#: library/ast.rst:1948 msgid "" "``vararg`` and ``kwarg`` are single :class:`arg` nodes, referring to the " "``*args, **kwargs`` parameters." msgstr "" -#: library/ast.rst:1932 +#: library/ast.rst:1950 msgid "" "``kw_defaults`` is a list of default values for keyword-only arguments. If " "one is ``None``, the corresponding argument is required." msgstr "" -#: library/ast.rst:1934 +#: library/ast.rst:1952 msgid "" "``defaults`` is a list of default values for arguments that can be passed " "positionally. If there are fewer defaults, they correspond to the last n " "arguments." msgstr "" -#: library/ast.rst:1941 +#: library/ast.rst:1959 msgid "" "A single argument in a list. ``arg`` is a raw string of the argument name; " "``annotation`` is its annotation, such as a :class:`Name` node." msgstr "" -#: library/ast.rst:1946 +#: library/ast.rst:1964 msgid "" "``type_comment`` is an optional string with the type annotation as a comment" msgstr "" -#: library/ast.rst:1948 +#: library/ast.rst:1966 msgid "" ">>> print(ast.dump(ast.parse(\"\"\"\\\n" "... @decorator1\n" @@ -2314,7 +2329,6 @@ msgid "" " FunctionDef(\n" " name='f',\n" " args=arguments(\n" -" posonlyargs=[],\n" " args=[\n" " arg(\n" " arg='a',\n" @@ -2337,57 +2351,52 @@ msgid "" " decorator_list=[\n" " Name(id='decorator1', ctx=Load()),\n" " Name(id='decorator2', ctx=Load())],\n" -" returns=Constant(value='return annotation'),\n" -" type_params=[])],\n" -" type_ignores=[])" +" returns=Constant(value='return annotation'))])" msgstr "" -#: library/ast.rst:1991 +#: library/ast.rst:2006 msgid "A ``return`` statement." msgstr "" -#: library/ast.rst:1993 +#: library/ast.rst:2008 msgid "" ">>> print(ast.dump(ast.parse('return 4'), indent=4))\n" "Module(\n" " body=[\n" " Return(\n" -" value=Constant(value=4))],\n" -" type_ignores=[])" +" value=Constant(value=4))])" msgstr "" -#: library/ast.rst:2006 +#: library/ast.rst:2020 msgid "" "A ``yield`` or ``yield from`` expression. Because these are expressions, " "they must be wrapped in an :class:`Expr` node if the value sent back is not " "used." msgstr "" -#: library/ast.rst:2009 +#: library/ast.rst:2023 msgid "" ">>> print(ast.dump(ast.parse('yield x'), indent=4))\n" "Module(\n" " body=[\n" " Expr(\n" " value=Yield(\n" -" value=Name(id='x', ctx=Load())))],\n" -" type_ignores=[])\n" +" value=Name(id='x', ctx=Load())))])\n" "\n" ">>> print(ast.dump(ast.parse('yield from x'), indent=4))\n" "Module(\n" " body=[\n" " Expr(\n" " value=YieldFrom(\n" -" value=Name(id='x', ctx=Load())))],\n" -" type_ignores=[])" +" value=Name(id='x', ctx=Load())))])" msgstr "" -#: library/ast.rst:2031 +#: library/ast.rst:2043 msgid "" "``global`` and ``nonlocal`` statements. ``names`` is a list of raw strings." msgstr "" -#: library/ast.rst:2033 +#: library/ast.rst:2045 msgid "" ">>> print(ast.dump(ast.parse('global x,y,z'), indent=4))\n" "Module(\n" @@ -2396,8 +2405,7 @@ msgid "" " names=[\n" " 'x',\n" " 'y',\n" -" 'z'])],\n" -" type_ignores=[])\n" +" 'z'])])\n" "\n" ">>> print(ast.dump(ast.parse('nonlocal x,y,z'), indent=4))\n" "Module(\n" @@ -2406,40 +2414,39 @@ msgid "" " names=[\n" " 'x',\n" " 'y',\n" -" 'z'])],\n" -" type_ignores=[])" +" 'z'])])" msgstr "" -#: library/ast.rst:2058 +#: library/ast.rst:2068 msgid "A class definition." msgstr "" -#: library/ast.rst:2060 +#: library/ast.rst:2070 msgid "``name`` is a raw string for the class name" msgstr "" -#: library/ast.rst:2061 +#: library/ast.rst:2071 msgid "``bases`` is a list of nodes for explicitly specified base classes." msgstr "" -#: library/ast.rst:2062 +#: library/ast.rst:2072 msgid "" "``keywords`` is a list of :class:`.keyword` nodes, principally for " "'metaclass'. Other keywords will be passed to the metaclass, as per :pep:" "`3115`." msgstr "" -#: library/ast.rst:2064 +#: library/ast.rst:2074 msgid "" "``body`` is a list of nodes representing the code within the class " "definition." msgstr "" -#: library/ast.rst:2066 +#: library/ast.rst:2076 msgid "``decorator_list`` is a list of nodes, as in :class:`FunctionDef`." msgstr "" -#: library/ast.rst:2069 +#: library/ast.rst:2079 msgid "" ">>> print(ast.dump(ast.parse(\"\"\"\\\n" "... @decorator1\n" @@ -2462,28 +2469,26 @@ msgid "" " Pass()],\n" " decorator_list=[\n" " Name(id='decorator1', ctx=Load()),\n" -" Name(id='decorator2', ctx=Load())],\n" -" type_params=[])],\n" -" type_ignores=[])" +" Name(id='decorator2', ctx=Load())])])" msgstr "" -#: library/ast.rst:2100 +#: library/ast.rst:2108 msgid "Async and await" msgstr "" -#: library/ast.rst:2104 +#: library/ast.rst:2112 msgid "" "An ``async def`` function definition. Has the same fields as :class:" "`FunctionDef`." msgstr "" -#: library/ast.rst:2113 +#: library/ast.rst:2121 msgid "" "An ``await`` expression. ``value`` is what it waits for. Only valid in the " "body of an :class:`AsyncFunctionDef`." msgstr "" -#: library/ast.rst:2116 +#: library/ast.rst:2124 msgid "" ">>> print(ast.dump(ast.parse(\"\"\"\\\n" "... async def f():\n" @@ -2493,32 +2498,22 @@ msgid "" " body=[\n" " AsyncFunctionDef(\n" " name='f',\n" -" args=arguments(\n" -" posonlyargs=[],\n" -" args=[],\n" -" kwonlyargs=[],\n" -" kw_defaults=[],\n" -" defaults=[]),\n" +" args=arguments(),\n" " body=[\n" " Expr(\n" " value=Await(\n" " value=Call(\n" -" func=Name(id='other_func', ctx=Load()),\n" -" args=[],\n" -" keywords=[])))],\n" -" decorator_list=[],\n" -" type_params=[])],\n" -" type_ignores=[])" +" func=Name(id='other_func', ctx=Load()))))])])" msgstr "" -#: library/ast.rst:2147 +#: library/ast.rst:2145 msgid "" "``async for`` loops and ``async with`` context managers. They have the same " "fields as :class:`For` and :class:`With`, respectively. Only valid in the " "body of an :class:`AsyncFunctionDef`." msgstr "" -#: library/ast.rst:2152 +#: library/ast.rst:2150 msgid "" "When a string is parsed by :func:`ast.parse`, operator nodes (subclasses of :" "class:`ast.operator`, :class:`ast.unaryop`, :class:`ast.cmpop`, :class:`ast." @@ -2527,20 +2522,22 @@ msgid "" "same value (e.g. :class:`ast.Add`)." msgstr "" -#: library/ast.rst:2160 +#: library/ast.rst:2158 msgid ":mod:`ast` Helpers" msgstr "" -#: library/ast.rst:2162 +#: library/ast.rst:2160 msgid "" "Apart from the node classes, the :mod:`ast` module defines these utility " "functions and classes for traversing abstract syntax trees:" msgstr "" -#: library/ast.rst:2167 +#: library/ast.rst:2165 msgid "" "Parse the source into an AST node. Equivalent to ``compile(source, " -"filename, mode, ast.PyCF_ONLY_AST)``." +"filename, mode, flags=FLAGS_VALUE, optimize=optimize)``, where " +"``FLAGS_VALUE`` is ``ast.PyCF_ONLY_AST`` if ``optimize <= 0`` and ``ast." +"PyCF_OPTIMIZED_AST`` otherwise." msgstr "" #: library/ast.rst:2170 @@ -2569,7 +2566,7 @@ msgid "" "\"best-effort\" attempt to parse using that Python version's grammar. For " "example, setting ``feature_version=(3, 9)`` will attempt to disallow parsing " "of :keyword:`match` statements. Currently ``major`` must equal to ``3``. The " -"lowest supported version is ``(3, 4)`` (and this may increase in future " +"lowest supported version is ``(3, 7)`` (and this may increase in future " "Python versions); the highest is ``sys.version_info[0:2]``. \"Best-effort\" " "attempt means there is no guarantee that the parse (or success of the parse) " "is the same as when run on the Python version corresponding to " @@ -2607,27 +2604,33 @@ msgstr "" msgid "Added ``type_comments``, ``mode='func_type'`` and ``feature_version``." msgstr "" -#: library/ast.rst:2218 +#: library/ast.rst:2215 +msgid "" +"The minimum supported version for ``feature_version`` is now ``(3, 7)``. The " +"``optimize`` argument was added." +msgstr "" + +#: library/ast.rst:2222 msgid "" "Unparse an :class:`ast.AST` object and generate a string with code that " "would produce an equivalent :class:`ast.AST` object if parsed back with :" "func:`ast.parse`." msgstr "" -#: library/ast.rst:2223 +#: library/ast.rst:2227 msgid "" "The produced code string will not necessarily be equal to the original code " "that generated the :class:`ast.AST` object (without any compiler " "optimizations, such as constant tuples/frozensets)." msgstr "" -#: library/ast.rst:2228 +#: library/ast.rst:2232 msgid "" "Trying to unparse a highly complex expression would result with :exc:" "`RecursionError`." msgstr "" -#: library/ast.rst:2236 +#: library/ast.rst:2240 msgid "" "Evaluate an expression node or a string containing only a Python literal or " "container display. The string or node provided may only consist of the " @@ -2635,14 +2638,14 @@ msgid "" "dicts, sets, booleans, ``None`` and ``Ellipsis``." msgstr "" -#: library/ast.rst:2241 +#: library/ast.rst:2245 msgid "" "This can be used for evaluating strings containing Python values without the " "need to parse the values oneself. It is not capable of evaluating " "arbitrarily complex expressions, for example involving operators or indexing." msgstr "" -#: library/ast.rst:2246 +#: library/ast.rst:2250 msgid "" "This function had been documented as \"safe\" in the past without defining " "what that meant. That was misleading. This is specifically designed not to " @@ -2654,31 +2657,31 @@ msgid "" "untrusted data is thus not recommended." msgstr "" -#: library/ast.rst:2256 +#: library/ast.rst:2260 msgid "" "It is possible to crash the Python interpreter due to stack depth " "limitations in Python's AST compiler." msgstr "" -#: library/ast.rst:2259 +#: library/ast.rst:2263 msgid "" "It can raise :exc:`ValueError`, :exc:`TypeError`, :exc:`SyntaxError`, :exc:" "`MemoryError` and :exc:`RecursionError` depending on the malformed input." msgstr "" -#: library/ast.rst:2263 +#: library/ast.rst:2267 msgid "Now allows bytes and set literals." msgstr "" -#: library/ast.rst:2266 +#: library/ast.rst:2270 msgid "Now supports creating empty sets with ``'set()'``." msgstr "" -#: library/ast.rst:2269 +#: library/ast.rst:2273 msgid "For string inputs, leading spaces and tabs are now stripped." msgstr "" -#: library/ast.rst:2275 +#: library/ast.rst:2279 msgid "" "Return the docstring of the given *node* (which must be a :class:" "`FunctionDef`, :class:`AsyncFunctionDef`, :class:`ClassDef`, or :class:" @@ -2686,11 +2689,11 @@ msgid "" "clean up the docstring's indentation with :func:`inspect.cleandoc`." msgstr "" -#: library/ast.rst:2281 +#: library/ast.rst:2285 msgid ":class:`AsyncFunctionDef` is now supported." msgstr "" -#: library/ast.rst:2287 +#: library/ast.rst:2291 msgid "" "Get source code segment of the *source* that generated *node*. If some " "location information (:attr:`~ast.AST.lineno`, :attr:`~ast.AST.end_lineno`, :" @@ -2698,13 +2701,13 @@ msgid "" "return ``None``." msgstr "" -#: library/ast.rst:2291 +#: library/ast.rst:2295 msgid "" "If *padded* is ``True``, the first line of a multi-line statement will be " "padded with spaces to match its original position." msgstr "" -#: library/ast.rst:2299 +#: library/ast.rst:2303 msgid "" "When you compile a node tree with :func:`compile`, the compiler expects :" "attr:`~ast.AST.lineno` and :attr:`~ast.AST.col_offset` attributes for every " @@ -2714,81 +2717,81 @@ msgid "" "starting at *node*." msgstr "" -#: library/ast.rst:2308 +#: library/ast.rst:2312 msgid "" "Increment the line number and end line number of each node in the tree " "starting at *node* by *n*. This is useful to \"move code\" to a different " "location in a file." msgstr "" -#: library/ast.rst:2315 +#: library/ast.rst:2319 msgid "" "Copy source location (:attr:`~ast.AST.lineno`, :attr:`~ast.AST.col_offset`, :" "attr:`~ast.AST.end_lineno`, and :attr:`~ast.AST.end_col_offset`) from " "*old_node* to *new_node* if possible, and return *new_node*." msgstr "" -#: library/ast.rst:2322 +#: library/ast.rst:2326 msgid "" "Yield a tuple of ``(fieldname, value)`` for each field in ``node._fields`` " "that is present on *node*." msgstr "" -#: library/ast.rst:2328 +#: library/ast.rst:2332 msgid "" "Yield all direct child nodes of *node*, that is, all fields that are nodes " "and all items of fields that are lists of nodes." msgstr "" -#: library/ast.rst:2334 +#: library/ast.rst:2338 msgid "" "Recursively yield all descendant nodes in the tree starting at *node* " "(including *node* itself), in no specified order. This is useful if you " "only want to modify nodes in place and don't care about the context." msgstr "" -#: library/ast.rst:2341 +#: library/ast.rst:2345 msgid "" "A node visitor base class that walks the abstract syntax tree and calls a " "visitor function for every node found. This function may return a value " "which is forwarded by the :meth:`visit` method." msgstr "" -#: library/ast.rst:2345 +#: library/ast.rst:2349 msgid "" "This class is meant to be subclassed, with the subclass adding visitor " "methods." msgstr "" -#: library/ast.rst:2350 +#: library/ast.rst:2354 msgid "" "Visit a node. The default implementation calls the method called :samp:" "`self.visit_{classname}` where *classname* is the name of the node class, " "or :meth:`generic_visit` if that method doesn't exist." msgstr "" -#: library/ast.rst:2356 +#: library/ast.rst:2360 msgid "This visitor calls :meth:`visit` on all children of the node." msgstr "" -#: library/ast.rst:2358 +#: library/ast.rst:2362 msgid "" "Note that child nodes of nodes that have a custom visitor method won't be " "visited unless the visitor calls :meth:`generic_visit` or visits them itself." msgstr "" -#: library/ast.rst:2364 +#: library/ast.rst:2368 msgid "Handles all constant nodes." msgstr "" -#: library/ast.rst:2366 +#: library/ast.rst:2370 msgid "" "Don't use the :class:`NodeVisitor` if you want to apply changes to nodes " "during traversal. For this a special visitor exists (:class:" "`NodeTransformer`) that allows modifications." msgstr "" -#: library/ast.rst:2372 +#: library/ast.rst:2376 msgid "" "Methods :meth:`!visit_Num`, :meth:`!visit_Str`, :meth:`!visit_Bytes`, :meth:" "`!visit_NameConstant` and :meth:`!visit_Ellipsis` are deprecated now and " @@ -2796,13 +2799,13 @@ msgid "" "`visit_Constant` method to handle all constant nodes." msgstr "" -#: library/ast.rst:2380 +#: library/ast.rst:2384 msgid "" "A :class:`NodeVisitor` subclass that walks the abstract syntax tree and " "allows modification of nodes." msgstr "" -#: library/ast.rst:2383 +#: library/ast.rst:2387 msgid "" "The :class:`NodeTransformer` will walk the AST and use the return value of " "the visitor methods to replace or remove the old node. If the return value " @@ -2811,13 +2814,13 @@ msgid "" "may be the original node in which case no replacement takes place." msgstr "" -#: library/ast.rst:2389 +#: library/ast.rst:2393 msgid "" "Here is an example transformer that rewrites all occurrences of name lookups " "(``foo``) to ``data['foo']``::" msgstr "" -#: library/ast.rst:2392 +#: library/ast.rst:2396 msgid "" "class RewriteName(NodeTransformer):\n" "\n" @@ -2829,21 +2832,21 @@ msgid "" " )" msgstr "" -#: library/ast.rst:2401 +#: library/ast.rst:2405 msgid "" "Keep in mind that if the node you're operating on has child nodes you must " "either transform the child nodes yourself or call the :meth:`~ast." "NodeVisitor.generic_visit` method for the node first." msgstr "" -#: library/ast.rst:2405 +#: library/ast.rst:2409 msgid "" "For nodes that were part of a collection of statements (that applies to all " "statement nodes), the visitor may also return a list of nodes rather than " "just a single node." msgstr "" -#: library/ast.rst:2409 +#: library/ast.rst:2413 msgid "" "If :class:`NodeTransformer` introduces new nodes (that weren't part of " "original tree) without giving them location information (such as :attr:`~ast." @@ -2851,21 +2854,21 @@ msgid "" "sub-tree to recalculate the location information::" msgstr "" -#: library/ast.rst:2414 +#: library/ast.rst:2418 msgid "" "tree = ast.parse('foo', mode='eval')\n" "new_tree = fix_missing_locations(RewriteName().visit(tree))" msgstr "" -#: library/ast.rst:2417 +#: library/ast.rst:2421 msgid "Usually you use the transformer like this::" msgstr "" -#: library/ast.rst:2419 +#: library/ast.rst:2423 msgid "node = YourTransformer().visit(node)" msgstr "" -#: library/ast.rst:2424 +#: library/ast.rst:2428 msgid "" "Return a formatted dump of the tree in *node*. This is mainly useful for " "debugging purposes. If *annotate_fields* is true (by default), the returned " @@ -2876,7 +2879,7 @@ msgid "" "true." msgstr "" -#: library/ast.rst:2432 +#: library/ast.rst:2436 msgid "" "If *indent* is a non-negative integer or string, then the tree will be " "pretty-printed with that indent level. An indent level of 0, negative, or " @@ -2886,91 +2889,135 @@ msgid "" "string is used to indent each level." msgstr "" -#: library/ast.rst:2439 -msgid "Added the *indent* option." +#: library/ast.rst:2443 +msgid "" +"If *show_empty* is ``False`` (the default), empty lists and fields that are " +"``None`` will be omitted from the output." msgstr "" #: library/ast.rst:2446 +msgid "Added the *indent* option." +msgstr "" + +#: library/ast.rst:2449 +msgid "Added the *show_empty* option." +msgstr "" + +#: library/ast.rst:2452 +msgid "" +">>> print(ast.dump(ast.parse(\"\"\"\\\n" +"... async def f():\n" +"... await other_func()\n" +"... \"\"\"), indent=4, show_empty=True))\n" +"Module(\n" +" body=[\n" +" AsyncFunctionDef(\n" +" name='f',\n" +" args=arguments(\n" +" posonlyargs=[],\n" +" args=[],\n" +" kwonlyargs=[],\n" +" kw_defaults=[],\n" +" defaults=[]),\n" +" body=[\n" +" Expr(\n" +" value=Await(\n" +" value=Call(\n" +" func=Name(id='other_func', ctx=Load()),\n" +" args=[],\n" +" keywords=[])))],\n" +" decorator_list=[],\n" +" type_params=[])],\n" +" type_ignores=[])" +msgstr "" + +#: library/ast.rst:2483 msgid "Compiler Flags" msgstr "" -#: library/ast.rst:2448 +#: library/ast.rst:2485 msgid "" "The following flags may be passed to :func:`compile` in order to change " "effects on the compilation of a program:" msgstr "" -#: library/ast.rst:2453 +#: library/ast.rst:2490 msgid "" "Enables support for top-level ``await``, ``async for``, ``async with`` and " "async comprehensions." msgstr "" -#: library/ast.rst:2460 +#: library/ast.rst:2497 msgid "" "Generates and returns an abstract syntax tree instead of returning a " "compiled code object." msgstr "" -#: library/ast.rst:2465 +#: library/ast.rst:2502 +msgid "" +"The returned AST is optimized according to the *optimize* argument in :func:" +"`compile` or :func:`ast.parse`." +msgstr "" + +#: library/ast.rst:2509 msgid "" "Enables support for :pep:`484` and :pep:`526` style type comments (``# type: " "``, ``# type: ignore ``)." msgstr "" -#: library/ast.rst:2474 +#: library/ast.rst:2518 msgid "Command-Line Usage" msgstr "" -#: library/ast.rst:2478 +#: library/ast.rst:2522 msgid "" "The :mod:`ast` module can be executed as a script from the command line. It " "is as simple as:" msgstr "" -#: library/ast.rst:2481 +#: library/ast.rst:2525 msgid "python -m ast [-m ] [-a] [infile]" msgstr "" -#: library/ast.rst:2485 +#: library/ast.rst:2529 msgid "The following options are accepted:" msgstr "" -#: library/ast.rst:2491 +#: library/ast.rst:2535 msgid "Show the help message and exit." msgstr "" -#: library/ast.rst:2496 +#: library/ast.rst:2540 msgid "" "Specify what kind of code must be compiled, like the *mode* argument in :" "func:`parse`." msgstr "" -#: library/ast.rst:2501 +#: library/ast.rst:2545 msgid "Don't parse type comments." msgstr "" -#: library/ast.rst:2505 +#: library/ast.rst:2549 msgid "Include attributes such as line numbers and column offsets." msgstr "" -#: library/ast.rst:2510 +#: library/ast.rst:2554 msgid "Indentation of nodes in AST (number of spaces)." msgstr "" -#: library/ast.rst:2512 +#: library/ast.rst:2556 msgid "" "If :file:`infile` is specified its contents are parsed to AST and dumped to " "stdout. Otherwise, the content is read from stdin." msgstr "" -#: library/ast.rst:2518 +#: library/ast.rst:2562 msgid "" "`Green Tree Snakes `_, an external " "documentation resource, has good details on working with Python ASTs." msgstr "" -#: library/ast.rst:2521 +#: library/ast.rst:2565 msgid "" "`ASTTokens `_ " "annotates Python ASTs with the positions of tokens and text in the source " @@ -2978,21 +3025,21 @@ msgid "" "transformations." msgstr "" -#: library/ast.rst:2526 +#: library/ast.rst:2570 msgid "" "`leoAst.py `_ unifies the token-based and parse-tree-based views of python programs " "by inserting two-way links between tokens and ast nodes." msgstr "" -#: library/ast.rst:2531 +#: library/ast.rst:2575 msgid "" "`LibCST `_ parses code as a Concrete Syntax " "Tree that looks like an ast tree and keeps all formatting details. It's " "useful for building automated refactoring (codemod) applications and linters." msgstr "" -#: library/ast.rst:2536 +#: library/ast.rst:2580 msgid "" "`Parso `_ is a Python parser that supports " "error recovery and round-trip parsing for different Python versions (in " diff --git a/library/asynchat.po b/library/asynchat.po index bec1f016..6796c9db 100644 --- a/library/asynchat.po +++ b/library/asynchat.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" diff --git a/library/asyncio-api-index.po b/library/asyncio-api-index.po index bae35e3a..133aa659 100644 --- a/library/asyncio-api-index.po +++ b/library/asyncio-api-index.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" diff --git a/library/asyncio-dev.po b/library/asyncio-dev.po index 716b4067..6e8f3504 100644 --- a/library/asyncio-dev.po +++ b/library/asyncio-dev.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" diff --git a/library/asyncio-eventloop.po b/library/asyncio-eventloop.po index 93511595..887dc85e 100644 --- a/library/asyncio-eventloop.po +++ b/library/asyncio-eventloop.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -253,8 +253,8 @@ msgid "" "used." msgstr "" -#: library/asyncio-eventloop.rst:177 library/asyncio-eventloop.rst:1285 -#: library/asyncio-eventloop.rst:1707 +#: library/asyncio-eventloop.rst:177 library/asyncio-eventloop.rst:1301 +#: library/asyncio-eventloop.rst:1750 msgid "Example::" msgstr "" @@ -522,9 +522,9 @@ msgstr "" msgid "" "If *factory* is ``None`` the default task factory will be set. Otherwise, " "*factory* must be a *callable* with the signature matching ``(loop, coro, " -"context=None)``, where *loop* is a reference to the active event loop, and " -"*coro* is a coroutine object. The callable must return a :class:`asyncio." -"Future`-compatible object." +"**kwargs)``, where *loop* is a reference to the active event loop, and " +"*coro* is a coroutine object. The callable must pass on all *kwargs*, and " +"return a :class:`asyncio.Task`-compatible object." msgstr "" #: library/asyncio-eventloop.rst:393 @@ -552,8 +552,8 @@ msgstr "" msgid "The socket type will be :py:const:`~socket.SOCK_STREAM`." msgstr "" -#: library/asyncio-eventloop.rst:418 library/asyncio-eventloop.rst:1195 -#: library/asyncio-eventloop.rst:1212 +#: library/asyncio-eventloop.rst:418 library/asyncio-eventloop.rst:1211 +#: library/asyncio-eventloop.rst:1228 msgid "" "*protocol_factory* must be a callable returning an :ref:`asyncio protocol " "` implementation." @@ -662,7 +662,7 @@ msgid "" msgstr "" #: library/asyncio-eventloop.rst:488 library/asyncio-eventloop.rst:604 -#: library/asyncio-eventloop.rst:836 +#: library/asyncio-eventloop.rst:852 msgid "" "The *sock* argument transfers ownership of the socket to the transport " "created. To close the socket, call the transport's :meth:`~asyncio." @@ -676,15 +676,15 @@ msgid "" "``getaddrinfo()``, similarly to *host* and *port*." msgstr "" -#: library/asyncio-eventloop.rst:496 library/asyncio-eventloop.rst:932 +#: library/asyncio-eventloop.rst:496 library/asyncio-eventloop.rst:948 msgid "" "*ssl_handshake_timeout* is (for a TLS connection) the time in seconds to " "wait for the TLS handshake to complete before aborting the connection. " "``60.0`` seconds if ``None`` (default)." msgstr "" -#: library/asyncio-eventloop.rst:500 library/asyncio-eventloop.rst:751 -#: library/asyncio-eventloop.rst:847 library/asyncio-eventloop.rst:936 +#: library/asyncio-eventloop.rst:500 library/asyncio-eventloop.rst:759 +#: library/asyncio-eventloop.rst:863 library/asyncio-eventloop.rst:952 msgid "" "*ssl_shutdown_timeout* is the time in seconds to wait for the SSL shutdown " "to complete before aborting the connection. ``30.0`` seconds if ``None`` " @@ -701,7 +701,7 @@ msgid "" "(even if there is only one)." msgstr "" -#: library/asyncio-eventloop.rst:514 library/asyncio-eventloop.rst:763 +#: library/asyncio-eventloop.rst:514 library/asyncio-eventloop.rst:771 msgid "Added support for SSL/TLS in :class:`ProactorEventLoop`." msgstr "" @@ -711,7 +711,7 @@ msgid "" "by default for all TCP connections." msgstr "" -#: library/asyncio-eventloop.rst:523 library/asyncio-eventloop.rst:857 +#: library/asyncio-eventloop.rst:523 library/asyncio-eventloop.rst:873 msgid "Added the *ssl_handshake_timeout* parameter." msgstr "" @@ -735,8 +735,8 @@ msgid "For more information: https://datatracker.ietf.org/doc/html/rfc6555" msgstr "" #: library/asyncio-eventloop.rst:542 library/asyncio-eventloop.rst:668 -#: library/asyncio-eventloop.rst:777 library/asyncio-eventloop.rst:813 -#: library/asyncio-eventloop.rst:861 library/asyncio-eventloop.rst:944 +#: library/asyncio-eventloop.rst:785 library/asyncio-eventloop.rst:825 +#: library/asyncio-eventloop.rst:877 library/asyncio-eventloop.rst:960 msgid "Added the *ssl_shutdown_timeout* parameter." msgstr "" @@ -766,8 +766,8 @@ msgstr "" msgid "The socket type will be :py:const:`~socket.SOCK_DGRAM`." msgstr "" -#: library/asyncio-eventloop.rst:568 library/asyncio-eventloop.rst:694 -#: library/asyncio-eventloop.rst:828 +#: library/asyncio-eventloop.rst:568 library/asyncio-eventloop.rst:695 +#: library/asyncio-eventloop.rst:844 msgid "" "*protocol_factory* must be a callable returning a :ref:`protocol ` implementation." @@ -889,9 +889,9 @@ msgid "" "information about arguments to this method." msgstr "" -#: library/asyncio-eventloop.rst:660 library/asyncio-eventloop.rst:804 -#: library/asyncio-eventloop.rst:1265 library/asyncio-eventloop.rst:1778 -#: library/asyncio-eventloop.rst:1785 +#: library/asyncio-eventloop.rst:660 library/asyncio-eventloop.rst:816 +#: library/asyncio-eventloop.rst:1281 library/asyncio-eventloop.rst:1821 +#: library/asyncio-eventloop.rst:1828 msgid "Availability" msgstr "" @@ -905,46 +905,46 @@ msgstr "" msgid "Creating network servers" msgstr "" -#: library/asyncio-eventloop.rst:687 +#: library/asyncio-eventloop.rst:688 msgid "" "Create a TCP server (socket type :const:`~socket.SOCK_STREAM`) listening on " "*port* of the *host* address." msgstr "" -#: library/asyncio-eventloop.rst:690 +#: library/asyncio-eventloop.rst:691 msgid "Returns a :class:`Server` object." msgstr "" -#: library/asyncio-eventloop.rst:692 +#: library/asyncio-eventloop.rst:693 msgid "Arguments:" msgstr "" -#: library/asyncio-eventloop.rst:697 +#: library/asyncio-eventloop.rst:698 msgid "" "The *host* parameter can be set to several types which determine where the " "server would be listening:" msgstr "" -#: library/asyncio-eventloop.rst:700 +#: library/asyncio-eventloop.rst:701 msgid "" "If *host* is a string, the TCP server is bound to a single network interface " "specified by *host*." msgstr "" -#: library/asyncio-eventloop.rst:703 +#: library/asyncio-eventloop.rst:704 msgid "" "If *host* is a sequence of strings, the TCP server is bound to all network " "interfaces specified by the sequence." msgstr "" -#: library/asyncio-eventloop.rst:706 +#: library/asyncio-eventloop.rst:707 msgid "" "If *host* is an empty string or ``None``, all interfaces are assumed and a " "list of multiple sockets will be returned (most likely one for IPv4 and " "another one for IPv6)." msgstr "" -#: library/asyncio-eventloop.rst:710 +#: library/asyncio-eventloop.rst:711 msgid "" "The *port* parameter can be set to specify which port the server should " "listen on. If ``0`` or ``None`` (the default), a random unused port will be " @@ -952,63 +952,73 @@ msgid "" "different random port will be selected for each interface)." msgstr "" -#: library/asyncio-eventloop.rst:715 +#: library/asyncio-eventloop.rst:716 msgid "" "*family* can be set to either :const:`socket.AF_INET` or :const:`~socket." "AF_INET6` to force the socket to use IPv4 or IPv6. If not set, the *family* " "will be determined from host name (defaults to :const:`~socket.AF_UNSPEC`)." msgstr "" -#: library/asyncio-eventloop.rst:720 +#: library/asyncio-eventloop.rst:721 msgid "*flags* is a bitmask for :meth:`getaddrinfo`." msgstr "" -#: library/asyncio-eventloop.rst:722 +#: library/asyncio-eventloop.rst:723 msgid "" "*sock* can optionally be specified in order to use a preexisting socket " "object. If specified, *host* and *port* must not be specified." msgstr "" -#: library/asyncio-eventloop.rst:727 +#: library/asyncio-eventloop.rst:728 msgid "" "The *sock* argument transfers ownership of the socket to the server created. " "To close the socket, call the server's :meth:`~asyncio.Server.close` method." msgstr "" -#: library/asyncio-eventloop.rst:731 +#: library/asyncio-eventloop.rst:732 msgid "" "*backlog* is the maximum number of queued connections passed to :meth:" "`~socket.socket.listen` (defaults to 100)." msgstr "" -#: library/asyncio-eventloop.rst:734 +#: library/asyncio-eventloop.rst:735 msgid "" "*ssl* can be set to an :class:`~ssl.SSLContext` instance to enable TLS over " "the accepted connections." msgstr "" -#: library/asyncio-eventloop.rst:737 +#: library/asyncio-eventloop.rst:738 msgid "" "*reuse_address* tells the kernel to reuse a local socket in ``TIME_WAIT`` " "state, without waiting for its natural timeout to expire. If not specified " "will automatically be set to ``True`` on Unix." msgstr "" -#: library/asyncio-eventloop.rst:742 +#: library/asyncio-eventloop.rst:743 msgid "" "*reuse_port* tells the kernel to allow this endpoint to be bound to the same " "port as other existing endpoints are bound to, so long as they all set this " "flag when being created. This option is not supported on Windows." msgstr "" -#: library/asyncio-eventloop.rst:747 +#: library/asyncio-eventloop.rst:748 +msgid "" +"*keep_alive* set to ``True`` keeps connections active by enabling the " +"periodic transmission of messages." +msgstr "" + +#: library/asyncio-eventloop.rst:753 +msgid "Added the *keep_alive* parameter." +msgstr "" + +#: library/asyncio-eventloop.rst:755 msgid "" "*ssl_handshake_timeout* is (for a TLS server) the time in seconds to wait " "for the TLS handshake to complete before aborting the connection. ``60.0`` " "seconds if ``None`` (default)." msgstr "" -#: library/asyncio-eventloop.rst:755 +#: library/asyncio-eventloop.rst:763 msgid "" "*start_serving* set to ``True`` (the default) causes the created server to " "start accepting connections immediately. When set to ``False``, the user " @@ -1016,104 +1026,115 @@ msgid "" "to make the server to start accepting connections." msgstr "" -#: library/asyncio-eventloop.rst:767 +#: library/asyncio-eventloop.rst:775 msgid "The *host* parameter can be a sequence of strings." msgstr "" -#: library/asyncio-eventloop.rst:771 +#: library/asyncio-eventloop.rst:779 msgid "" "Added *ssl_handshake_timeout* and *start_serving* parameters. The socket " "option :ref:`socket.TCP_NODELAY ` is set by default " "for all TCP connections." msgstr "" -#: library/asyncio-eventloop.rst:781 +#: library/asyncio-eventloop.rst:789 msgid "" "The :func:`start_server` function is a higher-level alternative API that " "returns a pair of :class:`StreamReader` and :class:`StreamWriter` that can " "be used in an async/await code." msgstr "" -#: library/asyncio-eventloop.rst:793 +#: library/asyncio-eventloop.rst:801 msgid "" "Similar to :meth:`loop.create_server` but works with the :py:const:`~socket." "AF_UNIX` socket family." msgstr "" -#: library/asyncio-eventloop.rst:796 +#: library/asyncio-eventloop.rst:804 msgid "" "*path* is the name of a Unix domain socket, and is required, unless a *sock* " "argument is provided. Abstract Unix sockets, :class:`str`, :class:`bytes`, " "and :class:`~pathlib.Path` paths are supported." msgstr "" -#: library/asyncio-eventloop.rst:801 +#: library/asyncio-eventloop.rst:809 +msgid "" +"If *cleanup_socket* is true then the Unix socket will automatically be " +"removed from the filesystem when the server is closed, unless the socket has " +"been replaced after the server has been created." +msgstr "" + +#: library/asyncio-eventloop.rst:813 msgid "" "See the documentation of the :meth:`loop.create_server` method for " "information about arguments to this method." msgstr "" -#: library/asyncio-eventloop.rst:808 +#: library/asyncio-eventloop.rst:820 msgid "" "Added the *ssl_handshake_timeout* and *start_serving* parameters. The *path* " "parameter can now be a :class:`~pathlib.Path` object." msgstr "" -#: library/asyncio-eventloop.rst:821 +#: library/asyncio-eventloop.rst:829 +msgid "Added the *cleanup_socket* parameter." +msgstr "" + +#: library/asyncio-eventloop.rst:837 msgid "Wrap an already accepted connection into a transport/protocol pair." msgstr "" -#: library/asyncio-eventloop.rst:823 +#: library/asyncio-eventloop.rst:839 msgid "" "This method can be used by servers that accept connections outside of " "asyncio but that use asyncio to handle them." msgstr "" -#: library/asyncio-eventloop.rst:826 library/asyncio-eventloop.rst:918 +#: library/asyncio-eventloop.rst:842 library/asyncio-eventloop.rst:934 msgid "Parameters:" msgstr "" -#: library/asyncio-eventloop.rst:831 +#: library/asyncio-eventloop.rst:847 msgid "" "*sock* is a preexisting socket object returned from :meth:`socket.accept " "`." msgstr "" -#: library/asyncio-eventloop.rst:840 +#: library/asyncio-eventloop.rst:856 msgid "" "*ssl* can be set to an :class:`~ssl.SSLContext` to enable SSL over the " "accepted connections." msgstr "" -#: library/asyncio-eventloop.rst:843 +#: library/asyncio-eventloop.rst:859 msgid "" "*ssl_handshake_timeout* is (for an SSL connection) the time in seconds to " "wait for the SSL handshake to complete before aborting the connection. " "``60.0`` seconds if ``None`` (default)." msgstr "" -#: library/asyncio-eventloop.rst:851 +#: library/asyncio-eventloop.rst:867 msgid "Returns a ``(transport, protocol)`` pair." msgstr "" -#: library/asyncio-eventloop.rst:865 +#: library/asyncio-eventloop.rst:881 msgid "Transferring files" msgstr "" -#: library/asyncio-eventloop.rst:871 +#: library/asyncio-eventloop.rst:887 msgid "" "Send a *file* over a *transport*. Return the total number of bytes sent." msgstr "" -#: library/asyncio-eventloop.rst:874 +#: library/asyncio-eventloop.rst:890 msgid "The method uses high-performance :meth:`os.sendfile` if available." msgstr "" -#: library/asyncio-eventloop.rst:876 +#: library/asyncio-eventloop.rst:892 msgid "*file* must be a regular file object opened in binary mode." msgstr "" -#: library/asyncio-eventloop.rst:878 library/asyncio-eventloop.rst:1139 +#: library/asyncio-eventloop.rst:894 library/asyncio-eventloop.rst:1155 msgid "" "*offset* tells from where to start reading the file. If specified, *count* " "is the total number of bytes to transmit as opposed to sending the file " @@ -1122,35 +1143,35 @@ msgid "" "obtain the actual number of bytes sent." msgstr "" -#: library/asyncio-eventloop.rst:885 +#: library/asyncio-eventloop.rst:901 msgid "" "*fallback* set to ``True`` makes asyncio to manually read and send the file " "when the platform does not support the sendfile system call (e.g. Windows or " "SSL socket on Unix)." msgstr "" -#: library/asyncio-eventloop.rst:889 +#: library/asyncio-eventloop.rst:905 msgid "" "Raise :exc:`SendfileNotAvailableError` if the system does not support the " "*sendfile* syscall and *fallback* is ``False``." msgstr "" -#: library/asyncio-eventloop.rst:896 +#: library/asyncio-eventloop.rst:912 msgid "TLS Upgrade" msgstr "" -#: library/asyncio-eventloop.rst:904 +#: library/asyncio-eventloop.rst:920 msgid "Upgrade an existing transport-based connection to TLS." msgstr "" -#: library/asyncio-eventloop.rst:906 +#: library/asyncio-eventloop.rst:922 msgid "" "Create a TLS coder/decoder instance and insert it between the *transport* " "and the *protocol*. The coder/decoder implements both *transport*-facing " "protocol and *protocol*-facing transport." msgstr "" -#: library/asyncio-eventloop.rst:910 +#: library/asyncio-eventloop.rst:926 msgid "" "Return the created two-interface instance. After *await*, the *protocol* " "must stop using the original *transport* and communicate with the returned " @@ -1158,85 +1179,85 @@ msgid "" "exchanges extra TLS session packets with *transport*." msgstr "" -#: library/asyncio-eventloop.rst:915 +#: library/asyncio-eventloop.rst:931 msgid "" "In some situations (e.g. when the passed transport is already closing) this " "may return ``None``." msgstr "" -#: library/asyncio-eventloop.rst:920 +#: library/asyncio-eventloop.rst:936 msgid "" "*transport* and *protocol* instances that methods like :meth:`~loop." "create_server` and :meth:`~loop.create_connection` return." msgstr "" -#: library/asyncio-eventloop.rst:924 +#: library/asyncio-eventloop.rst:940 msgid "*sslcontext*: a configured instance of :class:`~ssl.SSLContext`." msgstr "" -#: library/asyncio-eventloop.rst:926 +#: library/asyncio-eventloop.rst:942 msgid "" "*server_side* pass ``True`` when a server-side connection is being upgraded " "(like the one created by :meth:`~loop.create_server`)." msgstr "" -#: library/asyncio-eventloop.rst:929 +#: library/asyncio-eventloop.rst:945 msgid "" "*server_hostname*: sets or overrides the host name that the target server's " "certificate will be matched against." msgstr "" -#: library/asyncio-eventloop.rst:949 +#: library/asyncio-eventloop.rst:965 msgid "Watching file descriptors" msgstr "" -#: library/asyncio-eventloop.rst:953 +#: library/asyncio-eventloop.rst:969 msgid "" "Start monitoring the *fd* file descriptor for read availability and invoke " "*callback* with the specified arguments once *fd* is available for reading." msgstr "" -#: library/asyncio-eventloop.rst:957 library/asyncio-eventloop.rst:971 +#: library/asyncio-eventloop.rst:973 library/asyncio-eventloop.rst:987 msgid "" "Any preexisting callback registered for *fd* is cancelled and replaced by " "*callback*." msgstr "" -#: library/asyncio-eventloop.rst:962 +#: library/asyncio-eventloop.rst:978 msgid "" "Stop monitoring the *fd* file descriptor for read availability. Returns " "``True`` if *fd* was previously being monitored for reads." msgstr "" -#: library/asyncio-eventloop.rst:967 +#: library/asyncio-eventloop.rst:983 msgid "" "Start monitoring the *fd* file descriptor for write availability and invoke " "*callback* with the specified arguments once *fd* is available for writing." msgstr "" -#: library/asyncio-eventloop.rst:974 library/asyncio-eventloop.rst:1252 +#: library/asyncio-eventloop.rst:990 library/asyncio-eventloop.rst:1268 msgid "" "Use :func:`functools.partial` :ref:`to pass keyword arguments ` to *callback*." msgstr "" -#: library/asyncio-eventloop.rst:979 +#: library/asyncio-eventloop.rst:995 msgid "" "Stop monitoring the *fd* file descriptor for write availability. Returns " "``True`` if *fd* was previously being monitored for writes." msgstr "" -#: library/asyncio-eventloop.rst:982 +#: library/asyncio-eventloop.rst:998 msgid "" "See also :ref:`Platform Support ` section for some " "limitations of these methods." msgstr "" -#: library/asyncio-eventloop.rst:987 +#: library/asyncio-eventloop.rst:1003 msgid "Working with socket objects directly" msgstr "" -#: library/asyncio-eventloop.rst:989 +#: library/asyncio-eventloop.rst:1005 msgid "" "In general, protocol implementations that use transport-based APIs such as :" "meth:`loop.create_connection` and :meth:`loop.create_server` are faster than " @@ -1245,68 +1266,68 @@ msgid "" "socket` objects directly is more convenient." msgstr "" -#: library/asyncio-eventloop.rst:999 +#: library/asyncio-eventloop.rst:1015 msgid "" "Receive up to *nbytes* from *sock*. Asynchronous version of :meth:`socket." "recv() `." msgstr "" -#: library/asyncio-eventloop.rst:1002 +#: library/asyncio-eventloop.rst:1018 msgid "Return the received data as a bytes object." msgstr "" -#: library/asyncio-eventloop.rst:1004 library/asyncio-eventloop.rst:1019 -#: library/asyncio-eventloop.rst:1031 library/asyncio-eventloop.rst:1044 -#: library/asyncio-eventloop.rst:1060 library/asyncio-eventloop.rst:1076 -#: library/asyncio-eventloop.rst:1087 library/asyncio-eventloop.rst:1114 -#: library/asyncio-eventloop.rst:1153 +#: library/asyncio-eventloop.rst:1020 library/asyncio-eventloop.rst:1035 +#: library/asyncio-eventloop.rst:1047 library/asyncio-eventloop.rst:1060 +#: library/asyncio-eventloop.rst:1076 library/asyncio-eventloop.rst:1092 +#: library/asyncio-eventloop.rst:1103 library/asyncio-eventloop.rst:1130 +#: library/asyncio-eventloop.rst:1169 msgid "*sock* must be a non-blocking socket." msgstr "" -#: library/asyncio-eventloop.rst:1006 +#: library/asyncio-eventloop.rst:1022 msgid "" "Even though this method was always documented as a coroutine method, " "releases before Python 3.7 returned a :class:`Future`. Since Python 3.7 this " "is an ``async def`` method." msgstr "" -#: library/asyncio-eventloop.rst:1014 +#: library/asyncio-eventloop.rst:1030 msgid "" "Receive data from *sock* into the *buf* buffer. Modeled after the blocking :" "meth:`socket.recv_into() ` method." msgstr "" -#: library/asyncio-eventloop.rst:1017 +#: library/asyncio-eventloop.rst:1033 msgid "Return the number of bytes written to the buffer." msgstr "" -#: library/asyncio-eventloop.rst:1026 +#: library/asyncio-eventloop.rst:1042 msgid "" "Receive a datagram of up to *bufsize* from *sock*. Asynchronous version of :" "meth:`socket.recvfrom() `." msgstr "" -#: library/asyncio-eventloop.rst:1029 +#: library/asyncio-eventloop.rst:1045 msgid "Return a tuple of (received data, remote address)." msgstr "" -#: library/asyncio-eventloop.rst:1038 +#: library/asyncio-eventloop.rst:1054 msgid "" "Receive a datagram of up to *nbytes* from *sock* into *buf*. Asynchronous " "version of :meth:`socket.recvfrom_into() `." msgstr "" -#: library/asyncio-eventloop.rst:1042 +#: library/asyncio-eventloop.rst:1058 msgid "Return a tuple of (number of bytes received, remote address)." msgstr "" -#: library/asyncio-eventloop.rst:1051 +#: library/asyncio-eventloop.rst:1067 msgid "" "Send *data* to the *sock* socket. Asynchronous version of :meth:`socket." "sendall() `." msgstr "" -#: library/asyncio-eventloop.rst:1054 +#: library/asyncio-eventloop.rst:1070 msgid "" "This method continues to send to the socket until either all data in *data* " "has been sent or an error occurs. ``None`` is returned on success. On " @@ -1315,33 +1336,33 @@ msgid "" "the connection." msgstr "" -#: library/asyncio-eventloop.rst:1062 library/asyncio-eventloop.rst:1116 +#: library/asyncio-eventloop.rst:1078 library/asyncio-eventloop.rst:1132 msgid "" "Even though the method was always documented as a coroutine method, before " "Python 3.7 it returned a :class:`Future`. Since Python 3.7, this is an " "``async def`` method." msgstr "" -#: library/asyncio-eventloop.rst:1070 +#: library/asyncio-eventloop.rst:1086 msgid "" "Send a datagram from *sock* to *address*. Asynchronous version of :meth:" "`socket.sendto() `." msgstr "" -#: library/asyncio-eventloop.rst:1074 +#: library/asyncio-eventloop.rst:1090 msgid "Return the number of bytes sent." msgstr "" -#: library/asyncio-eventloop.rst:1083 +#: library/asyncio-eventloop.rst:1099 msgid "Connect *sock* to a remote socket at *address*." msgstr "" -#: library/asyncio-eventloop.rst:1085 +#: library/asyncio-eventloop.rst:1101 msgid "" "Asynchronous version of :meth:`socket.connect() `." msgstr "" -#: library/asyncio-eventloop.rst:1089 +#: library/asyncio-eventloop.rst:1105 msgid "" "``address`` no longer needs to be resolved. ``sock_connect`` will try to " "check if the *address* is already resolved by calling :func:`socket." @@ -1349,19 +1370,19 @@ msgid "" "*address*." msgstr "" -#: library/asyncio-eventloop.rst:1098 +#: library/asyncio-eventloop.rst:1114 msgid "" ":meth:`loop.create_connection` and :func:`asyncio.open_connection() " "`." msgstr "" -#: library/asyncio-eventloop.rst:1105 +#: library/asyncio-eventloop.rst:1121 msgid "" "Accept a connection. Modeled after the blocking :meth:`socket.accept() " "` method." msgstr "" -#: library/asyncio-eventloop.rst:1108 +#: library/asyncio-eventloop.rst:1124 msgid "" "The socket must be bound to an address and listening for connections. The " "return value is a pair ``(conn, address)`` where *conn* is a *new* socket " @@ -1369,57 +1390,57 @@ msgid "" "the address bound to the socket on the other end of the connection." msgstr "" -#: library/asyncio-eventloop.rst:1123 +#: library/asyncio-eventloop.rst:1139 msgid ":meth:`loop.create_server` and :func:`start_server`." msgstr "" -#: library/asyncio-eventloop.rst:1129 +#: library/asyncio-eventloop.rst:1145 msgid "" "Send a file using high-performance :mod:`os.sendfile` if possible. Return " "the total number of bytes sent." msgstr "" -#: library/asyncio-eventloop.rst:1132 +#: library/asyncio-eventloop.rst:1148 msgid "" "Asynchronous version of :meth:`socket.sendfile() `." msgstr "" -#: library/asyncio-eventloop.rst:1134 +#: library/asyncio-eventloop.rst:1150 msgid "" "*sock* must be a non-blocking :const:`socket.SOCK_STREAM` :class:`~socket." "socket`." msgstr "" -#: library/asyncio-eventloop.rst:1137 +#: library/asyncio-eventloop.rst:1153 msgid "*file* must be a regular file object open in binary mode." msgstr "" -#: library/asyncio-eventloop.rst:1146 +#: library/asyncio-eventloop.rst:1162 msgid "" "*fallback*, when set to ``True``, makes asyncio manually read and send the " "file when the platform does not support the sendfile syscall (e.g. Windows " "or SSL socket on Unix)." msgstr "" -#: library/asyncio-eventloop.rst:1150 +#: library/asyncio-eventloop.rst:1166 msgid "" "Raise :exc:`SendfileNotAvailableError` if the system does not support " "*sendfile* syscall and *fallback* is ``False``." msgstr "" -#: library/asyncio-eventloop.rst:1159 +#: library/asyncio-eventloop.rst:1175 msgid "DNS" msgstr "" -#: library/asyncio-eventloop.rst:1165 +#: library/asyncio-eventloop.rst:1181 msgid "Asynchronous version of :meth:`socket.getaddrinfo`." msgstr "" -#: library/asyncio-eventloop.rst:1170 +#: library/asyncio-eventloop.rst:1186 msgid "Asynchronous version of :meth:`socket.getnameinfo`." msgstr "" -#: library/asyncio-eventloop.rst:1173 +#: library/asyncio-eventloop.rst:1189 msgid "" "Both *getaddrinfo* and *getnameinfo* internally utilize their synchronous " "versions through the loop's default thread pool executor. When this executor " @@ -1429,7 +1450,7 @@ msgid "" "executor with a larger number of workers." msgstr "" -#: library/asyncio-eventloop.rst:1180 +#: library/asyncio-eventloop.rst:1196 msgid "" "Both *getaddrinfo* and *getnameinfo* methods were always documented to " "return a coroutine, but prior to Python 3.7 they were, in fact, returning :" @@ -1437,66 +1458,66 @@ msgid "" "coroutines." msgstr "" -#: library/asyncio-eventloop.rst:1188 +#: library/asyncio-eventloop.rst:1204 msgid "Working with pipes" msgstr "" -#: library/asyncio-eventloop.rst:1193 +#: library/asyncio-eventloop.rst:1209 msgid "Register the read end of *pipe* in the event loop." msgstr "" -#: library/asyncio-eventloop.rst:1198 +#: library/asyncio-eventloop.rst:1214 msgid "*pipe* is a :term:`file-like object `." msgstr "" -#: library/asyncio-eventloop.rst:1200 +#: library/asyncio-eventloop.rst:1216 msgid "" "Return pair ``(transport, protocol)``, where *transport* supports the :class:" "`ReadTransport` interface and *protocol* is an object instantiated by the " "*protocol_factory*." msgstr "" -#: library/asyncio-eventloop.rst:1204 library/asyncio-eventloop.rst:1221 +#: library/asyncio-eventloop.rst:1220 library/asyncio-eventloop.rst:1237 msgid "" "With :class:`SelectorEventLoop` event loop, the *pipe* is set to non-" "blocking mode." msgstr "" -#: library/asyncio-eventloop.rst:1210 +#: library/asyncio-eventloop.rst:1226 msgid "Register the write end of *pipe* in the event loop." msgstr "" -#: library/asyncio-eventloop.rst:1215 +#: library/asyncio-eventloop.rst:1231 msgid "*pipe* is :term:`file-like object `." msgstr "" -#: library/asyncio-eventloop.rst:1217 +#: library/asyncio-eventloop.rst:1233 msgid "" "Return pair ``(transport, protocol)``, where *transport* supports :class:" "`WriteTransport` interface and *protocol* is an object instantiated by the " "*protocol_factory*." msgstr "" -#: library/asyncio-eventloop.rst:1226 +#: library/asyncio-eventloop.rst:1242 msgid "" ":class:`SelectorEventLoop` does not support the above methods on Windows. " "Use :class:`ProactorEventLoop` instead for Windows." msgstr "" -#: library/asyncio-eventloop.rst:1231 +#: library/asyncio-eventloop.rst:1247 msgid "" "The :meth:`loop.subprocess_exec` and :meth:`loop.subprocess_shell` methods." msgstr "" -#: library/asyncio-eventloop.rst:1236 +#: library/asyncio-eventloop.rst:1252 msgid "Unix signals" msgstr "" -#: library/asyncio-eventloop.rst:1242 +#: library/asyncio-eventloop.rst:1258 msgid "Set *callback* as the handler for the *signum* signal." msgstr "" -#: library/asyncio-eventloop.rst:1244 +#: library/asyncio-eventloop.rst:1260 msgid "" "The callback will be invoked by *loop*, along with other queued callbacks " "and runnable coroutines of that event loop. Unlike signal handlers " @@ -1504,40 +1525,40 @@ msgid "" "function is allowed to interact with the event loop." msgstr "" -#: library/asyncio-eventloop.rst:1249 +#: library/asyncio-eventloop.rst:1265 msgid "" "Raise :exc:`ValueError` if the signal number is invalid or uncatchable. " "Raise :exc:`RuntimeError` if there is a problem setting up the handler." msgstr "" -#: library/asyncio-eventloop.rst:1255 +#: library/asyncio-eventloop.rst:1271 msgid "" "Like :func:`signal.signal`, this function must be invoked in the main thread." msgstr "" -#: library/asyncio-eventloop.rst:1260 +#: library/asyncio-eventloop.rst:1276 msgid "Remove the handler for the *sig* signal." msgstr "" -#: library/asyncio-eventloop.rst:1262 +#: library/asyncio-eventloop.rst:1278 msgid "" "Return ``True`` if the signal handler was removed, or ``False`` if no " "handler was set for the given signal." msgstr "" -#: library/asyncio-eventloop.rst:1269 +#: library/asyncio-eventloop.rst:1285 msgid "The :mod:`signal` module." msgstr "" -#: library/asyncio-eventloop.rst:1273 +#: library/asyncio-eventloop.rst:1289 msgid "Executing code in thread or process pools" msgstr "" -#: library/asyncio-eventloop.rst:1277 +#: library/asyncio-eventloop.rst:1293 msgid "Arrange for *func* to be called in the specified executor." msgstr "" -#: library/asyncio-eventloop.rst:1279 +#: library/asyncio-eventloop.rst:1295 msgid "" "The *executor* argument should be an :class:`concurrent.futures.Executor` " "instance. The default executor is used if *executor* is ``None``. The " @@ -1546,7 +1567,7 @@ msgid "" "and used by :func:`run_in_executor` if needed." msgstr "" -#: library/asyncio-eventloop.rst:1287 +#: library/asyncio-eventloop.rst:1303 msgid "" "import asyncio\n" "import concurrent.futures\n" @@ -1589,7 +1610,7 @@ msgid "" " asyncio.run(main())" msgstr "" -#: library/asyncio-eventloop.rst:1327 +#: library/asyncio-eventloop.rst:1343 msgid "" "Note that the entry point guard (``if __name__ == '__main__'``) is required " "for option 3 due to the peculiarities of :mod:`multiprocessing`, which is " @@ -1597,17 +1618,17 @@ msgid "" "importing of main module `." msgstr "" -#: library/asyncio-eventloop.rst:1332 +#: library/asyncio-eventloop.rst:1348 msgid "This method returns a :class:`asyncio.Future` object." msgstr "" -#: library/asyncio-eventloop.rst:1334 +#: library/asyncio-eventloop.rst:1350 msgid "" "Use :func:`functools.partial` :ref:`to pass keyword arguments ` to *func*." msgstr "" -#: library/asyncio-eventloop.rst:1337 +#: library/asyncio-eventloop.rst:1353 msgid "" ":meth:`loop.run_in_executor` no longer configures the ``max_workers`` of the " "thread pool executor it creates, instead leaving it up to the thread pool " @@ -1615,32 +1636,32 @@ msgid "" "default." msgstr "" -#: library/asyncio-eventloop.rst:1346 +#: library/asyncio-eventloop.rst:1362 msgid "" "Set *executor* as the default executor used by :meth:`run_in_executor`. " "*executor* must be an instance of :class:`~concurrent.futures." "ThreadPoolExecutor`." msgstr "" -#: library/asyncio-eventloop.rst:1350 +#: library/asyncio-eventloop.rst:1366 msgid "" "*executor* must be an instance of :class:`~concurrent.futures." "ThreadPoolExecutor`." msgstr "" -#: library/asyncio-eventloop.rst:1356 +#: library/asyncio-eventloop.rst:1372 msgid "Error Handling API" msgstr "" -#: library/asyncio-eventloop.rst:1358 +#: library/asyncio-eventloop.rst:1374 msgid "Allows customizing how exceptions are handled in the event loop." msgstr "" -#: library/asyncio-eventloop.rst:1362 +#: library/asyncio-eventloop.rst:1378 msgid "Set *handler* as the new event loop exception handler." msgstr "" -#: library/asyncio-eventloop.rst:1364 +#: library/asyncio-eventloop.rst:1380 msgid "" "If *handler* is ``None``, the default exception handler will be set. " "Otherwise, *handler* must be a callable with the signature matching ``(loop, " @@ -1649,182 +1670,190 @@ msgid "" "(see :meth:`call_exception_handler` documentation for details about context)." msgstr "" -#: library/asyncio-eventloop.rst:1372 +#: library/asyncio-eventloop.rst:1388 msgid "" "If the handler is called on behalf of a :class:`~asyncio.Task` or :class:" "`~asyncio.Handle`, it is run in the :class:`contextvars.Context` of that " "task or callback handle." msgstr "" -#: library/asyncio-eventloop.rst:1378 +#: library/asyncio-eventloop.rst:1394 msgid "" "The handler may be called in the :class:`~contextvars.Context` of the task " "or handle where the exception originated." msgstr "" -#: library/asyncio-eventloop.rst:1383 +#: library/asyncio-eventloop.rst:1399 msgid "" "Return the current exception handler, or ``None`` if no custom exception " "handler was set." msgstr "" -#: library/asyncio-eventloop.rst:1390 +#: library/asyncio-eventloop.rst:1406 msgid "Default exception handler." msgstr "" -#: library/asyncio-eventloop.rst:1392 +#: library/asyncio-eventloop.rst:1408 msgid "" "This is called when an exception occurs and no exception handler is set. " "This can be called by a custom exception handler that wants to defer to the " "default handler behavior." msgstr "" -#: library/asyncio-eventloop.rst:1396 +#: library/asyncio-eventloop.rst:1412 msgid "" "*context* parameter has the same meaning as in :meth:" "`call_exception_handler`." msgstr "" -#: library/asyncio-eventloop.rst:1401 +#: library/asyncio-eventloop.rst:1417 msgid "Call the current event loop exception handler." msgstr "" -#: library/asyncio-eventloop.rst:1403 +#: library/asyncio-eventloop.rst:1419 msgid "" "*context* is a ``dict`` object containing the following keys (new keys may " "be introduced in future Python versions):" msgstr "" -#: library/asyncio-eventloop.rst:1406 +#: library/asyncio-eventloop.rst:1422 msgid "'message': Error message;" msgstr "" -#: library/asyncio-eventloop.rst:1407 +#: library/asyncio-eventloop.rst:1423 msgid "'exception' (optional): Exception object;" msgstr "" -#: library/asyncio-eventloop.rst:1408 +#: library/asyncio-eventloop.rst:1424 msgid "'future' (optional): :class:`asyncio.Future` instance;" msgstr "" -#: library/asyncio-eventloop.rst:1409 +#: library/asyncio-eventloop.rst:1425 msgid "'task' (optional): :class:`asyncio.Task` instance;" msgstr "" -#: library/asyncio-eventloop.rst:1410 +#: library/asyncio-eventloop.rst:1426 msgid "'handle' (optional): :class:`asyncio.Handle` instance;" msgstr "" -#: library/asyncio-eventloop.rst:1411 +#: library/asyncio-eventloop.rst:1427 msgid "'protocol' (optional): :ref:`Protocol ` instance;" msgstr "" -#: library/asyncio-eventloop.rst:1412 +#: library/asyncio-eventloop.rst:1428 msgid "'transport' (optional): :ref:`Transport ` instance;" msgstr "" -#: library/asyncio-eventloop.rst:1413 +#: library/asyncio-eventloop.rst:1429 msgid "'socket' (optional): :class:`socket.socket` instance;" msgstr "" -#: library/asyncio-eventloop.rst:1414 +#: library/asyncio-eventloop.rst:1430 +msgid "'source_traceback' (optional): Traceback of the source;" +msgstr "" + +#: library/asyncio-eventloop.rst:1431 +msgid "'handle_traceback' (optional): Traceback of the handle;" +msgstr "" + +#: library/asyncio-eventloop.rst:1432 msgid "'asyncgen' (optional): Asynchronous generator that caused" msgstr "" -#: library/asyncio-eventloop.rst:1415 +#: library/asyncio-eventloop.rst:1433 msgid "the exception." msgstr "" -#: library/asyncio-eventloop.rst:1419 +#: library/asyncio-eventloop.rst:1437 msgid "" "This method should not be overloaded in subclassed event loops. For custom " "exception handling, use the :meth:`set_exception_handler` method." msgstr "" -#: library/asyncio-eventloop.rst:1424 +#: library/asyncio-eventloop.rst:1442 msgid "Enabling debug mode" msgstr "" -#: library/asyncio-eventloop.rst:1428 +#: library/asyncio-eventloop.rst:1446 msgid "Get the debug mode (:class:`bool`) of the event loop." msgstr "" -#: library/asyncio-eventloop.rst:1430 +#: library/asyncio-eventloop.rst:1448 msgid "" "The default value is ``True`` if the environment variable :envvar:" "`PYTHONASYNCIODEBUG` is set to a non-empty string, ``False`` otherwise." msgstr "" -#: library/asyncio-eventloop.rst:1436 +#: library/asyncio-eventloop.rst:1454 msgid "Set the debug mode of the event loop." msgstr "" -#: library/asyncio-eventloop.rst:1440 +#: library/asyncio-eventloop.rst:1458 msgid "" "The new :ref:`Python Development Mode ` can now also be used to " "enable the debug mode." msgstr "" -#: library/asyncio-eventloop.rst:1445 +#: library/asyncio-eventloop.rst:1463 msgid "" "This attribute can be used to set the minimum execution duration in seconds " "that is considered \"slow\". When debug mode is enabled, \"slow\" callbacks " "are logged." msgstr "" -#: library/asyncio-eventloop.rst:1449 +#: library/asyncio-eventloop.rst:1467 msgid "Default value is 100 milliseconds." msgstr "" -#: library/asyncio-eventloop.rst:1453 +#: library/asyncio-eventloop.rst:1471 msgid "The :ref:`debug mode of asyncio `." msgstr "" -#: library/asyncio-eventloop.rst:1457 +#: library/asyncio-eventloop.rst:1475 msgid "Running Subprocesses" msgstr "" -#: library/asyncio-eventloop.rst:1459 +#: library/asyncio-eventloop.rst:1477 msgid "" "Methods described in this subsections are low-level. In regular async/await " "code consider using the high-level :func:`asyncio.create_subprocess_shell` " "and :func:`asyncio.create_subprocess_exec` convenience functions instead." msgstr "" -#: library/asyncio-eventloop.rst:1466 +#: library/asyncio-eventloop.rst:1484 msgid "" "On Windows, the default event loop :class:`ProactorEventLoop` supports " "subprocesses, whereas :class:`SelectorEventLoop` does not. See :ref:" "`Subprocess Support on Windows ` for details." msgstr "" -#: library/asyncio-eventloop.rst:1478 +#: library/asyncio-eventloop.rst:1496 msgid "" "Create a subprocess from one or more string arguments specified by *args*." msgstr "" -#: library/asyncio-eventloop.rst:1481 +#: library/asyncio-eventloop.rst:1499 msgid "*args* must be a list of strings represented by:" msgstr "" -#: library/asyncio-eventloop.rst:1483 +#: library/asyncio-eventloop.rst:1501 msgid ":class:`str`;" msgstr "" -#: library/asyncio-eventloop.rst:1484 +#: library/asyncio-eventloop.rst:1502 msgid "" "or :class:`bytes`, encoded to the :ref:`filesystem encoding `." msgstr "" -#: library/asyncio-eventloop.rst:1487 +#: library/asyncio-eventloop.rst:1505 msgid "" "The first string specifies the program executable, and the remaining strings " "specify the arguments. Together, string arguments form the ``argv`` of the " "program." msgstr "" -#: library/asyncio-eventloop.rst:1491 +#: library/asyncio-eventloop.rst:1509 msgid "" "This is similar to the standard library :class:`subprocess.Popen` class " "called with ``shell=False`` and the list of strings passed as the first " @@ -1832,81 +1861,81 @@ msgid "" "which is list of strings, *subprocess_exec* takes multiple string arguments." msgstr "" -#: library/asyncio-eventloop.rst:1497 +#: library/asyncio-eventloop.rst:1515 msgid "" "The *protocol_factory* must be a callable returning a subclass of the :class:" "`asyncio.SubprocessProtocol` class." msgstr "" -#: library/asyncio-eventloop.rst:1500 +#: library/asyncio-eventloop.rst:1518 msgid "Other parameters:" msgstr "" -#: library/asyncio-eventloop.rst:1502 +#: library/asyncio-eventloop.rst:1520 msgid "*stdin* can be any of these:" msgstr "" -#: library/asyncio-eventloop.rst:1504 library/asyncio-eventloop.rst:1515 -#: library/asyncio-eventloop.rst:1525 +#: library/asyncio-eventloop.rst:1522 library/asyncio-eventloop.rst:1533 +#: library/asyncio-eventloop.rst:1543 msgid "a file-like object" msgstr "" -#: library/asyncio-eventloop.rst:1505 +#: library/asyncio-eventloop.rst:1523 msgid "" "an existing file descriptor (a positive integer), for example those created " "with :meth:`os.pipe`" msgstr "" -#: library/asyncio-eventloop.rst:1506 library/asyncio-eventloop.rst:1516 -#: library/asyncio-eventloop.rst:1526 +#: library/asyncio-eventloop.rst:1524 library/asyncio-eventloop.rst:1534 +#: library/asyncio-eventloop.rst:1544 msgid "" "the :const:`subprocess.PIPE` constant (default) which will create a new pipe " "and connect it," msgstr "" -#: library/asyncio-eventloop.rst:1508 library/asyncio-eventloop.rst:1518 -#: library/asyncio-eventloop.rst:1528 +#: library/asyncio-eventloop.rst:1526 library/asyncio-eventloop.rst:1536 +#: library/asyncio-eventloop.rst:1546 msgid "" "the value ``None`` which will make the subprocess inherit the file " "descriptor from this process" msgstr "" -#: library/asyncio-eventloop.rst:1510 library/asyncio-eventloop.rst:1520 -#: library/asyncio-eventloop.rst:1530 +#: library/asyncio-eventloop.rst:1528 library/asyncio-eventloop.rst:1538 +#: library/asyncio-eventloop.rst:1548 msgid "" "the :const:`subprocess.DEVNULL` constant which indicates that the special :" "data:`os.devnull` file will be used" msgstr "" -#: library/asyncio-eventloop.rst:1513 +#: library/asyncio-eventloop.rst:1531 msgid "*stdout* can be any of these:" msgstr "" -#: library/asyncio-eventloop.rst:1523 +#: library/asyncio-eventloop.rst:1541 msgid "*stderr* can be any of these:" msgstr "" -#: library/asyncio-eventloop.rst:1532 +#: library/asyncio-eventloop.rst:1550 msgid "" "the :const:`subprocess.STDOUT` constant which will connect the standard " "error stream to the process' standard output stream" msgstr "" -#: library/asyncio-eventloop.rst:1535 +#: library/asyncio-eventloop.rst:1553 msgid "" "All other keyword arguments are passed to :class:`subprocess.Popen` without " "interpretation, except for *bufsize*, *universal_newlines*, *shell*, *text*, " "*encoding* and *errors*, which should not be specified at all." msgstr "" -#: library/asyncio-eventloop.rst:1540 +#: library/asyncio-eventloop.rst:1558 msgid "" "The ``asyncio`` subprocess API does not support decoding the streams as " "text. :func:`bytes.decode` can be used to convert the bytes returned from " "the stream to text." msgstr "" -#: library/asyncio-eventloop.rst:1544 +#: library/asyncio-eventloop.rst:1562 msgid "" "If a file-like object passed as *stdin*, *stdout* or *stderr* represents a " "pipe, then the other side of this pipe should be registered with :meth:" @@ -1914,52 +1943,52 @@ msgid "" "the event loop." msgstr "" -#: library/asyncio-eventloop.rst:1549 +#: library/asyncio-eventloop.rst:1567 msgid "" "See the constructor of the :class:`subprocess.Popen` class for documentation " "on other arguments." msgstr "" -#: library/asyncio-eventloop.rst:1552 +#: library/asyncio-eventloop.rst:1570 msgid "" "Returns a pair of ``(transport, protocol)``, where *transport* conforms to " "the :class:`asyncio.SubprocessTransport` base class and *protocol* is an " "object instantiated by the *protocol_factory*." msgstr "" -#: library/asyncio-eventloop.rst:1561 +#: library/asyncio-eventloop.rst:1579 msgid "" "Create a subprocess from *cmd*, which can be a :class:`str` or a :class:" "`bytes` string encoded to the :ref:`filesystem encoding `, using the platform's \"shell\" syntax." msgstr "" -#: library/asyncio-eventloop.rst:1566 +#: library/asyncio-eventloop.rst:1584 msgid "" "This is similar to the standard library :class:`subprocess.Popen` class " "called with ``shell=True``." msgstr "" -#: library/asyncio-eventloop.rst:1569 +#: library/asyncio-eventloop.rst:1587 msgid "" "The *protocol_factory* must be a callable returning a subclass of the :class:" "`SubprocessProtocol` class." msgstr "" -#: library/asyncio-eventloop.rst:1572 +#: library/asyncio-eventloop.rst:1590 msgid "" "See :meth:`~loop.subprocess_exec` for more details about the remaining " "arguments." msgstr "" -#: library/asyncio-eventloop.rst:1575 +#: library/asyncio-eventloop.rst:1593 msgid "" "Returns a pair of ``(transport, protocol)``, where *transport* conforms to " "the :class:`SubprocessTransport` base class and *protocol* is an object " "instantiated by the *protocol_factory*." msgstr "" -#: library/asyncio-eventloop.rst:1580 +#: library/asyncio-eventloop.rst:1598 msgid "" "It is the application's responsibility to ensure that all whitespace and " "special characters are quoted appropriately to avoid `shell injection " @@ -1969,74 +1998,74 @@ msgid "" "used to construct shell commands." msgstr "" -#: library/asyncio-eventloop.rst:1589 +#: library/asyncio-eventloop.rst:1607 msgid "Callback Handles" msgstr "" -#: library/asyncio-eventloop.rst:1593 +#: library/asyncio-eventloop.rst:1611 msgid "" "A callback wrapper object returned by :meth:`loop.call_soon`, :meth:`loop." "call_soon_threadsafe`." msgstr "" -#: library/asyncio-eventloop.rst:1598 +#: library/asyncio-eventloop.rst:1616 msgid "" "Return the :class:`contextvars.Context` object associated with the handle." msgstr "" -#: library/asyncio-eventloop.rst:1605 +#: library/asyncio-eventloop.rst:1623 msgid "" "Cancel the callback. If the callback has already been canceled or executed, " "this method has no effect." msgstr "" -#: library/asyncio-eventloop.rst:1610 +#: library/asyncio-eventloop.rst:1628 msgid "Return ``True`` if the callback was cancelled." msgstr "" -#: library/asyncio-eventloop.rst:1616 +#: library/asyncio-eventloop.rst:1634 msgid "" "A callback wrapper object returned by :meth:`loop.call_later`, and :meth:" "`loop.call_at`." msgstr "" -#: library/asyncio-eventloop.rst:1619 +#: library/asyncio-eventloop.rst:1637 msgid "This class is a subclass of :class:`Handle`." msgstr "" -#: library/asyncio-eventloop.rst:1623 +#: library/asyncio-eventloop.rst:1641 msgid "Return a scheduled callback time as :class:`float` seconds." msgstr "" -#: library/asyncio-eventloop.rst:1625 +#: library/asyncio-eventloop.rst:1643 msgid "" "The time is an absolute timestamp, using the same time reference as :meth:" "`loop.time`." msgstr "" -#: library/asyncio-eventloop.rst:1632 +#: library/asyncio-eventloop.rst:1650 msgid "Server Objects" msgstr "" -#: library/asyncio-eventloop.rst:1634 +#: library/asyncio-eventloop.rst:1652 msgid "" "Server objects are created by :meth:`loop.create_server`, :meth:`loop." "create_unix_server`, :func:`start_server`, and :func:`start_unix_server` " "functions." msgstr "" -#: library/asyncio-eventloop.rst:1638 +#: library/asyncio-eventloop.rst:1656 msgid "Do not instantiate the :class:`Server` class directly." msgstr "" -#: library/asyncio-eventloop.rst:1642 +#: library/asyncio-eventloop.rst:1660 msgid "" "*Server* objects are asynchronous context managers. When used in an ``async " "with`` statement, it's guaranteed that the Server object is closed and not " "accepting new connections when the ``async with`` statement is completed::" msgstr "" -#: library/asyncio-eventloop.rst:1647 +#: library/asyncio-eventloop.rst:1665 msgid "" "srv = await loop.create_server(...)\n" "\n" @@ -2046,49 +2075,81 @@ msgid "" "# At this point, srv is closed and no longer accepts new connections." msgstr "" -#: library/asyncio-eventloop.rst:1655 +#: library/asyncio-eventloop.rst:1673 msgid "Server object is an asynchronous context manager since Python 3.7." msgstr "" -#: library/asyncio-eventloop.rst:1658 +#: library/asyncio-eventloop.rst:1676 msgid "" "This class was exposed publicly as ``asyncio.Server`` in Python 3.9.11, " "3.10.3 and 3.11." msgstr "" -#: library/asyncio-eventloop.rst:1663 +#: library/asyncio-eventloop.rst:1681 msgid "" "Stop serving: close listening sockets and set the :attr:`sockets` attribute " "to ``None``." msgstr "" -#: library/asyncio-eventloop.rst:1666 +#: library/asyncio-eventloop.rst:1684 msgid "" "The sockets that represent existing incoming client connections are left " "open." msgstr "" -#: library/asyncio-eventloop.rst:1669 +#: library/asyncio-eventloop.rst:1687 msgid "" "The server is closed asynchronously; use the :meth:`wait_closed` coroutine " "to wait until the server is closed (and no more connections are active)." msgstr "" -#: library/asyncio-eventloop.rst:1675 +#: library/asyncio-eventloop.rst:1693 +msgid "Close all existing incoming client connections." +msgstr "" + +#: library/asyncio-eventloop.rst:1695 +msgid "" +"Calls :meth:`~asyncio.BaseTransport.close` on all associated transports." +msgstr "" + +#: library/asyncio-eventloop.rst:1698 +msgid "" +":meth:`close` should be called before :meth:`close_clients` when closing the " +"server to avoid races with new clients connecting." +msgstr "" + +#: library/asyncio-eventloop.rst:1705 +msgid "" +"Close all existing incoming client connections immediately, without waiting " +"for pending operations to complete." +msgstr "" + +#: library/asyncio-eventloop.rst:1708 +msgid "" +"Calls :meth:`~asyncio.WriteTransport.abort` on all associated transports." +msgstr "" + +#: library/asyncio-eventloop.rst:1711 +msgid "" +":meth:`close` should be called before :meth:`abort_clients` when closing the " +"server to avoid races with new clients connecting." +msgstr "" + +#: library/asyncio-eventloop.rst:1718 msgid "Return the event loop associated with the server object." msgstr "" -#: library/asyncio-eventloop.rst:1682 +#: library/asyncio-eventloop.rst:1725 msgid "Start accepting connections." msgstr "" -#: library/asyncio-eventloop.rst:1684 +#: library/asyncio-eventloop.rst:1727 msgid "" "This method is idempotent, so it can be called when the server is already " "serving." msgstr "" -#: library/asyncio-eventloop.rst:1687 +#: library/asyncio-eventloop.rst:1730 msgid "" "The *start_serving* keyword-only parameter to :meth:`loop.create_server` " "and :meth:`asyncio.start_server` allows creating a Server object that is not " @@ -2097,19 +2158,19 @@ msgid "" "accepting connections." msgstr "" -#: library/asyncio-eventloop.rst:1699 +#: library/asyncio-eventloop.rst:1742 msgid "" "Start accepting connections until the coroutine is cancelled. Cancellation " "of ``serve_forever`` task causes the server to be closed." msgstr "" -#: library/asyncio-eventloop.rst:1703 +#: library/asyncio-eventloop.rst:1746 msgid "" "This method can be called if the server is already accepting connections. " "Only one ``serve_forever`` task can exist per one *Server* object." msgstr "" -#: library/asyncio-eventloop.rst:1709 +#: library/asyncio-eventloop.rst:1752 msgid "" "async def client_connected(reader, writer):\n" " # Communicate with the client with\n" @@ -2124,56 +2185,56 @@ msgid "" "asyncio.run(main('127.0.0.1', 0))" msgstr "" -#: library/asyncio-eventloop.rst:1725 +#: library/asyncio-eventloop.rst:1768 msgid "Return ``True`` if the server is accepting new connections." msgstr "" -#: library/asyncio-eventloop.rst:1732 +#: library/asyncio-eventloop.rst:1775 msgid "" "Wait until the :meth:`close` method completes and all active connections " "have finished." msgstr "" -#: library/asyncio-eventloop.rst:1737 +#: library/asyncio-eventloop.rst:1780 msgid "" "List of socket-like objects, ``asyncio.trsock.TransportSocket``, which the " "server is listening on." msgstr "" -#: library/asyncio-eventloop.rst:1740 +#: library/asyncio-eventloop.rst:1783 msgid "" "Prior to Python 3.7 ``Server.sockets`` used to return an internal list of " "server sockets directly. In 3.7 a copy of that list is returned." msgstr "" -#: library/asyncio-eventloop.rst:1750 +#: library/asyncio-eventloop.rst:1793 msgid "Event Loop Implementations" msgstr "" -#: library/asyncio-eventloop.rst:1752 +#: library/asyncio-eventloop.rst:1795 msgid "" "asyncio ships with two different event loop implementations: :class:" "`SelectorEventLoop` and :class:`ProactorEventLoop`." msgstr "" -#: library/asyncio-eventloop.rst:1755 -msgid "" -"By default asyncio is configured to use :class:`SelectorEventLoop` on Unix " -"and :class:`ProactorEventLoop` on Windows." +#: library/asyncio-eventloop.rst:1798 +msgid "By default asyncio is configured to use :class:`EventLoop`." msgstr "" -#: library/asyncio-eventloop.rst:1761 -msgid "An event loop based on the :mod:`selectors` module." +#: library/asyncio-eventloop.rst:1803 +msgid "" +"A subclass of :class:`AbstractEventLoop` based on the :mod:`selectors` " +"module." msgstr "" -#: library/asyncio-eventloop.rst:1763 +#: library/asyncio-eventloop.rst:1806 msgid "" "Uses the most efficient *selector* available for the given platform. It is " "also possible to manually configure the exact selector implementation to be " "used::" msgstr "" -#: library/asyncio-eventloop.rst:1767 +#: library/asyncio-eventloop.rst:1810 msgid "" "import asyncio\n" "import selectors\n" @@ -2186,31 +2247,45 @@ msgid "" "asyncio.set_event_loop_policy(MyPolicy())" msgstr "" -#: library/asyncio-eventloop.rst:1783 -msgid "An event loop for Windows that uses \"I/O Completion Ports\" (IOCP)." +#: library/asyncio-eventloop.rst:1826 +msgid "" +"A subclass of :class:`AbstractEventLoop` for Windows that uses \"I/O " +"Completion Ports\" (IOCP)." msgstr "" -#: library/asyncio-eventloop.rst:1789 +#: library/asyncio-eventloop.rst:1832 msgid "" "`MSDN documentation on I/O Completion Ports `_." msgstr "" -#: library/asyncio-eventloop.rst:1795 +#: library/asyncio-eventloop.rst:1837 +msgid "" +"An alias to the most efficient available subclass of :class:" +"`AbstractEventLoop` for the given platform." +msgstr "" + +#: library/asyncio-eventloop.rst:1840 +msgid "" +"It is an alias to :class:`SelectorEventLoop` on Unix and :class:" +"`ProactorEventLoop` on Windows." +msgstr "" + +#: library/asyncio-eventloop.rst:1846 msgid "Abstract base class for asyncio-compliant event loops." msgstr "" -#: library/asyncio-eventloop.rst:1797 +#: library/asyncio-eventloop.rst:1848 msgid "" "The :ref:`asyncio-event-loop-methods` section lists all methods that an " "alternative implementation of ``AbstractEventLoop`` should have defined." msgstr "" -#: library/asyncio-eventloop.rst:1803 +#: library/asyncio-eventloop.rst:1854 msgid "Examples" msgstr "" -#: library/asyncio-eventloop.rst:1805 +#: library/asyncio-eventloop.rst:1856 msgid "" "Note that all examples in this section **purposefully** show how to use the " "low-level event loop APIs, such as :meth:`loop.run_forever` and :meth:`loop." @@ -2218,17 +2293,17 @@ msgid "" "consider using the high-level functions like :func:`asyncio.run`." msgstr "" -#: library/asyncio-eventloop.rst:1815 +#: library/asyncio-eventloop.rst:1866 msgid "Hello World with call_soon()" msgstr "" -#: library/asyncio-eventloop.rst:1817 +#: library/asyncio-eventloop.rst:1868 msgid "" "An example using the :meth:`loop.call_soon` method to schedule a callback. " "The callback displays ``\"Hello World\"`` and then stops the event loop::" msgstr "" -#: library/asyncio-eventloop.rst:1821 +#: library/asyncio-eventloop.rst:1872 msgid "" "import asyncio\n" "\n" @@ -2249,24 +2324,24 @@ msgid "" " loop.close()" msgstr "" -#: library/asyncio-eventloop.rst:1841 +#: library/asyncio-eventloop.rst:1892 msgid "" "A similar :ref:`Hello World ` example created with a coroutine " "and the :func:`run` function." msgstr "" -#: library/asyncio-eventloop.rst:1848 +#: library/asyncio-eventloop.rst:1899 msgid "Display the current date with call_later()" msgstr "" -#: library/asyncio-eventloop.rst:1850 +#: library/asyncio-eventloop.rst:1901 msgid "" "An example of a callback displaying the current date every second. The " "callback uses the :meth:`loop.call_later` method to reschedule itself after " "5 seconds, and then stops the event loop::" msgstr "" -#: library/asyncio-eventloop.rst:1854 +#: library/asyncio-eventloop.rst:1905 msgid "" "import asyncio\n" "import datetime\n" @@ -2291,23 +2366,23 @@ msgid "" " loop.close()" msgstr "" -#: library/asyncio-eventloop.rst:1878 +#: library/asyncio-eventloop.rst:1929 msgid "" "A similar :ref:`current date ` example created with a " "coroutine and the :func:`run` function." msgstr "" -#: library/asyncio-eventloop.rst:1885 +#: library/asyncio-eventloop.rst:1936 msgid "Watch a file descriptor for read events" msgstr "" -#: library/asyncio-eventloop.rst:1887 +#: library/asyncio-eventloop.rst:1938 msgid "" "Wait until a file descriptor received some data using the :meth:`loop." "add_reader` method and then close the event loop::" msgstr "" -#: library/asyncio-eventloop.rst:1890 +#: library/asyncio-eventloop.rst:1941 msgid "" "import asyncio\n" "from socket import socketpair\n" @@ -2343,33 +2418,33 @@ msgid "" " loop.close()" msgstr "" -#: library/asyncio-eventloop.rst:1925 +#: library/asyncio-eventloop.rst:1976 msgid "" "A similar :ref:`example ` using " "transports, protocols, and the :meth:`loop.create_connection` method." msgstr "" -#: library/asyncio-eventloop.rst:1929 +#: library/asyncio-eventloop.rst:1980 msgid "" "Another similar :ref:`example ` " "using the high-level :func:`asyncio.open_connection` function and streams." msgstr "" -#: library/asyncio-eventloop.rst:1937 +#: library/asyncio-eventloop.rst:1988 msgid "Set signal handlers for SIGINT and SIGTERM" msgstr "" -#: library/asyncio-eventloop.rst:1939 +#: library/asyncio-eventloop.rst:1990 msgid "(This ``signals`` example only works on Unix.)" msgstr "" -#: library/asyncio-eventloop.rst:1941 +#: library/asyncio-eventloop.rst:1992 msgid "" "Register handlers for signals :const:`~signal.SIGINT` and :const:`~signal." "SIGTERM` using the :meth:`loop.add_signal_handler` method::" msgstr "" -#: library/asyncio-eventloop.rst:1944 +#: library/asyncio-eventloop.rst:1995 msgid "" "import asyncio\n" "import functools\n" diff --git a/library/asyncio-exceptions.po b/library/asyncio-exceptions.po index ec9f353d..c833d124 100644 --- a/library/asyncio-exceptions.po +++ b/library/asyncio-exceptions.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" diff --git a/library/asyncio-extending.po b/library/asyncio-extending.po index 721d06f4..d9553135 100644 --- a/library/asyncio-extending.po +++ b/library/asyncio-extending.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" diff --git a/library/asyncio-future.po b/library/asyncio-future.po index 29d42cd8..f90d687e 100644 --- a/library/asyncio-future.po +++ b/library/asyncio-future.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" diff --git a/library/asyncio-llapi-index.po b/library/asyncio-llapi-index.po index 0cc46834..777a7e09 100644 --- a/library/asyncio-llapi-index.po +++ b/library/asyncio-llapi-index.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" diff --git a/library/asyncio-platforms.po b/library/asyncio-platforms.po index 98508eda..99792100 100644 --- a/library/asyncio-platforms.po +++ b/library/asyncio-platforms.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" diff --git a/library/asyncio-policy.po b/library/asyncio-policy.po index 3d59d178..8f0e5217 100644 --- a/library/asyncio-policy.po +++ b/library/asyncio-policy.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" diff --git a/library/asyncio-protocol.po b/library/asyncio-protocol.po index 504e48b6..381df5ba 100644 --- a/library/asyncio-protocol.po +++ b/library/asyncio-protocol.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -496,7 +496,14 @@ msgid "" "the target address given on transport creation." msgstr "" -#: library/asyncio-protocol.rst:367 +#: library/asyncio-protocol.rst:365 +msgid "" +"This method can be called with an empty bytes object to send a zero-length " +"datagram. The buffer size calculation used for flow control is also updated " +"to account for the datagram header." +msgstr "" + +#: library/asyncio-protocol.rst:372 msgid "" "Close the transport immediately, without waiting for pending operations to " "complete. Buffered data will be lost. No more data will be received. The " @@ -504,110 +511,110 @@ msgid "" "method will eventually be called with :const:`None` as its argument." msgstr "" -#: library/asyncio-protocol.rst:377 +#: library/asyncio-protocol.rst:382 msgid "Subprocess Transports" msgstr "" -#: library/asyncio-protocol.rst:381 +#: library/asyncio-protocol.rst:386 msgid "Return the subprocess process id as an integer." msgstr "" -#: library/asyncio-protocol.rst:385 +#: library/asyncio-protocol.rst:390 msgid "" "Return the transport for the communication pipe corresponding to the integer " "file descriptor *fd*:" msgstr "" -#: library/asyncio-protocol.rst:388 +#: library/asyncio-protocol.rst:393 msgid "" "``0``: readable streaming transport of the standard input (*stdin*), or :" "const:`None` if the subprocess was not created with ``stdin=PIPE``" msgstr "" -#: library/asyncio-protocol.rst:390 +#: library/asyncio-protocol.rst:395 msgid "" "``1``: writable streaming transport of the standard output (*stdout*), or :" "const:`None` if the subprocess was not created with ``stdout=PIPE``" msgstr "" -#: library/asyncio-protocol.rst:392 +#: library/asyncio-protocol.rst:397 msgid "" "``2``: writable streaming transport of the standard error (*stderr*), or :" "const:`None` if the subprocess was not created with ``stderr=PIPE``" msgstr "" -#: library/asyncio-protocol.rst:394 +#: library/asyncio-protocol.rst:399 msgid "other *fd*: :const:`None`" msgstr "" -#: library/asyncio-protocol.rst:398 +#: library/asyncio-protocol.rst:403 msgid "" "Return the subprocess return code as an integer or :const:`None` if it " "hasn't returned, which is similar to the :attr:`subprocess.Popen.returncode` " "attribute." msgstr "" -#: library/asyncio-protocol.rst:404 +#: library/asyncio-protocol.rst:409 msgid "Kill the subprocess." msgstr "" -#: library/asyncio-protocol.rst:406 +#: library/asyncio-protocol.rst:411 msgid "" "On POSIX systems, the function sends SIGKILL to the subprocess. On Windows, " "this method is an alias for :meth:`terminate`." msgstr "" -#: library/asyncio-protocol.rst:409 +#: library/asyncio-protocol.rst:414 msgid "See also :meth:`subprocess.Popen.kill`." msgstr "" -#: library/asyncio-protocol.rst:413 +#: library/asyncio-protocol.rst:418 msgid "" "Send the *signal* number to the subprocess, as in :meth:`subprocess.Popen." "send_signal`." msgstr "" -#: library/asyncio-protocol.rst:418 +#: library/asyncio-protocol.rst:423 msgid "Stop the subprocess." msgstr "" -#: library/asyncio-protocol.rst:420 +#: library/asyncio-protocol.rst:425 msgid "" "On POSIX systems, this method sends :py:const:`~signal.SIGTERM` to the " "subprocess. On Windows, the Windows API function :c:func:`!TerminateProcess` " "is called to stop the subprocess." msgstr "" -#: library/asyncio-protocol.rst:424 +#: library/asyncio-protocol.rst:429 msgid "See also :meth:`subprocess.Popen.terminate`." msgstr "" -#: library/asyncio-protocol.rst:428 +#: library/asyncio-protocol.rst:433 msgid "Kill the subprocess by calling the :meth:`kill` method." msgstr "" -#: library/asyncio-protocol.rst:430 +#: library/asyncio-protocol.rst:435 msgid "" "If the subprocess hasn't returned yet, and close transports of *stdin*, " "*stdout*, and *stderr* pipes." msgstr "" -#: library/asyncio-protocol.rst:437 +#: library/asyncio-protocol.rst:442 msgid "Protocols" msgstr "" -#: library/asyncio-protocol.rst:439 +#: library/asyncio-protocol.rst:444 msgid "**Source code:** :source:`Lib/asyncio/protocols.py`" msgstr "" -#: library/asyncio-protocol.rst:443 +#: library/asyncio-protocol.rst:448 msgid "" "asyncio provides a set of abstract base classes that should be used to " "implement network protocols. Those classes are meant to be used together " "with :ref:`transports `." msgstr "" -#: library/asyncio-protocol.rst:447 +#: library/asyncio-protocol.rst:452 msgid "" "Subclasses of abstract base protocol classes may implement some or all " "methods. All these methods are callbacks: they are called by transports on " @@ -615,117 +622,117 @@ msgid "" "method should be called by the corresponding transport." msgstr "" -#: library/asyncio-protocol.rst:454 +#: library/asyncio-protocol.rst:459 msgid "Base Protocols" msgstr "" -#: library/asyncio-protocol.rst:458 +#: library/asyncio-protocol.rst:463 msgid "Base protocol with methods that all protocols share." msgstr "" -#: library/asyncio-protocol.rst:462 +#: library/asyncio-protocol.rst:467 msgid "" "The base class for implementing streaming protocols (TCP, Unix sockets, etc)." msgstr "" -#: library/asyncio-protocol.rst:467 +#: library/asyncio-protocol.rst:472 msgid "" "A base class for implementing streaming protocols with manual control of the " "receive buffer." msgstr "" -#: library/asyncio-protocol.rst:472 +#: library/asyncio-protocol.rst:477 msgid "The base class for implementing datagram (UDP) protocols." msgstr "" -#: library/asyncio-protocol.rst:476 +#: library/asyncio-protocol.rst:481 msgid "" "The base class for implementing protocols communicating with child processes " "(unidirectional pipes)." msgstr "" -#: library/asyncio-protocol.rst:481 +#: library/asyncio-protocol.rst:486 msgid "Base Protocol" msgstr "" -#: library/asyncio-protocol.rst:483 +#: library/asyncio-protocol.rst:488 msgid "All asyncio protocols can implement Base Protocol callbacks." msgstr "" -#: library/asyncio-protocol.rst:486 +#: library/asyncio-protocol.rst:491 msgid "Connection Callbacks" msgstr "" -#: library/asyncio-protocol.rst:487 +#: library/asyncio-protocol.rst:492 msgid "" "Connection callbacks are called on all protocols, exactly once per a " "successful connection. All other protocol callbacks can only be called " "between those two methods." msgstr "" -#: library/asyncio-protocol.rst:493 +#: library/asyncio-protocol.rst:498 msgid "Called when a connection is made." msgstr "" -#: library/asyncio-protocol.rst:495 +#: library/asyncio-protocol.rst:500 msgid "" "The *transport* argument is the transport representing the connection. The " "protocol is responsible for storing the reference to its transport." msgstr "" -#: library/asyncio-protocol.rst:501 +#: library/asyncio-protocol.rst:506 msgid "Called when the connection is lost or closed." msgstr "" -#: library/asyncio-protocol.rst:503 +#: library/asyncio-protocol.rst:508 msgid "" "The argument is either an exception object or :const:`None`. The latter " "means a regular EOF is received, or the connection was aborted or closed by " "this side of the connection." msgstr "" -#: library/asyncio-protocol.rst:509 +#: library/asyncio-protocol.rst:514 msgid "Flow Control Callbacks" msgstr "" -#: library/asyncio-protocol.rst:510 +#: library/asyncio-protocol.rst:515 msgid "" "Flow control callbacks can be called by transports to pause or resume " "writing performed by the protocol." msgstr "" -#: library/asyncio-protocol.rst:513 +#: library/asyncio-protocol.rst:518 msgid "" "See the documentation of the :meth:`~WriteTransport.set_write_buffer_limits` " "method for more details." msgstr "" -#: library/asyncio-protocol.rst:518 +#: library/asyncio-protocol.rst:523 msgid "Called when the transport's buffer goes over the high watermark." msgstr "" -#: library/asyncio-protocol.rst:522 +#: library/asyncio-protocol.rst:527 msgid "Called when the transport's buffer drains below the low watermark." msgstr "" -#: library/asyncio-protocol.rst:524 +#: library/asyncio-protocol.rst:529 msgid "" "If the buffer size equals the high watermark, :meth:`~BaseProtocol." "pause_writing` is not called: the buffer size must go strictly over." msgstr "" -#: library/asyncio-protocol.rst:528 +#: library/asyncio-protocol.rst:533 msgid "" "Conversely, :meth:`~BaseProtocol.resume_writing` is called when the buffer " "size is equal or lower than the low watermark. These end conditions are " "important to ensure that things go as expected when either mark is zero." msgstr "" -#: library/asyncio-protocol.rst:535 +#: library/asyncio-protocol.rst:540 msgid "Streaming Protocols" msgstr "" -#: library/asyncio-protocol.rst:537 +#: library/asyncio-protocol.rst:542 msgid "" "Event methods, such as :meth:`loop.create_server`, :meth:`loop." "create_unix_server`, :meth:`loop.create_connection`, :meth:`loop." @@ -734,13 +741,13 @@ msgid "" "that return streaming protocols." msgstr "" -#: library/asyncio-protocol.rst:545 +#: library/asyncio-protocol.rst:550 msgid "" "Called when some data is received. *data* is a non-empty bytes object " "containing the incoming data." msgstr "" -#: library/asyncio-protocol.rst:548 +#: library/asyncio-protocol.rst:553 msgid "" "Whether the data is buffered, chunked or reassembled depends on the " "transport. In general, you shouldn't rely on specific semantics and instead " @@ -748,27 +755,27 @@ msgid "" "the correct order." msgstr "" -#: library/asyncio-protocol.rst:553 +#: library/asyncio-protocol.rst:558 msgid "" "The method can be called an arbitrary number of times while a connection is " "open." msgstr "" -#: library/asyncio-protocol.rst:556 +#: library/asyncio-protocol.rst:561 msgid "" "However, :meth:`protocol.eof_received() ` is called " "at most once. Once ``eof_received()`` is called, ``data_received()`` is not " "called anymore." msgstr "" -#: library/asyncio-protocol.rst:562 +#: library/asyncio-protocol.rst:567 msgid "" "Called when the other end signals it won't send any more data (for example " "by calling :meth:`transport.write_eof() `, if the " "other end also uses asyncio)." msgstr "" -#: library/asyncio-protocol.rst:567 +#: library/asyncio-protocol.rst:572 msgid "" "This method may return a false value (including ``None``), in which case the " "transport will close itself. Conversely, if this method returns a true " @@ -777,18 +784,18 @@ msgid "" "connection." msgstr "" -#: library/asyncio-protocol.rst:573 +#: library/asyncio-protocol.rst:578 msgid "" "Some transports, including SSL, don't support half-closed connections, in " "which case returning true from this method will result in the connection " "being closed." msgstr "" -#: library/asyncio-protocol.rst:578 library/asyncio-protocol.rst:636 +#: library/asyncio-protocol.rst:583 library/asyncio-protocol.rst:641 msgid "State machine:" msgstr "" -#: library/asyncio-protocol.rst:580 +#: library/asyncio-protocol.rst:585 msgid "" "start -> connection_made\n" " [-> data_received]*\n" @@ -796,17 +803,17 @@ msgid "" "-> connection_lost -> end" msgstr "" -#: library/asyncio-protocol.rst:589 +#: library/asyncio-protocol.rst:594 msgid "Buffered Streaming Protocols" msgstr "" -#: library/asyncio-protocol.rst:593 +#: library/asyncio-protocol.rst:598 msgid "" "Buffered Protocols can be used with any event loop method that supports " "`Streaming Protocols`_." msgstr "" -#: library/asyncio-protocol.rst:596 +#: library/asyncio-protocol.rst:601 msgid "" "``BufferedProtocol`` implementations allow explicit manual allocation and " "control of the receive buffer. Event loops can then use the buffer provided " @@ -816,16 +823,16 @@ msgid "" "number of buffer allocations." msgstr "" -#: library/asyncio-protocol.rst:603 +#: library/asyncio-protocol.rst:608 msgid "" "The following callbacks are called on :class:`BufferedProtocol` instances:" msgstr "" -#: library/asyncio-protocol.rst:608 +#: library/asyncio-protocol.rst:613 msgid "Called to allocate a new receive buffer." msgstr "" -#: library/asyncio-protocol.rst:610 +#: library/asyncio-protocol.rst:615 msgid "" "*sizehint* is the recommended minimum size for the returned buffer. It is " "acceptable to return smaller or larger buffers than what *sizehint* " @@ -833,27 +840,27 @@ msgid "" "to return a buffer with a zero size." msgstr "" -#: library/asyncio-protocol.rst:615 +#: library/asyncio-protocol.rst:620 msgid "" "``get_buffer()`` must return an object implementing the :ref:`buffer " "protocol `." msgstr "" -#: library/asyncio-protocol.rst:620 +#: library/asyncio-protocol.rst:625 msgid "Called when the buffer was updated with the received data." msgstr "" -#: library/asyncio-protocol.rst:622 +#: library/asyncio-protocol.rst:627 msgid "*nbytes* is the total number of bytes that were written to the buffer." msgstr "" -#: library/asyncio-protocol.rst:626 +#: library/asyncio-protocol.rst:631 msgid "" "See the documentation of the :meth:`protocol.eof_received() ` method." msgstr "" -#: library/asyncio-protocol.rst:630 +#: library/asyncio-protocol.rst:635 msgid "" ":meth:`~BufferedProtocol.get_buffer` can be called an arbitrary number of " "times during a connection. However, :meth:`protocol.eof_received() " @@ -862,7 +869,7 @@ msgid "" "won't be called after it." msgstr "" -#: library/asyncio-protocol.rst:638 +#: library/asyncio-protocol.rst:643 msgid "" "start -> connection_made\n" " [-> get_buffer\n" @@ -872,44 +879,44 @@ msgid "" "-> connection_lost -> end" msgstr "" -#: library/asyncio-protocol.rst:649 +#: library/asyncio-protocol.rst:654 msgid "Datagram Protocols" msgstr "" -#: library/asyncio-protocol.rst:651 +#: library/asyncio-protocol.rst:656 msgid "" "Datagram Protocol instances should be constructed by protocol factories " "passed to the :meth:`loop.create_datagram_endpoint` method." msgstr "" -#: library/asyncio-protocol.rst:656 +#: library/asyncio-protocol.rst:661 msgid "" "Called when a datagram is received. *data* is a bytes object containing the " "incoming data. *addr* is the address of the peer sending the data; the " "exact format depends on the transport." msgstr "" -#: library/asyncio-protocol.rst:662 +#: library/asyncio-protocol.rst:667 msgid "" "Called when a previous send or receive operation raises an :class:" "`OSError`. *exc* is the :class:`OSError` instance." msgstr "" -#: library/asyncio-protocol.rst:665 +#: library/asyncio-protocol.rst:670 msgid "" "This method is called in rare conditions, when the transport (e.g. UDP) " "detects that a datagram could not be delivered to its recipient. In many " "conditions though, undeliverable datagrams will be silently dropped." msgstr "" -#: library/asyncio-protocol.rst:672 +#: library/asyncio-protocol.rst:677 msgid "" "On BSD systems (macOS, FreeBSD, etc.) flow control is not supported for " "datagram protocols, because there is no reliable way to detect send failures " "caused by writing too many packets." msgstr "" -#: library/asyncio-protocol.rst:676 +#: library/asyncio-protocol.rst:681 msgid "" "The socket always appears 'ready' and excess packets are dropped. An :class:" "`OSError` with ``errno`` set to :const:`errno.ENOBUFS` may or may not be " @@ -917,64 +924,64 @@ msgid "" "error_received` but otherwise ignored." msgstr "" -#: library/asyncio-protocol.rst:685 +#: library/asyncio-protocol.rst:690 msgid "Subprocess Protocols" msgstr "" -#: library/asyncio-protocol.rst:687 +#: library/asyncio-protocol.rst:692 msgid "" "Subprocess Protocol instances should be constructed by protocol factories " "passed to the :meth:`loop.subprocess_exec` and :meth:`loop.subprocess_shell` " "methods." msgstr "" -#: library/asyncio-protocol.rst:693 +#: library/asyncio-protocol.rst:698 msgid "" "Called when the child process writes data into its stdout or stderr pipe." msgstr "" -#: library/asyncio-protocol.rst:696 +#: library/asyncio-protocol.rst:701 msgid "*fd* is the integer file descriptor of the pipe." msgstr "" -#: library/asyncio-protocol.rst:698 +#: library/asyncio-protocol.rst:703 msgid "*data* is a non-empty bytes object containing the received data." msgstr "" -#: library/asyncio-protocol.rst:702 +#: library/asyncio-protocol.rst:707 msgid "" "Called when one of the pipes communicating with the child process is closed." msgstr "" -#: library/asyncio-protocol.rst:705 +#: library/asyncio-protocol.rst:710 msgid "*fd* is the integer file descriptor that was closed." msgstr "" -#: library/asyncio-protocol.rst:709 +#: library/asyncio-protocol.rst:714 msgid "Called when the child process has exited." msgstr "" -#: library/asyncio-protocol.rst:711 +#: library/asyncio-protocol.rst:716 msgid "" "It can be called before :meth:`~SubprocessProtocol.pipe_data_received` and :" "meth:`~SubprocessProtocol.pipe_connection_lost` methods." msgstr "" -#: library/asyncio-protocol.rst:716 +#: library/asyncio-protocol.rst:721 msgid "Examples" msgstr "" -#: library/asyncio-protocol.rst:721 +#: library/asyncio-protocol.rst:726 msgid "TCP Echo Server" msgstr "" -#: library/asyncio-protocol.rst:723 +#: library/asyncio-protocol.rst:728 msgid "" "Create a TCP echo server using the :meth:`loop.create_server` method, send " "back received data, and close the connection::" msgstr "" -#: library/asyncio-protocol.rst:726 +#: library/asyncio-protocol.rst:731 msgid "" "import asyncio\n" "\n" @@ -1002,7 +1009,7 @@ msgid "" " loop = asyncio.get_running_loop()\n" "\n" " server = await loop.create_server(\n" -" lambda: EchoServerProtocol(),\n" +" EchoServerProtocol,\n" " '127.0.0.1', 8888)\n" "\n" " async with server:\n" @@ -1012,23 +1019,23 @@ msgid "" "asyncio.run(main())" msgstr "" -#: library/asyncio-protocol.rst:764 +#: library/asyncio-protocol.rst:769 msgid "" "The :ref:`TCP echo server using streams ` " "example uses the high-level :func:`asyncio.start_server` function." msgstr "" -#: library/asyncio-protocol.rst:770 +#: library/asyncio-protocol.rst:775 msgid "TCP Echo Client" msgstr "" -#: library/asyncio-protocol.rst:772 +#: library/asyncio-protocol.rst:777 msgid "" "A TCP echo client using the :meth:`loop.create_connection` method, sends " "data, and waits until the connection is closed::" msgstr "" -#: library/asyncio-protocol.rst:775 +#: library/asyncio-protocol.rst:780 msgid "" "import asyncio\n" "\n" @@ -1073,23 +1080,23 @@ msgid "" "asyncio.run(main())" msgstr "" -#: library/asyncio-protocol.rst:820 +#: library/asyncio-protocol.rst:825 msgid "" "The :ref:`TCP echo client using streams ` " "example uses the high-level :func:`asyncio.open_connection` function." msgstr "" -#: library/asyncio-protocol.rst:827 +#: library/asyncio-protocol.rst:832 msgid "UDP Echo Server" msgstr "" -#: library/asyncio-protocol.rst:829 +#: library/asyncio-protocol.rst:834 msgid "" "A UDP echo server, using the :meth:`loop.create_datagram_endpoint` method, " "sends back received data::" msgstr "" -#: library/asyncio-protocol.rst:832 +#: library/asyncio-protocol.rst:837 msgid "" "import asyncio\n" "\n" @@ -1115,7 +1122,7 @@ msgid "" " # One protocol instance will be created to serve all\n" " # client requests.\n" " transport, protocol = await loop.create_datagram_endpoint(\n" -" lambda: EchoServerProtocol(),\n" +" EchoServerProtocol,\n" " local_addr=('127.0.0.1', 9999))\n" "\n" " try:\n" @@ -1127,17 +1134,17 @@ msgid "" "asyncio.run(main())" msgstr "" -#: library/asyncio-protocol.rst:871 +#: library/asyncio-protocol.rst:876 msgid "UDP Echo Client" msgstr "" -#: library/asyncio-protocol.rst:873 +#: library/asyncio-protocol.rst:878 msgid "" "A UDP echo client, using the :meth:`loop.create_datagram_endpoint` method, " "sends data and closes the transport when it receives the answer::" msgstr "" -#: library/asyncio-protocol.rst:876 +#: library/asyncio-protocol.rst:881 msgid "" "import asyncio\n" "\n" @@ -1188,17 +1195,17 @@ msgid "" "asyncio.run(main())" msgstr "" -#: library/asyncio-protocol.rst:928 +#: library/asyncio-protocol.rst:933 msgid "Connecting Existing Sockets" msgstr "" -#: library/asyncio-protocol.rst:930 +#: library/asyncio-protocol.rst:935 msgid "" "Wait until a socket receives data using the :meth:`loop.create_connection` " "method with a protocol::" msgstr "" -#: library/asyncio-protocol.rst:933 +#: library/asyncio-protocol.rst:938 msgid "" "import asyncio\n" "import socket\n" @@ -1250,35 +1257,35 @@ msgid "" "asyncio.run(main())" msgstr "" -#: library/asyncio-protocol.rst:984 +#: library/asyncio-protocol.rst:989 msgid "" "The :ref:`watch a file descriptor for read events " "` example uses the low-level :meth:`loop." "add_reader` method to register an FD." msgstr "" -#: library/asyncio-protocol.rst:988 +#: library/asyncio-protocol.rst:993 msgid "" "The :ref:`register an open socket to wait for data using streams " "` example uses high-level streams " "created by the :func:`open_connection` function in a coroutine." msgstr "" -#: library/asyncio-protocol.rst:995 +#: library/asyncio-protocol.rst:1000 msgid "loop.subprocess_exec() and SubprocessProtocol" msgstr "" -#: library/asyncio-protocol.rst:997 +#: library/asyncio-protocol.rst:1002 msgid "" "An example of a subprocess protocol used to get the output of a subprocess " "and to wait for the subprocess exit." msgstr "" -#: library/asyncio-protocol.rst:1000 +#: library/asyncio-protocol.rst:1005 msgid "The subprocess is created by the :meth:`loop.subprocess_exec` method::" msgstr "" -#: library/asyncio-protocol.rst:1002 +#: library/asyncio-protocol.rst:1007 msgid "" "import asyncio\n" "import sys\n" @@ -1339,7 +1346,7 @@ msgid "" "print(f\"Current date: {date}\")" msgstr "" -#: library/asyncio-protocol.rst:1060 +#: library/asyncio-protocol.rst:1065 msgid "" "See also the :ref:`same example ` " "written using high-level APIs." diff --git a/library/asyncio-queue.po b/library/asyncio-queue.po index 38fd9351..bf0fa81e 100644 --- a/library/asyncio-queue.po +++ b/library/asyncio-queue.po @@ -8,8 +8,8 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" -"PO-Revision-Date: 2025-01-22 13:33+0200\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" +"PO-Revision-Date: 2025-05-05 22:16+0300\n" "Last-Translator: Marios Giannopoulos \n" "Language-Team: PyGreece \n" "Language: \n" @@ -113,20 +113,28 @@ msgstr "" "Αφαίρεση και επιστροφή ενός αντικειμένου από την ουρά. Αν η ουρά είναι κενή, " "περιμένετε μέχρι να είναι διαθέσιμο ένα αντικείμενο." -#: library/asyncio-queue.rst:68 +#: library/asyncio-queue.rst:66 +msgid "" +"Raises :exc:`QueueShutDown` if the queue has been shut down and is empty, or " +"if the queue has been shut down immediately." +msgstr "" +"Κάνει raise μια :exc:`QueueShutDown` αν η ουρά έχει τερματιστεί και είναι " +"κενή, ή αν η ουρά έχει τερματιστεί άμεσα." + +#: library/asyncio-queue.rst:71 msgid "" "Return an item if one is immediately available, else raise :exc:`QueueEmpty`." msgstr "" "Επιστρέφει ένα αντικείμενο, αν είναι άμεσα διαθέσιμο, αλλιώς κάνε raise την :" "exc:`QueueEmpty`." -#: library/asyncio-queue.rst:74 +#: library/asyncio-queue.rst:77 msgid "Block until all items in the queue have been received and processed." msgstr "" "Αποκλείει μέχρι να ληφθούν και να υποβληθούν σε επεξεργασία όλα τα στοιχεία " "στην ουρά." -#: library/asyncio-queue.rst:76 +#: library/asyncio-queue.rst:79 msgid "" "The count of unfinished tasks goes up whenever an item is added to the " "queue. The count goes down whenever a consumer coroutine calls :meth:" @@ -140,7 +148,7 @@ msgstr "" "λήφθηκε και η εργασία πάνω του έχει ολοκληρωθεί. Όταν ο αριθμός των " "ατελείωτων εργασιών μειωθεί στο μηδέν, η μέθοδος :meth:`join` αποδεσμεύεται." -#: library/asyncio-queue.rst:85 +#: library/asyncio-queue.rst:88 msgid "" "Put an item into the queue. If the queue is full, wait until a free slot is " "available before adding the item." @@ -148,26 +156,61 @@ msgstr "" "Τοποθετεί ένα αντικείμενο στην ουρά. Αν η ουρά είναι γεμάτη, περιμένετε " "μέχρι να είναι διαθέσιμη μια ελεύθερη θέση, πριν προσθέσετε το αντικείμενο." -#: library/asyncio-queue.rst:90 +#: library/asyncio-queue.rst:91 +msgid "Raises :exc:`QueueShutDown` if the queue has been shut down." +msgstr "Κάνει raise μια :exc:`QueueShutDown` αν η ουρά έχει τερματιστεί." + +#: library/asyncio-queue.rst:95 msgid "Put an item into the queue without blocking." msgstr "Τοποθετεί ένα αντικείμενο στην ουρά χωρίς να μπλοκάρει." -#: library/asyncio-queue.rst:92 +#: library/asyncio-queue.rst:97 msgid "If no free slot is immediately available, raise :exc:`QueueFull`." msgstr "" "Αν δεν είναι διαθέσιμη μια ελεύθερη θέση αμέσως, γίνεται raise η :exc:" "`QueueFull`." -#: library/asyncio-queue.rst:96 +#: library/asyncio-queue.rst:101 msgid "Return the number of items in the queue." msgstr "Επιστρέφει τον αριθμό των αντικειμένων στην ουρά." -#: library/asyncio-queue.rst:100 +#: library/asyncio-queue.rst:105 +msgid "" +"Shut down the queue, making :meth:`~Queue.get` and :meth:`~Queue.put` raise :" +"exc:`QueueShutDown`." +msgstr "" +"Τερματίζει την ουρά, προκαλώντας την :meth:`~Queue.get` και :meth:`~Queue." +"put` κάνει raise την :exc:`QueueShutDown`." + +#: library/asyncio-queue.rst:108 +msgid "" +"By default, :meth:`~Queue.get` on a shut down queue will only raise once the " +"queue is empty. Set *immediate* to true to make :meth:`~Queue.get` raise " +"immediately instead." +msgstr "" +"Από προεπιλογή, η :meth:`~Queue.get` σε μια τερματισμένη ουρά θα κάνει raise " +"εξαίρεση μόνο όταν η ουρά είναι κενή. Ορίστε το *immediate* σε true για να " +"κάνετε την :meth:`~Queue.get` να εξάγει την εξαίρεση αμέσως αντί για " +"αργότερα." + +#: library/asyncio-queue.rst:112 +msgid "" +"All blocked callers of :meth:`~Queue.put` and :meth:`~Queue.get` will be " +"unblocked. If *immediate* is true, a task will be marked as done for each " +"remaining item in the queue, which may unblock callers of :meth:`~Queue." +"join`." +msgstr "" +"Όλοι οι αποκλεισμένοι καλούντες των :meth:`~Queue.put` και :meth:`~Queue." +"get` θα αποδεσμευτούν. Αν το *immediate* είναι αληθές, μια εργασία θα " +"χαρακτηριστεί ως ολοκληρωμένη για κάθε εναπομείναν αντικείμενο στην ουρά, το " +"οποίο μπορεί να αποδεσμευτεί στους καλούντες της :meth:`~Queue.join`." + +#: library/asyncio-queue.rst:121 msgid "Indicate that a formerly enqueued work item is complete." msgstr "" "Υποδεικνύει ότι μια εργασία που είχε προστεθεί στην ουρά έχει ολοκληρωθεί." -#: library/asyncio-queue.rst:102 +#: library/asyncio-queue.rst:123 msgid "" "Used by queue consumers. For each :meth:`~Queue.get` used to fetch a work " "item, a subsequent call to :meth:`task_done` tells the queue that the " @@ -178,7 +221,7 @@ msgstr "" "`task_done` ενημερώνει την ουρά ότι η επεξεργασία της εργασίας έχει " "ολοκληρωθεί." -#: library/asyncio-queue.rst:106 +#: library/asyncio-queue.rst:127 msgid "" "If a :meth:`join` is currently blocking, it will resume when all items have " "been processed (meaning that a :meth:`task_done` call was received for every " @@ -189,7 +232,15 @@ msgstr "" "meth:`task_done` για κάθε αντικείμενο που είχε προστεθεί με :meth:`~Queue." "put` στην ουρά)." -#: library/asyncio-queue.rst:111 +#: library/asyncio-queue.rst:132 +msgid "" +"``shutdown(immediate=True)`` calls :meth:`task_done` for each remaining item " +"in the queue." +msgstr "" +"Το ``shutdown(immediate=True)`` καλεί τη :meth:`task_done` για κάθε υπόλοιπο " +"στοιχείο στην ουρά." + +#: library/asyncio-queue.rst:135 msgid "" "Raises :exc:`ValueError` if called more times than there were items placed " "in the queue." @@ -197,11 +248,11 @@ msgstr "" "Κάνει raise την :exc:`ValueError` εάν κληθεί περισσότερες φορές από όσες τα " "αντικείμενα που είχαν τοποθετηθεί στην ουρά." -#: library/asyncio-queue.rst:116 +#: library/asyncio-queue.rst:140 msgid "Priority Queue" msgstr "Σειρά Προτεραιότητας" -#: library/asyncio-queue.rst:120 +#: library/asyncio-queue.rst:144 msgid "" "A variant of :class:`Queue`; retrieves entries in priority order (lowest " "first)." @@ -209,15 +260,15 @@ msgstr "" "Μια παραλλαγή της :class:`Queue`; η οποία ανακτά τις καταχωρήσεις με σειρά " "προτεραιότητας (οι χαμηλότερες πρώτες)." -#: library/asyncio-queue.rst:123 +#: library/asyncio-queue.rst:147 msgid "Entries are typically tuples of the form ``(priority_number, data)``." msgstr "Οι καταχωρήσεις είναι συνήθως της μορφής ``(priority_number, data)``." -#: library/asyncio-queue.rst:128 +#: library/asyncio-queue.rst:152 msgid "LIFO Queue" msgstr "Ουρά LIFO" -#: library/asyncio-queue.rst:132 +#: library/asyncio-queue.rst:156 msgid "" "A variant of :class:`Queue` that retrieves most recently added entries first " "(last in, first out)." @@ -225,11 +276,11 @@ msgstr "" "Μια παραλλαγή της κλάσης :class:`Queue` που ανακτά τις πιο πρόσφατα " "προστιθέμενες καταχωρίσεις πρώτες (με τη λογική τελευταίος μέσα, πρώτος έξω)." -#: library/asyncio-queue.rst:137 +#: library/asyncio-queue.rst:161 msgid "Exceptions" msgstr "Εξαιρέσεις" -#: library/asyncio-queue.rst:141 +#: library/asyncio-queue.rst:165 msgid "" "This exception is raised when the :meth:`~Queue.get_nowait` method is called " "on an empty queue." @@ -237,7 +288,7 @@ msgstr "" "Αυτή η εξαίρεση γίνεται raise όταν η μέθοδος :meth:`~Queue.get_nowait` " "καλείται σε μια άδεια ουρά." -#: library/asyncio-queue.rst:147 +#: library/asyncio-queue.rst:171 msgid "" "Exception raised when the :meth:`~Queue.put_nowait` method is called on a " "queue that has reached its *maxsize*." @@ -245,18 +296,26 @@ msgstr "" "Εξαίρεση που γίνεται raise όταν η μέθοδος :meth:`~Queue.put_nowait` καλείται " "σε μια ουρά που έχει φτάσει στο *maxsize* της." -#: library/asyncio-queue.rst:152 +#: library/asyncio-queue.rst:177 +msgid "" +"Exception raised when :meth:`~Queue.put` or :meth:`~Queue.get` is called on " +"a queue which has been shut down." +msgstr "" +"Εξαίρεση που γίνεται raise όταν η μέθοδος :meth:`~Queue.put` ή :meth:`~Queue." +"get` καλείται σε μια ουρά που έχει τερματιστεί." + +#: library/asyncio-queue.rst:184 msgid "Examples" msgstr "Παραδείγματα" -#: library/asyncio-queue.rst:156 +#: library/asyncio-queue.rst:188 msgid "" "Queues can be used to distribute workload between several concurrent tasks::" msgstr "" "Οι ουρές μπορούν να χρησιμοποιηθούν για τη διανομή εργασίας μεταξύ αρκετών " "παράλληλων εργασιών::" -#: library/asyncio-queue.rst:159 +#: library/asyncio-queue.rst:191 msgid "" "import asyncio\n" "import random\n" diff --git a/library/asyncio-runner.po b/library/asyncio-runner.po index 5fd9bb78..9251be58 100644 --- a/library/asyncio-runner.po +++ b/library/asyncio-runner.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -50,13 +50,13 @@ msgid "" "event loop, *finalizing asynchronous generators*, and closing the executor." msgstr "" -#: library/asyncio-runner.rst:113 +#: library/asyncio-runner.rst:115 msgid "" "This function cannot be called when another asyncio event loop is running in " "the same thread." msgstr "" -#: library/asyncio-runner.rst:83 +#: library/asyncio-runner.rst:85 msgid "" "If *debug* is ``True``, the event loop will be run in debug mode. ``False`` " "disables debug mode explicitly. ``None`` is used to respect the global :ref:" @@ -69,21 +69,22 @@ msgid "" "otherwise :func:`asyncio.new_event_loop` is used. The loop is closed at the " "end. This function should be used as a main entry point for asyncio " "programs, and should ideally only be called once. It is recommended to use " -"*loop_factory* to configure the event loop instead of policies." +"*loop_factory* to configure the event loop instead of policies. Passing :" +"class:`asyncio.EventLoop` allows running asyncio without the policy system." msgstr "" -#: library/asyncio-runner.rst:46 +#: library/asyncio-runner.rst:48 msgid "" "The executor is given a timeout duration of 5 minutes to shutdown. If the " "executor hasn't finished within that duration, a warning is emitted and the " "executor is closed." msgstr "" -#: library/asyncio-runner.rst:50 +#: library/asyncio-runner.rst:52 msgid "Example::" msgstr "" -#: library/asyncio-runner.rst:52 +#: library/asyncio-runner.rst:54 msgid "" "async def main():\n" " await asyncio.sleep(1)\n" @@ -92,36 +93,36 @@ msgid "" "asyncio.run(main())" msgstr "" -#: library/asyncio-runner.rst:60 +#: library/asyncio-runner.rst:62 msgid "Updated to use :meth:`loop.shutdown_default_executor`." msgstr "" -#: library/asyncio-runner.rst:65 +#: library/asyncio-runner.rst:67 msgid "" "*debug* is ``None`` by default to respect the global debug mode settings." msgstr "" -#: library/asyncio-runner.rst:69 +#: library/asyncio-runner.rst:71 msgid "Added *loop_factory* parameter." msgstr "" -#: library/asyncio-runner.rst:73 +#: library/asyncio-runner.rst:75 msgid "Runner context manager" msgstr "" -#: library/asyncio-runner.rst:77 +#: library/asyncio-runner.rst:79 msgid "" "A context manager that simplifies *multiple* async function calls in the " "same context." msgstr "" -#: library/asyncio-runner.rst:80 +#: library/asyncio-runner.rst:82 msgid "" "Sometimes several top-level async functions should be called in the same :" "ref:`event loop ` and :class:`contextvars.Context`." msgstr "" -#: library/asyncio-runner.rst:87 +#: library/asyncio-runner.rst:89 msgid "" "*loop_factory* could be used for overriding the loop creation. It is the " "responsibility of the *loop_factory* to set the created loop as the current " @@ -129,13 +130,13 @@ msgid "" "event loop with :func:`asyncio.set_event_loop` if *loop_factory* is ``None``." msgstr "" -#: library/asyncio-runner.rst:92 +#: library/asyncio-runner.rst:94 msgid "" "Basically, :func:`asyncio.run` example can be rewritten with the runner " "usage::" msgstr "" -#: library/asyncio-runner.rst:94 +#: library/asyncio-runner.rst:96 msgid "" "async def main():\n" " await asyncio.sleep(1)\n" @@ -145,52 +146,52 @@ msgid "" " runner.run(main())" msgstr "" -#: library/asyncio-runner.rst:105 +#: library/asyncio-runner.rst:107 msgid "Run a :term:`coroutine ` *coro* in the embedded loop." msgstr "" -#: library/asyncio-runner.rst:107 +#: library/asyncio-runner.rst:109 msgid "Return the coroutine's result or raise its exception." msgstr "" -#: library/asyncio-runner.rst:109 +#: library/asyncio-runner.rst:111 msgid "" "An optional keyword-only *context* argument allows specifying a custom :" "class:`contextvars.Context` for the *coro* to run in. The runner's default " "context is used if ``None``." msgstr "" -#: library/asyncio-runner.rst:118 +#: library/asyncio-runner.rst:120 msgid "Close the runner." msgstr "" -#: library/asyncio-runner.rst:120 +#: library/asyncio-runner.rst:122 msgid "" "Finalize asynchronous generators, shutdown default executor, close the event " "loop and release embedded :class:`contextvars.Context`." msgstr "" -#: library/asyncio-runner.rst:125 +#: library/asyncio-runner.rst:127 msgid "Return the event loop associated with the runner instance." msgstr "" -#: library/asyncio-runner.rst:129 +#: library/asyncio-runner.rst:131 msgid "" ":class:`Runner` uses the lazy initialization strategy, its constructor " "doesn't initialize underlying low-level structures." msgstr "" -#: library/asyncio-runner.rst:132 +#: library/asyncio-runner.rst:134 msgid "" "Embedded *loop* and *context* are created at the :keyword:`with` body " "entering or the first call of :meth:`run` or :meth:`get_loop`." msgstr "" -#: library/asyncio-runner.rst:137 +#: library/asyncio-runner.rst:139 msgid "Handling Keyboard Interruption" msgstr "" -#: library/asyncio-runner.rst:141 +#: library/asyncio-runner.rst:143 msgid "" "When :const:`signal.SIGINT` is raised by :kbd:`Ctrl-C`, :exc:" "`KeyboardInterrupt` exception is raised in the main thread by default. " @@ -198,26 +199,26 @@ msgid "" "asyncio internals and can hang the program from exiting." msgstr "" -#: library/asyncio-runner.rst:146 +#: library/asyncio-runner.rst:148 msgid "" "To mitigate this issue, :mod:`asyncio` handles :const:`signal.SIGINT` as " "follows:" msgstr "" -#: library/asyncio-runner.rst:148 +#: library/asyncio-runner.rst:150 msgid "" ":meth:`asyncio.Runner.run` installs a custom :const:`signal.SIGINT` handler " "before any user code is executed and removes it when exiting from the " "function." msgstr "" -#: library/asyncio-runner.rst:150 +#: library/asyncio-runner.rst:152 msgid "" "The :class:`~asyncio.Runner` creates the main task for the passed coroutine " "for its execution." msgstr "" -#: library/asyncio-runner.rst:152 +#: library/asyncio-runner.rst:154 msgid "" "When :const:`signal.SIGINT` is raised by :kbd:`Ctrl-C`, the custom signal " "handler cancels the main task by calling :meth:`asyncio.Task.cancel` which " @@ -227,7 +228,7 @@ msgid "" "Runner.run` raises :exc:`KeyboardInterrupt`." msgstr "" -#: library/asyncio-runner.rst:158 +#: library/asyncio-runner.rst:160 msgid "" "A user could write a tight loop which cannot be interrupted by :meth:" "`asyncio.Task.cancel`, in which case the second following :kbd:`Ctrl-C` " diff --git a/library/asyncio-stream.po b/library/asyncio-stream.po index f20465a4..72b2822c 100644 --- a/library/asyncio-stream.po +++ b/library/asyncio-stream.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -36,7 +36,7 @@ msgstr "" msgid "Here is an example of a TCP echo client written using asyncio streams::" msgstr "" -#: library/asyncio-stream.rst:415 +#: library/asyncio-stream.rst:430 msgid "" "import asyncio\n" "\n" @@ -84,7 +84,7 @@ msgid "" "`StreamReader` and :class:`StreamWriter` classes." msgstr "" -#: library/asyncio-stream.rst:111 +#: library/asyncio-stream.rst:112 msgid "" "*limit* determines the buffer size limit used by the returned :class:" "`StreamReader` instance. By default the *limit* is set to 64 KiB." @@ -96,7 +96,7 @@ msgid "" "create_connection`." msgstr "" -#: library/asyncio-stream.rst:150 +#: library/asyncio-stream.rst:154 msgid "" "The *sock* argument transfers ownership of the socket to the :class:" "`StreamWriter` created. To close the socket, call its :meth:`~asyncio." @@ -111,20 +111,20 @@ msgstr "" msgid "Added the *happy_eyeballs_delay* and *interleave* parameters." msgstr "" -#: library/asyncio-stream.rst:127 library/asyncio-stream.rst:191 +#: library/asyncio-stream.rst:128 library/asyncio-stream.rst:195 msgid "Removed the *loop* parameter." msgstr "" -#: library/asyncio-stream.rst:130 library/asyncio-stream.rst:194 -#: library/asyncio-stream.rst:382 +#: library/asyncio-stream.rst:131 library/asyncio-stream.rst:198 +#: library/asyncio-stream.rst:397 msgid "Added the *ssl_shutdown_timeout* parameter." msgstr "" -#: library/asyncio-stream.rst:100 +#: library/asyncio-stream.rst:101 msgid "Start a socket server." msgstr "" -#: library/asyncio-stream.rst:102 +#: library/asyncio-stream.rst:103 msgid "" "The *client_connected_cb* callback is called whenever a new client " "connection is established. It receives a ``(reader, writer)`` pair as two " @@ -132,162 +132,166 @@ msgid "" "classes." msgstr "" -#: library/asyncio-stream.rst:107 +#: library/asyncio-stream.rst:108 msgid "" "*client_connected_cb* can be a plain callable or a :ref:`coroutine function " "`; if it is a coroutine function, it will be automatically " "scheduled as a :class:`Task`." msgstr "" -#: library/asyncio-stream.rst:115 +#: library/asyncio-stream.rst:116 msgid "" "The rest of the arguments are passed directly to :meth:`loop.create_server`." msgstr "" -#: library/asyncio-stream.rst:181 +#: library/asyncio-stream.rst:185 msgid "" "The *sock* argument transfers ownership of the socket to the server created. " "To close the socket, call the server's :meth:`~asyncio.Server.close` method." msgstr "" -#: library/asyncio-stream.rst:124 +#: library/asyncio-stream.rst:125 msgid "Added the *ssl_handshake_timeout* and *start_serving* parameters." msgstr "" -#: library/asyncio-stream.rst:135 +#: library/asyncio-stream.rst:134 +msgid "Added the *keep_alive* parameter." +msgstr "" + +#: library/asyncio-stream.rst:139 msgid "Unix Sockets" msgstr "" -#: library/asyncio-stream.rst:141 +#: library/asyncio-stream.rst:145 msgid "" "Establish a Unix socket connection and return a pair of ``(reader, writer)``." msgstr "" -#: library/asyncio-stream.rst:144 +#: library/asyncio-stream.rst:148 msgid "Similar to :func:`open_connection` but operates on Unix sockets." msgstr "" -#: library/asyncio-stream.rst:146 +#: library/asyncio-stream.rst:150 msgid "See also the documentation of :meth:`loop.create_unix_connection`." msgstr "" -#: library/asyncio-stream.rst:185 +#: library/asyncio-stream.rst:189 msgid "Availability" msgstr "" -#: library/asyncio-stream.rst:156 +#: library/asyncio-stream.rst:160 msgid "" "Added the *ssl_handshake_timeout* parameter. The *path* parameter can now be " "a :term:`path-like object`" msgstr "" -#: library/asyncio-stream.rst:173 +#: library/asyncio-stream.rst:177 msgid "Start a Unix socket server." msgstr "" -#: library/asyncio-stream.rst:175 +#: library/asyncio-stream.rst:179 msgid "Similar to :func:`start_server` but works with Unix sockets." msgstr "" -#: library/asyncio-stream.rst:177 +#: library/asyncio-stream.rst:181 msgid "See also the documentation of :meth:`loop.create_unix_server`." msgstr "" -#: library/asyncio-stream.rst:187 +#: library/asyncio-stream.rst:191 msgid "" "Added the *ssl_handshake_timeout* and *start_serving* parameters. The *path* " "parameter can now be a :term:`path-like object`." msgstr "" -#: library/asyncio-stream.rst:199 +#: library/asyncio-stream.rst:203 msgid "StreamReader" msgstr "" -#: library/asyncio-stream.rst:203 +#: library/asyncio-stream.rst:207 msgid "" "Represents a reader object that provides APIs to read data from the IO " "stream. As an :term:`asynchronous iterable`, the object supports the :" "keyword:`async for` statement." msgstr "" -#: library/asyncio-stream.rst:207 +#: library/asyncio-stream.rst:211 msgid "" "It is not recommended to instantiate *StreamReader* objects directly; use :" "func:`open_connection` and :func:`start_server` instead." msgstr "" -#: library/asyncio-stream.rst:213 +#: library/asyncio-stream.rst:217 msgid "Acknowledge the EOF." msgstr "" -#: library/asyncio-stream.rst:218 +#: library/asyncio-stream.rst:222 msgid "Read up to *n* bytes from the stream." msgstr "" -#: library/asyncio-stream.rst:220 +#: library/asyncio-stream.rst:224 msgid "" "If *n* is not provided or set to ``-1``, read until EOF, then return all " "read :class:`bytes`. If EOF was received and the internal buffer is empty, " "return an empty ``bytes`` object." msgstr "" -#: library/asyncio-stream.rst:225 +#: library/asyncio-stream.rst:229 msgid "If *n* is ``0``, return an empty ``bytes`` object immediately." msgstr "" -#: library/asyncio-stream.rst:227 +#: library/asyncio-stream.rst:231 msgid "" "If *n* is positive, return at most *n* available ``bytes`` as soon as at " "least 1 byte is available in the internal buffer. If EOF is received before " "any byte is read, return an empty ``bytes`` object." msgstr "" -#: library/asyncio-stream.rst:235 +#: library/asyncio-stream.rst:239 msgid "" "Read one line, where \"line\" is a sequence of bytes ending with ``\\n``." msgstr "" -#: library/asyncio-stream.rst:238 +#: library/asyncio-stream.rst:242 msgid "" "If EOF is received and ``\\n`` was not found, the method returns partially " "read data." msgstr "" -#: library/asyncio-stream.rst:241 +#: library/asyncio-stream.rst:245 msgid "" "If EOF is received and the internal buffer is empty, return an empty " "``bytes`` object." msgstr "" -#: library/asyncio-stream.rst:247 +#: library/asyncio-stream.rst:251 msgid "Read exactly *n* bytes." msgstr "" -#: library/asyncio-stream.rst:249 +#: library/asyncio-stream.rst:253 msgid "" "Raise an :exc:`IncompleteReadError` if EOF is reached before *n* can be " "read. Use the :attr:`IncompleteReadError.partial` attribute to get the " "partially read data." msgstr "" -#: library/asyncio-stream.rst:256 +#: library/asyncio-stream.rst:260 msgid "Read data from the stream until *separator* is found." msgstr "" -#: library/asyncio-stream.rst:258 +#: library/asyncio-stream.rst:262 msgid "" "On success, the data and separator will be removed from the internal buffer " "(consumed). Returned data will include the separator at the end." msgstr "" -#: library/asyncio-stream.rst:262 +#: library/asyncio-stream.rst:266 msgid "" "If the amount of data read exceeds the configured stream limit, a :exc:" "`LimitOverrunError` exception is raised, and the data is left in the " "internal buffer and can be read again." msgstr "" -#: library/asyncio-stream.rst:266 +#: library/asyncio-stream.rst:270 msgid "" "If EOF is reached before the complete separator is found, an :exc:" "`IncompleteReadError` exception is raised, and the internal buffer is " @@ -296,102 +300,114 @@ msgid "" msgstr "" #: library/asyncio-stream.rst:275 +msgid "" +"The *separator* may also be a tuple of separators. In this case the return " +"value will be the shortest possible that has any separator as the suffix. " +"For the purposes of :exc:`LimitOverrunError`, the shortest possible " +"separator is considered to be the one that matched." +msgstr "" + +#: library/asyncio-stream.rst:285 +msgid "The *separator* parameter may now be a :class:`tuple` of separators." +msgstr "" + +#: library/asyncio-stream.rst:290 msgid "Return ``True`` if the buffer is empty and :meth:`feed_eof` was called." msgstr "" -#: library/asyncio-stream.rst:280 +#: library/asyncio-stream.rst:295 msgid "StreamWriter" msgstr "" -#: library/asyncio-stream.rst:284 +#: library/asyncio-stream.rst:299 msgid "" "Represents a writer object that provides APIs to write data to the IO stream." msgstr "" -#: library/asyncio-stream.rst:287 +#: library/asyncio-stream.rst:302 msgid "" "It is not recommended to instantiate *StreamWriter* objects directly; use :" "func:`open_connection` and :func:`start_server` instead." msgstr "" -#: library/asyncio-stream.rst:293 +#: library/asyncio-stream.rst:308 msgid "" "The method attempts to write the *data* to the underlying socket " "immediately. If that fails, the data is queued in an internal write buffer " "until it can be sent." msgstr "" -#: library/asyncio-stream.rst:309 +#: library/asyncio-stream.rst:324 msgid "The method should be used along with the ``drain()`` method::" msgstr "" -#: library/asyncio-stream.rst:299 +#: library/asyncio-stream.rst:314 msgid "" "stream.write(data)\n" "await stream.drain()" msgstr "" -#: library/asyncio-stream.rst:304 +#: library/asyncio-stream.rst:319 msgid "" "The method writes a list (or any iterable) of bytes to the underlying socket " "immediately. If that fails, the data is queued in an internal write buffer " "until it can be sent." msgstr "" -#: library/asyncio-stream.rst:311 +#: library/asyncio-stream.rst:326 msgid "" "stream.writelines(lines)\n" "await stream.drain()" msgstr "" -#: library/asyncio-stream.rst:316 +#: library/asyncio-stream.rst:331 msgid "The method closes the stream and the underlying socket." msgstr "" -#: library/asyncio-stream.rst:318 +#: library/asyncio-stream.rst:333 msgid "" "The method should be used, though not mandatory, along with the " "``wait_closed()`` method::" msgstr "" -#: library/asyncio-stream.rst:321 +#: library/asyncio-stream.rst:336 msgid "" "stream.close()\n" "await stream.wait_closed()" msgstr "" -#: library/asyncio-stream.rst:326 +#: library/asyncio-stream.rst:341 msgid "" "Return ``True`` if the underlying transport supports the :meth:`write_eof` " "method, ``False`` otherwise." msgstr "" -#: library/asyncio-stream.rst:331 +#: library/asyncio-stream.rst:346 msgid "" "Close the write end of the stream after the buffered write data is flushed." msgstr "" -#: library/asyncio-stream.rst:336 +#: library/asyncio-stream.rst:351 msgid "Return the underlying asyncio transport." msgstr "" -#: library/asyncio-stream.rst:340 +#: library/asyncio-stream.rst:355 msgid "" "Access optional transport information; see :meth:`BaseTransport." "get_extra_info` for details." msgstr "" -#: library/asyncio-stream.rst:346 +#: library/asyncio-stream.rst:361 msgid "Wait until it is appropriate to resume writing to the stream. Example::" msgstr "" -#: library/asyncio-stream.rst:349 +#: library/asyncio-stream.rst:364 msgid "" "writer.write(data)\n" "await writer.drain()" msgstr "" -#: library/asyncio-stream.rst:352 +#: library/asyncio-stream.rst:367 msgid "" "This is a flow control method that interacts with the underlying IO write " "buffer. When the size of the buffer reaches the high watermark, *drain()* " @@ -400,82 +416,82 @@ msgid "" "`drain` returns immediately." msgstr "" -#: library/asyncio-stream.rst:363 +#: library/asyncio-stream.rst:378 msgid "Upgrade an existing stream-based connection to TLS." msgstr "" -#: library/asyncio-stream.rst:365 +#: library/asyncio-stream.rst:380 msgid "Parameters:" msgstr "" -#: library/asyncio-stream.rst:367 +#: library/asyncio-stream.rst:382 msgid "*sslcontext*: a configured instance of :class:`~ssl.SSLContext`." msgstr "" -#: library/asyncio-stream.rst:369 +#: library/asyncio-stream.rst:384 msgid "" "*server_hostname*: sets or overrides the host name that the target server's " "certificate will be matched against." msgstr "" -#: library/asyncio-stream.rst:372 +#: library/asyncio-stream.rst:387 msgid "" "*ssl_handshake_timeout* is the time in seconds to wait for the TLS handshake " "to complete before aborting the connection. ``60.0`` seconds if ``None`` " "(default)." msgstr "" -#: library/asyncio-stream.rst:376 +#: library/asyncio-stream.rst:391 msgid "" "*ssl_shutdown_timeout* is the time in seconds to wait for the SSL shutdown " "to complete before aborting the connection. ``30.0`` seconds if ``None`` " "(default)." msgstr "" -#: library/asyncio-stream.rst:388 +#: library/asyncio-stream.rst:403 msgid "" "Return ``True`` if the stream is closed or in the process of being closed." msgstr "" -#: library/asyncio-stream.rst:396 +#: library/asyncio-stream.rst:411 msgid "Wait until the stream is closed." msgstr "" -#: library/asyncio-stream.rst:398 +#: library/asyncio-stream.rst:413 msgid "" "Should be called after :meth:`close` to wait until the underlying connection " "is closed, ensuring that all data has been flushed before e.g. exiting the " "program." msgstr "" -#: library/asyncio-stream.rst:406 +#: library/asyncio-stream.rst:421 msgid "Examples" msgstr "" -#: library/asyncio-stream.rst:411 +#: library/asyncio-stream.rst:426 msgid "TCP echo client using streams" msgstr "" -#: library/asyncio-stream.rst:413 +#: library/asyncio-stream.rst:428 msgid "TCP echo client using the :func:`asyncio.open_connection` function::" msgstr "" -#: library/asyncio-stream.rst:437 +#: library/asyncio-stream.rst:452 msgid "" "The :ref:`TCP echo client protocol " "` example uses the low-level :meth:" "`loop.create_connection` method." msgstr "" -#: library/asyncio-stream.rst:444 +#: library/asyncio-stream.rst:459 msgid "TCP echo server using streams" msgstr "" -#: library/asyncio-stream.rst:446 +#: library/asyncio-stream.rst:461 msgid "TCP echo server using the :func:`asyncio.start_server` function::" msgstr "" -#: library/asyncio-stream.rst:448 +#: library/asyncio-stream.rst:463 msgid "" "import asyncio\n" "\n" @@ -507,23 +523,23 @@ msgid "" "asyncio.run(main())" msgstr "" -#: library/asyncio-stream.rst:480 +#: library/asyncio-stream.rst:495 msgid "" "The :ref:`TCP echo server protocol " "` example uses the :meth:`loop." "create_server` method." msgstr "" -#: library/asyncio-stream.rst:485 +#: library/asyncio-stream.rst:500 msgid "Get HTTP headers" msgstr "" -#: library/asyncio-stream.rst:487 +#: library/asyncio-stream.rst:502 msgid "" "Simple example querying HTTP headers of the URL passed on the command line::" msgstr "" -#: library/asyncio-stream.rst:489 +#: library/asyncio-stream.rst:504 msgid "" "import asyncio\n" "import urllib.parse\n" @@ -562,33 +578,33 @@ msgid "" "asyncio.run(print_http_headers(url))" msgstr "" -#: library/asyncio-stream.rst:526 +#: library/asyncio-stream.rst:541 msgid "Usage::" msgstr "" -#: library/asyncio-stream.rst:528 +#: library/asyncio-stream.rst:543 msgid "python example.py http://example.com/path/page.html" msgstr "" -#: library/asyncio-stream.rst:530 +#: library/asyncio-stream.rst:545 msgid "or with HTTPS::" msgstr "" -#: library/asyncio-stream.rst:532 +#: library/asyncio-stream.rst:547 msgid "python example.py https://example.com/path/page.html" msgstr "" -#: library/asyncio-stream.rst:538 +#: library/asyncio-stream.rst:553 msgid "Register an open socket to wait for data using streams" msgstr "" -#: library/asyncio-stream.rst:540 +#: library/asyncio-stream.rst:555 msgid "" "Coroutine waiting until a socket receives data using the :func:" "`open_connection` function::" msgstr "" -#: library/asyncio-stream.rst:543 +#: library/asyncio-stream.rst:558 msgid "" "import asyncio\n" "import socket\n" @@ -621,14 +637,14 @@ msgid "" "asyncio.run(wait_for_data())" msgstr "" -#: library/asyncio-stream.rst:575 +#: library/asyncio-stream.rst:590 msgid "" "The :ref:`register an open socket to wait for data using a protocol " "` example uses a low-level protocol and " "the :meth:`loop.create_connection` method." msgstr "" -#: library/asyncio-stream.rst:579 +#: library/asyncio-stream.rst:594 msgid "" "The :ref:`watch a file descriptor for read events " "` example uses the low-level :meth:`loop." diff --git a/library/asyncio-subprocess.po b/library/asyncio-subprocess.po index 9a09e8cb..5ebc2692 100644 --- a/library/asyncio-subprocess.po +++ b/library/asyncio-subprocess.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" diff --git a/library/asyncio-sync.po b/library/asyncio-sync.po index daa9e1bd..a13bb384 100644 --- a/library/asyncio-sync.po +++ b/library/asyncio-sync.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -99,7 +99,7 @@ msgid "" " # access shared state" msgstr "" -#: library/asyncio-sync.rst:201 library/asyncio-sync.rst:304 +#: library/asyncio-sync.rst:201 library/asyncio-sync.rst:309 msgid "which is equivalent to::" msgstr "" @@ -115,8 +115,8 @@ msgid "" " lock.release()" msgstr "" -#: library/asyncio-sync.rst:113 library/asyncio-sync.rst:292 -#: library/asyncio-sync.rst:348 +#: library/asyncio-sync.rst:113 library/asyncio-sync.rst:297 +#: library/asyncio-sync.rst:353 msgid "Removed the *loop* parameter." msgstr "" @@ -180,7 +180,7 @@ msgid "" "*true*. The flag is set to *false* initially." msgstr "" -#: library/asyncio-sync.rst:372 +#: library/asyncio-sync.rst:377 msgid "Example::" msgstr "" @@ -307,8 +307,8 @@ msgstr "" #: library/asyncio-sync.rst:222 msgid "" -"Wake up at most *n* tasks (1 by default) waiting on this condition. The " -"method is no-op if no tasks are waiting." +"Wake up *n* tasks (1 by default) waiting on this condition. If fewer than " +"*n* tasks are waiting they are all awakened." msgstr "" #: library/asyncio-sync.rst:240 @@ -355,26 +355,34 @@ msgid "" "Condition re-acquires its lock and this method returns ``True``." msgstr "" -#: library/asyncio-sync.rst:267 +#: library/asyncio-sync.rst:264 +msgid "" +"Note that a task *may* return from this call spuriously, which is why the " +"caller should always re-check the state and be prepared to :meth:`~Condition." +"wait` again. For this reason, you may prefer to use :meth:`~Condition." +"wait_for` instead." +msgstr "" + +#: library/asyncio-sync.rst:272 msgid "Wait until a predicate becomes *true*." msgstr "" -#: library/asyncio-sync.rst:269 +#: library/asyncio-sync.rst:274 msgid "" "The predicate must be a callable which result will be interpreted as a " "boolean value. The method will repeatedly :meth:`~Condition.wait` until the " "predicate evaluates to *true*. The final value is the return value." msgstr "" -#: library/asyncio-sync.rst:276 +#: library/asyncio-sync.rst:281 msgid "Semaphore" msgstr "" -#: library/asyncio-sync.rst:280 +#: library/asyncio-sync.rst:285 msgid "A Semaphore object. Not thread-safe." msgstr "" -#: library/asyncio-sync.rst:282 +#: library/asyncio-sync.rst:287 msgid "" "A semaphore manages an internal counter which is decremented by each :meth:" "`acquire` call and incremented by each :meth:`release` call. The counter can " @@ -382,19 +390,19 @@ msgid "" "waiting until some task calls :meth:`release`." msgstr "" -#: library/asyncio-sync.rst:288 +#: library/asyncio-sync.rst:293 msgid "" "The optional *value* argument gives the initial value for the internal " "counter (``1`` by default). If the given value is less than ``0`` a :exc:" "`ValueError` is raised." msgstr "" -#: library/asyncio-sync.rst:295 +#: library/asyncio-sync.rst:300 msgid "" "The preferred way to use a Semaphore is an :keyword:`async with` statement::" msgstr "" -#: library/asyncio-sync.rst:298 +#: library/asyncio-sync.rst:303 msgid "" "sem = asyncio.Semaphore(10)\n" "\n" @@ -403,7 +411,7 @@ msgid "" " # work with shared resource" msgstr "" -#: library/asyncio-sync.rst:306 +#: library/asyncio-sync.rst:311 msgid "" "sem = asyncio.Semaphore(10)\n" "\n" @@ -415,57 +423,57 @@ msgid "" " sem.release()" msgstr "" -#: library/asyncio-sync.rst:318 +#: library/asyncio-sync.rst:323 msgid "Acquire a semaphore." msgstr "" -#: library/asyncio-sync.rst:320 +#: library/asyncio-sync.rst:325 msgid "" "If the internal counter is greater than zero, decrement it by one and return " "``True`` immediately. If it is zero, wait until a :meth:`release` is called " "and return ``True``." msgstr "" -#: library/asyncio-sync.rst:326 +#: library/asyncio-sync.rst:331 msgid "Returns ``True`` if semaphore can not be acquired immediately." msgstr "" -#: library/asyncio-sync.rst:330 +#: library/asyncio-sync.rst:335 msgid "" "Release a semaphore, incrementing the internal counter by one. Can wake up a " "task waiting to acquire the semaphore." msgstr "" -#: library/asyncio-sync.rst:333 +#: library/asyncio-sync.rst:338 msgid "" "Unlike :class:`BoundedSemaphore`, :class:`Semaphore` allows making more " "``release()`` calls than ``acquire()`` calls." msgstr "" -#: library/asyncio-sync.rst:338 +#: library/asyncio-sync.rst:343 msgid "BoundedSemaphore" msgstr "" -#: library/asyncio-sync.rst:342 +#: library/asyncio-sync.rst:347 msgid "A bounded semaphore object. Not thread-safe." msgstr "" -#: library/asyncio-sync.rst:344 +#: library/asyncio-sync.rst:349 msgid "" "Bounded Semaphore is a version of :class:`Semaphore` that raises a :exc:" "`ValueError` in :meth:`~Semaphore.release` if it increases the internal " "counter above the initial *value*." msgstr "" -#: library/asyncio-sync.rst:353 +#: library/asyncio-sync.rst:358 msgid "Barrier" msgstr "" -#: library/asyncio-sync.rst:357 +#: library/asyncio-sync.rst:362 msgid "A barrier object. Not thread-safe." msgstr "" -#: library/asyncio-sync.rst:359 +#: library/asyncio-sync.rst:364 msgid "" "A barrier is a simple synchronization primitive that allows to block until " "*parties* number of tasks are waiting on it. Tasks can wait on the :meth:" @@ -474,17 +482,17 @@ msgid "" "waiting tasks would unblock simultaneously." msgstr "" -#: library/asyncio-sync.rst:365 +#: library/asyncio-sync.rst:370 msgid "" ":keyword:`async with` can be used as an alternative to awaiting on :meth:" "`~Barrier.wait`." msgstr "" -#: library/asyncio-sync.rst:368 +#: library/asyncio-sync.rst:373 msgid "The barrier can be reused any number of times." msgstr "" -#: library/asyncio-sync.rst:374 +#: library/asyncio-sync.rst:379 msgid "" "async def example_barrier():\n" " # barrier with 3 parties\n" @@ -508,11 +516,11 @@ msgid "" "asyncio.run(example_barrier())" msgstr "" -#: library/asyncio-sync.rst:395 +#: library/asyncio-sync.rst:400 msgid "Result of this example is::" msgstr "" -#: library/asyncio-sync.rst:397 +#: library/asyncio-sync.rst:402 msgid "" "\n" "\n" @@ -520,27 +528,27 @@ msgid "" "" msgstr "" -#: library/asyncio-sync.rst:407 +#: library/asyncio-sync.rst:412 msgid "" "Pass the barrier. When all the tasks party to the barrier have called this " "function, they are all unblocked simultaneously." msgstr "" -#: library/asyncio-sync.rst:410 +#: library/asyncio-sync.rst:415 msgid "" "When a waiting or blocked task in the barrier is cancelled, this task exits " "the barrier which stays in the same state. If the state of the barrier is " "\"filling\", the number of waiting task decreases by 1." msgstr "" -#: library/asyncio-sync.rst:415 +#: library/asyncio-sync.rst:420 msgid "" "The return value is an integer in the range of 0 to ``parties-1``, different " "for each task. This can be used to select a task to do some special " "housekeeping, e.g.::" msgstr "" -#: library/asyncio-sync.rst:419 +#: library/asyncio-sync.rst:424 msgid "" "...\n" "async with barrier as position:\n" @@ -549,26 +557,26 @@ msgid "" " print('End of *draining phase*')" msgstr "" -#: library/asyncio-sync.rst:425 +#: library/asyncio-sync.rst:430 msgid "" "This method may raise a :class:`BrokenBarrierError` exception if the barrier " "is broken or reset while a task is waiting. It could raise a :exc:" "`CancelledError` if a task is cancelled." msgstr "" -#: library/asyncio-sync.rst:432 +#: library/asyncio-sync.rst:437 msgid "" "Return the barrier to the default, empty state. Any tasks waiting on it " "will receive the :class:`BrokenBarrierError` exception." msgstr "" -#: library/asyncio-sync.rst:435 +#: library/asyncio-sync.rst:440 msgid "" "If a barrier is broken it may be better to just leave it and create a new " "one." msgstr "" -#: library/asyncio-sync.rst:440 +#: library/asyncio-sync.rst:445 msgid "" "Put the barrier into a broken state. This causes any active or future calls " "to :meth:`~Barrier.wait` to fail with the :class:`BrokenBarrierError`. Use " @@ -576,25 +584,25 @@ msgid "" "waiting tasks." msgstr "" -#: library/asyncio-sync.rst:447 +#: library/asyncio-sync.rst:452 msgid "The number of tasks required to pass the barrier." msgstr "" -#: library/asyncio-sync.rst:451 +#: library/asyncio-sync.rst:456 msgid "The number of tasks currently waiting in the barrier while filling." msgstr "" -#: library/asyncio-sync.rst:455 +#: library/asyncio-sync.rst:460 msgid "A boolean that is ``True`` if the barrier is in the broken state." msgstr "" -#: library/asyncio-sync.rst:460 +#: library/asyncio-sync.rst:465 msgid "" "This exception, a subclass of :exc:`RuntimeError`, is raised when the :class:" "`Barrier` object is reset or broken." msgstr "" -#: library/asyncio-sync.rst:468 +#: library/asyncio-sync.rst:473 msgid "" "Acquiring a lock using ``await lock`` or ``yield from lock`` and/or :keyword:" "`with` statement (``with await lock``, ``with (yield from lock)``) was " diff --git a/library/asyncio-task.po b/library/asyncio-task.po index 851d1542..21771eb5 100644 --- a/library/asyncio-task.po +++ b/library/asyncio-task.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -399,11 +399,11 @@ msgid "" " task.add_done_callback(background_tasks.discard)" msgstr "" -#: library/asyncio-task.rst:1126 +#: library/asyncio-task.rst:1192 msgid "Added the *name* parameter." msgstr "" -#: library/asyncio-task.rst:1133 +#: library/asyncio-task.rst:1199 msgid "Added the *context* parameter." msgstr "" @@ -457,15 +457,21 @@ msgstr "" #: library/asyncio-task.rst:335 msgid "" "Create a task in this task group. The signature matches that of :func:" -"`asyncio.create_task`." +"`asyncio.create_task`. If the task group is inactive (e.g. not yet entered, " +"already finished, or in the process of shutting down), we will close the " +"given ``coro``." +msgstr "" + +#: library/asyncio-task.rst:343 +msgid "Close the given coroutine if the task group is not active." msgstr "" -#: library/asyncio-task.rst:520 library/asyncio-task.rst:751 -#: library/asyncio-task.rst:818 library/asyncio-task.rst:918 +#: library/asyncio-task.rst:551 library/asyncio-task.rst:782 +#: library/asyncio-task.rst:849 msgid "Example::" msgstr "" -#: library/asyncio-task.rst:340 +#: library/asyncio-task.rst:347 msgid "" "async def main():\n" " async with asyncio.TaskGroup() as tg:\n" @@ -475,7 +481,7 @@ msgid "" "result()}\")" msgstr "" -#: library/asyncio-task.rst:346 +#: library/asyncio-task.rst:353 msgid "" "The ``async with`` statement will wait for all tasks in the group to finish. " "While waiting, new tasks may still be added to the group (for example, by " @@ -484,7 +490,7 @@ msgid "" "block is exited, no new tasks may be added to the group." msgstr "" -#: library/asyncio-task.rst:353 +#: library/asyncio-task.rst:360 msgid "" "The first time any of the tasks belonging to the group fails with an " "exception other than :exc:`asyncio.CancelledError`, the remaining tasks in " @@ -496,7 +502,7 @@ msgid "" "bubble out of the containing ``async with`` statement." msgstr "" -#: library/asyncio-task.rst:363 +#: library/asyncio-task.rst:370 msgid "" "Once all tasks have finished, if any tasks have failed with an exception " "other than :exc:`asyncio.CancelledError`, those exceptions are combined in " @@ -504,7 +510,7 @@ msgid "" "their documentation) which is then raised." msgstr "" -#: library/asyncio-task.rst:370 +#: library/asyncio-task.rst:377 msgid "" "Two base exceptions are treated specially: If any task fails with :exc:" "`KeyboardInterrupt` or :exc:`SystemExit`, the task group still cancels the " @@ -513,7 +519,7 @@ msgid "" "`ExceptionGroup` or :exc:`BaseExceptionGroup`." msgstr "" -#: library/asyncio-task.rst:376 +#: library/asyncio-task.rst:383 msgid "" "If the body of the ``async with`` statement exits with an exception (so :" "meth:`~object.__aexit__` is called with an exception set), this is treated " @@ -525,18 +531,49 @@ msgid "" "`KeyboardInterrupt` and :exc:`SystemExit` as in the previous paragraph." msgstr "" -#: library/asyncio-task.rst:390 +#: library/asyncio-task.rst:395 +msgid "" +"Task groups are careful not to mix up the internal cancellation used to " +"\"wake up\" their :meth:`~object.__aexit__` with cancellation requests for " +"the task in which they are running made by other parties. In particular, " +"when one task group is syntactically nested in another, and both experience " +"an exception in one of their child tasks simultaneously, the inner task " +"group will process its exceptions, and then the outer task group will " +"receive another cancellation and process its own exceptions." +msgstr "" + +#: library/asyncio-task.rst:403 +msgid "" +"In the case where a task group is cancelled externally and also must raise " +"an :exc:`ExceptionGroup`, it will call the parent task's :meth:`~asyncio." +"Task.cancel` method. This ensures that a :exc:`asyncio.CancelledError` will " +"be raised at the next :keyword:`await`, so the cancellation is not lost." +msgstr "" + +#: library/asyncio-task.rst:409 +msgid "" +"Task groups preserve the cancellation count reported by :meth:`asyncio.Task." +"cancelling`." +msgstr "" + +#: library/asyncio-task.rst:414 +msgid "" +"Improved handling of simultaneous internal and external cancellations and " +"correct preservation of cancellation counts." +msgstr "" + +#: library/asyncio-task.rst:418 msgid "Terminating a Task Group" msgstr "" -#: library/asyncio-task.rst:392 +#: library/asyncio-task.rst:420 msgid "" "While terminating a task group is not natively supported by the standard " "library, termination can be achieved by adding an exception-raising task to " "the task group and ignoring the raised exception:" msgstr "" -#: library/asyncio-task.rst:396 +#: library/asyncio-task.rst:424 msgid "" "import asyncio\n" "from asyncio import TaskGroup\n" @@ -569,49 +606,49 @@ msgid "" "asyncio.run(main())" msgstr "" -#: library/asyncio-task.rst:428 +#: library/asyncio-task.rst:456 msgid "Expected output:" msgstr "" -#: library/asyncio-task.rst:430 +#: library/asyncio-task.rst:458 msgid "" "Task 1: start\n" "Task 2: start\n" "Task 1: done" msgstr "" -#: library/asyncio-task.rst:437 +#: library/asyncio-task.rst:465 msgid "Sleeping" msgstr "" -#: library/asyncio-task.rst:442 +#: library/asyncio-task.rst:470 msgid "Block for *delay* seconds." msgstr "" -#: library/asyncio-task.rst:444 +#: library/asyncio-task.rst:472 msgid "" "If *result* is provided, it is returned to the caller when the coroutine " "completes." msgstr "" -#: library/asyncio-task.rst:447 +#: library/asyncio-task.rst:475 msgid "" "``sleep()`` always suspends the current task, allowing other tasks to run." msgstr "" -#: library/asyncio-task.rst:450 +#: library/asyncio-task.rst:478 msgid "" "Setting the delay to 0 provides an optimized path to allow other tasks to " "run. This can be used by long-running functions to avoid blocking the event " "loop for the full duration of the function call." msgstr "" -#: library/asyncio-task.rst:456 +#: library/asyncio-task.rst:484 msgid "" "Example of coroutine displaying the current date every second for 5 seconds::" msgstr "" -#: library/asyncio-task.rst:459 +#: library/asyncio-task.rst:487 msgid "" "import asyncio\n" "import datetime\n" @@ -628,35 +665,39 @@ msgid "" "asyncio.run(display_date())" msgstr "" -#: library/asyncio-task.rst:569 library/asyncio-task.rst:843 -#: library/asyncio-task.rst:924 +#: library/asyncio-task.rst:600 library/asyncio-task.rst:874 +#: library/asyncio-task.rst:986 msgid "Removed the *loop* parameter." msgstr "" -#: library/asyncio-task.rst:479 +#: library/asyncio-task.rst:505 +msgid "Raises :exc:`ValueError` if *delay* is :data:`~math.nan`." +msgstr "" + +#: library/asyncio-task.rst:510 msgid "Running Tasks Concurrently" msgstr "" -#: library/asyncio-task.rst:483 +#: library/asyncio-task.rst:514 msgid "" "Run :ref:`awaitable objects ` in the *aws* sequence " "*concurrently*." msgstr "" -#: library/asyncio-task.rst:486 +#: library/asyncio-task.rst:517 msgid "" "If any awaitable in *aws* is a coroutine, it is automatically scheduled as a " "Task." msgstr "" -#: library/asyncio-task.rst:489 +#: library/asyncio-task.rst:520 msgid "" "If all awaitables are completed successfully, the result is an aggregate " "list of returned values. The order of result values corresponds to the " "order of awaitables in *aws*." msgstr "" -#: library/asyncio-task.rst:493 +#: library/asyncio-task.rst:524 msgid "" "If *return_exceptions* is ``False`` (default), the first raised exception is " "immediately propagated to the task that awaits on ``gather()``. Other " @@ -664,19 +705,19 @@ msgid "" "run." msgstr "" -#: library/asyncio-task.rst:498 +#: library/asyncio-task.rst:529 msgid "" "If *return_exceptions* is ``True``, exceptions are treated the same as " "successful results, and aggregated in the result list." msgstr "" -#: library/asyncio-task.rst:501 +#: library/asyncio-task.rst:532 msgid "" "If ``gather()`` is *cancelled*, all submitted awaitables (that have not " "completed yet) are also *cancelled*." msgstr "" -#: library/asyncio-task.rst:504 +#: library/asyncio-task.rst:535 msgid "" "If any Task or Future from the *aws* sequence is *cancelled*, it is treated " "as if it raised :exc:`CancelledError` -- the ``gather()`` call is **not** " @@ -684,7 +725,7 @@ msgid "" "submitted Task/Future to cause other Tasks/Futures to be cancelled." msgstr "" -#: library/asyncio-task.rst:511 +#: library/asyncio-task.rst:542 msgid "" "A new alternative to create and run tasks concurrently and wait for their " "completion is :class:`asyncio.TaskGroup`. *TaskGroup* provides stronger " @@ -694,7 +735,7 @@ msgid "" "tasks)." msgstr "" -#: library/asyncio-task.rst:522 +#: library/asyncio-task.rst:553 msgid "" "import asyncio\n" "\n" @@ -733,7 +774,7 @@ msgid "" "# [2, 6, 24]" msgstr "" -#: library/asyncio-task.rst:558 +#: library/asyncio-task.rst:589 msgid "" "If *return_exceptions* is false, cancelling gather() after it has been " "marked done won't cancel any submitted awaitables. For instance, gather can " @@ -742,28 +783,28 @@ msgid "" "the awaitables) from gather won't cancel any other awaitables." msgstr "" -#: library/asyncio-task.rst:565 +#: library/asyncio-task.rst:596 msgid "" "If the *gather* itself is cancelled, the cancellation is propagated " "regardless of *return_exceptions*." msgstr "" -#: library/asyncio-task.rst:572 +#: library/asyncio-task.rst:603 msgid "" "Deprecation warning is emitted if no positional arguments are provided or " "not all positional arguments are Future-like objects and there is no running " "event loop." msgstr "" -#: library/asyncio-task.rst:581 +#: library/asyncio-task.rst:612 msgid "Eager Task Factory" msgstr "" -#: library/asyncio-task.rst:585 +#: library/asyncio-task.rst:616 msgid "A task factory for eager task execution." msgstr "" -#: library/asyncio-task.rst:587 +#: library/asyncio-task.rst:618 msgid "" "When using this factory (via :meth:`loop.set_task_factory(asyncio." "eager_task_factory) `), coroutines begin execution " @@ -773,13 +814,13 @@ msgid "" "synchronously." msgstr "" -#: library/asyncio-task.rst:593 +#: library/asyncio-task.rst:624 msgid "" "A common example where this is beneficial is coroutines which employ caching " "or memoization to avoid actual I/O when possible." msgstr "" -#: library/asyncio-task.rst:598 +#: library/asyncio-task.rst:629 msgid "" "Immediate execution of the coroutine is a semantic change. If the coroutine " "returns or raises, the task is never scheduled to the event loop. If the " @@ -788,60 +829,60 @@ msgid "" "the application's task execution order is likely to change." msgstr "" -#: library/asyncio-task.rst:609 +#: library/asyncio-task.rst:640 msgid "" "Create an eager task factory, similar to :func:`eager_task_factory`, using " "the provided *custom_task_constructor* when creating a new task instead of " "the default :class:`Task`." msgstr "" -#: library/asyncio-task.rst:613 +#: library/asyncio-task.rst:644 msgid "" "*custom_task_constructor* must be a *callable* with the signature matching " "the signature of :class:`Task.__init__ `. The callable must return a :" "class:`asyncio.Task`-compatible object." msgstr "" -#: library/asyncio-task.rst:617 +#: library/asyncio-task.rst:648 msgid "" "This function returns a *callable* intended to be used as a task factory of " "an event loop via :meth:`loop.set_task_factory(factory) `)." msgstr "" -#: library/asyncio-task.rst:624 +#: library/asyncio-task.rst:655 msgid "Shielding From Cancellation" msgstr "" -#: library/asyncio-task.rst:628 +#: library/asyncio-task.rst:659 msgid "" "Protect an :ref:`awaitable object ` from being :meth:" "`cancelled `." msgstr "" -#: library/asyncio-task.rst:798 +#: library/asyncio-task.rst:829 msgid "If *aw* is a coroutine it is automatically scheduled as a Task." msgstr "" -#: library/asyncio-task.rst:633 +#: library/asyncio-task.rst:664 msgid "The statement::" msgstr "" -#: library/asyncio-task.rst:635 +#: library/asyncio-task.rst:666 msgid "" "task = asyncio.create_task(something())\n" "res = await shield(task)" msgstr "" -#: library/asyncio-task.rst:638 +#: library/asyncio-task.rst:669 msgid "is equivalent to::" msgstr "" -#: library/asyncio-task.rst:640 +#: library/asyncio-task.rst:671 msgid "res = await something()" msgstr "" -#: library/asyncio-task.rst:642 +#: library/asyncio-task.rst:673 msgid "" "*except* that if the coroutine containing it is cancelled, the Task running " "in ``something()`` is not cancelled. From the point of view of " @@ -850,20 +891,20 @@ msgid "" "`CancelledError`." msgstr "" -#: library/asyncio-task.rst:648 +#: library/asyncio-task.rst:679 msgid "" "If ``something()`` is cancelled by other means (i.e. from within itself) " "that would also cancel ``shield()``." msgstr "" -#: library/asyncio-task.rst:651 +#: library/asyncio-task.rst:682 msgid "" "If it is desired to completely ignore cancellation (not recommended) the " "``shield()`` function should be combined with a try/except clause, as " "follows::" msgstr "" -#: library/asyncio-task.rst:655 +#: library/asyncio-task.rst:686 msgid "" "task = asyncio.create_task(something())\n" "try:\n" @@ -872,7 +913,7 @@ msgid "" " res = None" msgstr "" -#: library/asyncio-task.rst:663 +#: library/asyncio-task.rst:694 msgid "" "Save a reference to tasks passed to this function, to avoid a task " "disappearing mid-execution. The event loop only keeps weak references to " @@ -880,43 +921,43 @@ msgid "" "any time, even before it's done." msgstr "" -#: library/asyncio-task.rst:671 +#: library/asyncio-task.rst:702 msgid "" "Deprecation warning is emitted if *aw* is not Future-like object and there " "is no running event loop." msgstr "" -#: library/asyncio-task.rst:677 +#: library/asyncio-task.rst:708 msgid "Timeouts" msgstr "" -#: library/asyncio-task.rst:681 +#: library/asyncio-task.rst:712 msgid "" "Return an :ref:`asynchronous context manager ` that " "can be used to limit the amount of time spent waiting on something." msgstr "" -#: library/asyncio-task.rst:685 +#: library/asyncio-task.rst:716 msgid "" "*delay* can either be ``None``, or a float/int number of seconds to wait. If " "*delay* is ``None``, no time limit will be applied; this can be useful if " "the delay is unknown when the context manager is created." msgstr "" -#: library/asyncio-task.rst:690 +#: library/asyncio-task.rst:721 msgid "" "In either case, the context manager can be rescheduled after creation using :" "meth:`Timeout.reschedule`." msgstr "" -#: library/asyncio-task.rst:695 +#: library/asyncio-task.rst:726 msgid "" "async def main():\n" " async with asyncio.timeout(10):\n" " await long_running_task()" msgstr "" -#: library/asyncio-task.rst:699 +#: library/asyncio-task.rst:730 msgid "" "If ``long_running_task`` takes more than 10 seconds to complete, the context " "manager will cancel the current task and handle the resulting :exc:`asyncio." @@ -924,18 +965,18 @@ msgid "" "can be caught and handled." msgstr "" -#: library/asyncio-task.rst:706 +#: library/asyncio-task.rst:737 msgid "" "The :func:`asyncio.timeout` context manager is what transforms the :exc:" "`asyncio.CancelledError` into a :exc:`TimeoutError`, which means the :exc:" "`TimeoutError` can only be caught *outside* of the context manager." msgstr "" -#: library/asyncio-task.rst:711 +#: library/asyncio-task.rst:742 msgid "Example of catching :exc:`TimeoutError`::" msgstr "" -#: library/asyncio-task.rst:713 +#: library/asyncio-task.rst:744 msgid "" "async def main():\n" " try:\n" @@ -947,48 +988,48 @@ msgid "" " print(\"This statement will run regardless.\")" msgstr "" -#: library/asyncio-task.rst:722 +#: library/asyncio-task.rst:753 msgid "" "The context manager produced by :func:`asyncio.timeout` can be rescheduled " "to a different deadline and inspected." msgstr "" -#: library/asyncio-task.rst:727 +#: library/asyncio-task.rst:758 msgid "" "An :ref:`asynchronous context manager ` for " "cancelling overdue coroutines." msgstr "" -#: library/asyncio-task.rst:730 +#: library/asyncio-task.rst:761 msgid "" "``when`` should be an absolute time at which the context should time out, as " "measured by the event loop's clock:" msgstr "" -#: library/asyncio-task.rst:733 +#: library/asyncio-task.rst:764 msgid "If ``when`` is ``None``, the timeout will never trigger." msgstr "" -#: library/asyncio-task.rst:734 +#: library/asyncio-task.rst:765 msgid "" "If ``when < loop.time()``, the timeout will trigger on the next iteration of " "the event loop." msgstr "" -#: library/asyncio-task.rst:739 +#: library/asyncio-task.rst:770 msgid "" "Return the current deadline, or ``None`` if the current deadline is not set." msgstr "" -#: library/asyncio-task.rst:744 +#: library/asyncio-task.rst:775 msgid "Reschedule the timeout." msgstr "" -#: library/asyncio-task.rst:748 +#: library/asyncio-task.rst:779 msgid "Return whether the context manager has exceeded its deadline (expired)." msgstr "" -#: library/asyncio-task.rst:753 +#: library/asyncio-task.rst:784 msgid "" "async def main():\n" " try:\n" @@ -1006,17 +1047,17 @@ msgid "" " print(\"Looks like we haven't finished on time.\")" msgstr "" -#: library/asyncio-task.rst:768 +#: library/asyncio-task.rst:799 msgid "Timeout context managers can be safely nested." msgstr "" -#: library/asyncio-task.rst:774 +#: library/asyncio-task.rst:805 msgid "" "Similar to :func:`asyncio.timeout`, except *when* is the absolute time to " "stop waiting, or ``None``." msgstr "" -#: library/asyncio-task.rst:779 +#: library/asyncio-task.rst:810 msgid "" "async def main():\n" " loop = get_running_loop()\n" @@ -1030,41 +1071,41 @@ msgid "" " print(\"This statement will run regardless.\")" msgstr "" -#: library/asyncio-task.rst:795 +#: library/asyncio-task.rst:826 msgid "" "Wait for the *aw* :ref:`awaitable ` to complete with a " "timeout." msgstr "" -#: library/asyncio-task.rst:800 +#: library/asyncio-task.rst:831 msgid "" "*timeout* can either be ``None`` or a float or int number of seconds to wait " "for. If *timeout* is ``None``, block until the future completes." msgstr "" -#: library/asyncio-task.rst:804 +#: library/asyncio-task.rst:835 msgid "" "If a timeout occurs, it cancels the task and raises :exc:`TimeoutError`." msgstr "" -#: library/asyncio-task.rst:807 +#: library/asyncio-task.rst:838 msgid "" "To avoid the task :meth:`cancellation `, wrap it in :func:" "`shield`." msgstr "" -#: library/asyncio-task.rst:810 +#: library/asyncio-task.rst:841 msgid "" "The function will wait until the future is actually cancelled, so the total " "wait time may exceed the *timeout*. If an exception happens during " "cancellation, it is propagated." msgstr "" -#: library/asyncio-task.rst:814 +#: library/asyncio-task.rst:845 msgid "If the wait is cancelled, the future *aw* is also cancelled." msgstr "" -#: library/asyncio-task.rst:820 +#: library/asyncio-task.rst:851 msgid "" "async def eternity():\n" " # Sleep for one hour\n" @@ -1085,134 +1126,186 @@ msgid "" "# timeout!" msgstr "" -#: library/asyncio-task.rst:838 +#: library/asyncio-task.rst:869 msgid "" "When *aw* is cancelled due to a timeout, ``wait_for`` waits for *aw* to be " "cancelled. Previously, it raised :exc:`TimeoutError` immediately." msgstr "" -#: library/asyncio-task.rst:846 +#: library/asyncio-task.rst:877 msgid "Raises :exc:`TimeoutError` instead of :exc:`asyncio.TimeoutError`." msgstr "" -#: library/asyncio-task.rst:851 +#: library/asyncio-task.rst:882 msgid "Waiting Primitives" msgstr "" -#: library/asyncio-task.rst:856 +#: library/asyncio-task.rst:887 msgid "" "Run :class:`~asyncio.Future` and :class:`~asyncio.Task` instances in the " "*aws* iterable concurrently and block until the condition specified by " "*return_when*." msgstr "" -#: library/asyncio-task.rst:860 +#: library/asyncio-task.rst:891 msgid "The *aws* iterable must not be empty." msgstr "" -#: library/asyncio-task.rst:862 +#: library/asyncio-task.rst:893 msgid "Returns two sets of Tasks/Futures: ``(done, pending)``." msgstr "" -#: library/asyncio-task.rst:864 +#: library/asyncio-task.rst:895 msgid "Usage::" msgstr "" -#: library/asyncio-task.rst:866 +#: library/asyncio-task.rst:897 msgid "done, pending = await asyncio.wait(aws)" msgstr "" -#: library/asyncio-task.rst:868 +#: library/asyncio-task.rst:899 msgid "" "*timeout* (a float or int), if specified, can be used to control the maximum " "number of seconds to wait before returning." msgstr "" -#: library/asyncio-task.rst:871 +#: library/asyncio-task.rst:902 msgid "" "Note that this function does not raise :exc:`TimeoutError`. Futures or Tasks " "that aren't done when the timeout occurs are simply returned in the second " "set." msgstr "" -#: library/asyncio-task.rst:875 +#: library/asyncio-task.rst:906 msgid "" "*return_when* indicates when this function should return. It must be one of " "the following constants:" msgstr "" -#: library/asyncio-task.rst:881 +#: library/asyncio-task.rst:912 msgid "Constant" msgstr "" -#: library/asyncio-task.rst:882 +#: library/asyncio-task.rst:913 msgid "Description" msgstr "" -#: library/asyncio-task.rst:885 +#: library/asyncio-task.rst:916 msgid "The function will return when any future finishes or is cancelled." msgstr "" -#: library/asyncio-task.rst:888 +#: library/asyncio-task.rst:919 msgid "" "The function will return when any future finishes by raising an exception. " "If no future raises an exception then it is equivalent to :const:" "`ALL_COMPLETED`." msgstr "" -#: library/asyncio-task.rst:893 +#: library/asyncio-task.rst:924 msgid "The function will return when all futures finish or are cancelled." msgstr "" -#: library/asyncio-task.rst:895 +#: library/asyncio-task.rst:926 msgid "" "Unlike :func:`~asyncio.wait_for`, ``wait()`` does not cancel the futures " "when a timeout occurs." msgstr "" -#: library/asyncio-task.rst:901 +#: library/asyncio-task.rst:932 msgid "Passing coroutine objects to ``wait()`` directly is forbidden." msgstr "" -#: library/asyncio-task.rst:931 +#: library/asyncio-task.rst:993 msgid "Added support for generators yielding tasks." msgstr "" -#: library/asyncio-task.rst:910 +#: library/asyncio-task.rst:941 msgid "" "Run :ref:`awaitable objects ` in the *aws* iterable " -"concurrently. Return an iterator of coroutines. Each coroutine returned can " -"be awaited to get the earliest next result from the iterable of the " -"remaining awaitables." +"concurrently. The returned object can be iterated to obtain the results of " +"the awaitables as they finish." +msgstr "" + +#: library/asyncio-task.rst:945 +msgid "" +"The object returned by ``as_completed()`` can be iterated as an :term:" +"`asynchronous iterator` or a plain :term:`iterator`. When asynchronous " +"iteration is used, the originally-supplied awaitables are yielded if they " +"are tasks or futures. This makes it easy to correlate previously-scheduled " +"tasks with their results. Example::" msgstr "" -#: library/asyncio-task.rst:915 +#: library/asyncio-task.rst:951 msgid "" -"Raises :exc:`TimeoutError` if the timeout occurs before all Futures are done." +"ipv4_connect = create_task(open_connection(\"127.0.0.1\", 80))\n" +"ipv6_connect = create_task(open_connection(\"::1\", 80))\n" +"tasks = [ipv4_connect, ipv6_connect]\n" +"\n" +"async for earliest_connect in as_completed(tasks):\n" +" # earliest_connect is done. The result can be obtained by\n" +" # awaiting it or calling earliest_connect.result()\n" +" reader, writer = await earliest_connect\n" +"\n" +" if earliest_connect is ipv6_connect:\n" +" print(\"IPv6 connection established.\")\n" +" else:\n" +" print(\"IPv4 connection established.\")" +msgstr "" + +#: library/asyncio-task.rst:965 +msgid "" +"During asynchronous iteration, implicitly-created tasks will be yielded for " +"supplied awaitables that aren't tasks or futures." msgstr "" -#: library/asyncio-task.rst:920 +#: library/asyncio-task.rst:968 msgid "" -"for coro in as_completed(aws):\n" -" earliest_result = await coro\n" -" # ..." +"When used as a plain iterator, each iteration yields a new coroutine that " +"returns the result or raises the exception of the next completed awaitable. " +"This pattern is compatible with Python versions older than 3.13::" msgstr "" -#: library/asyncio-task.rst:927 +#: library/asyncio-task.rst:972 +msgid "" +"ipv4_connect = create_task(open_connection(\"127.0.0.1\", 80))\n" +"ipv6_connect = create_task(open_connection(\"::1\", 80))\n" +"tasks = [ipv4_connect, ipv6_connect]\n" +"\n" +"for next_connect in as_completed(tasks):\n" +" # next_connect is not one of the original task objects. It must be\n" +" # awaited to obtain the result value or raise the exception of the\n" +" # awaitable that finishes next.\n" +" reader, writer = await next_connect" +msgstr "" + +#: library/asyncio-task.rst:982 +msgid "" +"A :exc:`TimeoutError` is raised if the timeout occurs before all awaitables " +"are done. This is raised by the ``async for`` loop during asynchronous " +"iteration or by the coroutines yielded during plain iteration." +msgstr "" + +#: library/asyncio-task.rst:989 msgid "" "Deprecation warning is emitted if not all awaitable objects in the *aws* " "iterable are Future-like objects and there is no running event loop." msgstr "" -#: library/asyncio-task.rst:936 +#: library/asyncio-task.rst:996 +msgid "" +"The result can now be used as either an :term:`asynchronous iterator` or as " +"a plain :term:`iterator` (previously it was only a plain iterator)." +msgstr "" + +#: library/asyncio-task.rst:1002 msgid "Running in Threads" msgstr "" -#: library/asyncio-task.rst:941 +#: library/asyncio-task.rst:1007 msgid "Asynchronously run function *func* in a separate thread." msgstr "" -#: library/asyncio-task.rst:943 +#: library/asyncio-task.rst:1009 msgid "" "Any \\*args and \\*\\*kwargs supplied for this function are directly passed " "to *func*. Also, the current :class:`contextvars.Context` is propagated, " @@ -1220,19 +1313,19 @@ msgid "" "separate thread." msgstr "" -#: library/asyncio-task.rst:948 +#: library/asyncio-task.rst:1014 msgid "" "Return a coroutine that can be awaited to get the eventual result of *func*." msgstr "" -#: library/asyncio-task.rst:950 +#: library/asyncio-task.rst:1016 msgid "" "This coroutine function is primarily intended to be used for executing IO-" "bound functions/methods that would otherwise block the event loop if they " "were run in the main thread. For example::" msgstr "" -#: library/asyncio-task.rst:954 +#: library/asyncio-task.rst:1020 msgid "" "def blocking_io():\n" " print(f\"start blocking_io at {time.strftime('%X')}\")\n" @@ -1261,7 +1354,7 @@ msgid "" "# finished main at 19:50:54" msgstr "" -#: library/asyncio-task.rst:980 +#: library/asyncio-task.rst:1046 msgid "" "Directly calling ``blocking_io()`` in any coroutine would block the event " "loop for its duration, resulting in an additional 1 second of run time. " @@ -1269,7 +1362,7 @@ msgid "" "thread without blocking the event loop." msgstr "" -#: library/asyncio-task.rst:987 +#: library/asyncio-task.rst:1053 msgid "" "Due to the :term:`GIL`, ``asyncio.to_thread()`` can typically only be used " "to make IO-bound functions non-blocking. However, for extension modules that " @@ -1277,27 +1370,27 @@ msgid "" "``asyncio.to_thread()`` can also be used for CPU-bound functions." msgstr "" -#: library/asyncio-task.rst:996 +#: library/asyncio-task.rst:1062 msgid "Scheduling From Other Threads" msgstr "" -#: library/asyncio-task.rst:1000 +#: library/asyncio-task.rst:1066 msgid "Submit a coroutine to the given event loop. Thread-safe." msgstr "" -#: library/asyncio-task.rst:1002 +#: library/asyncio-task.rst:1068 msgid "" "Return a :class:`concurrent.futures.Future` to wait for the result from " "another OS thread." msgstr "" -#: library/asyncio-task.rst:1005 +#: library/asyncio-task.rst:1071 msgid "" "This function is meant to be called from a different OS thread than the one " "where the event loop is running. Example::" msgstr "" -#: library/asyncio-task.rst:1008 +#: library/asyncio-task.rst:1074 msgid "" "# Create a coroutine\n" "coro = asyncio.sleep(1, result=3)\n" @@ -1309,13 +1402,13 @@ msgid "" "assert future.result(timeout) == 3" msgstr "" -#: library/asyncio-task.rst:1017 +#: library/asyncio-task.rst:1083 msgid "" "If an exception is raised in the coroutine, the returned Future will be " "notified. It can also be used to cancel the task in the event loop::" msgstr "" -#: library/asyncio-task.rst:1021 +#: library/asyncio-task.rst:1087 msgid "" "try:\n" " result = future.result(timeout)\n" @@ -1328,59 +1421,59 @@ msgid "" " print(f'The coroutine returned: {result!r}')" msgstr "" -#: library/asyncio-task.rst:1031 +#: library/asyncio-task.rst:1097 msgid "" "See the :ref:`concurrency and multithreading ` " "section of the documentation." msgstr "" -#: library/asyncio-task.rst:1034 +#: library/asyncio-task.rst:1100 msgid "" "Unlike other asyncio functions this function requires the *loop* argument to " "be passed explicitly." msgstr "" -#: library/asyncio-task.rst:1041 +#: library/asyncio-task.rst:1107 msgid "Introspection" msgstr "" -#: library/asyncio-task.rst:1046 +#: library/asyncio-task.rst:1112 msgid "" "Return the currently running :class:`Task` instance, or ``None`` if no task " "is running." msgstr "" -#: library/asyncio-task.rst:1049 +#: library/asyncio-task.rst:1115 msgid "" "If *loop* is ``None`` :func:`get_running_loop` is used to get the current " "loop." msgstr "" -#: library/asyncio-task.rst:1057 +#: library/asyncio-task.rst:1123 msgid "Return a set of not yet finished :class:`Task` objects run by the loop." msgstr "" -#: library/asyncio-task.rst:1060 +#: library/asyncio-task.rst:1126 msgid "" "If *loop* is ``None``, :func:`get_running_loop` is used for getting current " "loop." msgstr "" -#: library/asyncio-task.rst:1068 +#: library/asyncio-task.rst:1134 msgid "Return ``True`` if *obj* is a coroutine object." msgstr "" -#: library/asyncio-task.rst:1074 +#: library/asyncio-task.rst:1140 msgid "Task Object" msgstr "" -#: library/asyncio-task.rst:1078 +#: library/asyncio-task.rst:1144 msgid "" "A :class:`Future-like ` object that runs a Python :ref:`coroutine " "`. Not thread-safe." msgstr "" -#: library/asyncio-task.rst:1081 +#: library/asyncio-task.rst:1147 msgid "" "Tasks are used to run coroutines in event loops. If a coroutine awaits on a " "Future, the Task suspends the execution of the coroutine and waits for the " @@ -1388,21 +1481,21 @@ msgid "" "wrapped coroutine resumes." msgstr "" -#: library/asyncio-task.rst:1087 +#: library/asyncio-task.rst:1153 msgid "" "Event loops use cooperative scheduling: an event loop runs one Task at a " "time. While a Task awaits for the completion of a Future, the event loop " "runs other Tasks, callbacks, or performs IO operations." msgstr "" -#: library/asyncio-task.rst:1092 +#: library/asyncio-task.rst:1158 msgid "" "Use the high-level :func:`asyncio.create_task` function to create Tasks, or " "the low-level :meth:`loop.create_task` or :func:`ensure_future` functions. " "Manual instantiation of Tasks is discouraged." msgstr "" -#: library/asyncio-task.rst:1097 +#: library/asyncio-task.rst:1163 msgid "" "To cancel a running Task use the :meth:`cancel` method. Calling it will " "cause the Task to throw a :exc:`CancelledError` exception into the wrapped " @@ -1410,20 +1503,20 @@ msgid "" "cancellation, the Future object will be cancelled." msgstr "" -#: library/asyncio-task.rst:1102 +#: library/asyncio-task.rst:1168 msgid "" ":meth:`cancelled` can be used to check if the Task was cancelled. The method " "returns ``True`` if the wrapped coroutine did not suppress the :exc:" "`CancelledError` exception and was actually cancelled." msgstr "" -#: library/asyncio-task.rst:1107 +#: library/asyncio-task.rst:1173 msgid "" ":class:`asyncio.Task` inherits from :class:`Future` all of its APIs except :" "meth:`Future.set_result` and :meth:`Future.set_exception`." msgstr "" -#: library/asyncio-task.rst:1111 +#: library/asyncio-task.rst:1177 msgid "" "An optional keyword-only *context* argument allows specifying a custom :" "class:`contextvars.Context` for the *coro* to run in. If no *context* is " @@ -1431,7 +1524,7 @@ msgid "" "in the copied context." msgstr "" -#: library/asyncio-task.rst:1116 +#: library/asyncio-task.rst:1182 msgid "" "An optional keyword-only *eager_start* argument allows eagerly starting the " "execution of the :class:`asyncio.Task` at task creation time. If set to " @@ -1441,96 +1534,96 @@ msgid "" "eagerly and will skip scheduling to the event loop." msgstr "" -#: library/asyncio-task.rst:1123 +#: library/asyncio-task.rst:1189 msgid "Added support for the :mod:`contextvars` module." msgstr "" -#: library/asyncio-task.rst:1129 +#: library/asyncio-task.rst:1195 msgid "" "Deprecation warning is emitted if *loop* is not specified and there is no " "running event loop." msgstr "" -#: library/asyncio-task.rst:1136 +#: library/asyncio-task.rst:1202 msgid "Added the *eager_start* parameter." msgstr "" -#: library/asyncio-task.rst:1141 +#: library/asyncio-task.rst:1207 msgid "Return ``True`` if the Task is *done*." msgstr "" -#: library/asyncio-task.rst:1143 +#: library/asyncio-task.rst:1209 msgid "" "A Task is *done* when the wrapped coroutine either returned a value, raised " "an exception, or the Task was cancelled." msgstr "" -#: library/asyncio-task.rst:1148 +#: library/asyncio-task.rst:1214 msgid "Return the result of the Task." msgstr "" -#: library/asyncio-task.rst:1150 +#: library/asyncio-task.rst:1216 msgid "" "If the Task is *done*, the result of the wrapped coroutine is returned (or " "if the coroutine raised an exception, that exception is re-raised.)" msgstr "" -#: library/asyncio-task.rst:1168 +#: library/asyncio-task.rst:1234 msgid "" "If the Task has been *cancelled*, this method raises a :exc:`CancelledError` " "exception." msgstr "" -#: library/asyncio-task.rst:1157 +#: library/asyncio-task.rst:1223 msgid "" "If the Task's result isn't yet available, this method raises an :exc:" "`InvalidStateError` exception." msgstr "" -#: library/asyncio-task.rst:1162 +#: library/asyncio-task.rst:1228 msgid "Return the exception of the Task." msgstr "" -#: library/asyncio-task.rst:1164 +#: library/asyncio-task.rst:1230 msgid "" "If the wrapped coroutine raised an exception that exception is returned. If " "the wrapped coroutine returned normally this method returns ``None``." msgstr "" -#: library/asyncio-task.rst:1171 +#: library/asyncio-task.rst:1237 msgid "" "If the Task isn't *done* yet, this method raises an :exc:`InvalidStateError` " "exception." msgstr "" -#: library/asyncio-task.rst:1176 +#: library/asyncio-task.rst:1242 msgid "Add a callback to be run when the Task is *done*." msgstr "" -#: library/asyncio-task.rst:1187 +#: library/asyncio-task.rst:1253 msgid "This method should only be used in low-level callback-based code." msgstr "" -#: library/asyncio-task.rst:1180 +#: library/asyncio-task.rst:1246 msgid "" "See the documentation of :meth:`Future.add_done_callback` for more details." msgstr "" -#: library/asyncio-task.rst:1185 +#: library/asyncio-task.rst:1251 msgid "Remove *callback* from the callbacks list." msgstr "" -#: library/asyncio-task.rst:1189 +#: library/asyncio-task.rst:1255 msgid "" "See the documentation of :meth:`Future.remove_done_callback` for more " "details." msgstr "" -#: library/asyncio-task.rst:1194 +#: library/asyncio-task.rst:1260 msgid "Return the list of stack frames for this Task." msgstr "" -#: library/asyncio-task.rst:1196 +#: library/asyncio-task.rst:1262 msgid "" "If the wrapped coroutine is not done, this returns the stack where it is " "suspended. If the coroutine has completed successfully or was cancelled, " @@ -1538,15 +1631,15 @@ msgid "" "this returns the list of traceback frames." msgstr "" -#: library/asyncio-task.rst:1202 +#: library/asyncio-task.rst:1268 msgid "The frames are always ordered from oldest to newest." msgstr "" -#: library/asyncio-task.rst:1204 +#: library/asyncio-task.rst:1270 msgid "Only one stack frame is returned for a suspended coroutine." msgstr "" -#: library/asyncio-task.rst:1206 +#: library/asyncio-task.rst:1272 msgid "" "The optional *limit* argument sets the maximum number of frames to return; " "by default all available frames are returned. The ordering of the returned " @@ -1555,81 +1648,87 @@ msgid "" "are returned. (This matches the behavior of the traceback module.)" msgstr "" -#: library/asyncio-task.rst:1215 +#: library/asyncio-task.rst:1281 msgid "Print the stack or traceback for this Task." msgstr "" -#: library/asyncio-task.rst:1217 +#: library/asyncio-task.rst:1283 msgid "" "This produces output similar to that of the traceback module for the frames " "retrieved by :meth:`get_stack`." msgstr "" -#: library/asyncio-task.rst:1220 +#: library/asyncio-task.rst:1286 msgid "The *limit* argument is passed to :meth:`get_stack` directly." msgstr "" -#: library/asyncio-task.rst:1222 +#: library/asyncio-task.rst:1288 msgid "" "The *file* argument is an I/O stream to which the output is written; by " "default output is written to :data:`sys.stdout`." msgstr "" -#: library/asyncio-task.rst:1227 +#: library/asyncio-task.rst:1293 msgid "Return the coroutine object wrapped by the :class:`Task`." msgstr "" -#: library/asyncio-task.rst:1231 +#: library/asyncio-task.rst:1297 msgid "" "This will return ``None`` for Tasks which have already completed eagerly. " "See the :ref:`Eager Task Factory `." msgstr "" -#: library/asyncio-task.rst:1238 +#: library/asyncio-task.rst:1304 msgid "Newly added eager task execution means result may be ``None``." msgstr "" -#: library/asyncio-task.rst:1242 +#: library/asyncio-task.rst:1308 msgid "" "Return the :class:`contextvars.Context` object associated with the task." msgstr "" -#: library/asyncio-task.rst:1249 +#: library/asyncio-task.rst:1315 msgid "Return the name of the Task." msgstr "" -#: library/asyncio-task.rst:1251 +#: library/asyncio-task.rst:1317 msgid "" "If no name has been explicitly assigned to the Task, the default asyncio " "Task implementation generates a default name during instantiation." msgstr "" -#: library/asyncio-task.rst:1259 +#: library/asyncio-task.rst:1325 msgid "Set the name of the Task." msgstr "" -#: library/asyncio-task.rst:1261 +#: library/asyncio-task.rst:1327 msgid "" "The *value* argument can be any object, which is then converted to a string." msgstr "" -#: library/asyncio-task.rst:1264 +#: library/asyncio-task.rst:1330 msgid "" "In the default Task implementation, the name will be visible in the :func:" "`repr` output of a task object." msgstr "" -#: library/asyncio-task.rst:1271 +#: library/asyncio-task.rst:1337 msgid "Request the Task to be cancelled." msgstr "" -#: library/asyncio-task.rst:1273 +#: library/asyncio-task.rst:1339 msgid "" -"This arranges for a :exc:`CancelledError` exception to be thrown into the " -"wrapped coroutine on the next cycle of the event loop." +"If the Task is already *done* or *cancelled*, return ``False``, otherwise, " +"return ``True``." msgstr "" -#: library/asyncio-task.rst:1276 +#: library/asyncio-task.rst:1342 +msgid "" +"The method arranges for a :exc:`CancelledError` exception to be thrown into " +"the wrapped coroutine on the next cycle of the event loop." +msgstr "" + +#: library/asyncio-task.rst:1345 msgid "" "The coroutine then has a chance to clean up or even deny the request by " "suppressing the exception with a :keyword:`try` ... ... ``except " @@ -1641,21 +1740,21 @@ msgid "" "addition to catching the exception." msgstr "" -#: library/asyncio-task.rst:1286 +#: library/asyncio-task.rst:1355 msgid "Added the *msg* parameter." msgstr "" -#: library/asyncio-task.rst:1289 +#: library/asyncio-task.rst:1358 msgid "The ``msg`` parameter is propagated from cancelled task to its awaiter." msgstr "" -#: library/asyncio-task.rst:1294 +#: library/asyncio-task.rst:1363 msgid "" "The following example illustrates how coroutines can intercept the " "cancellation request::" msgstr "" -#: library/asyncio-task.rst:1297 +#: library/asyncio-task.rst:1366 msgid "" "async def cancel_me():\n" " print('cancel_me(): before sleep')\n" @@ -1692,32 +1791,32 @@ msgid "" "# main(): cancel_me is cancelled now" msgstr "" -#: library/asyncio-task.rst:1333 +#: library/asyncio-task.rst:1402 msgid "Return ``True`` if the Task is *cancelled*." msgstr "" -#: library/asyncio-task.rst:1335 +#: library/asyncio-task.rst:1404 msgid "" "The Task is *cancelled* when the cancellation was requested with :meth:" "`cancel` and the wrapped coroutine propagated the :exc:`CancelledError` " "exception thrown into it." msgstr "" -#: library/asyncio-task.rst:1341 +#: library/asyncio-task.rst:1410 msgid "Decrement the count of cancellation requests to this Task." msgstr "" -#: library/asyncio-task.rst:1343 +#: library/asyncio-task.rst:1412 msgid "Returns the remaining number of cancellation requests." msgstr "" -#: library/asyncio-task.rst:1345 +#: library/asyncio-task.rst:1414 msgid "" "Note that once execution of a cancelled task completed, further calls to :" "meth:`uncancel` are ineffective." msgstr "" -#: library/asyncio-task.rst:1350 +#: library/asyncio-task.rst:1419 msgid "" "This method is used by asyncio's internals and isn't expected to be used by " "end-user code. In particular, if a Task gets successfully uncancelled, this " @@ -1726,7 +1825,7 @@ msgid "" "respective structured block. For example::" msgstr "" -#: library/asyncio-task.rst:1357 +#: library/asyncio-task.rst:1426 msgid "" "async def make_request_with_timeout():\n" " try:\n" @@ -1740,7 +1839,7 @@ msgid "" " await unrelated_code()" msgstr "" -#: library/asyncio-task.rst:1368 +#: library/asyncio-task.rst:1437 msgid "" "While the block with ``make_request()`` and ``make_another_request()`` might " "get cancelled due to the timeout, ``unrelated_code()`` should continue " @@ -1749,20 +1848,33 @@ msgid "" "similar fashion." msgstr "" -#: library/asyncio-task.rst:1374 +#: library/asyncio-task.rst:1443 msgid "" "If end-user code is, for some reason, suppressing cancellation by catching :" "exc:`CancelledError`, it needs to call this method to remove the " "cancellation state." msgstr "" -#: library/asyncio-task.rst:1380 +#: library/asyncio-task.rst:1447 +msgid "" +"When this method decrements the cancellation count to zero, the method " +"checks if a previous :meth:`cancel` call had arranged for :exc:" +"`CancelledError` to be thrown into the task. If it hasn't been thrown yet, " +"that arrangement will be rescinded (by resetting the internal " +"``_must_cancel`` flag)." +msgstr "" + +#: library/asyncio-task.rst:1453 +msgid "Changed to rescind pending cancellation requests upon reaching zero." +msgstr "" + +#: library/asyncio-task.rst:1458 msgid "" "Return the number of pending cancellation requests to this Task, i.e., the " "number of calls to :meth:`cancel` less the number of :meth:`uncancel` calls." msgstr "" -#: library/asyncio-task.rst:1384 +#: library/asyncio-task.rst:1462 msgid "" "Note that if this number is greater than zero but the Task is still " "executing, :meth:`cancelled` will still return ``False``. This is because " @@ -1771,7 +1883,7 @@ msgid "" "to zero." msgstr "" -#: library/asyncio-task.rst:1390 +#: library/asyncio-task.rst:1468 msgid "" "This method is used by asyncio's internals and isn't expected to be used by " "end-user code. See :meth:`uncancel` for more details." diff --git a/library/asyncio.po b/library/asyncio.po index b64ee18e..daa74218 100644 --- a/library/asyncio.po +++ b/library/asyncio.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -17,15 +17,15 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -#: library/asyncio.rst:87 +#: library/asyncio.rst:91 msgid "High-level APIs" msgstr "" -#: library/asyncio.rst:99 +#: library/asyncio.rst:103 msgid "Low-level APIs" msgstr "" -#: library/asyncio.rst:110 +#: library/asyncio.rst:114 msgid "Guides and Tutorials" msgstr "" @@ -126,9 +126,8 @@ msgstr "" #: includes/wasm-notavail.rst:5 msgid "" -"This module does not work or is not available on WebAssembly platforms " -"``wasm32-emscripten`` and ``wasm32-wasi``. See :ref:`wasm-availability` for " -"more information." +"This module does not work or is not available on WebAssembly. See :ref:`wasm-" +"availability` for more information." msgstr "" #: library/asyncio.rst:64 @@ -136,7 +135,9 @@ msgid "asyncio REPL" msgstr "" #: library/asyncio.rst:65 -msgid "You can experiment with an ``asyncio`` concurrent context in the REPL:" +msgid "" +"You can experiment with an ``asyncio`` concurrent context in the :term:" +"`REPL`:" msgstr "" #: library/asyncio.rst:67 @@ -161,10 +162,16 @@ msgstr "" msgid "(also 3.11.10, 3.10.15, 3.9.20, and 3.8.20) Emits audit events." msgstr "" -#: library/asyncio.rst:86 +#: library/asyncio.rst:82 +msgid "" +"Uses PyREPL if possible, in which case :envvar:`PYTHONSTARTUP` is also " +"executed. Emits audit events." +msgstr "" + +#: library/asyncio.rst:90 msgid "Reference" msgstr "" -#: library/asyncio.rst:119 +#: library/asyncio.rst:123 msgid "The source code for asyncio can be found in :source:`Lib/asyncio/`." msgstr "" diff --git a/library/asyncore.po b/library/asyncore.po index 8477372e..7d8fd7d3 100644 --- a/library/asyncore.po +++ b/library/asyncore.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" diff --git a/library/atexit.po b/library/atexit.po index ef59b44a..aac11273 100644 --- a/library/atexit.po +++ b/library/atexit.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" diff --git a/library/audioop.po b/library/audioop.po index 3df02270..d2edabe7 100644 --- a/library/audioop.po +++ b/library/audioop.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -18,346 +18,18 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" #: library/audioop.rst:2 -msgid ":mod:`audioop` --- Manipulate raw audio data" +msgid ":mod:`!audioop` --- Manipulate raw audio data" msgstr "" -#: library/audioop.rst:8 +#: library/audioop.rst:10 msgid "" -"The :mod:`audioop` module is deprecated (see :pep:`PEP 594 <594#audioop>` " -"for details)." +"This module is no longer part of the Python standard library. It was :ref:" +"`removed in Python 3.13 ` after being deprecated in " +"Python 3.11. The removal was decided in :pep:`594`." msgstr "" #: library/audioop.rst:14 msgid "" -"The :mod:`audioop` module contains some useful operations on sound " -"fragments. It operates on sound fragments consisting of signed integer " -"samples 8, 16, 24 or 32 bits wide, stored in :term:`bytes-like objects " -"`. All scalar items are integers, unless specified " -"otherwise." -msgstr "" - -#: library/audioop.rst:19 -msgid "" -"Support for 24-bit samples was added. All functions now accept any :term:" -"`bytes-like object`. String input now results in an immediate error." -msgstr "" - -#: library/audioop.rst:30 -msgid "" -"This module provides support for a-LAW, u-LAW and Intel/DVI ADPCM encodings." -msgstr "" - -#: library/audioop.rst:34 -msgid "" -"A few of the more complicated operations only take 16-bit samples, otherwise " -"the sample size (in bytes) is always a parameter of the operation." -msgstr "" - -#: library/audioop.rst:37 -msgid "The module defines the following variables and functions:" -msgstr "" - -#: library/audioop.rst:42 -msgid "" -"This exception is raised on all errors, such as unknown number of bytes per " -"sample, etc." -msgstr "" - -#: library/audioop.rst:48 -msgid "" -"Return a fragment which is the addition of the two samples passed as " -"parameters. *width* is the sample width in bytes, either ``1``, ``2``, ``3`` " -"or ``4``. Both fragments should have the same length. Samples are " -"truncated in case of overflow." -msgstr "" - -#: library/audioop.rst:55 -msgid "" -"Decode an Intel/DVI ADPCM coded fragment to a linear fragment. See the " -"description of :func:`lin2adpcm` for details on ADPCM coding. Return a tuple " -"``(sample, newstate)`` where the sample has the width specified in *width*." -msgstr "" - -#: library/audioop.rst:62 -msgid "" -"Convert sound fragments in a-LAW encoding to linearly encoded sound " -"fragments. a-LAW encoding always uses 8 bits samples, so *width* refers only " -"to the sample width of the output fragment here." -msgstr "" - -#: library/audioop.rst:69 -msgid "Return the average over all samples in the fragment." -msgstr "" - -#: library/audioop.rst:74 -msgid "" -"Return the average peak-peak value over all samples in the fragment. No " -"filtering is done, so the usefulness of this routine is questionable." -msgstr "" - -#: library/audioop.rst:80 -msgid "" -"Return a fragment that is the original fragment with a bias added to each " -"sample. Samples wrap around in case of overflow." -msgstr "" - -#: library/audioop.rst:86 -msgid "" -"\"Byteswap\" all samples in a fragment and returns the modified fragment. " -"Converts big-endian samples to little-endian and vice versa." -msgstr "" - -#: library/audioop.rst:94 -msgid "" -"Return the number of zero crossings in the fragment passed as an argument." -msgstr "" - -#: library/audioop.rst:99 -msgid "" -"Return a factor *F* such that ``rms(add(fragment, mul(reference, -F)))`` is " -"minimal, i.e., return the factor with which you should multiply *reference* " -"to make it match as well as possible to *fragment*. The fragments should " -"both contain 2-byte samples." -msgstr "" - -#: library/audioop.rst:104 -msgid "The time taken by this routine is proportional to ``len(fragment)``." -msgstr "" - -#: library/audioop.rst:109 -msgid "" -"Try to match *reference* as well as possible to a portion of *fragment* " -"(which should be the longer fragment). This is (conceptually) done by " -"taking slices out of *fragment*, using :func:`findfactor` to compute the " -"best match, and minimizing the result. The fragments should both contain 2-" -"byte samples. Return a tuple ``(offset, factor)`` where *offset* is the " -"(integer) offset into *fragment* where the optimal match started and " -"*factor* is the (floating-point) factor as per :func:`findfactor`." -msgstr "" - -#: library/audioop.rst:120 -msgid "" -"Search *fragment* for a slice of length *length* samples (not bytes!) with " -"maximum energy, i.e., return *i* for which ``rms(fragment[i*2:" -"(i+length)*2])`` is maximal. The fragments should both contain 2-byte " -"samples." -msgstr "" - -#: library/audioop.rst:124 -msgid "The routine takes time proportional to ``len(fragment)``." -msgstr "" - -#: library/audioop.rst:129 -msgid "Return the value of sample *index* from the fragment." -msgstr "" - -#: library/audioop.rst:134 -msgid "" -"Convert samples to 4 bit Intel/DVI ADPCM encoding. ADPCM coding is an " -"adaptive coding scheme, whereby each 4 bit number is the difference between " -"one sample and the next, divided by a (varying) step. The Intel/DVI ADPCM " -"algorithm has been selected for use by the IMA, so it may well become a " -"standard." -msgstr "" - -#: library/audioop.rst:139 -msgid "" -"*state* is a tuple containing the state of the coder. The coder returns a " -"tuple ``(adpcmfrag, newstate)``, and the *newstate* should be passed to the " -"next call of :func:`lin2adpcm`. In the initial call, ``None`` can be passed " -"as the state. *adpcmfrag* is the ADPCM coded fragment packed 2 4-bit values " -"per byte." -msgstr "" - -#: library/audioop.rst:147 -msgid "" -"Convert samples in the audio fragment to a-LAW encoding and return this as a " -"bytes object. a-LAW is an audio encoding format whereby you get a dynamic " -"range of about 13 bits using only 8 bit samples. It is used by the Sun " -"audio hardware, among others." -msgstr "" - -#: library/audioop.rst:155 -msgid "Convert samples between 1-, 2-, 3- and 4-byte formats." -msgstr "" - -#: library/audioop.rst:159 -msgid "" -"In some audio formats, such as .WAV files, 16, 24 and 32 bit samples are " -"signed, but 8 bit samples are unsigned. So when converting to 8 bit wide " -"samples for these formats, you need to also add 128 to the result::" -msgstr "" - -#: library/audioop.rst:163 -msgid "" -"new_frames = audioop.lin2lin(frames, old_width, 1)\n" -"new_frames = audioop.bias(new_frames, 1, 128)" -msgstr "" - -#: library/audioop.rst:166 -msgid "" -"The same, in reverse, has to be applied when converting from 8 to 16, 24 or " -"32 bit width samples." -msgstr "" - -#: library/audioop.rst:172 -msgid "" -"Convert samples in the audio fragment to u-LAW encoding and return this as a " -"bytes object. u-LAW is an audio encoding format whereby you get a dynamic " -"range of about 14 bits using only 8 bit samples. It is used by the Sun " -"audio hardware, among others." -msgstr "" - -#: library/audioop.rst:180 -msgid "" -"Return the maximum of the *absolute value* of all samples in a fragment." -msgstr "" - -#: library/audioop.rst:185 -msgid "Return the maximum peak-peak value in the sound fragment." -msgstr "" - -#: library/audioop.rst:190 -msgid "" -"Return a tuple consisting of the minimum and maximum values of all samples " -"in the sound fragment." -msgstr "" - -#: library/audioop.rst:196 -msgid "" -"Return a fragment that has all samples in the original fragment multiplied " -"by the floating-point value *factor*. Samples are truncated in case of " -"overflow." -msgstr "" - -#: library/audioop.rst:202 -msgid "Convert the frame rate of the input fragment." -msgstr "" - -#: library/audioop.rst:204 -msgid "" -"*state* is a tuple containing the state of the converter. The converter " -"returns a tuple ``(newfragment, newstate)``, and *newstate* should be passed " -"to the next call of :func:`ratecv`. The initial call should pass ``None`` " -"as the state." -msgstr "" - -#: library/audioop.rst:208 -msgid "" -"The *weightA* and *weightB* arguments are parameters for a simple digital " -"filter and default to ``1`` and ``0`` respectively." -msgstr "" - -#: library/audioop.rst:214 -msgid "Reverse the samples in a fragment and returns the modified fragment." -msgstr "" - -#: library/audioop.rst:219 -msgid "" -"Return the root-mean-square of the fragment, i.e. ``sqrt(sum(S_i^2)/n)``." -msgstr "" - -#: library/audioop.rst:221 -msgid "This is a measure of the power in an audio signal." -msgstr "" - -#: library/audioop.rst:226 -msgid "" -"Convert a stereo fragment to a mono fragment. The left channel is " -"multiplied by *lfactor* and the right channel by *rfactor* before adding the " -"two channels to give a mono signal." -msgstr "" - -#: library/audioop.rst:233 -msgid "" -"Generate a stereo fragment from a mono fragment. Each pair of samples in " -"the stereo fragment are computed from the mono sample, whereby left channel " -"samples are multiplied by *lfactor* and right channel samples by *rfactor*." -msgstr "" - -#: library/audioop.rst:240 -msgid "" -"Convert sound fragments in u-LAW encoding to linearly encoded sound " -"fragments. u-LAW encoding always uses 8 bits samples, so *width* refers only " -"to the sample width of the output fragment here." -msgstr "" - -#: library/audioop.rst:244 -msgid "" -"Note that operations such as :func:`.mul` or :func:`.max` make no " -"distinction between mono and stereo fragments, i.e. all samples are treated " -"equal. If this is a problem the stereo fragment should be split into two " -"mono fragments first and recombined later. Here is an example of how to do " -"that::" -msgstr "" - -#: library/audioop.rst:249 -msgid "" -"def mul_stereo(sample, width, lfactor, rfactor):\n" -" lsample = audioop.tomono(sample, width, 1, 0)\n" -" rsample = audioop.tomono(sample, width, 0, 1)\n" -" lsample = audioop.mul(lsample, width, lfactor)\n" -" rsample = audioop.mul(rsample, width, rfactor)\n" -" lsample = audioop.tostereo(lsample, width, 1, 0)\n" -" rsample = audioop.tostereo(rsample, width, 0, 1)\n" -" return audioop.add(lsample, rsample, width)" -msgstr "" - -#: library/audioop.rst:258 -msgid "" -"If you use the ADPCM coder to build network packets and you want your " -"protocol to be stateless (i.e. to be able to tolerate packet loss) you " -"should not only transmit the data but also the state. Note that you should " -"send the *initial* state (the one you passed to :func:`lin2adpcm`) along to " -"the decoder, not the final state (as returned by the coder). If you want to " -"use :class:`struct.Struct` to store the state in binary you can code the " -"first element (the predicted value) in 16 bits and the second (the delta " -"index) in 8." -msgstr "" - -#: library/audioop.rst:266 -msgid "" -"The ADPCM coders have never been tried against other ADPCM coders, only " -"against themselves. It could well be that I misinterpreted the standards in " -"which case they will not be interoperable with the respective standards." -msgstr "" - -#: library/audioop.rst:270 -msgid "" -"The :func:`find\\*` routines might look a bit funny at first sight. They are " -"primarily meant to do echo cancellation. A reasonably fast way to do this " -"is to pick the most energetic piece of the output sample, locate that in the " -"input sample and subtract the whole output sample from the input sample::" -msgstr "" - -#: library/audioop.rst:275 -msgid "" -"def echocancel(outputdata, inputdata):\n" -" pos = audioop.findmax(outputdata, 800) # one tenth second\n" -" out_test = outputdata[pos*2:]\n" -" in_test = inputdata[pos*2:]\n" -" ipos, factor = audioop.findfit(in_test, out_test)\n" -" # Optional (for better cancellation):\n" -" # factor = audioop.findfactor(in_test[ipos*2:ipos*2+len(out_test)],\n" -" # out_test)\n" -" prefill = '\\0'*(pos+ipos)*2\n" -" postfill = '\\0'*(len(inputdata)-len(prefill)-len(outputdata))\n" -" outputdata = prefill + audioop.mul(outputdata, 2, -factor) + postfill\n" -" return audioop.add(inputdata, outputdata, 2)" -msgstr "" - -#: library/audioop.rst:24 -msgid "Intel/DVI ADPCM" -msgstr "" - -#: library/audioop.rst:24 -msgid "ADPCM, Intel/DVI" -msgstr "" - -#: library/audioop.rst:24 -msgid "a-LAW" -msgstr "" - -#: library/audioop.rst:24 -msgid "u-LAW" +"The last version of Python that provided the :mod:`!audioop` module was " +"`Python 3.12 `_." msgstr "" diff --git a/library/audit_events.po b/library/audit_events.po index 918c457d..3a9cc1b5 100644 --- a/library/audit_events.po +++ b/library/audit_events.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" diff --git a/library/base64.po b/library/base64.po index f24dc1d2..59da10f3 100644 --- a/library/base64.po +++ b/library/base64.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -310,11 +310,25 @@ msgid "" "necessary." msgstr "" -#: library/base64.rst:247 +#: library/base64.rst:249 +msgid "" +"Encode the :term:`bytes-like object` *s* using Z85 (as used in ZeroMQ) and " +"return the encoded :class:`bytes`. See `Z85 specification `_ for more information." +msgstr "" + +#: library/base64.rst:258 +msgid "" +"Decode the Z85-encoded :term:`bytes-like object` or ASCII string *s* and " +"return the decoded :class:`bytes`. See `Z85 specification `_ for more information." +msgstr "" + +#: library/base64.rst:265 msgid "The legacy interface:" msgstr "" -#: library/base64.rst:251 +#: library/base64.rst:269 msgid "" "Decode the contents of the binary *input* file and write the resulting " "binary data to the *output* file. *input* and *output* must be :term:`file " @@ -322,13 +336,13 @@ msgid "" "returns an empty bytes object." msgstr "" -#: library/base64.rst:259 +#: library/base64.rst:277 msgid "" "Decode the :term:`bytes-like object` *s*, which must contain one or more " "lines of base64 encoded data, and return the decoded :class:`bytes`." msgstr "" -#: library/base64.rst:267 +#: library/base64.rst:285 msgid "" "Encode the contents of the binary *input* file and write the resulting " "base64 encoded data to the *output* file. *input* and *output* must be :term:" @@ -338,7 +352,7 @@ msgid "" "the output always ends with a newline, as per :rfc:`2045` (MIME)." msgstr "" -#: library/base64.rst:277 +#: library/base64.rst:295 msgid "" "Encode the :term:`bytes-like object` *s*, which can contain arbitrary binary " "data, and return :class:`bytes` containing the base64-encoded data, with " @@ -346,38 +360,38 @@ msgid "" "that there is a trailing newline, as per :rfc:`2045` (MIME)." msgstr "" -#: library/base64.rst:285 +#: library/base64.rst:303 msgid "An example usage of the module:" msgstr "" -#: library/base64.rst:298 +#: library/base64.rst:316 msgid "Security Considerations" msgstr "" -#: library/base64.rst:300 +#: library/base64.rst:318 msgid "" "A new security considerations section was added to :rfc:`4648` (section 12); " "it's recommended to review the security section for any code deployed to " "production." msgstr "" -#: library/base64.rst:305 +#: library/base64.rst:323 msgid "Module :mod:`binascii`" msgstr "" -#: library/base64.rst:306 +#: library/base64.rst:324 msgid "" "Support module containing ASCII-to-binary and binary-to-ASCII conversions." msgstr "" -#: library/base64.rst:308 +#: library/base64.rst:326 msgid "" ":rfc:`1521` - MIME (Multipurpose Internet Mail Extensions) Part One: " "Mechanisms for Specifying and Describing the Format of Internet Message " "Bodies" msgstr "" -#: library/base64.rst:309 +#: library/base64.rst:327 msgid "" "Section 5.2, \"Base64 Content-Transfer-Encoding,\" provides the definition " "of the base64 encoding." diff --git a/library/bdb.po b/library/bdb.po index 224a8703..0dd22c05 100644 --- a/library/bdb.po +++ b/library/bdb.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -414,57 +414,63 @@ msgid "" "from caller's frame." msgstr "" -#: library/bdb.rst:294 +#: library/bdb.rst:292 +msgid "" +":func:`set_trace` will enter the debugger immediately, rather than on the " +"next line of code to be executed." +msgstr "" + +#: library/bdb.rst:298 msgid "" "Stop only at breakpoints or when finished. If there are no breakpoints, set " "the system trace function to ``None``." msgstr "" -#: library/bdb.rst:301 +#: library/bdb.rst:305 msgid "" "Set the :attr:`!quitting` attribute to ``True``. This raises :exc:`BdbQuit` " "in the next call to one of the :meth:`!dispatch_\\*` methods." msgstr "" -#: library/bdb.rst:305 +#: library/bdb.rst:309 msgid "" "Derived classes and clients can call the following methods to manipulate " "breakpoints. These methods return a string containing an error message if " "something went wrong, or ``None`` if all is well." msgstr "" -#: library/bdb.rst:311 +#: library/bdb.rst:315 msgid "" "Set a new breakpoint. If the *lineno* line doesn't exist for the *filename* " "passed as argument, return an error message. The *filename* should be in " "canonical form, as described in the :meth:`canonic` method." msgstr "" -#: library/bdb.rst:317 +#: library/bdb.rst:321 msgid "" "Delete the breakpoints in *filename* and *lineno*. If none were set, return " "an error message." msgstr "" -#: library/bdb.rst:322 +#: library/bdb.rst:326 msgid "" "Delete the breakpoint which has the index *arg* in the :attr:`Breakpoint." "bpbynumber`. If *arg* is not numeric or out of range, return an error " "message." msgstr "" -#: library/bdb.rst:328 +#: library/bdb.rst:332 msgid "" "Delete all breakpoints in *filename*. If none were set, return an error " "message." msgstr "" -#: library/bdb.rst:333 +#: library/bdb.rst:337 msgid "" "Delete all existing breakpoints. If none were set, return an error message." msgstr "" -#: library/bdb.rst:338 +#: library/bdb.rst:342 msgid "" "Return a breakpoint specified by the given number. If *arg* is a string, it " "will be converted to a number. If *arg* is a non-numeric string, if the " @@ -472,103 +478,103 @@ msgid "" "raised." msgstr "" -#: library/bdb.rst:347 +#: library/bdb.rst:351 msgid "Return ``True`` if there is a breakpoint for *lineno* in *filename*." msgstr "" -#: library/bdb.rst:351 +#: library/bdb.rst:355 msgid "" "Return all breakpoints for *lineno* in *filename*, or an empty list if none " "are set." msgstr "" -#: library/bdb.rst:356 +#: library/bdb.rst:360 msgid "Return all breakpoints in *filename*, or an empty list if none are set." msgstr "" -#: library/bdb.rst:360 +#: library/bdb.rst:364 msgid "Return all breakpoints that are set." msgstr "" -#: library/bdb.rst:363 +#: library/bdb.rst:367 msgid "" "Derived classes and clients can call the following methods to get a data " "structure representing a stack trace." msgstr "" -#: library/bdb.rst:368 +#: library/bdb.rst:372 msgid "Return a list of (frame, lineno) tuples in a stack trace, and a size." msgstr "" -#: library/bdb.rst:370 +#: library/bdb.rst:374 msgid "" "The most recently called frame is last in the list. The size is the number " "of frames below the frame where the debugger was invoked." msgstr "" -#: library/bdb.rst:375 +#: library/bdb.rst:379 msgid "" "Return a string with information about a stack entry, which is a ``(frame, " "lineno)`` tuple. The return string contains:" msgstr "" -#: library/bdb.rst:378 +#: library/bdb.rst:382 msgid "The canonical filename which contains the frame." msgstr "" -#: library/bdb.rst:379 +#: library/bdb.rst:383 msgid "The function name or ``\"\"``." msgstr "" -#: library/bdb.rst:380 +#: library/bdb.rst:384 msgid "The input arguments." msgstr "" -#: library/bdb.rst:381 +#: library/bdb.rst:385 msgid "The return value." msgstr "" -#: library/bdb.rst:382 +#: library/bdb.rst:386 msgid "The line of code (if it exists)." msgstr "" -#: library/bdb.rst:385 +#: library/bdb.rst:389 msgid "" "The following two methods can be called by clients to use a debugger to " "debug a :term:`statement`, given as a string." msgstr "" -#: library/bdb.rst:390 +#: library/bdb.rst:394 msgid "" "Debug a statement executed via the :func:`exec` function. *globals* " "defaults to :attr:`!__main__.__dict__`, *locals* defaults to *globals*." msgstr "" -#: library/bdb.rst:395 +#: library/bdb.rst:399 msgid "" "Debug an expression executed via the :func:`eval` function. *globals* and " "*locals* have the same meaning as in :meth:`run`." msgstr "" -#: library/bdb.rst:400 +#: library/bdb.rst:404 msgid "For backwards compatibility. Calls the :meth:`run` method." msgstr "" -#: library/bdb.rst:404 +#: library/bdb.rst:408 msgid "Debug a single function call, and return its result." msgstr "" -#: library/bdb.rst:407 +#: library/bdb.rst:411 msgid "Finally, the module defines the following functions:" msgstr "" -#: library/bdb.rst:411 +#: library/bdb.rst:415 msgid "" "Return ``True`` if we should break here, depending on the way the :class:" "`Breakpoint` *b* was set." msgstr "" -#: library/bdb.rst:414 +#: library/bdb.rst:418 msgid "" "If it was set via line number, it checks if :attr:`b.line ` is the same as the one in *frame*. If the breakpoint was set via :" @@ -577,13 +583,13 @@ msgid "" "line." msgstr "" -#: library/bdb.rst:423 +#: library/bdb.rst:427 msgid "" "Return ``(active breakpoint, delete temporary flag)`` or ``(None, None)`` as " "the breakpoint to act upon." msgstr "" -#: library/bdb.rst:426 +#: library/bdb.rst:430 msgid "" "The *active breakpoint* is the first entry in :attr:`bplist ` for the (:attr:`file `, :attr:`line ` count is ignored)." msgstr "" -#: library/bdb.rst:437 +#: library/bdb.rst:441 msgid "If no such entry exists, then ``(None, None)`` is returned." msgstr "" -#: library/bdb.rst:442 +#: library/bdb.rst:446 msgid "Start debugging with a :class:`Bdb` instance from caller's frame." msgstr "" -#: library/bdb.rst:299 +#: library/bdb.rst:303 msgid "quitting (bdb.Bdb attribute)" msgstr "" diff --git a/library/binary.po b/library/binary.po index 92cfa12f..17eb0dc3 100644 --- a/library/binary.po +++ b/library/binary.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" diff --git a/library/binascii.po b/library/binascii.po index 2cadf157..302562d4 100644 --- a/library/binascii.po +++ b/library/binascii.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -21,17 +21,16 @@ msgstr "" msgid ":mod:`!binascii` --- Convert between binary and ASCII" msgstr "" -#: library/binascii.rst:14 +#: library/binascii.rst:13 msgid "" "The :mod:`binascii` module contains a number of methods to convert between " "binary and various ASCII-encoded binary representations. Normally, you will " -"not use these functions directly but use wrapper modules like :mod:`uu` or :" -"mod:`base64` instead. The :mod:`binascii` module contains low-level " -"functions written in C for greater speed that are used by the higher-level " -"modules." +"not use these functions directly but use wrapper modules like :mod:`base64` " +"instead. The :mod:`binascii` module contains low-level functions written in " +"C for greater speed that are used by the higher-level modules." msgstr "" -#: library/binascii.rst:23 +#: library/binascii.rst:22 msgid "" "``a2b_*`` functions accept Unicode strings containing only ASCII characters. " "Other functions only accept :term:`bytes-like objects ` " @@ -39,22 +38,22 @@ msgid "" "the buffer protocol)." msgstr "" -#: library/binascii.rst:28 +#: library/binascii.rst:27 msgid "ASCII-only unicode strings are now accepted by the ``a2b_*`` functions." msgstr "" -#: library/binascii.rst:32 +#: library/binascii.rst:31 msgid "The :mod:`binascii` module defines the following functions:" msgstr "" -#: library/binascii.rst:37 +#: library/binascii.rst:36 msgid "" "Convert a single line of uuencoded data back to binary and return the binary " "data. Lines normally contain 45 (binary) bytes, except for the last line. " "Line data may be followed by whitespace." msgstr "" -#: library/binascii.rst:44 +#: library/binascii.rst:43 msgid "" "Convert binary data to a line of ASCII characters, the return value is the " "converted line, including a newline char. The length of *data* should be at " @@ -62,67 +61,67 @@ msgid "" "spaces." msgstr "" -#: library/binascii.rst:48 +#: library/binascii.rst:47 msgid "Added the *backtick* parameter." msgstr "" -#: library/binascii.rst:54 +#: library/binascii.rst:53 msgid "" "Convert a block of base64 data back to binary and return the binary data. " "More than one line may be passed at a time." msgstr "" -#: library/binascii.rst:57 +#: library/binascii.rst:56 msgid "" "If *strict_mode* is true, only valid base64 data will be converted. Invalid " "base64 data will raise :exc:`binascii.Error`." msgstr "" -#: library/binascii.rst:60 +#: library/binascii.rst:59 msgid "Valid base64:" msgstr "" -#: library/binascii.rst:62 +#: library/binascii.rst:61 msgid "Conforms to :rfc:`3548`." msgstr "" -#: library/binascii.rst:63 +#: library/binascii.rst:62 msgid "Contains only characters from the base64 alphabet." msgstr "" -#: library/binascii.rst:64 +#: library/binascii.rst:63 msgid "" "Contains no excess data after padding (including excess padding, newlines, " "etc.)." msgstr "" -#: library/binascii.rst:65 +#: library/binascii.rst:64 msgid "Does not start with a padding." msgstr "" -#: library/binascii.rst:67 +#: library/binascii.rst:66 msgid "Added the *strict_mode* parameter." msgstr "" -#: library/binascii.rst:73 +#: library/binascii.rst:72 msgid "" "Convert binary data to a line of ASCII characters in base64 coding. The " "return value is the converted line, including a newline char if *newline* is " "true. The output of this function conforms to :rfc:`3548`." msgstr "" -#: library/binascii.rst:77 +#: library/binascii.rst:76 msgid "Added the *newline* parameter." msgstr "" -#: library/binascii.rst:83 +#: library/binascii.rst:82 msgid "" "Convert a block of quoted-printable data back to binary and return the " "binary data. More than one line may be passed at a time. If the optional " "argument *header* is present and true, underscores will be decoded as spaces." msgstr "" -#: library/binascii.rst:90 +#: library/binascii.rst:89 msgid "" "Convert binary data to a line(s) of ASCII characters in quoted-printable " "encoding. The return value is the converted line(s). If the optional " @@ -135,7 +134,7 @@ msgid "" "might corrupt the binary data stream." msgstr "" -#: library/binascii.rst:103 +#: library/binascii.rst:102 msgid "" "Compute a 16-bit CRC value of *data*, starting with *value* as the initial " "CRC, and return the result. This uses the CRC-CCITT polynomial *x*:sup:`16` " @@ -143,7 +142,7 @@ msgid "" "used in the binhex4 format." msgstr "" -#: library/binascii.rst:111 +#: library/binascii.rst:110 msgid "" "Compute CRC-32, the unsigned 32-bit checksum of *data*, starting with an " "initial CRC of *value*. The default initial CRC is zero. The algorithm is " @@ -152,7 +151,7 @@ msgid "" "algorithm. Use as follows::" msgstr "" -#: library/binascii.rst:117 +#: library/binascii.rst:116 msgid "" "print(binascii.crc32(b\"hello world\"))\n" "# Or, in two pieces:\n" @@ -161,24 +160,24 @@ msgid "" "print('crc32 = {:#010x}'.format(crc))" msgstr "" -#: library/binascii.rst:123 +#: library/binascii.rst:122 msgid "The result is always unsigned." msgstr "" -#: library/binascii.rst:129 +#: library/binascii.rst:128 msgid "" "Return the hexadecimal representation of the binary *data*. Every byte of " "*data* is converted into the corresponding 2-digit hex representation. The " "returned bytes object is therefore twice as long as the length of *data*." msgstr "" -#: library/binascii.rst:133 +#: library/binascii.rst:132 msgid "" "Similar functionality (but returning a text string) is also conveniently " "accessible using the :meth:`bytes.hex` method." msgstr "" -#: library/binascii.rst:136 +#: library/binascii.rst:135 msgid "" "If *sep* is specified, it must be a single character str or bytes object. It " "will be inserted in the output after every *bytes_per_sep* input bytes. " @@ -186,11 +185,11 @@ msgid "" "if you wish to count from the left, supply a negative *bytes_per_sep* value." msgstr "" -#: library/binascii.rst:151 +#: library/binascii.rst:150 msgid "The *sep* and *bytes_per_sep* parameters were added." msgstr "" -#: library/binascii.rst:157 +#: library/binascii.rst:156 msgid "" "Return the binary data represented by the hexadecimal string *hexstr*. This " "function is the inverse of :func:`b2a_hex`. *hexstr* must contain an even " @@ -198,45 +197,37 @@ msgid "" "an :exc:`Error` exception is raised." msgstr "" -#: library/binascii.rst:162 +#: library/binascii.rst:161 msgid "" "Similar functionality (accepting only text string arguments, but more " "liberal towards whitespace) is also accessible using the :meth:`bytes." "fromhex` class method." msgstr "" -#: library/binascii.rst:168 +#: library/binascii.rst:167 msgid "Exception raised on errors. These are usually programming errors." msgstr "" -#: library/binascii.rst:173 +#: library/binascii.rst:172 msgid "" "Exception raised on incomplete data. These are usually not programming " "errors, but may be handled by reading a little more data and trying again." msgstr "" -#: library/binascii.rst:179 +#: library/binascii.rst:178 msgid "Module :mod:`base64`" msgstr "" -#: library/binascii.rst:180 +#: library/binascii.rst:179 msgid "" "Support for RFC compliant base64-style encoding in base 16, 32, 64, and 85." msgstr "" -#: library/binascii.rst:183 -msgid "Module :mod:`uu`" -msgstr "" - -#: library/binascii.rst:184 -msgid "Support for UU encoding used on Unix." -msgstr "" - -#: library/binascii.rst:186 +#: library/binascii.rst:182 msgid "Module :mod:`quopri`" msgstr "" -#: library/binascii.rst:187 +#: library/binascii.rst:183 msgid "Support for quoted-printable encoding used in MIME email messages." msgstr "" @@ -244,10 +235,6 @@ msgstr "" msgid "module" msgstr "" -#: library/binascii.rst:8 -msgid "uu" -msgstr "" - #: library/binascii.rst:8 msgid "base64" msgstr "" diff --git a/library/bisect.po b/library/bisect.po index adb1e64f..7a0faf3b 100644 --- a/library/bisect.po +++ b/library/bisect.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" diff --git a/library/builtins.po b/library/builtins.po index c5cce26f..311c88a5 100644 --- a/library/builtins.po +++ b/library/builtins.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" diff --git a/library/bz2.po b/library/bz2.po index 6c84bdf9..5bbcb4db 100644 --- a/library/bz2.po +++ b/library/bz2.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -98,11 +98,11 @@ msgid "" "handling behavior, and line ending(s)." msgstr "" -#: library/bz2.rst:162 +#: library/bz2.rst:175 msgid "The ``'x'`` (exclusive creation) mode was added." msgstr "" -#: library/bz2.rst:169 +#: library/bz2.rst:182 msgid "Accepts a :term:`path-like object`." msgstr "" @@ -152,7 +152,7 @@ msgid "" msgstr "" #: library/bz2.rst:94 -msgid ":class:`BZ2File` also provides the following methods:" +msgid ":class:`BZ2File` also provides the following methods and attributes:" msgstr "" #: library/bz2.rst:98 @@ -205,93 +205,103 @@ msgstr "" msgid "Returns the number of bytes read (0 for EOF)." msgstr "" -#: library/bz2.rst:152 +#: library/bz2.rst:153 +msgid "``'rb'`` for reading and ``'wb'`` for writing." +msgstr "" + +#: library/bz2.rst:159 +msgid "" +"The bzip2 file name. Equivalent to the :attr:`~io.FileIO.name` attribute of " +"the underlying :term:`file object`." +msgstr "" + +#: library/bz2.rst:165 msgid "Support for the :keyword:`with` statement was added." msgstr "" -#: library/bz2.rst:155 +#: library/bz2.rst:168 msgid "" "Support was added for *filename* being a :term:`file object` instead of an " "actual filename." msgstr "" -#: library/bz2.rst:159 +#: library/bz2.rst:172 msgid "" "The ``'a'`` (append) mode was added, along with support for reading multi-" "stream files." msgstr "" -#: library/bz2.rst:165 +#: library/bz2.rst:178 msgid "" "The :meth:`~io.BufferedIOBase.read` method now accepts an argument of " "``None``." msgstr "" -#: library/bz2.rst:172 +#: library/bz2.rst:185 msgid "" "The *buffering* parameter has been removed. It was ignored and deprecated " "since Python 3.0. Pass an open file object to control how the file is opened." msgstr "" -#: library/bz2.rst:177 +#: library/bz2.rst:190 msgid "The *compresslevel* parameter became keyword-only." msgstr "" -#: library/bz2.rst:179 +#: library/bz2.rst:192 msgid "" "This class is thread unsafe in the face of multiple simultaneous readers or " "writers, just like its equivalent classes in :mod:`gzip` and :mod:`lzma` " "have always been." msgstr "" -#: library/bz2.rst:186 +#: library/bz2.rst:199 msgid "Incremental (de)compression" msgstr "" -#: library/bz2.rst:190 +#: library/bz2.rst:203 msgid "" "Create a new compressor object. This object may be used to compress data " "incrementally. For one-shot compression, use the :func:`compress` function " "instead." msgstr "" -#: library/bz2.rst:282 +#: library/bz2.rst:295 msgid "" "*compresslevel*, if given, must be an integer between ``1`` and ``9``. The " "default is ``9``." msgstr "" -#: library/bz2.rst:199 +#: library/bz2.rst:212 msgid "" "Provide data to the compressor object. Returns a chunk of compressed data if " "possible, or an empty byte string otherwise." msgstr "" -#: library/bz2.rst:202 +#: library/bz2.rst:215 msgid "" "When you have finished providing data to the compressor, call the :meth:" "`flush` method to finish the compression process." msgstr "" -#: library/bz2.rst:208 +#: library/bz2.rst:221 msgid "" "Finish the compression process. Returns the compressed data left in internal " "buffers." msgstr "" -#: library/bz2.rst:211 +#: library/bz2.rst:224 msgid "" "The compressor object may not be used after this method has been called." msgstr "" -#: library/bz2.rst:216 +#: library/bz2.rst:229 msgid "" "Create a new decompressor object. This object may be used to decompress data " "incrementally. For one-shot compression, use the :func:`decompress` function " "instead." msgstr "" -#: library/bz2.rst:221 +#: library/bz2.rst:234 msgid "" "This class does not transparently handle inputs containing multiple " "compressed streams, unlike :func:`decompress` and :class:`BZ2File`. If you " @@ -299,7 +309,7 @@ msgid "" "must use a new decompressor for each stream." msgstr "" -#: library/bz2.rst:228 +#: library/bz2.rst:241 msgid "" "Decompress *data* (a :term:`bytes-like object`), returning uncompressed data " "as bytes. Some of *data* may be buffered internally, for use in later calls " @@ -307,7 +317,7 @@ msgid "" "output of any previous calls to :meth:`decompress`." msgstr "" -#: library/bz2.rst:234 +#: library/bz2.rst:247 msgid "" "If *max_length* is nonnegative, returns at most *max_length* bytes of " "decompressed data. If this limit is reached and further output can be " @@ -316,99 +326,99 @@ msgid "" "``b''`` to obtain more of the output." msgstr "" -#: library/bz2.rst:241 +#: library/bz2.rst:254 msgid "" "If all of the input data was decompressed and returned (either because this " "was less than *max_length* bytes, or because *max_length* was negative), " "the :attr:`~.needs_input` attribute will be set to ``True``." msgstr "" -#: library/bz2.rst:246 +#: library/bz2.rst:259 msgid "" "Attempting to decompress data after the end of stream is reached raises an :" "exc:`EOFError`. Any data found after the end of the stream is ignored and " "saved in the :attr:`~.unused_data` attribute." msgstr "" -#: library/bz2.rst:250 +#: library/bz2.rst:263 msgid "Added the *max_length* parameter." msgstr "" -#: library/bz2.rst:255 +#: library/bz2.rst:268 msgid "``True`` if the end-of-stream marker has been reached." msgstr "" -#: library/bz2.rst:262 +#: library/bz2.rst:275 msgid "Data found after the end of the compressed stream." msgstr "" -#: library/bz2.rst:264 +#: library/bz2.rst:277 msgid "" "If this attribute is accessed before the end of the stream has been reached, " "its value will be ``b''``." msgstr "" -#: library/bz2.rst:269 +#: library/bz2.rst:282 msgid "" "``False`` if the :meth:`.decompress` method can provide more decompressed " "data before requiring new uncompressed input." msgstr "" -#: library/bz2.rst:276 +#: library/bz2.rst:289 msgid "One-shot (de)compression" msgstr "" -#: library/bz2.rst:280 +#: library/bz2.rst:293 msgid "Compress *data*, a :term:`bytes-like object `." msgstr "" -#: library/bz2.rst:285 +#: library/bz2.rst:298 msgid "For incremental compression, use a :class:`BZ2Compressor` instead." msgstr "" -#: library/bz2.rst:290 +#: library/bz2.rst:303 msgid "Decompress *data*, a :term:`bytes-like object `." msgstr "" -#: library/bz2.rst:292 +#: library/bz2.rst:305 msgid "" "If *data* is the concatenation of multiple compressed streams, decompress " "all of the streams." msgstr "" -#: library/bz2.rst:295 +#: library/bz2.rst:308 msgid "For incremental decompression, use a :class:`BZ2Decompressor` instead." msgstr "" -#: library/bz2.rst:297 +#: library/bz2.rst:310 msgid "Support for multi-stream inputs was added." msgstr "" -#: library/bz2.rst:303 +#: library/bz2.rst:316 msgid "Examples of usage" msgstr "" -#: library/bz2.rst:305 +#: library/bz2.rst:318 msgid "Below are some examples of typical usage of the :mod:`bz2` module." msgstr "" -#: library/bz2.rst:307 +#: library/bz2.rst:320 msgid "" "Using :func:`compress` and :func:`decompress` to demonstrate round-trip " "compression:" msgstr "" -#: library/bz2.rst:325 +#: library/bz2.rst:338 msgid "Using :class:`BZ2Compressor` for incremental compression:" msgstr "" -#: library/bz2.rst:343 +#: library/bz2.rst:356 msgid "" "The example above uses a very \"nonrandom\" stream of data (a stream of " "``b\"z\"`` chunks). Random data tends to compress poorly, while ordered, " "repetitive data usually yields a high compression ratio." msgstr "" -#: library/bz2.rst:347 +#: library/bz2.rst:360 msgid "Writing and reading a bzip2-compressed file in binary mode:" msgstr "" diff --git a/library/calendar.po b/library/calendar.po index b2a2b39b..19bf9edd 100644 --- a/library/calendar.po +++ b/library/calendar.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -600,7 +600,7 @@ msgstr "" msgid "" "python -m calendar [-h] [-L LOCALE] [-e ENCODING] [-t {text,html}]\n" " [-w WIDTH] [-l LINES] [-s SPACING] [-m MONTHS] [-c CSS]\n" -" [year] [month]" +" [-f FIRST_WEEKDAY] [year] [month]" msgstr "" #: library/calendar.rst:587 @@ -672,48 +672,52 @@ msgstr "" #: library/calendar.rst:660 msgid "" -"The year to print the calendar for. Must be a number between 1 and 9999. " -"Defaults to the current year." +"The weekday to start each week. Must be a number between 0 (Monday) and 6 " +"(Sunday). Defaults to 0." msgstr "" -#: library/calendar.rst:667 +#: library/calendar.rst:668 +msgid "The year to print the calendar for. Defaults to the current year." +msgstr "" + +#: library/calendar.rst:674 msgid "" "The month of the specified :option:`year` to print the calendar for. Must be " "a number between 1 and 12, and may only be used in text mode. Defaults to " "printing a calendar for the full year." msgstr "" -#: library/calendar.rst:673 +#: library/calendar.rst:680 msgid "*Text-mode options:*" msgstr "" -#: library/calendar.rst:677 +#: library/calendar.rst:684 msgid "" "The width of the date column in terminal columns. The date is printed " "centred in the column. Any value lower than 2 is ignored. Defaults to 2." msgstr "" -#: library/calendar.rst:685 +#: library/calendar.rst:692 msgid "" "The number of lines for each week in terminal rows. The date is printed top-" "aligned. Any value lower than 1 is ignored. Defaults to 1." msgstr "" -#: library/calendar.rst:693 +#: library/calendar.rst:700 msgid "" "The space between months in columns. Any value lower than 2 is ignored. " "Defaults to 6." msgstr "" -#: library/calendar.rst:700 +#: library/calendar.rst:707 msgid "The number of months printed per row. Defaults to 3." msgstr "" -#: library/calendar.rst:704 +#: library/calendar.rst:711 msgid "*HTML-mode options:*" msgstr "" -#: library/calendar.rst:708 +#: library/calendar.rst:715 msgid "" "The path of a CSS stylesheet to use for the calendar. This must either be " "relative to the generated HTML, or an absolute HTTP or ``file:///`` URL." diff --git a/library/cgi.po b/library/cgi.po index 64479700..04a81e08 100644 --- a/library/cgi.po +++ b/library/cgi.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -18,844 +18,25 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" #: library/cgi.rst:2 -msgid ":mod:`cgi` --- Common Gateway Interface support" +msgid ":mod:`!cgi` --- Common Gateway Interface support" msgstr "" -#: library/cgi.rst:8 -msgid "**Source code:** :source:`Lib/cgi.py`" -msgstr "" - -#: library/cgi.rst:18 -msgid "" -"The :mod:`cgi` module is deprecated (see :pep:`PEP 594 <594#cgi>` for " -"details and alternatives)." -msgstr "" - -#: library/cgi.rst:22 -msgid "" -"The :class:`FieldStorage` class can typically be replaced with :func:`urllib." -"parse.parse_qsl` for ``GET`` and ``HEAD`` requests, and the :mod:`email." -"message` module or :pypi:`multipart` for ``POST`` and ``PUT``. Most :ref:" -"`utility functions ` have replacements." -msgstr "" - -#: library/cgi.rst:30 -msgid "Support module for Common Gateway Interface (CGI) scripts." -msgstr "" - -#: library/cgi.rst:32 -msgid "" -"This module defines a number of utilities for use by CGI scripts written in " -"Python." -msgstr "" - -#: library/cgi.rst:35 -msgid "" -"The global variable ``maxlen`` can be set to an integer indicating the " -"maximum size of a POST request. POST requests larger than this size will " -"result in a :exc:`ValueError` being raised during parsing. The default value " -"of this variable is ``0``, meaning the request size is unlimited." -msgstr "" - -#: includes/wasm-notavail.rst:3 -msgid "Availability" -msgstr "" - -#: includes/wasm-notavail.rst:5 -msgid "" -"This module does not work or is not available on WebAssembly platforms " -"``wasm32-emscripten`` and ``wasm32-wasi``. See :ref:`wasm-availability` for " -"more information." -msgstr "" - -#: library/cgi.rst:43 -msgid "Introduction" -msgstr "" - -#: library/cgi.rst:47 -msgid "" -"A CGI script is invoked by an HTTP server, usually to process user input " -"submitted through an HTML ``
`` or ```` element." -msgstr "" - -#: library/cgi.rst:50 -msgid "" -"Most often, CGI scripts live in the server's special :file:`cgi-bin` " -"directory. The HTTP server places all sorts of information about the request " -"(such as the client's hostname, the requested URL, the query string, and " -"lots of other goodies) in the script's shell environment, executes the " -"script, and sends the script's output back to the client." -msgstr "" - -#: library/cgi.rst:56 -msgid "" -"The script's input is connected to the client too, and sometimes the form " -"data is read this way; at other times the form data is passed via the " -"\"query string\" part of the URL. This module is intended to take care of " -"the different cases and provide a simpler interface to the Python script. " -"It also provides a number of utilities that help in debugging scripts, and " -"the latest addition is support for file uploads from a form (if your browser " -"supports it)." -msgstr "" - -#: library/cgi.rst:63 -msgid "" -"The output of a CGI script should consist of two sections, separated by a " -"blank line. The first section contains a number of headers, telling the " -"client what kind of data is following. Python code to generate a minimal " -"header section looks like this::" -msgstr "" - -#: library/cgi.rst:68 -msgid "" -"print(\"Content-Type: text/html\") # HTML is following\n" -"print() # blank line, end of headers" -msgstr "" - -#: library/cgi.rst:71 -msgid "" -"The second section is usually HTML, which allows the client software to " -"display nicely formatted text with header, in-line images, etc. Here's " -"Python code that prints a simple piece of HTML::" -msgstr "" - -#: library/cgi.rst:75 -msgid "" -"print(\"CGI script output\")\n" -"print(\"

This is my first CGI script

\")\n" -"print(\"Hello, world!\")" -msgstr "" - -#: library/cgi.rst:83 -msgid "Using the cgi module" -msgstr "" - -#: library/cgi.rst:85 -msgid "Begin by writing ``import cgi``." -msgstr "" - -#: library/cgi.rst:87 -msgid "When you write a new script, consider adding these lines::" -msgstr "" - -#: library/cgi.rst:505 -msgid "" -"import cgitb\n" -"cgitb.enable()" -msgstr "" - -#: library/cgi.rst:92 -msgid "" -"This activates a special exception handler that will display detailed " -"reports in the web browser if any errors occur. If you'd rather not show " -"the guts of your program to users of your script, you can have the reports " -"saved to files instead, with code like this::" -msgstr "" - -#: library/cgi.rst:97 -msgid "" -"import cgitb\n" -"cgitb.enable(display=0, logdir=\"/path/to/logdir\")" -msgstr "" - -#: library/cgi.rst:100 -msgid "" -"It's very helpful to use this feature during script development. The reports " -"produced by :mod:`cgitb` provide information that can save you a lot of time " -"in tracking down bugs. You can always remove the ``cgitb`` line later when " -"you have tested your script and are confident that it works correctly." -msgstr "" - -#: library/cgi.rst:105 -msgid "" -"To get at submitted form data, use the :class:`FieldStorage` class. If the " -"form contains non-ASCII characters, use the *encoding* keyword parameter set " -"to the value of the encoding defined for the document. It is usually " -"contained in the META tag in the HEAD section of the HTML document or by " -"the :mailheader:`Content-Type` header. This reads the form contents from " -"the standard input or the environment (depending on the value of various " -"environment variables set according to the CGI standard). Since it may " -"consume standard input, it should be instantiated only once." -msgstr "" - -#: library/cgi.rst:114 -msgid "" -"The :class:`FieldStorage` instance can be indexed like a Python dictionary. " -"It allows membership testing with the :keyword:`in` operator, and also " -"supports the standard dictionary method :meth:`~dict.keys` and the built-in " -"function :func:`len`. Form fields containing empty strings are ignored and " -"do not appear in the dictionary; to keep such values, provide a true value " -"for the optional *keep_blank_values* keyword parameter when creating the :" -"class:`FieldStorage` instance." -msgstr "" - -#: library/cgi.rst:122 -msgid "" -"For instance, the following code (which assumes that the :mailheader:" -"`Content-Type` header and blank line have already been printed) checks that " -"the fields ``name`` and ``addr`` are both set to a non-empty string::" -msgstr "" - -#: library/cgi.rst:127 -msgid "" -"form = cgi.FieldStorage()\n" -"if \"name\" not in form or \"addr\" not in form:\n" -" print(\"

Error

\")\n" -" print(\"Please fill in the name and addr fields.\")\n" -" return\n" -"print(\"

name:\", form[\"name\"].value)\n" -"print(\"

addr:\", form[\"addr\"].value)\n" -"...further form processing here..." -msgstr "" - -#: library/cgi.rst:136 -msgid "" -"Here the fields, accessed through ``form[key]``, are themselves instances " -"of :class:`FieldStorage` (or :class:`MiniFieldStorage`, depending on the " -"form encoding). The :attr:`~FieldStorage.value` attribute of the instance " -"yields the string value of the field. The :meth:`~FieldStorage.getvalue` " -"method returns this string value directly; it also accepts an optional " -"second argument as a default to return if the requested key is not present." -msgstr "" - -#: library/cgi.rst:143 -msgid "" -"If the submitted form data contains more than one field with the same name, " -"the object retrieved by ``form[key]`` is not a :class:`FieldStorage` or :" -"class:`MiniFieldStorage` instance but a list of such instances. Similarly, " -"in this situation, ``form.getvalue(key)`` would return a list of strings. If " -"you expect this possibility (when your HTML form contains multiple fields " -"with the same name), use the :meth:`~FieldStorage.getlist` method, which " -"always returns a list of values (so that you do not need to special-case the " -"single item case). For example, this code concatenates any number of " -"username fields, separated by commas::" -msgstr "" - -#: library/cgi.rst:153 -msgid "" -"value = form.getlist(\"username\")\n" -"usernames = \",\".join(value)" -msgstr "" - -#: library/cgi.rst:156 -msgid "" -"If a field represents an uploaded file, accessing the value via the :attr:" -"`~FieldStorage.value` attribute or the :meth:`~FieldStorage.getvalue` method " -"reads the entire file in memory as bytes. This may not be what you want. " -"You can test for an uploaded file by testing either the :attr:`~FieldStorage." -"filename` attribute or the :attr:`~FieldStorage.file` attribute. You can " -"then read the data from the :attr:`!file` attribute before it is " -"automatically closed as part of the garbage collection of the :class:" -"`FieldStorage` instance (the :func:`~io.RawIOBase.read` and :func:`~io." -"IOBase.readline` methods will return bytes)::" -msgstr "" - -#: library/cgi.rst:167 -msgid "" -"fileitem = form[\"userfile\"]\n" -"if fileitem.file:\n" -" # It's an uploaded file; count lines\n" -" linecount = 0\n" -" while True:\n" -" line = fileitem.file.readline()\n" -" if not line: break\n" -" linecount = linecount + 1" -msgstr "" - -#: library/cgi.rst:176 -msgid "" -":class:`FieldStorage` objects also support being used in a :keyword:`with` " -"statement, which will automatically close them when done." -msgstr "" - -#: library/cgi.rst:179 -msgid "" -"If an error is encountered when obtaining the contents of an uploaded file " -"(for example, when the user interrupts the form submission by clicking on a " -"Back or Cancel button) the :attr:`~FieldStorage.done` attribute of the " -"object for the field will be set to the value -1." -msgstr "" - -#: library/cgi.rst:184 -msgid "" -"The file upload draft standard entertains the possibility of uploading " -"multiple files from one field (using a recursive :mimetype:`multipart/\\*` " -"encoding). When this occurs, the item will be a dictionary-like :class:" -"`FieldStorage` item. This can be determined by testing its :attr:`!type` " -"attribute, which should be :mimetype:`multipart/form-data` (or perhaps " -"another MIME type matching :mimetype:`multipart/\\*`). In this case, it can " -"be iterated over recursively just like the top-level form object." -msgstr "" - -#: library/cgi.rst:192 -msgid "" -"When a form is submitted in the \"old\" format (as the query string or as a " -"single data part of type :mimetype:`application/x-www-form-urlencoded`), the " -"items will actually be instances of the class :class:`MiniFieldStorage`. In " -"this case, the :attr:`!list`, :attr:`!file`, and :attr:`filename` attributes " -"are always ``None``." -msgstr "" - -#: library/cgi.rst:197 -msgid "" -"A form submitted via POST that also has a query string will contain both :" -"class:`FieldStorage` and :class:`MiniFieldStorage` items." -msgstr "" - -#: library/cgi.rst:200 -msgid "" -"The :attr:`~FieldStorage.file` attribute is automatically closed upon the " -"garbage collection of the creating :class:`FieldStorage` instance." -msgstr "" - -#: library/cgi.rst:204 -msgid "" -"Added support for the context management protocol to the :class:" -"`FieldStorage` class." -msgstr "" - -#: library/cgi.rst:210 -msgid "Higher Level Interface" -msgstr "" - -#: library/cgi.rst:212 -msgid "" -"The previous section explains how to read CGI form data using the :class:" -"`FieldStorage` class. This section describes a higher level interface which " -"was added to this class to allow one to do it in a more readable and " -"intuitive way. The interface doesn't make the techniques described in " -"previous sections obsolete --- they are still useful to process file uploads " -"efficiently, for example." -msgstr "" - -#: library/cgi.rst:221 -msgid "" -"The interface consists of two simple methods. Using the methods you can " -"process form data in a generic way, without the need to worry whether only " -"one or more values were posted under one name." -msgstr "" - -#: library/cgi.rst:225 -msgid "" -"In the previous section, you learned to write following code anytime you " -"expected a user to post more than one value under one name::" -msgstr "" - -#: library/cgi.rst:228 -msgid "" -"item = form.getvalue(\"item\")\n" -"if isinstance(item, list):\n" -" # The user is requesting more than one item.\n" -"else:\n" -" # The user is requesting only one item." -msgstr "" - -#: library/cgi.rst:234 -msgid "" -"This situation is common for example when a form contains a group of " -"multiple checkboxes with the same name::" -msgstr "" - -#: library/cgi.rst:237 -msgid "" -"\n" -"" -msgstr "" - -#: library/cgi.rst:240 -msgid "" -"In most situations, however, there's only one form control with a particular " -"name in a form and then you expect and need only one value associated with " -"this name. So you write a script containing for example this code::" -msgstr "" - -#: library/cgi.rst:244 -msgid "user = form.getvalue(\"user\").upper()" -msgstr "" - -#: library/cgi.rst:246 -msgid "" -"The problem with the code is that you should never expect that a client will " -"provide valid input to your scripts. For example, if a curious user appends " -"another ``user=foo`` pair to the query string, then the script would crash, " -"because in this situation the ``getvalue(\"user\")`` method call returns a " -"list instead of a string. Calling the :meth:`~str.upper` method on a list " -"is not valid (since lists do not have a method of this name) and results in " -"an :exc:`AttributeError` exception." -msgstr "" - -#: library/cgi.rst:254 -msgid "" -"Therefore, the appropriate way to read form data values was to always use " -"the code which checks whether the obtained value is a single value or a list " -"of values. That's annoying and leads to less readable scripts." -msgstr "" - -#: library/cgi.rst:258 -msgid "" -"A more convenient approach is to use the methods :meth:`~FieldStorage." -"getfirst` and :meth:`~FieldStorage.getlist` provided by this higher level " -"interface." -msgstr "" - -#: library/cgi.rst:264 -msgid "" -"This method always returns only one value associated with form field *name*. " -"The method returns only the first value in case that more values were posted " -"under such name. Please note that the order in which the values are " -"received may vary from browser to browser and should not be counted on. " -"[#]_ If no such form field or value exists then the method returns the " -"value specified by the optional parameter *default*. This parameter " -"defaults to ``None`` if not specified." -msgstr "" - -#: library/cgi.rst:275 -msgid "" -"This method always returns a list of values associated with form field " -"*name*. The method returns an empty list if no such form field or value " -"exists for *name*. It returns a list consisting of one item if only one " -"such value exists." -msgstr "" - -#: library/cgi.rst:279 -msgid "Using these methods you can write nice compact code::" -msgstr "" - -#: library/cgi.rst:281 -msgid "" -"import cgi\n" -"form = cgi.FieldStorage()\n" -"user = form.getfirst(\"user\", \"\").upper() # This way it's safe.\n" -"for item in form.getlist(\"item\"):\n" -" do_something(item)" -msgstr "" - -#: library/cgi.rst:291 -msgid "Functions" -msgstr "" - -#: library/cgi.rst:293 -msgid "" -"These are useful if you want more control, or if you want to employ some of " -"the algorithms implemented in this module in other circumstances." -msgstr "" - -#: library/cgi.rst:299 -msgid "" -"Parse a query in the environment or from a file (the file defaults to ``sys." -"stdin``). The *keep_blank_values*, *strict_parsing* and *separator* " -"parameters are passed to :func:`urllib.parse.parse_qs` unchanged." -msgstr "" - -#: library/cgi.rst:303 -msgid "" -"This function, like the rest of the :mod:`cgi` module, is deprecated. It can " -"be replaced by calling :func:`urllib.parse.parse_qs` directly on the desired " -"query string (except for ``multipart/form-data`` input, which can be handled " -"as described for :func:`parse_multipart`)." -msgstr "" - -#: library/cgi.rst:312 -msgid "" -"Parse input of type :mimetype:`multipart/form-data` (for file uploads). " -"Arguments are *fp* for the input file, *pdict* for a dictionary containing " -"other parameters in the :mailheader:`Content-Type` header, and *encoding*, " -"the request encoding." -msgstr "" - -#: library/cgi.rst:317 -msgid "" -"Returns a dictionary just like :func:`urllib.parse.parse_qs`: keys are the " -"field names, each value is a list of values for that field. For non-file " -"fields, the value is a list of strings." -msgstr "" - -#: library/cgi.rst:321 -msgid "" -"This is easy to use but not much good if you are expecting megabytes to be " -"uploaded --- in that case, use the :class:`FieldStorage` class instead which " -"is much more flexible." -msgstr "" - -#: library/cgi.rst:325 -msgid "" -"Added the *encoding* and *errors* parameters. For non-file fields, the " -"value is now a list of strings, not bytes." -msgstr "" - -#: library/cgi.rst:329 -msgid "Added the *separator* parameter." -msgstr "" - -#: library/cgi.rst:332 -msgid "" -"This function, like the rest of the :mod:`cgi` module, is deprecated. It can " -"be replaced with the functionality in the :mod:`email` package (e.g. :class:" -"`email.message.EmailMessage`/:class:`email.message.Message`) which " -"implements the same MIME RFCs, or with the :pypi:`multipart` PyPI project." -msgstr "" - -#: library/cgi.rst:342 -msgid "" -"Parse a MIME header (such as :mailheader:`Content-Type`) into a main value " -"and a dictionary of parameters." -msgstr "" - -#: library/cgi.rst:345 -msgid "" -"This function, like the rest of the :mod:`cgi` module, is deprecated. It can " -"be replaced with the functionality in the :mod:`email` package, which " -"implements the same MIME RFCs." -msgstr "" - -#: library/cgi.rst:350 -msgid "For example, with :class:`email.message.EmailMessage`::" -msgstr "" - -#: library/cgi.rst:352 -msgid "" -"from email.message import EmailMessage\n" -"msg = EmailMessage()\n" -"msg['content-type'] = 'application/json; charset=\"utf8\"'\n" -"main, params = msg.get_content_type(), msg['content-type'].params" -msgstr "" - -#: library/cgi.rst:360 -msgid "" -"Robust test CGI script, usable as main program. Writes minimal HTTP headers " -"and formats all information provided to the script in HTML format." -msgstr "" - -#: library/cgi.rst:366 -msgid "Format the shell environment in HTML." -msgstr "" - -#: library/cgi.rst:371 -msgid "Format a form in HTML." -msgstr "" - -#: library/cgi.rst:376 -msgid "Format the current directory in HTML." -msgstr "" - -#: library/cgi.rst:381 -msgid "Print a list of useful (used by CGI) environment variables in HTML." -msgstr "" - -#: library/cgi.rst:387 -msgid "Caring about security" -msgstr "" - -#: library/cgi.rst:391 -msgid "" -"There's one important rule: if you invoke an external program (via :func:`os." -"system`, :func:`os.popen` or other functions with similar functionality), " -"make very sure you don't pass arbitrary strings received from the client to " -"the shell. This is a well-known security hole whereby clever hackers " -"anywhere on the web can exploit a gullible CGI script to invoke arbitrary " -"shell commands. Even parts of the URL or field names cannot be trusted, " -"since the request doesn't have to come from your form!" -msgstr "" - -#: library/cgi.rst:399 -msgid "" -"To be on the safe side, if you must pass a string gotten from a form to a " -"shell command, you should make sure the string contains only alphanumeric " -"characters, dashes, underscores, and periods." -msgstr "" - -#: library/cgi.rst:405 -msgid "Installing your CGI script on a Unix system" -msgstr "" - -#: library/cgi.rst:407 -msgid "" -"Read the documentation for your HTTP server and check with your local system " -"administrator to find the directory where CGI scripts should be installed; " -"usually this is in a directory :file:`cgi-bin` in the server tree." -msgstr "" - -#: library/cgi.rst:411 -msgid "" -"Make sure that your script is readable and executable by \"others\"; the " -"Unix file mode should be ``0o755`` octal (use ``chmod 0755 filename``). " -"Make sure that the first line of the script contains ``#!`` starting in " -"column 1 followed by the pathname of the Python interpreter, for instance::" -msgstr "" - -#: library/cgi.rst:416 -msgid "#!/usr/local/bin/python" -msgstr "" - -#: library/cgi.rst:418 -msgid "" -"Make sure the Python interpreter exists and is executable by \"others\"." -msgstr "" - -#: library/cgi.rst:420 -msgid "" -"Make sure that any files your script needs to read or write are readable or " -"writable, respectively, by \"others\" --- their mode should be ``0o644`` for " -"readable and ``0o666`` for writable. This is because, for security reasons, " -"the HTTP server executes your script as user \"nobody\", without any special " -"privileges. It can only read (write, execute) files that everybody can read " -"(write, execute). The current directory at execution time is also different " -"(it is usually the server's cgi-bin directory) and the set of environment " -"variables is also different from what you get when you log in. In " -"particular, don't count on the shell's search path for executables (:envvar:" -"`PATH`) or the Python module search path (:envvar:`PYTHONPATH`) to be set to " -"anything interesting." -msgstr "" - -#: library/cgi.rst:431 -msgid "" -"If you need to load modules from a directory which is not on Python's " -"default module search path, you can change the path in your script, before " -"importing other modules. For example::" -msgstr "" - -#: library/cgi.rst:435 -msgid "" -"import sys\n" -"sys.path.insert(0, \"/usr/home/joe/lib/python\")\n" -"sys.path.insert(0, \"/usr/local/lib/python\")" -msgstr "" - -#: library/cgi.rst:439 -msgid "(This way, the directory inserted last will be searched first!)" -msgstr "" - -#: library/cgi.rst:441 -msgid "" -"Instructions for non-Unix systems will vary; check your HTTP server's " -"documentation (it will usually have a section on CGI scripts)." -msgstr "" - -#: library/cgi.rst:446 -msgid "Testing your CGI script" -msgstr "" - -#: library/cgi.rst:448 -msgid "" -"Unfortunately, a CGI script will generally not run when you try it from the " -"command line, and a script that works perfectly from the command line may " -"fail mysteriously when run from the server. There's one reason why you " -"should still test your script from the command line: if it contains a syntax " -"error, the Python interpreter won't execute it at all, and the HTTP server " -"will most likely send a cryptic error to the client." -msgstr "" - -#: library/cgi.rst:455 -msgid "" -"Assuming your script has no syntax errors, yet it does not work, you have no " -"choice but to read the next section." -msgstr "" - -#: library/cgi.rst:460 -msgid "Debugging CGI scripts" -msgstr "" - -#: library/cgi.rst:464 -msgid "" -"First of all, check for trivial installation errors --- reading the section " -"above on installing your CGI script carefully can save you a lot of time. " -"If you wonder whether you have understood the installation procedure " -"correctly, try installing a copy of this module file (:file:`cgi.py`) as a " -"CGI script. When invoked as a script, the file will dump its environment " -"and the contents of the form in HTML format. Give it the right mode etc., " -"and send it a request. If it's installed in the standard :file:`cgi-bin` " -"directory, it should be possible to send it a request by entering a URL into " -"your browser of the form:" -msgstr "" - -#: library/cgi.rst:473 -msgid "http://yourhostname/cgi-bin/cgi.py?name=Joe+Blow&addr=At+Home" -msgstr "" - -#: library/cgi.rst:477 -msgid "" -"If this gives an error of type 404, the server cannot find the script -- " -"perhaps you need to install it in a different directory. If it gives " -"another error, there's an installation problem that you should fix before " -"trying to go any further. If you get a nicely formatted listing of the " -"environment and form content (in this example, the fields should be listed " -"as \"addr\" with value \"At Home\" and \"name\" with value \"Joe Blow\"), " -"the :file:`cgi.py` script has been installed correctly. If you follow the " -"same procedure for your own script, you should now be able to debug it." -msgstr "" - -#: library/cgi.rst:486 -msgid "" -"The next step could be to call the :mod:`cgi` module's :func:`test` function " -"from your script: replace its main code with the single statement ::" -msgstr "" - -#: library/cgi.rst:489 -msgid "cgi.test()" -msgstr "" - -#: library/cgi.rst:491 -msgid "" -"This should produce the same results as those gotten from installing the :" -"file:`cgi.py` file itself." -msgstr "" - -#: library/cgi.rst:494 -msgid "" -"When an ordinary Python script raises an unhandled exception (for whatever " -"reason: of a typo in a module name, a file that can't be opened, etc.), the " -"Python interpreter prints a nice traceback and exits. While the Python " -"interpreter will still do this when your CGI script raises an exception, " -"most likely the traceback will end up in one of the HTTP server's log files, " -"or be discarded altogether." -msgstr "" - -#: library/cgi.rst:501 -msgid "" -"Fortunately, once you have managed to get your script to execute *some* " -"code, you can easily send tracebacks to the web browser using the :mod:" -"`cgitb` module. If you haven't done so already, just add the lines::" -msgstr "" - -#: library/cgi.rst:508 -msgid "" -"to the top of your script. Then try running it again; when a problem " -"occurs, you should see a detailed report that will likely make apparent the " -"cause of the crash." -msgstr "" - -#: library/cgi.rst:512 -msgid "" -"If you suspect that there may be a problem in importing the :mod:`cgitb` " -"module, you can use an even more robust approach (which only uses built-in " -"modules)::" -msgstr "" - -#: library/cgi.rst:515 -msgid "" -"import sys\n" -"sys.stderr = sys.stdout\n" -"print(\"Content-Type: text/plain\")\n" -"print()\n" -"...your code here..." -msgstr "" - -#: library/cgi.rst:521 -msgid "" -"This relies on the Python interpreter to print the traceback. The content " -"type of the output is set to plain text, which disables all HTML " -"processing. If your script works, the raw HTML will be displayed by your " -"client. If it raises an exception, most likely after the first two lines " -"have been printed, a traceback will be displayed. Because no HTML " -"interpretation is going on, the traceback will be readable." -msgstr "" - -#: library/cgi.rst:530 -msgid "Common problems and solutions" -msgstr "" - -#: library/cgi.rst:532 -msgid "" -"Most HTTP servers buffer the output from CGI scripts until the script is " -"completed. This means that it is not possible to display a progress report " -"on the client's display while the script is running." -msgstr "" - -#: library/cgi.rst:536 -msgid "Check the installation instructions above." -msgstr "" - -#: library/cgi.rst:538 -msgid "" -"Check the HTTP server's log files. (``tail -f logfile`` in a separate " -"window may be useful!)" -msgstr "" - -#: library/cgi.rst:541 -msgid "" -"Always check a script for syntax errors first, by doing something like " -"``python script.py``." -msgstr "" - -#: library/cgi.rst:544 -msgid "" -"If your script does not have any syntax errors, try adding ``import cgitb; " -"cgitb.enable()`` to the top of the script." -msgstr "" - -#: library/cgi.rst:547 -msgid "" -"When invoking external programs, make sure they can be found. Usually, this " -"means using absolute path names --- :envvar:`PATH` is usually not set to a " -"very useful value in a CGI script." -msgstr "" - -#: library/cgi.rst:551 +#: library/cgi.rst:10 msgid "" -"When reading or writing external files, make sure they can be read or " -"written by the userid under which your CGI script will be running: this is " -"typically the userid under which the web server is running, or some " -"explicitly specified userid for a web server's ``suexec`` feature." +"This module is no longer part of the Python standard library. It was :ref:" +"`removed in Python 3.13 ` after being deprecated in " +"Python 3.11. The removal was decided in :pep:`594`." msgstr "" -#: library/cgi.rst:556 +#: library/cgi.rst:14 msgid "" -"Don't try to give a CGI script a set-uid mode. This doesn't work on most " -"systems, and is a security liability as well." -msgstr "" - -#: library/cgi.rst:560 -msgid "Footnotes" +"A fork of the module on PyPI can be used instead: :pypi:`legacy-cgi`. This " +"is a copy of the cgi module, no longer maintained or supported by the core " +"Python team." msgstr "" -#: library/cgi.rst:561 +#: library/cgi.rst:18 msgid "" -"Note that some recent versions of the HTML specification do state what order " -"the field values should be supplied in, but knowing whether a request was " -"received from a conforming browser, or even from a browser at all, is " -"tedious and error-prone." -msgstr "" - -#: library/cgi.rst:10 -msgid "WWW" -msgstr "" - -#: library/cgi.rst:10 -msgid "server" -msgstr "" - -#: library/cgi.rst:389 library/cgi.rst:462 -msgid "CGI" -msgstr "" - -#: library/cgi.rst:10 -msgid "protocol" -msgstr "" - -#: library/cgi.rst:10 -msgid "HTTP" -msgstr "" - -#: library/cgi.rst:10 -msgid "MIME" -msgstr "" - -#: library/cgi.rst:10 -msgid "headers" -msgstr "" - -#: library/cgi.rst:10 -msgid "URL" -msgstr "" - -#: library/cgi.rst:10 -msgid "Common Gateway Interface" -msgstr "" - -#: library/cgi.rst:389 -msgid "security" -msgstr "" - -#: library/cgi.rst:462 -msgid "debugging" +"The last version of Python that provided the :mod:`!cgi` module was `Python " +"3.12 `_." msgstr "" diff --git a/library/cgitb.po b/library/cgitb.po index 2ac7063a..32541dd1 100644 --- a/library/cgitb.po +++ b/library/cgitb.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -18,115 +18,25 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" #: library/cgitb.rst:2 -msgid ":mod:`cgitb` --- Traceback manager for CGI scripts" +msgid ":mod:`!cgitb` --- Traceback manager for CGI scripts" msgstr "" -#: library/cgitb.rst:11 -msgid "**Source code:** :source:`Lib/cgitb.py`" -msgstr "" - -#: library/cgitb.rst:19 -msgid "" -"The :mod:`cgitb` module is deprecated (see :pep:`PEP 594 <594#cgitb>` for " -"details)." -msgstr "" - -#: library/cgitb.rst:25 -msgid "" -"The :mod:`cgitb` module provides a special exception handler for Python " -"scripts. (Its name is a bit misleading. It was originally designed to " -"display extensive traceback information in HTML for CGI scripts. It was " -"later generalized to also display this information in plain text.) After " -"this module is activated, if an uncaught exception occurs, a detailed, " -"formatted report will be displayed. The report includes a traceback showing " -"excerpts of the source code for each level, as well as the values of the " -"arguments and local variables to currently running functions, to help you " -"debug the problem. Optionally, you can save this information to a file " -"instead of sending it to the browser." -msgstr "" - -#: library/cgitb.rst:35 -msgid "To enable this feature, simply add this to the top of your CGI script::" -msgstr "" - -#: library/cgitb.rst:37 -msgid "" -"import cgitb\n" -"cgitb.enable()" -msgstr "" - -#: library/cgitb.rst:40 -msgid "" -"The options to the :func:`enable` function control whether the report is " -"displayed in the browser and whether the report is logged to a file for " -"later analysis." -msgstr "" - -#: library/cgitb.rst:49 +#: library/cgitb.rst:10 msgid "" -"This function causes the :mod:`cgitb` module to take over the interpreter's " -"default handling for exceptions by setting the value of :attr:`sys." -"excepthook`." +"This module is no longer part of the Python standard library. It was :ref:" +"`removed in Python 3.13 ` after being deprecated in " +"Python 3.11. The removal was decided in :pep:`594`." msgstr "" -#: library/cgitb.rst:52 +#: library/cgitb.rst:14 msgid "" -"The optional argument *display* defaults to ``1`` and can be set to ``0`` to " -"suppress sending the traceback to the browser. If the argument *logdir* is " -"present, the traceback reports are written to files. The value of *logdir* " -"should be a directory where these files will be placed. The optional " -"argument *context* is the number of lines of context to display around the " -"current line of source code in the traceback; this defaults to ``5``. If the " -"optional argument *format* is ``\"html\"``, the output is formatted as " -"HTML. Any other value forces plain text output. The default value is " -"``\"html\"``." +"A fork of the module on PyPI can now be used instead: :pypi:`legacy-cgi`. " +"This is a copy of the cgi module, no longer maintained or supported by the " +"core Python team." msgstr "" -#: library/cgitb.rst:64 +#: library/cgitb.rst:18 msgid "" -"This function handles the exception described by *info* (a 3-tuple " -"containing the result of :func:`sys.exc_info`), formatting its traceback as " -"text and returning the result as a string. The optional argument *context* " -"is the number of lines of context to display around the current line of " -"source code in the traceback; this defaults to ``5``." -msgstr "" - -#: library/cgitb.rst:73 -msgid "" -"This function handles the exception described by *info* (a 3-tuple " -"containing the result of :func:`sys.exc_info`), formatting its traceback as " -"HTML and returning the result as a string. The optional argument *context* " -"is the number of lines of context to display around the current line of " -"source code in the traceback; this defaults to ``5``." -msgstr "" - -#: library/cgitb.rst:82 -msgid "" -"This function handles an exception using the default settings (that is, show " -"a report in the browser, but don't log to a file). This can be used when " -"you've caught an exception and want to report it using :mod:`cgitb`. The " -"optional *info* argument should be a 3-tuple containing an exception type, " -"exception value, and traceback object, exactly like the tuple returned by :" -"func:`sys.exc_info`. If the *info* argument is not supplied, the current " -"exception is obtained from :func:`sys.exc_info`." -msgstr "" - -#: library/cgitb.rst:13 -msgid "CGI" -msgstr "" - -#: library/cgitb.rst:13 -msgid "exceptions" -msgstr "" - -#: library/cgitb.rst:13 -msgid "tracebacks" -msgstr "" - -#: library/cgitb.rst:13 -msgid "in CGI scripts" -msgstr "" - -#: library/cgitb.rst:47 -msgid "excepthook() (in module sys)" +"The last version of Python that provided the :mod:`!cgitb` module was " +"`Python 3.12 `_." msgstr "" diff --git a/library/chunk.po b/library/chunk.po index e6107364..0cd51687 100644 --- a/library/chunk.po +++ b/library/chunk.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -18,205 +18,18 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" #: library/chunk.rst:2 -msgid ":mod:`chunk` --- Read IFF chunked data" +msgid ":mod:`!chunk` --- Read IFF chunked data" msgstr "" -#: library/chunk.rst:11 -msgid "**Source code:** :source:`Lib/chunk.py`" -msgstr "" - -#: library/chunk.rst:20 -msgid "" -"The :mod:`chunk` module is deprecated (see :pep:`PEP 594 <594#chunk>` for " -"details)." -msgstr "" - -#: library/chunk.rst:26 -msgid "" -"This module provides an interface for reading files that use EA IFF 85 " -"chunks. [#]_ This format is used in at least the Audio Interchange File " -"Format (AIFF/AIFF-C) and the Real Media File Format (RMFF). The WAVE audio " -"file format is closely related and can also be read using this module." -msgstr "" - -#: library/chunk.rst:31 -msgid "A chunk has the following structure:" -msgstr "" - -#: library/chunk.rst:34 -msgid "Offset" -msgstr "" - -#: library/chunk.rst:34 -msgid "Length" -msgstr "" - -#: library/chunk.rst:34 -msgid "Contents" -msgstr "" - -#: library/chunk.rst:36 -msgid "0" -msgstr "" - -#: library/chunk.rst:38 -msgid "4" -msgstr "" - -#: library/chunk.rst:36 -msgid "Chunk ID" -msgstr "" - -#: library/chunk.rst:38 -msgid "Size of chunk in big-endian byte order, not including the header" -msgstr "" - -#: library/chunk.rst:42 -msgid "8" -msgstr "" - -#: library/chunk.rst:42 -msgid "*n*" -msgstr "" - -#: library/chunk.rst:42 -msgid "Data bytes, where *n* is the size given in the preceding field" -msgstr "" - -#: library/chunk.rst:46 -msgid "8 + *n*" -msgstr "" - -#: library/chunk.rst:46 -msgid "0 or 1" -msgstr "" - -#: library/chunk.rst:46 -msgid "Pad byte needed if *n* is odd and chunk alignment is used" -msgstr "" - -#: library/chunk.rst:50 -msgid "The ID is a 4-byte string which identifies the type of chunk." -msgstr "" - -#: library/chunk.rst:52 -msgid "" -"The size field (a 32-bit value, encoded using big-endian byte order) gives " -"the size of the chunk data, not including the 8-byte header." -msgstr "" - -#: library/chunk.rst:55 +#: library/chunk.rst:10 msgid "" -"Usually an IFF-type file consists of one or more chunks. The proposed usage " -"of the :class:`Chunk` class defined here is to instantiate an instance at " -"the start of each chunk and read from the instance until it reaches the end, " -"after which a new instance can be instantiated. At the end of the file, " -"creating a new instance will fail with an :exc:`EOFError` exception." +"This module is no longer part of the Python standard library. It was :ref:" +"`removed in Python 3.13 ` after being deprecated in " +"Python 3.11. The removal was decided in :pep:`594`." msgstr "" -#: library/chunk.rst:64 +#: library/chunk.rst:14 msgid "" -"Class which represents a chunk. The *file* argument is expected to be a " -"file-like object. An instance of this class is specifically allowed. The " -"only method that is needed is :meth:`~io.IOBase.read`. If the methods :meth:" -"`~io.IOBase.seek` and :meth:`~io.IOBase.tell` are present and don't raise an " -"exception, they are also used. If these methods are present and raise an " -"exception, they are expected to not have altered the object. If the " -"optional argument *align* is true, chunks are assumed to be aligned on 2-" -"byte boundaries. If *align* is false, no alignment is assumed. The default " -"value is true. If the optional argument *bigendian* is false, the chunk " -"size is assumed to be in little-endian order. This is needed for WAVE audio " -"files. The default value is true. If the optional argument *inclheader* is " -"true, the size given in the chunk header includes the size of the header. " -"The default value is false." -msgstr "" - -#: library/chunk.rst:78 -msgid "A :class:`Chunk` object supports the following methods:" -msgstr "" - -#: library/chunk.rst:83 -msgid "" -"Returns the name (ID) of the chunk. This is the first 4 bytes of the chunk." -msgstr "" - -#: library/chunk.rst:89 -msgid "Returns the size of the chunk." -msgstr "" - -#: library/chunk.rst:94 -msgid "" -"Close and skip to the end of the chunk. This does not close the underlying " -"file." -msgstr "" - -#: library/chunk.rst:97 -msgid "" -"The remaining methods will raise :exc:`OSError` if called after the :meth:" -"`close` method has been called. Before Python 3.3, they used to raise :exc:" -"`IOError`, now an alias of :exc:`OSError`." -msgstr "" - -#: library/chunk.rst:104 -msgid "Returns ``False``." -msgstr "" - -#: library/chunk.rst:109 -msgid "" -"Set the chunk's current position. The *whence* argument is optional and " -"defaults to ``0`` (absolute file positioning); other values are ``1`` (seek " -"relative to the current position) and ``2`` (seek relative to the file's " -"end). There is no return value. If the underlying file does not allow seek, " -"only forward seeks are allowed." -msgstr "" - -#: library/chunk.rst:118 -msgid "Return the current position into the chunk." -msgstr "" - -#: library/chunk.rst:123 -msgid "" -"Read at most *size* bytes from the chunk (less if the read hits the end of " -"the chunk before obtaining *size* bytes). If the *size* argument is " -"negative or omitted, read all data until the end of the chunk. An empty " -"bytes object is returned when the end of the chunk is encountered " -"immediately." -msgstr "" - -#: library/chunk.rst:132 -msgid "" -"Skip to the end of the chunk. All further calls to :meth:`read` for the " -"chunk will return ``b''``. If you are not interested in the contents of the " -"chunk, this method should be called so that the file points to the start of " -"the next chunk." -msgstr "" - -#: library/chunk.rst:139 -msgid "Footnotes" -msgstr "" - -#: library/chunk.rst:140 -msgid "" -"\"EA IFF 85\" Standard for Interchange Format Files, Jerry Morrison, " -"Electronic Arts, January 1985." -msgstr "" - -#: library/chunk.rst:13 -msgid "Audio Interchange File Format" -msgstr "" - -#: library/chunk.rst:13 -msgid "AIFF" -msgstr "" - -#: library/chunk.rst:13 -msgid "AIFF-C" -msgstr "" - -#: library/chunk.rst:13 -msgid "Real Media File Format" -msgstr "" - -#: library/chunk.rst:13 -msgid "RMFF" +"The last version of Python that provided the :mod:`!chunk` module was " +"`Python 3.12 `_." msgstr "" diff --git a/library/cmath.po b/library/cmath.po index ae31f2ec..7717be51 100644 --- a/library/cmath.po +++ b/library/cmath.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" diff --git a/library/cmd.po b/library/cmd.po index 76a9e993..08bceb54 100644 --- a/library/cmd.po +++ b/library/cmd.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -52,41 +52,54 @@ msgstr "" #: library/cmd.rst:29 msgid "" +"The default, ``'tab'``, is treated specially, so that it refers to the :kbd:" +"`Tab` key on every :data:`readline.backend`. Specifically, if :data:" +"`readline.backend` is ``editline``, ``Cmd`` will use ``'^I'`` instead of " +"``'tab'``. Note that other values are not treated this way, and might only " +"work with a specific backend." +msgstr "" + +#: library/cmd.rst:36 +msgid "" "The optional arguments *stdin* and *stdout* specify the input and output " "file objects that the Cmd instance or subclass instance will use for input " "and output. If not specified, they will default to :data:`sys.stdin` and :" "data:`sys.stdout`." msgstr "" -#: library/cmd.rst:34 +#: library/cmd.rst:41 msgid "" "If you want a given *stdin* to be used, make sure to set the instance's :" "attr:`use_rawinput` attribute to ``False``, otherwise *stdin* will be " "ignored." msgstr "" -#: library/cmd.rst:42 +#: library/cmd.rst:45 +msgid "``completekey='tab'`` is replaced by ``'^I'`` for ``editline``." +msgstr "" + +#: library/cmd.rst:52 msgid "Cmd Objects" msgstr "" -#: library/cmd.rst:44 +#: library/cmd.rst:54 msgid "A :class:`Cmd` instance has the following methods:" msgstr "" -#: library/cmd.rst:49 +#: library/cmd.rst:59 msgid "" "Repeatedly issue a prompt, accept input, parse an initial prefix off the " "received input, and dispatch to action methods, passing them the remainder " "of the line as argument." msgstr "" -#: library/cmd.rst:53 +#: library/cmd.rst:63 msgid "" "The optional argument is a banner or intro string to be issued before the " "first prompt (this overrides the :attr:`intro` class attribute)." msgstr "" -#: library/cmd.rst:56 +#: library/cmd.rst:66 msgid "" "If the :mod:`readline` module is loaded, input will automatically inherit :" "program:`bash`\\ -like history-list editing (e.g. :kbd:`Control-P` scrolls " @@ -95,11 +108,11 @@ msgid "" "B` moves the cursor to the left non-destructively, etc.)." msgstr "" -#: library/cmd.rst:62 +#: library/cmd.rst:72 msgid "An end-of-file on input is passed back as the string ``'EOF'``." msgstr "" -#: library/cmd.rst:68 +#: library/cmd.rst:78 msgid "" "An interpreter instance will recognize a command name ``foo`` if and only if " "it has a method :meth:`!do_foo`. As a special case, a line beginning with " @@ -108,14 +121,14 @@ msgid "" "dispatched to the method :meth:`!do_shell` (if such a method is defined)." msgstr "" -#: library/cmd.rst:74 +#: library/cmd.rst:84 msgid "" "This method will return when the :meth:`postcmd` method returns a true " "value. The *stop* argument to :meth:`postcmd` is the return value from the " "command's corresponding :meth:`!do_\\*` method." msgstr "" -#: library/cmd.rst:78 +#: library/cmd.rst:88 msgid "" "If completion is enabled, completing commands will be done automatically, " "and completing of commands args is done by calling :meth:`!complete_foo` " @@ -127,7 +140,7 @@ msgid "" "the argument is in." msgstr "" -#: library/cmd.rst:89 +#: library/cmd.rst:99 msgid "" "All subclasses of :class:`Cmd` inherit a predefined :meth:`!do_help`. This " "method, called with an argument ``'bar'``, invokes the corresponding method :" @@ -138,7 +151,7 @@ msgid "" "undocumented commands." msgstr "" -#: library/cmd.rst:100 +#: library/cmd.rst:110 msgid "" "Interpret the argument as though it had been typed in response to the " "prompt. This may be overridden, but should not normally need to be; see the :" @@ -149,32 +162,32 @@ msgid "" "return value from the :meth:`default` method is returned." msgstr "" -#: library/cmd.rst:111 +#: library/cmd.rst:121 msgid "" "Method called when an empty line is entered in response to the prompt. If " "this method is not overridden, it repeats the last nonempty command entered." msgstr "" -#: library/cmd.rst:117 +#: library/cmd.rst:127 msgid "" "Method called on an input line when the command prefix is not recognized. If " "this method is not overridden, it prints an error message and returns." msgstr "" -#: library/cmd.rst:123 +#: library/cmd.rst:133 msgid "" "Method called to complete an input line when no command-specific :meth:`!" "complete_\\*` method is available. By default, it returns an empty list." msgstr "" -#: library/cmd.rst:129 +#: library/cmd.rst:139 msgid "" "Method called to display a list of strings as a compact set of columns. Each " "column is only as wide as necessary. Columns are separated by two spaces for " "readability." msgstr "" -#: library/cmd.rst:136 +#: library/cmd.rst:146 msgid "" "Hook method executed just before the command line *line* is interpreted, but " "after the input prompt is generated and issued. This method is a stub in :" @@ -184,7 +197,7 @@ msgid "" "*line* unchanged." msgstr "" -#: library/cmd.rst:146 +#: library/cmd.rst:156 msgid "" "Hook method executed just after a command dispatch is finished. This method " "is a stub in :class:`Cmd`; it exists to be overridden by subclasses. *line* " @@ -195,74 +208,74 @@ msgid "" "corresponds to *stop*; returning false will cause interpretation to continue." msgstr "" -#: library/cmd.rst:157 +#: library/cmd.rst:167 msgid "" "Hook method executed once when :meth:`cmdloop` is called. This method is a " "stub in :class:`Cmd`; it exists to be overridden by subclasses." msgstr "" -#: library/cmd.rst:163 +#: library/cmd.rst:173 msgid "" "Hook method executed once when :meth:`cmdloop` is about to return. This " "method is a stub in :class:`Cmd`; it exists to be overridden by subclasses." msgstr "" -#: library/cmd.rst:167 +#: library/cmd.rst:177 msgid "" "Instances of :class:`Cmd` subclasses have some public instance variables:" msgstr "" -#: library/cmd.rst:171 +#: library/cmd.rst:181 msgid "The prompt issued to solicit input." msgstr "" -#: library/cmd.rst:176 +#: library/cmd.rst:186 msgid "The string of characters accepted for the command prefix." msgstr "" -#: library/cmd.rst:181 +#: library/cmd.rst:191 msgid "The last nonempty command prefix seen." msgstr "" -#: library/cmd.rst:186 +#: library/cmd.rst:196 msgid "" "A list of queued input lines. The cmdqueue list is checked in :meth:" "`cmdloop` when new input is needed; if it is nonempty, its elements will be " "processed in order, as if entered at the prompt." msgstr "" -#: library/cmd.rst:193 +#: library/cmd.rst:203 msgid "" "A string to issue as an intro or banner. May be overridden by giving the :" "meth:`cmdloop` method an argument." msgstr "" -#: library/cmd.rst:199 +#: library/cmd.rst:209 msgid "" "The header to issue if the help output has a section for documented commands." msgstr "" -#: library/cmd.rst:204 +#: library/cmd.rst:214 msgid "" "The header to issue if the help output has a section for miscellaneous help " "topics (that is, there are :meth:`!help_\\*` methods without corresponding :" "meth:`!do_\\*` methods)." msgstr "" -#: library/cmd.rst:211 +#: library/cmd.rst:221 msgid "" "The header to issue if the help output has a section for undocumented " "commands (that is, there are :meth:`!do_\\*` methods without corresponding :" "meth:`!help_\\*` methods)." msgstr "" -#: library/cmd.rst:218 +#: library/cmd.rst:228 msgid "" "The character used to draw separator lines under the help-message headers. " "If empty, no ruler line is drawn. It defaults to ``'='``." msgstr "" -#: library/cmd.rst:224 +#: library/cmd.rst:234 msgid "" "A flag, defaulting to true. If true, :meth:`cmdloop` uses :func:`input` to " "display a prompt and read the next command; if false, :data:`sys.stdout." @@ -272,23 +285,23 @@ msgid "" "editing and command-history keystrokes.)" msgstr "" -#: library/cmd.rst:234 +#: library/cmd.rst:244 msgid "Cmd Example" msgstr "" -#: library/cmd.rst:238 +#: library/cmd.rst:248 msgid "" "The :mod:`cmd` module is mainly useful for building custom shells that let a " "user work with a program interactively." msgstr "" -#: library/cmd.rst:241 +#: library/cmd.rst:251 msgid "" "This section presents a simple example of how to build a shell around a few " "of the commands in the :mod:`turtle` module." msgstr "" -#: library/cmd.rst:244 +#: library/cmd.rst:254 msgid "" "Basic turtle commands such as :meth:`~turtle.forward` are added to a :class:" "`Cmd` subclass with method named :meth:`!do_forward`. The argument is " @@ -296,7 +309,7 @@ msgid "" "used in the help utility provided by the shell." msgstr "" -#: library/cmd.rst:249 +#: library/cmd.rst:259 msgid "" "The example also includes a basic record and playback facility implemented " "with the :meth:`~Cmd.precmd` method which is responsible for converting the " @@ -305,7 +318,7 @@ msgid "" "attr:`~Cmd.cmdqueue` for immediate playback::" msgstr "" -#: library/cmd.rst:255 +#: library/cmd.rst:265 msgid "" "import cmd, sys\n" "from turtle import *\n" @@ -385,14 +398,14 @@ msgid "" " TurtleShell().cmdloop()" msgstr "" -#: library/cmd.rst:330 +#: library/cmd.rst:340 msgid "" "Here is a sample session with the turtle shell showing the help functions, " "using blank lines to repeat commands, and the simple record and playback " "facility:" msgstr "" -#: library/cmd.rst:333 +#: library/cmd.rst:343 msgid "" "Welcome to the turtle shell. Type help or ? to list commands.\n" "\n" @@ -453,14 +466,14 @@ msgid "" "Thank you for using Turtle" msgstr "" -#: library/cmd.rst:64 +#: library/cmd.rst:74 msgid "? (question mark)" msgstr "" -#: library/cmd.rst:64 +#: library/cmd.rst:74 msgid "in a command interpreter" msgstr "" -#: library/cmd.rst:64 +#: library/cmd.rst:74 msgid "! (exclamation)" msgstr "" diff --git a/library/cmdline.po b/library/cmdline.po index 26a465d8..467d70fd 100644 --- a/library/cmdline.po +++ b/library/cmdline.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -122,7 +122,7 @@ msgid ":ref:`pickletools `" msgstr "" #: library/cmdline.rst:31 -msgid ":mod:`platform`" +msgid ":ref:`platform `" msgstr "" #: library/cmdline.rst:32 @@ -154,73 +154,81 @@ msgid ":mod:`quopri`" msgstr "" #: library/cmdline.rst:39 -msgid ":mod:`runpy`" +msgid ":ref:`random `" msgstr "" #: library/cmdline.rst:40 -msgid ":ref:`site `" +msgid ":mod:`runpy`" msgstr "" #: library/cmdline.rst:41 -msgid ":ref:`sqlite3 `" +msgid ":ref:`site `" msgstr "" #: library/cmdline.rst:42 -msgid ":ref:`sysconfig `" +msgid ":ref:`sqlite3 `" msgstr "" #: library/cmdline.rst:43 -msgid ":mod:`tabnanny`" +msgid ":ref:`symtable `" msgstr "" #: library/cmdline.rst:44 -msgid ":ref:`tarfile `" +msgid ":ref:`sysconfig `" msgstr "" #: library/cmdline.rst:45 -msgid ":mod:`!this`" +msgid ":mod:`tabnanny`" msgstr "" #: library/cmdline.rst:46 -msgid ":ref:`timeit `" +msgid ":ref:`tarfile `" msgstr "" #: library/cmdline.rst:47 -msgid ":ref:`tokenize `" +msgid ":mod:`!this`" msgstr "" #: library/cmdline.rst:48 -msgid ":ref:`trace `" +msgid ":ref:`timeit `" msgstr "" #: library/cmdline.rst:49 -msgid ":mod:`turtledemo`" +msgid ":ref:`tokenize `" msgstr "" #: library/cmdline.rst:50 -msgid ":ref:`unittest `" +msgid ":ref:`trace `" msgstr "" #: library/cmdline.rst:51 -msgid ":ref:`uuid `" +msgid ":mod:`turtledemo`" msgstr "" #: library/cmdline.rst:52 -msgid ":mod:`venv`" +msgid ":ref:`unittest `" msgstr "" #: library/cmdline.rst:53 -msgid ":mod:`webbrowser`" +msgid ":ref:`uuid `" msgstr "" #: library/cmdline.rst:54 -msgid ":ref:`zipapp `" +msgid ":mod:`venv`" msgstr "" #: library/cmdline.rst:55 -msgid ":ref:`zipfile `" +msgid ":mod:`webbrowser`" +msgstr "" + +#: library/cmdline.rst:56 +msgid ":ref:`zipapp `" msgstr "" #: library/cmdline.rst:57 +msgid ":ref:`zipfile `" +msgstr "" + +#: library/cmdline.rst:59 msgid "See also the :ref:`Python command-line interface `." msgstr "" diff --git a/library/cmdlinelibs.po b/library/cmdlinelibs.po new file mode 100644 index 00000000..48456645 --- /dev/null +++ b/library/cmdlinelibs.po @@ -0,0 +1,31 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) 2001-2025, Python Software Foundation +# This file is distributed under the same license as the Python package. +# FIRST AUTHOR , YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: Python 3.13\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#: library/cmdlinelibs.rst:5 +msgid "Command Line Interface Libraries" +msgstr "" + +#: library/cmdlinelibs.rst:7 +msgid "" +"The modules described in this chapter assist with implementing command line " +"and terminal interfaces for applications." +msgstr "" + +#: library/cmdlinelibs.rst:10 +msgid "Here's an overview:" +msgstr "" diff --git a/library/code.po b/library/code.po index 7a3212f4..fda4ece5 100644 --- a/library/code.po +++ b/library/code.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -37,35 +37,42 @@ msgid "" "This class deals with parsing and interpreter state (the user's namespace); " "it does not deal with input buffering or prompting or input file naming (the " "filename is always passed in explicitly). The optional *locals* argument " -"specifies the dictionary in which code will be executed; it defaults to a " -"newly created dictionary with key ``'__name__'`` set to ``'__console__'`` " -"and key ``'__doc__'`` set to ``None``." +"specifies a mapping to use as the namespace in which code will be executed; " +"it defaults to a newly created dictionary with key ``'__name__'`` set to " +"``'__console__'`` and key ``'__doc__'`` set to ``None``." msgstr "" #: library/code.rst:28 msgid "" "Closely emulate the behavior of the interactive Python interpreter. This " "class builds on :class:`InteractiveInterpreter` and adds prompting using the " -"familiar ``sys.ps1`` and ``sys.ps2``, and input buffering." +"familiar ``sys.ps1`` and ``sys.ps2``, and input buffering. If *local_exit* " +"is true, ``exit()`` and ``quit()`` in the console will not raise :exc:" +"`SystemExit`, but instead return to the calling code." msgstr "" -#: library/code.rst:35 +#: library/code.rst:52 +msgid "Added *local_exit* parameter." +msgstr "" + +#: library/code.rst:39 msgid "" "Convenience function to run a read-eval-print loop. This creates a new " "instance of :class:`InteractiveConsole` and sets *readfunc* to be used as " "the :meth:`InteractiveConsole.raw_input` method, if provided. If *local* is " "provided, it is passed to the :class:`InteractiveConsole` constructor for " -"use as the default namespace for the interpreter loop. The :meth:" -"`~InteractiveConsole.interact` method of the instance is then run with " +"use as the default namespace for the interpreter loop. If *local_exit* is " +"provided, it is passed to the :class:`InteractiveConsole` constructor. The :" +"meth:`~InteractiveConsole.interact` method of the instance is then run with " "*banner* and *exitmsg* passed as the banner and exit message to use, if " "provided. The console object is discarded after use." msgstr "" -#: library/code.rst:44 +#: library/code.rst:49 msgid "Added *exitmsg* parameter." msgstr "" -#: library/code.rst:50 +#: library/code.rst:57 msgid "" "This function is useful for programs that want to emulate Python's " "interpreter main loop (a.k.a. the read-eval-print loop). The tricky part is " @@ -75,7 +82,7 @@ msgid "" "real interpreter main loop." msgstr "" -#: library/code.rst:57 +#: library/code.rst:64 msgid "" "*source* is the source string; *filename* is the optional filename from " "which source was read, defaulting to ``''``; and *symbol* is the " @@ -83,7 +90,7 @@ msgid "" "``'eval'`` or ``'exec'``." msgstr "" -#: library/code.rst:62 +#: library/code.rst:69 msgid "" "Returns a code object (the same as ``compile(source, filename, symbol)``) if " "the command is complete and valid; ``None`` if the command is incomplete; " @@ -92,18 +99,18 @@ msgid "" "contains an invalid literal." msgstr "" -#: library/code.rst:72 +#: library/code.rst:79 msgid "Interactive Interpreter Objects" msgstr "" -#: library/code.rst:77 +#: library/code.rst:84 msgid "" "Compile and run some source in the interpreter. Arguments are the same as " "for :func:`compile_command`; the default for *filename* is ``''``, " "and for *symbol* is ``'single'``. One of several things can happen:" msgstr "" -#: library/code.rst:81 +#: library/code.rst:88 msgid "" "The input is incorrect; :func:`compile_command` raised an exception (:exc:" "`SyntaxError` or :exc:`OverflowError`). A syntax traceback will be printed " @@ -111,13 +118,13 @@ msgid "" "``False``." msgstr "" -#: library/code.rst:86 +#: library/code.rst:93 msgid "" "The input is incomplete, and more input is required; :func:`compile_command` " "returned ``None``. :meth:`runsource` returns ``True``." msgstr "" -#: library/code.rst:89 +#: library/code.rst:96 msgid "" "The input is complete; :func:`compile_command` returned a code object. The " "code is executed by calling the :meth:`runcode` (which also handles run-time " @@ -125,27 +132,27 @@ msgid "" "``False``." msgstr "" -#: library/code.rst:93 +#: library/code.rst:100 msgid "" "The return value can be used to decide whether to use ``sys.ps1`` or ``sys." "ps2`` to prompt the next line." msgstr "" -#: library/code.rst:99 +#: library/code.rst:106 msgid "" "Execute a code object. When an exception occurs, :meth:`showtraceback` is " "called to display a traceback. All exceptions are caught except :exc:" "`SystemExit`, which is allowed to propagate." msgstr "" -#: library/code.rst:103 +#: library/code.rst:110 msgid "" "A note about :exc:`KeyboardInterrupt`: this exception may occur elsewhere in " "this code, and may not always be caught. The caller should be prepared to " "deal with it." msgstr "" -#: library/code.rst:110 +#: library/code.rst:117 msgid "" "Display the syntax error that just occurred. This does not display a stack " "trace because there isn't one for syntax errors. If *filename* is given, it " @@ -154,38 +161,38 @@ msgid "" "string. The output is written by the :meth:`write` method." msgstr "" -#: library/code.rst:119 +#: library/code.rst:126 msgid "" "Display the exception that just occurred. We remove the first stack item " "because it is within the interpreter object implementation. The output is " "written by the :meth:`write` method." msgstr "" -#: library/code.rst:123 +#: library/code.rst:130 msgid "" "The full chained traceback is displayed instead of just the primary " "traceback." msgstr "" -#: library/code.rst:129 +#: library/code.rst:136 msgid "" "Write a string to the standard error stream (``sys.stderr``). Derived " "classes should override this to provide the appropriate output handling as " "needed." msgstr "" -#: library/code.rst:136 +#: library/code.rst:143 msgid "Interactive Console Objects" msgstr "" -#: library/code.rst:138 +#: library/code.rst:145 msgid "" "The :class:`InteractiveConsole` class is a subclass of :class:" "`InteractiveInterpreter`, and so offers all the methods of the interpreter " "objects as well as the following additions." msgstr "" -#: library/code.rst:145 +#: library/code.rst:152 msgid "" "Closely emulate the interactive Python console. The optional *banner* " "argument specify the banner to print before the first interaction; by " @@ -195,22 +202,22 @@ msgid "" "close!)." msgstr "" -#: library/code.rst:151 +#: library/code.rst:158 msgid "" "The optional *exitmsg* argument specifies an exit message printed when " "exiting. Pass the empty string to suppress the exit message. If *exitmsg* is " "not given or ``None``, a default message is printed." msgstr "" -#: library/code.rst:155 +#: library/code.rst:162 msgid "To suppress printing any banner, pass an empty string." msgstr "" -#: library/code.rst:158 +#: library/code.rst:165 msgid "Print an exit message when exiting." msgstr "" -#: library/code.rst:164 +#: library/code.rst:171 msgid "" "Push a line of source text to the interpreter. The line should not have a " "trailing newline; it may have internal newlines. The line is appended to a " @@ -223,11 +230,11 @@ msgid "" "same as :meth:`!runsource`)." msgstr "" -#: library/code.rst:176 +#: library/code.rst:183 msgid "Remove any unhandled source text from the input buffer." msgstr "" -#: library/code.rst:181 +#: library/code.rst:188 msgid "" "Write a prompt and read a line. The returned line does not include the " "trailing newline. When the user enters the EOF key sequence, :exc:" diff --git a/library/codecs.po b/library/codecs.po index fc84cfd2..18fbaa57 100644 --- a/library/codecs.po +++ b/library/codecs.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -365,7 +365,7 @@ msgstr "" msgid "Value" msgstr "" -#: library/codecs.rst:373 library/codecs.rst:1330 library/codecs.rst:1455 +#: library/codecs.rst:373 library/codecs.rst:1331 library/codecs.rst:1454 msgid "Meaning" msgstr "" @@ -1364,11 +1364,11 @@ msgstr "" msgid "an IBM PC code page, which is ASCII compatible" msgstr "" -#: library/codecs.rst:1330 library/codecs.rst:1455 +#: library/codecs.rst:1331 library/codecs.rst:1454 msgid "Codec" msgstr "" -#: library/codecs.rst:1330 library/codecs.rst:1455 +#: library/codecs.rst:1331 library/codecs.rst:1454 msgid "Aliases" msgstr "" @@ -1396,7 +1396,7 @@ msgstr "" msgid "big5-tw, csbig5" msgstr "" -#: library/codecs.rst:1081 library/codecs.rst:1139 +#: library/codecs.rst:1081 library/codecs.rst:1140 msgid "Traditional Chinese" msgstr "" @@ -1436,7 +1436,7 @@ msgstr "" msgid "EBCDIC-CP-HE, IBM424" msgstr "" -#: library/codecs.rst:1109 library/codecs.rst:1162 library/codecs.rst:1225 +#: library/codecs.rst:1109 library/codecs.rst:1163 library/codecs.rst:1226 msgid "Hebrew" msgstr "" @@ -1456,8 +1456,8 @@ msgstr "" msgid "EBCDIC-CP-BE, EBCDIC-CP-CH, IBM500" msgstr "" -#: library/codecs.rst:1102 library/codecs.rst:1149 library/codecs.rst:1209 -#: library/codecs.rst:1265 +#: library/codecs.rst:1102 library/codecs.rst:1150 library/codecs.rst:1210 +#: library/codecs.rst:1266 msgid "Western Europe" msgstr "" @@ -1465,7 +1465,7 @@ msgstr "" msgid "cp720" msgstr "" -#: library/codecs.rst:1123 library/codecs.rst:1221 +#: library/codecs.rst:1123 library/codecs.rst:1222 msgid "Arabic" msgstr "" @@ -1473,7 +1473,7 @@ msgstr "" msgid "cp737" msgstr "" -#: library/codecs.rst:1129 library/codecs.rst:1158 library/codecs.rst:1258 +#: library/codecs.rst:1129 library/codecs.rst:1159 library/codecs.rst:1259 msgid "Greek" msgstr "" @@ -1485,7 +1485,7 @@ msgstr "" msgid "IBM775" msgstr "" -#: library/codecs.rst:1166 library/codecs.rst:1233 +#: library/codecs.rst:1167 library/codecs.rst:1234 msgid "Baltic languages" msgstr "" @@ -1505,7 +1505,7 @@ msgstr "" msgid "852, IBM852" msgstr "" -#: library/codecs.rst:1151 library/codecs.rst:1262 +#: library/codecs.rst:1152 library/codecs.rst:1263 msgid "Central and Eastern Europe" msgstr "" @@ -1517,8 +1517,8 @@ msgstr "" msgid "855, IBM855" msgstr "" -#: library/codecs.rst:1153 library/codecs.rst:1255 -msgid "Bulgarian, Byelorussian, Macedonian, Russian, Serbian" +#: library/codecs.rst:1154 library/codecs.rst:1256 +msgid "Belarusian, Bulgarian, Macedonian, Russian, Serbian" msgstr "" #: library/codecs.rst:1109 @@ -1533,7 +1533,7 @@ msgstr "" msgid "857, IBM857" msgstr "" -#: library/codecs.rst:1143 library/codecs.rst:1227 library/codecs.rst:1267 +#: library/codecs.rst:1144 library/codecs.rst:1228 library/codecs.rst:1268 msgid "Turkish" msgstr "" @@ -1565,7 +1565,7 @@ msgstr "" msgid "861, CP-IS, IBM861" msgstr "" -#: library/codecs.rst:1260 +#: library/codecs.rst:1261 msgid "Icelandic" msgstr "" @@ -1617,7 +1617,7 @@ msgstr "" msgid "866, IBM866" msgstr "" -#: library/codecs.rst:1243 +#: library/codecs.rst:1244 msgid "Russian" msgstr "" @@ -1646,625 +1646,625 @@ msgid "cp932" msgstr "" #: library/codecs.rst:1135 -msgid "932, ms932, mskanji, ms-kanji" +msgid "932, ms932, mskanji, ms-kanji, windows-31j" msgstr "" -#: library/codecs.rst:1170 library/codecs.rst:1174 library/codecs.rst:1194 -#: library/codecs.rst:1202 library/codecs.rst:1272 library/codecs.rst:1278 +#: library/codecs.rst:1171 library/codecs.rst:1175 library/codecs.rst:1195 +#: library/codecs.rst:1203 library/codecs.rst:1273 library/codecs.rst:1279 msgid "Japanese" msgstr "" -#: library/codecs.rst:1137 +#: library/codecs.rst:1138 msgid "cp949" msgstr "" -#: library/codecs.rst:1137 +#: library/codecs.rst:1138 msgid "949, ms949, uhc" msgstr "" -#: library/codecs.rst:1176 library/codecs.rst:1241 +#: library/codecs.rst:1177 library/codecs.rst:1242 msgid "Korean" msgstr "" -#: library/codecs.rst:1139 +#: library/codecs.rst:1140 msgid "cp950" msgstr "" -#: library/codecs.rst:1139 +#: library/codecs.rst:1140 msgid "950, ms950" msgstr "" -#: library/codecs.rst:1141 +#: library/codecs.rst:1142 msgid "cp1006" msgstr "" -#: library/codecs.rst:1141 +#: library/codecs.rst:1142 msgid "Urdu" msgstr "" -#: library/codecs.rst:1143 +#: library/codecs.rst:1144 msgid "cp1026" msgstr "" -#: library/codecs.rst:1143 +#: library/codecs.rst:1144 msgid "ibm1026" msgstr "" -#: library/codecs.rst:1145 +#: library/codecs.rst:1146 msgid "cp1125" msgstr "" -#: library/codecs.rst:1145 +#: library/codecs.rst:1146 msgid "1125, ibm1125, cp866u, ruscii" msgstr "" -#: library/codecs.rst:1249 +#: library/codecs.rst:1250 msgid "Ukrainian" msgstr "" -#: library/codecs.rst:1149 +#: library/codecs.rst:1150 msgid "cp1140" msgstr "" -#: library/codecs.rst:1149 +#: library/codecs.rst:1150 msgid "ibm1140" msgstr "" -#: library/codecs.rst:1151 +#: library/codecs.rst:1152 msgid "cp1250" msgstr "" -#: library/codecs.rst:1151 +#: library/codecs.rst:1152 msgid "windows-1250" msgstr "" -#: library/codecs.rst:1153 +#: library/codecs.rst:1154 msgid "cp1251" msgstr "" -#: library/codecs.rst:1153 +#: library/codecs.rst:1154 msgid "windows-1251" msgstr "" -#: library/codecs.rst:1156 +#: library/codecs.rst:1157 msgid "cp1252" msgstr "" -#: library/codecs.rst:1156 +#: library/codecs.rst:1157 msgid "windows-1252" msgstr "" -#: library/codecs.rst:1158 +#: library/codecs.rst:1159 msgid "cp1253" msgstr "" -#: library/codecs.rst:1158 +#: library/codecs.rst:1159 msgid "windows-1253" msgstr "" -#: library/codecs.rst:1160 +#: library/codecs.rst:1161 msgid "cp1254" msgstr "" -#: library/codecs.rst:1160 +#: library/codecs.rst:1161 msgid "windows-1254" msgstr "" -#: library/codecs.rst:1162 +#: library/codecs.rst:1163 msgid "cp1255" msgstr "" -#: library/codecs.rst:1162 +#: library/codecs.rst:1163 msgid "windows-1255" msgstr "" -#: library/codecs.rst:1164 +#: library/codecs.rst:1165 msgid "cp1256" msgstr "" -#: library/codecs.rst:1164 +#: library/codecs.rst:1165 msgid "windows-1256" msgstr "" -#: library/codecs.rst:1166 +#: library/codecs.rst:1167 msgid "cp1257" msgstr "" -#: library/codecs.rst:1166 +#: library/codecs.rst:1167 msgid "windows-1257" msgstr "" -#: library/codecs.rst:1168 +#: library/codecs.rst:1169 msgid "cp1258" msgstr "" -#: library/codecs.rst:1168 +#: library/codecs.rst:1169 msgid "windows-1258" msgstr "" -#: library/codecs.rst:1168 +#: library/codecs.rst:1169 msgid "Vietnamese" msgstr "" -#: library/codecs.rst:1170 +#: library/codecs.rst:1171 msgid "euc_jp" msgstr "" -#: library/codecs.rst:1170 +#: library/codecs.rst:1171 msgid "eucjp, ujis, u-jis" msgstr "" -#: library/codecs.rst:1172 +#: library/codecs.rst:1173 msgid "euc_jis_2004" msgstr "" -#: library/codecs.rst:1172 +#: library/codecs.rst:1173 msgid "jisx0213, eucjis2004" msgstr "" -#: library/codecs.rst:1174 +#: library/codecs.rst:1175 msgid "euc_jisx0213" msgstr "" -#: library/codecs.rst:1174 +#: library/codecs.rst:1175 msgid "eucjisx0213" msgstr "" -#: library/codecs.rst:1176 +#: library/codecs.rst:1177 msgid "euc_kr" msgstr "" -#: library/codecs.rst:1176 +#: library/codecs.rst:1177 msgid "euckr, korean, ksc5601, ks_c-5601, ks_c-5601-1987, ksx1001, ks_x-1001" msgstr "" -#: library/codecs.rst:1180 +#: library/codecs.rst:1181 msgid "gb2312" msgstr "" -#: library/codecs.rst:1180 +#: library/codecs.rst:1181 msgid "" "chinese, csiso58gb231280, euc-cn, euccn, eucgb2312-cn, gb2312-1980, " "gb2312-80, iso-ir-58" msgstr "" -#: library/codecs.rst:1189 +#: library/codecs.rst:1190 msgid "Simplified Chinese" msgstr "" -#: library/codecs.rst:1185 +#: library/codecs.rst:1186 msgid "gbk" msgstr "" -#: library/codecs.rst:1185 +#: library/codecs.rst:1186 msgid "936, cp936, ms936" msgstr "" -#: library/codecs.rst:1187 +#: library/codecs.rst:1188 msgid "Unified Chinese" msgstr "" -#: library/codecs.rst:1187 +#: library/codecs.rst:1188 msgid "gb18030" msgstr "" -#: library/codecs.rst:1187 +#: library/codecs.rst:1188 msgid "gb18030-2000" msgstr "" -#: library/codecs.rst:1189 +#: library/codecs.rst:1190 msgid "hz" msgstr "" -#: library/codecs.rst:1189 +#: library/codecs.rst:1190 msgid "hzgb, hz-gb, hz-gb-2312" msgstr "" -#: library/codecs.rst:1191 +#: library/codecs.rst:1192 msgid "iso2022_jp" msgstr "" -#: library/codecs.rst:1191 +#: library/codecs.rst:1192 msgid "csiso2022jp, iso2022jp, iso-2022-jp" msgstr "" -#: library/codecs.rst:1194 +#: library/codecs.rst:1195 msgid "iso2022_jp_1" msgstr "" -#: library/codecs.rst:1194 +#: library/codecs.rst:1195 msgid "iso2022jp-1, iso-2022-jp-1" msgstr "" -#: library/codecs.rst:1196 +#: library/codecs.rst:1197 msgid "iso2022_jp_2" msgstr "" -#: library/codecs.rst:1196 +#: library/codecs.rst:1197 msgid "iso2022jp-2, iso-2022-jp-2" msgstr "" -#: library/codecs.rst:1196 +#: library/codecs.rst:1197 msgid "Japanese, Korean, Simplified Chinese, Western Europe, Greek" msgstr "" -#: library/codecs.rst:1199 +#: library/codecs.rst:1200 msgid "iso2022_jp_2004" msgstr "" -#: library/codecs.rst:1199 +#: library/codecs.rst:1200 msgid "iso2022jp-2004, iso-2022-jp-2004" msgstr "" -#: library/codecs.rst:1202 +#: library/codecs.rst:1203 msgid "iso2022_jp_3" msgstr "" -#: library/codecs.rst:1202 +#: library/codecs.rst:1203 msgid "iso2022jp-3, iso-2022-jp-3" msgstr "" -#: library/codecs.rst:1204 +#: library/codecs.rst:1205 msgid "iso2022_jp_ext" msgstr "" -#: library/codecs.rst:1204 +#: library/codecs.rst:1205 msgid "iso2022jp-ext, iso-2022-jp-ext" msgstr "" -#: library/codecs.rst:1206 +#: library/codecs.rst:1207 msgid "iso2022_kr" msgstr "" -#: library/codecs.rst:1206 +#: library/codecs.rst:1207 msgid "csiso2022kr, iso2022kr, iso-2022-kr" msgstr "" -#: library/codecs.rst:1209 +#: library/codecs.rst:1210 msgid "latin_1" msgstr "" -#: library/codecs.rst:1209 +#: library/codecs.rst:1210 msgid "iso-8859-1, iso8859-1, 8859, cp819, latin, latin1, L1" msgstr "" -#: library/codecs.rst:1212 +#: library/codecs.rst:1213 msgid "iso8859_2" msgstr "" -#: library/codecs.rst:1212 +#: library/codecs.rst:1213 msgid "iso-8859-2, latin2, L2" msgstr "" -#: library/codecs.rst:1214 +#: library/codecs.rst:1215 msgid "iso8859_3" msgstr "" -#: library/codecs.rst:1214 +#: library/codecs.rst:1215 msgid "iso-8859-3, latin3, L3" msgstr "" -#: library/codecs.rst:1214 +#: library/codecs.rst:1215 msgid "Esperanto, Maltese" msgstr "" -#: library/codecs.rst:1216 +#: library/codecs.rst:1217 msgid "iso8859_4" msgstr "" -#: library/codecs.rst:1216 +#: library/codecs.rst:1217 msgid "iso-8859-4, latin4, L4" msgstr "" -#: library/codecs.rst:1218 +#: library/codecs.rst:1219 msgid "iso8859_5" msgstr "" -#: library/codecs.rst:1218 +#: library/codecs.rst:1219 msgid "iso-8859-5, cyrillic" msgstr "" -#: library/codecs.rst:1221 +#: library/codecs.rst:1222 msgid "iso8859_6" msgstr "" -#: library/codecs.rst:1221 +#: library/codecs.rst:1222 msgid "iso-8859-6, arabic" msgstr "" -#: library/codecs.rst:1223 +#: library/codecs.rst:1224 msgid "iso8859_7" msgstr "" -#: library/codecs.rst:1223 +#: library/codecs.rst:1224 msgid "iso-8859-7, greek, greek8" msgstr "" -#: library/codecs.rst:1225 +#: library/codecs.rst:1226 msgid "iso8859_8" msgstr "" -#: library/codecs.rst:1225 +#: library/codecs.rst:1226 msgid "iso-8859-8, hebrew" msgstr "" -#: library/codecs.rst:1227 +#: library/codecs.rst:1228 msgid "iso8859_9" msgstr "" -#: library/codecs.rst:1227 +#: library/codecs.rst:1228 msgid "iso-8859-9, latin5, L5" msgstr "" -#: library/codecs.rst:1229 +#: library/codecs.rst:1230 msgid "iso8859_10" msgstr "" -#: library/codecs.rst:1229 +#: library/codecs.rst:1230 msgid "iso-8859-10, latin6, L6" msgstr "" -#: library/codecs.rst:1229 +#: library/codecs.rst:1230 msgid "Nordic languages" msgstr "" -#: library/codecs.rst:1231 +#: library/codecs.rst:1232 msgid "iso8859_11" msgstr "" -#: library/codecs.rst:1231 +#: library/codecs.rst:1232 msgid "iso-8859-11, thai" msgstr "" -#: library/codecs.rst:1231 +#: library/codecs.rst:1232 msgid "Thai languages" msgstr "" -#: library/codecs.rst:1233 +#: library/codecs.rst:1234 msgid "iso8859_13" msgstr "" -#: library/codecs.rst:1233 +#: library/codecs.rst:1234 msgid "iso-8859-13, latin7, L7" msgstr "" -#: library/codecs.rst:1235 +#: library/codecs.rst:1236 msgid "iso8859_14" msgstr "" -#: library/codecs.rst:1235 +#: library/codecs.rst:1236 msgid "iso-8859-14, latin8, L8" msgstr "" -#: library/codecs.rst:1235 +#: library/codecs.rst:1236 msgid "Celtic languages" msgstr "" -#: library/codecs.rst:1237 +#: library/codecs.rst:1238 msgid "iso8859_15" msgstr "" -#: library/codecs.rst:1237 +#: library/codecs.rst:1238 msgid "iso-8859-15, latin9, L9" msgstr "" -#: library/codecs.rst:1239 +#: library/codecs.rst:1240 msgid "iso8859_16" msgstr "" -#: library/codecs.rst:1239 +#: library/codecs.rst:1240 msgid "iso-8859-16, latin10, L10" msgstr "" -#: library/codecs.rst:1239 +#: library/codecs.rst:1240 msgid "South-Eastern Europe" msgstr "" -#: library/codecs.rst:1241 +#: library/codecs.rst:1242 msgid "johab" msgstr "" -#: library/codecs.rst:1241 +#: library/codecs.rst:1242 msgid "cp1361, ms1361" msgstr "" -#: library/codecs.rst:1243 +#: library/codecs.rst:1244 msgid "koi8_r" msgstr "" -#: library/codecs.rst:1245 +#: library/codecs.rst:1246 msgid "koi8_t" msgstr "" -#: library/codecs.rst:1245 +#: library/codecs.rst:1246 msgid "Tajik" msgstr "" -#: library/codecs.rst:1249 +#: library/codecs.rst:1250 msgid "koi8_u" msgstr "" -#: library/codecs.rst:1251 +#: library/codecs.rst:1252 msgid "kz1048" msgstr "" -#: library/codecs.rst:1251 +#: library/codecs.rst:1252 msgid "kz_1048, strk1048_2002, rk1048" msgstr "" -#: library/codecs.rst:1269 +#: library/codecs.rst:1270 msgid "Kazakh" msgstr "" -#: library/codecs.rst:1255 +#: library/codecs.rst:1256 msgid "mac_cyrillic" msgstr "" -#: library/codecs.rst:1255 +#: library/codecs.rst:1256 msgid "maccyrillic" msgstr "" -#: library/codecs.rst:1258 +#: library/codecs.rst:1259 msgid "mac_greek" msgstr "" -#: library/codecs.rst:1258 +#: library/codecs.rst:1259 msgid "macgreek" msgstr "" -#: library/codecs.rst:1260 +#: library/codecs.rst:1261 msgid "mac_iceland" msgstr "" -#: library/codecs.rst:1260 +#: library/codecs.rst:1261 msgid "maciceland" msgstr "" -#: library/codecs.rst:1262 +#: library/codecs.rst:1263 msgid "mac_latin2" msgstr "" -#: library/codecs.rst:1262 +#: library/codecs.rst:1263 msgid "maclatin2, maccentraleurope, mac_centeuro" msgstr "" -#: library/codecs.rst:1265 +#: library/codecs.rst:1266 msgid "mac_roman" msgstr "" -#: library/codecs.rst:1265 +#: library/codecs.rst:1266 msgid "macroman, macintosh" msgstr "" -#: library/codecs.rst:1267 +#: library/codecs.rst:1268 msgid "mac_turkish" msgstr "" -#: library/codecs.rst:1267 +#: library/codecs.rst:1268 msgid "macturkish" msgstr "" -#: library/codecs.rst:1269 +#: library/codecs.rst:1270 msgid "ptcp154" msgstr "" -#: library/codecs.rst:1269 +#: library/codecs.rst:1270 msgid "csptcp154, pt154, cp154, cyrillic-asian" msgstr "" -#: library/codecs.rst:1272 +#: library/codecs.rst:1273 msgid "shift_jis" msgstr "" -#: library/codecs.rst:1272 +#: library/codecs.rst:1273 msgid "csshiftjis, shiftjis, sjis, s_jis" msgstr "" -#: library/codecs.rst:1275 +#: library/codecs.rst:1276 msgid "shift_jis_2004" msgstr "" -#: library/codecs.rst:1275 +#: library/codecs.rst:1276 msgid "shiftjis2004, sjis_2004, sjis2004" msgstr "" -#: library/codecs.rst:1278 +#: library/codecs.rst:1279 msgid "shift_jisx0213" msgstr "" -#: library/codecs.rst:1278 +#: library/codecs.rst:1279 msgid "shiftjisx0213, sjisx0213, s_jisx0213" msgstr "" -#: library/codecs.rst:1281 +#: library/codecs.rst:1282 msgid "utf_32" msgstr "" -#: library/codecs.rst:1281 +#: library/codecs.rst:1282 msgid "U32, utf32" msgstr "" -#: library/codecs.rst:1283 library/codecs.rst:1287 library/codecs.rst:1291 -#: library/codecs.rst:1295 library/codecs.rst:1297 +#: library/codecs.rst:1284 library/codecs.rst:1288 library/codecs.rst:1292 +#: library/codecs.rst:1296 library/codecs.rst:1298 msgid "all languages" msgstr "" -#: library/codecs.rst:1283 +#: library/codecs.rst:1284 msgid "utf_32_be" msgstr "" -#: library/codecs.rst:1283 +#: library/codecs.rst:1284 msgid "UTF-32BE" msgstr "" -#: library/codecs.rst:1285 +#: library/codecs.rst:1286 msgid "utf_32_le" msgstr "" -#: library/codecs.rst:1285 +#: library/codecs.rst:1286 msgid "UTF-32LE" msgstr "" -#: library/codecs.rst:1287 +#: library/codecs.rst:1288 msgid "utf_16" msgstr "" -#: library/codecs.rst:1287 +#: library/codecs.rst:1288 msgid "U16, utf16" msgstr "" -#: library/codecs.rst:1289 +#: library/codecs.rst:1290 msgid "utf_16_be" msgstr "" -#: library/codecs.rst:1289 +#: library/codecs.rst:1290 msgid "UTF-16BE" msgstr "" -#: library/codecs.rst:1291 +#: library/codecs.rst:1292 msgid "utf_16_le" msgstr "" -#: library/codecs.rst:1291 +#: library/codecs.rst:1292 msgid "UTF-16LE" msgstr "" -#: library/codecs.rst:1293 +#: library/codecs.rst:1294 msgid "utf_7" msgstr "" -#: library/codecs.rst:1293 +#: library/codecs.rst:1294 msgid "U7, unicode-1-1-utf-7" msgstr "" -#: library/codecs.rst:1295 +#: library/codecs.rst:1296 msgid "utf_8" msgstr "" -#: library/codecs.rst:1295 +#: library/codecs.rst:1296 msgid "U8, UTF, utf8, cp65001" msgstr "" -#: library/codecs.rst:1297 +#: library/codecs.rst:1298 msgid "utf_8_sig" msgstr "" -#: library/codecs.rst:1300 +#: library/codecs.rst:1301 msgid "" "The utf-16\\* and utf-32\\* encoders no longer allow surrogate code points " "(``U+D800``--``U+DFFF``) to be encoded. The utf-32\\* decoders no longer " "decode byte sequences that correspond to surrogate code points." msgstr "" -#: library/codecs.rst:1306 +#: library/codecs.rst:1307 msgid "``cp65001`` is now an alias to ``utf_8``." msgstr "" -#: library/codecs.rst:1311 +#: library/codecs.rst:1312 msgid "Python Specific Encodings" msgstr "" -#: library/codecs.rst:1313 +#: library/codecs.rst:1314 msgid "" "A number of predefined codecs are specific to Python, so their codec names " "have no meaning outside Python. These are listed in the tables below based " @@ -2274,273 +2274,268 @@ msgid "" "asymmetric codecs, the stated meaning describes the encoding direction." msgstr "" -#: library/codecs.rst:1321 +#: library/codecs.rst:1322 msgid "Text Encodings" msgstr "" -#: library/codecs.rst:1323 +#: library/codecs.rst:1324 msgid "" "The following codecs provide :class:`str` to :class:`bytes` encoding and :" "term:`bytes-like object` to :class:`str` decoding, similar to the Unicode " "text encodings." msgstr "" -#: library/codecs.rst:1332 +#: library/codecs.rst:1333 msgid "idna" msgstr "" -#: library/codecs.rst:1332 +#: library/codecs.rst:1333 msgid "" "Implement :rfc:`3490`, see also :mod:`encodings.idna`. Only " "``errors='strict'`` is supported." msgstr "" -#: library/codecs.rst:1338 +#: library/codecs.rst:1339 msgid "mbcs" msgstr "" -#: library/codecs.rst:1338 +#: library/codecs.rst:1339 msgid "ansi, dbcs" msgstr "" -#: library/codecs.rst:1338 +#: library/codecs.rst:1339 msgid "" "Windows only: Encode the operand according to the ANSI codepage (CP_ACP)." msgstr "" -#: library/codecs.rst:1342 +#: library/codecs.rst:1343 msgid "oem" msgstr "" -#: library/codecs.rst:1342 +#: library/codecs.rst:1343 msgid "" "Windows only: Encode the operand according to the OEM codepage (CP_OEMCP)." msgstr "" -#: library/codecs.rst:1348 +#: library/codecs.rst:1349 msgid "palmos" msgstr "" -#: library/codecs.rst:1348 +#: library/codecs.rst:1349 msgid "Encoding of PalmOS 3.5." msgstr "" -#: library/codecs.rst:1350 +#: library/codecs.rst:1351 msgid "punycode" msgstr "" -#: library/codecs.rst:1350 +#: library/codecs.rst:1351 msgid "Implement :rfc:`3492`. Stateful codecs are not supported." msgstr "" -#: library/codecs.rst:1354 +#: library/codecs.rst:1355 msgid "raw_unicode_escape" msgstr "" -#: library/codecs.rst:1354 +#: library/codecs.rst:1355 msgid "" "Latin-1 encoding with :samp:`\\\\u{XXXX}` and :samp:`\\\\U{XXXXXXXX}` for " "other code points. Existing backslashes are not escaped in any way. It is " "used in the Python pickle protocol." msgstr "" -#: library/codecs.rst:1364 +#: library/codecs.rst:1365 msgid "undefined" msgstr "" -#: library/codecs.rst:1364 +#: library/codecs.rst:1365 msgid "" "Raise an exception for all conversions, even empty strings. The error " "handler is ignored." msgstr "" -#: library/codecs.rst:1369 +#: library/codecs.rst:1370 msgid "unicode_escape" msgstr "" -#: library/codecs.rst:1369 +#: library/codecs.rst:1370 msgid "" "Encoding suitable as the contents of a Unicode literal in ASCII-encoded " "Python source code, except that quotes are not escaped. Decode from Latin-1 " "source code. Beware that Python source code actually uses UTF-8 by default." msgstr "" -#: library/codecs.rst:1381 +#: library/codecs.rst:1382 msgid "\"unicode_internal\" codec is removed." msgstr "" -#: library/codecs.rst:1388 +#: library/codecs.rst:1389 msgid "Binary Transforms" msgstr "" -#: library/codecs.rst:1390 +#: library/codecs.rst:1391 msgid "" "The following codecs provide binary transforms: :term:`bytes-like object` " "to :class:`bytes` mappings. They are not supported by :meth:`bytes.decode` " "(which only produces :class:`str` output)." msgstr "" -#: library/codecs.rst:1398 +#: library/codecs.rst:1399 msgid "Encoder / decoder" msgstr "" -#: library/codecs.rst:1400 +#: library/codecs.rst:1401 msgid "base64_codec [#b64]_" msgstr "" -#: library/codecs.rst:1400 +#: library/codecs.rst:1401 msgid "base64, base_64" msgstr "" -#: library/codecs.rst:1400 +#: library/codecs.rst:1401 msgid "" "Convert the operand to multiline MIME base64 (the result always includes a " "trailing ``'\\n'``)." msgstr "" -#: library/codecs.rst:1405 +#: library/codecs.rst:1406 msgid "" "accepts any :term:`bytes-like object` as input for encoding and decoding" msgstr "" -#: library/codecs.rst:1400 +#: library/codecs.rst:1401 msgid ":meth:`base64.encodebytes` / :meth:`base64.decodebytes`" msgstr "" -#: library/codecs.rst:1411 +#: library/codecs.rst:1412 msgid "bz2_codec" msgstr "" -#: library/codecs.rst:1411 +#: library/codecs.rst:1412 msgid "bz2" msgstr "" -#: library/codecs.rst:1411 +#: library/codecs.rst:1412 msgid "Compress the operand using bz2." msgstr "" -#: library/codecs.rst:1411 +#: library/codecs.rst:1412 msgid ":meth:`bz2.compress` / :meth:`bz2.decompress`" msgstr "" -#: library/codecs.rst:1414 +#: library/codecs.rst:1415 msgid "hex_codec" msgstr "" -#: library/codecs.rst:1414 +#: library/codecs.rst:1415 msgid "hex" msgstr "" -#: library/codecs.rst:1414 +#: library/codecs.rst:1415 msgid "" "Convert the operand to hexadecimal representation, with two digits per byte." msgstr "" -#: library/codecs.rst:1414 +#: library/codecs.rst:1415 msgid ":meth:`binascii.b2a_hex` / :meth:`binascii.a2b_hex`" msgstr "" -#: library/codecs.rst:1419 +#: library/codecs.rst:1420 msgid "quopri_codec" msgstr "" -#: library/codecs.rst:1419 +#: library/codecs.rst:1420 msgid "quopri, quotedprintable, quoted_printable" msgstr "" -#: library/codecs.rst:1419 +#: library/codecs.rst:1420 msgid "Convert the operand to MIME quoted printable." msgstr "" -#: library/codecs.rst:1419 +#: library/codecs.rst:1420 msgid ":meth:`quopri.encode` with ``quotetabs=True`` / :meth:`quopri.decode`" msgstr "" -#: library/codecs.rst:1423 +#: library/codecs.rst:1424 msgid "uu_codec" msgstr "" -#: library/codecs.rst:1423 +#: library/codecs.rst:1424 msgid "uu" msgstr "" -#: library/codecs.rst:1423 +#: library/codecs.rst:1424 msgid "Convert the operand using uuencode." msgstr "" -#: library/codecs.rst:1423 -msgid "" -":meth:`!uu.encode` / :meth:`!uu.decode` (Note: :mod:`uu` is deprecated.)" -msgstr "" - -#: library/codecs.rst:1428 +#: library/codecs.rst:1427 msgid "zlib_codec" msgstr "" -#: library/codecs.rst:1428 +#: library/codecs.rst:1427 msgid "zip, zlib" msgstr "" -#: library/codecs.rst:1428 +#: library/codecs.rst:1427 msgid "Compress the operand using gzip." msgstr "" -#: library/codecs.rst:1428 +#: library/codecs.rst:1427 msgid ":meth:`zlib.compress` / :meth:`zlib.decompress`" msgstr "" -#: library/codecs.rst:1432 +#: library/codecs.rst:1431 msgid "" "In addition to :term:`bytes-like objects `, " "``'base64_codec'`` also accepts ASCII-only instances of :class:`str` for " "decoding" msgstr "" -#: library/codecs.rst:1436 +#: library/codecs.rst:1435 msgid "Restoration of the binary transforms." msgstr "" -#: library/codecs.rst:1439 +#: library/codecs.rst:1438 msgid "Restoration of the aliases for the binary transforms." msgstr "" -#: library/codecs.rst:1446 +#: library/codecs.rst:1445 msgid "Text Transforms" msgstr "" -#: library/codecs.rst:1448 +#: library/codecs.rst:1447 msgid "" "The following codec provides a text transform: a :class:`str` to :class:" "`str` mapping. It is not supported by :meth:`str.encode` (which only " "produces :class:`bytes` output)." msgstr "" -#: library/codecs.rst:1457 +#: library/codecs.rst:1456 msgid "rot_13" msgstr "" -#: library/codecs.rst:1457 +#: library/codecs.rst:1456 msgid "rot13" msgstr "" -#: library/codecs.rst:1457 +#: library/codecs.rst:1456 msgid "Return the Caesar-cypher encryption of the operand." msgstr "" -#: library/codecs.rst:1462 +#: library/codecs.rst:1461 msgid "Restoration of the ``rot_13`` text transform." msgstr "" -#: library/codecs.rst:1465 +#: library/codecs.rst:1464 msgid "Restoration of the ``rot13`` alias." msgstr "" -#: library/codecs.rst:1470 +#: library/codecs.rst:1469 msgid "" ":mod:`encodings.idna` --- Internationalized Domain Names in Applications" msgstr "" -#: library/codecs.rst:1476 +#: library/codecs.rst:1475 msgid "" "This module implements :rfc:`3490` (Internationalized Domain Names in " "Applications) and :rfc:`3492` (Nameprep: A Stringprep Profile for " @@ -2548,13 +2543,13 @@ msgid "" "encoding and :mod:`stringprep`." msgstr "" -#: library/codecs.rst:1481 +#: library/codecs.rst:1480 msgid "" "If you need the IDNA 2008 standard from :rfc:`5891` and :rfc:`5895`, use the " "third-party :pypi:`idna` module." msgstr "" -#: library/codecs.rst:1484 +#: library/codecs.rst:1483 msgid "" "These RFCs together define a protocol to support non-ASCII characters in " "domain names. A domain name containing non-ASCII characters (such as ``www." @@ -2568,7 +2563,7 @@ msgid "" "presenting them to the user." msgstr "" -#: library/codecs.rst:1495 +#: library/codecs.rst:1494 msgid "" "Python supports this conversion in several ways: the ``idna`` codec " "performs conversion between Unicode and ACE, separating an input string into " @@ -2585,14 +2580,14 @@ msgid "" "sends that field at all)." msgstr "" -#: library/codecs.rst:1508 +#: library/codecs.rst:1507 msgid "" "When receiving host names from the wire (such as in reverse name lookup), no " "automatic conversion to Unicode is performed: applications wishing to " "present such host names to the user should decode them to Unicode." msgstr "" -#: library/codecs.rst:1512 +#: library/codecs.rst:1511 msgid "" "The module :mod:`encodings.idna` also implements the nameprep procedure, " "which performs certain normalizations on host names, to achieve case-" @@ -2600,49 +2595,49 @@ msgid "" "characters. The nameprep functions can be used directly if desired." msgstr "" -#: library/codecs.rst:1520 +#: library/codecs.rst:1519 msgid "" "Return the nameprepped version of *label*. The implementation currently " "assumes query strings, so ``AllowUnassigned`` is true." msgstr "" -#: library/codecs.rst:1526 +#: library/codecs.rst:1525 msgid "" "Convert a label to ASCII, as specified in :rfc:`3490`. ``UseSTD3ASCIIRules`` " "is assumed to be false." msgstr "" -#: library/codecs.rst:1532 +#: library/codecs.rst:1531 msgid "Convert a label to Unicode, as specified in :rfc:`3490`." msgstr "" -#: library/codecs.rst:1536 +#: library/codecs.rst:1535 msgid ":mod:`encodings.mbcs` --- Windows ANSI codepage" msgstr "" -#: library/codecs.rst:1541 +#: library/codecs.rst:1540 msgid "This module implements the ANSI codepage (CP_ACP)." msgstr "" -#: library/codecs.rst:1543 +#: library/codecs.rst:1542 msgid "Availability" msgstr "" -#: library/codecs.rst:1545 +#: library/codecs.rst:1544 msgid "" "Before 3.2, the *errors* argument was ignored; ``'replace'`` was always used " "to encode, and ``'ignore'`` to decode." msgstr "" -#: library/codecs.rst:1549 +#: library/codecs.rst:1548 msgid "Support any error handler." msgstr "" -#: library/codecs.rst:1554 +#: library/codecs.rst:1553 msgid ":mod:`encodings.utf_8_sig` --- UTF-8 codec with BOM signature" msgstr "" -#: library/codecs.rst:1560 +#: library/codecs.rst:1559 msgid "" "This module implements a variant of the UTF-8 codec. On encoding, a UTF-8 " "encoded BOM will be prepended to the UTF-8 encoded bytes. For the stateful " diff --git a/library/codeop.po b/library/codeop.po index ff09d327..6b6001f2 100644 --- a/library/codeop.po +++ b/library/codeop.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" diff --git a/library/collections.abc.po b/library/collections.abc.po index 019ff147..14cc7c21 100644 --- a/library/collections.abc.po +++ b/library/collections.abc.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: 2025-05-02 23:52+0200\n" "Last-Translator: Marios Giannopoulos \n" "Language-Team: PyGreece \n" diff --git a/library/collections.po b/library/collections.po index 745810f6..54283168 100644 --- a/library/collections.po +++ b/library/collections.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -505,7 +505,7 @@ msgid "" "list(c) # list unique elements\n" "set(c) # convert to a set\n" "dict(c) # convert to a regular dictionary\n" -"c.items() # convert to a list of (elem, cnt) pairs\n" +"c.items() # access the (elem, cnt) pairs\n" "Counter(dict(list_of_pairs)) # convert from a list of (elem, cnt) pairs\n" "c.most_common()[:-n-1:-1] # n least common elements\n" "+c # remove zero and negative counts" @@ -1005,7 +1005,7 @@ msgid "" "absent." msgstr "" -#: library/collections.rst:1186 +#: library/collections.rst:1192 msgid "" "Added merge (``|``) and update (``|=``) operators, specified in :pep:`584`." msgstr "" @@ -1261,13 +1261,24 @@ msgid "" "timestamp=time.now())" msgstr "" +#: library/collections.rst:983 +msgid "" +"Named tuples are also supported by generic function :func:`copy.replace`." +msgstr "" + #: library/collections.rst:985 msgid "" +"Raise :exc:`TypeError` instead of :exc:`ValueError` for invalid keyword " +"arguments." +msgstr "" + +#: library/collections.rst:991 +msgid "" "Tuple of strings listing the field names. Useful for introspection and for " "creating new named tuple types from existing named tuples." msgstr "" -#: library/collections.rst:988 +#: library/collections.rst:994 msgid "" ">>> p._fields # view the field names\n" "('x', 'y')\n" @@ -1278,11 +1289,11 @@ msgid "" "Pixel(x=11, y=22, red=128, green=255, blue=0)" msgstr "" -#: library/collections.rst:1000 +#: library/collections.rst:1006 msgid "Dictionary mapping field names to default values." msgstr "" -#: library/collections.rst:1002 +#: library/collections.rst:1008 msgid "" ">>> Account = namedtuple('Account', ['type', 'balance'], defaults=[0])\n" ">>> Account._field_defaults\n" @@ -1291,26 +1302,26 @@ msgid "" "Account(type='premium', balance=0)" msgstr "" -#: library/collections.rst:1010 +#: library/collections.rst:1016 msgid "" "To retrieve a field whose name is stored in a string, use the :func:" "`getattr` function:" msgstr "" -#: library/collections.rst:1016 +#: library/collections.rst:1022 msgid "" "To convert a dictionary to a named tuple, use the double-star-operator (as " "described in :ref:`tut-unpacking-arguments`):" msgstr "" -#: library/collections.rst:1023 +#: library/collections.rst:1029 msgid "" "Since a named tuple is a regular Python class, it is easy to add or change " "functionality with a subclass. Here is how to add a calculated field and a " "fixed-width print format:" msgstr "" -#: library/collections.rst:1027 +#: library/collections.rst:1033 msgid "" ">>> class Point(namedtuple('Point', ['x', 'y'])):\n" "... __slots__ = ()\n" @@ -1327,38 +1338,38 @@ msgid "" "Point: x=14.000 y= 0.714 hypot=14.018" msgstr "" -#: library/collections.rst:1042 +#: library/collections.rst:1048 msgid "" "The subclass shown above sets ``__slots__`` to an empty tuple. This helps " "keep memory requirements low by preventing the creation of instance " "dictionaries." msgstr "" -#: library/collections.rst:1045 +#: library/collections.rst:1051 msgid "" "Subclassing is not useful for adding new, stored fields. Instead, simply " "create a new named tuple type from the :attr:`~somenamedtuple._fields` " "attribute:" msgstr "" -#: library/collections.rst:1050 +#: library/collections.rst:1056 msgid "" "Docstrings can be customized by making direct assignments to the ``__doc__`` " "fields:" msgstr "" -#: library/collections.rst:1059 +#: library/collections.rst:1065 msgid "Property docstrings became writeable." msgstr "" -#: library/collections.rst:1064 +#: library/collections.rst:1070 msgid "" "See :class:`typing.NamedTuple` for a way to add type hints for named " "tuples. It also provides an elegant notation using the :keyword:`class` " "keyword::" msgstr "" -#: library/collections.rst:1068 +#: library/collections.rst:1074 msgid "" "class Component(NamedTuple):\n" " part_number: int\n" @@ -1366,23 +1377,23 @@ msgid "" " description: Optional[str] = None" msgstr "" -#: library/collections.rst:1073 +#: library/collections.rst:1079 msgid "" "See :meth:`types.SimpleNamespace` for a mutable namespace based on an " "underlying dictionary instead of a tuple." msgstr "" -#: library/collections.rst:1076 +#: library/collections.rst:1082 msgid "" "The :mod:`dataclasses` module provides a decorator and functions for " "automatically adding generated special methods to user-defined classes." msgstr "" -#: library/collections.rst:1081 +#: library/collections.rst:1087 msgid ":class:`OrderedDict` objects" msgstr "" -#: library/collections.rst:1083 +#: library/collections.rst:1089 msgid "" "Ordered dictionaries are just like regular dictionaries but have some extra " "capabilities relating to ordering operations. They have become less " @@ -1390,93 +1401,93 @@ msgid "" "remember insertion order (this new behavior became guaranteed in Python 3.7)." msgstr "" -#: library/collections.rst:1089 +#: library/collections.rst:1095 msgid "Some differences from :class:`dict` still remain:" msgstr "" -#: library/collections.rst:1091 +#: library/collections.rst:1097 msgid "" "The regular :class:`dict` was designed to be very good at mapping " "operations. Tracking insertion order was secondary." msgstr "" -#: library/collections.rst:1094 +#: library/collections.rst:1100 msgid "" "The :class:`OrderedDict` was designed to be good at reordering operations. " "Space efficiency, iteration speed, and the performance of update operations " "were secondary." msgstr "" -#: library/collections.rst:1098 +#: library/collections.rst:1104 msgid "" "The :class:`OrderedDict` algorithm can handle frequent reordering operations " "better than :class:`dict`. As shown in the recipes below, this makes it " "suitable for implementing various kinds of LRU caches." msgstr "" -#: library/collections.rst:1102 +#: library/collections.rst:1108 msgid "" "The equality operation for :class:`OrderedDict` checks for matching order." msgstr "" -#: library/collections.rst:1104 +#: library/collections.rst:1110 msgid "" "A regular :class:`dict` can emulate the order sensitive equality test with " "``p == q and all(k1 == k2 for k1, k2 in zip(p, q))``." msgstr "" -#: library/collections.rst:1107 +#: library/collections.rst:1113 msgid "" "The :meth:`~OrderedDict.popitem` method of :class:`OrderedDict` has a " "different signature. It accepts an optional argument to specify which item " "is popped." msgstr "" -#: library/collections.rst:1110 +#: library/collections.rst:1116 msgid "" "A regular :class:`dict` can emulate OrderedDict's ``od.popitem(last=True)`` " "with ``d.popitem()`` which is guaranteed to pop the rightmost (last) item." msgstr "" -#: library/collections.rst:1113 +#: library/collections.rst:1119 msgid "" "A regular :class:`dict` can emulate OrderedDict's ``od.popitem(last=False)`` " "with ``(k := next(iter(d)), d.pop(k))`` which will return and remove the " "leftmost (first) item if it exists." msgstr "" -#: library/collections.rst:1117 +#: library/collections.rst:1123 msgid "" ":class:`OrderedDict` has a :meth:`~OrderedDict.move_to_end` method to " "efficiently reposition an element to an endpoint." msgstr "" -#: library/collections.rst:1120 +#: library/collections.rst:1126 msgid "" "A regular :class:`dict` can emulate OrderedDict's ``od.move_to_end(k, " "last=True)`` with ``d[k] = d.pop(k)`` which will move the key and its " "associated value to the rightmost (last) position." msgstr "" -#: library/collections.rst:1124 +#: library/collections.rst:1130 msgid "" "A regular :class:`dict` does not have an efficient equivalent for " "OrderedDict's ``od.move_to_end(k, last=False)`` which moves the key and its " "associated value to the leftmost (first) position." msgstr "" -#: library/collections.rst:1128 +#: library/collections.rst:1134 msgid "" "Until Python 3.8, :class:`dict` lacked a :meth:`~object.__reversed__` method." msgstr "" -#: library/collections.rst:1133 +#: library/collections.rst:1139 msgid "" "Return an instance of a :class:`dict` subclass that has methods specialized " "for rearranging dictionary order." msgstr "" -#: library/collections.rst:1140 +#: library/collections.rst:1146 msgid "" "The :meth:`popitem` method for ordered dictionaries returns and removes a " "(key, value) pair. The pairs are returned in :abbr:`LIFO (last-in, first-" @@ -1484,14 +1495,14 @@ msgid "" "false." msgstr "" -#: library/collections.rst:1147 +#: library/collections.rst:1153 msgid "" "Move an existing *key* to either end of an ordered dictionary. The item is " "moved to the right end if *last* is true (the default) or to the beginning " "if *last* is false. Raises :exc:`KeyError` if the *key* does not exist:" msgstr "" -#: library/collections.rst:1152 +#: library/collections.rst:1158 msgid "" ">>> d = OrderedDict.fromkeys('abcde')\n" ">>> d.move_to_end('b')\n" @@ -1502,19 +1513,19 @@ msgid "" "'bacde'" msgstr "" -#: library/collections.rst:1164 +#: library/collections.rst:1170 msgid "" "In addition to the usual mapping methods, ordered dictionaries also support " "reverse iteration using :func:`reversed`." msgstr "" -#: library/collections.rst:1169 +#: library/collections.rst:1175 msgid "" "Equality tests between :class:`OrderedDict` objects are order-sensitive and " "are roughly equivalent to ``list(od1.items())==list(od2.items())``." msgstr "" -#: library/collections.rst:1172 +#: library/collections.rst:1178 msgid "" "Equality tests between :class:`OrderedDict` objects and other :class:" "`~collections.abc.Mapping` objects are order-insensitive like regular " @@ -1522,24 +1533,24 @@ msgid "" "anywhere a regular dictionary is used." msgstr "" -#: library/collections.rst:1177 +#: library/collections.rst:1183 msgid "" "The items, keys, and values :term:`views ` of :class:" "`OrderedDict` now support reverse iteration using :func:`reversed`." msgstr "" -#: library/collections.rst:1181 +#: library/collections.rst:1187 msgid "" "With the acceptance of :pep:`468`, order is retained for keyword arguments " "passed to the :class:`OrderedDict` constructor and its :meth:`~dict.update` " "method." msgstr "" -#: library/collections.rst:1191 +#: library/collections.rst:1197 msgid ":class:`OrderedDict` Examples and Recipes" msgstr "" -#: library/collections.rst:1193 +#: library/collections.rst:1199 msgid "" "It is straightforward to create an ordered dictionary variant that remembers " "the order the keys were *last* inserted. If a new entry overwrites an " @@ -1547,7 +1558,7 @@ msgid "" "end::" msgstr "" -#: library/collections.rst:1198 +#: library/collections.rst:1204 msgid "" "class LastUpdatedOrderedDict(OrderedDict):\n" " 'Store items in the order the keys were last added'\n" @@ -1557,13 +1568,13 @@ msgid "" " self.move_to_end(key)" msgstr "" -#: library/collections.rst:1205 +#: library/collections.rst:1211 msgid "" "An :class:`OrderedDict` would also be useful for implementing variants of :" "func:`functools.lru_cache`:" msgstr "" -#: library/collections.rst:1208 +#: library/collections.rst:1214 msgid "" "from collections import OrderedDict\n" "from time import time\n" @@ -1586,11 +1597,11 @@ msgid "" " result = self.func(*args)\n" " self.cache[args] = time(), result\n" " if len(self.cache) > self.maxsize:\n" -" self.cache.popitem(0)\n" +" self.cache.popitem(last=False)\n" " return result" msgstr "" -#: library/collections.rst:1235 +#: library/collections.rst:1241 msgid "" "class MultiHitLRUCache:\n" " \"\"\" LRU cache that defers caching a result until\n" @@ -1619,20 +1630,20 @@ msgid "" " if self.requests[args] <= self.cache_after:\n" " self.requests.move_to_end(args)\n" " if len(self.requests) > self.maxrequests:\n" -" self.requests.popitem(0)\n" +" self.requests.popitem(last=False)\n" " else:\n" " self.requests.pop(args, None)\n" " self.cache[args] = result\n" " if len(self.cache) > self.maxsize:\n" -" self.cache.popitem(0)\n" +" self.cache.popitem(last=False)\n" " return result" msgstr "" -#: library/collections.rst:1304 +#: library/collections.rst:1310 msgid ":class:`UserDict` objects" msgstr "" -#: library/collections.rst:1306 +#: library/collections.rst:1312 msgid "" "The class, :class:`UserDict` acts as a wrapper around dictionary objects. " "The need for this class has been partially supplanted by the ability to " @@ -1640,7 +1651,7 @@ msgid "" "work with because the underlying dictionary is accessible as an attribute." msgstr "" -#: library/collections.rst:1314 +#: library/collections.rst:1320 msgid "" "Class that simulates a dictionary. The instance's contents are kept in a " "regular dictionary, which is accessible via the :attr:`data` attribute of :" @@ -1649,22 +1660,22 @@ msgid "" "not be kept, allowing it to be used for other purposes." msgstr "" -#: library/collections.rst:1320 +#: library/collections.rst:1326 msgid "" "In addition to supporting the methods and operations of mappings, :class:" "`UserDict` instances provide the following attribute:" msgstr "" -#: library/collections.rst:1325 +#: library/collections.rst:1331 msgid "" "A real dictionary used to store the contents of the :class:`UserDict` class." msgstr "" -#: library/collections.rst:1331 +#: library/collections.rst:1337 msgid ":class:`UserList` objects" msgstr "" -#: library/collections.rst:1333 +#: library/collections.rst:1339 msgid "" "This class acts as a wrapper around list objects. It is a useful base class " "for your own list-like classes which can inherit from them and override " @@ -1672,14 +1683,14 @@ msgid "" "lists." msgstr "" -#: library/collections.rst:1338 +#: library/collections.rst:1344 msgid "" "The need for this class has been partially supplanted by the ability to " "subclass directly from :class:`list`; however, this class can be easier to " "work with because the underlying list is accessible as an attribute." msgstr "" -#: library/collections.rst:1344 +#: library/collections.rst:1350 msgid "" "Class that simulates a list. The instance's contents are kept in a regular " "list, which is accessible via the :attr:`data` attribute of :class:" @@ -1688,19 +1699,19 @@ msgid "" "for example a real Python list or a :class:`UserList` object." msgstr "" -#: library/collections.rst:1350 +#: library/collections.rst:1356 msgid "" "In addition to supporting the methods and operations of mutable sequences, :" "class:`UserList` instances provide the following attribute:" msgstr "" -#: library/collections.rst:1355 +#: library/collections.rst:1361 msgid "" "A real :class:`list` object used to store the contents of the :class:" "`UserList` class." msgstr "" -#: library/collections.rst:1358 +#: library/collections.rst:1364 msgid "" "**Subclassing requirements:** Subclasses of :class:`UserList` are expected " "to offer a constructor which can be called with either no arguments or one " @@ -1710,7 +1721,7 @@ msgid "" "object used as a data source." msgstr "" -#: library/collections.rst:1365 +#: library/collections.rst:1371 msgid "" "If a derived class does not wish to comply with this requirement, all of the " "special methods supported by this class will need to be overridden; please " @@ -1718,11 +1729,11 @@ msgid "" "provided in that case." msgstr "" -#: library/collections.rst:1371 +#: library/collections.rst:1377 msgid ":class:`UserString` objects" msgstr "" -#: library/collections.rst:1373 +#: library/collections.rst:1379 msgid "" "The class, :class:`UserString` acts as a wrapper around string objects. The " "need for this class has been partially supplanted by the ability to subclass " @@ -1730,7 +1741,7 @@ msgid "" "because the underlying string is accessible as an attribute." msgstr "" -#: library/collections.rst:1381 +#: library/collections.rst:1387 msgid "" "Class that simulates a string object. The instance's content is kept in a " "regular string object, which is accessible via the :attr:`data` attribute " @@ -1739,19 +1750,19 @@ msgid "" "converted into a string using the built-in :func:`str` function." msgstr "" -#: library/collections.rst:1388 +#: library/collections.rst:1394 msgid "" "In addition to supporting the methods and operations of strings, :class:" "`UserString` instances provide the following attribute:" msgstr "" -#: library/collections.rst:1393 +#: library/collections.rst:1399 msgid "" "A real :class:`str` object used to store the contents of the :class:" "`UserString` class." msgstr "" -#: library/collections.rst:1396 +#: library/collections.rst:1402 msgid "" "New methods ``__getnewargs__``, ``__rmod__``, ``casefold``, ``format_map``, " "``isprintable``, and ``maketrans``." diff --git a/library/colorsys.po b/library/colorsys.po index f4b5d4a2..9804a6c1 100644 --- a/library/colorsys.po +++ b/library/colorsys.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" diff --git a/library/compileall.po b/library/compileall.po index 399369dc..7219cc51 100644 --- a/library/compileall.po +++ b/library/compileall.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -40,9 +40,8 @@ msgstr "" #: includes/wasm-notavail.rst:5 msgid "" -"This module does not work or is not available on WebAssembly platforms " -"``wasm32-emscripten`` and ``wasm32-wasi``. See :ref:`wasm-availability` for " -"more information." +"This module does not work or is not available on WebAssembly. See :ref:`wasm-" +"availability` for more information." msgstr "" #: library/compileall.rst:22 @@ -125,7 +124,7 @@ msgstr "" #: library/compileall.rst:92 msgid "" "Use *N* workers to compile the files within the given directory. If ``0`` is " -"used, then the result of :func:`os.cpu_count` will be used." +"used, then the result of :func:`os.process_cpu_count` will be used." msgstr "" #: library/compileall.rst:98 diff --git a/library/concurrency.po b/library/concurrency.po index b76d99ef..e3bb46ef 100644 --- a/library/concurrency.po +++ b/library/concurrency.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" diff --git a/library/concurrent.futures.po b/library/concurrent.futures.po index 13b68ef4..ed46b940 100644 --- a/library/concurrent.futures.po +++ b/library/concurrent.futures.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -47,9 +47,8 @@ msgstr "" #: includes/wasm-notavail.rst:5 msgid "" -"This module does not work or is not available on WebAssembly platforms " -"``wasm32-emscripten`` and ``wasm32-wasi``. See :ref:`wasm-availability` for " -"more information." +"This module does not work or is not available on WebAssembly. See :ref:`wasm-" +"availability` for more information." msgstr "" #: library/concurrent.futures.rst:25 @@ -265,7 +264,7 @@ msgid "" "easier debugging." msgstr "" -#: library/concurrent.futures.rst:179 library/concurrent.futures.rst:283 +#: library/concurrent.futures.rst:179 library/concurrent.futures.rst:287 msgid "Added the *initializer* and *initargs* arguments." msgstr "" @@ -283,11 +282,17 @@ msgid "" "*max_workers* worker threads too." msgstr "" -#: library/concurrent.futures.rst:195 +#: library/concurrent.futures.rst:191 +msgid "" +"Default value of *max_workers* is changed to ``min(32, (os." +"process_cpu_count() or 1) + 4)``." +msgstr "" + +#: library/concurrent.futures.rst:199 msgid "ThreadPoolExecutor Example" msgstr "" -#: library/concurrent.futures.rst:198 +#: library/concurrent.futures.rst:202 msgid "" "import concurrent.futures\n" "import urllib.request\n" @@ -296,7 +301,7 @@ msgid "" " 'http://www.cnn.com/',\n" " 'http://europe.wsj.com/',\n" " 'http://www.bbc.co.uk/',\n" -" 'http://nonexistant-subdomain.python.org/']\n" +" 'http://nonexistent-subdomain.python.org/']\n" "\n" "# Retrieve a single page and report the URL and contents\n" "def load_url(url, timeout):\n" @@ -318,11 +323,11 @@ msgid "" " print('%r page is %d bytes' % (url, len(data)))" msgstr "" -#: library/concurrent.futures.rst:227 +#: library/concurrent.futures.rst:231 msgid "ProcessPoolExecutor" msgstr "" -#: library/concurrent.futures.rst:229 +#: library/concurrent.futures.rst:233 msgid "" "The :class:`ProcessPoolExecutor` class is an :class:`Executor` subclass that " "uses a pool of processes to execute calls asynchronously. :class:" @@ -332,35 +337,35 @@ msgid "" "returned." msgstr "" -#: library/concurrent.futures.rst:236 +#: library/concurrent.futures.rst:240 msgid "" "The ``__main__`` module must be importable by worker subprocesses. This " "means that :class:`ProcessPoolExecutor` will not work in the interactive " "interpreter." msgstr "" -#: library/concurrent.futures.rst:239 +#: library/concurrent.futures.rst:243 msgid "" "Calling :class:`Executor` or :class:`Future` methods from a callable " "submitted to a :class:`ProcessPoolExecutor` will result in deadlock." msgstr "" -#: library/concurrent.futures.rst:244 +#: library/concurrent.futures.rst:248 msgid "" "An :class:`Executor` subclass that executes calls asynchronously using a " "pool of at most *max_workers* processes. If *max_workers* is ``None`` or " -"not given, it will default to the number of processors on the machine. If " -"*max_workers* is less than or equal to ``0``, then a :exc:`ValueError` will " -"be raised. On Windows, *max_workers* must be less than or equal to ``61``. " -"If it is not then :exc:`ValueError` will be raised. If *max_workers* is " -"``None``, then the default chosen will be at most ``61``, even if more " -"processors are available. *mp_context* can be a :mod:`multiprocessing` " -"context or ``None``. It will be used to launch the workers. If *mp_context* " -"is ``None`` or not given, the default :mod:`multiprocessing` context is " -"used. See :ref:`multiprocessing-start-methods`." +"not given, it will default to :func:`os.process_cpu_count`. If *max_workers* " +"is less than or equal to ``0``, then a :exc:`ValueError` will be raised. On " +"Windows, *max_workers* must be less than or equal to ``61``. If it is not " +"then :exc:`ValueError` will be raised. If *max_workers* is ``None``, then " +"the default chosen will be at most ``61``, even if more processors are " +"available. *mp_context* can be a :mod:`multiprocessing` context or ``None``. " +"It will be used to launch the workers. If *mp_context* is ``None`` or not " +"given, the default :mod:`multiprocessing` context is used. See :ref:" +"`multiprocessing-start-methods`." msgstr "" -#: library/concurrent.futures.rst:258 +#: library/concurrent.futures.rst:262 msgid "" "*initializer* is an optional callable that is called at the start of each " "worker process; *initargs* is a tuple of arguments passed to the " @@ -369,7 +374,7 @@ msgid "" "well as any attempt to submit more jobs to the pool." msgstr "" -#: library/concurrent.futures.rst:264 +#: library/concurrent.futures.rst:268 msgid "" "*max_tasks_per_child* is an optional argument that specifies the maximum " "number of tasks a single process can execute before it will exit and be " @@ -380,7 +385,7 @@ msgid "" "with the \"fork\" start method." msgstr "" -#: library/concurrent.futures.rst:272 +#: library/concurrent.futures.rst:276 msgid "" "When one of the worker processes terminates abruptly, a :exc:`~concurrent." "futures.process.BrokenProcessPool` error is now raised. Previously, " @@ -388,13 +393,13 @@ msgid "" "often freeze or deadlock." msgstr "" -#: library/concurrent.futures.rst:279 +#: library/concurrent.futures.rst:283 msgid "" "The *mp_context* argument was added to allow users to control the " "start_method for worker processes created by the pool." msgstr "" -#: library/concurrent.futures.rst:286 +#: library/concurrent.futures.rst:290 msgid "" "The default :mod:`multiprocessing` start method (see :ref:`multiprocessing-" "start-methods`) will change away from *fork* in Python 3.14. Code that " @@ -403,13 +408,13 @@ msgid "" "get_context(\"fork\")`` parameter." msgstr "" -#: library/concurrent.futures.rst:293 +#: library/concurrent.futures.rst:297 msgid "" "The *max_tasks_per_child* argument was added to allow users to control the " "lifetime of workers in the pool." msgstr "" -#: library/concurrent.futures.rst:297 +#: library/concurrent.futures.rst:301 msgid "" "On POSIX systems, if your application has multiple threads and the :mod:" "`multiprocessing` context uses the ``\"fork\"`` start method: The :func:`os." @@ -418,11 +423,17 @@ msgid "" "start method. See the :func:`os.fork` documentation for further explanation." msgstr "" -#: library/concurrent.futures.rst:308 +#: library/concurrent.futures.rst:309 +msgid "" +"*max_workers* uses :func:`os.process_cpu_count` by default, instead of :func:" +"`os.cpu_count`." +msgstr "" + +#: library/concurrent.futures.rst:316 msgid "ProcessPoolExecutor Example" msgstr "" -#: library/concurrent.futures.rst:311 +#: library/concurrent.futures.rst:319 msgid "" "import concurrent.futures\n" "import math\n" @@ -458,24 +469,24 @@ msgid "" " main()" msgstr "" -#: library/concurrent.futures.rst:346 +#: library/concurrent.futures.rst:354 msgid "Future Objects" msgstr "" -#: library/concurrent.futures.rst:348 +#: library/concurrent.futures.rst:356 msgid "" "The :class:`Future` class encapsulates the asynchronous execution of a " "callable. :class:`Future` instances are created by :meth:`Executor.submit`." msgstr "" -#: library/concurrent.futures.rst:353 +#: library/concurrent.futures.rst:361 msgid "" "Encapsulates the asynchronous execution of a callable. :class:`Future` " "instances are created by :meth:`Executor.submit` and should not be created " "directly except for testing." msgstr "" -#: library/concurrent.futures.rst:359 +#: library/concurrent.futures.rst:367 msgid "" "Attempt to cancel the call. If the call is currently being executed or " "finished running and cannot be cancelled then the method will return " @@ -483,22 +494,22 @@ msgid "" "``True``." msgstr "" -#: library/concurrent.futures.rst:366 +#: library/concurrent.futures.rst:374 msgid "Return ``True`` if the call was successfully cancelled." msgstr "" -#: library/concurrent.futures.rst:370 +#: library/concurrent.futures.rst:378 msgid "" "Return ``True`` if the call is currently being executed and cannot be " "cancelled." msgstr "" -#: library/concurrent.futures.rst:375 +#: library/concurrent.futures.rst:383 msgid "" "Return ``True`` if the call was successfully cancelled or finished running." msgstr "" -#: library/concurrent.futures.rst:380 +#: library/concurrent.futures.rst:388 msgid "" "Return the value returned by the call. If the call hasn't yet completed then " "this method will wait up to *timeout* seconds. If the call hasn't completed " @@ -507,18 +518,18 @@ msgid "" "no limit to the wait time." msgstr "" -#: library/concurrent.futures.rst:387 library/concurrent.futures.rst:401 +#: library/concurrent.futures.rst:395 library/concurrent.futures.rst:409 msgid "" "If the future is cancelled before completing then :exc:`.CancelledError` " "will be raised." msgstr "" -#: library/concurrent.futures.rst:390 +#: library/concurrent.futures.rst:398 msgid "" "If the call raised an exception, this method will raise the same exception." msgstr "" -#: library/concurrent.futures.rst:394 +#: library/concurrent.futures.rst:402 msgid "" "Return the exception raised by the call. If the call hasn't yet completed " "then this method will wait up to *timeout* seconds. If the call hasn't " @@ -527,18 +538,18 @@ msgid "" "``None``, there is no limit to the wait time." msgstr "" -#: library/concurrent.futures.rst:404 +#: library/concurrent.futures.rst:412 msgid "If the call completed without raising, ``None`` is returned." msgstr "" -#: library/concurrent.futures.rst:408 +#: library/concurrent.futures.rst:416 msgid "" "Attaches the callable *fn* to the future. *fn* will be called, with the " "future as its only argument, when the future is cancelled or finishes " "running." msgstr "" -#: library/concurrent.futures.rst:412 +#: library/concurrent.futures.rst:420 msgid "" "Added callables are called in the order that they were added and are always " "called in a thread belonging to the process that added them. If the " @@ -547,26 +558,26 @@ msgid "" "behavior is undefined." msgstr "" -#: library/concurrent.futures.rst:418 +#: library/concurrent.futures.rst:426 msgid "" "If the future has already completed or been cancelled, *fn* will be called " "immediately." msgstr "" -#: library/concurrent.futures.rst:421 +#: library/concurrent.futures.rst:429 msgid "" "The following :class:`Future` methods are meant for use in unit tests and :" "class:`Executor` implementations." msgstr "" -#: library/concurrent.futures.rst:426 +#: library/concurrent.futures.rst:434 msgid "" "This method should only be called by :class:`Executor` implementations " "before executing the work associated with the :class:`Future` and by unit " "tests." msgstr "" -#: library/concurrent.futures.rst:430 +#: library/concurrent.futures.rst:438 msgid "" "If the method returns ``False`` then the :class:`Future` was cancelled, i." "e. :meth:`Future.cancel` was called and returned ``True``. Any threads " @@ -574,47 +585,47 @@ msgid "" "or :func:`wait`) will be woken up." msgstr "" -#: library/concurrent.futures.rst:435 +#: library/concurrent.futures.rst:443 msgid "" "If the method returns ``True`` then the :class:`Future` was not cancelled " "and has been put in the running state, i.e. calls to :meth:`Future.running` " "will return ``True``." msgstr "" -#: library/concurrent.futures.rst:439 +#: library/concurrent.futures.rst:447 msgid "" "This method can only be called once and cannot be called after :meth:`Future." "set_result` or :meth:`Future.set_exception` have been called." msgstr "" -#: library/concurrent.futures.rst:445 +#: library/concurrent.futures.rst:453 msgid "" "Sets the result of the work associated with the :class:`Future` to *result*." msgstr "" -#: library/concurrent.futures.rst:448 library/concurrent.futures.rst:461 +#: library/concurrent.futures.rst:456 library/concurrent.futures.rst:469 msgid "" "This method should only be used by :class:`Executor` implementations and " "unit tests." msgstr "" -#: library/concurrent.futures.rst:451 library/concurrent.futures.rst:464 +#: library/concurrent.futures.rst:459 library/concurrent.futures.rst:472 msgid "" "This method raises :exc:`concurrent.futures.InvalidStateError` if the :class:" "`Future` is already done." msgstr "" -#: library/concurrent.futures.rst:458 +#: library/concurrent.futures.rst:466 msgid "" "Sets the result of the work associated with the :class:`Future` to the :" "class:`Exception` *exception*." msgstr "" -#: library/concurrent.futures.rst:470 +#: library/concurrent.futures.rst:478 msgid "Module Functions" msgstr "" -#: library/concurrent.futures.rst:474 +#: library/concurrent.futures.rst:482 msgid "" "Wait for the :class:`Future` instances (possibly created by different :class:" "`Executor` instances) given by *fs* to complete. Duplicate futures given to " @@ -625,43 +636,43 @@ msgid "" "running futures)." msgstr "" -#: library/concurrent.futures.rst:482 +#: library/concurrent.futures.rst:490 msgid "" "*timeout* can be used to control the maximum number of seconds to wait " "before returning. *timeout* can be an int or float. If *timeout* is not " "specified or ``None``, there is no limit to the wait time." msgstr "" -#: library/concurrent.futures.rst:486 +#: library/concurrent.futures.rst:494 msgid "" "*return_when* indicates when this function should return. It must be one of " "the following constants:" msgstr "" -#: library/concurrent.futures.rst:492 +#: library/concurrent.futures.rst:500 msgid "Constant" msgstr "" -#: library/concurrent.futures.rst:493 +#: library/concurrent.futures.rst:501 msgid "Description" msgstr "" -#: library/concurrent.futures.rst:496 +#: library/concurrent.futures.rst:504 msgid "The function will return when any future finishes or is cancelled." msgstr "" -#: library/concurrent.futures.rst:499 +#: library/concurrent.futures.rst:507 msgid "" "The function will return when any future finishes by raising an exception. " "If no future raises an exception then it is equivalent to :const:" "`ALL_COMPLETED`." msgstr "" -#: library/concurrent.futures.rst:504 +#: library/concurrent.futures.rst:512 msgid "The function will return when all futures finish or are cancelled." msgstr "" -#: library/concurrent.futures.rst:508 +#: library/concurrent.futures.rst:516 msgid "" "Returns an iterator over the :class:`Future` instances (possibly created by " "different :class:`Executor` instances) given by *fs* that yields futures as " @@ -674,55 +685,55 @@ msgid "" "*timeout* is not specified or ``None``, there is no limit to the wait time." msgstr "" -#: library/concurrent.futures.rst:521 +#: library/concurrent.futures.rst:529 msgid ":pep:`3148` -- futures - execute computations asynchronously" msgstr "" -#: library/concurrent.futures.rst:522 +#: library/concurrent.futures.rst:530 msgid "" "The proposal which described this feature for inclusion in the Python " "standard library." msgstr "" -#: library/concurrent.futures.rst:527 +#: library/concurrent.futures.rst:535 msgid "Exception classes" msgstr "" -#: library/concurrent.futures.rst:533 +#: library/concurrent.futures.rst:541 msgid "Raised when a future is cancelled." msgstr "" -#: library/concurrent.futures.rst:537 +#: library/concurrent.futures.rst:545 msgid "" "A deprecated alias of :exc:`TimeoutError`, raised when a future operation " "exceeds the given timeout." msgstr "" -#: library/concurrent.futures.rst:542 +#: library/concurrent.futures.rst:550 msgid "This class was made an alias of :exc:`TimeoutError`." msgstr "" -#: library/concurrent.futures.rst:547 +#: library/concurrent.futures.rst:555 msgid "" "Derived from :exc:`RuntimeError`, this exception class is raised when an " "executor is broken for some reason, and cannot be used to submit or execute " "new tasks." msgstr "" -#: library/concurrent.futures.rst:555 +#: library/concurrent.futures.rst:563 msgid "" "Raised when an operation is performed on a future that is not allowed in the " "current state." msgstr "" -#: library/concurrent.futures.rst:564 +#: library/concurrent.futures.rst:572 msgid "" "Derived from :exc:`~concurrent.futures.BrokenExecutor`, this exception class " "is raised when one of the workers of a :class:`~concurrent.futures." "ThreadPoolExecutor` has failed initializing." msgstr "" -#: library/concurrent.futures.rst:575 +#: library/concurrent.futures.rst:583 msgid "" "Derived from :exc:`~concurrent.futures.BrokenExecutor` (formerly :exc:" "`RuntimeError`), this exception class is raised when one of the workers of " diff --git a/library/concurrent.po b/library/concurrent.po index 1d298ed7..3050434c 100644 --- a/library/concurrent.po +++ b/library/concurrent.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" diff --git a/library/configparser.po b/library/configparser.po index 1a47c1c3..a812ae0d 100644 --- a/library/configparser.po +++ b/library/configparser.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -175,7 +175,7 @@ msgid "" "and stored in lowercase [1]_." msgstr "" -#: library/configparser.rst:967 +#: library/configparser.rst:1003 msgid "" "It is possible to read several configurations into a single :class:" "`ConfigParser`, where the most recently added configuration has the highest " @@ -185,13 +185,13 @@ msgid "" "``example.ini`` file." msgstr "" -#: library/configparser.rst:974 +#: library/configparser.rst:1010 msgid "" "[DEFAULT]\n" "ServerAliveInterval = -1" msgstr "" -#: library/configparser.rst:979 +#: library/configparser.rst:1015 msgid "" ">>> config_override = configparser.ConfigParser()\n" ">>> config_override['DEFAULT'] = {'ServerAliveInterval': '-1'}\n" @@ -353,16 +353,24 @@ msgstr "" #: library/configparser.rst:283 msgid "" +"The first section name may be omitted if the parser is configured to allow " +"an unnamed top level section with ``allow_unnamed_section=True``. In this " +"case, the keys/values may be retrieved by :const:`UNNAMED_SECTION` as in " +"``config[UNNAMED_SECTION]``." +msgstr "" + +#: library/configparser.rst:288 +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:350 +#: library/configparser.rst:376 msgid "For example:" msgstr "" -#: library/configparser.rst:289 +#: library/configparser.rst:294 msgid "" "[Simple Values]\n" "key=value\n" @@ -407,18 +415,42 @@ msgid "" " # Did I mention we can indent comments, too?" msgstr "" -#: library/configparser.rst:335 +#: library/configparser.rst:342 +msgid "Unnamed Sections" +msgstr "" + +#: library/configparser.rst:344 +msgid "" +"The name of the first section (or unique) may be omitted and values " +"retrieved by the :const:`UNNAMED_SECTION` attribute." +msgstr "" + +#: library/configparser.rst:347 +msgid "" +">>> config = \"\"\"\n" +"... option = value\n" +"...\n" +"... [ Section 2 ]\n" +"... another = val\n" +"... \"\"\"\n" +">>> unnamed = configparser.ConfigParser(allow_unnamed_section=True)\n" +">>> unnamed.read_string(config)\n" +">>> unnamed.get(configparser.UNNAMED_SECTION, 'option')\n" +"'value'" +msgstr "" + +#: library/configparser.rst:361 msgid "Interpolation of values" msgstr "" -#: library/configparser.rst:337 +#: library/configparser.rst:363 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:345 +#: library/configparser.rst:371 msgid "" "The default implementation used by :class:`ConfigParser`. It enables values " "to contain format strings which refer to other values in the same section, " @@ -426,7 +458,7 @@ msgid "" "can be provided on initialization." msgstr "" -#: library/configparser.rst:352 +#: library/configparser.rst:378 msgid "" "[Paths]\n" "home_dir: /Users\n" @@ -439,7 +471,7 @@ msgid "" "gain: 80%%" msgstr "" -#: library/configparser.rst:363 +#: library/configparser.rst:389 msgid "" "In the example above, :class:`ConfigParser` with *interpolation* set to " "``BasicInterpolation()`` would resolve ``%(home_dir)s`` to the value of " @@ -449,14 +481,14 @@ msgid "" "specific order in the configuration file." msgstr "" -#: library/configparser.rst:370 +#: library/configparser.rst:396 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:378 +#: library/configparser.rst:404 msgid "" "An alternative handler for interpolation which implements a more advanced " "syntax, used for instance in ``zc.buildout``. Extended interpolation is " @@ -466,13 +498,13 @@ msgid "" "possibly the default values from the special section)." msgstr "" -#: library/configparser.rst:385 +#: library/configparser.rst:411 msgid "" "For example, the configuration specified above with basic interpolation, " "would look like this with extended interpolation:" msgstr "" -#: library/configparser.rst:388 +#: library/configparser.rst:414 msgid "" "[Paths]\n" "home_dir: /Users\n" @@ -485,11 +517,11 @@ msgid "" "cost: $$80" msgstr "" -#: library/configparser.rst:399 +#: library/configparser.rst:425 msgid "Values from other sections can be fetched as well:" msgstr "" -#: library/configparser.rst:401 +#: library/configparser.rst:427 msgid "" "[Common]\n" "home_dir: /Users\n" @@ -509,11 +541,11 @@ msgid "" "python_dir: ${Frameworks:path}/Python/Versions/${Frameworks:Python}" msgstr "" -#: library/configparser.rst:421 +#: library/configparser.rst:447 msgid "Mapping Protocol Access" msgstr "" -#: library/configparser.rst:425 +#: library/configparser.rst:451 msgid "" "Mapping protocol access is a generic name for functionality that enables " "using custom objects as if they were dictionaries. In case of :mod:" @@ -521,7 +553,7 @@ msgid "" "``parser['section']['option']`` notation." msgstr "" -#: library/configparser.rst:430 +#: library/configparser.rst:456 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 " @@ -530,7 +562,7 @@ msgid "" "original parser." msgstr "" -#: library/configparser.rst:436 +#: library/configparser.rst:462 msgid "" ":mod:`configparser` objects behave as close to actual dictionaries as " "possible. The mapping interface is complete and adheres to the :class:" @@ -538,7 +570,7 @@ msgid "" "that should be taken into account:" msgstr "" -#: library/configparser.rst:441 +#: library/configparser.rst:467 msgid "" "By default, all keys in sections are accessible in a case-insensitive manner " "[1]_. E.g. ``for option in parser[\"section\"]`` yields only " @@ -547,13 +579,13 @@ msgid "" "expressions return ``True``::" msgstr "" -#: library/configparser.rst:446 +#: library/configparser.rst:472 msgid "" "\"a\" in parser[\"section\"]\n" "\"A\" in parser[\"section\"]" msgstr "" -#: library/configparser.rst:449 +#: library/configparser.rst:475 msgid "" "All sections include ``DEFAULTSECT`` values as well which means that ``." "clear()`` on a section may not leave the section visibly empty. This is " @@ -563,30 +595,30 @@ msgid "" "default value causes a :exc:`KeyError`." msgstr "" -#: library/configparser.rst:456 +#: library/configparser.rst:482 msgid "``DEFAULTSECT`` cannot be removed from the parser:" msgstr "" -#: library/configparser.rst:458 +#: library/configparser.rst:484 msgid "trying to delete it raises :exc:`ValueError`," msgstr "" -#: library/configparser.rst:460 +#: library/configparser.rst:486 msgid "``parser.clear()`` leaves it intact," msgstr "" -#: library/configparser.rst:462 +#: library/configparser.rst:488 msgid "``parser.popitem()`` never returns it." msgstr "" -#: library/configparser.rst:464 +#: library/configparser.rst:490 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:468 +#: library/configparser.rst:494 msgid "" "``parser.items()`` is compatible with the mapping protocol (returns a list " "of *section_name*, *section_proxy* pairs including the DEFAULTSECT). " @@ -596,18 +628,18 @@ msgid "" "(unless ``raw=True`` is provided)." msgstr "" -#: library/configparser.rst:475 +#: library/configparser.rst:501 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:481 +#: library/configparser.rst:507 msgid "Customizing Parser Behaviour" msgstr "" -#: library/configparser.rst:483 +#: library/configparser.rst:509 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 " @@ -616,17 +648,17 @@ msgid "" "customize some of the features." msgstr "" -#: library/configparser.rst:489 +#: library/configparser.rst:515 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:492 +#: library/configparser.rst:518 msgid "*defaults*, default value: ``None``" msgstr "" -#: library/configparser.rst:494 +#: library/configparser.rst:520 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 " @@ -634,17 +666,17 @@ msgid "" "the documented default." msgstr "" -#: library/configparser.rst:499 +#: library/configparser.rst:525 msgid "" "Hint: if you want to specify default values for a specific section, use :" "meth:`~ConfigParser.read_dict` before you read the actual file." msgstr "" -#: library/configparser.rst:502 +#: library/configparser.rst:528 msgid "*dict_type*, default value: :class:`dict`" msgstr "" -#: library/configparser.rst:504 +#: library/configparser.rst:530 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, " @@ -652,20 +684,20 @@ msgid "" "goes for options within sections." msgstr "" -#: library/configparser.rst:509 +#: library/configparser.rst:535 msgid "" "An alternative dictionary type can be used for example to sort sections and " "options on write-back." msgstr "" -#: library/configparser.rst:512 +#: library/configparser.rst:538 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:516 +#: library/configparser.rst:542 msgid "" ">>> parser = configparser.ConfigParser()\n" ">>> parser.read_dict({'section1': {'key1': 'value1',\n" @@ -684,11 +716,11 @@ msgid "" "['foo', 'bar', 'baz']" msgstr "" -#: library/configparser.rst:534 +#: library/configparser.rst:560 msgid "*allow_no_value*, default value: ``False``" msgstr "" -#: library/configparser.rst:536 +#: library/configparser.rst:562 msgid "" "Some configuration files are known to include settings without values, but " "which otherwise conform to the syntax supported by :mod:`configparser`. The " @@ -696,7 +728,7 @@ msgid "" "such values should be accepted:" msgstr "" -#: library/configparser.rst:541 +#: library/configparser.rst:567 msgid "" ">>> import configparser\n" "\n" @@ -727,32 +759,32 @@ msgid "" "KeyError: 'does-not-exist'" msgstr "" -#: library/configparser.rst:571 +#: library/configparser.rst:597 msgid "*delimiters*, default value: ``('=', ':')``" msgstr "" -#: library/configparser.rst:573 +#: library/configparser.rst:599 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:577 +#: library/configparser.rst:603 msgid "" "See also the *space_around_delimiters* argument to :meth:`ConfigParser." "write`." msgstr "" -#: library/configparser.rst:580 +#: library/configparser.rst:606 msgid "*comment_prefixes*, default value: ``('#', ';')``" msgstr "" -#: library/configparser.rst:582 +#: library/configparser.rst:608 msgid "*inline_comment_prefixes*, default value: ``None``" msgstr "" -#: library/configparser.rst:584 +#: library/configparser.rst:610 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 " @@ -762,13 +794,13 @@ msgid "" "used as prefixes for whole line comments." msgstr "" -#: library/configparser.rst:591 +#: library/configparser.rst:617 msgid "" "In previous versions of :mod:`configparser` behaviour matched " "``comment_prefixes=('#',';')`` and ``inline_comment_prefixes=(';',)``." msgstr "" -#: library/configparser.rst:595 +#: library/configparser.rst:621 msgid "" "Please note that config parsers don't support escaping of comment prefixes " "so using *inline_comment_prefixes* may prevent users from specifying option " @@ -778,7 +810,7 @@ msgid "" "values is to interpolate the prefix, for example::" msgstr "" -#: library/configparser.rst:602 +#: library/configparser.rst:628 msgid "" ">>> from configparser import ConfigParser, ExtendedInterpolation\n" ">>> parser = ConfigParser(interpolation=ExtendedInterpolation())\n" @@ -820,11 +852,11 @@ msgid "" "line #3" msgstr "" -#: library/configparser.rst:641 +#: library/configparser.rst:667 msgid "*strict*, default value: ``True``" msgstr "" -#: library/configparser.rst:643 +#: library/configparser.rst:669 msgid "" "When set to ``True``, the parser will not allow for any section or option " "duplicates while reading from a single source (using :meth:`~ConfigParser." @@ -832,17 +864,17 @@ msgid "" "read_dict`). It is recommended to use strict parsers in new applications." msgstr "" -#: library/configparser.rst:648 +#: library/configparser.rst:674 msgid "" "In previous versions of :mod:`configparser` behaviour matched " "``strict=False``." msgstr "" -#: library/configparser.rst:652 +#: library/configparser.rst:678 msgid "*empty_lines_in_values*, default value: ``True``" msgstr "" -#: library/configparser.rst:654 +#: library/configparser.rst:680 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 " @@ -852,7 +884,7 @@ msgid "" "lose track of the file structure. Take for instance:" msgstr "" -#: library/configparser.rst:661 +#: library/configparser.rst:687 msgid "" "[Section]\n" "key = multiline\n" @@ -861,7 +893,7 @@ msgid "" " this = is still a part of the multiline value of 'key'" msgstr "" -#: library/configparser.rst:669 +#: library/configparser.rst:695 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 " @@ -870,13 +902,13 @@ msgid "" "would produce two keys, ``key`` and ``this``." msgstr "" -#: library/configparser.rst:675 +#: library/configparser.rst:701 msgid "" "*default_section*, default value: ``configparser.DEFAULTSECT`` (that is: " "``\"DEFAULT\"``)" msgstr "" -#: library/configparser.rst:678 +#: library/configparser.rst:704 msgid "" "The convention of allowing a special section of default values for other " "sections or interpolation purposes is a powerful concept of this library, " @@ -890,11 +922,11 @@ msgid "" "files from one format to another)." msgstr "" -#: library/configparser.rst:689 +#: library/configparser.rst:715 msgid "*interpolation*, default value: ``configparser.BasicInterpolation``" msgstr "" -#: library/configparser.rst:691 +#: library/configparser.rst:717 msgid "" "Interpolation behaviour may be customized by providing a custom handler " "through the *interpolation* argument. ``None`` can be used to turn off " @@ -904,11 +936,11 @@ msgid "" "`RawConfigParser` has a default value of ``None``." msgstr "" -#: library/configparser.rst:698 +#: library/configparser.rst:724 msgid "*converters*, default value: not set" msgstr "" -#: library/configparser.rst:700 +#: library/configparser.rst:726 msgid "" "Config parsers provide option value getters that perform type conversion. " "By default :meth:`~ConfigParser.getint`, :meth:`~ConfigParser.getfloat`, " @@ -922,7 +954,7 @@ msgid "" "``parser_instance['section'].getdecimal('key', 0)``." msgstr "" -#: library/configparser.rst:711 +#: library/configparser.rst:737 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 " @@ -930,14 +962,14 @@ msgid "" "the dict-compatible form (see the ``getdecimal()`` example above)." msgstr "" -#: library/configparser.rst:716 +#: library/configparser.rst:742 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:722 +#: library/configparser.rst:748 msgid "" "By default when using :meth:`~ConfigParser.getboolean`, config parsers " "consider the following values ``True``: ``'1'``, ``'yes'``, ``'true'``, " @@ -946,7 +978,7 @@ msgid "" "strings and their Boolean outcomes. For example:" msgstr "" -#: library/configparser.rst:728 +#: library/configparser.rst:754 msgid "" ">>> custom = configparser.ConfigParser()\n" ">>> custom['section1'] = {'funky': 'nope'}\n" @@ -959,13 +991,13 @@ msgid "" "False" msgstr "" -#: library/configparser.rst:740 +#: library/configparser.rst:766 msgid "" "Other typical Boolean pairs include ``accept``/``reject`` or ``enabled``/" "``disabled``." msgstr "" -#: library/configparser.rst:746 +#: library/configparser.rst:772 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 " @@ -973,7 +1005,7 @@ msgid "" "method if that's unsuitable. For example:" msgstr "" -#: library/configparser.rst:752 +#: library/configparser.rst:778 msgid "" ">>> config = \"\"\"\n" "... [Section1]\n" @@ -997,14 +1029,14 @@ msgid "" "['AnotherKey']" msgstr "" -#: library/configparser.rst:776 +#: library/configparser.rst:802 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:783 +#: library/configparser.rst:809 msgid "" "A compiled regular expression used to parse section headers. The default " "matches ``[section]`` to the name ``\"section\"``. Whitespace is considered " @@ -1013,7 +1045,7 @@ msgid "" "example:" msgstr "" -#: library/configparser.rst:789 +#: library/configparser.rst:815 msgid "" ">>> import re\n" ">>> config = \"\"\"\n" @@ -1034,18 +1066,18 @@ msgid "" "['Section 1', 'Section 2']" msgstr "" -#: library/configparser.rst:811 +#: library/configparser.rst:837 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:817 +#: library/configparser.rst:843 msgid "Legacy API Examples" msgstr "" -#: library/configparser.rst:819 +#: library/configparser.rst:845 msgid "" "Mainly because of backwards compatibility concerns, :mod:`configparser` " "provides also a legacy API with explicit ``get``/``set`` methods. While " @@ -1054,11 +1086,11 @@ msgid "" "advanced, low-level and downright counterintuitive." msgstr "" -#: library/configparser.rst:825 +#: library/configparser.rst:851 msgid "An example of writing to a configuration file::" msgstr "" -#: library/configparser.rst:827 +#: library/configparser.rst:853 msgid "" "import configparser\n" "\n" @@ -1082,11 +1114,11 @@ msgid "" " config.write(configfile)" msgstr "" -#: library/configparser.rst:848 +#: library/configparser.rst:874 msgid "An example of reading the configuration file again::" msgstr "" -#: library/configparser.rst:850 +#: library/configparser.rst:876 msgid "" "import configparser\n" "\n" @@ -1105,11 +1137,11 @@ msgid "" " print(config.get('Section1', 'foo'))" msgstr "" -#: library/configparser.rst:866 +#: library/configparser.rst:892 msgid "To get interpolation, use :class:`ConfigParser`::" msgstr "" -#: library/configparser.rst:868 +#: library/configparser.rst:894 msgid "" "import configparser\n" "\n" @@ -1144,13 +1176,13 @@ msgid "" " # -> None" msgstr "" -#: library/configparser.rst:899 +#: library/configparser.rst:925 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:928 msgid "" "import configparser\n" "\n" @@ -1164,11 +1196,11 @@ msgid "" "print(config.get('Section1', 'foo')) # -> \"Life is hard!\"" msgstr "" -#: library/configparser.rst:917 +#: library/configparser.rst:943 msgid "ConfigParser Objects" msgstr "" -#: library/configparser.rst:921 +#: library/configparser.rst:953 msgid "" "The main configuration parser. When *defaults* is given, it is initialized " "into the dictionary of intrinsic defaults. When *dict_type* is given, it " @@ -1176,7 +1208,7 @@ msgid "" "the options within a section, and for the default values." msgstr "" -#: library/configparser.rst:926 +#: library/configparser.rst:958 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 " @@ -1185,7 +1217,7 @@ msgid "" "as the set of substrings that prefix comments in non-empty lines." msgstr "" -#: library/configparser.rst:932 +#: library/configparser.rst:964 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, " @@ -1198,7 +1230,7 @@ msgid "" "without the trailing delimiter." msgstr "" -#: library/configparser.rst:942 +#: library/configparser.rst:974 msgid "" "When *default_section* is given, it specifies the name for the special " "section holding default values for other sections and interpolation purposes " @@ -1208,7 +1240,7 @@ msgid "" "settings to a new config file." msgstr "" -#: library/configparser.rst:949 +#: library/configparser.rst:981 msgid "" "Interpolation behaviour may be customized by providing a custom handler " "through the *interpolation* argument. ``None`` can be used to turn off " @@ -1217,7 +1249,7 @@ msgid "" "`dedicated documentation section <#interpolation-of-values>`_." msgstr "" -#: library/configparser.rst:955 +#: library/configparser.rst:987 msgid "" "All option names used in interpolation will be passed through the :meth:" "`optionxform` method just like any other option name reference. For " @@ -1226,7 +1258,7 @@ msgid "" "%(BAR)s`` are equivalent." msgstr "" -#: library/configparser.rst:961 +#: library/configparser.rst:993 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 " @@ -1235,44 +1267,61 @@ msgid "" "object and section proxies." msgstr "" -#: library/configparser.rst:992 +#: library/configparser.rst:999 +msgid "" +"When *allow_unnamed_section* is ``True`` (default: ``False``), the first " +"section name can be omitted. See the `\"Unnamed Sections\" section <#unnamed-" +"sections>`_." +msgstr "" + +#: library/configparser.rst:1028 msgid "The default *dict_type* is :class:`collections.OrderedDict`." msgstr "" -#: library/configparser.rst:995 +#: library/configparser.rst:1320 msgid "" "*allow_no_value*, *delimiters*, *comment_prefixes*, *strict*, " "*empty_lines_in_values*, *default_section* and *interpolation* were added." msgstr "" -#: library/configparser.rst:1000 +#: library/configparser.rst:1325 msgid "The *converters* argument was added." msgstr "" -#: library/configparser.rst:1003 +#: library/configparser.rst:1039 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:1271 +#: library/configparser.rst:1328 msgid "" "The default *dict_type* is :class:`dict`, since it now preserves insertion " "order." msgstr "" -#: library/configparser.rst:1014 +#: library/configparser.rst:1048 +msgid "" +"Raise a :exc:`MultilineContinuationError` when *allow_no_value* is ``True``, " +"and a key without a value is continued with an indented line." +msgstr "" + +#: library/configparser.rst:1332 +msgid "The *allow_unnamed_section* argument was added." +msgstr "" + +#: library/configparser.rst:1057 msgid "Return a dictionary containing the instance-wide defaults." msgstr "" -#: library/configparser.rst:1019 +#: library/configparser.rst:1062 msgid "" "Return a list of the sections available; the *default section* is not " "included in the list." msgstr "" -#: library/configparser.rst:1025 +#: library/configparser.rst:1068 msgid "" "Add a section named *section* to the instance. If a section by the given " "name already exists, :exc:`DuplicateSectionError` is raised. If the " @@ -1280,34 +1329,34 @@ msgid "" "the section must be a string; if not, :exc:`TypeError` is raised." msgstr "" -#: library/configparser.rst:1030 +#: library/configparser.rst:1073 msgid "Non-string section names raise :exc:`TypeError`." msgstr "" -#: library/configparser.rst:1036 +#: library/configparser.rst:1079 msgid "" "Indicates whether the named *section* is present in the configuration. The " "*default section* is not acknowledged." msgstr "" -#: library/configparser.rst:1042 +#: library/configparser.rst:1085 msgid "Return a list of options available in the specified *section*." msgstr "" -#: library/configparser.rst:1047 +#: library/configparser.rst:1090 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:1054 +#: library/configparser.rst:1097 msgid "" "Attempt to read and parse an iterable of filenames, returning a list of " "filenames which were successfully parsed." msgstr "" -#: library/configparser.rst:1057 +#: library/configparser.rst:1100 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* " @@ -1318,7 +1367,7 @@ msgid "" "be read." msgstr "" -#: library/configparser.rst:1066 +#: library/configparser.rst:1109 msgid "" "If none of the named files exist, the :class:`ConfigParser` instance will " "contain an empty dataset. An application which requires initial values to " @@ -1326,7 +1375,7 @@ msgid "" "`read_file` before calling :meth:`read` for any optional files::" msgstr "" -#: library/configparser.rst:1072 +#: library/configparser.rst:1115 msgid "" "import configparser, os\n" "\n" @@ -1336,49 +1385,49 @@ msgid "" " encoding='cp1250')" msgstr "" -#: library/configparser.rst:1079 +#: library/configparser.rst:1122 msgid "" "Added the *encoding* parameter. Previously, all files were read using the " "default encoding for :func:`open`." msgstr "" -#: library/configparser.rst:1083 +#: library/configparser.rst:1126 msgid "The *filenames* parameter accepts a :term:`path-like object`." msgstr "" -#: library/configparser.rst:1086 +#: library/configparser.rst:1129 msgid "The *filenames* parameter accepts a :class:`bytes` object." msgstr "" -#: library/configparser.rst:1092 +#: library/configparser.rst:1135 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:1095 +#: library/configparser.rst:1138 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:1099 +#: library/configparser.rst:1142 msgid "Replaces :meth:`!readfp`." msgstr "" -#: library/configparser.rst:1104 +#: library/configparser.rst:1147 msgid "Parse configuration data from a string." msgstr "" -#: library/configparser.rst:1106 +#: library/configparser.rst:1149 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:1115 +#: library/configparser.rst:1158 msgid "" "Load configuration from any object that provides a dict-like ``items()`` " "method. Keys are section names, values are dictionaries with keys and " @@ -1387,17 +1436,17 @@ msgid "" "automatically converted to strings." msgstr "" -#: library/configparser.rst:1121 +#: library/configparser.rst:1164 msgid "" "Optional argument *source* specifies a context-specific name of the " "dictionary passed. If not given, ```` is used." msgstr "" -#: library/configparser.rst:1124 +#: library/configparser.rst:1167 msgid "This method can be used to copy state between parsers." msgstr "" -#: library/configparser.rst:1131 +#: library/configparser.rst:1174 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), " @@ -1406,35 +1455,35 @@ msgid "" "provided as a *fallback* value." msgstr "" -#: library/configparser.rst:1137 +#: library/configparser.rst:1180 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:1141 +#: library/configparser.rst:1184 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:1149 +#: library/configparser.rst:1192 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:1156 +#: library/configparser.rst:1199 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:1163 +#: library/configparser.rst:1206 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 " @@ -1446,34 +1495,34 @@ msgid "" "*fallback*." msgstr "" -#: library/configparser.rst:1176 +#: library/configparser.rst:1219 msgid "" "When *section* is not given, return a list of *section_name*, " "*section_proxy* pairs, including DEFAULTSECT." msgstr "" -#: library/configparser.rst:1179 +#: library/configparser.rst:1222 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:1183 +#: library/configparser.rst:1226 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:1191 +#: library/configparser.rst:1234 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:1198 +#: library/configparser.rst:1241 msgid "" "Write a representation of the configuration to the specified :term:`file " "object`, which must be opened in text mode (accepting strings). This " @@ -1482,27 +1531,27 @@ msgid "" "surrounded by spaces." msgstr "" -#: library/configparser.rst:1206 +#: library/configparser.rst:1249 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:1214 +#: library/configparser.rst:1257 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:1222 +#: library/configparser.rst:1265 msgid "" "Remove the specified *section* from the configuration. If the section in " "fact existed, return ``True``. Otherwise return ``False``." msgstr "" -#: library/configparser.rst:1228 +#: library/configparser.rst:1271 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 " @@ -1511,7 +1560,7 @@ msgid "" "of this name on instances to affect this behavior." msgstr "" -#: library/configparser.rst:1234 +#: library/configparser.rst:1277 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 " @@ -1519,30 +1568,36 @@ msgid "" "sensitive::" msgstr "" -#: library/configparser.rst:1239 +#: library/configparser.rst:1282 msgid "" "cfgparser = ConfigParser()\n" "cfgparser.optionxform = str" msgstr "" -#: library/configparser.rst:1242 +#: library/configparser.rst:1285 msgid "" "Note that when reading configuration files, whitespace around the option " "names is stripped before :meth:`optionxform` is called." msgstr "" -#: library/configparser.rst:1248 +#: library/configparser.rst:1291 +msgid "" +"A special object representing a section name used to reference the unnamed " +"section (see :ref:`unnamed-sections`)." +msgstr "" + +#: library/configparser.rst:1296 msgid "" "The maximum depth for recursive interpolation for :meth:`~configparser." "ConfigParser.get` when the *raw* parameter is false. This is relevant only " "when the default *interpolation* is used." msgstr "" -#: library/configparser.rst:1256 +#: library/configparser.rst:1304 msgid "RawConfigParser Objects" msgstr "" -#: library/configparser.rst:1266 +#: library/configparser.rst:1315 msgid "" "Legacy variant of the :class:`ConfigParser`. It has interpolation disabled " "by default and allows for non-string section names, option names, and values " @@ -1550,27 +1605,27 @@ msgid "" "``defaults=`` keyword argument handling." msgstr "" -#: library/configparser.rst:1276 +#: library/configparser.rst:1336 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:1283 +#: library/configparser.rst:1343 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:1287 +#: library/configparser.rst:1347 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:1293 +#: library/configparser.rst:1353 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:" @@ -1580,7 +1635,7 @@ msgid "" "string values." msgstr "" -#: library/configparser.rst:1300 +#: library/configparser.rst:1360 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 " @@ -1588,32 +1643,32 @@ msgid "" "not allow such assignments to take place." msgstr "" -#: library/configparser.rst:1307 +#: library/configparser.rst:1367 msgid "Exceptions" msgstr "" -#: library/configparser.rst:1311 +#: library/configparser.rst:1371 msgid "Base class for all other :mod:`configparser` exceptions." msgstr "" -#: library/configparser.rst:1316 +#: library/configparser.rst:1376 msgid "Exception raised when a specified section is not found." msgstr "" -#: library/configparser.rst:1321 +#: library/configparser.rst:1381 msgid "" "Exception raised if :meth:`~ConfigParser.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:1325 +#: library/configparser.rst:1385 msgid "" "Added the optional *source* and *lineno* attributes and parameters to :meth:" "`!__init__`." msgstr "" -#: library/configparser.rst:1332 +#: library/configparser.rst:1392 msgid "" "Exception raised by strict parsers if a single option appears twice during " "reading from a single file, string or dictionary. This catches misspellings " @@ -1621,58 +1676,64 @@ msgid "" "representing the same case-insensitive configuration key." msgstr "" -#: library/configparser.rst:1340 +#: library/configparser.rst:1400 msgid "" "Exception raised when a specified option is not found in the specified " "section." msgstr "" -#: library/configparser.rst:1346 +#: library/configparser.rst:1406 msgid "" "Base class for exceptions raised when problems occur performing string " "interpolation." msgstr "" -#: library/configparser.rst:1352 +#: library/configparser.rst:1412 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:1359 +#: library/configparser.rst:1419 msgid "" "Exception raised when an option referenced from a value does not exist. " "Subclass of :exc:`InterpolationError`." msgstr "" -#: library/configparser.rst:1365 +#: library/configparser.rst:1425 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:1371 +#: library/configparser.rst:1431 msgid "" "Exception raised when attempting to parse a file which has no section " "headers." msgstr "" -#: library/configparser.rst:1377 +#: library/configparser.rst:1437 msgid "Exception raised when errors occur attempting to parse a file." msgstr "" -#: library/configparser.rst:1379 +#: library/configparser.rst:1439 msgid "" "The ``filename`` attribute and :meth:`!__init__` constructor argument were " "removed. They have been available using the name ``source`` since 3.2." msgstr "" -#: library/configparser.rst:1384 +#: library/configparser.rst:1445 +msgid "" +"Exception raised when a key without a corresponding value is continued with " +"an indented line." +msgstr "" + +#: library/configparser.rst:1451 msgid "Footnotes" msgstr "" -#: library/configparser.rst:1385 +#: library/configparser.rst:1452 msgid "" "Config parsers allow for heavy customization. If you are interested in " "changing the behaviour outlined by the footnote reference, consult the " @@ -1699,14 +1760,14 @@ msgstr "" msgid "Windows ini file" msgstr "" -#: library/configparser.rst:341 +#: library/configparser.rst:367 msgid "% (percent)" msgstr "" -#: library/configparser.rst:374 +#: library/configparser.rst:400 msgid "interpolation in configuration files" msgstr "" -#: library/configparser.rst:374 +#: library/configparser.rst:400 msgid "$ (dollar)" msgstr "" diff --git a/library/constants.po b/library/constants.po index bd0c5d15..2798aed5 100644 --- a/library/constants.po +++ b/library/constants.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" diff --git a/library/contextlib.po b/library/contextlib.po index fa3e2e20..8fc25773 100644 --- a/library/contextlib.po +++ b/library/contextlib.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -72,7 +72,7 @@ msgid "" "While many objects natively support use in with statements, sometimes a " "resource needs to be managed that isn't a context manager in its own right, " "and doesn't implement a ``close()`` method for use with ``contextlib." -"closing``" +"closing``." msgstr "" #: library/contextlib.rst:54 diff --git a/library/contextvars.po b/library/contextvars.po index cdff3fc1..5b752848 100644 --- a/library/contextvars.po +++ b/library/contextvars.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -203,45 +203,90 @@ msgstr "" #: library/contextvars.rst:147 msgid "" -"Every thread will have a different top-level :class:`~contextvars.Context` " -"object. This means that a :class:`ContextVar` object behaves in a similar " -"fashion to :func:`threading.local` when values are assigned in different " -"threads." +"Each thread has its own effective stack of :class:`!Context` objects. The :" +"term:`current context` is the :class:`!Context` object at the top of the " +"current thread's stack. All :class:`!Context` objects in the stacks are " +"considered to be *entered*." msgstr "" #: library/contextvars.rst:152 -msgid "Context implements the :class:`collections.abc.Mapping` interface." +msgid "" +"*Entering* a context, which can be done by calling its :meth:`~Context.run` " +"method, makes the context the current context by pushing it onto the top of " +"the current thread's context stack." msgstr "" #: library/contextvars.rst:156 msgid "" -"Execute ``callable(*args, **kwargs)`` code in the context object the *run* " -"method is called on. Return the result of the execution or propagate an " -"exception if one occurred." +"*Exiting* from the current context, which can be done by returning from the " +"callback passed to the :meth:`~Context.run` method, restores the current " +"context to what it was before the context was entered by popping the context " +"off the top of the context stack." msgstr "" -#: library/contextvars.rst:160 +#: library/contextvars.rst:161 msgid "" -"Any changes to any context variables that *callable* makes will be contained " -"in the context object::" +"Since each thread has its own context stack, :class:`ContextVar` objects " +"behave in a similar fashion to :func:`threading.local` when values are " +"assigned in different threads." msgstr "" -#: library/contextvars.rst:163 +#: library/contextvars.rst:165 msgid "" -"var = ContextVar('var')\n" +"Attempting to enter an already entered context, including contexts entered " +"in other threads, raises a :exc:`RuntimeError`." +msgstr "" + +#: library/contextvars.rst:168 +msgid "After exiting a context, it can later be re-entered (from any thread)." +msgstr "" + +#: library/contextvars.rst:170 +msgid "" +"Any changes to :class:`ContextVar` values via the :meth:`ContextVar.set` " +"method are recorded in the current context. The :meth:`ContextVar.get` " +"method returns the value associated with the current context. Exiting a " +"context effectively reverts any changes made to context variables while the " +"context was entered (if needed, the values can be restored by re-entering " +"the context)." +msgstr "" + +#: library/contextvars.rst:177 +msgid "Context implements the :class:`collections.abc.Mapping` interface." +msgstr "" + +#: library/contextvars.rst:181 +msgid "" +"Enters the Context, executes ``callable(*args, **kwargs)``, then exits the " +"Context. Returns *callable*'s return value, or propagates an exception if " +"one occurred." +msgstr "" + +#: library/contextvars.rst:185 +msgid "Example:" +msgstr "" + +#: library/contextvars.rst:187 +msgid "" +"import contextvars\n" +"\n" +"var = contextvars.ContextVar('var')\n" "var.set('spam')\n" +"print(var.get()) # 'spam'\n" +"\n" +"ctx = contextvars.copy_context()\n" "\n" "def main():\n" " # 'var' was set to 'spam' before\n" " # calling 'copy_context()' and 'ctx.run(main)', so:\n" -" # var.get() == ctx[var] == 'spam'\n" +" print(var.get()) # 'spam'\n" +" print(ctx[var]) # 'spam'\n" "\n" " var.set('ham')\n" "\n" " # Now, after setting 'var' to 'ham':\n" -" # var.get() == ctx[var] == 'ham'\n" -"\n" -"ctx = copy_context()\n" +" print(var.get()) # 'ham'\n" +" print(ctx[var]) # 'ham'\n" "\n" "# Any changes that the 'main' function makes to 'var'\n" "# will be contained in 'ctx'.\n" @@ -249,67 +294,61 @@ msgid "" "\n" "# The 'main()' function was run in the 'ctx' context,\n" "# so changes to 'var' are contained in it:\n" -"# ctx[var] == 'ham'\n" +"print(ctx[var]) # 'ham'\n" "\n" "# However, outside of 'ctx', 'var' is still set to 'spam':\n" -"# var.get() == 'spam'" -msgstr "" - -#: library/contextvars.rst:189 -msgid "" -"The method raises a :exc:`RuntimeError` when called on the same context " -"object from more than one OS thread, or when called recursively." +"print(var.get()) # 'spam'" msgstr "" -#: library/contextvars.rst:195 +#: library/contextvars.rst:233 msgid "Return a shallow copy of the context object." msgstr "" -#: library/contextvars.rst:199 +#: library/contextvars.rst:237 msgid "" "Return ``True`` if the *context* has a value for *var* set; return ``False`` " "otherwise." msgstr "" -#: library/contextvars.rst:204 +#: library/contextvars.rst:242 msgid "" "Return the value of the *var* :class:`ContextVar` variable. If the variable " "is not set in the context object, a :exc:`KeyError` is raised." msgstr "" -#: library/contextvars.rst:210 +#: library/contextvars.rst:248 msgid "" "Return the value for *var* if *var* has the value in the context object. " "Return *default* otherwise. If *default* is not given, return ``None``." msgstr "" -#: library/contextvars.rst:216 +#: library/contextvars.rst:254 msgid "Return an iterator over the variables stored in the context object." msgstr "" -#: library/contextvars.rst:221 +#: library/contextvars.rst:259 msgid "Return the number of variables set in the context object." msgstr "" -#: library/contextvars.rst:225 +#: library/contextvars.rst:263 msgid "Return a list of all variables in the context object." msgstr "" -#: library/contextvars.rst:229 +#: library/contextvars.rst:267 msgid "Return a list of all variables' values in the context object." msgstr "" -#: library/contextvars.rst:234 +#: library/contextvars.rst:272 msgid "" "Return a list of 2-tuples containing all variables and their values in the " "context object." msgstr "" -#: library/contextvars.rst:239 +#: library/contextvars.rst:277 msgid "asyncio support" msgstr "" -#: library/contextvars.rst:241 +#: library/contextvars.rst:279 msgid "" "Context variables are natively supported in :mod:`asyncio` and are ready to " "be used without any extra configuration. For example, here is a simple echo " @@ -317,7 +356,7 @@ msgid "" "available in the Task that handles that client::" msgstr "" -#: library/contextvars.rst:247 +#: library/contextvars.rst:285 msgid "" "import asyncio\n" "import contextvars\n" diff --git a/library/copy.po b/library/copy.po index b1990e6d..1fe89fcc 100644 --- a/library/copy.po +++ b/library/copy.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -39,71 +39,77 @@ msgid "Interface summary:" msgstr "" #: library/copy.rst:22 -msgid "Return a shallow copy of *x*." +msgid "Return a shallow copy of *obj*." msgstr "" #: library/copy.rst:27 -msgid "Return a deep copy of *x*." +msgid "Return a deep copy of *obj*." msgstr "" #: library/copy.rst:32 +msgid "" +"Creates a new object of the same type as *obj*, replacing fields with values " +"from *changes*." +msgstr "" + +#: library/copy.rst:40 msgid "Raised for module specific errors." msgstr "" -#: library/copy.rst:36 +#: library/copy.rst:44 msgid "" "The difference between shallow and deep copying is only relevant for " "compound objects (objects that contain other objects, like lists or class " "instances):" msgstr "" -#: library/copy.rst:39 +#: library/copy.rst:47 msgid "" "A *shallow copy* constructs a new compound object and then (to the extent " "possible) inserts *references* into it to the objects found in the original." msgstr "" -#: library/copy.rst:42 +#: library/copy.rst:50 msgid "" "A *deep copy* constructs a new compound object and then, recursively, " "inserts *copies* into it of the objects found in the original." msgstr "" -#: library/copy.rst:45 +#: library/copy.rst:53 msgid "" "Two problems often exist with deep copy operations that don't exist with " "shallow copy operations:" msgstr "" -#: library/copy.rst:48 +#: library/copy.rst:56 msgid "" "Recursive objects (compound objects that, directly or indirectly, contain a " "reference to themselves) may cause a recursive loop." msgstr "" -#: library/copy.rst:51 +#: library/copy.rst:59 msgid "" "Because deep copy copies everything it may copy too much, such as data which " "is intended to be shared between copies." msgstr "" -#: library/copy.rst:54 +#: library/copy.rst:62 msgid "The :func:`deepcopy` function avoids these problems by:" msgstr "" -#: library/copy.rst:56 +#: library/copy.rst:64 msgid "" "keeping a ``memo`` dictionary of objects already copied during the current " "copying pass; and" msgstr "" -#: library/copy.rst:59 +#: library/copy.rst:67 msgid "" "letting user-defined classes override the copying operation or the set of " "components copied." msgstr "" -#: library/copy.rst:62 +#: library/copy.rst:70 msgid "" "This module does not copy types like module, method, stack trace, stack " "frame, file, socket, window, or any similar types. It does \"copy\" " @@ -112,14 +118,14 @@ msgid "" "`pickle` module." msgstr "" -#: library/copy.rst:67 +#: library/copy.rst:75 msgid "" "Shallow copies of dictionaries can be made using :meth:`dict.copy`, and of " "lists by assigning a slice of the entire list, for example, ``copied_list = " "original_list[:]``." msgstr "" -#: library/copy.rst:73 +#: library/copy.rst:81 msgid "" "Classes can use the same interfaces to control copying that they use to " "control pickling. See the description of module :mod:`pickle` for " @@ -127,49 +133,67 @@ msgid "" "registered pickle functions from the :mod:`copyreg` module." msgstr "" -#: library/copy.rst:82 +#: library/copy.rst:92 msgid "" "In order for a class to define its own copy implementation, it can define " "special methods :meth:`~object.__copy__` and :meth:`~object.__deepcopy__`." msgstr "" -#: library/copy.rst:88 +#: library/copy.rst:98 msgid "" "Called to implement the shallow copy operation; no additional arguments are " "passed." msgstr "" -#: library/copy.rst:94 +#: library/copy.rst:104 msgid "" "Called to implement the deep copy operation; it is passed one argument, the " "*memo* dictionary. If the ``__deepcopy__`` implementation needs to make a " -"deep copy of a component, it should call the :func:`deepcopy` function with " -"the component as first argument and the *memo* dictionary as second " +"deep copy of a component, it should call the :func:`~copy.deepcopy` function " +"with the component as first argument and the *memo* dictionary as second " "argument. The *memo* dictionary should be treated as an opaque object." msgstr "" -#: library/copy.rst:103 +#: library/copy.rst:114 +msgid "" +"Function :func:`!copy.replace` is more limited than :func:`~copy.copy` and :" +"func:`~copy.deepcopy`, and only supports named tuples created by :func:" +"`~collections.namedtuple`, :mod:`dataclasses`, and other classes which " +"define method :meth:`~object.__replace__`." +msgstr "" + +#: library/copy.rst:122 +msgid "" +"This method should create a new object of the same type, replacing fields " +"with values from *changes*." +msgstr "" + +#: library/copy.rst:128 msgid "Module :mod:`pickle`" msgstr "" -#: library/copy.rst:104 +#: library/copy.rst:129 msgid "" "Discussion of the special methods used to support object state retrieval and " "restoration." msgstr "" -#: library/copy.rst:71 +#: library/copy.rst:79 msgid "module" msgstr "" -#: library/copy.rst:71 +#: library/copy.rst:79 msgid "pickle" msgstr "" -#: library/copy.rst:78 +#: library/copy.rst:86 msgid "__copy__() (copy protocol)" msgstr "" -#: library/copy.rst:78 +#: library/copy.rst:86 msgid "__deepcopy__() (copy protocol)" msgstr "" + +#: library/copy.rst:111 +msgid "__replace__() (replace protocol)" +msgstr "" diff --git a/library/copyreg.po b/library/copyreg.po index c48f9ef5..53218618 100644 --- a/library/copyreg.po +++ b/library/copyreg.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" diff --git a/library/crypt.po b/library/crypt.po index bb3b6d27..a235ce37 100644 --- a/library/crypt.po +++ b/library/crypt.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -18,231 +18,26 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" #: library/crypt.rst:2 -msgid ":mod:`crypt` --- Function to check Unix passwords" +msgid ":mod:`!crypt` --- Function to check Unix passwords" msgstr "" -#: library/crypt.rst:13 -msgid "**Source code:** :source:`Lib/crypt.py`" -msgstr "" - -#: library/crypt.rst:19 -msgid "" -"The :mod:`crypt` module is deprecated (see :pep:`PEP 594 <594#crypt>` for " -"details and alternatives). The :mod:`hashlib` module is a potential " -"replacement for certain use cases. The :pypi:`passlib` package can replace " -"all use cases of this module." -msgstr "" - -#: library/crypt.rst:27 -msgid "" -"This module implements an interface to the :manpage:`crypt(3)` routine, " -"which is a one-way hash function based upon a modified DES algorithm; see " -"the Unix man page for further details. Possible uses include storing hashed " -"passwords so you can check passwords without storing the actual password, or " -"attempting to crack Unix passwords with a dictionary." -msgstr "" - -#: library/crypt.rst:35 -msgid "" -"Notice that the behavior of this module depends on the actual " -"implementation of the :manpage:`crypt(3)` routine in the running system. " -"Therefore, any extensions available on the current implementation will also " -"be available on this module." -msgstr "" - -#: includes/wasm-notavail.rst:3 -msgid "Availability" -msgstr "" - -#: includes/wasm-notavail.rst:5 -msgid "" -"This module does not work or is not available on WebAssembly platforms " -"``wasm32-emscripten`` and ``wasm32-wasi``. See :ref:`wasm-availability` for " -"more information." -msgstr "" - -#: library/crypt.rst:45 -msgid "Hashing Methods" -msgstr "" - -#: library/crypt.rst:49 -msgid "" -"The :mod:`crypt` module defines the list of hashing methods (not all methods " -"are available on all platforms):" -msgstr "" - -#: library/crypt.rst:54 -msgid "" -"A Modular Crypt Format method with 16 character salt and 86 character hash " -"based on the SHA-512 hash function. This is the strongest method." -msgstr "" - -#: library/crypt.rst:59 -msgid "" -"Another Modular Crypt Format method with 16 character salt and 43 character " -"hash based on the SHA-256 hash function." -msgstr "" - -#: library/crypt.rst:64 -msgid "" -"Another Modular Crypt Format method with 22 character salt and 31 character " -"hash based on the Blowfish cipher." -msgstr "" - -#: library/crypt.rst:71 -msgid "" -"Another Modular Crypt Format method with 8 character salt and 22 character " -"hash based on the MD5 hash function." -msgstr "" - -#: library/crypt.rst:76 -msgid "" -"The traditional method with a 2 character salt and 13 characters of hash. " -"This is the weakest method." -msgstr "" - -#: library/crypt.rst:81 -msgid "Module Attributes" -msgstr "" - -#: library/crypt.rst:87 -msgid "" -"A list of available password hashing algorithms, as ``crypt.METHOD_*`` " -"objects. This list is sorted from strongest to weakest." -msgstr "" - -#: library/crypt.rst:93 -msgid "Module Functions" -msgstr "" - -#: library/crypt.rst:95 -msgid "The :mod:`crypt` module defines the following functions:" -msgstr "" - -#: library/crypt.rst:99 -msgid "" -"*word* will usually be a user's password as typed at a prompt or in a " -"graphical interface. The optional *salt* is either a string as returned " -"from :func:`mksalt`, one of the ``crypt.METHOD_*`` values (though not all " -"may be available on all platforms), or a full encrypted password including " -"salt, as returned by this function. If *salt* is not provided, the " -"strongest method available in :attr:`methods` will be used." -msgstr "" - -#: library/crypt.rst:106 -msgid "" -"Checking a password is usually done by passing the plain-text password as " -"*word* and the full results of a previous :func:`crypt` call, which should " -"be the same as the results of this call." -msgstr "" - -#: library/crypt.rst:110 -msgid "" -"*salt* (either a random 2 or 16 character string, possibly prefixed with " -"``$digit$`` to indicate the method) which will be used to perturb the " -"encryption algorithm. The characters in *salt* must be in the set ``[./a-zA-" -"Z0-9]``, with the exception of Modular Crypt Format which prefixes a " -"``$digit$``." -msgstr "" - -#: library/crypt.rst:116 -msgid "" -"Returns the hashed password as a string, which will be composed of " -"characters from the same alphabet as the salt." -msgstr "" - -#: library/crypt.rst:121 +#: library/crypt.rst:10 msgid "" -"Since a few :manpage:`crypt(3)` extensions allow different values, with " -"different sizes in the *salt*, it is recommended to use the full crypted " -"password as salt when checking for a password." -msgstr "" - -#: library/crypt.rst:125 -msgid "Accept ``crypt.METHOD_*`` values in addition to strings for *salt*." +"This module is no longer part of the Python standard library. It was :ref:" +"`removed in Python 3.13 ` after being deprecated in " +"Python 3.11. The removal was decided in :pep:`594`." msgstr "" -#: library/crypt.rst:131 +#: library/crypt.rst:14 msgid "" -"Return a randomly generated salt of the specified method. If no *method* is " -"given, the strongest method available in :attr:`methods` is used." +"Applications can use the :mod:`hashlib` module from the standard library. " +"Other possible replacements are third-party libraries from PyPI: :pypi:" +"`legacycrypt`, :pypi:`bcrypt`, :pypi:`argon2-cffi`, or :pypi:`passlib`. " +"These are not supported or maintained by the Python core team." msgstr "" -#: library/crypt.rst:135 -msgid "" -"The return value is a string suitable for passing as the *salt* argument to :" -"func:`crypt`." -msgstr "" - -#: library/crypt.rst:138 -msgid "" -"*rounds* specifies the number of rounds for ``METHOD_SHA256``, " -"``METHOD_SHA512`` and ``METHOD_BLOWFISH``. For ``METHOD_SHA256`` and " -"``METHOD_SHA512`` it must be an integer between ``1000`` and " -"``999_999_999``, the default is ``5000``. For ``METHOD_BLOWFISH`` it must " -"be a power of two between ``16`` (2\\ :sup:`4`) and ``2_147_483_648`` (2\\ :" -"sup:`31`), the default is ``4096`` (2\\ :sup:`12`)." -msgstr "" - -#: library/crypt.rst:148 -msgid "Added the *rounds* parameter." -msgstr "" - -#: library/crypt.rst:153 -msgid "Examples" -msgstr "" - -#: library/crypt.rst:155 -msgid "" -"A simple example illustrating typical use (a constant-time comparison " -"operation is needed to limit exposure to timing attacks. :func:`hmac." -"compare_digest` is suitable for this purpose)::" -msgstr "" - -#: library/crypt.rst:159 -msgid "" -"import pwd\n" -"import crypt\n" -"import getpass\n" -"from hmac import compare_digest as compare_hash\n" -"\n" -"def login():\n" -" username = input('Python login: ')\n" -" cryptedpasswd = pwd.getpwnam(username)[1]\n" -" if cryptedpasswd:\n" -" if cryptedpasswd == 'x' or cryptedpasswd == '*':\n" -" raise ValueError('no support for shadow passwords')\n" -" cleartext = getpass.getpass()\n" -" return compare_hash(crypt.crypt(cleartext, cryptedpasswd), " -"cryptedpasswd)\n" -" else:\n" -" return True" -msgstr "" - -#: library/crypt.rst:175 -msgid "" -"To generate a hash of a password using the strongest available method and " -"check it against the original::" -msgstr "" - -#: library/crypt.rst:178 +#: library/crypt.rst:19 msgid "" -"import crypt\n" -"from hmac import compare_digest as compare_hash\n" -"\n" -"hashed = crypt.crypt(plaintext)\n" -"if not compare_hash(hashed, crypt.crypt(plaintext, hashed)):\n" -" raise ValueError(\"hashed version doesn't validate against original\")" -msgstr "" - -#: library/crypt.rst:33 library/crypt.rst:119 -msgid "crypt(3)" -msgstr "" - -#: library/crypt.rst:15 -msgid "cipher" -msgstr "" - -#: library/crypt.rst:15 -msgid "DES" +"The last version of Python that provided the :mod:`!crypt` module was " +"`Python 3.12 `_." msgstr "" diff --git a/library/crypto.po b/library/crypto.po index aade7ff2..6c2501e9 100644 --- a/library/crypto.po +++ b/library/crypto.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -25,8 +25,7 @@ msgstr "" msgid "" "The modules described in this chapter implement various algorithms of a " "cryptographic nature. They are available at the discretion of the " -"installation. On Unix systems, the :mod:`crypt` module may also be " -"available. Here's an overview:" +"installation. Here's an overview:" msgstr "" #: library/crypto.rst:7 diff --git a/library/csv.po b/library/csv.po index 972f0e81..1565178f 100644 --- a/library/csv.po +++ b/library/csv.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -440,26 +440,19 @@ msgid "" "``None`` and to otherwise behave as :data:`QUOTE_NONNUMERIC`." msgstr "" -#: library/csv.rst:370 -msgid "" -"Due to a bug, constants :data:`QUOTE_NOTNULL` and :data:`QUOTE_STRINGS` do " -"not affect behaviour of :class:`reader` objects. This bug is fixed in Python " -"3.13." -msgstr "" - -#: library/csv.rst:374 +#: library/csv.rst:368 msgid "The :mod:`csv` module defines the following exception:" msgstr "" -#: library/csv.rst:379 +#: library/csv.rst:373 msgid "Raised by any of the functions when an error is detected." msgstr "" -#: library/csv.rst:384 +#: library/csv.rst:378 msgid "Dialects and Formatting Parameters" msgstr "" -#: library/csv.rst:386 +#: library/csv.rst:380 msgid "" "To make it easier to specify the format of input and output records, " "specific formatting parameters are grouped together into dialects. A " @@ -472,16 +465,16 @@ msgid "" "attributes defined below for the :class:`Dialect` class." msgstr "" -#: library/csv.rst:396 +#: library/csv.rst:390 msgid "Dialects support the following attributes:" msgstr "" -#: library/csv.rst:401 +#: library/csv.rst:395 msgid "" "A one-character string used to separate fields. It defaults to ``','``." msgstr "" -#: library/csv.rst:406 +#: library/csv.rst:400 msgid "" "Controls how instances of *quotechar* appearing inside a field should " "themselves be quoted. When :const:`True`, the character is doubled. When :" @@ -489,13 +482,13 @@ msgid "" "defaults to :const:`True`." msgstr "" -#: library/csv.rst:411 +#: library/csv.rst:405 msgid "" "On output, if *doublequote* is :const:`False` and no *escapechar* is set, :" "exc:`Error` is raised if a *quotechar* is found in a field." msgstr "" -#: library/csv.rst:417 +#: library/csv.rst:411 msgid "" "A one-character string used by the writer to escape the *delimiter* if " "*quoting* is set to :const:`QUOTE_NONE` and the *quotechar* if *doublequote* " @@ -504,64 +497,64 @@ msgid "" "escaping." msgstr "" -#: library/csv.rst:422 +#: library/csv.rst:416 msgid "An empty *escapechar* is not allowed." msgstr "" -#: library/csv.rst:427 +#: library/csv.rst:421 msgid "" "The string used to terminate lines produced by the :class:`writer`. It " "defaults to ``'\\r\\n'``." msgstr "" -#: library/csv.rst:432 +#: library/csv.rst:426 msgid "" "The :class:`reader` is hard-coded to recognise either ``'\\r'`` or ``'\\n'`` " "as end-of-line, and ignores *lineterminator*. This behavior may change in " "the future." msgstr "" -#: library/csv.rst:439 +#: library/csv.rst:433 msgid "" "A one-character string used to quote fields containing special characters, " "such as the *delimiter* or *quotechar*, or which contain new-line " "characters. It defaults to ``'\"'``." msgstr "" -#: library/csv.rst:443 +#: library/csv.rst:437 msgid "An empty *quotechar* is not allowed." msgstr "" -#: library/csv.rst:448 +#: library/csv.rst:442 msgid "" "Controls when quotes should be generated by the writer and recognised by the " "reader. It can take on any of the :ref:`QUOTE_\\* constants ` and defaults to :const:`QUOTE_MINIMAL`." msgstr "" -#: library/csv.rst:455 +#: library/csv.rst:449 msgid "" "When :const:`True`, spaces immediately following the *delimiter* are " "ignored. The default is :const:`False`." msgstr "" -#: library/csv.rst:461 +#: library/csv.rst:455 msgid "" "When ``True``, raise exception :exc:`Error` on bad CSV input. The default is " "``False``." msgstr "" -#: library/csv.rst:467 +#: library/csv.rst:461 msgid "Reader Objects" msgstr "" -#: library/csv.rst:469 +#: library/csv.rst:463 msgid "" "Reader objects (:class:`DictReader` instances and objects returned by the :" "func:`reader` function) have the following public methods:" msgstr "" -#: library/csv.rst:474 +#: library/csv.rst:468 msgid "" "Return the next row of the reader's iterable object as a list (if the object " "was returned from :func:`reader`) or a dict (if it is a :class:`DictReader` " @@ -569,35 +562,35 @@ msgid "" "should call this as ``next(reader)``." msgstr "" -#: library/csv.rst:480 +#: library/csv.rst:474 msgid "Reader objects have the following public attributes:" msgstr "" -#: library/csv.rst:484 +#: library/csv.rst:478 msgid "A read-only description of the dialect in use by the parser." msgstr "" -#: library/csv.rst:489 +#: library/csv.rst:483 msgid "" "The number of lines read from the source iterator. This is not the same as " "the number of records returned, as records can span multiple lines." msgstr "" -#: library/csv.rst:493 +#: library/csv.rst:487 msgid "DictReader objects have the following public attribute:" msgstr "" -#: library/csv.rst:497 +#: library/csv.rst:491 msgid "" "If not passed as a parameter when creating the object, this attribute is " "initialized upon first access or when the first record is read from the file." msgstr "" -#: library/csv.rst:504 +#: library/csv.rst:498 msgid "Writer Objects" msgstr "" -#: library/csv.rst:506 +#: library/csv.rst:500 msgid "" ":class:`writer` objects (:class:`DictWriter` instances and objects returned " "by the :func:`writer` function) have the following public methods. A *row* " @@ -609,58 +602,58 @@ msgid "" "complex numbers at all)." msgstr "" -#: library/csv.rst:517 +#: library/csv.rst:511 msgid "" "Write the *row* parameter to the writer's file object, formatted according " "to the current :class:`Dialect`. Return the return value of the call to the " "*write* method of the underlying file object." msgstr "" -#: library/csv.rst:521 +#: library/csv.rst:515 msgid "Added support of arbitrary iterables." msgstr "" -#: library/csv.rst:526 +#: library/csv.rst:520 msgid "" "Write all elements in *rows* (an iterable of *row* objects as described " "above) to the writer's file object, formatted according to the current " "dialect." msgstr "" -#: library/csv.rst:530 +#: library/csv.rst:524 msgid "Writer objects have the following public attribute:" msgstr "" -#: library/csv.rst:535 +#: library/csv.rst:529 msgid "A read-only description of the dialect in use by the writer." msgstr "" -#: library/csv.rst:538 +#: library/csv.rst:532 msgid "DictWriter objects have the following public method:" msgstr "" -#: library/csv.rst:543 +#: library/csv.rst:537 msgid "" "Write a row with the field names (as specified in the constructor) to the " "writer's file object, formatted according to the current dialect. Return the " "return value of the :meth:`csvwriter.writerow` call used internally." msgstr "" -#: library/csv.rst:548 +#: library/csv.rst:542 msgid "" ":meth:`writeheader` now also returns the value returned by the :meth:" "`csvwriter.writerow` method it uses internally." msgstr "" -#: library/csv.rst:556 +#: library/csv.rst:550 msgid "Examples" msgstr "" -#: library/csv.rst:558 +#: library/csv.rst:552 msgid "The simplest example of reading a CSV file::" msgstr "" -#: library/csv.rst:560 +#: library/csv.rst:554 msgid "" "import csv\n" "with open('some.csv', newline='') as f:\n" @@ -669,11 +662,11 @@ msgid "" " print(row)" msgstr "" -#: library/csv.rst:566 +#: library/csv.rst:560 msgid "Reading a file with an alternate format::" msgstr "" -#: library/csv.rst:568 +#: library/csv.rst:562 msgid "" "import csv\n" "with open('passwd', newline='') as f:\n" @@ -682,11 +675,11 @@ msgid "" " print(row)" msgstr "" -#: library/csv.rst:574 +#: library/csv.rst:568 msgid "The corresponding simplest possible writing example is::" msgstr "" -#: library/csv.rst:576 +#: library/csv.rst:570 msgid "" "import csv\n" "with open('some.csv', 'w', newline='') as f:\n" @@ -694,7 +687,7 @@ msgid "" " writer.writerows(someiterable)" msgstr "" -#: library/csv.rst:581 +#: library/csv.rst:575 msgid "" "Since :func:`open` is used to open a CSV file for reading, the file will by " "default be decoded into unicode using the system default encoding (see :func:" @@ -702,7 +695,7 @@ msgid "" "``encoding`` argument of open::" msgstr "" -#: library/csv.rst:586 +#: library/csv.rst:580 msgid "" "import csv\n" "with open('some.csv', newline='', encoding='utf-8') as f:\n" @@ -711,17 +704,17 @@ msgid "" " print(row)" msgstr "" -#: library/csv.rst:592 +#: library/csv.rst:586 msgid "" "The same applies to writing in something other than the system default " "encoding: specify the encoding argument when opening the output file." msgstr "" -#: library/csv.rst:595 +#: library/csv.rst:589 msgid "Registering a new dialect::" msgstr "" -#: library/csv.rst:597 +#: library/csv.rst:591 msgid "" "import csv\n" "csv.register_dialect('unixpwd', delimiter=':', quoting=csv.QUOTE_NONE)\n" @@ -729,13 +722,13 @@ msgid "" " reader = csv.reader(f, 'unixpwd')" msgstr "" -#: library/csv.rst:602 +#: library/csv.rst:596 msgid "" "A slightly more advanced use of the reader --- catching and reporting " "errors::" msgstr "" -#: library/csv.rst:604 +#: library/csv.rst:598 msgid "" "import csv, sys\n" "filename = 'some.csv'\n" @@ -748,24 +741,24 @@ msgid "" " sys.exit('file {}, line {}: {}'.format(filename, reader.line_num, e))" msgstr "" -#: library/csv.rst:614 +#: library/csv.rst:608 msgid "" "And while the module doesn't directly support parsing strings, it can easily " "be done::" msgstr "" -#: library/csv.rst:617 +#: library/csv.rst:611 msgid "" "import csv\n" "for row in csv.reader(['one,two,three']):\n" " print(row)" msgstr "" -#: library/csv.rst:623 +#: library/csv.rst:617 msgid "Footnotes" msgstr "" -#: library/csv.rst:624 +#: library/csv.rst:618 msgid "" "If ``newline=''`` is not specified, newlines embedded inside quoted fields " "will not be interpreted correctly, and on platforms that use ``\\r\\n`` " diff --git a/library/ctypes.po b/library/ctypes.po index 40c7e640..f991b09f 100644 --- a/library/ctypes.po +++ b/library/ctypes.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -301,7 +301,7 @@ msgid "" "calls. ``None`` is passed as a C ``NULL`` pointer, bytes objects and strings " "are passed as pointer to the memory block that contains their data (:c:expr:" "`char *` or :c:expr:`wchar_t *`). Python integers are passed as the " -"platforms default C :c:expr:`int` type, their value is masked to fit into " +"platform's default C :c:expr:`int` type, their value is masked to fit into " "the C type." msgstr "" @@ -311,7 +311,7 @@ msgid "" "learn more about :mod:`ctypes` data types." msgstr "" -#: library/ctypes.rst:2237 +#: library/ctypes.rst:2242 msgid "Fundamental data types" msgstr "" @@ -581,7 +581,7 @@ msgid "" "Assigning a new value to instances of the pointer types :class:`c_char_p`, :" "class:`c_wchar_p`, and :class:`c_void_p` changes the *memory location* they " "point to, *not the contents* of the memory block (of course not, because " -"Python bytes objects are immutable)::" +"Python string objects are immutable)::" msgstr "" #: library/ctypes.rst:297 @@ -668,7 +668,8 @@ msgid "" ">>> printf(b\"%f bottles of beer\\n\", 42.5)\n" "Traceback (most recent call last):\n" " File \"\", line 1, in \n" -"ArgumentError: argument 2: TypeError: Don't know how to convert parameter 2\n" +"ctypes.ArgumentError: argument 2: TypeError: Don't know how to convert " +"parameter 2\n" ">>>" msgstr "" @@ -789,7 +790,8 @@ msgid "" ">>> printf(b\"%d %d %d\", 1, 2, 3)\n" "Traceback (most recent call last):\n" " File \"\", line 1, in \n" -"ArgumentError: argument 2: TypeError: wrong type\n" +"ctypes.ArgumentError: argument 2: TypeError: 'int' object cannot be " +"interpreted as ctypes.c_char_p\n" ">>> printf(b\"%s %d %f\\n\", b\"X\", 2, 3)\n" "X 2 3.000000\n" "13\n" @@ -1093,10 +1095,14 @@ msgid "" "compiler does it. It is possible to override this behavior by specifying a :" "attr:`~Structure._pack_` class attribute in the subclass definition. This " "must be set to a positive integer and specifies the maximum alignment for " -"the fields. This is what ``#pragma pack(n)`` also does in MSVC." +"the fields. This is what ``#pragma pack(n)`` also does in MSVC. It is also " +"possible to set a minimum alignment for how the subclass itself is packed in " +"the same way ``#pragma align(n)`` works in MSVC. This can be achieved by " +"specifying a :attr:`~Structure._align_` class attribute in the subclass " +"definition." msgstr "" -#: library/ctypes.rst:673 +#: library/ctypes.rst:677 msgid "" ":mod:`ctypes` uses the native byte order for Structures and Unions. To " "build structures with non-native byte order, you can use one of the :class:" @@ -1105,18 +1111,18 @@ msgid "" "classes cannot contain pointer fields." msgstr "" -#: library/ctypes.rst:683 +#: library/ctypes.rst:687 msgid "Bit fields in structures and unions" msgstr "" -#: library/ctypes.rst:685 +#: library/ctypes.rst:689 msgid "" "It is possible to create structures and unions containing bit fields. Bit " "fields are only possible for integer fields, the bit width is specified as " "the third item in the :attr:`~Structure._fields_` tuples::" msgstr "" -#: library/ctypes.rst:689 +#: library/ctypes.rst:693 msgid "" ">>> class Int(Structure):\n" "... _fields_ = [(\"first_16\", c_int, 16),\n" @@ -1129,33 +1135,33 @@ msgid "" ">>>" msgstr "" -#: library/ctypes.rst:703 +#: library/ctypes.rst:707 msgid "Arrays" msgstr "" -#: library/ctypes.rst:705 +#: library/ctypes.rst:709 msgid "" "Arrays are sequences, containing a fixed number of instances of the same " "type." msgstr "" -#: library/ctypes.rst:707 +#: library/ctypes.rst:711 msgid "" "The recommended way to create array types is by multiplying a data type with " "a positive integer::" msgstr "" -#: library/ctypes.rst:710 +#: library/ctypes.rst:714 msgid "TenPointsArrayType = POINT * 10" msgstr "" -#: library/ctypes.rst:712 +#: library/ctypes.rst:716 msgid "" "Here is an example of a somewhat artificial data type, a structure " "containing 4 POINTs among other stuff::" msgstr "" -#: library/ctypes.rst:715 +#: library/ctypes.rst:719 msgid "" ">>> from ctypes import *\n" ">>> class POINT(Structure):\n" @@ -1171,28 +1177,28 @@ msgid "" ">>>" msgstr "" -#: library/ctypes.rst:728 +#: library/ctypes.rst:732 msgid "Instances are created in the usual way, by calling the class::" msgstr "" -#: library/ctypes.rst:730 +#: library/ctypes.rst:734 msgid "" "arr = TenPointsArrayType()\n" "for pt in arr:\n" " print(pt.x, pt.y)" msgstr "" -#: library/ctypes.rst:734 +#: library/ctypes.rst:738 msgid "" "The above code print a series of ``0 0`` lines, because the array contents " "is initialized to zeros." msgstr "" -#: library/ctypes.rst:737 +#: library/ctypes.rst:741 msgid "Initializers of the correct type can also be specified::" msgstr "" -#: library/ctypes.rst:739 +#: library/ctypes.rst:743 msgid "" ">>> from ctypes import *\n" ">>> TenIntegers = c_int * 10\n" @@ -1205,17 +1211,17 @@ msgid "" ">>>" msgstr "" -#: library/ctypes.rst:753 +#: library/ctypes.rst:757 msgid "Pointers" msgstr "" -#: library/ctypes.rst:755 +#: library/ctypes.rst:759 msgid "" "Pointer instances are created by calling the :func:`pointer` function on a :" "mod:`ctypes` type::" msgstr "" -#: library/ctypes.rst:758 +#: library/ctypes.rst:762 msgid "" ">>> from ctypes import *\n" ">>> i = c_int(42)\n" @@ -1223,26 +1229,26 @@ msgid "" ">>>" msgstr "" -#: library/ctypes.rst:763 +#: library/ctypes.rst:767 msgid "" "Pointer instances have a :attr:`~_Pointer.contents` attribute which returns " "the object to which the pointer points, the ``i`` object above::" msgstr "" -#: library/ctypes.rst:766 +#: library/ctypes.rst:770 msgid "" ">>> pi.contents\n" "c_long(42)\n" ">>>" msgstr "" -#: library/ctypes.rst:770 +#: library/ctypes.rst:774 msgid "" "Note that :mod:`ctypes` does not have OOR (original object return), it " "constructs a new, equivalent object each time you retrieve an attribute::" msgstr "" -#: library/ctypes.rst:773 +#: library/ctypes.rst:777 msgid "" ">>> pi.contents is i\n" "False\n" @@ -1251,14 +1257,14 @@ msgid "" ">>>" msgstr "" -#: library/ctypes.rst:779 +#: library/ctypes.rst:783 msgid "" "Assigning another :class:`c_int` instance to the pointer's contents " "attribute would cause the pointer to point to the memory location where this " "is stored::" msgstr "" -#: library/ctypes.rst:782 +#: library/ctypes.rst:786 msgid "" ">>> i = c_int(99)\n" ">>> pi.contents = i\n" @@ -1267,22 +1273,22 @@ msgid "" ">>>" msgstr "" -#: library/ctypes.rst:791 +#: library/ctypes.rst:795 msgid "Pointer instances can also be indexed with integers::" msgstr "" -#: library/ctypes.rst:793 +#: library/ctypes.rst:797 msgid "" ">>> pi[0]\n" "99\n" ">>>" msgstr "" -#: library/ctypes.rst:797 +#: library/ctypes.rst:801 msgid "Assigning to an integer index changes the pointed to value::" msgstr "" -#: library/ctypes.rst:799 +#: library/ctypes.rst:803 msgid "" ">>> print(i)\n" "c_long(99)\n" @@ -1292,7 +1298,7 @@ msgid "" ">>>" msgstr "" -#: library/ctypes.rst:806 +#: library/ctypes.rst:810 msgid "" "It is also possible to use indexes different from 0, but you must know what " "you're doing, just as in C: You can access or change arbitrary memory " @@ -1301,7 +1307,7 @@ msgid "" "instead of a single item." msgstr "" -#: library/ctypes.rst:812 +#: library/ctypes.rst:816 msgid "" "Behind the scenes, the :func:`pointer` function does more than simply create " "pointer instances, it has to create pointer *types* first. This is done with " @@ -1309,7 +1315,7 @@ msgid "" "returns a new type::" msgstr "" -#: library/ctypes.rst:817 +#: library/ctypes.rst:821 msgid "" ">>> PI = POINTER(c_int)\n" ">>> PI\n" @@ -1323,13 +1329,13 @@ msgid "" ">>>" msgstr "" -#: library/ctypes.rst:828 +#: library/ctypes.rst:832 msgid "" "Calling the pointer type without an argument creates a ``NULL`` pointer. " "``NULL`` pointers have a ``False`` boolean value::" msgstr "" -#: library/ctypes.rst:831 +#: library/ctypes.rst:835 msgid "" ">>> null_ptr = POINTER(c_int)()\n" ">>> print(bool(null_ptr))\n" @@ -1337,13 +1343,13 @@ msgid "" ">>>" msgstr "" -#: library/ctypes.rst:836 +#: library/ctypes.rst:840 msgid "" ":mod:`ctypes` checks for ``NULL`` when dereferencing pointers (but " "dereferencing invalid non-\\ ``NULL`` pointers would crash Python)::" msgstr "" -#: library/ctypes.rst:839 +#: library/ctypes.rst:843 msgid "" ">>> null_ptr[0]\n" "Traceback (most recent call last):\n" @@ -1358,11 +1364,11 @@ msgid "" ">>>" msgstr "" -#: library/ctypes.rst:855 +#: library/ctypes.rst:859 msgid "Type conversions" msgstr "" -#: library/ctypes.rst:857 +#: library/ctypes.rst:861 msgid "" "Usually, ctypes does strict type checking. This means, if you have " "``POINTER(c_int)`` in the :attr:`~_CFuncPtr.argtypes` list of a function or " @@ -1373,7 +1379,7 @@ msgid "" "ctypes accepts an array of c_int::" msgstr "" -#: library/ctypes.rst:864 +#: library/ctypes.rst:868 msgid "" ">>> class Bar(Structure):\n" "... _fields_ = [(\"count\", c_int), (\"values\", POINTER(c_int))]\n" @@ -1390,7 +1396,7 @@ msgid "" ">>>" msgstr "" -#: library/ctypes.rst:878 +#: library/ctypes.rst:882 msgid "" "In addition, if a function argument is explicitly declared to be a pointer " "type (such as ``POINTER(c_int)``) in :attr:`~_CFuncPtr.argtypes`, an object " @@ -1399,17 +1405,17 @@ msgid "" "automatically." msgstr "" -#: library/ctypes.rst:883 +#: library/ctypes.rst:887 msgid "To set a POINTER type field to ``NULL``, you can assign ``None``::" msgstr "" -#: library/ctypes.rst:885 +#: library/ctypes.rst:889 msgid "" ">>> bar.values = None\n" ">>>" msgstr "" -#: library/ctypes.rst:890 +#: library/ctypes.rst:894 msgid "" "Sometimes you have instances of incompatible types. In C, you can cast one " "type into another type. :mod:`ctypes` provides a :func:`cast` function " @@ -1418,7 +1424,7 @@ msgid "" "``values`` field, but not instances of other types::" msgstr "" -#: library/ctypes.rst:896 +#: library/ctypes.rst:900 msgid "" ">>> bar.values = (c_byte * 4)()\n" "Traceback (most recent call last):\n" @@ -1428,11 +1434,11 @@ msgid "" ">>>" msgstr "" -#: library/ctypes.rst:902 +#: library/ctypes.rst:906 msgid "For these cases, the :func:`cast` function is handy." msgstr "" -#: library/ctypes.rst:904 +#: library/ctypes.rst:908 msgid "" "The :func:`cast` function can be used to cast a ctypes instance into a " "pointer to a different ctypes data type. :func:`cast` takes two parameters, " @@ -1441,7 +1447,7 @@ msgid "" "references the same memory block as the first argument::" msgstr "" -#: library/ctypes.rst:910 +#: library/ctypes.rst:914 msgid "" ">>> a = (c_byte * 4)()\n" ">>> cast(a, POINTER(c_int))\n" @@ -1449,13 +1455,13 @@ msgid "" ">>>" msgstr "" -#: library/ctypes.rst:915 +#: library/ctypes.rst:919 msgid "" "So, :func:`cast` can be used to assign to the ``values`` field of ``Bar`` " "the structure::" msgstr "" -#: library/ctypes.rst:918 +#: library/ctypes.rst:922 msgid "" ">>> bar = Bar()\n" ">>> bar.values = cast((c_byte * 4)(), POINTER(c_int))\n" @@ -1464,18 +1470,18 @@ msgid "" ">>>" msgstr "" -#: library/ctypes.rst:928 +#: library/ctypes.rst:932 msgid "Incomplete Types" msgstr "" -#: library/ctypes.rst:930 +#: library/ctypes.rst:934 msgid "" "*Incomplete Types* are structures, unions or arrays whose members are not " "yet specified. In C, they are specified by forward declarations, which are " "defined later::" msgstr "" -#: library/ctypes.rst:934 +#: library/ctypes.rst:938 msgid "" "struct cell; /* forward declaration */\n" "\n" @@ -1485,13 +1491,13 @@ msgid "" "};" msgstr "" -#: library/ctypes.rst:941 +#: library/ctypes.rst:945 msgid "" "The straightforward translation into ctypes code would be this, but it does " "not work::" msgstr "" -#: library/ctypes.rst:944 +#: library/ctypes.rst:948 msgid "" ">>> class cell(Structure):\n" "... _fields_ = [(\"name\", c_char_p),\n" @@ -1504,14 +1510,14 @@ msgid "" ">>>" msgstr "" -#: library/ctypes.rst:954 +#: library/ctypes.rst:958 msgid "" "because the new ``class cell`` is not available in the class statement " "itself. In :mod:`ctypes`, we can define the ``cell`` class and set the :attr:" "`~Structure._fields_` attribute later, after the class statement::" msgstr "" -#: library/ctypes.rst:958 +#: library/ctypes.rst:962 msgid "" ">>> from ctypes import *\n" ">>> class cell(Structure):\n" @@ -1522,13 +1528,13 @@ msgid "" ">>>" msgstr "" -#: library/ctypes.rst:966 +#: library/ctypes.rst:970 msgid "" "Let's try it. We create two instances of ``cell``, and let them point to " "each other, and finally follow the pointer chain a few times::" msgstr "" -#: library/ctypes.rst:969 +#: library/ctypes.rst:973 msgid "" ">>> c1 = cell()\n" ">>> c1.name = b\"foo\"\n" @@ -1545,24 +1551,24 @@ msgid "" ">>>" msgstr "" -#: library/ctypes.rst:987 +#: library/ctypes.rst:991 msgid "Callback functions" msgstr "" -#: library/ctypes.rst:989 +#: library/ctypes.rst:993 msgid "" ":mod:`ctypes` allows creating C callable function pointers from Python " "callables. These are sometimes called *callback functions*." msgstr "" -#: library/ctypes.rst:992 +#: library/ctypes.rst:996 msgid "" "First, you must create a class for the callback function. The class knows " "the calling convention, the return type, and the number and types of " "arguments this function will receive." msgstr "" -#: library/ctypes.rst:996 +#: library/ctypes.rst:1000 msgid "" "The :func:`CFUNCTYPE` factory function creates types for callback functions " "using the ``cdecl`` calling convention. On Windows, the :func:`WINFUNCTYPE` " @@ -1570,21 +1576,21 @@ msgid "" "calling convention." msgstr "" -#: library/ctypes.rst:1001 +#: library/ctypes.rst:1005 msgid "" "Both of these factory functions are called with the result type as first " "argument, and the callback functions expected argument types as the " "remaining arguments." msgstr "" -#: library/ctypes.rst:1005 +#: library/ctypes.rst:1009 msgid "" "I will present an example here which uses the standard C library's :c:func:`!" "qsort` function, that is used to sort items with the help of a callback " "function. :c:func:`!qsort` will be used to sort an array of integers::" msgstr "" -#: library/ctypes.rst:1009 +#: library/ctypes.rst:1013 msgid "" ">>> IntArray5 = c_int * 5\n" ">>> ia = IntArray5(5, 1, 7, 33, 99)\n" @@ -1593,7 +1599,7 @@ msgid "" ">>>" msgstr "" -#: library/ctypes.rst:1015 +#: library/ctypes.rst:1019 msgid "" ":func:`!qsort` must be called with a pointer to the data to sort, the number " "of items in the data array, the size of one item, and a pointer to the " @@ -1603,25 +1609,25 @@ msgid "" "otherwise." msgstr "" -#: library/ctypes.rst:1021 +#: library/ctypes.rst:1025 msgid "" "So our callback function receives pointers to integers, and must return an " "integer. First we create the ``type`` for the callback function::" msgstr "" -#: library/ctypes.rst:1024 +#: library/ctypes.rst:1028 msgid "" ">>> CMPFUNC = CFUNCTYPE(c_int, POINTER(c_int), POINTER(c_int))\n" ">>>" msgstr "" -#: library/ctypes.rst:1027 +#: library/ctypes.rst:1031 msgid "" "To get started, here is a simple callback that shows the values it gets " "passed::" msgstr "" -#: library/ctypes.rst:1030 +#: library/ctypes.rst:1034 msgid "" ">>> def py_cmp_func(a, b):\n" "... print(\"py_cmp_func\", a[0], b[0])\n" @@ -1631,11 +1637,11 @@ msgid "" ">>>" msgstr "" -#: library/ctypes.rst:1037 +#: library/ctypes.rst:1041 msgid "The result::" msgstr "" -#: library/ctypes.rst:1039 +#: library/ctypes.rst:1043 msgid "" ">>> qsort(ia, len(ia), sizeof(c_int), cmp_func)\n" "py_cmp_func 5 1\n" @@ -1646,11 +1652,11 @@ msgid "" ">>>" msgstr "" -#: library/ctypes.rst:1047 +#: library/ctypes.rst:1051 msgid "Now we can actually compare the two items and return a useful result::" msgstr "" -#: library/ctypes.rst:1049 +#: library/ctypes.rst:1053 msgid "" ">>> def py_cmp_func(a, b):\n" "... print(\"py_cmp_func\", a[0], b[0])\n" @@ -1666,11 +1672,11 @@ msgid "" ">>>" msgstr "" -#: library/ctypes.rst:1062 +#: library/ctypes.rst:1066 msgid "As we can easily check, our array is sorted now::" msgstr "" -#: library/ctypes.rst:1064 +#: library/ctypes.rst:1068 msgid "" ">>> for i in ia: print(i, end=\" \")\n" "...\n" @@ -1678,13 +1684,13 @@ msgid "" ">>>" msgstr "" -#: library/ctypes.rst:1069 +#: library/ctypes.rst:1073 msgid "" "The function factories can be used as decorator factories, so we may as well " "write::" msgstr "" -#: library/ctypes.rst:1072 +#: library/ctypes.rst:1076 msgid "" ">>> @CFUNCTYPE(c_int, POINTER(c_int), POINTER(c_int))\n" "... def py_cmp_func(a, b):\n" @@ -1700,14 +1706,14 @@ msgid "" ">>>" msgstr "" -#: library/ctypes.rst:1087 +#: library/ctypes.rst:1091 msgid "" "Make sure you keep references to :func:`CFUNCTYPE` objects as long as they " "are used from C code. :mod:`ctypes` doesn't, and if you don't, they may be " "garbage collected, crashing your program when a callback is made." msgstr "" -#: library/ctypes.rst:1091 +#: library/ctypes.rst:1095 msgid "" "Also, note that if the callback function is called in a thread created " "outside of Python's control (e.g. by the foreign code that calls the " @@ -1717,42 +1723,42 @@ msgid "" "even when those calls are made from the same C thread." msgstr "" -#: library/ctypes.rst:1101 +#: library/ctypes.rst:1105 msgid "Accessing values exported from dlls" msgstr "" -#: library/ctypes.rst:1103 +#: library/ctypes.rst:1107 msgid "" "Some shared libraries not only export functions, they also export variables. " "An example in the Python library itself is the :c:data:`Py_Version`, Python " "runtime version number encoded in a single constant integer." msgstr "" -#: library/ctypes.rst:1107 +#: library/ctypes.rst:1111 msgid "" ":mod:`ctypes` can access values like this with the :meth:`~_CData.in_dll` " "class methods of the type. *pythonapi* is a predefined symbol giving access " "to the Python C api::" msgstr "" -#: library/ctypes.rst:1111 +#: library/ctypes.rst:1115 msgid "" ">>> version = ctypes.c_int.in_dll(ctypes.pythonapi, \"Py_Version\")\n" ">>> print(hex(version.value))\n" "0x30c00a0" msgstr "" -#: library/ctypes.rst:1115 +#: library/ctypes.rst:1119 msgid "" "An extended example which also demonstrates the use of pointers accesses " "the :c:data:`PyImport_FrozenModules` pointer exported by Python." msgstr "" -#: library/ctypes.rst:1118 +#: library/ctypes.rst:1122 msgid "Quoting the docs for that value:" msgstr "" -#: library/ctypes.rst:1120 +#: library/ctypes.rst:1124 msgid "" "This pointer is initialized to point to an array of :c:struct:`_frozen` " "records, terminated by one whose members are all ``NULL`` or zero. When a " @@ -1761,13 +1767,13 @@ msgid "" "frozen modules." msgstr "" -#: library/ctypes.rst:1125 +#: library/ctypes.rst:1129 msgid "" "So manipulating this pointer could even prove useful. To restrict the " "example size, we show only how this table can be read with :mod:`ctypes`::" msgstr "" -#: library/ctypes.rst:1128 +#: library/ctypes.rst:1132 msgid "" ">>> from ctypes import *\n" ">>>\n" @@ -1781,20 +1787,20 @@ msgid "" ">>>" msgstr "" -#: library/ctypes.rst:1139 +#: library/ctypes.rst:1143 msgid "" "We have defined the :c:struct:`_frozen` data type, so we can get the pointer " "to the table::" msgstr "" -#: library/ctypes.rst:1142 +#: library/ctypes.rst:1146 msgid "" ">>> FrozenTable = POINTER(struct_frozen)\n" ">>> table = FrozenTable.in_dll(pythonapi, \"_PyImport_FrozenBootstrap\")\n" ">>>" msgstr "" -#: library/ctypes.rst:1146 +#: library/ctypes.rst:1150 msgid "" "Since ``table`` is a ``pointer`` to the array of ``struct_frozen`` records, " "we can iterate over it, but we just have to make sure that our loop " @@ -1803,7 +1809,7 @@ msgid "" "the loop when we hit the ``NULL`` entry::" msgstr "" -#: library/ctypes.rst:1152 +#: library/ctypes.rst:1156 msgid "" ">>> for item in table:\n" "... if item.name is None:\n" @@ -1816,28 +1822,28 @@ msgid "" ">>>" msgstr "" -#: library/ctypes.rst:1162 +#: library/ctypes.rst:1166 msgid "" "The fact that standard Python has a frozen module and a frozen package " "(indicated by the negative ``size`` member) is not well known, it is only " "used for testing. Try it out with ``import __hello__`` for example." msgstr "" -#: library/ctypes.rst:1170 +#: library/ctypes.rst:1174 msgid "Surprises" msgstr "" -#: library/ctypes.rst:1172 +#: library/ctypes.rst:1176 msgid "" "There are some edges in :mod:`ctypes` where you might expect something other " "than what actually happens." msgstr "" -#: library/ctypes.rst:1175 +#: library/ctypes.rst:1179 msgid "Consider the following example::" msgstr "" -#: library/ctypes.rst:1177 +#: library/ctypes.rst:1181 msgid "" ">>> from ctypes import *\n" ">>> class POINT(Structure):\n" @@ -1858,13 +1864,13 @@ msgid "" ">>>" msgstr "" -#: library/ctypes.rst:1195 +#: library/ctypes.rst:1199 msgid "" "Hm. We certainly expected the last statement to print ``3 4 1 2``. What " "happened? Here are the steps of the ``rc.a, rc.b = rc.b, rc.a`` line above::" msgstr "" -#: library/ctypes.rst:1198 +#: library/ctypes.rst:1202 msgid "" ">>> temp0, temp1 = rc.b, rc.a\n" ">>> rc.a = temp0\n" @@ -1872,7 +1878,7 @@ msgid "" ">>>" msgstr "" -#: library/ctypes.rst:1203 +#: library/ctypes.rst:1207 msgid "" "Note that ``temp0`` and ``temp1`` are objects still using the internal " "buffer of the ``rc`` object above. So executing ``rc.a = temp0`` copies the " @@ -1881,20 +1887,20 @@ msgid "" "have the expected effect." msgstr "" -#: library/ctypes.rst:1209 +#: library/ctypes.rst:1213 msgid "" "Keep in mind that retrieving sub-objects from Structure, Unions, and Arrays " "doesn't *copy* the sub-object, instead it retrieves a wrapper object " "accessing the root-object's underlying buffer." msgstr "" -#: library/ctypes.rst:1213 +#: library/ctypes.rst:1217 msgid "" "Another example that may behave differently from what one would expect is " "this::" msgstr "" -#: library/ctypes.rst:1215 +#: library/ctypes.rst:1219 msgid "" ">>> s = c_char_p()\n" ">>> s.value = b\"abc def ghi\"\n" @@ -1905,13 +1911,13 @@ msgid "" ">>>" msgstr "" -#: library/ctypes.rst:1225 +#: library/ctypes.rst:1229 msgid "" "Objects instantiated from :class:`c_char_p` can only have their value set to " "bytes or integers." msgstr "" -#: library/ctypes.rst:1228 +#: library/ctypes.rst:1232 msgid "" "Why is it printing ``False``? ctypes instances are objects containing a " "memory block plus some :term:`descriptor`\\s accessing the contents of the " @@ -1920,16 +1926,16 @@ msgid "" "the contents again constructs a new Python object each time!" msgstr "" -#: library/ctypes.rst:1238 +#: library/ctypes.rst:1242 msgid "Variable-sized data types" msgstr "" -#: library/ctypes.rst:1240 +#: library/ctypes.rst:1244 msgid "" ":mod:`ctypes` provides some support for variable-sized arrays and structures." msgstr "" -#: library/ctypes.rst:1242 +#: library/ctypes.rst:1246 msgid "" "The :func:`resize` function can be used to resize the memory buffer of an " "existing ctypes object. The function takes the object as first argument, " @@ -1938,7 +1944,7 @@ msgid "" "objects type, a :exc:`ValueError` is raised if this is tried::" msgstr "" -#: library/ctypes.rst:1248 +#: library/ctypes.rst:1252 msgid "" ">>> short_array = (c_short * 4)()\n" ">>> print(sizeof(short_array))\n" @@ -1955,14 +1961,14 @@ msgid "" ">>>" msgstr "" -#: library/ctypes.rst:1262 +#: library/ctypes.rst:1266 msgid "" "This is nice and fine, but how would one access the additional elements " "contained in this array? Since the type still only knows about 4 elements, " "we get errors accessing other elements::" msgstr "" -#: library/ctypes.rst:1266 +#: library/ctypes.rst:1270 msgid "" ">>> short_array[:]\n" "[0, 0, 0, 0]\n" @@ -1973,28 +1979,28 @@ msgid "" ">>>" msgstr "" -#: library/ctypes.rst:1274 +#: library/ctypes.rst:1278 msgid "" "Another way to use variable-sized data types with :mod:`ctypes` is to use " "the dynamic nature of Python, and (re-)define the data type after the " "required size is already known, on a case by case basis." msgstr "" -#: library/ctypes.rst:1282 +#: library/ctypes.rst:1286 msgid "ctypes reference" msgstr "" -#: library/ctypes.rst:1288 +#: library/ctypes.rst:1292 msgid "Finding shared libraries" msgstr "" -#: library/ctypes.rst:1290 +#: library/ctypes.rst:1294 msgid "" "When programming in a compiled language, shared libraries are accessed when " "compiling/linking a program, and when the program is run." msgstr "" -#: library/ctypes.rst:1293 +#: library/ctypes.rst:1297 msgid "" "The purpose of the :func:`~ctypes.util.find_library` function is to locate a " "library in a way similar to what the compiler or runtime loader does (on " @@ -2003,13 +2009,13 @@ msgid "" "and call the runtime loader directly." msgstr "" -#: library/ctypes.rst:1299 +#: library/ctypes.rst:1303 msgid "" "The :mod:`!ctypes.util` module provides a function which can help to " "determine the library to load." msgstr "" -#: library/ctypes.rst:1307 +#: library/ctypes.rst:1311 msgid "" "Try to find a library and return a pathname. *name* is the library name " "without any prefix like *lib*, suffix like ``.so``, ``.dylib`` or version " @@ -2017,29 +2023,29 @@ msgid "" "If no library can be found, returns ``None``." msgstr "" -#: library/ctypes.rst:1997 +#: library/ctypes.rst:2002 msgid "The exact functionality is system dependent." msgstr "" -#: library/ctypes.rst:1314 +#: library/ctypes.rst:1318 msgid "" "On Linux, :func:`~ctypes.util.find_library` tries to run external programs " "(``/sbin/ldconfig``, ``gcc``, ``objdump`` and ``ld``) to find the library " "file. It returns the filename of the library file." msgstr "" -#: library/ctypes.rst:1318 +#: library/ctypes.rst:1322 msgid "" "On Linux, the value of the environment variable ``LD_LIBRARY_PATH`` is used " "when searching for libraries, if a library cannot be found by any other " "means." msgstr "" -#: library/ctypes.rst:1322 +#: library/ctypes.rst:1326 msgid "Here are some examples::" msgstr "" -#: library/ctypes.rst:1324 +#: library/ctypes.rst:1328 msgid "" ">>> from ctypes.util import find_library\n" ">>> find_library(\"m\")\n" @@ -2051,14 +2057,14 @@ msgid "" ">>>" msgstr "" -#: library/ctypes.rst:1333 +#: library/ctypes.rst:1337 msgid "" -"On macOS, :func:`~ctypes.util.find_library` tries several predefined naming " -"schemes and paths to locate the library, and returns a full pathname if " -"successful::" +"On macOS and Android, :func:`~ctypes.util.find_library` uses the system's " +"standard naming schemes and paths to locate the library, and returns a full " +"pathname if successful::" msgstr "" -#: library/ctypes.rst:1336 +#: library/ctypes.rst:1341 msgid "" ">>> from ctypes.util import find_library\n" ">>> find_library(\"c\")\n" @@ -2072,7 +2078,7 @@ msgid "" ">>>" msgstr "" -#: library/ctypes.rst:1347 +#: library/ctypes.rst:1352 msgid "" "On Windows, :func:`~ctypes.util.find_library` searches along the system " "search path, and returns the full pathname, but since there is no predefined " @@ -2080,7 +2086,7 @@ msgid "" "``None``." msgstr "" -#: library/ctypes.rst:1351 +#: library/ctypes.rst:1356 msgid "" "If wrapping a shared library with :mod:`ctypes`, it *may* be better to " "determine the shared library name at development time, and hardcode that " @@ -2088,24 +2094,24 @@ msgid "" "to locate the library at runtime." msgstr "" -#: library/ctypes.rst:1359 +#: library/ctypes.rst:1364 msgid "Loading shared libraries" msgstr "" -#: library/ctypes.rst:1361 +#: library/ctypes.rst:1366 msgid "" "There are several ways to load shared libraries into the Python process. " "One way is to instantiate one of the following classes:" msgstr "" -#: library/ctypes.rst:1367 +#: library/ctypes.rst:1372 msgid "" "Instances of this class represent loaded shared libraries. Functions in " "these libraries use the standard C calling convention, and are assumed to " "return :c:expr:`int`." msgstr "" -#: library/ctypes.rst:1371 +#: library/ctypes.rst:1376 msgid "" "On Windows creating a :class:`CDLL` instance may fail even if the DLL name " "exists. When a dependent DLL of the loaded DLL is not found, a :exc:" @@ -2117,17 +2123,17 @@ msgid "" "determine which one is not found using Windows debugging and tracing tools." msgstr "" -#: library/ctypes.rst:1408 library/ctypes.rst:1439 +#: library/ctypes.rst:1413 library/ctypes.rst:1444 msgid "The *name* parameter can now be a :term:`path-like object`." msgstr "" -#: library/ctypes.rst:1387 +#: library/ctypes.rst:1392 msgid "" "`Microsoft DUMPBIN tool `_ -- A tool to find DLL dependents." msgstr "" -#: library/ctypes.rst:1393 +#: library/ctypes.rst:1398 msgid "" "Instances of this class represent loaded shared libraries, functions in " "these libraries use the ``stdcall`` calling convention, and are assumed to " @@ -2137,32 +2143,32 @@ msgid "" "a failure, an :class:`OSError` is automatically raised." msgstr "" -#: library/ctypes.rst:1417 library/ctypes.rst:1569 library/ctypes.rst:1977 -#: library/ctypes.rst:2011 library/ctypes.rst:2029 library/ctypes.rst:2101 -#: library/ctypes.rst:2473 +#: library/ctypes.rst:1422 library/ctypes.rst:1574 library/ctypes.rst:1982 +#: library/ctypes.rst:2016 library/ctypes.rst:2034 library/ctypes.rst:2106 +#: library/ctypes.rst:2478 msgid "Availability" msgstr "" -#: library/ctypes.rst:1402 +#: library/ctypes.rst:1407 msgid "" ":exc:`WindowsError` used to be raised, which is now an alias of :exc:" "`OSError`." msgstr "" -#: library/ctypes.rst:1413 +#: library/ctypes.rst:1418 msgid "" "Instances of this class represent loaded shared libraries, functions in " "these libraries use the ``stdcall`` calling convention, and are assumed to " "return :c:expr:`int` by default." msgstr "" -#: library/ctypes.rst:1424 +#: library/ctypes.rst:1429 msgid "" "The Python :term:`global interpreter lock` is released before calling any " "function exported by these libraries, and reacquired afterwards." msgstr "" -#: library/ctypes.rst:1430 +#: library/ctypes.rst:1435 msgid "" "Instances of this class behave like :class:`CDLL` instances, except that the " "Python GIL is *not* released during the function call, and after the " @@ -2170,21 +2176,21 @@ msgid "" "set, a Python exception is raised." msgstr "" -#: library/ctypes.rst:1435 +#: library/ctypes.rst:1440 msgid "Thus, this is only useful to call Python C api functions directly." msgstr "" -#: library/ctypes.rst:1441 +#: library/ctypes.rst:1446 msgid "" "All these classes can be instantiated by calling them with at least one " "argument, the pathname of the shared library. If you have an existing " "handle to an already loaded shared library, it can be passed as the " -"``handle`` named parameter, otherwise the underlying platforms :c:func:`!" +"``handle`` named parameter, otherwise the underlying platform's :c:func:`!" "dlopen` or :c:func:`!LoadLibrary` function is used to load the library into " "the process, and to get a handle to it." msgstr "" -#: library/ctypes.rst:1448 +#: library/ctypes.rst:1453 msgid "" "The *mode* parameter can be used to specify how the library is loaded. For " "details, consult the :manpage:`dlopen(3)` manpage. On Windows, *mode* is " @@ -2192,24 +2198,24 @@ msgid "" "configurable." msgstr "" -#: library/ctypes.rst:1453 +#: library/ctypes.rst:1458 msgid "" "The *use_errno* parameter, when set to true, enables a ctypes mechanism that " "allows accessing the system :data:`errno` error number in a safe way. :mod:" -"`ctypes` maintains a thread-local copy of the systems :data:`errno` " +"`ctypes` maintains a thread-local copy of the system's :data:`errno` " "variable; if you call foreign functions created with ``use_errno=True`` then " "the :data:`errno` value before the function call is swapped with the ctypes " "private copy, the same happens immediately after the function call." msgstr "" -#: library/ctypes.rst:1460 +#: library/ctypes.rst:1465 msgid "" "The function :func:`ctypes.get_errno` returns the value of the ctypes " "private copy, and the function :func:`ctypes.set_errno` changes the ctypes " "private copy to a new value and returns the former value." msgstr "" -#: library/ctypes.rst:1464 +#: library/ctypes.rst:1469 msgid "" "The *use_last_error* parameter, when set to true, enables the same mechanism " "for the Windows error code which is managed by the :func:`GetLastError` and :" @@ -2218,7 +2224,7 @@ msgid "" "private copy of the windows error code." msgstr "" -#: library/ctypes.rst:1470 +#: library/ctypes.rst:1475 msgid "" "The *winmode* parameter is used on Windows to specify how the library is " "loaded (since *mode* is ignored). It takes any value that is valid for the " @@ -2228,29 +2234,29 @@ msgid "" "ensure the correct library and dependencies are loaded." msgstr "" -#: library/ctypes.rst:1477 +#: library/ctypes.rst:1482 msgid "Added *winmode* parameter." msgstr "" -#: library/ctypes.rst:1484 +#: library/ctypes.rst:1489 msgid "" "Flag to use as *mode* parameter. On platforms where this flag is not " "available, it is defined as the integer zero." msgstr "" -#: library/ctypes.rst:1491 +#: library/ctypes.rst:1496 msgid "" "Flag to use as *mode* parameter. On platforms where this is not available, " "it is the same as *RTLD_GLOBAL*." msgstr "" -#: library/ctypes.rst:1498 +#: library/ctypes.rst:1503 msgid "" "The default mode which is used to load shared libraries. On OSX 10.3, this " "is *RTLD_GLOBAL*, otherwise it is the same as *RTLD_LOCAL*." msgstr "" -#: library/ctypes.rst:1501 +#: library/ctypes.rst:1506 msgid "" "Instances of these classes have no public methods. Functions exported by " "the shared library can be accessed as attributes or by index. Please note " @@ -2259,7 +2265,7 @@ msgid "" "other hand, accessing it through an index returns a new object each time::" msgstr "" -#: library/ctypes.rst:1507 +#: library/ctypes.rst:1512 msgid "" ">>> from ctypes import CDLL\n" ">>> libc = CDLL(\"libc.so.6\") # On Linux\n" @@ -2269,21 +2275,21 @@ msgid "" "False" msgstr "" -#: library/ctypes.rst:1514 +#: library/ctypes.rst:1519 msgid "" "The following public attributes are available, their name starts with an " "underscore to not clash with exported function names:" msgstr "" -#: library/ctypes.rst:1520 +#: library/ctypes.rst:1525 msgid "The system handle used to access the library." msgstr "" -#: library/ctypes.rst:1525 +#: library/ctypes.rst:1530 msgid "The name of the library passed in the constructor." msgstr "" -#: library/ctypes.rst:1527 +#: library/ctypes.rst:1532 msgid "" "Shared libraries can also be loaded by using one of the prefabricated " "objects, which are instances of the :class:`LibraryLoader` class, either by " @@ -2291,13 +2297,13 @@ msgid "" "library as attribute of the loader instance." msgstr "" -#: library/ctypes.rst:1535 +#: library/ctypes.rst:1540 msgid "" "Class which loads shared libraries. *dlltype* should be one of the :class:" "`CDLL`, :class:`PyDLL`, :class:`WinDLL`, or :class:`OleDLL` types." msgstr "" -#: library/ctypes.rst:1538 +#: library/ctypes.rst:1543 msgid "" ":meth:`!__getattr__` has special behavior: It allows loading a shared " "library by accessing it as attribute of a library loader instance. The " @@ -2305,39 +2311,39 @@ msgid "" "each time." msgstr "" -#: library/ctypes.rst:1544 +#: library/ctypes.rst:1549 msgid "" "Load a shared library into the process and return it. This method always " "returns a new instance of the library." msgstr "" -#: library/ctypes.rst:1548 +#: library/ctypes.rst:1553 msgid "These prefabricated library loaders are available:" msgstr "" -#: library/ctypes.rst:1553 +#: library/ctypes.rst:1558 msgid "Creates :class:`CDLL` instances." msgstr "" -#: library/ctypes.rst:1559 +#: library/ctypes.rst:1564 msgid "Creates :class:`WinDLL` instances." msgstr "" -#: library/ctypes.rst:1567 +#: library/ctypes.rst:1572 msgid "Creates :class:`OleDLL` instances." msgstr "" -#: library/ctypes.rst:1575 +#: library/ctypes.rst:1580 msgid "Creates :class:`PyDLL` instances." msgstr "" -#: library/ctypes.rst:1578 +#: library/ctypes.rst:1583 msgid "" "For accessing the C Python api directly, a ready-to-use Python shared " "library object is available:" msgstr "" -#: library/ctypes.rst:1584 +#: library/ctypes.rst:1589 msgid "" "An instance of :class:`PyDLL` that exposes Python C API functions as " "attributes. Note that all these functions are assumed to return C :c:expr:" @@ -2345,32 +2351,32 @@ msgid "" "correct :attr:`!restype` attribute to use these functions." msgstr "" -#: library/ctypes.rst:1591 +#: library/ctypes.rst:1596 msgid "" "Loading a library through any of these objects raises an :ref:`auditing " "event ` ``ctypes.dlopen`` with string argument ``name``, the name " "used to load the library." msgstr "" -#: library/ctypes.rst:1597 +#: library/ctypes.rst:1602 msgid "" "Accessing a function on a loaded library raises an auditing event ``ctypes." "dlsym`` with arguments ``library`` (the library object) and ``name`` (the " "symbol's name as a string or integer)." msgstr "" -#: library/ctypes.rst:1603 +#: library/ctypes.rst:1608 msgid "" "In cases when only the library handle is available rather than the object, " "accessing a function raises an auditing event ``ctypes.dlsym/handle`` with " "arguments ``handle`` (the raw library handle) and ``name``." msgstr "" -#: library/ctypes.rst:1610 +#: library/ctypes.rst:1615 msgid "Foreign functions" msgstr "" -#: library/ctypes.rst:1612 +#: library/ctypes.rst:1617 msgid "" "As explained in the previous section, foreign functions can be accessed as " "attributes of loaded shared libraries. The function objects created in this " @@ -2379,13 +2385,13 @@ msgid "" "library loader." msgstr "" -#: library/ctypes.rst:1617 +#: library/ctypes.rst:1622 msgid "" "They are instances of a private local class :class:`!_FuncPtr` (not exposed " "in :mod:`!ctypes`) which inherits from the private :class:`_CFuncPtr` class:" msgstr "" -#: library/ctypes.rst:1620 +#: library/ctypes.rst:1625 msgid "" ">>> import ctypes\n" ">>> lib = ctypes.CDLL(None)\n" @@ -2395,29 +2401,29 @@ msgid "" "False" msgstr "" -#: library/ctypes.rst:1631 +#: library/ctypes.rst:1636 msgid "Base class for C callable foreign functions." msgstr "" -#: library/ctypes.rst:1633 +#: library/ctypes.rst:1638 msgid "" "Instances of foreign functions are also C compatible data types; they " "represent C function pointers." msgstr "" -#: library/ctypes.rst:1636 +#: library/ctypes.rst:1641 msgid "" "This behavior can be customized by assigning to special attributes of the " "foreign function object." msgstr "" -#: library/ctypes.rst:1641 +#: library/ctypes.rst:1646 msgid "" "Assign a ctypes type to specify the result type of the foreign function. Use " "``None`` for :c:expr:`void`, a function not returning anything." msgstr "" -#: library/ctypes.rst:1644 +#: library/ctypes.rst:1649 msgid "" "It is possible to assign a callable Python object that is not a ctypes type, " "in this case the function is assumed to return a C :c:expr:`int`, and the " @@ -2427,7 +2433,7 @@ msgid "" "callable to the :attr:`errcheck` attribute." msgstr "" -#: library/ctypes.rst:1653 +#: library/ctypes.rst:1658 msgid "" "Assign a tuple of ctypes types to specify the argument types that the " "function accepts. Functions using the ``stdcall`` calling convention can " @@ -2436,7 +2442,7 @@ msgid "" "unspecified arguments as well." msgstr "" -#: library/ctypes.rst:1659 +#: library/ctypes.rst:1664 msgid "" "When a foreign function is called, each actual argument is passed to the :" "meth:`~_CData.from_param` class method of the items in the :attr:`argtypes` " @@ -2446,7 +2452,7 @@ msgid "" "object using ctypes conversion rules." msgstr "" -#: library/ctypes.rst:1666 +#: library/ctypes.rst:1671 msgid "" "New: It is now possible to put items in argtypes which are not ctypes types, " "but each item must have a :meth:`~_CData.from_param` method which returns a " @@ -2454,44 +2460,44 @@ msgid "" "defining adapters that can adapt custom objects as function parameters." msgstr "" -#: library/ctypes.rst:1673 +#: library/ctypes.rst:1678 msgid "" "Assign a Python function or another callable to this attribute. The callable " "will be called with three or more arguments:" msgstr "" -#: library/ctypes.rst:1680 +#: library/ctypes.rst:1685 msgid "" "*result* is what the foreign function returns, as specified by the :attr:`!" "restype` attribute." msgstr "" -#: library/ctypes.rst:1683 +#: library/ctypes.rst:1688 msgid "" "*func* is the foreign function object itself, this allows reusing the same " "callable object to check or post process the results of several functions." msgstr "" -#: library/ctypes.rst:1687 +#: library/ctypes.rst:1692 msgid "" "*arguments* is a tuple containing the parameters originally passed to the " "function call, this allows specializing the behavior on the arguments used." msgstr "" -#: library/ctypes.rst:1691 +#: library/ctypes.rst:1696 msgid "" "The object that this function returns will be returned from the foreign " "function call, but it can also check the result value and raise an exception " "if the foreign function call failed." msgstr "" -#: library/ctypes.rst:1698 +#: library/ctypes.rst:1703 msgid "" "This exception is raised when a foreign function call cannot convert one of " "the passed arguments." msgstr "" -#: library/ctypes.rst:1704 +#: library/ctypes.rst:1709 msgid "" "On Windows, when a foreign function call raises a system exception (for " "example, due to an access violation), it will be captured and replaced with " @@ -2500,18 +2506,18 @@ msgid "" "hook to replace the exception with its own." msgstr "" -#: library/ctypes.rst:1712 +#: library/ctypes.rst:1717 msgid "" "Some ways to invoke foreign function calls may raise an auditing event " "``ctypes.call_function`` with arguments ``function pointer`` and " "``arguments``." msgstr "" -#: library/ctypes.rst:1718 +#: library/ctypes.rst:1723 msgid "Function prototypes" msgstr "" -#: library/ctypes.rst:1720 +#: library/ctypes.rst:1725 msgid "" "Foreign functions can also be created by instantiating function prototypes. " "Function prototypes are similar to function prototypes in C; they describe a " @@ -2522,7 +2528,7 @@ msgid "" "``@wrapper`` syntax. See :ref:`ctypes-callback-functions` for examples." msgstr "" -#: library/ctypes.rst:1731 +#: library/ctypes.rst:1736 msgid "" "The returned function prototype creates functions that use the standard C " "calling convention. The function will release the GIL during the call. If " @@ -2531,37 +2537,37 @@ msgid "" "after the call; *use_last_error* does the same for the Windows error code." msgstr "" -#: library/ctypes.rst:1741 +#: library/ctypes.rst:1746 msgid "" "The returned function prototype creates functions that use the ``stdcall`` " "calling convention. The function will release the GIL during the call. " "*use_errno* and *use_last_error* have the same meaning as above." msgstr "" -#: library/ctypes.rst:1751 +#: library/ctypes.rst:1756 msgid "" "The returned function prototype creates functions that use the Python " "calling convention. The function will *not* release the GIL during the call." msgstr "" -#: library/ctypes.rst:1754 +#: library/ctypes.rst:1759 msgid "" "Function prototypes created by these factory functions can be instantiated " "in different ways, depending on the type and number of the parameters in the " "call:" msgstr "" -#: library/ctypes.rst:1761 +#: library/ctypes.rst:1766 msgid "" "Returns a foreign function at the specified address which must be an integer." msgstr "" -#: library/ctypes.rst:1768 +#: library/ctypes.rst:1773 msgid "" "Create a C callable function (a callback function) from a Python *callable*." msgstr "" -#: library/ctypes.rst:1775 +#: library/ctypes.rst:1780 msgid "" "Returns a foreign function exported by a shared library. *func_spec* must be " "a 2-tuple ``(name_or_ordinal, library)``. The first item is the name of the " @@ -2569,7 +2575,7 @@ msgid "" "small integer. The second item is the shared library instance." msgstr "" -#: library/ctypes.rst:1785 +#: library/ctypes.rst:1790 msgid "" "Returns a foreign function that will call a COM method. *vtbl_index* is the " "index into the virtual function table, a small non-negative integer. *name* " @@ -2577,79 +2583,79 @@ msgid "" "identifier which is used in extended error reporting." msgstr "" -#: library/ctypes.rst:1790 +#: library/ctypes.rst:1795 msgid "" "COM methods use a special calling convention: They require a pointer to the " "COM interface as first argument, in addition to those parameters that are " "specified in the :attr:`!argtypes` tuple." msgstr "" -#: library/ctypes.rst:1794 +#: library/ctypes.rst:1799 msgid "" "The optional *paramflags* parameter creates foreign function wrappers with " "much more functionality than the features described above." msgstr "" -#: library/ctypes.rst:1797 +#: library/ctypes.rst:1802 msgid "" "*paramflags* must be a tuple of the same length as :attr:`~_CFuncPtr." "argtypes`." msgstr "" -#: library/ctypes.rst:1799 +#: library/ctypes.rst:1804 msgid "" "Each item in this tuple contains further information about a parameter, it " "must be a tuple containing one, two, or three items." msgstr "" -#: library/ctypes.rst:1802 +#: library/ctypes.rst:1807 msgid "" "The first item is an integer containing a combination of direction flags for " "the parameter:" msgstr "" -#: library/ctypes.rst:1805 +#: library/ctypes.rst:1810 msgid "1" msgstr "" -#: library/ctypes.rst:1806 +#: library/ctypes.rst:1811 msgid "Specifies an input parameter to the function." msgstr "" -#: library/ctypes.rst:1808 +#: library/ctypes.rst:1813 msgid "2" msgstr "" -#: library/ctypes.rst:1809 +#: library/ctypes.rst:1814 msgid "Output parameter. The foreign function fills in a value." msgstr "" -#: library/ctypes.rst:1811 +#: library/ctypes.rst:1816 msgid "4" msgstr "" -#: library/ctypes.rst:1812 +#: library/ctypes.rst:1817 msgid "Input parameter which defaults to the integer zero." msgstr "" -#: library/ctypes.rst:1814 +#: library/ctypes.rst:1819 msgid "" "The optional second item is the parameter name as string. If this is " "specified, the foreign function can be called with named parameters." msgstr "" -#: library/ctypes.rst:1817 +#: library/ctypes.rst:1822 msgid "The optional third item is the default value for this parameter." msgstr "" -#: library/ctypes.rst:1820 +#: library/ctypes.rst:1825 msgid "" "The following example demonstrates how to wrap the Windows ``MessageBoxW`` " "function so that it supports default parameters and named arguments. The C " "declaration from the windows header file is this::" msgstr "" -#: library/ctypes.rst:1824 +#: library/ctypes.rst:1829 msgid "" "WINUSERAPI int WINAPI\n" "MessageBoxW(\n" @@ -2659,11 +2665,11 @@ msgid "" " UINT uType);" msgstr "" -#: library/ctypes.rst:1854 +#: library/ctypes.rst:1859 msgid "Here is the wrapping with :mod:`ctypes`::" msgstr "" -#: library/ctypes.rst:1833 +#: library/ctypes.rst:1838 msgid "" ">>> from ctypes import c_int, WINFUNCTYPE, windll\n" ">>> from ctypes.wintypes import HWND, LPCWSTR, UINT\n" @@ -2673,18 +2679,18 @@ msgid "" ">>> MessageBox = prototype((\"MessageBoxW\", windll.user32), paramflags)" msgstr "" -#: library/ctypes.rst:1839 +#: library/ctypes.rst:1844 msgid "The ``MessageBox`` foreign function can now be called in these ways::" msgstr "" -#: library/ctypes.rst:1841 +#: library/ctypes.rst:1846 msgid "" ">>> MessageBox()\n" ">>> MessageBox(text=\"Spam, spam, spam\")\n" ">>> MessageBox(flags=2, text=\"foo bar\")" msgstr "" -#: library/ctypes.rst:1845 +#: library/ctypes.rst:1850 msgid "" "A second example demonstrates output parameters. The win32 " "``GetWindowRect`` function retrieves the dimensions of a specified window by " @@ -2692,7 +2698,7 @@ msgid "" "the C declaration::" msgstr "" -#: library/ctypes.rst:1849 +#: library/ctypes.rst:1854 msgid "" "WINUSERAPI BOOL WINAPI\n" "GetWindowRect(\n" @@ -2700,7 +2706,7 @@ msgid "" " LPRECT lpRect);" msgstr "" -#: library/ctypes.rst:1856 +#: library/ctypes.rst:1861 msgid "" ">>> from ctypes import POINTER, WINFUNCTYPE, windll, WinError\n" ">>> from ctypes.wintypes import BOOL, HWND, RECT\n" @@ -2711,7 +2717,7 @@ msgid "" ">>>" msgstr "" -#: library/ctypes.rst:1863 +#: library/ctypes.rst:1868 msgid "" "Functions with output parameters will automatically return the output " "parameter value if there is a single one, or a tuple containing the output " @@ -2719,7 +2725,7 @@ msgid "" "now returns a RECT instance, when called." msgstr "" -#: library/ctypes.rst:1868 +#: library/ctypes.rst:1873 msgid "" "Output parameters can be combined with the :attr:`~_CFuncPtr.errcheck` " "protocol to do further output processing and error checking. The win32 " @@ -2728,7 +2734,7 @@ msgid "" "exception when the api call failed::" msgstr "" -#: library/ctypes.rst:1873 +#: library/ctypes.rst:1878 msgid "" ">>> def errcheck(result, func, args):\n" "... if not result:\n" @@ -2739,7 +2745,7 @@ msgid "" ">>>" msgstr "" -#: library/ctypes.rst:1881 +#: library/ctypes.rst:1886 msgid "" "If the :attr:`~_CFuncPtr.errcheck` function returns the argument tuple it " "receives unchanged, :mod:`ctypes` continues the normal processing it does on " @@ -2748,7 +2754,7 @@ msgid "" "and return them instead, the normal processing will no longer take place::" msgstr "" -#: library/ctypes.rst:1887 +#: library/ctypes.rst:1892 msgid "" ">>> def errcheck(result, func, args):\n" "... if not result:\n" @@ -2760,50 +2766,50 @@ msgid "" ">>>" msgstr "" -#: library/ctypes.rst:1900 +#: library/ctypes.rst:1905 msgid "Utility functions" msgstr "" -#: library/ctypes.rst:1904 +#: library/ctypes.rst:1909 msgid "" "Returns the address of the memory buffer as integer. *obj* must be an " "instance of a ctypes type." msgstr "" -#: library/ctypes.rst:1907 +#: library/ctypes.rst:1912 msgid "" "Raises an :ref:`auditing event ` ``ctypes.addressof`` with " "argument ``obj``." msgstr "" -#: library/ctypes.rst:1912 +#: library/ctypes.rst:1917 msgid "" "Returns the alignment requirements of a ctypes type. *obj_or_type* must be a " "ctypes type or instance." msgstr "" -#: library/ctypes.rst:1918 +#: library/ctypes.rst:1923 msgid "" "Returns a light-weight pointer to *obj*, which must be an instance of a " "ctypes type. *offset* defaults to zero, and must be an integer that will be " "added to the internal pointer value." msgstr "" -#: library/ctypes.rst:1922 +#: library/ctypes.rst:1927 msgid "``byref(obj, offset)`` corresponds to this C code::" msgstr "" -#: library/ctypes.rst:1924 +#: library/ctypes.rst:1929 msgid "(((char *)&obj) + offset)" msgstr "" -#: library/ctypes.rst:1926 +#: library/ctypes.rst:1931 msgid "" "The returned object can only be used as a foreign function call parameter. " "It behaves similar to ``pointer(obj)``, but the construction is a lot faster." msgstr "" -#: library/ctypes.rst:1932 +#: library/ctypes.rst:1937 msgid "" "This function is similar to the cast operator in C. It returns a new " "instance of *type* which points to the same memory block as *obj*. *type* " @@ -2811,19 +2817,19 @@ msgid "" "as a pointer." msgstr "" -#: library/ctypes.rst:1940 +#: library/ctypes.rst:1945 msgid "" "This function creates a mutable character buffer. The returned object is a " "ctypes array of :class:`c_char`." msgstr "" -#: library/ctypes.rst:1943 +#: library/ctypes.rst:1948 msgid "" "*init_or_size* must be an integer which specifies the size of the array, or " "a bytes object which will be used to initialize the array items." msgstr "" -#: library/ctypes.rst:1946 +#: library/ctypes.rst:1951 msgid "" "If a bytes object is specified as first argument, the buffer is made one " "item larger than its length so that the last element in the array is a NUL " @@ -2832,25 +2838,25 @@ msgid "" "not be used." msgstr "" -#: library/ctypes.rst:1951 +#: library/ctypes.rst:1956 msgid "" "Raises an :ref:`auditing event ` ``ctypes.create_string_buffer`` " "with arguments ``init``, ``size``." msgstr "" -#: library/ctypes.rst:1956 +#: library/ctypes.rst:1961 msgid "" "This function creates a mutable unicode character buffer. The returned " "object is a ctypes array of :class:`c_wchar`." msgstr "" -#: library/ctypes.rst:1959 +#: library/ctypes.rst:1964 msgid "" "*init_or_size* must be an integer which specifies the size of the array, or " "a string which will be used to initialize the array items." msgstr "" -#: library/ctypes.rst:1962 +#: library/ctypes.rst:1967 msgid "" "If a string is specified as first argument, the buffer is made one item " "larger than the length of the string so that the last element in the array " @@ -2859,27 +2865,27 @@ msgid "" "should not be used." msgstr "" -#: library/ctypes.rst:1968 +#: library/ctypes.rst:1973 msgid "" "Raises an :ref:`auditing event ` ``ctypes.create_unicode_buffer`` " "with arguments ``init``, ``size``." msgstr "" -#: library/ctypes.rst:1973 +#: library/ctypes.rst:1978 msgid "" "This function is a hook which allows implementing in-process COM servers " "with ctypes. It is called from the DllCanUnloadNow function that the " "_ctypes extension dll exports." msgstr "" -#: library/ctypes.rst:1982 +#: library/ctypes.rst:1987 msgid "" "This function is a hook which allows implementing in-process COM servers " "with ctypes. It is called from the DllGetClassObject function that the " "``_ctypes`` extension dll exports." msgstr "" -#: library/ctypes.rst:1992 +#: library/ctypes.rst:1997 msgid "" "Try to find a library and return a pathname. *name* is the library name " "without any prefix like ``lib``, suffix like ``.so``, ``.dylib`` or version " @@ -2887,92 +2893,92 @@ msgid "" "If no library can be found, returns ``None``." msgstr "" -#: library/ctypes.rst:2003 +#: library/ctypes.rst:2008 msgid "" "Returns the filename of the VC runtime library used by Python, and by the " "extension modules. If the name of the library cannot be determined, " "``None`` is returned." msgstr "" -#: library/ctypes.rst:2007 +#: library/ctypes.rst:2012 msgid "" "If you need to free memory, for example, allocated by an extension module " "with a call to the ``free(void *)``, it is important that you use the " "function in the same library that allocated the memory." msgstr "" -#: library/ctypes.rst:2016 +#: library/ctypes.rst:2021 msgid "" "Returns a textual description of the error code *code*. If no error code is " "specified, the last error code is used by calling the Windows api function " "GetLastError." msgstr "" -#: library/ctypes.rst:2025 +#: library/ctypes.rst:2030 msgid "" "Returns the last error code set by Windows in the calling thread. This " "function calls the Windows ``GetLastError()`` function directly, it does not " "return the ctypes-private copy of the error code." msgstr "" -#: library/ctypes.rst:2034 +#: library/ctypes.rst:2039 msgid "" "Returns the current value of the ctypes-private copy of the system :data:" "`errno` variable in the calling thread." msgstr "" -#: library/ctypes.rst:2037 +#: library/ctypes.rst:2042 msgid "" "Raises an :ref:`auditing event ` ``ctypes.get_errno`` with no " "arguments." msgstr "" -#: library/ctypes.rst:2041 +#: library/ctypes.rst:2046 msgid "" "Returns the current value of the ctypes-private copy of the system :data:`!" "LastError` variable in the calling thread." msgstr "" -#: library/ctypes.rst:2046 +#: library/ctypes.rst:2051 msgid "" "Raises an :ref:`auditing event ` ``ctypes.get_last_error`` with no " "arguments." msgstr "" -#: library/ctypes.rst:2051 +#: library/ctypes.rst:2056 msgid "" "Same as the standard C memmove library function: copies *count* bytes from " "*src* to *dst*. *dst* and *src* must be integers or ctypes instances that " "can be converted to pointers." msgstr "" -#: library/ctypes.rst:2058 +#: library/ctypes.rst:2063 msgid "" "Same as the standard C memset library function: fills the memory block at " "address *dst* with *count* bytes of value *c*. *dst* must be an integer " "specifying an address, or a ctypes instance." msgstr "" -#: library/ctypes.rst:2065 +#: library/ctypes.rst:2070 msgid "" "Create and return a new ctypes pointer type. Pointer types are cached and " "reused internally, so calling this function repeatedly is cheap. *type* must " "be a ctypes type." msgstr "" -#: library/ctypes.rst:2072 +#: library/ctypes.rst:2077 msgid "" "Create a new pointer instance, pointing to *obj*. The returned object is of " "the type ``POINTER(type(obj))``." msgstr "" -#: library/ctypes.rst:2075 +#: library/ctypes.rst:2080 msgid "" "Note: If you just want to pass a pointer to an object to a foreign function " "call, you should use ``byref(obj)`` which is much faster." msgstr "" -#: library/ctypes.rst:2081 +#: library/ctypes.rst:2086 msgid "" "This function resizes the internal memory buffer of *obj*, which must be an " "instance of a ctypes type. It is not possible to make the buffer smaller " @@ -2980,50 +2986,50 @@ msgid "" "but it is possible to enlarge the buffer." msgstr "" -#: library/ctypes.rst:2089 +#: library/ctypes.rst:2094 msgid "" "Set the current value of the ctypes-private copy of the system :data:`errno` " "variable in the calling thread to *value* and return the previous value." msgstr "" -#: library/ctypes.rst:2092 +#: library/ctypes.rst:2097 msgid "" "Raises an :ref:`auditing event ` ``ctypes.set_errno`` with " "argument ``errno``." msgstr "" -#: library/ctypes.rst:2097 +#: library/ctypes.rst:2102 msgid "" "Sets the current value of the ctypes-private copy of the system :data:`!" "LastError` variable in the calling thread to *value* and return the previous " "value." msgstr "" -#: library/ctypes.rst:2103 +#: library/ctypes.rst:2108 msgid "" "Raises an :ref:`auditing event ` ``ctypes.set_last_error`` with " "argument ``error``." msgstr "" -#: library/ctypes.rst:2108 +#: library/ctypes.rst:2113 msgid "" "Returns the size in bytes of a ctypes type or instance memory buffer. Does " "the same as the C ``sizeof`` operator." msgstr "" -#: library/ctypes.rst:2114 +#: library/ctypes.rst:2119 msgid "" "Return the byte string at *void \\*ptr*. If *size* is specified, it is used " "as size, otherwise the string is assumed to be zero-terminated." msgstr "" -#: library/ctypes.rst:2118 +#: library/ctypes.rst:2123 msgid "" "Raises an :ref:`auditing event ` ``ctypes.string_at`` with " "arguments ``ptr``, ``size``." msgstr "" -#: library/ctypes.rst:2123 +#: library/ctypes.rst:2128 msgid "" "This function is probably the worst-named thing in ctypes. It creates an " "instance of :exc:`OSError`. If *code* is not specified, ``GetLastError`` is " @@ -3031,30 +3037,30 @@ msgid "" "`FormatError` is called to get a textual description of the error." msgstr "" -#: library/ctypes.rst:2131 +#: library/ctypes.rst:2136 msgid "" "An instance of :exc:`WindowsError` used to be created, which is now an alias " "of :exc:`OSError`." msgstr "" -#: library/ctypes.rst:2138 +#: library/ctypes.rst:2143 msgid "" "Return the wide-character string at *void \\*ptr*. If *size* is specified, " "it is used as the number of characters of the string, otherwise the string " "is assumed to be zero-terminated." msgstr "" -#: library/ctypes.rst:2143 +#: library/ctypes.rst:2148 msgid "" "Raises an :ref:`auditing event ` ``ctypes.wstring_at`` with " "arguments ``ptr``, ``size``." msgstr "" -#: library/ctypes.rst:2149 +#: library/ctypes.rst:2154 msgid "Data types" msgstr "" -#: library/ctypes.rst:2154 +#: library/ctypes.rst:2159 msgid "" "This non-public class is the common base class of all ctypes data types. " "Among other things, all ctypes type instances contain a memory block that " @@ -3064,13 +3070,13 @@ msgid "" "alive in case the memory block contains pointers." msgstr "" -#: library/ctypes.rst:2161 +#: library/ctypes.rst:2166 msgid "" "Common methods of ctypes data types, these are all class methods (to be " "exact, they are methods of the :term:`metaclass`):" msgstr "" -#: library/ctypes.rst:2166 +#: library/ctypes.rst:2171 msgid "" "This method returns a ctypes instance that shares the buffer of the *source* " "object. The *source* object must support the writeable buffer interface. " @@ -3079,13 +3085,13 @@ msgid "" "exc:`ValueError` is raised." msgstr "" -#: library/ctypes.rst:2182 +#: library/ctypes.rst:2187 msgid "" "Raises an :ref:`auditing event ` ``ctypes.cdata/buffer`` with " "arguments ``pointer``, ``size``, ``offset``." msgstr "" -#: library/ctypes.rst:2176 +#: library/ctypes.rst:2181 msgid "" "This method creates a ctypes instance, copying the buffer from the *source* " "object buffer which must be readable. The optional *offset* parameter " @@ -3093,19 +3099,19 @@ msgid "" "If the source buffer is not large enough a :exc:`ValueError` is raised." msgstr "" -#: library/ctypes.rst:2186 +#: library/ctypes.rst:2191 msgid "" "This method returns a ctypes type instance using the memory specified by " "*address* which must be an integer." msgstr "" -#: library/ctypes.rst:2191 +#: library/ctypes.rst:2196 msgid "" "This method, and others that indirectly call this method, raises an :ref:" "`auditing event ` ``ctypes.cdata`` with argument ``address``." msgstr "" -#: library/ctypes.rst:2197 +#: library/ctypes.rst:2202 msgid "" "This method adapts *obj* to a ctypes type. It is called with the actual " "object used in a foreign function call when the type is present in the " @@ -3113,25 +3119,25 @@ msgid "" "object that can be used as a function call parameter." msgstr "" -#: library/ctypes.rst:2202 +#: library/ctypes.rst:2207 msgid "" "All ctypes data types have a default implementation of this classmethod that " "normally returns *obj* if that is an instance of the type. Some types " "accept other objects as well." msgstr "" -#: library/ctypes.rst:2208 +#: library/ctypes.rst:2213 msgid "" "This method returns a ctypes type instance exported by a shared library. " "*name* is the name of the symbol that exports the data, *library* is the " "loaded shared library." msgstr "" -#: library/ctypes.rst:2212 +#: library/ctypes.rst:2217 msgid "Common instance variables of ctypes data types:" msgstr "" -#: library/ctypes.rst:2216 +#: library/ctypes.rst:2221 msgid "" "Sometimes ctypes data instances do not own the memory block they contain, " "instead they share part of the memory block of a base object. The :attr:" @@ -3139,13 +3145,13 @@ msgid "" "block." msgstr "" -#: library/ctypes.rst:2223 +#: library/ctypes.rst:2228 msgid "" "This read-only variable is true when the ctypes data instance has allocated " "the memory block itself, false otherwise." msgstr "" -#: library/ctypes.rst:2228 +#: library/ctypes.rst:2233 msgid "" "This member is either ``None`` or a dictionary containing Python objects " "that need to be kept alive so that the memory block contents is kept valid. " @@ -3153,7 +3159,7 @@ msgid "" "dictionary." msgstr "" -#: library/ctypes.rst:2241 +#: library/ctypes.rst:2246 msgid "" "This non-public class is the base class of all fundamental ctypes data " "types. It is mentioned here because it contains the common attributes of the " @@ -3162,11 +3168,11 @@ msgid "" "types that are not and do not contain pointers can now be pickled." msgstr "" -#: library/ctypes.rst:2247 +#: library/ctypes.rst:2252 msgid "Instances have a single attribute:" msgstr "" -#: library/ctypes.rst:2251 +#: library/ctypes.rst:2256 msgid "" "This attribute contains the actual value of the instance. For integer and " "pointer types, it is an integer, for character types, it is a single " @@ -3174,7 +3180,7 @@ msgid "" "bytes object or string." msgstr "" -#: library/ctypes.rst:2256 +#: library/ctypes.rst:2261 msgid "" "When the ``value`` attribute is retrieved from a ctypes instance, usually a " "new object is returned each time. :mod:`ctypes` does *not* implement " @@ -3182,7 +3188,7 @@ msgid "" "true for all other ctypes object instances." msgstr "" -#: library/ctypes.rst:2262 +#: library/ctypes.rst:2267 msgid "" "Fundamental data types, when returned as foreign function call results, or, " "for example, by retrieving structure field members or array items, are " @@ -3192,7 +3198,7 @@ msgid "" "instance." msgstr "" -#: library/ctypes.rst:2270 +#: library/ctypes.rst:2275 msgid "" "Subclasses of fundamental data types do *not* inherit this behavior. So, if " "a foreign functions :attr:`!restype` is a subclass of :class:`c_void_p`, you " @@ -3200,25 +3206,25 @@ msgid "" "you can get the value of the pointer by accessing the ``value`` attribute." msgstr "" -#: library/ctypes.rst:2275 +#: library/ctypes.rst:2280 msgid "These are the fundamental ctypes data types:" msgstr "" -#: library/ctypes.rst:2279 +#: library/ctypes.rst:2284 msgid "" "Represents the C :c:expr:`signed char` datatype, and interprets the value as " "small integer. The constructor accepts an optional integer initializer; no " "overflow checking is done." msgstr "" -#: library/ctypes.rst:2286 +#: library/ctypes.rst:2291 msgid "" "Represents the C :c:expr:`char` datatype, and interprets the value as a " "single character. The constructor accepts an optional string initializer, " "the length of the string must be exactly one character." msgstr "" -#: library/ctypes.rst:2293 +#: library/ctypes.rst:2298 msgid "" "Represents the C :c:expr:`char *` datatype when it points to a zero-" "terminated string. For a general character pointer that may also point to " @@ -3226,182 +3232,182 @@ msgid "" "integer address, or a bytes object." msgstr "" -#: library/ctypes.rst:2301 +#: library/ctypes.rst:2306 msgid "" "Represents the C :c:expr:`double` datatype. The constructor accepts an " "optional float initializer." msgstr "" -#: library/ctypes.rst:2307 +#: library/ctypes.rst:2312 msgid "" "Represents the C :c:expr:`long double` datatype. The constructor accepts an " "optional float initializer. On platforms where ``sizeof(long double) == " "sizeof(double)`` it is an alias to :class:`c_double`." msgstr "" -#: library/ctypes.rst:2313 +#: library/ctypes.rst:2318 msgid "" "Represents the C :c:expr:`float` datatype. The constructor accepts an " "optional float initializer." msgstr "" -#: library/ctypes.rst:2319 +#: library/ctypes.rst:2324 msgid "" "Represents the C :c:expr:`signed int` datatype. The constructor accepts an " "optional integer initializer; no overflow checking is done. On platforms " "where ``sizeof(int) == sizeof(long)`` it is an alias to :class:`c_long`." msgstr "" -#: library/ctypes.rst:2326 +#: library/ctypes.rst:2331 msgid "" "Represents the C 8-bit :c:expr:`signed int` datatype. Usually an alias for :" "class:`c_byte`." msgstr "" -#: library/ctypes.rst:2332 +#: library/ctypes.rst:2337 msgid "" "Represents the C 16-bit :c:expr:`signed int` datatype. Usually an alias " "for :class:`c_short`." msgstr "" -#: library/ctypes.rst:2338 +#: library/ctypes.rst:2343 msgid "" "Represents the C 32-bit :c:expr:`signed int` datatype. Usually an alias " "for :class:`c_int`." msgstr "" -#: library/ctypes.rst:2344 +#: library/ctypes.rst:2349 msgid "" "Represents the C 64-bit :c:expr:`signed int` datatype. Usually an alias " "for :class:`c_longlong`." msgstr "" -#: library/ctypes.rst:2350 +#: library/ctypes.rst:2355 msgid "" "Represents the C :c:expr:`signed long` datatype. The constructor accepts an " "optional integer initializer; no overflow checking is done." msgstr "" -#: library/ctypes.rst:2356 +#: library/ctypes.rst:2361 msgid "" "Represents the C :c:expr:`signed long long` datatype. The constructor " "accepts an optional integer initializer; no overflow checking is done." msgstr "" -#: library/ctypes.rst:2362 +#: library/ctypes.rst:2367 msgid "" "Represents the C :c:expr:`signed short` datatype. The constructor accepts " "an optional integer initializer; no overflow checking is done." msgstr "" -#: library/ctypes.rst:2368 +#: library/ctypes.rst:2373 msgid "Represents the C :c:type:`size_t` datatype." msgstr "" -#: library/ctypes.rst:2373 +#: library/ctypes.rst:2378 msgid "Represents the C :c:type:`ssize_t` datatype." msgstr "" -#: library/ctypes.rst:2380 +#: library/ctypes.rst:2385 msgid "Represents the C :c:type:`time_t` datatype." msgstr "" -#: library/ctypes.rst:2387 +#: library/ctypes.rst:2392 msgid "" "Represents the C :c:expr:`unsigned char` datatype, it interprets the value " "as small integer. The constructor accepts an optional integer initializer; " "no overflow checking is done." msgstr "" -#: library/ctypes.rst:2394 +#: library/ctypes.rst:2399 msgid "" "Represents the C :c:expr:`unsigned int` datatype. The constructor accepts " "an optional integer initializer; no overflow checking is done. On platforms " "where ``sizeof(int) == sizeof(long)`` it is an alias for :class:`c_ulong`." msgstr "" -#: library/ctypes.rst:2401 +#: library/ctypes.rst:2406 msgid "" "Represents the C 8-bit :c:expr:`unsigned int` datatype. Usually an alias " "for :class:`c_ubyte`." msgstr "" -#: library/ctypes.rst:2407 +#: library/ctypes.rst:2412 msgid "" "Represents the C 16-bit :c:expr:`unsigned int` datatype. Usually an alias " "for :class:`c_ushort`." msgstr "" -#: library/ctypes.rst:2413 +#: library/ctypes.rst:2418 msgid "" "Represents the C 32-bit :c:expr:`unsigned int` datatype. Usually an alias " "for :class:`c_uint`." msgstr "" -#: library/ctypes.rst:2419 +#: library/ctypes.rst:2424 msgid "" "Represents the C 64-bit :c:expr:`unsigned int` datatype. Usually an alias " "for :class:`c_ulonglong`." msgstr "" -#: library/ctypes.rst:2425 +#: library/ctypes.rst:2430 msgid "" "Represents the C :c:expr:`unsigned long` datatype. The constructor accepts " "an optional integer initializer; no overflow checking is done." msgstr "" -#: library/ctypes.rst:2431 +#: library/ctypes.rst:2436 msgid "" "Represents the C :c:expr:`unsigned long long` datatype. The constructor " "accepts an optional integer initializer; no overflow checking is done." msgstr "" -#: library/ctypes.rst:2437 +#: library/ctypes.rst:2442 msgid "" "Represents the C :c:expr:`unsigned short` datatype. The constructor accepts " "an optional integer initializer; no overflow checking is done." msgstr "" -#: library/ctypes.rst:2443 +#: library/ctypes.rst:2448 msgid "" "Represents the C :c:expr:`void *` type. The value is represented as " "integer. The constructor accepts an optional integer initializer." msgstr "" -#: library/ctypes.rst:2449 +#: library/ctypes.rst:2454 msgid "" "Represents the C :c:type:`wchar_t` datatype, and interprets the value as a " "single character unicode string. The constructor accepts an optional string " "initializer, the length of the string must be exactly one character." msgstr "" -#: library/ctypes.rst:2456 +#: library/ctypes.rst:2461 msgid "" "Represents the C :c:expr:`wchar_t *` datatype, which must be a pointer to a " "zero-terminated wide character string. The constructor accepts an integer " "address, or a string." msgstr "" -#: library/ctypes.rst:2463 +#: library/ctypes.rst:2468 msgid "" "Represent the C :c:expr:`bool` datatype (more accurately, :c:expr:`_Bool` " "from C99). Its value can be ``True`` or ``False``, and the constructor " "accepts any object that has a truth value." msgstr "" -#: library/ctypes.rst:2470 +#: library/ctypes.rst:2475 msgid "" "Represents a :c:type:`!HRESULT` value, which contains success or error " "information for a function or method call." msgstr "" -#: library/ctypes.rst:2478 +#: library/ctypes.rst:2483 msgid "" "Represents the C :c:expr:`PyObject *` datatype. Calling this without an " "argument creates a ``NULL`` :c:expr:`PyObject *` pointer." msgstr "" -#: library/ctypes.rst:2481 +#: library/ctypes.rst:2486 msgid "" "The :mod:`!ctypes.wintypes` module provides quite some other Windows " "specific data types, for example :c:type:`!HWND`, :c:type:`!WPARAM`, or :c:" @@ -3409,41 +3415,41 @@ msgid "" "are also defined." msgstr "" -#: library/ctypes.rst:2489 +#: library/ctypes.rst:2494 msgid "Structured data types" msgstr "" -#: library/ctypes.rst:2494 +#: library/ctypes.rst:2499 msgid "Abstract base class for unions in native byte order." msgstr "" -#: library/ctypes.rst:2499 +#: library/ctypes.rst:2504 msgid "Abstract base class for unions in *big endian* byte order." msgstr "" -#: library/ctypes.rst:2505 +#: library/ctypes.rst:2510 msgid "Abstract base class for unions in *little endian* byte order." msgstr "" -#: library/ctypes.rst:2511 +#: library/ctypes.rst:2516 msgid "Abstract base class for structures in *big endian* byte order." msgstr "" -#: library/ctypes.rst:2516 +#: library/ctypes.rst:2521 msgid "Abstract base class for structures in *little endian* byte order." msgstr "" -#: library/ctypes.rst:2518 +#: library/ctypes.rst:2523 msgid "" "Structures and unions with non-native byte order cannot contain pointer type " "fields, or any other data types containing pointer type fields." msgstr "" -#: library/ctypes.rst:2524 +#: library/ctypes.rst:2529 msgid "Abstract base class for structures in *native* byte order." msgstr "" -#: library/ctypes.rst:2526 +#: library/ctypes.rst:2531 msgid "" "Concrete structure and union types must be created by subclassing one of " "these types, and at least define a :attr:`_fields_` class variable. :mod:" @@ -3451,34 +3457,34 @@ msgid "" "the fields by direct attribute accesses. These are the" msgstr "" -#: library/ctypes.rst:2534 +#: library/ctypes.rst:2539 msgid "" "A sequence defining the structure fields. The items must be 2-tuples or 3-" "tuples. The first item is the name of the field, the second item specifies " "the type of the field; it can be any ctypes data type." msgstr "" -#: library/ctypes.rst:2538 +#: library/ctypes.rst:2543 msgid "" "For integer type fields like :class:`c_int`, a third optional item can be " "given. It must be a small positive integer defining the bit width of the " "field." msgstr "" -#: library/ctypes.rst:2542 +#: library/ctypes.rst:2547 msgid "" "Field names must be unique within one structure or union. This is not " "checked, only one field can be accessed when names are repeated." msgstr "" -#: library/ctypes.rst:2545 +#: library/ctypes.rst:2550 msgid "" "It is possible to define the :attr:`_fields_` class variable *after* the " "class statement that defines the Structure subclass, this allows creating " "data types that directly or indirectly reference themselves::" msgstr "" -#: library/ctypes.rst:2549 +#: library/ctypes.rst:2554 msgid "" "class List(Structure):\n" " pass\n" @@ -3487,7 +3493,7 @@ msgid "" " ]" msgstr "" -#: library/ctypes.rst:2555 +#: library/ctypes.rst:2560 msgid "" "The :attr:`_fields_` class variable must, however, be defined before the " "type is first used (an instance is created, :func:`sizeof` is called on it, " @@ -3495,14 +3501,14 @@ msgid "" "raise an AttributeError." msgstr "" -#: library/ctypes.rst:2560 +#: library/ctypes.rst:2565 msgid "" "It is possible to define sub-subclasses of structure types, they inherit the " "fields of the base class plus the :attr:`_fields_` defined in the sub-" "subclass, if any." msgstr "" -#: library/ctypes.rst:2567 +#: library/ctypes.rst:2572 msgid "" "An optional small integer that allows overriding the alignment of structure " "fields in the instance. :attr:`_pack_` must already be defined when :attr:" @@ -3510,14 +3516,21 @@ msgid "" "attribute to 0 is the same as not setting it at all." msgstr "" -#: library/ctypes.rst:2575 +#: library/ctypes.rst:2580 +msgid "" +"An optional small integer that allows overriding the alignment of the " +"structure when being packed or unpacked to/from memory. Setting this " +"attribute to 0 is the same as not setting it at all." +msgstr "" + +#: library/ctypes.rst:2588 msgid "" "An optional sequence that lists the names of unnamed (anonymous) fields. :" "attr:`_anonymous_` must be already defined when :attr:`_fields_` is " "assigned, otherwise it will have no effect." msgstr "" -#: library/ctypes.rst:2579 +#: library/ctypes.rst:2592 msgid "" "The fields listed in this variable must be structure or union type fields. :" "mod:`ctypes` will create descriptors in the structure type that allows " @@ -3525,11 +3538,11 @@ msgid "" "structure or union field." msgstr "" -#: library/ctypes.rst:2584 +#: library/ctypes.rst:2597 msgid "Here is an example type (Windows)::" msgstr "" -#: library/ctypes.rst:2586 +#: library/ctypes.rst:2599 msgid "" "class _U(Union):\n" " _fields_ = [(\"lptdesc\", POINTER(TYPEDESC)),\n" @@ -3542,7 +3555,7 @@ msgid "" " (\"vt\", VARTYPE)]" msgstr "" -#: library/ctypes.rst:2597 +#: library/ctypes.rst:2610 msgid "" "The ``TYPEDESC`` structure describes a COM data type, the ``vt`` field " "specifies which one of the union fields is valid. Since the ``u`` field is " @@ -3552,7 +3565,7 @@ msgid "" "temporary union instance::" msgstr "" -#: library/ctypes.rst:2604 +#: library/ctypes.rst:2617 msgid "" "td = TYPEDESC()\n" "td.vt = VT_PTR\n" @@ -3560,7 +3573,7 @@ msgid "" "td.u.lptdesc = POINTER(some_type)" msgstr "" -#: library/ctypes.rst:2609 +#: library/ctypes.rst:2622 msgid "" "It is possible to define sub-subclasses of structures, they inherit the " "fields of the base class. If the subclass definition has a separate :attr:" @@ -3568,7 +3581,7 @@ msgid "" "of the base class." msgstr "" -#: library/ctypes.rst:2614 +#: library/ctypes.rst:2627 msgid "" "Structure and union constructors accept both positional and keyword " "arguments. Positional arguments are used to initialize member fields in the " @@ -3578,15 +3591,15 @@ msgid "" "names not present in :attr:`_fields_`." msgstr "" -#: library/ctypes.rst:2625 +#: library/ctypes.rst:2638 msgid "Arrays and pointers" msgstr "" -#: library/ctypes.rst:2629 +#: library/ctypes.rst:2642 msgid "Abstract base class for arrays." msgstr "" -#: library/ctypes.rst:2631 +#: library/ctypes.rst:2644 msgid "" "The recommended way to create concrete array types is by multiplying any :" "mod:`ctypes` data type with a non-negative integer. Alternatively, you can " @@ -3596,34 +3609,46 @@ msgid "" "an :class:`Array`." msgstr "" -#: library/ctypes.rst:2641 +#: library/ctypes.rst:2654 msgid "" "A positive integer specifying the number of elements in the array. Out-of-" "range subscripts result in an :exc:`IndexError`. Will be returned by :func:" "`len`." msgstr "" -#: library/ctypes.rst:2648 +#: library/ctypes.rst:2661 msgid "Specifies the type of each element in the array." msgstr "" -#: library/ctypes.rst:2651 +#: library/ctypes.rst:2664 msgid "" "Array subclass constructors accept positional arguments, used to initialize " "the elements in order." msgstr "" -#: library/ctypes.rst:2657 +#: library/ctypes.rst:2669 +msgid "" +"Create an array. Equivalent to ``type * length``, where *type* is a :mod:" +"`ctypes` data type and *length* an integer." +msgstr "" + +#: library/ctypes.rst:2673 +msgid "" +"This function is :term:`soft deprecated` in favor of multiplication. There " +"are no plans to remove it." +msgstr "" + +#: library/ctypes.rst:2679 msgid "Private, abstract base class for pointers." msgstr "" -#: library/ctypes.rst:2659 +#: library/ctypes.rst:2681 msgid "" "Concrete pointer types are created by calling :func:`POINTER` with the type " "that will be pointed to; this is done automatically by :func:`pointer`." msgstr "" -#: library/ctypes.rst:2663 +#: library/ctypes.rst:2685 msgid "" "If a pointer points to an array, its elements can be read and written using " "standard subscript and slice accesses. Pointer objects have no size, so :" @@ -3632,11 +3657,11 @@ msgid "" "probably crash with an access violation (if you're lucky)." msgstr "" -#: library/ctypes.rst:2673 +#: library/ctypes.rst:2695 msgid "Specifies the type pointed to." msgstr "" -#: library/ctypes.rst:2677 +#: library/ctypes.rst:2699 msgid "" "Returns the object to which to pointer points. Assigning to this attribute " "changes the pointer to point to the assigned object." diff --git a/library/curses.ascii.po b/library/curses.ascii.po index 5a130830..adda32fc 100644 --- a/library/curses.ascii.po +++ b/library/curses.ascii.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" diff --git a/library/curses.panel.po b/library/curses.panel.po index 1c5c159a..32c13c0c 100644 --- a/library/curses.panel.po +++ b/library/curses.panel.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" diff --git a/library/curses.po b/library/curses.po index 6a9a70ff..0ab7e5e1 100644 --- a/library/curses.po +++ b/library/curses.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -39,80 +39,90 @@ msgid "" "curses library hosted on Linux and the BSD variants of Unix." msgstr "" -#: library/curses.rst:26 +#: includes/wasm-mobile-notavail.rst:3 +msgid "Availability" +msgstr "" + +#: includes/wasm-mobile-notavail.rst:5 +msgid "" +"This module is not supported on :ref:`mobile platforms ` or :ref:`WebAssembly platforms `." +msgstr "" + +#: library/curses.rst:28 msgid "" "Whenever the documentation mentions a *character* it can be specified as an " "integer, a one-character Unicode string or a one-byte byte string." msgstr "" -#: library/curses.rst:29 +#: library/curses.rst:31 msgid "" "Whenever the documentation mentions a *character string* it can be specified " "as a Unicode string or a byte string." msgstr "" -#: library/curses.rst:34 +#: library/curses.rst:36 msgid "Module :mod:`curses.ascii`" msgstr "" -#: library/curses.rst:35 +#: library/curses.rst:37 msgid "" "Utilities for working with ASCII characters, regardless of your locale " "settings." msgstr "" -#: library/curses.rst:37 +#: library/curses.rst:39 msgid "Module :mod:`curses.panel`" msgstr "" -#: library/curses.rst:38 +#: library/curses.rst:40 msgid "A panel stack extension that adds depth to curses windows." msgstr "" -#: library/curses.rst:40 +#: library/curses.rst:42 msgid "Module :mod:`curses.textpad`" msgstr "" -#: library/curses.rst:41 +#: library/curses.rst:43 msgid "" "Editable text widget for curses supporting :program:`Emacs`\\ -like " "bindings." msgstr "" -#: library/curses.rst:43 +#: library/curses.rst:45 msgid ":ref:`curses-howto`" msgstr "" -#: library/curses.rst:44 +#: library/curses.rst:46 msgid "" "Tutorial material on using curses with Python, by Andrew Kuchling and Eric " "Raymond." msgstr "" -#: library/curses.rst:51 +#: library/curses.rst:53 msgid "Functions" msgstr "" -#: library/curses.rst:53 +#: library/curses.rst:55 msgid "The module :mod:`curses` defines the following exception:" msgstr "" -#: library/curses.rst:58 +#: library/curses.rst:60 msgid "Exception raised when a curses library function returns an error." msgstr "" -#: library/curses.rst:62 +#: library/curses.rst:64 msgid "" "Whenever *x* or *y* arguments to a function or a method are optional, they " "default to the current cursor location. Whenever *attr* is optional, it " "defaults to :const:`A_NORMAL`." msgstr "" -#: library/curses.rst:66 +#: library/curses.rst:68 msgid "The module :mod:`curses` defines the following functions:" msgstr "" -#: library/curses.rst:71 +#: library/curses.rst:73 msgid "" "Return the output speed of the terminal in bits per second. On software " "terminal emulators it will have a fixed high value. Included for historical " @@ -120,17 +130,17 @@ msgid "" "and occasionally to change interfaces depending on the line speed." msgstr "" -#: library/curses.rst:79 +#: library/curses.rst:81 msgid "Emit a short attention sound." msgstr "" -#: library/curses.rst:84 +#: library/curses.rst:86 msgid "" "Return ``True`` or ``False``, depending on whether the programmer can change " "the colors displayed by the terminal." msgstr "" -#: library/curses.rst:90 +#: library/curses.rst:92 msgid "" "Enter cbreak mode. In cbreak mode (sometimes called \"rare\" mode) normal " "tty line buffering is turned off and characters are available to be read one " @@ -140,7 +150,7 @@ msgid "" "terminal in cbreak mode." msgstr "" -#: library/curses.rst:99 +#: library/curses.rst:101 msgid "" "Return the intensity of the red, green, and blue (RGB) components in the " "color *color_number*, which must be between ``0`` and ``COLORS - 1``. " @@ -149,7 +159,7 @@ msgid "" "component)." msgstr "" -#: library/curses.rst:107 +#: library/curses.rst:109 msgid "" "Return the attribute value for displaying text in the specified color pair. " "Only the first 256 color pairs are supported. This attribute value can be " @@ -158,7 +168,7 @@ msgid "" "function." msgstr "" -#: library/curses.rst:116 +#: library/curses.rst:118 msgid "" "Set the cursor state. *visibility* can be set to ``0``, ``1``, or ``2``, " "for invisible, normal, or very visible. If the terminal supports the " @@ -167,7 +177,7 @@ msgid "" "and the \"very visible\" mode is a block cursor." msgstr "" -#: library/curses.rst:125 +#: library/curses.rst:127 msgid "" "Save the current terminal mode as the \"program\" mode, the mode when the " "running program is using curses. (Its counterpart is the \"shell\" mode, " @@ -175,7 +185,7 @@ msgid "" "`reset_prog_mode` will restore this mode." msgstr "" -#: library/curses.rst:133 +#: library/curses.rst:135 msgid "" "Save the current terminal mode as the \"shell\" mode, the mode when the " "running program is not using curses. (Its counterpart is the \"program\" " @@ -183,11 +193,11 @@ msgid "" "func:`reset_shell_mode` will restore this mode." msgstr "" -#: library/curses.rst:141 +#: library/curses.rst:143 msgid "Insert an *ms* millisecond pause in output." msgstr "" -#: library/curses.rst:146 +#: library/curses.rst:148 msgid "" "Update the physical screen. The curses library keeps two data structures, " "one representing the current physical screen contents and a virtual screen " @@ -195,7 +205,7 @@ msgid "" "the physical screen to match the virtual screen." msgstr "" -#: library/curses.rst:151 +#: library/curses.rst:153 msgid "" "The virtual screen may be updated by a :meth:`~window.noutrefresh` call " "after write operations such as :meth:`~window.addstr` have been performed on " @@ -206,24 +216,24 @@ msgid "" "func:`!doupdate`." msgstr "" -#: library/curses.rst:161 +#: library/curses.rst:163 msgid "" "Enter echo mode. In echo mode, each character input is echoed to the screen " "as it is entered." msgstr "" -#: library/curses.rst:167 +#: library/curses.rst:169 msgid "De-initialize the library, and return terminal to normal status." msgstr "" -#: library/curses.rst:172 +#: library/curses.rst:174 msgid "" "Return the user's current erase character as a one-byte bytes object. Under " "Unix operating systems this is a property of the controlling tty of the " "curses program, and is not set by the curses library itself." msgstr "" -#: library/curses.rst:179 +#: library/curses.rst:181 msgid "" "The :func:`.filter` routine, if used, must be called before :func:`initscr` " "is called. The effect is that, during those calls, :envvar:`LINES` is set " @@ -234,20 +244,20 @@ msgid "" "time line editing without touching the rest of the screen." msgstr "" -#: library/curses.rst:189 +#: library/curses.rst:191 msgid "" "Flash the screen. That is, change it to reverse-video and then change it " "back in a short interval. Some people prefer such as 'visible bell' to the " "audible attention signal produced by :func:`beep`." msgstr "" -#: library/curses.rst:196 +#: library/curses.rst:198 msgid "" "Flush all input buffers. This throws away any typeahead that has been " "typed by the user and has not yet been processed by the program." msgstr "" -#: library/curses.rst:202 +#: library/curses.rst:204 msgid "" "After :meth:`~window.getch` returns :const:`KEY_MOUSE` to signal a mouse " "event, this method should be called to retrieve the queued mouse event, " @@ -262,51 +272,51 @@ msgid "" "const:`BUTTON_ALT`." msgstr "" -#: library/curses.rst:1774 +#: library/curses.rst:1776 msgid "" "The ``BUTTON5_*`` constants are now exposed if they are provided by the " "underlying curses library." msgstr "" -#: library/curses.rst:220 +#: library/curses.rst:222 msgid "" "Return the current coordinates of the virtual screen cursor as a tuple ``(y, " "x)``. If :meth:`leaveok ` is currently ``True``, then " "return ``(-1, -1)``." msgstr "" -#: library/curses.rst:226 +#: library/curses.rst:228 msgid "" "Read window related data stored in the file by an earlier :func:`window." "putwin` call. The routine then creates and initializes a new window using " "that data, returning the new window object." msgstr "" -#: library/curses.rst:233 +#: library/curses.rst:235 msgid "" "Return ``True`` if the terminal can display colors; otherwise, return " "``False``." msgstr "" -#: library/curses.rst:237 +#: library/curses.rst:239 msgid "" "Return ``True`` if the module supports extended colors; otherwise, return " "``False``. Extended color support allows more than 256 color pairs for " "terminals that support more than 16 colors (e.g. xterm-256color)." msgstr "" -#: library/curses.rst:241 +#: library/curses.rst:243 msgid "Extended color support requires ncurses version 6.1 or later." msgstr "" -#: library/curses.rst:247 +#: library/curses.rst:249 msgid "" "Return ``True`` if the terminal has insert- and delete-character " "capabilities. This function is included for historical reasons only, as all " "modern software terminal emulators have such capabilities." msgstr "" -#: library/curses.rst:254 +#: library/curses.rst:256 msgid "" "Return ``True`` if the terminal has insert- and delete-line capabilities, or " "can simulate them using scrolling regions. This function is included for " @@ -314,13 +324,13 @@ msgid "" "capabilities." msgstr "" -#: library/curses.rst:262 +#: library/curses.rst:264 msgid "" "Take a key value *ch*, and return ``True`` if the current terminal type " "recognizes a key with that value." msgstr "" -#: library/curses.rst:268 +#: library/curses.rst:270 msgid "" "Used for half-delay mode, which is similar to cbreak mode in that characters " "typed by the user are immediately available to the program. However, after " @@ -329,7 +339,7 @@ msgid "" "``255``. Use :func:`nocbreak` to leave half-delay mode." msgstr "" -#: library/curses.rst:277 +#: library/curses.rst:279 msgid "" "Change the definition of a color, taking the number of the color to be " "changed followed by three RGB values (for the amounts of red, green, and " @@ -341,7 +351,7 @@ msgid "" "``True``." msgstr "" -#: library/curses.rst:288 +#: library/curses.rst:290 msgid "" "Change the definition of a color-pair. It takes three arguments: the number " "of the color-pair to be changed, the foreground color number, and the " @@ -354,31 +364,31 @@ msgid "" "definition." msgstr "" -#: library/curses.rst:301 +#: library/curses.rst:303 msgid "" "Initialize the library. Return a :ref:`window ` " "object which represents the whole screen." msgstr "" -#: library/curses.rst:306 +#: library/curses.rst:308 msgid "" "If there is an error opening the terminal, the underlying curses library may " "cause the interpreter to exit." msgstr "" -#: library/curses.rst:312 +#: library/curses.rst:314 msgid "" "Return ``True`` if :func:`resize_term` would modify the window structure, " "``False`` otherwise." msgstr "" -#: library/curses.rst:318 +#: library/curses.rst:320 msgid "" "Return ``True`` if :func:`endwin` has been called (that is, the curses " "library has been deinitialized)." msgstr "" -#: library/curses.rst:324 +#: library/curses.rst:326 msgid "" "Return the name of the key numbered *k* as a bytes object. The name of a " "key generating printable ASCII character is the key's character. The name " @@ -389,27 +399,27 @@ msgid "" "character." msgstr "" -#: library/curses.rst:334 +#: library/curses.rst:336 msgid "" "Return the user's current line kill character as a one-byte bytes object. " "Under Unix operating systems this is a property of the controlling tty of " "the curses program, and is not set by the curses library itself." msgstr "" -#: library/curses.rst:341 +#: library/curses.rst:343 msgid "" "Return a bytes object containing the terminfo long name field describing the " "current terminal. The maximum length of a verbose description is 128 " "characters. It is defined only after the call to :func:`initscr`." msgstr "" -#: library/curses.rst:348 +#: library/curses.rst:350 msgid "" "If *flag* is ``True``, allow 8-bit characters to be input. If *flag* is " "``False``, allow only 7-bit chars." msgstr "" -#: library/curses.rst:354 +#: library/curses.rst:356 msgid "" "Set the maximum time in milliseconds that can elapse between press and " "release events in order for them to be recognized as a click, and return the " @@ -417,7 +427,7 @@ msgid "" "fifth of a second." msgstr "" -#: library/curses.rst:361 +#: library/curses.rst:363 msgid "" "Set the mouse events to be reported, and return a tuple ``(availmask, " "oldmask)``. *availmask* indicates which of the specified mouse events can " @@ -426,17 +436,17 @@ msgid "" "never called, no mouse events are ever reported." msgstr "" -#: library/curses.rst:370 +#: library/curses.rst:372 msgid "Sleep for *ms* milliseconds." msgstr "" -#: library/curses.rst:375 +#: library/curses.rst:377 msgid "" "Create and return a pointer to a new pad data structure with the given " "number of lines and columns. Return a pad as a window object." msgstr "" -#: library/curses.rst:378 +#: library/curses.rst:380 msgid "" "A pad is like a window, except that it is not restricted by the screen size, " "and is not necessarily associated with a particular part of the screen. " @@ -452,35 +462,35 @@ msgid "" "to be displayed." msgstr "" -#: library/curses.rst:394 +#: library/curses.rst:396 msgid "" "Return a new :ref:`window `, whose left-upper corner " "is at ``(begin_y, begin_x)``, and whose height/width is *nlines*/*ncols*." msgstr "" -#: library/curses.rst:397 +#: library/curses.rst:399 msgid "" "By default, the window will extend from the specified position to the lower " "right corner of the screen." msgstr "" -#: library/curses.rst:403 +#: library/curses.rst:405 msgid "" "Enter newline mode. This mode translates the return key into newline on " "input, and translates newline into return and line-feed on output. Newline " "mode is initially on." msgstr "" -#: library/curses.rst:410 +#: library/curses.rst:412 msgid "" "Leave cbreak mode. Return to normal \"cooked\" mode with line buffering." msgstr "" -#: library/curses.rst:415 +#: library/curses.rst:417 msgid "Leave echo mode. Echoing of input characters is turned off." msgstr "" -#: library/curses.rst:420 +#: library/curses.rst:422 msgid "" "Leave newline mode. Disable translation of return into newline on input, " "and disable low-level translation of newline into newline/return on output " @@ -490,7 +500,7 @@ msgid "" "also, it will be able to detect the return key on input." msgstr "" -#: library/curses.rst:430 +#: library/curses.rst:432 msgid "" "When the :func:`!noqiflush` routine is used, normal flush of input and " "output queues associated with the ``INTR``, ``QUIT`` and ``SUSP`` characters " @@ -499,63 +509,63 @@ msgid "" "occurred, after the handler exits." msgstr "" -#: library/curses.rst:438 +#: library/curses.rst:440 msgid "Leave raw mode. Return to normal \"cooked\" mode with line buffering." msgstr "" -#: library/curses.rst:443 +#: library/curses.rst:445 msgid "" "Return a tuple ``(fg, bg)`` containing the colors for the requested color " "pair. The value of *pair_number* must be between ``0`` and ``COLOR_PAIRS - " "1``." msgstr "" -#: library/curses.rst:449 +#: library/curses.rst:451 msgid "" "Return the number of the color-pair set by the attribute value *attr*. :func:" "`color_pair` is the counterpart to this function." msgstr "" -#: library/curses.rst:455 +#: library/curses.rst:457 msgid "" "Equivalent to ``tputs(str, 1, putchar)``; emit the value of a specified " "terminfo capability for the current terminal. Note that the output of :func:" "`putp` always goes to standard output." msgstr "" -#: library/curses.rst:462 +#: library/curses.rst:464 msgid "" "If *flag* is ``False``, the effect is the same as calling :func:`noqiflush`. " "If *flag* is ``True``, or no argument is provided, the queues will be " "flushed when these control characters are read." msgstr "" -#: library/curses.rst:469 +#: library/curses.rst:471 msgid "" "Enter raw mode. In raw mode, normal line buffering and processing of " "interrupt, quit, suspend, and flow control keys are turned off; characters " "are presented to curses input functions one by one." msgstr "" -#: library/curses.rst:476 +#: library/curses.rst:478 msgid "" "Restore the terminal to \"program\" mode, as previously saved by :func:" "`def_prog_mode`." msgstr "" -#: library/curses.rst:482 +#: library/curses.rst:484 msgid "" "Restore the terminal to \"shell\" mode, as previously saved by :func:" "`def_shell_mode`." msgstr "" -#: library/curses.rst:488 +#: library/curses.rst:490 msgid "" "Restore the state of the terminal modes to what it was at the last call to :" "func:`savetty`." msgstr "" -#: library/curses.rst:494 +#: library/curses.rst:496 msgid "" "Backend function used by :func:`resizeterm`, performing most of the work; " "when resizing the windows, :func:`resize_term` blank-fills the areas that " @@ -565,47 +575,47 @@ msgid "" "to resize these without additional interaction with the application." msgstr "" -#: library/curses.rst:504 +#: library/curses.rst:506 msgid "" "Resize the standard and current windows to the specified dimensions, and " "adjusts other bookkeeping data used by the curses library that record the " "window dimensions (in particular the SIGWINCH handler)." msgstr "" -#: library/curses.rst:511 +#: library/curses.rst:513 msgid "" "Save the current state of the terminal modes in a buffer, usable by :func:" "`resetty`." msgstr "" -#: library/curses.rst:516 +#: library/curses.rst:518 msgid "Retrieves the value set by :func:`set_escdelay`." msgstr "" -#: library/curses.rst:522 +#: library/curses.rst:524 msgid "" "Sets the number of milliseconds to wait after reading an escape character, " "to distinguish between an individual escape character entered on the " "keyboard from escape sequences sent by cursor and function keys." msgstr "" -#: library/curses.rst:530 +#: library/curses.rst:532 msgid "Retrieves the value set by :func:`set_tabsize`." msgstr "" -#: library/curses.rst:536 +#: library/curses.rst:538 msgid "" "Sets the number of columns used by the curses library when converting a tab " "character to spaces as it adds the tab to a window." msgstr "" -#: library/curses.rst:543 +#: library/curses.rst:545 msgid "" "Set the virtual screen cursor to *y*, *x*. If *y* and *x* are both ``-1``, " "then :meth:`leaveok ` is set ``True``." msgstr "" -#: library/curses.rst:549 +#: library/curses.rst:551 msgid "" "Initialize the terminal. *term* is a string giving the terminal name, or " "``None``; if omitted or ``None``, the value of the :envvar:`TERM` " @@ -614,14 +624,14 @@ msgid "" "descriptor for ``sys.stdout`` will be used." msgstr "" -#: library/curses.rst:558 +#: library/curses.rst:560 msgid "" "Must be called if the programmer wants to use colors, and before any other " "color manipulation routine is called. It is good practice to call this " "routine right after :func:`initscr`." msgstr "" -#: library/curses.rst:562 +#: library/curses.rst:564 msgid "" ":func:`start_color` initializes eight basic colors (black, red, green, " "yellow, blue, magenta, cyan, and white), and two global variables in the :" @@ -631,20 +641,20 @@ msgid "" "terminal was just turned on." msgstr "" -#: library/curses.rst:571 +#: library/curses.rst:573 msgid "" "Return a logical OR of all video attributes supported by the terminal. This " "information is useful when a curses program needs complete control over the " "appearance of the screen." msgstr "" -#: library/curses.rst:578 +#: library/curses.rst:580 msgid "" "Return the value of the environment variable :envvar:`TERM`, as a bytes " "object, truncated to 14 characters." msgstr "" -#: library/curses.rst:584 +#: library/curses.rst:586 msgid "" "Return the value of the Boolean capability corresponding to the terminfo " "capability name *capname* as an integer. Return the value ``-1`` if " @@ -652,7 +662,7 @@ msgid "" "from the terminal description." msgstr "" -#: library/curses.rst:592 +#: library/curses.rst:594 msgid "" "Return the value of the numeric capability corresponding to the terminfo " "capability name *capname* as an integer. Return the value ``-2`` if " @@ -660,7 +670,7 @@ msgid "" "from the terminal description." msgstr "" -#: library/curses.rst:600 +#: library/curses.rst:602 msgid "" "Return the value of the string capability corresponding to the terminfo " "capability name *capname* as a bytes object. Return ``None`` if *capname* " @@ -668,7 +678,7 @@ msgid "" "terminal description." msgstr "" -#: library/curses.rst:608 +#: library/curses.rst:610 msgid "" "Instantiate the bytes object *str* with the supplied parameters, where *str* " "should be a parameterized string obtained from the terminfo database. E.g. " @@ -676,13 +686,13 @@ msgid "" "exact result depending on terminal type." msgstr "" -#: library/curses.rst:616 +#: library/curses.rst:618 msgid "" "Specify that the file descriptor *fd* be used for typeahead checking. If " "*fd* is ``-1``, then no typeahead checking is done." msgstr "" -#: library/curses.rst:619 +#: library/curses.rst:621 msgid "" "The curses library does \"line-breakout optimization\" by looking for " "typeahead periodically while updating the screen. If input is found, and it " @@ -692,7 +702,7 @@ msgid "" "typeahead checking." msgstr "" -#: library/curses.rst:628 +#: library/curses.rst:630 msgid "" "Return a bytes object which is a printable representation of the character " "*ch*. Control characters are represented as a caret followed by the " @@ -700,35 +710,35 @@ msgid "" "are." msgstr "" -#: library/curses.rst:635 +#: library/curses.rst:637 msgid "Push *ch* so the next :meth:`~window.getch` will return it." msgstr "" -#: library/curses.rst:639 +#: library/curses.rst:641 msgid "Only one *ch* can be pushed before :meth:`!getch` is called." msgstr "" -#: library/curses.rst:644 +#: library/curses.rst:646 msgid "" "Update the :const:`LINES` and :const:`COLS` module variables. Useful for " "detecting manual screen resize." msgstr "" -#: library/curses.rst:652 +#: library/curses.rst:654 msgid "Push *ch* so the next :meth:`~window.get_wch` will return it." msgstr "" -#: library/curses.rst:656 +#: library/curses.rst:658 msgid "Only one *ch* can be pushed before :meth:`!get_wch` is called." msgstr "" -#: library/curses.rst:663 +#: library/curses.rst:665 msgid "" "Push a :const:`KEY_MOUSE` event onto the input queue, associating the given " "state data with it." msgstr "" -#: library/curses.rst:669 +#: library/curses.rst:671 msgid "" "If used, this function should be called before :func:`initscr` or newterm " "are called. When *flag* is ``False``, the values of lines and columns " @@ -738,7 +748,7 @@ msgid "" "to use the window size if :envvar:`LINES` and :envvar:`COLUMNS` are not set)." msgstr "" -#: library/curses.rst:679 +#: library/curses.rst:681 msgid "" "Allow use of default values for colors on terminals supporting this feature. " "Use this to support transparency in your application. The default color is " @@ -747,7 +757,7 @@ msgid "" "*x* to a red foreground color on the default background." msgstr "" -#: library/curses.rst:688 +#: library/curses.rst:690 msgid "" "Initialize curses and call another callable object, *func*, which should be " "the rest of your curses-using application. If the application raises an " @@ -761,50 +771,50 @@ msgid "" "echo, and disables the terminal keypad." msgstr "" -#: library/curses.rst:702 +#: library/curses.rst:704 msgid "Window Objects" msgstr "" -#: library/curses.rst:704 +#: library/curses.rst:706 msgid "" "Window objects, as returned by :func:`initscr` and :func:`newwin` above, " "have the following methods and attributes:" msgstr "" -#: library/curses.rst:711 +#: library/curses.rst:713 msgid "" "Paint character *ch* at ``(y, x)`` with attributes *attr*, overwriting any " "character previously painted at that location. By default, the character " "position and attributes are the current settings for the window object." msgstr "" -#: library/curses.rst:717 +#: library/curses.rst:719 msgid "" "Writing outside the window, subwindow, or pad raises a :exc:`curses.error`. " "Attempting to write to the lower right corner of a window, subwindow, or pad " "will cause an exception to be raised after the character is printed." msgstr "" -#: library/curses.rst:725 +#: library/curses.rst:727 msgid "" "Paint at most *n* characters of the character string *str* at ``(y, x)`` " "with attributes *attr*, overwriting anything previously on the display." msgstr "" -#: library/curses.rst:733 +#: library/curses.rst:735 msgid "" "Paint the character string *str* at ``(y, x)`` with attributes *attr*, " "overwriting anything previously on the display." msgstr "" -#: library/curses.rst:738 +#: library/curses.rst:740 msgid "" "Writing outside the window, subwindow, or pad raises :exc:`curses.error`. " "Attempting to write to the lower right corner of a window, subwindow, or pad " "will cause an exception to be raised after the string is printed." msgstr "" -#: library/curses.rst:742 +#: library/curses.rst:744 msgid "" "A `bug in ncurses `_, the backend for " "this Python module, can cause SegFaults when resizing windows. This is fixed " @@ -814,44 +824,44 @@ msgid "" "line." msgstr "" -#: library/curses.rst:752 +#: library/curses.rst:754 msgid "" "Remove attribute *attr* from the \"background\" set applied to all writes to " "the current window." msgstr "" -#: library/curses.rst:758 +#: library/curses.rst:760 msgid "" "Add attribute *attr* from the \"background\" set applied to all writes to " "the current window." msgstr "" -#: library/curses.rst:764 +#: library/curses.rst:766 msgid "" "Set the \"background\" set of attributes to *attr*. This set is initially " "``0`` (no attributes)." msgstr "" -#: library/curses.rst:770 +#: library/curses.rst:772 msgid "" "Set the background property of the window to the character *ch*, with " "attributes *attr*. The change is then applied to every character position " "in that window:" msgstr "" -#: library/curses.rst:774 +#: library/curses.rst:776 msgid "" "The attribute of every character in the window is changed to the new " "background attribute." msgstr "" -#: library/curses.rst:777 +#: library/curses.rst:779 msgid "" "Wherever the former background character appears, it is changed to the new " "background character." msgstr "" -#: library/curses.rst:783 +#: library/curses.rst:785 msgid "" "Set the window's background. A window's background consists of a character " "and any combination of attributes. The attribute part of the background is " @@ -862,128 +872,128 @@ msgid "" "delete line/character operations." msgstr "" -#: library/curses.rst:793 +#: library/curses.rst:795 msgid "" "Draw a border around the edges of the window. Each parameter specifies the " "character to use for a specific part of the border; see the table below for " "more details." msgstr "" -#: library/curses.rst:799 +#: library/curses.rst:801 msgid "" "A ``0`` value for any parameter will cause the default character to be used " "for that parameter. Keyword parameters can *not* be used. The defaults are " "listed in this table:" msgstr "" -#: library/curses.rst:804 +#: library/curses.rst:806 msgid "Parameter" msgstr "" -#: library/curses.rst:804 +#: library/curses.rst:806 msgid "Description" msgstr "" -#: library/curses.rst:804 +#: library/curses.rst:806 msgid "Default value" msgstr "" -#: library/curses.rst:806 +#: library/curses.rst:808 msgid "*ls*" msgstr "" -#: library/curses.rst:806 +#: library/curses.rst:808 msgid "Left side" msgstr "" -#: library/curses.rst:808 +#: library/curses.rst:810 msgid ":const:`ACS_VLINE`" msgstr "" -#: library/curses.rst:808 +#: library/curses.rst:810 msgid "*rs*" msgstr "" -#: library/curses.rst:808 +#: library/curses.rst:810 msgid "Right side" msgstr "" -#: library/curses.rst:810 +#: library/curses.rst:812 msgid "*ts*" msgstr "" -#: library/curses.rst:810 +#: library/curses.rst:812 msgid "Top" msgstr "" -#: library/curses.rst:812 +#: library/curses.rst:814 msgid ":const:`ACS_HLINE`" msgstr "" -#: library/curses.rst:812 +#: library/curses.rst:814 msgid "*bs*" msgstr "" -#: library/curses.rst:812 +#: library/curses.rst:814 msgid "Bottom" msgstr "" -#: library/curses.rst:814 +#: library/curses.rst:816 msgid "*tl*" msgstr "" -#: library/curses.rst:814 +#: library/curses.rst:816 msgid "Upper-left corner" msgstr "" -#: library/curses.rst:814 +#: library/curses.rst:816 msgid ":const:`ACS_ULCORNER`" msgstr "" -#: library/curses.rst:816 +#: library/curses.rst:818 msgid "*tr*" msgstr "" -#: library/curses.rst:816 +#: library/curses.rst:818 msgid "Upper-right corner" msgstr "" -#: library/curses.rst:816 +#: library/curses.rst:818 msgid ":const:`ACS_URCORNER`" msgstr "" -#: library/curses.rst:818 +#: library/curses.rst:820 msgid "*bl*" msgstr "" -#: library/curses.rst:818 +#: library/curses.rst:820 msgid "Bottom-left corner" msgstr "" -#: library/curses.rst:818 +#: library/curses.rst:820 msgid ":const:`ACS_LLCORNER`" msgstr "" -#: library/curses.rst:820 +#: library/curses.rst:822 msgid "*br*" msgstr "" -#: library/curses.rst:820 +#: library/curses.rst:822 msgid "Bottom-right corner" msgstr "" -#: library/curses.rst:820 +#: library/curses.rst:822 msgid ":const:`ACS_LRCORNER`" msgstr "" -#: library/curses.rst:826 +#: library/curses.rst:828 msgid "" "Similar to :meth:`border`, but both *ls* and *rs* are *vertch* and both *ts* " "and *bs* are *horch*. The default corner characters are always used by this " "function." msgstr "" -#: library/curses.rst:835 +#: library/curses.rst:837 msgid "" "Set the attributes of *num* characters at the current cursor position, or at " "position ``(y, x)`` if supplied. If *num* is not given or is ``-1``, the " @@ -993,45 +1003,45 @@ msgid "" "be redisplayed by the next window refresh." msgstr "" -#: library/curses.rst:845 +#: library/curses.rst:847 msgid "" "Like :meth:`erase`, but also cause the whole window to be repainted upon " "next call to :meth:`refresh`." msgstr "" -#: library/curses.rst:851 +#: library/curses.rst:853 msgid "" "If *flag* is ``True``, the next call to :meth:`refresh` will clear the " "window completely." msgstr "" -#: library/curses.rst:857 +#: library/curses.rst:859 msgid "" "Erase from cursor to the end of the window: all lines below the cursor are " "deleted, and then the equivalent of :meth:`clrtoeol` is performed." msgstr "" -#: library/curses.rst:863 +#: library/curses.rst:865 msgid "Erase from cursor to the end of the line." msgstr "" -#: library/curses.rst:868 +#: library/curses.rst:870 msgid "" "Update the current cursor position of all the ancestors of the window to " "reflect the current cursor position of the window." msgstr "" -#: library/curses.rst:874 +#: library/curses.rst:876 msgid "Delete any character at ``(y, x)``." msgstr "" -#: library/curses.rst:879 +#: library/curses.rst:881 msgid "" "Delete the line under the cursor. All following lines are moved up by one " "line." msgstr "" -#: library/curses.rst:885 +#: library/curses.rst:887 msgid "" "An abbreviation for \"derive window\", :meth:`derwin` is the same as " "calling :meth:`subwin`, except that *begin_y* and *begin_x* are relative to " @@ -1039,13 +1049,13 @@ msgid "" "a window object for the derived window." msgstr "" -#: library/curses.rst:893 +#: library/curses.rst:895 msgid "" "Add character *ch* with attribute *attr*, and immediately call :meth:" "`refresh` on the window." msgstr "" -#: library/curses.rst:899 +#: library/curses.rst:901 msgid "" "Test whether the given pair of screen-relative character-cell coordinates " "are enclosed by the given window, returning ``True`` or ``False``. It is " @@ -1053,11 +1063,11 @@ msgid "" "location of a mouse event." msgstr "" -#: library/curses.rst:904 +#: library/curses.rst:906 msgid "Previously it returned ``1`` or ``0`` instead of ``True`` or ``False``." msgstr "" -#: library/curses.rst:910 +#: library/curses.rst:912 msgid "" "Encoding used to encode method arguments (Unicode strings and characters). " "The encoding attribute is inherited from the parent window when a subwindow " @@ -1065,19 +1075,19 @@ msgid "" "locale encoding is used (see :func:`locale.getencoding`)." msgstr "" -#: library/curses.rst:920 +#: library/curses.rst:922 msgid "Clear the window." msgstr "" -#: library/curses.rst:925 +#: library/curses.rst:927 msgid "Return a tuple ``(y, x)`` of coordinates of upper-left corner." msgstr "" -#: library/curses.rst:930 +#: library/curses.rst:932 msgid "Return the given window's current background character/attribute pair." msgstr "" -#: library/curses.rst:935 +#: library/curses.rst:937 msgid "" "Get a character. Note that the integer returned does *not* have to be in " "ASCII range: function keys, keypad keys and so on are represented by numbers " @@ -1085,14 +1095,14 @@ msgid "" "otherwise wait until a key is pressed." msgstr "" -#: library/curses.rst:943 +#: library/curses.rst:945 msgid "" "Get a wide character. Return a character for most keys, or an integer for " "function keys, keypad keys, and other special keys. In no-delay mode, raise " "an exception if there is no input." msgstr "" -#: library/curses.rst:952 +#: library/curses.rst:954 msgid "" "Get a character, returning a string instead of an integer, as :meth:`getch` " "does. Function keys, keypad keys and other special keys return a multibyte " @@ -1100,35 +1110,35 @@ msgid "" "there is no input." msgstr "" -#: library/curses.rst:960 +#: library/curses.rst:962 msgid "Return a tuple ``(y, x)`` of the height and width of the window." msgstr "" -#: library/curses.rst:965 +#: library/curses.rst:967 msgid "" "Return the beginning coordinates of this window relative to its parent " "window as a tuple ``(y, x)``. Return ``(-1, -1)`` if this window has no " "parent." msgstr "" -#: library/curses.rst:975 +#: library/curses.rst:977 msgid "" "Read a bytes object from the user, with primitive line editing capacity." msgstr "" -#: library/curses.rst:980 +#: library/curses.rst:982 msgid "" "Return a tuple ``(y, x)`` of current cursor position relative to the " "window's upper-left corner." msgstr "" -#: library/curses.rst:987 +#: library/curses.rst:989 msgid "" "Display a horizontal line starting at ``(y, x)`` with length *n* consisting " "of the character *ch*." msgstr "" -#: library/curses.rst:993 +#: library/curses.rst:995 msgid "" "If *flag* is ``False``, curses no longer considers using the hardware insert/" "delete character feature of the terminal; if *flag* is ``True``, use of " @@ -1136,13 +1146,13 @@ msgid "" "initialized, use of character insert/delete is enabled by default." msgstr "" -#: library/curses.rst:1001 +#: library/curses.rst:1003 msgid "" "If *flag* is ``True``, :mod:`curses` will try and use hardware line editing " "facilities. Otherwise, line insertion/deletion are disabled." msgstr "" -#: library/curses.rst:1007 +#: library/curses.rst:1009 msgid "" "If *flag* is ``True``, any change in the window image automatically causes " "the window to be refreshed; you no longer have to call :meth:`refresh` " @@ -1150,19 +1160,19 @@ msgid "" "calls to wrefresh. This option is disabled by default." msgstr "" -#: library/curses.rst:1015 +#: library/curses.rst:1017 msgid "" "Return the character at the given position in the window. The bottom 8 bits " "are the character proper, and upper bits are the attributes." msgstr "" -#: library/curses.rst:1022 +#: library/curses.rst:1024 msgid "" "Paint character *ch* at ``(y, x)`` with attributes *attr*, moving the line " "from position *x* right by one character." msgstr "" -#: library/curses.rst:1028 +#: library/curses.rst:1030 msgid "" "Insert *nlines* lines into the specified window above the current line. The " "*nlines* bottom lines are lost. For negative *nlines*, delete *nlines* " @@ -1171,13 +1181,13 @@ msgid "" "remains the same." msgstr "" -#: library/curses.rst:1037 +#: library/curses.rst:1039 msgid "" "Insert a blank line under the cursor. All following lines are moved down by " "one line." msgstr "" -#: library/curses.rst:1044 +#: library/curses.rst:1046 msgid "" "Insert a character string (as many characters as will fit on the line) " "before the character under the cursor, up to *n* characters. If *n* is " @@ -1187,7 +1197,7 @@ msgid "" "if specified)." msgstr "" -#: library/curses.rst:1054 +#: library/curses.rst:1056 msgid "" "Insert a character string (as many characters as will fit on the line) " "before the character under the cursor. All characters to the right of the " @@ -1196,7 +1206,7 @@ msgid "" "specified)." msgstr "" -#: library/curses.rst:1063 +#: library/curses.rst:1065 msgid "" "Return a bytes object of characters, extracted from the window starting at " "the current cursor position, or at *y*, *x* if specified. Attributes are " @@ -1204,76 +1214,76 @@ msgid "" "string at most *n* characters long (exclusive of the trailing NUL)." msgstr "" -#: library/curses.rst:1071 +#: library/curses.rst:1073 msgid "" "Return ``True`` if the specified line was modified since the last call to :" "meth:`refresh`; otherwise return ``False``. Raise a :exc:`curses.error` " "exception if *line* is not valid for the given window." msgstr "" -#: library/curses.rst:1078 +#: library/curses.rst:1080 msgid "" "Return ``True`` if the specified window was modified since the last call to :" "meth:`refresh`; otherwise return ``False``." msgstr "" -#: library/curses.rst:1084 +#: library/curses.rst:1086 msgid "" "If *flag* is ``True``, escape sequences generated by some keys (keypad, " "function keys) will be interpreted by :mod:`curses`. If *flag* is ``False``, " "escape sequences will be left as is in the input stream." msgstr "" -#: library/curses.rst:1091 +#: library/curses.rst:1093 msgid "" "If *flag* is ``True``, cursor is left where it is on update, instead of " "being at \"cursor position.\" This reduces cursor movement where possible. " "If possible the cursor will be made invisible." msgstr "" -#: library/curses.rst:1095 +#: library/curses.rst:1097 msgid "" "If *flag* is ``False``, cursor will always be at \"cursor position\" after " "an update." msgstr "" -#: library/curses.rst:1100 +#: library/curses.rst:1102 msgid "Move cursor to ``(new_y, new_x)``." msgstr "" -#: library/curses.rst:1105 +#: library/curses.rst:1107 msgid "" "Move the window inside its parent window. The screen-relative parameters of " "the window are not changed. This routine is used to display different parts " "of the parent window at the same physical position on the screen." msgstr "" -#: library/curses.rst:1112 +#: library/curses.rst:1114 msgid "Move the window so its upper-left corner is at ``(new_y, new_x)``." msgstr "" -#: library/curses.rst:1117 +#: library/curses.rst:1119 msgid "If *flag* is ``True``, :meth:`getch` will be non-blocking." msgstr "" -#: library/curses.rst:1122 +#: library/curses.rst:1124 msgid "If *flag* is ``True``, escape sequences will not be timed out." msgstr "" -#: library/curses.rst:1124 +#: library/curses.rst:1126 msgid "" "If *flag* is ``False``, after a few milliseconds, an escape sequence will " "not be interpreted, and will be left in the input stream as is." msgstr "" -#: library/curses.rst:1130 +#: library/curses.rst:1132 msgid "" "Mark for refresh but wait. This function updates the data structure " "representing the desired state of the window, but does not force an update " "of the physical screen. To accomplish that, call :func:`doupdate`." msgstr "" -#: library/curses.rst:1137 +#: library/curses.rst:1139 msgid "" "Overlay the window on top of *destwin*. The windows need not be the same " "size, only the overlapping region is copied. This copy is non-destructive, " @@ -1281,7 +1291,7 @@ msgid "" "contents of *destwin*." msgstr "" -#: library/curses.rst:1142 +#: library/curses.rst:1144 msgid "" "To get fine-grained control over the copied region, the second form of :meth:" "`overlay` can be used. *sminrow* and *smincol* are the upper-left " @@ -1289,7 +1299,7 @@ msgid "" "in the destination window." msgstr "" -#: library/curses.rst:1150 +#: library/curses.rst:1152 msgid "" "Overwrite the window on top of *destwin*. The windows need not be the same " "size, in which case only the overlapping region is copied. This copy is " @@ -1297,7 +1307,7 @@ msgid "" "the old contents of *destwin*." msgstr "" -#: library/curses.rst:1155 +#: library/curses.rst:1157 msgid "" "To get fine-grained control over the copied region, the second form of :meth:" "`overwrite` can be used. *sminrow* and *smincol* are the upper-left " @@ -1305,31 +1315,31 @@ msgid "" "the destination window." msgstr "" -#: library/curses.rst:1163 +#: library/curses.rst:1165 msgid "" "Write all data associated with the window into the provided file object. " "This information can be later retrieved using the :func:`getwin` function." msgstr "" -#: library/curses.rst:1169 +#: library/curses.rst:1171 msgid "" "Indicate that the *num* screen lines, starting at line *beg*, are corrupted " "and should be completely redrawn on the next :meth:`refresh` call." msgstr "" -#: library/curses.rst:1175 +#: library/curses.rst:1177 msgid "" "Touch the entire window, causing it to be completely redrawn on the next :" "meth:`refresh` call." msgstr "" -#: library/curses.rst:1181 +#: library/curses.rst:1183 msgid "" "Update the display immediately (sync actual screen with previous drawing/" "deleting methods)." msgstr "" -#: library/curses.rst:1184 +#: library/curses.rst:1186 msgid "" "The 6 optional arguments can only be specified when the window is a pad " "created with :func:`newpad`. The additional parameters are needed to " @@ -1344,7 +1354,7 @@ msgid "" "*smincol* are treated as if they were zero." msgstr "" -#: library/curses.rst:1198 +#: library/curses.rst:1200 msgid "" "Reallocate storage for a curses window to adjust its dimensions to the " "specified values. If either dimension is larger than the current values, " @@ -1352,11 +1362,11 @@ msgid "" "rendition (as set by :meth:`bkgdset`) merged into them." msgstr "" -#: library/curses.rst:1206 +#: library/curses.rst:1208 msgid "Scroll the screen or scrolling region upward by *lines* lines." msgstr "" -#: library/curses.rst:1211 +#: library/curses.rst:1213 msgid "" "Control what happens when the cursor of a window is moved off the edge of " "the window or scrolling region, either as a result of a newline action on " @@ -1366,54 +1376,54 @@ msgid "" "scrolling effect on the terminal, it is also necessary to call :meth:`idlok`." msgstr "" -#: library/curses.rst:1221 +#: library/curses.rst:1223 msgid "" "Set the scrolling region from line *top* to line *bottom*. All scrolling " "actions will take place in this region." msgstr "" -#: library/curses.rst:1227 +#: library/curses.rst:1229 msgid "" "Turn off the standout attribute. On some terminals this has the side effect " "of turning off all attributes." msgstr "" -#: library/curses.rst:1233 +#: library/curses.rst:1235 msgid "Turn on attribute *A_STANDOUT*." msgstr "" -#: library/curses.rst:1246 +#: library/curses.rst:1248 msgid "" "Return a sub-window, whose upper-left corner is at ``(begin_y, begin_x)``, " "and whose width/height is *ncols*/*nlines*." msgstr "" -#: library/curses.rst:1249 +#: library/curses.rst:1251 msgid "" "By default, the sub-window will extend from the specified position to the " "lower right corner of the window." msgstr "" -#: library/curses.rst:1255 +#: library/curses.rst:1257 msgid "" "Touch each location in the window that has been touched in any of its " "ancestor windows. This routine is called by :meth:`refresh`, so it should " "almost never be necessary to call it manually." msgstr "" -#: library/curses.rst:1262 +#: library/curses.rst:1264 msgid "" "If *flag* is ``True``, then :meth:`syncup` is called automatically whenever " "there is a change in the window." msgstr "" -#: library/curses.rst:1268 +#: library/curses.rst:1270 msgid "" "Touch all locations in ancestors of the window that have been changed in " "the window." msgstr "" -#: library/curses.rst:1274 +#: library/curses.rst:1276 msgid "" "Set blocking or non-blocking read behavior for the window. If *delay* is " "negative, blocking read is used (which will wait indefinitely for input). " @@ -1423,7 +1433,7 @@ msgid "" "still no input at the end of that time." msgstr "" -#: library/curses.rst:1284 +#: library/curses.rst:1286 msgid "" "Pretend *count* lines have been changed, starting with line *start*. If " "*changed* is supplied, it specifies whether the affected lines are marked as " @@ -1431,49 +1441,49 @@ msgid "" "``=False``)." msgstr "" -#: library/curses.rst:1291 +#: library/curses.rst:1293 msgid "" "Pretend the whole window has been changed, for purposes of drawing " "optimizations." msgstr "" -#: library/curses.rst:1297 +#: library/curses.rst:1299 msgid "" "Mark all lines in the window as unchanged since the last call to :meth:" "`refresh`." msgstr "" -#: library/curses.rst:1304 +#: library/curses.rst:1306 msgid "" "Display a vertical line starting at ``(y, x)`` with length *n* consisting of " "the character *ch* with attributes *attr*." msgstr "" -#: library/curses.rst:1309 +#: library/curses.rst:1311 msgid "Constants" msgstr "" -#: library/curses.rst:1311 +#: library/curses.rst:1313 msgid "The :mod:`curses` module defines the following data members:" msgstr "" -#: library/curses.rst:1316 +#: library/curses.rst:1318 msgid "" "Some curses routines that return an integer, such as :meth:`~window." "getch`, return :const:`ERR` upon failure." msgstr "" -#: library/curses.rst:1322 +#: library/curses.rst:1324 msgid "" "Some curses routines that return an integer, such as :func:`napms`, " "return :const:`OK` upon success." msgstr "" -#: library/curses.rst:1329 +#: library/curses.rst:1331 msgid "A bytes object representing the current version of the module." msgstr "" -#: library/curses.rst:1334 +#: library/curses.rst:1336 msgid "" "A named tuple containing the three components of the ncurses library " "version: *major*, *minor*, and *patch*. All values are integers. The " @@ -1481,535 +1491,535 @@ msgid "" "is equivalent to ``curses.ncurses_version.major`` and so on." msgstr "" -#: library/curses.rst:1339 +#: library/curses.rst:1341 msgid "Availability: if the ncurses library is used." msgstr "" -#: library/curses.rst:1345 +#: library/curses.rst:1347 msgid "" "The maximum number of colors the terminal can support. It is defined only " "after the call to :func:`start_color`." msgstr "" -#: library/curses.rst:1350 +#: library/curses.rst:1352 msgid "" "The maximum number of color pairs the terminal can support. It is defined " "only after the call to :func:`start_color`." msgstr "" -#: library/curses.rst:1355 +#: library/curses.rst:1357 msgid "" "The width of the screen, i.e., the number of columns. It is defined only " "after the call to :func:`initscr`. Updated by :func:`update_lines_cols`, :" "func:`resizeterm` and :func:`resize_term`." msgstr "" -#: library/curses.rst:1362 +#: library/curses.rst:1364 msgid "" "The height of the screen, i.e., the number of lines. It is defined only " "after the call to :func:`initscr`. Updated by :func:`update_lines_cols`, :" "func:`resizeterm` and :func:`resize_term`." msgstr "" -#: library/curses.rst:1368 +#: library/curses.rst:1370 msgid "" "Some constants are available to specify character cell attributes. The exact " "constants available are system dependent." msgstr "" -#: library/curses.rst:1372 +#: library/curses.rst:1374 msgid "Attribute" msgstr "" -#: library/curses.rst:1417 library/curses.rst:1755 +#: library/curses.rst:1419 library/curses.rst:1757 msgid "Meaning" msgstr "" -#: library/curses.rst:1374 +#: library/curses.rst:1376 msgid "Alternate character set mode" msgstr "" -#: library/curses.rst:1376 +#: library/curses.rst:1378 msgid "Blink mode" msgstr "" -#: library/curses.rst:1378 +#: library/curses.rst:1380 msgid "Bold mode" msgstr "" -#: library/curses.rst:1380 +#: library/curses.rst:1382 msgid "Dim mode" msgstr "" -#: library/curses.rst:1382 +#: library/curses.rst:1384 msgid "Invisible or blank mode" msgstr "" -#: library/curses.rst:1384 +#: library/curses.rst:1386 msgid "Italic mode" msgstr "" -#: library/curses.rst:1386 +#: library/curses.rst:1388 msgid "Normal attribute" msgstr "" -#: library/curses.rst:1388 +#: library/curses.rst:1390 msgid "Protected mode" msgstr "" -#: library/curses.rst:1390 +#: library/curses.rst:1392 msgid "Reverse background and foreground colors" msgstr "" -#: library/curses.rst:1393 +#: library/curses.rst:1395 msgid "Standout mode" msgstr "" -#: library/curses.rst:1395 +#: library/curses.rst:1397 msgid "Underline mode" msgstr "" -#: library/curses.rst:1397 +#: library/curses.rst:1399 msgid "Horizontal highlight" msgstr "" -#: library/curses.rst:1399 +#: library/curses.rst:1401 msgid "Left highlight" msgstr "" -#: library/curses.rst:1401 +#: library/curses.rst:1403 msgid "Low highlight" msgstr "" -#: library/curses.rst:1403 +#: library/curses.rst:1405 msgid "Right highlight" msgstr "" -#: library/curses.rst:1405 +#: library/curses.rst:1407 msgid "Top highlight" msgstr "" -#: library/curses.rst:1407 +#: library/curses.rst:1409 msgid "Vertical highlight" msgstr "" -#: library/curses.rst:1410 +#: library/curses.rst:1412 msgid "``A_ITALIC`` was added." msgstr "" -#: library/curses.rst:1413 +#: library/curses.rst:1415 msgid "" "Several constants are available to extract corresponding attributes returned " "by some methods." msgstr "" -#: library/curses.rst:1417 +#: library/curses.rst:1419 msgid "Bit-mask" msgstr "" -#: library/curses.rst:1419 +#: library/curses.rst:1421 msgid "Bit-mask to extract attributes" msgstr "" -#: library/curses.rst:1422 +#: library/curses.rst:1424 msgid "Bit-mask to extract a character" msgstr "" -#: library/curses.rst:1425 +#: library/curses.rst:1427 msgid "Bit-mask to extract color-pair field information" msgstr "" -#: library/curses.rst:1429 +#: library/curses.rst:1431 msgid "" "Keys are referred to by integer constants with names starting with " "``KEY_``. The exact keycaps available are system dependent." msgstr "" -#: library/curses.rst:1435 +#: library/curses.rst:1437 msgid "Key constant" msgstr "" -#: library/curses.rst:1435 +#: library/curses.rst:1437 msgid "Key" msgstr "" -#: library/curses.rst:1437 +#: library/curses.rst:1439 msgid "Minimum key value" msgstr "" -#: library/curses.rst:1439 +#: library/curses.rst:1441 msgid "Break key (unreliable)" msgstr "" -#: library/curses.rst:1441 +#: library/curses.rst:1443 msgid "Down-arrow" msgstr "" -#: library/curses.rst:1443 +#: library/curses.rst:1445 msgid "Up-arrow" msgstr "" -#: library/curses.rst:1445 +#: library/curses.rst:1447 msgid "Left-arrow" msgstr "" -#: library/curses.rst:1447 +#: library/curses.rst:1449 msgid "Right-arrow" msgstr "" -#: library/curses.rst:1449 +#: library/curses.rst:1451 msgid "Home key (upward+left arrow)" msgstr "" -#: library/curses.rst:1451 +#: library/curses.rst:1453 msgid "Backspace (unreliable)" msgstr "" -#: library/curses.rst:1453 +#: library/curses.rst:1455 msgid "Function keys. Up to 64 function keys are supported." msgstr "" -#: library/curses.rst:1456 +#: library/curses.rst:1458 msgid "Value of function key *n*" msgstr "" -#: library/curses.rst:1458 +#: library/curses.rst:1460 msgid "Delete line" msgstr "" -#: library/curses.rst:1460 +#: library/curses.rst:1462 msgid "Insert line" msgstr "" -#: library/curses.rst:1462 +#: library/curses.rst:1464 msgid "Delete character" msgstr "" -#: library/curses.rst:1464 +#: library/curses.rst:1466 msgid "Insert char or enter insert mode" msgstr "" -#: library/curses.rst:1466 +#: library/curses.rst:1468 msgid "Exit insert char mode" msgstr "" -#: library/curses.rst:1468 +#: library/curses.rst:1470 msgid "Clear screen" msgstr "" -#: library/curses.rst:1470 +#: library/curses.rst:1472 msgid "Clear to end of screen" msgstr "" -#: library/curses.rst:1472 +#: library/curses.rst:1474 msgid "Clear to end of line" msgstr "" -#: library/curses.rst:1474 +#: library/curses.rst:1476 msgid "Scroll 1 line forward" msgstr "" -#: library/curses.rst:1476 +#: library/curses.rst:1478 msgid "Scroll 1 line backward (reverse)" msgstr "" -#: library/curses.rst:1478 +#: library/curses.rst:1480 msgid "Next page" msgstr "" -#: library/curses.rst:1480 +#: library/curses.rst:1482 msgid "Previous page" msgstr "" -#: library/curses.rst:1482 +#: library/curses.rst:1484 msgid "Set tab" msgstr "" -#: library/curses.rst:1484 +#: library/curses.rst:1486 msgid "Clear tab" msgstr "" -#: library/curses.rst:1486 +#: library/curses.rst:1488 msgid "Clear all tabs" msgstr "" -#: library/curses.rst:1488 +#: library/curses.rst:1490 msgid "Enter or send (unreliable)" msgstr "" -#: library/curses.rst:1490 +#: library/curses.rst:1492 msgid "Soft (partial) reset (unreliable)" msgstr "" -#: library/curses.rst:1492 +#: library/curses.rst:1494 msgid "Reset or hard reset (unreliable)" msgstr "" -#: library/curses.rst:1494 +#: library/curses.rst:1496 msgid "Print" msgstr "" -#: library/curses.rst:1496 +#: library/curses.rst:1498 msgid "Home down or bottom (lower left)" msgstr "" -#: library/curses.rst:1498 +#: library/curses.rst:1500 msgid "Upper left of keypad" msgstr "" -#: library/curses.rst:1500 +#: library/curses.rst:1502 msgid "Upper right of keypad" msgstr "" -#: library/curses.rst:1502 +#: library/curses.rst:1504 msgid "Center of keypad" msgstr "" -#: library/curses.rst:1504 +#: library/curses.rst:1506 msgid "Lower left of keypad" msgstr "" -#: library/curses.rst:1506 +#: library/curses.rst:1508 msgid "Lower right of keypad" msgstr "" -#: library/curses.rst:1508 +#: library/curses.rst:1510 msgid "Back tab" msgstr "" -#: library/curses.rst:1510 +#: library/curses.rst:1512 msgid "Beg (beginning)" msgstr "" -#: library/curses.rst:1512 +#: library/curses.rst:1514 msgid "Cancel" msgstr "" -#: library/curses.rst:1514 +#: library/curses.rst:1516 msgid "Close" msgstr "" -#: library/curses.rst:1516 +#: library/curses.rst:1518 msgid "Cmd (command)" msgstr "" -#: library/curses.rst:1518 +#: library/curses.rst:1520 msgid "Copy" msgstr "" -#: library/curses.rst:1520 +#: library/curses.rst:1522 msgid "Create" msgstr "" -#: library/curses.rst:1522 +#: library/curses.rst:1524 msgid "End" msgstr "" -#: library/curses.rst:1524 +#: library/curses.rst:1526 msgid "Exit" msgstr "" -#: library/curses.rst:1526 +#: library/curses.rst:1528 msgid "Find" msgstr "" -#: library/curses.rst:1528 +#: library/curses.rst:1530 msgid "Help" msgstr "" -#: library/curses.rst:1530 +#: library/curses.rst:1532 msgid "Mark" msgstr "" -#: library/curses.rst:1532 +#: library/curses.rst:1534 msgid "Message" msgstr "" -#: library/curses.rst:1534 +#: library/curses.rst:1536 msgid "Move" msgstr "" -#: library/curses.rst:1536 +#: library/curses.rst:1538 msgid "Next" msgstr "" -#: library/curses.rst:1538 +#: library/curses.rst:1540 msgid "Open" msgstr "" -#: library/curses.rst:1540 +#: library/curses.rst:1542 msgid "Options" msgstr "" -#: library/curses.rst:1542 +#: library/curses.rst:1544 msgid "Prev (previous)" msgstr "" -#: library/curses.rst:1544 +#: library/curses.rst:1546 msgid "Redo" msgstr "" -#: library/curses.rst:1546 +#: library/curses.rst:1548 msgid "Ref (reference)" msgstr "" -#: library/curses.rst:1548 +#: library/curses.rst:1550 msgid "Refresh" msgstr "" -#: library/curses.rst:1550 +#: library/curses.rst:1552 msgid "Replace" msgstr "" -#: library/curses.rst:1552 +#: library/curses.rst:1554 msgid "Restart" msgstr "" -#: library/curses.rst:1554 +#: library/curses.rst:1556 msgid "Resume" msgstr "" -#: library/curses.rst:1556 +#: library/curses.rst:1558 msgid "Save" msgstr "" -#: library/curses.rst:1558 +#: library/curses.rst:1560 msgid "Shifted Beg (beginning)" msgstr "" -#: library/curses.rst:1560 +#: library/curses.rst:1562 msgid "Shifted Cancel" msgstr "" -#: library/curses.rst:1562 +#: library/curses.rst:1564 msgid "Shifted Command" msgstr "" -#: library/curses.rst:1564 +#: library/curses.rst:1566 msgid "Shifted Copy" msgstr "" -#: library/curses.rst:1566 +#: library/curses.rst:1568 msgid "Shifted Create" msgstr "" -#: library/curses.rst:1568 +#: library/curses.rst:1570 msgid "Shifted Delete char" msgstr "" -#: library/curses.rst:1570 +#: library/curses.rst:1572 msgid "Shifted Delete line" msgstr "" -#: library/curses.rst:1572 +#: library/curses.rst:1574 msgid "Select" msgstr "" -#: library/curses.rst:1574 +#: library/curses.rst:1576 msgid "Shifted End" msgstr "" -#: library/curses.rst:1576 +#: library/curses.rst:1578 msgid "Shifted Clear line" msgstr "" -#: library/curses.rst:1578 +#: library/curses.rst:1580 msgid "Shifted Exit" msgstr "" -#: library/curses.rst:1580 +#: library/curses.rst:1582 msgid "Shifted Find" msgstr "" -#: library/curses.rst:1582 +#: library/curses.rst:1584 msgid "Shifted Help" msgstr "" -#: library/curses.rst:1584 +#: library/curses.rst:1586 msgid "Shifted Home" msgstr "" -#: library/curses.rst:1586 +#: library/curses.rst:1588 msgid "Shifted Input" msgstr "" -#: library/curses.rst:1588 +#: library/curses.rst:1590 msgid "Shifted Left arrow" msgstr "" -#: library/curses.rst:1590 +#: library/curses.rst:1592 msgid "Shifted Message" msgstr "" -#: library/curses.rst:1592 +#: library/curses.rst:1594 msgid "Shifted Move" msgstr "" -#: library/curses.rst:1594 +#: library/curses.rst:1596 msgid "Shifted Next" msgstr "" -#: library/curses.rst:1596 +#: library/curses.rst:1598 msgid "Shifted Options" msgstr "" -#: library/curses.rst:1598 +#: library/curses.rst:1600 msgid "Shifted Prev" msgstr "" -#: library/curses.rst:1600 +#: library/curses.rst:1602 msgid "Shifted Print" msgstr "" -#: library/curses.rst:1602 +#: library/curses.rst:1604 msgid "Shifted Redo" msgstr "" -#: library/curses.rst:1604 +#: library/curses.rst:1606 msgid "Shifted Replace" msgstr "" -#: library/curses.rst:1606 +#: library/curses.rst:1608 msgid "Shifted Right arrow" msgstr "" -#: library/curses.rst:1608 +#: library/curses.rst:1610 msgid "Shifted Resume" msgstr "" -#: library/curses.rst:1610 +#: library/curses.rst:1612 msgid "Shifted Save" msgstr "" -#: library/curses.rst:1612 +#: library/curses.rst:1614 msgid "Shifted Suspend" msgstr "" -#: library/curses.rst:1614 +#: library/curses.rst:1616 msgid "Shifted Undo" msgstr "" -#: library/curses.rst:1616 +#: library/curses.rst:1618 msgid "Suspend" msgstr "" -#: library/curses.rst:1618 +#: library/curses.rst:1620 msgid "Undo" msgstr "" -#: library/curses.rst:1620 +#: library/curses.rst:1622 msgid "Mouse event has occurred" msgstr "" -#: library/curses.rst:1622 +#: library/curses.rst:1624 msgid "Terminal resize event" msgstr "" -#: library/curses.rst:1624 +#: library/curses.rst:1626 msgid "Maximum key value" msgstr "" -#: library/curses.rst:1627 +#: library/curses.rst:1629 msgid "" "On VT100s and their software emulations, such as X terminal emulators, there " "are normally at least four function keys (:const:`KEY_F1 `, :const:" @@ -2021,63 +2031,63 @@ msgid "" "keypad mappings are standard:" msgstr "" -#: library/curses.rst:1636 +#: library/curses.rst:1638 msgid "Keycap" msgstr "" -#: library/curses.rst:1781 library/curses.rst:1905 +#: library/curses.rst:1783 library/curses.rst:1907 msgid "Constant" msgstr "" -#: library/curses.rst:1638 +#: library/curses.rst:1640 msgid ":kbd:`Insert`" msgstr "" -#: library/curses.rst:1638 +#: library/curses.rst:1640 msgid "KEY_IC" msgstr "" -#: library/curses.rst:1640 +#: library/curses.rst:1642 msgid ":kbd:`Delete`" msgstr "" -#: library/curses.rst:1640 +#: library/curses.rst:1642 msgid "KEY_DC" msgstr "" -#: library/curses.rst:1642 +#: library/curses.rst:1644 msgid ":kbd:`Home`" msgstr "" -#: library/curses.rst:1642 +#: library/curses.rst:1644 msgid "KEY_HOME" msgstr "" -#: library/curses.rst:1644 +#: library/curses.rst:1646 msgid ":kbd:`End`" msgstr "" -#: library/curses.rst:1644 +#: library/curses.rst:1646 msgid "KEY_END" msgstr "" -#: library/curses.rst:1646 +#: library/curses.rst:1648 msgid ":kbd:`Page Up`" msgstr "" -#: library/curses.rst:1646 +#: library/curses.rst:1648 msgid "KEY_PPAGE" msgstr "" -#: library/curses.rst:1648 +#: library/curses.rst:1650 msgid ":kbd:`Page Down`" msgstr "" -#: library/curses.rst:1648 +#: library/curses.rst:1650 msgid "KEY_NPAGE" msgstr "" -#: library/curses.rst:1653 +#: library/curses.rst:1655 msgid "" "The following table lists characters from the alternate character set. These " "are inherited from the VT100 terminal, and will generally be available on " @@ -2085,268 +2095,268 @@ msgid "" "available, curses falls back on a crude printable ASCII approximation." msgstr "" -#: library/curses.rst:1660 +#: library/curses.rst:1662 msgid "These are available only after :func:`initscr` has been called." msgstr "" -#: library/curses.rst:1663 +#: library/curses.rst:1665 msgid "ACS code" msgstr "" -#: library/curses.rst:1665 +#: library/curses.rst:1667 msgid "alternate name for upper right corner" msgstr "" -#: library/curses.rst:1667 +#: library/curses.rst:1669 msgid "solid square block" msgstr "" -#: library/curses.rst:1669 +#: library/curses.rst:1671 msgid "board of squares" msgstr "" -#: library/curses.rst:1671 +#: library/curses.rst:1673 msgid "alternate name for horizontal line" msgstr "" -#: library/curses.rst:1673 +#: library/curses.rst:1675 msgid "alternate name for upper left corner" msgstr "" -#: library/curses.rst:1675 +#: library/curses.rst:1677 msgid "alternate name for top tee" msgstr "" -#: library/curses.rst:1677 +#: library/curses.rst:1679 msgid "bottom tee" msgstr "" -#: library/curses.rst:1679 +#: library/curses.rst:1681 msgid "bullet" msgstr "" -#: library/curses.rst:1681 +#: library/curses.rst:1683 msgid "checker board (stipple)" msgstr "" -#: library/curses.rst:1683 +#: library/curses.rst:1685 msgid "arrow pointing down" msgstr "" -#: library/curses.rst:1685 +#: library/curses.rst:1687 msgid "degree symbol" msgstr "" -#: library/curses.rst:1687 +#: library/curses.rst:1689 msgid "diamond" msgstr "" -#: library/curses.rst:1689 +#: library/curses.rst:1691 msgid "greater-than-or-equal-to" msgstr "" -#: library/curses.rst:1691 +#: library/curses.rst:1693 msgid "horizontal line" msgstr "" -#: library/curses.rst:1693 +#: library/curses.rst:1695 msgid "lantern symbol" msgstr "" -#: library/curses.rst:1695 +#: library/curses.rst:1697 msgid "left arrow" msgstr "" -#: library/curses.rst:1697 +#: library/curses.rst:1699 msgid "less-than-or-equal-to" msgstr "" -#: library/curses.rst:1699 +#: library/curses.rst:1701 msgid "lower left-hand corner" msgstr "" -#: library/curses.rst:1701 +#: library/curses.rst:1703 msgid "lower right-hand corner" msgstr "" -#: library/curses.rst:1703 +#: library/curses.rst:1705 msgid "left tee" msgstr "" -#: library/curses.rst:1705 +#: library/curses.rst:1707 msgid "not-equal sign" msgstr "" -#: library/curses.rst:1707 +#: library/curses.rst:1709 msgid "letter pi" msgstr "" -#: library/curses.rst:1709 +#: library/curses.rst:1711 msgid "plus-or-minus sign" msgstr "" -#: library/curses.rst:1711 +#: library/curses.rst:1713 msgid "big plus sign" msgstr "" -#: library/curses.rst:1713 +#: library/curses.rst:1715 msgid "right arrow" msgstr "" -#: library/curses.rst:1715 +#: library/curses.rst:1717 msgid "right tee" msgstr "" -#: library/curses.rst:1717 +#: library/curses.rst:1719 msgid "scan line 1" msgstr "" -#: library/curses.rst:1719 +#: library/curses.rst:1721 msgid "scan line 3" msgstr "" -#: library/curses.rst:1721 +#: library/curses.rst:1723 msgid "scan line 7" msgstr "" -#: library/curses.rst:1723 +#: library/curses.rst:1725 msgid "scan line 9" msgstr "" -#: library/curses.rst:1725 +#: library/curses.rst:1727 msgid "alternate name for lower right corner" msgstr "" -#: library/curses.rst:1727 +#: library/curses.rst:1729 msgid "alternate name for vertical line" msgstr "" -#: library/curses.rst:1729 +#: library/curses.rst:1731 msgid "alternate name for right tee" msgstr "" -#: library/curses.rst:1731 +#: library/curses.rst:1733 msgid "alternate name for lower left corner" msgstr "" -#: library/curses.rst:1733 +#: library/curses.rst:1735 msgid "alternate name for bottom tee" msgstr "" -#: library/curses.rst:1735 +#: library/curses.rst:1737 msgid "alternate name for left tee" msgstr "" -#: library/curses.rst:1737 +#: library/curses.rst:1739 msgid "alternate name for crossover or big plus" msgstr "" -#: library/curses.rst:1739 +#: library/curses.rst:1741 msgid "pound sterling" msgstr "" -#: library/curses.rst:1741 +#: library/curses.rst:1743 msgid "top tee" msgstr "" -#: library/curses.rst:1743 +#: library/curses.rst:1745 msgid "up arrow" msgstr "" -#: library/curses.rst:1745 +#: library/curses.rst:1747 msgid "upper left corner" msgstr "" -#: library/curses.rst:1747 +#: library/curses.rst:1749 msgid "upper right corner" msgstr "" -#: library/curses.rst:1749 +#: library/curses.rst:1751 msgid "vertical line" msgstr "" -#: library/curses.rst:1752 +#: library/curses.rst:1754 msgid "" "The following table lists mouse button constants used by :meth:`getmouse`:" msgstr "" -#: library/curses.rst:1755 +#: library/curses.rst:1757 msgid "Mouse button constant" msgstr "" -#: library/curses.rst:1757 +#: library/curses.rst:1759 msgid "Mouse button *n* pressed" msgstr "" -#: library/curses.rst:1759 +#: library/curses.rst:1761 msgid "Mouse button *n* released" msgstr "" -#: library/curses.rst:1761 +#: library/curses.rst:1763 msgid "Mouse button *n* clicked" msgstr "" -#: library/curses.rst:1763 +#: library/curses.rst:1765 msgid "Mouse button *n* double clicked" msgstr "" -#: library/curses.rst:1765 +#: library/curses.rst:1767 msgid "Mouse button *n* triple clicked" msgstr "" -#: library/curses.rst:1767 +#: library/curses.rst:1769 msgid "Shift was down during button state change" msgstr "" -#: library/curses.rst:1771 +#: library/curses.rst:1773 msgid "Control was down during button state change" msgstr "" -#: library/curses.rst:1778 +#: library/curses.rst:1780 msgid "The following table lists the predefined colors:" msgstr "" -#: library/curses.rst:1781 +#: library/curses.rst:1783 msgid "Color" msgstr "" -#: library/curses.rst:1783 +#: library/curses.rst:1785 msgid "Black" msgstr "" -#: library/curses.rst:1785 +#: library/curses.rst:1787 msgid "Blue" msgstr "" -#: library/curses.rst:1787 +#: library/curses.rst:1789 msgid "Cyan (light greenish blue)" msgstr "" -#: library/curses.rst:1789 +#: library/curses.rst:1791 msgid "Green" msgstr "" -#: library/curses.rst:1791 +#: library/curses.rst:1793 msgid "Magenta (purplish red)" msgstr "" -#: library/curses.rst:1793 +#: library/curses.rst:1795 msgid "Red" msgstr "" -#: library/curses.rst:1795 +#: library/curses.rst:1797 msgid "White" msgstr "" -#: library/curses.rst:1797 +#: library/curses.rst:1799 msgid "Yellow" msgstr "" -#: library/curses.rst:1802 +#: library/curses.rst:1804 msgid ":mod:`curses.textpad` --- Text input widget for curses programs" msgstr "" -#: library/curses.rst:1810 +#: library/curses.rst:1812 msgid "" "The :mod:`curses.textpad` module provides a :class:`Textbox` class that " "handles elementary text editing in a curses window, supporting a set of " @@ -2356,11 +2366,11 @@ msgid "" "purposes." msgstr "" -#: library/curses.rst:1816 +#: library/curses.rst:1818 msgid "The module :mod:`curses.textpad` defines the following function:" msgstr "" -#: library/curses.rst:1821 +#: library/curses.rst:1823 msgid "" "Draw a rectangle. The first argument must be a window object; the remaining " "arguments are coordinates relative to that window. The second and third " @@ -2372,15 +2382,15 @@ msgid "" "will be drawn with ASCII dashes, vertical bars, and plus signs." msgstr "" -#: library/curses.rst:1834 +#: library/curses.rst:1836 msgid "Textbox objects" msgstr "" -#: library/curses.rst:1836 +#: library/curses.rst:1838 msgid "You can instantiate a :class:`Textbox` object as follows:" msgstr "" -#: library/curses.rst:1841 +#: library/curses.rst:1843 msgid "" "Return a textbox widget object. The *win* argument should be a curses :ref:" "`window ` object in which the textbox is to be " @@ -2389,11 +2399,11 @@ msgid "" "instance's :attr:`stripspaces` flag is initially on." msgstr "" -#: library/curses.rst:1847 +#: library/curses.rst:1849 msgid ":class:`Textbox` objects have the following methods:" msgstr "" -#: library/curses.rst:1852 +#: library/curses.rst:1854 msgid "" "This is the entry point you will normally use. It accepts editing " "keystrokes until one of the termination keystrokes is entered. If " @@ -2404,167 +2414,167 @@ msgid "" "`stripspaces` attribute." msgstr "" -#: library/curses.rst:1863 +#: library/curses.rst:1865 msgid "" "Process a single command keystroke. Here are the supported special " "keystrokes:" msgstr "" -#: library/curses.rst:1905 +#: library/curses.rst:1907 msgid "Keystroke" msgstr "" -#: library/curses.rst:1867 +#: library/curses.rst:1869 msgid "Action" msgstr "" -#: library/curses.rst:1869 +#: library/curses.rst:1871 msgid ":kbd:`Control-A`" msgstr "" -#: library/curses.rst:1869 +#: library/curses.rst:1871 msgid "Go to left edge of window." msgstr "" -#: library/curses.rst:1907 +#: library/curses.rst:1909 msgid ":kbd:`Control-B`" msgstr "" -#: library/curses.rst:1871 +#: library/curses.rst:1873 msgid "Cursor left, wrapping to previous line if appropriate." msgstr "" -#: library/curses.rst:1874 +#: library/curses.rst:1876 msgid ":kbd:`Control-D`" msgstr "" -#: library/curses.rst:1874 +#: library/curses.rst:1876 msgid "Delete character under cursor." msgstr "" -#: library/curses.rst:1876 +#: library/curses.rst:1878 msgid ":kbd:`Control-E`" msgstr "" -#: library/curses.rst:1876 +#: library/curses.rst:1878 msgid "Go to right edge (stripspaces off) or end of line (stripspaces on)." msgstr "" -#: library/curses.rst:1909 +#: library/curses.rst:1911 msgid ":kbd:`Control-F`" msgstr "" -#: library/curses.rst:1879 +#: library/curses.rst:1881 msgid "Cursor right, wrapping to next line when appropriate." msgstr "" -#: library/curses.rst:1882 +#: library/curses.rst:1884 msgid ":kbd:`Control-G`" msgstr "" -#: library/curses.rst:1882 +#: library/curses.rst:1884 msgid "Terminate, returning the window contents." msgstr "" -#: library/curses.rst:1884 +#: library/curses.rst:1886 msgid ":kbd:`Control-H`" msgstr "" -#: library/curses.rst:1884 +#: library/curses.rst:1886 msgid "Delete character backward." msgstr "" -#: library/curses.rst:1886 +#: library/curses.rst:1888 msgid ":kbd:`Control-J`" msgstr "" -#: library/curses.rst:1886 +#: library/curses.rst:1888 msgid "Terminate if the window is 1 line, otherwise insert newline." msgstr "" -#: library/curses.rst:1889 +#: library/curses.rst:1891 msgid ":kbd:`Control-K`" msgstr "" -#: library/curses.rst:1889 +#: library/curses.rst:1891 msgid "If line is blank, delete it, otherwise clear to end of line." msgstr "" -#: library/curses.rst:1892 +#: library/curses.rst:1894 msgid ":kbd:`Control-L`" msgstr "" -#: library/curses.rst:1892 +#: library/curses.rst:1894 msgid "Refresh screen." msgstr "" -#: library/curses.rst:1913 +#: library/curses.rst:1915 msgid ":kbd:`Control-N`" msgstr "" -#: library/curses.rst:1894 +#: library/curses.rst:1896 msgid "Cursor down; move down one line." msgstr "" -#: library/curses.rst:1896 +#: library/curses.rst:1898 msgid ":kbd:`Control-O`" msgstr "" -#: library/curses.rst:1896 +#: library/curses.rst:1898 msgid "Insert a blank line at cursor location." msgstr "" -#: library/curses.rst:1911 +#: library/curses.rst:1913 msgid ":kbd:`Control-P`" msgstr "" -#: library/curses.rst:1898 +#: library/curses.rst:1900 msgid "Cursor up; move up one line." msgstr "" -#: library/curses.rst:1901 +#: library/curses.rst:1903 msgid "" "Move operations do nothing if the cursor is at an edge where the movement is " "not possible. The following synonyms are supported where possible:" msgstr "" -#: library/curses.rst:1907 +#: library/curses.rst:1909 msgid ":const:`~curses.KEY_LEFT`" msgstr "" -#: library/curses.rst:1909 +#: library/curses.rst:1911 msgid ":const:`~curses.KEY_RIGHT`" msgstr "" -#: library/curses.rst:1911 +#: library/curses.rst:1913 msgid ":const:`~curses.KEY_UP`" msgstr "" -#: library/curses.rst:1913 +#: library/curses.rst:1915 msgid ":const:`~curses.KEY_DOWN`" msgstr "" -#: library/curses.rst:1915 +#: library/curses.rst:1917 msgid ":const:`~curses.KEY_BACKSPACE`" msgstr "" -#: library/curses.rst:1915 +#: library/curses.rst:1917 msgid ":kbd:`Control-h`" msgstr "" -#: library/curses.rst:1918 +#: library/curses.rst:1920 msgid "" "All other keystrokes are treated as a command to insert the given character " "and move right (with line wrapping)." msgstr "" -#: library/curses.rst:1924 +#: library/curses.rst:1926 msgid "" "Return the window contents as a string; whether blanks in the window are " "included is affected by the :attr:`stripspaces` member." msgstr "" -#: library/curses.rst:1930 +#: library/curses.rst:1932 msgid "" "This attribute is a flag which controls the interpretation of blanks in the " "window. When it is on, trailing blanks on each line are ignored; any cursor " diff --git a/library/custominterp.po b/library/custominterp.po index 15f0583b..9da31648 100644 --- a/library/custominterp.po +++ b/library/custominterp.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" diff --git a/library/dataclasses.po b/library/dataclasses.po index bdb1bfcb..1b9c42fe 100644 --- a/library/dataclasses.po +++ b/library/dataclasses.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -512,13 +512,22 @@ msgstr "" #: library/dataclasses.rst:352 msgid "" +"``InitVar[T]`` type annotations describe variables that are :ref:`init-only " +"`. Fields annotated with :class:`!InitVar` " +"are considered pseudo-fields, and thus are neither returned by the :func:" +"`fields` function nor used in any way except adding them as parameters to :" +"meth:`~object.__init__` and an optional :meth:`__post_init__`." +msgstr "" + +#: library/dataclasses.rst:361 +msgid "" "Returns a tuple of :class:`Field` objects that define the fields for this " "dataclass. Accepts either a dataclass, or an instance of a dataclass. " "Raises :exc:`TypeError` if not passed a dataclass or instance of one. Does " "not return pseudo-fields which are ``ClassVar`` or ``InitVar``." msgstr "" -#: library/dataclasses.rst:359 +#: library/dataclasses.rst:368 msgid "" "Converts the dataclass *obj* to a dict (by using the factory function " "*dict_factory*). Each dataclass is converted to a dict of its fields, as " @@ -526,11 +535,11 @@ msgid "" "into. Other objects are copied with :func:`copy.deepcopy`." msgstr "" -#: library/dataclasses.rst:365 +#: library/dataclasses.rst:374 msgid "Example of using :func:`!asdict` on nested dataclasses::" msgstr "" -#: library/dataclasses.rst:367 +#: library/dataclasses.rst:376 msgid "" "@dataclass\n" "class Point:\n" @@ -548,20 +557,20 @@ msgid "" "assert asdict(c) == {'mylist': [{'x': 0, 'y': 0}, {'x': 10, 'y': 4}]}" msgstr "" -#: library/dataclasses.rst:402 +#: library/dataclasses.rst:411 msgid "To create a shallow copy, the following workaround may be used::" msgstr "" -#: library/dataclasses.rst:384 +#: library/dataclasses.rst:393 msgid "{field.name: getattr(obj, field.name) for field in fields(obj)}" msgstr "" -#: library/dataclasses.rst:386 +#: library/dataclasses.rst:395 msgid "" ":func:`!asdict` raises :exc:`TypeError` if *obj* is not a dataclass instance." msgstr "" -#: library/dataclasses.rst:391 +#: library/dataclasses.rst:400 msgid "" "Converts the dataclass *obj* to a tuple (by using the factory function " "*tuple_factory*). Each dataclass is converted to a tuple of its field " @@ -569,27 +578,27 @@ msgid "" "objects are copied with :func:`copy.deepcopy`." msgstr "" -#: library/dataclasses.rst:397 +#: library/dataclasses.rst:406 msgid "Continuing from the previous example::" msgstr "" -#: library/dataclasses.rst:399 +#: library/dataclasses.rst:408 msgid "" "assert astuple(p) == (10, 20)\n" "assert astuple(c) == ([(0, 0), (10, 4)],)" msgstr "" -#: library/dataclasses.rst:404 +#: library/dataclasses.rst:413 msgid "tuple(getattr(obj, field.name) for field in dataclasses.fields(obj))" msgstr "" -#: library/dataclasses.rst:406 +#: library/dataclasses.rst:415 msgid "" ":func:`!astuple` raises :exc:`TypeError` if *obj* is not a dataclass " "instance." msgstr "" -#: library/dataclasses.rst:411 +#: library/dataclasses.rst:420 msgid "" "Creates a new dataclass with name *cls_name*, fields as defined in *fields*, " "base classes as given in *bases*, and initialized with a namespace as given " @@ -601,13 +610,13 @@ msgid "" "`@dataclass `." msgstr "" -#: library/dataclasses.rst:421 +#: library/dataclasses.rst:430 msgid "" "If *module* is defined, the :attr:`!__module__` attribute of the dataclass " "is set to that value. By default, it is set to the module name of the caller." msgstr "" -#: library/dataclasses.rst:425 +#: library/dataclasses.rst:434 msgid "" "This function is not strictly required, because any Python mechanism for " "creating a new class with :attr:`!__annotations__` can then apply the :func:" @@ -615,7 +624,7 @@ msgid "" "This function is provided as a convenience. For example::" msgstr "" -#: library/dataclasses.rst:431 +#: library/dataclasses.rst:440 msgid "" "C = make_dataclass('C',\n" " [('x', int),\n" @@ -624,11 +633,11 @@ msgid "" " namespace={'add_one': lambda self: self.x + 1})" msgstr "" -#: library/dataclasses.rst:437 +#: library/dataclasses.rst:446 msgid "Is equivalent to::" msgstr "" -#: library/dataclasses.rst:439 +#: library/dataclasses.rst:448 msgid "" "@dataclass\n" "class C:\n" @@ -640,7 +649,7 @@ msgid "" " return self.x + 1" msgstr "" -#: library/dataclasses.rst:450 +#: library/dataclasses.rst:459 msgid "" "Creates a new object of the same type as *obj*, replacing fields with values " "from *changes*. If *obj* is not a Data Class, raises :exc:`TypeError`. If " @@ -648,27 +657,27 @@ msgid "" "`TypeError`." msgstr "" -#: library/dataclasses.rst:455 +#: library/dataclasses.rst:464 msgid "" "The newly returned object is created by calling the :meth:`~object.__init__` " "method of the dataclass. This ensures that :meth:`__post_init__`, if " "present, is also called." msgstr "" -#: library/dataclasses.rst:459 +#: library/dataclasses.rst:468 msgid "" "Init-only variables without default values, if any exist, must be specified " "on the call to :func:`!replace` so that they can be passed to :meth:`!" "__init__` and :meth:`__post_init__`." msgstr "" -#: library/dataclasses.rst:463 +#: library/dataclasses.rst:472 msgid "" "It is an error for *changes* to contain any fields that are defined as " "having ``init=False``. A :exc:`ValueError` will be raised in this case." msgstr "" -#: library/dataclasses.rst:467 +#: library/dataclasses.rst:476 msgid "" "Be forewarned about how ``init=False`` fields work during a call to :func:`!" "replace`. They are not copied from the source object, but rather are " @@ -679,30 +688,36 @@ msgid "" "instance copying." msgstr "" -#: library/dataclasses.rst:478 +#: library/dataclasses.rst:485 +msgid "" +"Dataclass instances are also supported by generic function :func:`copy." +"replace`." +msgstr "" + +#: library/dataclasses.rst:489 msgid "" "Return ``True`` if its parameter is a dataclass (including subclasses of a " "dataclass) or an instance of one, otherwise return ``False``." msgstr "" -#: library/dataclasses.rst:481 +#: library/dataclasses.rst:492 msgid "" "If you need to know if a class is an instance of a dataclass (and not a " "dataclass itself), then add a further check for ``not isinstance(obj, " "type)``::" msgstr "" -#: library/dataclasses.rst:485 +#: library/dataclasses.rst:496 msgid "" "def is_dataclass_instance(obj):\n" " return is_dataclass(obj) and not isinstance(obj, type)" msgstr "" -#: library/dataclasses.rst:490 +#: library/dataclasses.rst:501 msgid "A sentinel value signifying a missing default or default_factory." msgstr "" -#: library/dataclasses.rst:494 +#: library/dataclasses.rst:505 msgid "" "A sentinel value used as a type annotation. Any fields after a pseudo-field " "with the type of :const:`!KW_ONLY` are marked as keyword-only fields. Note " @@ -713,13 +728,13 @@ msgid "" "the class is instantiated." msgstr "" -#: library/dataclasses.rst:503 +#: library/dataclasses.rst:514 msgid "" "In this example, the fields ``y`` and ``z`` will be marked as keyword-only " "fields::" msgstr "" -#: library/dataclasses.rst:505 +#: library/dataclasses.rst:516 msgid "" "@dataclass\n" "class Point:\n" @@ -731,24 +746,24 @@ msgid "" "p = Point(0, y=1.5, z=2.0)" msgstr "" -#: library/dataclasses.rst:514 +#: library/dataclasses.rst:525 msgid "" "In a single dataclass, it is an error to specify more than one field whose " "type is :const:`!KW_ONLY`." msgstr "" -#: library/dataclasses.rst:521 +#: library/dataclasses.rst:532 msgid "" "Raised when an implicitly defined :meth:`~object.__setattr__` or :meth:" "`~object.__delattr__` is called on a dataclass which was defined with " "``frozen=True``. It is a subclass of :exc:`AttributeError`." msgstr "" -#: library/dataclasses.rst:528 +#: library/dataclasses.rst:539 msgid "Post-init processing" msgstr "" -#: library/dataclasses.rst:532 +#: library/dataclasses.rst:543 msgid "" "When defined on the class, it will be called by the generated :meth:`~object." "__init__`, normally as :meth:`!self.__post_init__`. However, if any " @@ -758,13 +773,13 @@ msgid "" "automatically be called." msgstr "" -#: library/dataclasses.rst:539 +#: library/dataclasses.rst:550 msgid "" "Among other uses, this allows for initializing field values that depend on " "one or more other fields. For example::" msgstr "" -#: library/dataclasses.rst:542 +#: library/dataclasses.rst:553 msgid "" "@dataclass\n" "class C:\n" @@ -776,7 +791,7 @@ msgid "" " self.c = self.a + self.b" msgstr "" -#: library/dataclasses.rst:551 +#: library/dataclasses.rst:562 msgid "" "The :meth:`~object.__init__` method generated by :func:`@dataclass " "` does not call base class :meth:`!__init__` methods. If the base " @@ -784,12 +799,12 @@ msgid "" "call this method in a :meth:`__post_init__` method::" msgstr "" -#: library/dataclasses.rst:556 +#: library/dataclasses.rst:567 msgid "" "class Rectangle:\n" " def __init__(self, height, width):\n" -" self.height = height\n" -" self.width = width\n" +" self.height = height\n" +" self.width = width\n" "\n" "@dataclass\n" "class Square(Rectangle):\n" @@ -799,25 +814,25 @@ msgid "" " super().__init__(self.side, self.side)" msgstr "" -#: library/dataclasses.rst:568 +#: library/dataclasses.rst:579 msgid "" "Note, however, that in general the dataclass-generated :meth:`!__init__` " "methods don't need to be called, since the derived dataclass will take care " "of initializing all fields of any base class that is a dataclass itself." msgstr "" -#: library/dataclasses.rst:572 +#: library/dataclasses.rst:583 msgid "" "See the section below on init-only variables for ways to pass parameters to :" "meth:`!__post_init__`. Also see the warning about how :func:`replace` " "handles ``init=False`` fields." msgstr "" -#: library/dataclasses.rst:579 +#: library/dataclasses.rst:590 msgid "Class variables" msgstr "" -#: library/dataclasses.rst:581 +#: library/dataclasses.rst:592 msgid "" "One of the few places where :func:`@dataclass ` actually inspects " "the type of a field is to determine if a field is a class variable as " @@ -828,16 +843,16 @@ msgid "" "`fields` function." msgstr "" -#: library/dataclasses.rst:592 +#: library/dataclasses.rst:603 msgid "Init-only variables" msgstr "" -#: library/dataclasses.rst:594 +#: library/dataclasses.rst:605 msgid "" "Another place where :func:`@dataclass ` inspects a type " "annotation is to determine if a field is an init-only variable. It does " -"this by seeing if the type of a field is of type ``dataclasses.InitVar``. " -"If a field is an ``InitVar``, it is considered a pseudo-field called an init-" +"this by seeing if the type of a field is of type :class:`InitVar`. If a " +"field is an :class:`InitVar`, it is considered a pseudo-field called an init-" "only field. As it is not a true field, it is not returned by the module-" "level :func:`fields` function. Init-only fields are added as parameters to " "the generated :meth:`~object.__init__` method, and are passed to the " @@ -845,13 +860,13 @@ msgid "" "dataclasses." msgstr "" -#: library/dataclasses.rst:604 +#: library/dataclasses.rst:615 msgid "" "For example, suppose a field will be initialized from a database, if a value " "is not provided when creating the class::" msgstr "" -#: library/dataclasses.rst:607 +#: library/dataclasses.rst:618 msgid "" "@dataclass\n" "class C:\n" @@ -866,17 +881,17 @@ msgid "" "c = C(10, database=my_database)" msgstr "" -#: library/dataclasses.rst:619 +#: library/dataclasses.rst:630 msgid "" "In this case, :func:`fields` will return :class:`Field` objects for :attr:`!" "i` and :attr:`!j`, but not for :attr:`!database`." msgstr "" -#: library/dataclasses.rst:625 +#: library/dataclasses.rst:636 msgid "Frozen instances" msgstr "" -#: library/dataclasses.rst:627 +#: library/dataclasses.rst:638 msgid "" "It is not possible to create truly immutable Python objects. However, by " "passing ``frozen=True`` to the :func:`@dataclass ` decorator you " @@ -885,18 +900,18 @@ msgid "" "methods will raise a :exc:`FrozenInstanceError` when invoked." msgstr "" -#: library/dataclasses.rst:633 +#: library/dataclasses.rst:644 msgid "" "There is a tiny performance penalty when using ``frozen=True``: :meth:" "`~object.__init__` cannot use simple assignment to initialize fields, and " "must use :meth:`!object.__setattr__`." msgstr "" -#: library/dataclasses.rst:642 +#: library/dataclasses.rst:653 msgid "Inheritance" msgstr "" -#: library/dataclasses.rst:644 +#: library/dataclasses.rst:655 msgid "" "When the dataclass is being created by the :func:`@dataclass ` " "decorator, it looks through all of the class's base classes in reverse MRO " @@ -908,7 +923,7 @@ msgid "" "order, derived classes override base classes. An example::" msgstr "" -#: library/dataclasses.rst:654 +#: library/dataclasses.rst:665 msgid "" "@dataclass\n" "class Base:\n" @@ -921,28 +936,28 @@ msgid "" " x: int = 15" msgstr "" -#: library/dataclasses.rst:664 +#: library/dataclasses.rst:675 msgid "" "The final list of fields is, in order, :attr:`!x`, :attr:`!y`, :attr:`!z`. " "The final type of :attr:`!x` is :class:`int`, as specified in class :class:`!" "C`." msgstr "" -#: library/dataclasses.rst:667 +#: library/dataclasses.rst:678 msgid "" "The generated :meth:`~object.__init__` method for :class:`!C` will look " "like::" msgstr "" -#: library/dataclasses.rst:669 +#: library/dataclasses.rst:680 msgid "def __init__(self, x: int = 15, y: int = 0, z: int = 10):" msgstr "" -#: library/dataclasses.rst:672 +#: library/dataclasses.rst:683 msgid "Re-ordering of keyword-only parameters in :meth:`!__init__`" msgstr "" -#: library/dataclasses.rst:674 +#: library/dataclasses.rst:685 msgid "" "After the parameters needed for :meth:`~object.__init__` are computed, any " "keyword-only parameters are moved to come after all regular (non-keyword-" @@ -950,14 +965,14 @@ msgid "" "implemented in Python: they must come after non-keyword-only parameters." msgstr "" -#: library/dataclasses.rst:680 +#: library/dataclasses.rst:691 msgid "" "In this example, :attr:`!Base.y`, :attr:`!Base.w`, and :attr:`!D.t` are " "keyword-only fields, and :attr:`!Base.x` and :attr:`!D.z` are regular " "fields::" msgstr "" -#: library/dataclasses.rst:683 +#: library/dataclasses.rst:694 msgid "" "@dataclass\n" "class Base:\n" @@ -972,45 +987,45 @@ msgid "" " t: int = field(kw_only=True, default=0)" msgstr "" -#: library/dataclasses.rst:695 +#: library/dataclasses.rst:706 msgid "The generated :meth:`!__init__` method for :class:`!D` will look like::" msgstr "" -#: library/dataclasses.rst:697 +#: library/dataclasses.rst:708 msgid "" "def __init__(self, x: Any = 15.0, z: int = 10, *, y: int = 0, w: int = 1, t: " "int = 0):" msgstr "" -#: library/dataclasses.rst:699 +#: library/dataclasses.rst:710 msgid "" "Note that the parameters have been re-ordered from how they appear in the " "list of fields: parameters derived from regular fields are followed by " "parameters derived from keyword-only fields." msgstr "" -#: library/dataclasses.rst:703 +#: library/dataclasses.rst:714 msgid "" "The relative ordering of keyword-only parameters is maintained in the re-" "ordered :meth:`!__init__` parameter list." msgstr "" -#: library/dataclasses.rst:708 +#: library/dataclasses.rst:719 msgid "Default factory functions" msgstr "" -#: library/dataclasses.rst:710 +#: library/dataclasses.rst:721 msgid "" "If a :func:`field` specifies a *default_factory*, it is called with zero " "arguments when a default value for the field is needed. For example, to " "create a new instance of a list, use::" msgstr "" -#: library/dataclasses.rst:714 +#: library/dataclasses.rst:725 msgid "mylist: list = field(default_factory=list)" msgstr "" -#: library/dataclasses.rst:716 +#: library/dataclasses.rst:727 msgid "" "If a field is excluded from :meth:`~object.__init__` (using ``init=False``) " "and the field also specifies *default_factory*, then the default factory " @@ -1019,17 +1034,17 @@ msgid "" "initial value." msgstr "" -#: library/dataclasses.rst:723 +#: library/dataclasses.rst:734 msgid "Mutable default values" msgstr "" -#: library/dataclasses.rst:725 +#: library/dataclasses.rst:736 msgid "" "Python stores default member variable values in class attributes. Consider " "this example, not using dataclasses::" msgstr "" -#: library/dataclasses.rst:728 +#: library/dataclasses.rst:739 msgid "" "class C:\n" " x = []\n" @@ -1044,17 +1059,17 @@ msgid "" "assert o1.x is o2.x" msgstr "" -#: library/dataclasses.rst:740 +#: library/dataclasses.rst:751 msgid "" "Note that the two instances of class :class:`!C` share the same class " "variable :attr:`!x`, as expected." msgstr "" -#: library/dataclasses.rst:743 +#: library/dataclasses.rst:754 msgid "Using dataclasses, *if* this code was valid::" msgstr "" -#: library/dataclasses.rst:745 +#: library/dataclasses.rst:756 msgid "" "@dataclass\n" "class D:\n" @@ -1063,11 +1078,11 @@ msgid "" " self.x.append(element)" msgstr "" -#: library/dataclasses.rst:751 +#: library/dataclasses.rst:762 msgid "it would generate code similar to::" msgstr "" -#: library/dataclasses.rst:753 +#: library/dataclasses.rst:764 msgid "" "class D:\n" " x = []\n" @@ -1079,7 +1094,7 @@ msgid "" "assert D().x is D().x" msgstr "" -#: library/dataclasses.rst:762 +#: library/dataclasses.rst:773 msgid "" "This has the same issue as the original example using class :class:`!C`. " "That is, two instances of class :class:`!D` that do not specify a value for :" @@ -1092,13 +1107,13 @@ msgid "" "partial solution, but it does protect against many common errors." msgstr "" -#: library/dataclasses.rst:773 +#: library/dataclasses.rst:784 msgid "" "Using default factory functions is a way to create new instances of mutable " "types as default values for fields::" msgstr "" -#: library/dataclasses.rst:776 +#: library/dataclasses.rst:787 msgid "" "@dataclass\n" "class D:\n" @@ -1107,38 +1122,38 @@ msgid "" "assert D().x is not D().x" msgstr "" -#: library/dataclasses.rst:782 +#: library/dataclasses.rst:793 msgid "" "Instead of looking for and disallowing objects of type :class:`list`, :class:" "`dict`, or :class:`set`, unhashable objects are now not allowed as default " "values. Unhashability is used to approximate mutability." msgstr "" -#: library/dataclasses.rst:789 +#: library/dataclasses.rst:800 msgid "Descriptor-typed fields" msgstr "" -#: library/dataclasses.rst:791 +#: library/dataclasses.rst:802 msgid "" "Fields that are assigned :ref:`descriptor objects ` as their " "default value have the following special behaviors:" msgstr "" -#: library/dataclasses.rst:794 +#: library/dataclasses.rst:805 msgid "" "The value for the field passed to the dataclass's :meth:`~object.__init__` " "method is passed to the descriptor's :meth:`~object.__set__` method rather " "than overwriting the descriptor object." msgstr "" -#: library/dataclasses.rst:798 +#: library/dataclasses.rst:809 msgid "" "Similarly, when getting or setting the field, the descriptor's :meth:" "`~object.__get__` or :meth:`!__set__` method is called rather than returning " "or overwriting the descriptor object." msgstr "" -#: library/dataclasses.rst:802 +#: library/dataclasses.rst:813 msgid "" "To determine whether a field contains a default value, :func:`@dataclass " "` will call the descriptor's :meth:`!__get__` method using its " @@ -1148,7 +1163,7 @@ msgid "" "in this situation, no default value will be provided for the field." msgstr "" -#: library/dataclasses.rst:812 +#: library/dataclasses.rst:823 msgid "" "class IntConversionDescriptor:\n" " def __init__(self, *, default):\n" @@ -1177,7 +1192,7 @@ msgid "" "print(i.quantity_on_hand) # 2" msgstr "" -#: library/dataclasses.rst:837 +#: library/dataclasses.rst:848 msgid "" "Note that if a field is annotated with a descriptor type, but is not " "assigned a descriptor object as its default value, the field will act like a " diff --git a/library/datatypes.po b/library/datatypes.po index f7e663dc..f9caffa6 100644 --- a/library/datatypes.po +++ b/library/datatypes.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" diff --git a/library/datetime.po b/library/datetime.po index c0b7ded8..3be57e66 100644 --- a/library/datetime.po +++ b/library/datetime.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -407,7 +407,7 @@ msgid "" "(-1, 86399, 999999)" msgstr "" -#: library/datetime.rst:566 library/datetime.rst:1720 library/datetime.rst:2322 +#: library/datetime.rst:566 library/datetime.rst:1764 library/datetime.rst:2369 msgid "Class attributes:" msgstr "" @@ -434,7 +434,7 @@ msgid "" "`timedelta` object." msgstr "" -#: library/datetime.rst:584 library/datetime.rst:1740 +#: library/datetime.rst:584 library/datetime.rst:1784 msgid "Instance attributes (read-only):" msgstr "" @@ -467,15 +467,15 @@ msgstr "" msgid "Between 0 and 999,999 inclusive." msgstr "" -#: library/datetime.rst:601 library/datetime.rst:1162 +#: library/datetime.rst:601 library/datetime.rst:1199 msgid "Supported operations:" msgstr "" -#: library/datetime.rst:604 library/datetime.rst:1165 +#: library/datetime.rst:604 library/datetime.rst:1202 msgid "Operation" msgstr "" -#: library/datetime.rst:604 library/datetime.rst:1165 +#: library/datetime.rst:604 library/datetime.rst:1202 msgid "Result" msgstr "" @@ -619,7 +619,7 @@ msgid "" "constructor call with canonical attribute values." msgstr "" -#: library/datetime.rst:623 library/datetime.rst:2570 +#: library/datetime.rst:623 library/datetime.rst:2600 msgid "Notes:" msgstr "" @@ -686,7 +686,7 @@ msgid "" "and only if it isn't equal to ``timedelta(0)``." msgstr "" -#: library/datetime.rst:649 library/datetime.rst:1847 +#: library/datetime.rst:665 library/datetime.rst:1891 msgid "Instance methods:" msgstr "" @@ -780,12 +780,12 @@ msgstr "" msgid "``1 <= day <= number of days in the given month and year``" msgstr "" -#: library/datetime.rst:864 +#: library/datetime.rst:883 msgid "" "If an argument outside those ranges is given, :exc:`ValueError` is raised." msgstr "" -#: library/datetime.rst:869 +#: library/datetime.rst:888 msgid "Other constructors, all class methods:" msgstr "" @@ -839,22 +839,22 @@ msgid "" "ISO 8601 format, with the following exceptions:" msgstr "" -#: library/datetime.rst:1029 +#: library/datetime.rst:1048 msgid "" "Reduced precision dates are not currently supported (``YYYY-MM``, ``YYYY``)." msgstr "" -#: library/datetime.rst:1031 +#: library/datetime.rst:1050 msgid "" "Extended date representations are not currently supported (``±YYYYYY-MM-" "DD``)." msgstr "" -#: library/datetime.rst:1033 +#: library/datetime.rst:1052 msgid "Ordinal dates are not currently supported (``YYYY-OOO``)." msgstr "" -#: library/datetime.rst:1035 library/datetime.rst:1476 +#: library/datetime.rst:1054 library/datetime.rst:1520 msgid "Examples::" msgstr "" @@ -894,15 +894,15 @@ msgid "" "``timedelta(days=1)``." msgstr "" -#: library/datetime.rst:1113 +#: library/datetime.rst:1150 msgid "Between :const:`MINYEAR` and :const:`MAXYEAR` inclusive." msgstr "" -#: library/datetime.rst:1118 +#: library/datetime.rst:1155 msgid "Between 1 and 12 inclusive." msgstr "" -#: library/datetime.rst:1123 +#: library/datetime.rst:1160 msgid "Between 1 and the number of days in the given month of the given year." msgstr "" @@ -926,7 +926,7 @@ msgstr "" msgid "``timedelta = date1 - date2``" msgstr "" -#: library/datetime.rst:1171 +#: library/datetime.rst:1208 msgid "\\(3)" msgstr "" @@ -938,7 +938,7 @@ msgstr "" msgid "``date1 != date2``" msgstr "" -#: library/datetime.rst:1173 +#: library/datetime.rst:1210 msgid "Equality comparison. (4)" msgstr "" @@ -958,7 +958,7 @@ msgstr "" msgid "``date1 >= date2``" msgstr "" -#: library/datetime.rst:1176 +#: library/datetime.rst:1213 msgid "Order comparison. (5)" msgstr "" @@ -985,29 +985,51 @@ msgstr "" msgid ":class:`date` objects are equal if they represent the same date." msgstr "" -#: library/datetime.rst:643 +#: library/datetime.rst:642 +msgid "" +":class:`!date` objects that are not also :class:`.datetime` instances are " +"never equal to :class:`!datetime` objects, even if they represent the same " +"date." +msgstr "" + +#: library/datetime.rst:647 msgid "" "*date1* is considered less than *date2* when *date1* precedes *date2* in " "time. In other words, ``date1 < date2`` if and only if ``date1.toordinal() < " "date2.toordinal()``." msgstr "" -#: library/datetime.rst:647 +#: library/datetime.rst:651 +msgid "" +"Order comparison between a :class:`!date` object that is not also a :class:`." +"datetime` instance and a :class:`!datetime` object raises :exc:`TypeError`." +msgstr "" + +#: library/datetime.rst:1281 +msgid "" +"Comparison between :class:`.datetime` object and an instance of the :class:" +"`date` subclass that is not a :class:`!datetime` subclass no longer converts " +"the latter to :class:`!date`, ignoring the time part and the time zone. The " +"default behavior can be changed by overriding the special comparison methods " +"in subclasses." +msgstr "" + +#: library/datetime.rst:663 msgid "" "In Boolean contexts, all :class:`date` objects are considered to be true." msgstr "" -#: library/datetime.rst:653 +#: library/datetime.rst:669 msgid "" "Return a new :class:`date` object with the same values, but with specified " "parameters updated." msgstr "" -#: library/datetime.rst:1890 +#: library/datetime.rst:1937 msgid "Example::" msgstr "" -#: library/datetime.rst:658 +#: library/datetime.rst:674 msgid "" ">>> from datetime import date\n" ">>> d = date(2002, 12, 31)\n" @@ -1015,64 +1037,70 @@ msgid "" "datetime.date(2002, 12, 26)" msgstr "" -#: library/datetime.rst:1361 +#: library/datetime.rst:679 +msgid "" +"The generic function :func:`copy.replace` also supports :class:`date` " +"objects." +msgstr "" + +#: library/datetime.rst:1405 msgid "" "Return a :class:`time.struct_time` such as returned by :func:`time." "localtime`." msgstr "" -#: library/datetime.rst:668 +#: library/datetime.rst:687 msgid "The hours, minutes and seconds are 0, and the DST flag is -1." msgstr "" -#: library/datetime.rst:1363 +#: library/datetime.rst:1407 msgid "``d.timetuple()`` is equivalent to::" msgstr "" -#: library/datetime.rst:672 +#: library/datetime.rst:691 msgid "" "time.struct_time((d.year, d.month, d.day, 0, 0, 0, d.weekday(), yday, -1))" msgstr "" -#: library/datetime.rst:674 +#: library/datetime.rst:693 msgid "" "where ``yday = d.toordinal() - date(d.year, 1, 1).toordinal() + 1`` is the " "day number within the current year starting with 1 for January 1st." msgstr "" -#: library/datetime.rst:680 +#: library/datetime.rst:699 msgid "" "Return the proleptic Gregorian ordinal of the date, where January 1 of year " "1 has ordinal 1. For any :class:`date` object ``d``, ``date.fromordinal(d." "toordinal()) == d``." msgstr "" -#: library/datetime.rst:687 +#: library/datetime.rst:706 msgid "" "Return the day of the week as an integer, where Monday is 0 and Sunday is 6. " "For example, ``date(2002, 12, 4).weekday() == 2``, a Wednesday. See also :" "meth:`isoweekday`." msgstr "" -#: library/datetime.rst:694 +#: library/datetime.rst:713 msgid "" "Return the day of the week as an integer, where Monday is 1 and Sunday is 7. " "For example, ``date(2002, 12, 4).isoweekday() == 3``, a Wednesday. See also :" "meth:`weekday`, :meth:`isocalendar`." msgstr "" -#: library/datetime.rst:701 +#: library/datetime.rst:720 msgid "" "Return a :term:`named tuple` object with three components: ``year``, " "``week`` and ``weekday``." msgstr "" -#: library/datetime.rst:704 +#: library/datetime.rst:723 msgid "" "The ISO calendar is a widely used variant of the Gregorian calendar. [#]_" msgstr "" -#: library/datetime.rst:706 +#: library/datetime.rst:725 msgid "" "The ISO year consists of 52 or 53 full weeks, and where a week starts on a " "Monday and ends on a Sunday. The first week of an ISO year is the first " @@ -1081,13 +1109,13 @@ msgid "" "Gregorian year." msgstr "" -#: library/datetime.rst:711 +#: library/datetime.rst:730 msgid "" "For example, 2004 begins on a Thursday, so the first week of ISO year 2004 " "begins on Monday, 29 Dec 2003 and ends on Sunday, 4 Jan 2004::" msgstr "" -#: library/datetime.rst:714 +#: library/datetime.rst:733 msgid "" ">>> from datetime import date\n" ">>> date(2003, 12, 29).isocalendar()\n" @@ -1096,53 +1124,53 @@ msgid "" "datetime.IsoCalendarDate(year=2004, week=1, weekday=7)" msgstr "" -#: library/datetime.rst:720 +#: library/datetime.rst:739 msgid "Result changed from a tuple to a :term:`named tuple`." msgstr "" -#: library/datetime.rst:725 +#: library/datetime.rst:744 msgid "" "Return a string representing the date in ISO 8601 format, ``YYYY-MM-DD``::" msgstr "" -#: library/datetime.rst:727 +#: library/datetime.rst:746 msgid "" ">>> from datetime import date\n" ">>> date(2002, 12, 4).isoformat()\n" "'2002-12-04'" msgstr "" -#: library/datetime.rst:733 +#: library/datetime.rst:752 msgid "For a date ``d``, ``str(d)`` is equivalent to ``d.isoformat()``." msgstr "" -#: library/datetime.rst:738 +#: library/datetime.rst:757 msgid "Return a string representing the date::" msgstr "" -#: library/datetime.rst:740 +#: library/datetime.rst:759 msgid "" ">>> from datetime import date\n" ">>> date(2002, 12, 4).ctime()\n" "'Wed Dec 4 00:00:00 2002'" msgstr "" -#: library/datetime.rst:1547 +#: library/datetime.rst:1591 msgid "``d.ctime()`` is equivalent to::" msgstr "" -#: library/datetime.rst:1549 +#: library/datetime.rst:1593 msgid "time.ctime(time.mktime(d.timetuple()))" msgstr "" -#: library/datetime.rst:748 +#: library/datetime.rst:767 msgid "" "on platforms where the native C :c:func:`ctime` function (which :func:`time." "ctime` invokes, but which :meth:`date.ctime` does not invoke) conforms to " "the C standard." msgstr "" -#: library/datetime.rst:755 +#: library/datetime.rst:774 msgid "" "Return a string representing the date, controlled by an explicit format " "string. Format codes referring to hours, minutes or seconds will see 0 " @@ -1150,7 +1178,7 @@ msgid "" "isoformat`." msgstr "" -#: library/datetime.rst:762 +#: library/datetime.rst:781 msgid "" "Same as :meth:`.date.strftime`. This makes it possible to specify a format " "string for a :class:`.date` object in :ref:`formatted string literals >> import time\n" ">>> from datetime import date\n" @@ -1186,11 +1214,11 @@ msgid "" "202" msgstr "" -#: library/datetime.rst:789 +#: library/datetime.rst:808 msgid "More examples of working with :class:`date`:" msgstr "" -#: library/datetime.rst:791 +#: library/datetime.rst:810 msgid "" ">>> from datetime import date\n" ">>> d = date.fromordinal(730920) # 730920th day after 1. 1. 0001\n" @@ -1234,17 +1262,17 @@ msgid "" "datetime.date(2005, 3, 11)" msgstr "" -#: library/datetime.rst:838 +#: library/datetime.rst:857 msgid ":class:`.datetime` Objects" msgstr "" -#: library/datetime.rst:840 +#: library/datetime.rst:859 msgid "" "A :class:`.datetime` object is a single object containing all the " "information from a :class:`date` object and a :class:`.time` object." msgstr "" -#: library/datetime.rst:843 +#: library/datetime.rst:862 msgid "" "Like a :class:`date` object, :class:`.datetime` assumes the current " "Gregorian calendar extended in both directions; like a :class:`.time` " @@ -1252,80 +1280,80 @@ msgid "" "every day." msgstr "" -#: library/datetime.rst:847 +#: library/datetime.rst:866 msgid "Constructor:" msgstr "" -#: library/datetime.rst:851 +#: library/datetime.rst:870 msgid "" "The *year*, *month* and *day* arguments are required. *tzinfo* may be " "``None``, or an instance of a :class:`tzinfo` subclass. The remaining " "arguments must be integers in the following ranges:" msgstr "" -#: library/datetime.rst:855 +#: library/datetime.rst:874 msgid "``MINYEAR <= year <= MAXYEAR``," msgstr "" -#: library/datetime.rst:856 +#: library/datetime.rst:875 msgid "``1 <= month <= 12``," msgstr "" -#: library/datetime.rst:857 +#: library/datetime.rst:876 msgid "``1 <= day <= number of days in the given month and year``," msgstr "" -#: library/datetime.rst:1711 +#: library/datetime.rst:1755 msgid "``0 <= hour < 24``," msgstr "" -#: library/datetime.rst:1712 +#: library/datetime.rst:1756 msgid "``0 <= minute < 60``," msgstr "" -#: library/datetime.rst:1713 +#: library/datetime.rst:1757 msgid "``0 <= second < 60``," msgstr "" -#: library/datetime.rst:1714 +#: library/datetime.rst:1758 msgid "``0 <= microsecond < 1000000``," msgstr "" -#: library/datetime.rst:1715 +#: library/datetime.rst:1759 msgid "``fold in [0, 1]``." msgstr "" -#: library/datetime.rst:1282 library/datetime.rst:1857 +#: library/datetime.rst:1326 library/datetime.rst:1904 msgid "Added the *fold* parameter." msgstr "" -#: library/datetime.rst:873 +#: library/datetime.rst:892 msgid "Return the current local date and time, with :attr:`.tzinfo` ``None``." msgstr "" -#: library/datetime.rst:875 +#: library/datetime.rst:894 msgid "Equivalent to::" msgstr "" -#: library/datetime.rst:877 +#: library/datetime.rst:896 msgid "datetime.fromtimestamp(time.time())" msgstr "" -#: library/datetime.rst:879 +#: library/datetime.rst:898 msgid "See also :meth:`now`, :meth:`fromtimestamp`." msgstr "" -#: library/datetime.rst:881 +#: library/datetime.rst:900 msgid "" "This method is functionally equivalent to :meth:`now`, but without a ``tz`` " "parameter." msgstr "" -#: library/datetime.rst:886 +#: library/datetime.rst:905 msgid "Return the current local date and time." msgstr "" -#: library/datetime.rst:888 +#: library/datetime.rst:907 msgid "" "If optional argument *tz* is ``None`` or not specified, this is like :meth:" "`today`, but, if possible, supplies more precision than can be gotten from " @@ -1333,34 +1361,34 @@ msgid "" "possible on platforms supplying the C :c:func:`gettimeofday` function)." msgstr "" -#: library/datetime.rst:894 +#: library/datetime.rst:913 msgid "" "If *tz* is not ``None``, it must be an instance of a :class:`tzinfo` " "subclass, and the current date and time are converted to *tz*’s time zone." msgstr "" -#: library/datetime.rst:897 +#: library/datetime.rst:916 msgid "This function is preferred over :meth:`today` and :meth:`utcnow`." msgstr "" -#: library/datetime.rst:901 +#: library/datetime.rst:920 msgid "" "Subsequent calls to :meth:`!datetime.now` may return the same instant " "depending on the precision of the underlying clock." msgstr "" -#: library/datetime.rst:906 +#: library/datetime.rst:925 msgid "Return the current UTC date and time, with :attr:`.tzinfo` ``None``." msgstr "" -#: library/datetime.rst:908 +#: library/datetime.rst:927 msgid "" "This is like :meth:`now`, but returns the current UTC date and time, as a " "naive :class:`.datetime` object. An aware current UTC datetime can be " "obtained by calling ``datetime.now(timezone.utc)``. See also :meth:`now`." msgstr "" -#: library/datetime.rst:914 +#: library/datetime.rst:933 msgid "" "Because naive ``datetime`` objects are treated by many ``datetime`` methods " "as local times, it is preferred to use aware datetimes to represent times in " @@ -1368,11 +1396,11 @@ msgid "" "current time in UTC is by calling ``datetime.now(timezone.utc)``." msgstr "" -#: library/datetime.rst:921 +#: library/datetime.rst:940 msgid "Use :meth:`datetime.now` with :const:`UTC` instead." msgstr "" -#: library/datetime.rst:926 +#: library/datetime.rst:945 msgid "" "Return the local date and time corresponding to the POSIX timestamp, such as " "is returned by :func:`time.time`. If optional argument *tz* is ``None`` or " @@ -1380,13 +1408,13 @@ msgid "" "time, and the returned :class:`.datetime` object is naive." msgstr "" -#: library/datetime.rst:931 +#: library/datetime.rst:950 msgid "" "If *tz* is not ``None``, it must be an instance of a :class:`tzinfo` " "subclass, and the timestamp is converted to *tz*’s time zone." msgstr "" -#: library/datetime.rst:934 +#: library/datetime.rst:953 msgid "" ":meth:`fromtimestamp` may raise :exc:`OverflowError`, if the timestamp is " "out of the range of values supported by the platform C :c:func:`localtime` " @@ -1399,7 +1427,7 @@ msgid "" "preferred over :meth:`utcfromtimestamp`." msgstr "" -#: library/datetime.rst:945 +#: library/datetime.rst:964 msgid "" "Raise :exc:`OverflowError` instead of :exc:`ValueError` if the timestamp is " "out of the range of values supported by the platform C :c:func:`localtime` " @@ -1407,17 +1435,17 @@ msgid "" "`ValueError` on :c:func:`localtime` or :c:func:`gmtime` failure." msgstr "" -#: library/datetime.rst:952 +#: library/datetime.rst:971 msgid ":meth:`fromtimestamp` may return instances with :attr:`.fold` set to 1." msgstr "" -#: library/datetime.rst:957 +#: library/datetime.rst:976 msgid "" "Return the UTC :class:`.datetime` corresponding to the POSIX timestamp, " "with :attr:`.tzinfo` ``None``. (The resulting object is naive.)" msgstr "" -#: library/datetime.rst:960 +#: library/datetime.rst:979 msgid "" "This may raise :exc:`OverflowError`, if the timestamp is out of the range of " "values supported by the platform C :c:func:`gmtime` function, and :exc:" @@ -1425,32 +1453,32 @@ msgid "" "to years in 1970 through 2038." msgstr "" -#: library/datetime.rst:965 +#: library/datetime.rst:984 msgid "To get an aware :class:`.datetime` object, call :meth:`fromtimestamp`::" msgstr "" -#: library/datetime.rst:967 +#: library/datetime.rst:986 msgid "datetime.fromtimestamp(timestamp, timezone.utc)" msgstr "" -#: library/datetime.rst:969 +#: library/datetime.rst:988 msgid "" "On the POSIX compliant platforms, it is equivalent to the following " "expression::" msgstr "" -#: library/datetime.rst:972 +#: library/datetime.rst:991 msgid "" "datetime(1970, 1, 1, tzinfo=timezone.utc) + timedelta(seconds=timestamp)" msgstr "" -#: library/datetime.rst:974 +#: library/datetime.rst:993 msgid "" "except the latter formula always supports the full years range: between :" "const:`MINYEAR` and :const:`MAXYEAR` inclusive." msgstr "" -#: library/datetime.rst:979 +#: library/datetime.rst:998 msgid "" "Because naive ``datetime`` objects are treated by many ``datetime`` methods " "as local times, it is preferred to use aware datetimes to represent times in " @@ -1459,7 +1487,7 @@ msgid "" "tz=timezone.utc)``." msgstr "" -#: library/datetime.rst:985 +#: library/datetime.rst:1004 msgid "" "Raise :exc:`OverflowError` instead of :exc:`ValueError` if the timestamp is " "out of the range of values supported by the platform C :c:func:`gmtime` " @@ -1467,11 +1495,11 @@ msgid "" "`gmtime` failure." msgstr "" -#: library/datetime.rst:993 +#: library/datetime.rst:1012 msgid "Use :meth:`datetime.fromtimestamp` with :const:`UTC` instead." msgstr "" -#: library/datetime.rst:998 +#: library/datetime.rst:1017 msgid "" "Return the :class:`.datetime` corresponding to the proleptic Gregorian " "ordinal, where January 1 of year 1 has ordinal 1. :exc:`ValueError` is " @@ -1480,7 +1508,7 @@ msgid "" "is ``None``." msgstr "" -#: library/datetime.rst:1006 +#: library/datetime.rst:1025 msgid "" "Return a new :class:`.datetime` object whose date components are equal to " "the given :class:`date` object's, and whose time components are equal to the " @@ -1491,35 +1519,35 @@ msgid "" "attr:`.tzinfo` attributes are ignored." msgstr "" -#: library/datetime.rst:1014 +#: library/datetime.rst:1033 msgid "" "For any :class:`.datetime` object ``d``, ``d == datetime.combine(d.date(), d." "time(), d.tzinfo)``." msgstr "" -#: library/datetime.rst:1017 +#: library/datetime.rst:1036 msgid "Added the *tzinfo* argument." msgstr "" -#: library/datetime.rst:1023 +#: library/datetime.rst:1042 msgid "" "Return a :class:`.datetime` corresponding to a *date_string* in any valid " "ISO 8601 format, with the following exceptions:" msgstr "" -#: library/datetime.rst:1811 +#: library/datetime.rst:1855 msgid "Time zone offsets may have fractional seconds." msgstr "" -#: library/datetime.rst:1027 +#: library/datetime.rst:1046 msgid "The ``T`` separator may be replaced by any single unicode character." msgstr "" -#: library/datetime.rst:1816 +#: library/datetime.rst:1860 msgid "Fractional hours and minutes are not supported." msgstr "" -#: library/datetime.rst:1037 +#: library/datetime.rst:1056 msgid "" ">>> from datetime import datetime\n" ">>> datetime.fromisoformat('2011-11-04')\n" @@ -1544,13 +1572,13 @@ msgid "" " tzinfo=datetime.timezone(datetime.timedelta(seconds=14400)))" msgstr "" -#: library/datetime.rst:1059 +#: library/datetime.rst:1078 msgid "" "Previously, this method only supported formats that could be emitted by :" "meth:`date.isoformat` or :meth:`datetime.isoformat`." msgstr "" -#: library/datetime.rst:1066 +#: library/datetime.rst:1085 msgid "" "Return a :class:`.datetime` corresponding to the ISO calendar date specified " "by year, week and day. The non-date components of the datetime are populated " @@ -1558,23 +1586,23 @@ msgid "" "`datetime.isocalendar`." msgstr "" -#: library/datetime.rst:1075 +#: library/datetime.rst:1094 msgid "" "Return a :class:`.datetime` corresponding to *date_string*, parsed according " "to *format*." msgstr "" -#: library/datetime.rst:1078 +#: library/datetime.rst:1097 msgid "" "If *format* does not contain microseconds or time zone information, this is " "equivalent to::" msgstr "" -#: library/datetime.rst:2550 +#: library/datetime.rst:2580 msgid "datetime(*(time.strptime(date_string, format)[0:6]))" msgstr "" -#: library/datetime.rst:1082 +#: library/datetime.rst:1101 msgid "" ":exc:`ValueError` is raised if the date_string and format can't be parsed " "by :func:`time.strptime` or if it returns a value which isn't a time tuple. " @@ -1582,43 +1610,64 @@ msgid "" "fromisoformat`." msgstr "" -#: library/datetime.rst:1093 +#: library/datetime.rst:1108 +msgid "" +"If *format* specifies a day of month without a year a :exc:" +"`DeprecationWarning` is now emitted. This is to avoid a quadrennial leap " +"year bug in code seeking to parse only a month and day as the default year " +"used in absence of one in the format is not a leap year. Such *format* " +"values may raise an error as of Python 3.15. The workaround is to always " +"include a year in your *format*. If parsing *date_string* values that do " +"not have a year, explicitly add a year that is a leap year before parsing:" +msgstr "" + +#: library/datetime.rst:1117 +msgid "" +">>> from datetime import datetime\n" +">>> date_string = \"02/29\"\n" +">>> when = datetime.strptime(f\"{date_string};1984\", \"%m/%d;%Y\") # " +"Avoids leap year bug.\n" +">>> when.strftime(\"%B %d\")\n" +"'February 29'" +msgstr "" + +#: library/datetime.rst:1130 msgid "" "The earliest representable :class:`.datetime`, ``datetime(MINYEAR, 1, 1, " "tzinfo=None)``." msgstr "" -#: library/datetime.rst:1099 +#: library/datetime.rst:1136 msgid "" "The latest representable :class:`.datetime`, ``datetime(MAXYEAR, 12, 31, 23, " "59, 59, 999999, tzinfo=None)``." msgstr "" -#: library/datetime.rst:1105 +#: library/datetime.rst:1142 msgid "" "The smallest possible difference between non-equal :class:`.datetime` " "objects, ``timedelta(microseconds=1)``." msgstr "" -#: library/datetime.rst:1744 +#: library/datetime.rst:1788 msgid "In ``range(24)``." msgstr "" -#: library/datetime.rst:1138 library/datetime.rst:1754 +#: library/datetime.rst:1175 library/datetime.rst:1798 msgid "In ``range(60)``." msgstr "" -#: library/datetime.rst:1759 +#: library/datetime.rst:1803 msgid "In ``range(1000000)``." msgstr "" -#: library/datetime.rst:1148 +#: library/datetime.rst:1185 msgid "" "The object passed as the *tzinfo* argument to the :class:`.datetime` " "constructor, or ``None`` if none was passed." msgstr "" -#: library/datetime.rst:1770 +#: library/datetime.rst:1814 msgid "" "In ``[0, 1]``. Used to disambiguate wall times during a repeated interval. " "(A repeated interval occurs when clocks are rolled back at the end of " @@ -1628,24 +1677,24 @@ msgid "" "time representation." msgstr "" -#: library/datetime.rst:1167 +#: library/datetime.rst:1204 msgid "``datetime2 = datetime1 + timedelta``" msgstr "" -#: library/datetime.rst:2380 library/datetime.rst:2397 -#: library/datetime.rst:2462 library/datetime.rst:2471 +#: library/datetime.rst:2427 library/datetime.rst:2444 +#: library/datetime.rst:2509 library/datetime.rst:2518 msgid "\\(1)" msgstr "" -#: library/datetime.rst:1169 +#: library/datetime.rst:1206 msgid "``datetime2 = datetime1 - timedelta``" msgstr "" -#: library/datetime.rst:2413 +#: library/datetime.rst:2460 msgid "\\(2)" msgstr "" -#: library/datetime.rst:1171 +#: library/datetime.rst:1208 msgid "``timedelta = datetime1 - datetime2``" msgstr "" @@ -1673,7 +1722,7 @@ msgstr "" msgid "``datetime1 >= datetime2``" msgstr "" -#: library/datetime.rst:1183 +#: library/datetime.rst:1220 msgid "" "``datetime2`` is a duration of ``timedelta`` removed from ``datetime1``, " "moving forward in time if ``timedelta.days > 0``, or backward if ``timedelta." @@ -1684,7 +1733,7 @@ msgid "" "adjustments are done even if the input is an aware object." msgstr "" -#: library/datetime.rst:1192 +#: library/datetime.rst:1229 msgid "" "Computes the ``datetime2`` such that ``datetime2 + timedelta == datetime1``. " "As for addition, the result has the same :attr:`~.datetime.tzinfo` attribute " @@ -1692,14 +1741,14 @@ msgid "" "input is aware." msgstr "" -#: library/datetime.rst:1197 +#: library/datetime.rst:1234 msgid "" "Subtraction of a :class:`.datetime` from a :class:`.datetime` is defined " "only if both operands are naive, or if both are aware. If one is aware and " "the other is naive, :exc:`TypeError` is raised." msgstr "" -#: library/datetime.rst:1201 +#: library/datetime.rst:1238 msgid "" "If both are naive, or both are aware and have the same :attr:`~.datetime." "tzinfo` attribute, the :attr:`~.datetime.tzinfo` attributes are ignored, and " @@ -1707,7 +1756,7 @@ msgid "" "datetime1``. No time zone adjustments are done in this case." msgstr "" -#: library/datetime.rst:1206 +#: library/datetime.rst:1243 msgid "" "If both are aware and have different :attr:`~.datetime.tzinfo` attributes, " "``a-b`` acts as if ``a`` and ``b`` were first converted to naive UTC " @@ -1716,20 +1765,17 @@ msgid "" "overflows." msgstr "" -#: library/datetime.rst:1212 +#: library/datetime.rst:1249 msgid "" ":class:`.datetime` objects are equal if they represent the same date and " "time, taking into account the time zone." msgstr "" -#: library/datetime.rst:1215 -msgid "" -"Naive and aware :class:`!datetime` objects are never equal. :class:`!" -"datetime` objects are never equal to :class:`date` objects that are not " -"also :class:`!datetime` instances, even if they represent the same date." +#: library/datetime.rst:1252 +msgid "Naive and aware :class:`!datetime` objects are never equal." msgstr "" -#: library/datetime.rst:1220 +#: library/datetime.rst:1254 msgid "" "If both comparands are aware, and have the same :attr:`!tzinfo` attribute, " "the :attr:`!tzinfo` and :attr:`~.datetime.fold` attributes are ignored and " @@ -1740,20 +1786,19 @@ msgid "" "interval are never equal to :class:`!datetime` instances in other time zone." msgstr "" -#: library/datetime.rst:1230 +#: library/datetime.rst:1264 msgid "" "*datetime1* is considered less than *datetime2* when *datetime1* precedes " "*datetime2* in time, taking into account the time zone." msgstr "" -#: library/datetime.rst:1233 +#: library/datetime.rst:1267 msgid "" -"Order comparison between naive and aware :class:`.datetime` objects, as well " -"as a :class:`!datetime` object and a :class:`!date` object that is not also " -"a :class:`!datetime` instance, raises :exc:`TypeError`." +"Order comparison between naive and aware :class:`.datetime` objects raises :" +"exc:`TypeError`." msgstr "" -#: library/datetime.rst:1237 +#: library/datetime.rst:1270 msgid "" "If both comparands are aware, and have the same :attr:`!tzinfo` attribute, " "the :attr:`!tzinfo` and :attr:`~.datetime.fold` attributes are ignored and " @@ -1763,33 +1808,33 @@ msgid "" "implementation never overflows." msgstr "" -#: library/datetime.rst:1244 +#: library/datetime.rst:1277 msgid "" "Equality comparisons between aware and naive :class:`.datetime` instances " "don't raise :exc:`TypeError`." msgstr "" -#: library/datetime.rst:1252 +#: library/datetime.rst:1293 msgid "Return :class:`date` object with same year, month and day." msgstr "" -#: library/datetime.rst:1257 +#: library/datetime.rst:1298 msgid "" "Return :class:`.time` object with same hour, minute, second, microsecond and " "fold. :attr:`.tzinfo` is ``None``. See also method :meth:`timetz`." msgstr "" -#: library/datetime.rst:1269 +#: library/datetime.rst:1310 msgid "The fold value is copied to the returned :class:`.time` object." msgstr "" -#: library/datetime.rst:1266 +#: library/datetime.rst:1307 msgid "" "Return :class:`.time` object with same hour, minute, second, microsecond, " "fold, and tzinfo attributes. See also method :meth:`time`." msgstr "" -#: library/datetime.rst:1277 +#: library/datetime.rst:1318 msgid "" "Return a new :class:`datetime` object with the same attributes, but with " "specified parameters updated. Note that ``tzinfo=None`` can be specified to " @@ -1797,21 +1842,27 @@ msgid "" "and time data." msgstr "" -#: library/datetime.rst:1288 +#: library/datetime.rst:1323 +msgid "" +":class:`.datetime` objects are also supported by generic function :func:" +"`copy.replace`." +msgstr "" + +#: library/datetime.rst:1332 msgid "" "Return a :class:`.datetime` object with new :attr:`.tzinfo` attribute *tz*, " "adjusting the date and time data so the result is the same UTC time as " "*self*, but in *tz*'s local time." msgstr "" -#: library/datetime.rst:1292 +#: library/datetime.rst:1336 msgid "" "If provided, *tz* must be an instance of a :class:`tzinfo` subclass, and " "its :meth:`utcoffset` and :meth:`dst` methods must not return ``None``. If " "*self* is naive, it is presumed to represent time in the system time zone." msgstr "" -#: library/datetime.rst:1296 +#: library/datetime.rst:1340 msgid "" "If called without arguments (or with ``tz=None``) the system local time zone " "is assumed for the target time zone. The ``.tzinfo`` attribute of the " @@ -1819,7 +1870,7 @@ msgid "" "with the zone name and offset obtained from the OS." msgstr "" -#: library/datetime.rst:1301 +#: library/datetime.rst:1345 msgid "" "If ``self.tzinfo`` is *tz*, ``self.astimezone(tz)`` is equal to *self*: no " "adjustment of date or time data is performed. Else the result is local time " @@ -1828,7 +1879,7 @@ msgid "" "date and time data as ``dt - dt.utcoffset()``." msgstr "" -#: library/datetime.rst:1307 +#: library/datetime.rst:1351 msgid "" "If you merely want to attach a :class:`timezone` object *tz* to a datetime " "*dt* without adjustment of date and time data, use ``dt." @@ -1837,14 +1888,14 @@ msgid "" "use ``dt.replace(tzinfo=None)``." msgstr "" -#: library/datetime.rst:1312 +#: library/datetime.rst:1356 msgid "" "Note that the default :meth:`tzinfo.fromutc` method can be overridden in a :" "class:`tzinfo` subclass to affect the result returned by :meth:`astimezone`. " "Ignoring error cases, :meth:`astimezone` acts like::" msgstr "" -#: library/datetime.rst:1316 +#: library/datetime.rst:1360 msgid "" "def astimezone(self, tz):\n" " if self.tzinfo is tz:\n" @@ -1855,54 +1906,54 @@ msgid "" " return tz.fromutc(utc)" msgstr "" -#: library/datetime.rst:1324 +#: library/datetime.rst:1368 msgid "*tz* now can be omitted." msgstr "" -#: library/datetime.rst:1327 +#: library/datetime.rst:1371 msgid "" "The :meth:`astimezone` method can now be called on naive instances that are " "presumed to represent system local time." msgstr "" -#: library/datetime.rst:1334 +#: library/datetime.rst:1378 msgid "" "If :attr:`.tzinfo` is ``None``, returns ``None``, else returns ``self.tzinfo." "utcoffset(self)``, and raises an exception if the latter doesn't return " "``None`` or a :class:`timedelta` object with magnitude less than one day." msgstr "" -#: library/datetime.rst:1930 library/datetime.rst:2282 -#: library/datetime.rst:2623 +#: library/datetime.rst:1977 library/datetime.rst:2329 +#: library/datetime.rst:2653 msgid "The UTC offset is not restricted to a whole number of minutes." msgstr "" -#: library/datetime.rst:1344 +#: library/datetime.rst:1388 msgid "" "If :attr:`.tzinfo` is ``None``, returns ``None``, else returns ``self.tzinfo." "dst(self)``, and raises an exception if the latter doesn't return ``None`` " "or a :class:`timedelta` object with magnitude less than one day." msgstr "" -#: library/datetime.rst:1940 library/datetime.rst:2091 +#: library/datetime.rst:1987 library/datetime.rst:2138 msgid "The DST offset is not restricted to a whole number of minutes." msgstr "" -#: library/datetime.rst:1354 +#: library/datetime.rst:1398 msgid "" "If :attr:`.tzinfo` is ``None``, returns ``None``, else returns ``self.tzinfo." "tzname(self)``, raises an exception if the latter doesn't return ``None`` or " "a string object," msgstr "" -#: library/datetime.rst:1365 +#: library/datetime.rst:1409 msgid "" "time.struct_time((d.year, d.month, d.day,\n" " d.hour, d.minute, d.second,\n" " d.weekday(), yday, dst))" msgstr "" -#: library/datetime.rst:1369 +#: library/datetime.rst:1413 msgid "" "where ``yday = d.toordinal() - date(d.year, 1, 1).toordinal() + 1`` is the " "day number within the current year starting with 1 for January 1st. The :" @@ -1913,7 +1964,7 @@ msgid "" "to 0." msgstr "" -#: library/datetime.rst:1380 +#: library/datetime.rst:1424 msgid "" "If :class:`.datetime` instance ``d`` is naive, this is the same as ``d." "timetuple()`` except that :attr:`~.time.struct_time.tm_isdst` is forced to 0 " @@ -1921,7 +1972,7 @@ msgid "" "time." msgstr "" -#: library/datetime.rst:1384 +#: library/datetime.rst:1428 msgid "" "If ``d`` is aware, ``d`` is normalized to UTC time, by subtracting ``d." "utcoffset()``, and a :class:`time.struct_time` for the normalized time is " @@ -1930,7 +1981,7 @@ msgid "" "and UTC adjustment spills over a year boundary." msgstr "" -#: library/datetime.rst:1393 +#: library/datetime.rst:1437 msgid "" "Because naive ``datetime`` objects are treated by many ``datetime`` methods " "as local times, it is preferred to use aware datetimes to represent times in " @@ -1940,20 +1991,20 @@ msgid "" "meth:`.datetime.timetuple`." msgstr "" -#: library/datetime.rst:1402 +#: library/datetime.rst:1446 msgid "" "Return the proleptic Gregorian ordinal of the date. The same as ``self." "date().toordinal()``." msgstr "" -#: library/datetime.rst:1407 +#: library/datetime.rst:1451 msgid "" "Return POSIX timestamp corresponding to the :class:`.datetime` instance. The " "return value is a :class:`float` similar to that returned by :func:`time." "time`." msgstr "" -#: library/datetime.rst:1411 +#: library/datetime.rst:1455 msgid "" "Naive :class:`.datetime` instances are assumed to represent local time and " "this method relies on the platform C :c:func:`mktime` function to perform " @@ -1963,22 +2014,22 @@ msgid "" "future." msgstr "" -#: library/datetime.rst:1418 +#: library/datetime.rst:1462 msgid "" "For aware :class:`.datetime` instances, the return value is computed as::" msgstr "" -#: library/datetime.rst:1421 +#: library/datetime.rst:1465 msgid "(dt - datetime(1970, 1, 1, tzinfo=timezone.utc)).total_seconds()" msgstr "" -#: library/datetime.rst:1425 +#: library/datetime.rst:1469 msgid "" "The :meth:`timestamp` method uses the :attr:`.fold` attribute to " "disambiguate the times during a repeated interval." msgstr "" -#: library/datetime.rst:1431 +#: library/datetime.rst:1475 msgid "" "There is no method to obtain the POSIX timestamp directly from a naive :" "class:`.datetime` instance representing UTC time. If your application uses " @@ -1986,67 +2037,67 @@ msgid "" "the POSIX timestamp by supplying ``tzinfo=timezone.utc``::" msgstr "" -#: library/datetime.rst:1437 +#: library/datetime.rst:1481 msgid "timestamp = dt.replace(tzinfo=timezone.utc).timestamp()" msgstr "" -#: library/datetime.rst:1439 +#: library/datetime.rst:1483 msgid "or by calculating the timestamp directly::" msgstr "" -#: library/datetime.rst:1441 +#: library/datetime.rst:1485 msgid "timestamp = (dt - datetime(1970, 1, 1)) / timedelta(seconds=1)" msgstr "" -#: library/datetime.rst:1445 +#: library/datetime.rst:1489 msgid "" "Return the day of the week as an integer, where Monday is 0 and Sunday is 6. " "The same as ``self.date().weekday()``. See also :meth:`isoweekday`." msgstr "" -#: library/datetime.rst:1451 +#: library/datetime.rst:1495 msgid "" "Return the day of the week as an integer, where Monday is 1 and Sunday is 7. " "The same as ``self.date().isoweekday()``. See also :meth:`weekday`, :meth:" "`isocalendar`." msgstr "" -#: library/datetime.rst:1458 +#: library/datetime.rst:1502 msgid "" "Return a :term:`named tuple` with three components: ``year``, ``week`` and " "``weekday``. The same as ``self.date().isocalendar()``." msgstr "" -#: library/datetime.rst:1464 +#: library/datetime.rst:1508 msgid "Return a string representing the date and time in ISO 8601 format:" msgstr "" -#: library/datetime.rst:1466 +#: library/datetime.rst:1510 msgid "``YYYY-MM-DDTHH:MM:SS.ffffff``, if :attr:`microsecond` is not 0" msgstr "" -#: library/datetime.rst:1467 +#: library/datetime.rst:1511 msgid "``YYYY-MM-DDTHH:MM:SS``, if :attr:`microsecond` is 0" msgstr "" -#: library/datetime.rst:1469 +#: library/datetime.rst:1513 msgid "" "If :meth:`utcoffset` does not return ``None``, a string is appended, giving " "the UTC offset:" msgstr "" -#: library/datetime.rst:1472 +#: library/datetime.rst:1516 msgid "" "``YYYY-MM-DDTHH:MM:SS.ffffff+HH:MM[:SS[.ffffff]]``, if :attr:`microsecond` " "is not 0" msgstr "" -#: library/datetime.rst:1474 +#: library/datetime.rst:1518 msgid "" "``YYYY-MM-DDTHH:MM:SS+HH:MM[:SS[.ffffff]]``, if :attr:`microsecond` is 0" msgstr "" -#: library/datetime.rst:1478 +#: library/datetime.rst:1522 msgid "" ">>> from datetime import datetime, timezone\n" ">>> datetime(2019, 5, 18, 15, 17, 8, 132263).isoformat()\n" @@ -2055,13 +2106,13 @@ msgid "" "'2019-05-18T15:17:00+00:00'" msgstr "" -#: library/datetime.rst:1484 +#: library/datetime.rst:1528 msgid "" "The optional argument *sep* (default ``'T'``) is a one-character separator, " "placed between the date and time portions of the result. For example::" msgstr "" -#: library/datetime.rst:1487 +#: library/datetime.rst:1531 msgid "" ">>> from datetime import tzinfo, timedelta, datetime\n" ">>> class TZ(tzinfo):\n" @@ -2075,53 +2126,53 @@ msgid "" "'2009-11-27T00:00:00.000100-06:39'" msgstr "" -#: library/datetime.rst:1870 +#: library/datetime.rst:1917 msgid "" "The optional argument *timespec* specifies the number of additional " "components of the time to include (the default is ``'auto'``). It can be one " "of the following:" msgstr "" -#: library/datetime.rst:1874 +#: library/datetime.rst:1921 msgid "" "``'auto'``: Same as ``'seconds'`` if :attr:`microsecond` is 0, same as " "``'microseconds'`` otherwise." msgstr "" -#: library/datetime.rst:1876 +#: library/datetime.rst:1923 msgid "``'hours'``: Include the :attr:`hour` in the two-digit ``HH`` format." msgstr "" -#: library/datetime.rst:1877 +#: library/datetime.rst:1924 msgid "" "``'minutes'``: Include :attr:`hour` and :attr:`minute` in ``HH:MM`` format." msgstr "" -#: library/datetime.rst:1878 +#: library/datetime.rst:1925 msgid "" "``'seconds'``: Include :attr:`hour`, :attr:`minute`, and :attr:`second` in " "``HH:MM:SS`` format." msgstr "" -#: library/datetime.rst:1880 +#: library/datetime.rst:1927 msgid "" "``'milliseconds'``: Include full time, but truncate fractional second part " "to milliseconds. ``HH:MM:SS.sss`` format." msgstr "" -#: library/datetime.rst:1882 +#: library/datetime.rst:1929 msgid "``'microseconds'``: Include full time in ``HH:MM:SS.ffffff`` format." msgstr "" -#: library/datetime.rst:1886 +#: library/datetime.rst:1933 msgid "Excluded time components are truncated, not rounded." msgstr "" -#: library/datetime.rst:1516 +#: library/datetime.rst:1560 msgid ":exc:`ValueError` will be raised on an invalid *timespec* argument::" msgstr "" -#: library/datetime.rst:1519 +#: library/datetime.rst:1563 msgid "" ">>> from datetime import datetime\n" ">>> datetime.now().isoformat(timespec='minutes')\n" @@ -2131,48 +2182,48 @@ msgid "" "'2015-01-01T12:30:59.000000'" msgstr "" -#: library/datetime.rst:1901 +#: library/datetime.rst:1948 msgid "Added the *timespec* parameter." msgstr "" -#: library/datetime.rst:1532 +#: library/datetime.rst:1576 msgid "" "For a :class:`.datetime` instance ``d``, ``str(d)`` is equivalent to ``d." "isoformat(' ')``." msgstr "" -#: library/datetime.rst:1538 +#: library/datetime.rst:1582 msgid "Return a string representing the date and time::" msgstr "" -#: library/datetime.rst:1540 +#: library/datetime.rst:1584 msgid "" ">>> from datetime import datetime\n" ">>> datetime(2002, 12, 4, 20, 30, 40).ctime()\n" "'Wed Dec 4 20:30:40 2002'" msgstr "" -#: library/datetime.rst:1544 +#: library/datetime.rst:1588 msgid "" "The output string will *not* include time zone information, regardless of " "whether the input is aware or naive." msgstr "" -#: library/datetime.rst:1551 +#: library/datetime.rst:1595 msgid "" "on platforms where the native C :c:func:`ctime` function (which :func:`time." "ctime` invokes, but which :meth:`datetime.ctime` does not invoke) conforms " "to the C standard." msgstr "" -#: library/datetime.rst:1558 +#: library/datetime.rst:1602 msgid "" "Return a string representing the date and time, controlled by an explicit " "format string. See also :ref:`strftime-strptime-behavior` and :meth:" "`datetime.isoformat`." msgstr "" -#: library/datetime.rst:1565 +#: library/datetime.rst:1609 msgid "" "Same as :meth:`.datetime.strftime`. This makes it possible to specify a " "format string for a :class:`.datetime` object in :ref:`formatted string " @@ -2180,15 +2231,15 @@ msgid "" "`strftime-strptime-behavior` and :meth:`datetime.isoformat`." msgstr "" -#: library/datetime.rst:1572 +#: library/datetime.rst:1616 msgid "Examples of Usage: :class:`.datetime`" msgstr "" -#: library/datetime.rst:1574 +#: library/datetime.rst:1618 msgid "Examples of working with :class:`.datetime` objects:" msgstr "" -#: library/datetime.rst:1576 +#: library/datetime.rst:1620 msgid "" ">>> from datetime import datetime, date, time, timezone\n" "\n" @@ -2242,14 +2293,14 @@ msgid "" "'The day is 21, the month is November, the time is 04:30PM.'" msgstr "" -#: library/datetime.rst:1627 +#: library/datetime.rst:1671 msgid "" "The example below defines a :class:`tzinfo` subclass capturing time zone " "information for Kabul, Afghanistan, which used +4 UTC until 1945 and then " "+4:30 UTC thereafter::" msgstr "" -#: library/datetime.rst:1631 +#: library/datetime.rst:1675 msgid "" "from datetime import timedelta, datetime, tzinfo, timezone\n" "\n" @@ -2296,11 +2347,11 @@ msgid "" " return \"+04\"" msgstr "" -#: library/datetime.rst:1674 +#: library/datetime.rst:1718 msgid "Usage of ``KabulTz`` from above::" msgstr "" -#: library/datetime.rst:1676 +#: library/datetime.rst:1720 msgid "" ">>> tz1 = KabulTz()\n" "\n" @@ -2324,63 +2375,63 @@ msgid "" "True" msgstr "" -#: library/datetime.rst:1700 +#: library/datetime.rst:1744 msgid ":class:`.time` Objects" msgstr "" -#: library/datetime.rst:1702 +#: library/datetime.rst:1746 msgid "" "A :class:`.time` object represents a (local) time of day, independent of any " "particular day, and subject to adjustment via a :class:`tzinfo` object." msgstr "" -#: library/datetime.rst:1707 +#: library/datetime.rst:1751 msgid "" "All arguments are optional. *tzinfo* may be ``None``, or an instance of a :" "class:`tzinfo` subclass. The remaining arguments must be integers in the " "following ranges:" msgstr "" -#: library/datetime.rst:1717 +#: library/datetime.rst:1761 msgid "" "If an argument outside those ranges is given, :exc:`ValueError` is raised. " "All default to 0 except *tzinfo*, which defaults to ``None``." msgstr "" -#: library/datetime.rst:1725 +#: library/datetime.rst:1769 msgid "The earliest representable :class:`.time`, ``time(0, 0, 0, 0)``." msgstr "" -#: library/datetime.rst:1730 +#: library/datetime.rst:1774 msgid "The latest representable :class:`.time`, ``time(23, 59, 59, 999999)``." msgstr "" -#: library/datetime.rst:1735 +#: library/datetime.rst:1779 msgid "" "The smallest possible difference between non-equal :class:`.time` objects, " "``timedelta(microseconds=1)``, although note that arithmetic on :class:`." "time` objects is not supported." msgstr "" -#: library/datetime.rst:1764 +#: library/datetime.rst:1808 msgid "" "The object passed as the tzinfo argument to the :class:`.time` constructor, " "or ``None`` if none was passed." msgstr "" -#: library/datetime.rst:1778 +#: library/datetime.rst:1822 msgid "" ":class:`.time` objects support equality and order comparisons, where ``a`` " "is considered less than ``b`` when ``a`` precedes ``b`` in time." msgstr "" -#: library/datetime.rst:1781 +#: library/datetime.rst:1825 msgid "" "Naive and aware :class:`!time` objects are never equal. Order comparison " "between naive and aware :class:`!time` objects raises :exc:`TypeError`." msgstr "" -#: library/datetime.rst:1785 +#: library/datetime.rst:1829 msgid "" "If both comparands are aware, and have the same :attr:`~.time.tzinfo` " "attribute, the :attr:`!tzinfo` and :attr:`!fold` attributes are ignored and " @@ -2389,18 +2440,18 @@ msgid "" "subtracting their UTC offsets (obtained from ``self.utcoffset()``)." msgstr "" -#: library/datetime.rst:1791 +#: library/datetime.rst:1835 msgid "" "Equality comparisons between aware and naive :class:`.time` instances don't " "raise :exc:`TypeError`." msgstr "" -#: library/datetime.rst:1795 +#: library/datetime.rst:1839 msgid "" "In Boolean contexts, a :class:`.time` object is always considered to be true." msgstr "" -#: library/datetime.rst:1797 +#: library/datetime.rst:1841 msgid "" "Before Python 3.5, a :class:`.time` object was considered to be false if it " "represented midnight in UTC. This behavior was considered obscure and error-" @@ -2408,33 +2459,33 @@ msgid "" "details." msgstr "" -#: library/datetime.rst:1804 +#: library/datetime.rst:1848 msgid "Other constructor:" msgstr "" -#: library/datetime.rst:1808 +#: library/datetime.rst:1852 msgid "" "Return a :class:`.time` corresponding to a *time_string* in any valid ISO " "8601 format, with the following exceptions:" msgstr "" -#: library/datetime.rst:1812 +#: library/datetime.rst:1856 msgid "" "The leading ``T``, normally required in cases where there may be ambiguity " "between a date and a time, is not required." msgstr "" -#: library/datetime.rst:1814 +#: library/datetime.rst:1858 msgid "" "Fractional seconds may have any number of digits (anything beyond 6 will be " "truncated)." msgstr "" -#: library/datetime.rst:1818 +#: library/datetime.rst:1862 msgid "Examples:" msgstr "" -#: library/datetime.rst:1820 +#: library/datetime.rst:1864 msgid "" ">>> from datetime import time\n" ">>> time.fromisoformat('04:23:01')\n" @@ -2456,13 +2507,13 @@ msgid "" "datetime.time(4, 23, 1, tzinfo=datetime.timezone.utc)" msgstr "" -#: library/datetime.rst:1842 +#: library/datetime.rst:1886 msgid "" "Previously, this method only supported formats that could be emitted by :" "meth:`time.isoformat`." msgstr "" -#: library/datetime.rst:1852 +#: library/datetime.rst:1896 msgid "" "Return a new :class:`.time` with the same values, but with specified " "parameters updated. Note that ``tzinfo=None`` can be specified to create a " @@ -2470,35 +2521,41 @@ msgid "" "time data." msgstr "" -#: library/datetime.rst:1863 +#: library/datetime.rst:1901 +msgid "" +":class:`.time` objects are also supported by generic function :func:`copy." +"replace`." +msgstr "" + +#: library/datetime.rst:1910 msgid "Return a string representing the time in ISO 8601 format, one of:" msgstr "" -#: library/datetime.rst:1865 +#: library/datetime.rst:1912 msgid "``HH:MM:SS.ffffff``, if :attr:`microsecond` is not 0" msgstr "" -#: library/datetime.rst:1866 +#: library/datetime.rst:1913 msgid "``HH:MM:SS``, if :attr:`microsecond` is 0" msgstr "" -#: library/datetime.rst:1867 +#: library/datetime.rst:1914 msgid "" "``HH:MM:SS.ffffff+HH:MM[:SS[.ffffff]]``, if :meth:`utcoffset` does not " "return ``None``" msgstr "" -#: library/datetime.rst:1868 +#: library/datetime.rst:1915 msgid "" "``HH:MM:SS+HH:MM[:SS[.ffffff]]``, if :attr:`microsecond` is 0 and :meth:" "`utcoffset` does not return ``None``" msgstr "" -#: library/datetime.rst:1888 +#: library/datetime.rst:1935 msgid ":exc:`ValueError` will be raised on an invalid *timespec* argument." msgstr "" -#: library/datetime.rst:1892 +#: library/datetime.rst:1939 msgid "" ">>> from datetime import time\n" ">>> time(hour=12, minute=34, second=56, microsecond=123456)." @@ -2511,18 +2568,18 @@ msgid "" "'12:34:56'" msgstr "" -#: library/datetime.rst:1907 +#: library/datetime.rst:1954 msgid "For a time ``t``, ``str(t)`` is equivalent to ``t.isoformat()``." msgstr "" -#: library/datetime.rst:1912 +#: library/datetime.rst:1959 msgid "" "Return a string representing the time, controlled by an explicit format " "string. See also :ref:`strftime-strptime-behavior` and :meth:`time." "isoformat`." msgstr "" -#: library/datetime.rst:1918 +#: library/datetime.rst:1965 msgid "" "Same as :meth:`.time.strftime`. This makes it possible to specify a format " "string for a :class:`.time` object in :ref:`formatted string literals >> from datetime import time, tzinfo, timedelta\n" ">>> class TZ1(tzinfo):\n" @@ -2587,18 +2644,18 @@ msgid "" "'The time is 12:10.'" msgstr "" -#: library/datetime.rst:1983 +#: library/datetime.rst:2030 msgid ":class:`tzinfo` Objects" msgstr "" -#: library/datetime.rst:1987 +#: library/datetime.rst:2034 msgid "" "This is an abstract base class, meaning that this class should not be " "instantiated directly. Define a subclass of :class:`tzinfo` to capture " "information about a particular time zone." msgstr "" -#: library/datetime.rst:1991 +#: library/datetime.rst:2038 msgid "" "An instance of (a concrete subclass of) :class:`tzinfo` can be passed to the " "constructors for :class:`.datetime` and :class:`.time` objects. The latter " @@ -2608,7 +2665,7 @@ msgid "" "object passed to them." msgstr "" -#: library/datetime.rst:1997 +#: library/datetime.rst:2044 msgid "" "You need to derive a concrete subclass, and (at least) supply " "implementations of the standard :class:`tzinfo` methods needed by the :class:" @@ -2618,7 +2675,7 @@ msgid "" "American EST and EDT." msgstr "" -#: library/datetime.rst:2004 +#: library/datetime.rst:2051 msgid "" "Special requirement for pickling: A :class:`tzinfo` subclass must have an :" "meth:`~object.__init__` method that can be called with no arguments, " @@ -2626,20 +2683,20 @@ msgid "" "technical requirement that may be relaxed in the future." msgstr "" -#: library/datetime.rst:2010 +#: library/datetime.rst:2057 msgid "" "A concrete subclass of :class:`tzinfo` may need to implement the following " "methods. Exactly which methods are needed depends on the uses made of aware :" "mod:`!datetime` objects. If in doubt, simply implement all of them." msgstr "" -#: library/datetime.rst:2017 +#: library/datetime.rst:2064 msgid "" "Return offset of local time from UTC, as a :class:`timedelta` object that is " "positive east of UTC. If local time is west of UTC, this should be negative." msgstr "" -#: library/datetime.rst:2020 +#: library/datetime.rst:2067 msgid "" "This represents the *total* offset from UTC; for example, if a :class:" "`tzinfo` object represents both time zone and DST adjustments, :meth:" @@ -2650,31 +2707,31 @@ msgid "" "meth:`utcoffset` will probably look like one of these two::" msgstr "" -#: library/datetime.rst:2028 +#: library/datetime.rst:2075 msgid "" "return CONSTANT # fixed-offset class\n" "return CONSTANT + self.dst(dt) # daylight-aware class" msgstr "" -#: library/datetime.rst:2031 +#: library/datetime.rst:2078 msgid "" "If :meth:`utcoffset` does not return ``None``, :meth:`dst` should not return " "``None`` either." msgstr "" -#: library/datetime.rst:2034 +#: library/datetime.rst:2081 msgid "" "The default implementation of :meth:`utcoffset` raises :exc:" "`NotImplementedError`." msgstr "" -#: library/datetime.rst:2043 +#: library/datetime.rst:2090 msgid "" "Return the daylight saving time (DST) adjustment, as a :class:`timedelta` " "object or ``None`` if DST information isn't known." msgstr "" -#: library/datetime.rst:2047 +#: library/datetime.rst:2094 msgid "" "Return ``timedelta(0)`` if DST is not in effect. If DST is in effect, return " "the offset as a :class:`timedelta` object (see :meth:`utcoffset` for " @@ -2687,17 +2744,17 @@ msgid "" "to account for DST changes when crossing time zones." msgstr "" -#: library/datetime.rst:2057 +#: library/datetime.rst:2104 msgid "" "An instance *tz* of a :class:`tzinfo` subclass that models both standard and " "daylight times must be consistent in this sense:" msgstr "" -#: library/datetime.rst:2060 +#: library/datetime.rst:2107 msgid "``tz.utcoffset(dt) - tz.dst(dt)``" msgstr "" -#: library/datetime.rst:2062 +#: library/datetime.rst:2109 msgid "" "must return the same result for every :class:`.datetime` *dt* with ``dt." "tzinfo == tz``. For sane :class:`tzinfo` subclasses, this expression yields " @@ -2710,24 +2767,24 @@ msgid "" "astimezone` regardless." msgstr "" -#: library/datetime.rst:2071 +#: library/datetime.rst:2118 msgid "" "Most implementations of :meth:`dst` will probably look like one of these " "two::" msgstr "" -#: library/datetime.rst:2073 +#: library/datetime.rst:2120 msgid "" "def dst(self, dt):\n" " # a fixed-offset class: doesn't account for DST\n" " return timedelta(0)" msgstr "" -#: library/datetime.rst:2077 +#: library/datetime.rst:2124 msgid "or::" msgstr "" -#: library/datetime.rst:2079 +#: library/datetime.rst:2126 msgid "" "def dst(self, dt):\n" " # Code to set dston and dstoff to the time zone's DST\n" @@ -2740,12 +2797,12 @@ msgid "" " return timedelta(0)" msgstr "" -#: library/datetime.rst:2089 +#: library/datetime.rst:2136 msgid "" "The default implementation of :meth:`dst` raises :exc:`NotImplementedError`." msgstr "" -#: library/datetime.rst:2097 +#: library/datetime.rst:2144 msgid "" "Return the time zone name corresponding to the :class:`.datetime` object " "*dt*, as a string. Nothing about string names is defined by the :mod:`!" @@ -2759,13 +2816,13 @@ msgid "" "accounting for daylight time." msgstr "" -#: library/datetime.rst:2107 +#: library/datetime.rst:2154 msgid "" "The default implementation of :meth:`tzname` raises :exc:" "`NotImplementedError`." msgstr "" -#: library/datetime.rst:2110 +#: library/datetime.rst:2157 msgid "" "These methods are called by a :class:`.datetime` or :class:`.time` object, " "in response to their methods of the same names. A :class:`.datetime` object " @@ -2775,7 +2832,7 @@ msgid "" "datetime`." msgstr "" -#: library/datetime.rst:2116 +#: library/datetime.rst:2163 msgid "" "When ``None`` is passed, it's up to the class designer to decide the best " "response. For example, returning ``None`` is appropriate if the class wishes " @@ -2784,7 +2841,7 @@ msgid "" "offset, as there is no other convention for discovering the standard offset." msgstr "" -#: library/datetime.rst:2122 +#: library/datetime.rst:2169 msgid "" "When a :class:`.datetime` object is passed in response to a :class:`." "datetime` method, ``dt.tzinfo`` is the same object as *self*. :class:" @@ -2794,13 +2851,13 @@ msgid "" "zones." msgstr "" -#: library/datetime.rst:2128 +#: library/datetime.rst:2175 msgid "" "There is one more :class:`tzinfo` method that a subclass may wish to " "override:" msgstr "" -#: library/datetime.rst:2133 +#: library/datetime.rst:2180 msgid "" "This is called from the default :meth:`datetime.astimezone` implementation. " "When called from that, ``dt.tzinfo`` is *self*, and *dt*'s date and time " @@ -2809,7 +2866,7 @@ msgid "" "datetime in *self*'s local time." msgstr "" -#: library/datetime.rst:2139 +#: library/datetime.rst:2186 msgid "" "Most :class:`tzinfo` subclasses should be able to inherit the default :meth:" "`fromutc` implementation without problems. It's strong enough to handle " @@ -2824,13 +2881,13 @@ msgid "" "offset changes." msgstr "" -#: library/datetime.rst:2150 +#: library/datetime.rst:2197 msgid "" "Skipping code for error cases, the default :meth:`fromutc` implementation " "acts like::" msgstr "" -#: library/datetime.rst:2153 +#: library/datetime.rst:2200 msgid "" "def fromutc(self, dt):\n" " # raise ValueError error if dt.tzinfo is not self\n" @@ -2848,13 +2905,13 @@ msgid "" " return dt" msgstr "" -#: library/datetime.rst:2168 +#: library/datetime.rst:2215 msgid "" "In the following :download:`tzinfo_examples.py <../includes/tzinfo_examples." "py>` file there are some examples of :class:`tzinfo` classes:" msgstr "" -#: library/datetime.rst:2172 +#: library/datetime.rst:2219 msgid "" "from datetime import tzinfo, timedelta, datetime\n" "\n" @@ -3034,7 +3091,7 @@ msgid "" "Pacific = USTimeZone(-8, \"Pacific\", \"PST\", \"PDT\")\n" msgstr "" -#: library/datetime.rst:2174 +#: library/datetime.rst:2221 msgid "" "Note that there are unavoidable subtleties twice per year in a :class:" "`tzinfo` subclass accounting for both standard and daylight time, at the DST " @@ -3043,7 +3100,7 @@ msgid "" "ends the minute after 1:59 (EDT) on the first Sunday in November::" msgstr "" -#: library/datetime.rst:2180 +#: library/datetime.rst:2227 msgid "" " UTC 3:MM 4:MM 5:MM 6:MM 7:MM 8:MM\n" " EST 22:MM 23:MM 0:MM 1:MM 2:MM 3:MM\n" @@ -3054,7 +3111,7 @@ msgid "" " end 23:MM 0:MM 1:MM 1:MM 2:MM 3:MM" msgstr "" -#: library/datetime.rst:2188 +#: library/datetime.rst:2235 msgid "" "When DST starts (the \"start\" line), the local wall clock leaps from 1:59 " "to 3:00. A wall time of the form 2:MM doesn't really make sense on that day, " @@ -3063,7 +3120,7 @@ msgid "" "get::" msgstr "" -#: library/datetime.rst:2193 +#: library/datetime.rst:2240 msgid "" ">>> from datetime import datetime, timezone\n" ">>> from tzinfo_examples import HOUR, Eastern\n" @@ -3079,7 +3136,7 @@ msgid "" "08:00:00 UTC = 04:00:00 EDT" msgstr "" -#: library/datetime.rst:2207 +#: library/datetime.rst:2254 msgid "" "When DST ends (the \"end\" line), there's a potentially worse problem: " "there's an hour that can't be spelled unambiguously in local wall time: the " @@ -3094,7 +3151,7 @@ msgid "" "Fall back transition of 2016, we get::" msgstr "" -#: library/datetime.rst:2218 +#: library/datetime.rst:2265 msgid "" ">>> u0 = datetime(2016, 11, 6, 4, tzinfo=timezone.utc)\n" ">>> for i in range(4):\n" @@ -3108,13 +3165,13 @@ msgid "" "07:00:00 UTC = 02:00:00 EST 0" msgstr "" -#: library/datetime.rst:2229 +#: library/datetime.rst:2276 msgid "" "Note that the :class:`.datetime` instances that differ only by the value of " "the :attr:`~.datetime.fold` attribute are considered equal in comparisons." msgstr "" -#: library/datetime.rst:2232 +#: library/datetime.rst:2279 msgid "" "Applications that can't bear wall-time ambiguities should explicitly check " "the value of the :attr:`~.datetime.fold` attribute or avoid using hybrid :" @@ -3124,28 +3181,28 @@ msgid "" "offset -4 hours))." msgstr "" -#: library/datetime.rst:2240 +#: library/datetime.rst:2287 msgid ":mod:`zoneinfo`" msgstr "" -#: library/datetime.rst:2241 +#: library/datetime.rst:2288 msgid "" "The :mod:`!datetime` module has a basic :class:`timezone` class (for " "handling arbitrary fixed offsets from UTC) and its :attr:`timezone.utc` " "attribute (a UTC :class:`!timezone` instance)." msgstr "" -#: library/datetime.rst:2245 +#: library/datetime.rst:2292 msgid "" "``zoneinfo`` brings the *IANA time zone database* (also known as the Olson " "database) to Python, and its usage is recommended." msgstr "" -#: library/datetime.rst:2248 +#: library/datetime.rst:2295 msgid "`IANA time zone database `_" msgstr "" -#: library/datetime.rst:2249 +#: library/datetime.rst:2296 msgid "" "The Time Zone Database (often called tz, tzdata or zoneinfo) contains code " "and data that represent the history of local time for many representative " @@ -3154,24 +3211,24 @@ msgid "" "saving rules." msgstr "" -#: library/datetime.rst:2259 +#: library/datetime.rst:2306 msgid ":class:`timezone` Objects" msgstr "" -#: library/datetime.rst:2261 +#: library/datetime.rst:2308 msgid "" "The :class:`timezone` class is a subclass of :class:`tzinfo`, each instance " "of which represents a time zone defined by a fixed offset from UTC." msgstr "" -#: library/datetime.rst:2265 +#: library/datetime.rst:2312 msgid "" "Objects of this class cannot be used to represent time zone information in " "the locations where different offsets are used in different days of the year " "or where historical changes have been made to civil time." msgstr "" -#: library/datetime.rst:2272 +#: library/datetime.rst:2319 msgid "" "The *offset* argument must be specified as a :class:`timedelta` object " "representing the difference between the local time and UTC. It must be " @@ -3179,25 +3236,25 @@ msgid "" "otherwise :exc:`ValueError` is raised." msgstr "" -#: library/datetime.rst:2277 +#: library/datetime.rst:2324 msgid "" "The *name* argument is optional. If specified it must be a string that will " "be used as the value returned by the :meth:`datetime.tzname` method." msgstr "" -#: library/datetime.rst:2299 +#: library/datetime.rst:2346 msgid "" "Return the fixed value specified when the :class:`timezone` instance is " "constructed." msgstr "" -#: library/datetime.rst:2291 +#: library/datetime.rst:2338 msgid "" "The *dt* argument is ignored. The return value is a :class:`timedelta` " "instance equal to the difference between the local time and UTC." msgstr "" -#: library/datetime.rst:2302 +#: library/datetime.rst:2349 msgid "" "If *name* is not provided in the constructor, the name returned by " "``tzname(dt)`` is generated from the value of the ``offset`` as follows. If " @@ -3206,119 +3263,119 @@ msgid "" "are two digits of ``offset.hours`` and ``offset.minutes`` respectively." msgstr "" -#: library/datetime.rst:2308 +#: library/datetime.rst:2355 msgid "" "Name generated from ``offset=timedelta(0)`` is now plain ``'UTC'``, not " "``'UTC+00:00'``." msgstr "" -#: library/datetime.rst:2315 +#: library/datetime.rst:2362 msgid "Always returns ``None``." msgstr "" -#: library/datetime.rst:2319 +#: library/datetime.rst:2366 msgid "" "Return ``dt + offset``. The *dt* argument must be an aware :class:`." "datetime` instance, with ``tzinfo`` set to ``self``." msgstr "" -#: library/datetime.rst:2326 +#: library/datetime.rst:2373 msgid "The UTC time zone, ``timezone(timedelta(0))``." msgstr "" -#: library/datetime.rst:2335 +#: library/datetime.rst:2382 msgid ":meth:`~.datetime.strftime` and :meth:`~.datetime.strptime` Behavior" msgstr "" -#: library/datetime.rst:2337 +#: library/datetime.rst:2384 msgid "" ":class:`date`, :class:`.datetime`, and :class:`.time` objects all support a " "``strftime(format)`` method, to create a string representing the time under " "the control of an explicit format string." msgstr "" -#: library/datetime.rst:2341 +#: library/datetime.rst:2388 msgid "" "Conversely, the :meth:`datetime.strptime` class method creates a :class:`." "datetime` object from a string representing a date and time and a " "corresponding format string." msgstr "" -#: library/datetime.rst:2345 +#: library/datetime.rst:2392 msgid "" "The table below provides a high-level comparison of :meth:`~.datetime." "strftime` versus :meth:`~.datetime.strptime`:" msgstr "" -#: library/datetime.rst:2349 +#: library/datetime.rst:2396 msgid "``strftime``" msgstr "" -#: library/datetime.rst:2349 +#: library/datetime.rst:2396 msgid "``strptime``" msgstr "" -#: library/datetime.rst:2351 +#: library/datetime.rst:2398 msgid "Usage" msgstr "" -#: library/datetime.rst:2351 +#: library/datetime.rst:2398 msgid "Convert object to a string according to a given format" msgstr "" -#: library/datetime.rst:2351 +#: library/datetime.rst:2398 msgid "" "Parse a string into a :class:`.datetime` object given a corresponding format" msgstr "" -#: library/datetime.rst:2353 +#: library/datetime.rst:2400 msgid "Type of method" msgstr "" -#: library/datetime.rst:2353 +#: library/datetime.rst:2400 msgid "Instance method" msgstr "" -#: library/datetime.rst:2353 +#: library/datetime.rst:2400 msgid "Class method" msgstr "" -#: library/datetime.rst:2355 +#: library/datetime.rst:2402 msgid "Method of" msgstr "" -#: library/datetime.rst:2355 +#: library/datetime.rst:2402 msgid ":class:`date`; :class:`.datetime`; :class:`.time`" msgstr "" -#: library/datetime.rst:2355 +#: library/datetime.rst:2402 msgid ":class:`.datetime`" msgstr "" -#: library/datetime.rst:2357 +#: library/datetime.rst:2404 msgid "Signature" msgstr "" -#: library/datetime.rst:2357 +#: library/datetime.rst:2404 msgid "``strftime(format)``" msgstr "" -#: library/datetime.rst:2357 +#: library/datetime.rst:2404 msgid "``strptime(date_string, format)``" msgstr "" -#: library/datetime.rst:2364 +#: library/datetime.rst:2411 msgid "" ":meth:`~.datetime.strftime` and :meth:`~.datetime.strptime` Format Codes" msgstr "" -#: library/datetime.rst:2366 +#: library/datetime.rst:2413 msgid "" "These methods accept format codes that can be used to parse and format " "dates::" msgstr "" -#: library/datetime.rst:2368 +#: library/datetime.rst:2415 msgid "" ">>> datetime.strptime('31/01/22 23:59:59.999999',\n" "... '%d/%m/%y %H:%M:%S.%f')\n" @@ -3327,33 +3384,33 @@ msgid "" "'Mon 31 Jan 2022, 11:59PM'" msgstr "" -#: library/datetime.rst:2374 +#: library/datetime.rst:2421 msgid "" "The following is a list of all the format codes that the 1989 C standard " "requires, and these work on all platforms with a standard C implementation." msgstr "" -#: library/datetime.rst:2481 +#: library/datetime.rst:2528 msgid "Directive" msgstr "" -#: library/datetime.rst:2481 +#: library/datetime.rst:2528 msgid "Meaning" msgstr "" -#: library/datetime.rst:2481 +#: library/datetime.rst:2528 msgid "Example" msgstr "" -#: library/datetime.rst:2481 +#: library/datetime.rst:2528 msgid "Notes" msgstr "" -#: library/datetime.rst:2380 +#: library/datetime.rst:2427 msgid "``%a``" msgstr "" -#: library/datetime.rst:2380 +#: library/datetime.rst:2427 msgid "Weekday as locale's abbreviated name." msgstr "" @@ -3365,11 +3422,11 @@ msgstr "" msgid "So, Mo, ..., Sa (de_DE)" msgstr "" -#: library/datetime.rst:2385 +#: library/datetime.rst:2432 msgid "``%A``" msgstr "" -#: library/datetime.rst:2385 +#: library/datetime.rst:2432 msgid "Weekday as locale's full name." msgstr "" @@ -3381,40 +3438,40 @@ msgstr "" msgid "Sonntag, Montag, ..., Samstag (de_DE)" msgstr "" -#: library/datetime.rst:2390 +#: library/datetime.rst:2437 msgid "``%w``" msgstr "" -#: library/datetime.rst:2390 +#: library/datetime.rst:2437 msgid "Weekday as a decimal number, where 0 is Sunday and 6 is Saturday." msgstr "" -#: library/datetime.rst:2390 +#: library/datetime.rst:2437 msgid "0, 1, ..., 6" msgstr "" -#: library/datetime.rst:2394 +#: library/datetime.rst:2441 msgid "``%d``" msgstr "" -#: library/datetime.rst:2394 +#: library/datetime.rst:2441 msgid "Day of the month as a zero-padded decimal number." msgstr "" -#: library/datetime.rst:2394 +#: library/datetime.rst:2441 msgid "01, 02, ..., 31" msgstr "" -#: library/datetime.rst:2407 library/datetime.rst:2416 -#: library/datetime.rst:2425 library/datetime.rst:2443 +#: library/datetime.rst:2454 library/datetime.rst:2463 +#: library/datetime.rst:2472 library/datetime.rst:2490 msgid "\\(9)" msgstr "" -#: library/datetime.rst:2397 +#: library/datetime.rst:2444 msgid "``%b``" msgstr "" -#: library/datetime.rst:2397 +#: library/datetime.rst:2444 msgid "Month as locale's abbreviated name." msgstr "" @@ -3426,11 +3483,11 @@ msgstr "" msgid "Jan, Feb, ..., Dez (de_DE)" msgstr "" -#: library/datetime.rst:2402 +#: library/datetime.rst:2449 msgid "``%B``" msgstr "" -#: library/datetime.rst:2402 +#: library/datetime.rst:2449 msgid "Month as locale's full name." msgstr "" @@ -3442,67 +3499,67 @@ msgstr "" msgid "Januar, Februar, ..., Dezember (de_DE)" msgstr "" -#: library/datetime.rst:2407 +#: library/datetime.rst:2454 msgid "``%m``" msgstr "" -#: library/datetime.rst:2407 +#: library/datetime.rst:2454 msgid "Month as a zero-padded decimal number." msgstr "" -#: library/datetime.rst:2419 +#: library/datetime.rst:2466 msgid "01, 02, ..., 12" msgstr "" -#: library/datetime.rst:2410 +#: library/datetime.rst:2457 msgid "``%y``" msgstr "" -#: library/datetime.rst:2410 +#: library/datetime.rst:2457 msgid "Year without century as a zero-padded decimal number." msgstr "" -#: library/datetime.rst:2410 +#: library/datetime.rst:2457 msgid "00, 01, ..., 99" msgstr "" -#: library/datetime.rst:2413 +#: library/datetime.rst:2460 msgid "``%Y``" msgstr "" -#: library/datetime.rst:2413 +#: library/datetime.rst:2460 msgid "Year with century as a decimal number." msgstr "" -#: library/datetime.rst:2483 +#: library/datetime.rst:2530 msgid "0001, 0002, ..., 2013, 2014, ..., 9998, 9999" msgstr "" -#: library/datetime.rst:2416 +#: library/datetime.rst:2463 msgid "``%H``" msgstr "" -#: library/datetime.rst:2416 +#: library/datetime.rst:2463 msgid "Hour (24-hour clock) as a zero-padded decimal number." msgstr "" -#: library/datetime.rst:2416 +#: library/datetime.rst:2463 msgid "00, 01, ..., 23" msgstr "" -#: library/datetime.rst:2419 +#: library/datetime.rst:2466 msgid "``%I``" msgstr "" -#: library/datetime.rst:2419 +#: library/datetime.rst:2466 msgid "Hour (12-hour clock) as a zero-padded decimal number." msgstr "" -#: library/datetime.rst:2422 +#: library/datetime.rst:2469 msgid "``%p``" msgstr "" -#: library/datetime.rst:2422 +#: library/datetime.rst:2469 msgid "Locale's equivalent of either AM or PM." msgstr "" @@ -3514,127 +3571,127 @@ msgstr "" msgid "am, pm (de_DE)" msgstr "" -#: library/datetime.rst:2422 +#: library/datetime.rst:2469 msgid "\\(1), \\(3)" msgstr "" -#: library/datetime.rst:2425 +#: library/datetime.rst:2472 msgid "``%M``" msgstr "" -#: library/datetime.rst:2425 +#: library/datetime.rst:2472 msgid "Minute as a zero-padded decimal number." msgstr "" -#: library/datetime.rst:2428 +#: library/datetime.rst:2475 msgid "00, 01, ..., 59" msgstr "" -#: library/datetime.rst:2428 +#: library/datetime.rst:2475 msgid "``%S``" msgstr "" -#: library/datetime.rst:2428 +#: library/datetime.rst:2475 msgid "Second as a zero-padded decimal number." msgstr "" -#: library/datetime.rst:2428 +#: library/datetime.rst:2475 msgid "\\(4), \\(9)" msgstr "" -#: library/datetime.rst:2431 +#: library/datetime.rst:2478 msgid "``%f``" msgstr "" -#: library/datetime.rst:2431 +#: library/datetime.rst:2478 msgid "Microsecond as a decimal number, zero-padded to 6 digits." msgstr "" -#: library/datetime.rst:2431 +#: library/datetime.rst:2478 msgid "000000, 000001, ..., 999999" msgstr "" -#: library/datetime.rst:2431 +#: library/datetime.rst:2478 msgid "\\(5)" msgstr "" -#: library/datetime.rst:2611 +#: library/datetime.rst:2641 msgid "``%z``" msgstr "" -#: library/datetime.rst:2435 +#: library/datetime.rst:2482 msgid "" "UTC offset in the form ``±HHMM[SS[.ffffff]]`` (empty string if the object is " "naive)." msgstr "" -#: library/datetime.rst:2435 +#: library/datetime.rst:2482 msgid "(empty), +0000, -0400, +1030, +063415, -030712.345216" msgstr "" -#: library/datetime.rst:2440 library/datetime.rst:2497 +#: library/datetime.rst:2487 library/datetime.rst:2544 msgid "\\(6)" msgstr "" -#: library/datetime.rst:2637 +#: library/datetime.rst:2667 msgid "``%Z``" msgstr "" -#: library/datetime.rst:2440 +#: library/datetime.rst:2487 msgid "Time zone name (empty string if the object is naive)." msgstr "" -#: library/datetime.rst:2440 +#: library/datetime.rst:2487 msgid "(empty), UTC, GMT" msgstr "" -#: library/datetime.rst:2443 +#: library/datetime.rst:2490 msgid "``%j``" msgstr "" -#: library/datetime.rst:2443 +#: library/datetime.rst:2490 msgid "Day of the year as a zero-padded decimal number." msgstr "" -#: library/datetime.rst:2443 +#: library/datetime.rst:2490 msgid "001, 002, ..., 366" msgstr "" -#: library/datetime.rst:2446 +#: library/datetime.rst:2493 msgid "``%U``" msgstr "" -#: library/datetime.rst:2446 +#: library/datetime.rst:2493 msgid "" "Week number of the year (Sunday as the first day of the week) as a zero-" "padded decimal number. All days in a new year preceding the first Sunday are " "considered to be in week 0." msgstr "" -#: library/datetime.rst:2454 +#: library/datetime.rst:2501 msgid "00, 01, ..., 53" msgstr "" -#: library/datetime.rst:2454 +#: library/datetime.rst:2501 msgid "\\(7), \\(9)" msgstr "" -#: library/datetime.rst:2454 +#: library/datetime.rst:2501 msgid "``%W``" msgstr "" -#: library/datetime.rst:2454 +#: library/datetime.rst:2501 msgid "" "Week number of the year (Monday as the first day of the week) as a zero-" "padded decimal number. All days in a new year preceding the first Monday are " "considered to be in week 0." msgstr "" -#: library/datetime.rst:2462 +#: library/datetime.rst:2509 msgid "``%c``" msgstr "" -#: library/datetime.rst:2462 +#: library/datetime.rst:2509 msgid "Locale's appropriate date and time representation." msgstr "" @@ -3646,11 +3703,11 @@ msgstr "" msgid "Di 16 Aug 21:30:00 1988 (de_DE)" msgstr "" -#: library/datetime.rst:2467 +#: library/datetime.rst:2514 msgid "``%x``" msgstr "" -#: library/datetime.rst:2467 +#: library/datetime.rst:2514 msgid "Locale's appropriate date representation." msgstr "" @@ -3666,11 +3723,11 @@ msgstr "" msgid "16.08.1988 (de_DE)" msgstr "" -#: library/datetime.rst:2471 +#: library/datetime.rst:2518 msgid "``%X``" msgstr "" -#: library/datetime.rst:2471 +#: library/datetime.rst:2518 msgid "Locale's appropriate time representation." msgstr "" @@ -3682,83 +3739,83 @@ msgstr "" msgid "21:30:00 (de_DE)" msgstr "" -#: library/datetime.rst:2474 +#: library/datetime.rst:2521 msgid "``%%``" msgstr "" -#: library/datetime.rst:2474 +#: library/datetime.rst:2521 msgid "A literal ``'%'`` character." msgstr "" -#: library/datetime.rst:2474 +#: library/datetime.rst:2521 msgid "%" msgstr "" -#: library/datetime.rst:2477 +#: library/datetime.rst:2524 msgid "" "Several additional directives not required by the C89 standard are included " "for convenience. These parameters all correspond to ISO 8601 date values." msgstr "" -#: library/datetime.rst:2483 +#: library/datetime.rst:2530 msgid "``%G``" msgstr "" -#: library/datetime.rst:2483 +#: library/datetime.rst:2530 msgid "" "ISO 8601 year with century representing the year that contains the greater " "part of the ISO week (``%V``)." msgstr "" -#: library/datetime.rst:2483 +#: library/datetime.rst:2530 msgid "\\(8)" msgstr "" -#: library/datetime.rst:2488 +#: library/datetime.rst:2535 msgid "``%u``" msgstr "" -#: library/datetime.rst:2488 +#: library/datetime.rst:2535 msgid "ISO 8601 weekday as a decimal number where 1 is Monday." msgstr "" -#: library/datetime.rst:2488 +#: library/datetime.rst:2535 msgid "1, 2, ..., 7" msgstr "" -#: library/datetime.rst:2491 +#: library/datetime.rst:2538 msgid "``%V``" msgstr "" -#: library/datetime.rst:2491 +#: library/datetime.rst:2538 msgid "" "ISO 8601 week as a decimal number with Monday as the first day of the week. " "Week 01 is the week containing Jan 4." msgstr "" -#: library/datetime.rst:2491 +#: library/datetime.rst:2538 msgid "01, 02, ..., 53" msgstr "" -#: library/datetime.rst:2491 +#: library/datetime.rst:2538 msgid "\\(8), \\(9)" msgstr "" -#: library/datetime.rst:2633 +#: library/datetime.rst:2663 msgid "``%:z``" msgstr "" -#: library/datetime.rst:2497 +#: library/datetime.rst:2544 msgid "" "UTC offset in the form ``±HH:MM[:SS[.ffffff]]`` (empty string if the object " "is naive)." msgstr "" -#: library/datetime.rst:2497 +#: library/datetime.rst:2544 msgid "(empty), +00:00, -04:00, +10:30, +06:34:15, -03:07:12.345216" msgstr "" -#: library/datetime.rst:2503 +#: library/datetime.rst:2550 msgid "" "These may not be available on all platforms when used with the :meth:`~." "datetime.strftime` method. The ISO 8601 year and ISO 8601 week directives " @@ -3767,7 +3824,7 @@ msgid "" "directives will raise a :exc:`ValueError`." msgstr "" -#: library/datetime.rst:2508 +#: library/datetime.rst:2555 msgid "" "The full set of format codes supported varies across platforms, because " "Python calls the platform C library's :c:func:`strftime` function, and " @@ -3777,78 +3834,58 @@ msgid "" "unsupported format specifiers." msgstr "" -#: library/datetime.rst:2514 +#: library/datetime.rst:2561 msgid "``%G``, ``%u`` and ``%V`` were added." msgstr "" -#: library/datetime.rst:2517 +#: library/datetime.rst:2564 msgid "``%:z`` was added." msgstr "" -#: library/datetime.rst:2521 +#: library/datetime.rst:2568 msgid "Technical Detail" msgstr "" -#: library/datetime.rst:2523 +#: library/datetime.rst:2570 msgid "" "Broadly speaking, ``d.strftime(fmt)`` acts like the :mod:`time` module's " "``time.strftime(fmt, d.timetuple())`` although not all objects support a :" "meth:`~date.timetuple` method." msgstr "" -#: library/datetime.rst:2527 +#: library/datetime.rst:2574 msgid "" "For the :meth:`.datetime.strptime` class method, the default value is " "``1900-01-01T00:00:00.000``: any components not specified in the format " -"string will be pulled from the default value." -msgstr "" - -#: library/datetime.rst:2532 -msgid "" -"When used to parse partial dates lacking a year, :meth:`~.datetime.strptime` " -"will raise when encountering February 29 because its default year of 1900 is " -"*not* a leap year. Always add a default leap year to partial date strings " -"before parsing." -msgstr "" - -#: library/datetime.rst:2537 -msgid "" -">>> from datetime import datetime\n" -">>> value = \"2/29\"\n" -">>> datetime.strptime(value, \"%m/%d\")\n" -"Traceback (most recent call last):\n" -"...\n" -"ValueError: day is out of range for month\n" -">>> datetime.strptime(f\"1904 {value}\", \"%Y %m/%d\")\n" -"datetime.datetime(1904, 2, 29, 0, 0)" +"string will be pulled from the default value. [#]_" msgstr "" -#: library/datetime.rst:2548 +#: library/datetime.rst:2578 msgid "Using ``datetime.strptime(date_string, format)`` is equivalent to::" msgstr "" -#: library/datetime.rst:2552 +#: library/datetime.rst:2582 msgid "" "except when the format includes sub-second components or time zone offset " "information, which are supported in ``datetime.strptime`` but are discarded " "by ``time.strptime``." msgstr "" -#: library/datetime.rst:2556 +#: library/datetime.rst:2586 msgid "" "For :class:`.time` objects, the format codes for year, month, and day should " "not be used, as :class:`!time` objects have no such values. If they're used " "anyway, 1900 is substituted for the year, and 1 for the month and day." msgstr "" -#: library/datetime.rst:2560 +#: library/datetime.rst:2590 msgid "" "For :class:`date` objects, the format codes for hours, minutes, seconds, and " "microseconds should not be used, as :class:`date` objects have no such " "values. If they're used anyway, 0 is substituted for them." msgstr "" -#: library/datetime.rst:2564 +#: library/datetime.rst:2594 msgid "" "For the same reason, handling of format strings containing Unicode code " "points that can't be represented in the charset of the current locale is " @@ -3857,7 +3894,7 @@ msgid "" "`UnicodeError` or return an empty string instead." msgstr "" -#: library/datetime.rst:2573 +#: library/datetime.rst:2603 msgid "" "Because the format depends on the current locale, care should be taken when " "making assumptions about the output value. Field orderings will vary (for " @@ -3865,38 +3902,38 @@ msgid "" "contain non-ASCII characters." msgstr "" -#: library/datetime.rst:2579 +#: library/datetime.rst:2609 msgid "" "The :meth:`~.datetime.strptime` method can parse years in the full [1, 9999] " "range, but years < 1000 must be zero-filled to 4-digit width." msgstr "" -#: library/datetime.rst:2582 +#: library/datetime.rst:2612 msgid "" "In previous versions, :meth:`~.datetime.strftime` method was restricted to " "years >= 1900." msgstr "" -#: library/datetime.rst:2586 +#: library/datetime.rst:2616 msgid "" "In version 3.2, :meth:`~.datetime.strftime` method was restricted to years " ">= 1000." msgstr "" -#: library/datetime.rst:2591 +#: library/datetime.rst:2621 msgid "" "When used with the :meth:`~.datetime.strptime` method, the ``%p`` directive " "only affects the output hour field if the ``%I`` directive is used to parse " "the hour." msgstr "" -#: library/datetime.rst:2595 +#: library/datetime.rst:2625 msgid "" "Unlike the :mod:`time` module, the :mod:`!datetime` module does not support " "leap seconds." msgstr "" -#: library/datetime.rst:2599 +#: library/datetime.rst:2629 msgid "" "When used with the :meth:`~.datetime.strptime` method, the ``%f`` directive " "accepts from one to six digits and zero pads on the right. ``%f`` is an " @@ -3904,17 +3941,17 @@ msgid "" "separately in datetime objects, and therefore always available)." msgstr "" -#: library/datetime.rst:2606 +#: library/datetime.rst:2636 msgid "" "For a naive object, the ``%z``, ``%:z`` and ``%Z`` format codes are replaced " "by empty strings." msgstr "" -#: library/datetime.rst:2609 +#: library/datetime.rst:2639 msgid "For an aware object:" msgstr "" -#: library/datetime.rst:2612 +#: library/datetime.rst:2642 msgid "" ":meth:`~.datetime.utcoffset` is transformed into a string of the form " "``±HHMM[SS[.ffffff]]``, where ``HH`` is a 2-digit string giving the number " @@ -3928,7 +3965,7 @@ msgid "" "replaced with the string ``'-0330'``." msgstr "" -#: library/datetime.rst:2626 +#: library/datetime.rst:2656 msgid "" "When the ``%z`` directive is provided to the :meth:`~.datetime.strptime` " "method, the UTC offsets can have a colon as a separator between hours, " @@ -3937,53 +3974,53 @@ msgid "" "``'+00:00'``." msgstr "" -#: library/datetime.rst:2634 +#: library/datetime.rst:2664 msgid "" "Behaves exactly as ``%z``, but has a colon separator added between hours, " "minutes and seconds." msgstr "" -#: library/datetime.rst:2638 +#: library/datetime.rst:2668 msgid "" "In :meth:`~.datetime.strftime`, ``%Z`` is replaced by an empty string if :" "meth:`~.datetime.tzname` returns ``None``; otherwise ``%Z`` is replaced by " "the returned value, which must be a string." msgstr "" -#: library/datetime.rst:2642 +#: library/datetime.rst:2672 msgid ":meth:`~.datetime.strptime` only accepts certain values for ``%Z``:" msgstr "" -#: library/datetime.rst:2644 +#: library/datetime.rst:2674 msgid "any value in ``time.tzname`` for your machine's locale" msgstr "" -#: library/datetime.rst:2645 +#: library/datetime.rst:2675 msgid "the hard-coded values ``UTC`` and ``GMT``" msgstr "" -#: library/datetime.rst:2647 +#: library/datetime.rst:2677 msgid "" "So someone living in Japan may have ``JST``, ``UTC``, and ``GMT`` as valid " "values, but probably not ``EST``. It will raise ``ValueError`` for invalid " "values." msgstr "" -#: library/datetime.rst:2651 +#: library/datetime.rst:2681 msgid "" "When the ``%z`` directive is provided to the :meth:`~.datetime.strptime` " "method, an aware :class:`.datetime` object will be produced. The ``tzinfo`` " "of the result will be set to a :class:`timezone` instance." msgstr "" -#: library/datetime.rst:2657 +#: library/datetime.rst:2687 msgid "" "When used with the :meth:`~.datetime.strptime` method, ``%U`` and ``%W`` are " "only used in calculations when the day of the week and the calendar year " "(``%Y``) are specified." msgstr "" -#: library/datetime.rst:2662 +#: library/datetime.rst:2692 msgid "" "Similar to ``%U`` and ``%W``, ``%V`` is only used in calculations when the " "day of the week and the ISO year (``%G``) are specified in a :meth:`~." @@ -3991,7 +4028,7 @@ msgid "" "interchangeable." msgstr "" -#: library/datetime.rst:2668 +#: library/datetime.rst:2698 msgid "" "When used with the :meth:`~.datetime.strptime` method, the leading zero is " "optional for formats ``%d``, ``%m``, ``%H``, ``%I``, ``%M``, ``%S``, " @@ -3999,22 +4036,40 @@ msgid "" "zero." msgstr "" -#: library/datetime.rst:2673 +#: library/datetime.rst:2703 +msgid "" +"When parsing a month and day using :meth:`~.datetime.strptime`, always " +"include a year in the format. If the value you need to parse lacks a year, " +"append an explicit dummy leap year. Otherwise your code will raise an " +"exception when it encounters leap day because the default year used by the " +"parser is not a leap year. Users run into this bug every four years..." +msgstr "" + +#: library/datetime.rst:2709 +msgid "" +">>> month_day = \"02/29\"\n" +">>> datetime.strptime(f\"{month_day};1984\", \"%m/%d;%Y\") # No leap year " +"bug.\n" +"datetime.datetime(1984, 2, 29, 0, 0)" +msgstr "" + +#: library/datetime.rst:2715 msgid "" -"Parsing dates without a year using :meth:`~.datetime.strptime` will fail on " -"representations of February 29 as that date does not exist in the default " -"year of 1900." +":meth:`~.datetime.strptime` calls using a format string containing a day of " +"month without a year now emit a :exc:`DeprecationWarning`. In 3.15 or later " +"we may change this into an error or change the default year to a leap year. " +"See :gh:`70647`." msgstr "" -#: library/datetime.rst:2678 +#: library/datetime.rst:2722 msgid "Footnotes" msgstr "" -#: library/datetime.rst:2679 +#: library/datetime.rst:2723 msgid "If, that is, we ignore the effects of Relativity" msgstr "" -#: library/datetime.rst:2681 +#: library/datetime.rst:2725 msgid "" "This matches the definition of the \"proleptic Gregorian\" calendar in " "Dershowitz and Reingold's book *Calendrical Calculations*, where it's the " @@ -4023,17 +4078,23 @@ msgid "" "systems." msgstr "" -#: library/datetime.rst:2687 +#: library/datetime.rst:2731 msgid "" "See R. H. van Gent's `guide to the mathematics of the ISO 8601 calendar " "`_ for a good explanation." msgstr "" -#: library/datetime.rst:2329 +#: library/datetime.rst:2735 +msgid "" +"Passing ``datetime.strptime('Feb 29', '%b %d')`` will fail since 1900 is not " +"a leap year." +msgstr "" + +#: library/datetime.rst:2376 msgid "% (percent)" msgstr "" -#: library/datetime.rst:2329 +#: library/datetime.rst:2376 msgid "datetime format" msgstr "" diff --git a/library/dbm.po b/library/dbm.po index 17b81237..6ebb4dee 100644 --- a/library/dbm.po +++ b/library/dbm.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -26,52 +26,66 @@ msgid "**Source code:** :source:`Lib/dbm/__init__.py`" msgstr "" #: library/dbm.rst:11 +msgid ":mod:`dbm` is a generic interface to variants of the DBM database:" +msgstr "" + +#: library/dbm.rst:13 +msgid ":mod:`dbm.sqlite3`" +msgstr "" + +#: library/dbm.rst:14 +msgid ":mod:`dbm.gnu`" +msgstr "" + +#: library/dbm.rst:15 +msgid ":mod:`dbm.ndbm`" +msgstr "" + +#: library/dbm.rst:17 msgid "" -":mod:`dbm` is a generic interface to variants of the DBM database --- :mod:" -"`dbm.gnu` or :mod:`dbm.ndbm`. If none of these modules is installed, the " -"slow-but-simple implementation in module :mod:`dbm.dumb` will be used. " -"There is a `third party interface `_ to the Oracle Berkeley DB." +"If none of these modules are installed, the slow-but-simple implementation " +"in module :mod:`dbm.dumb` will be used. There is a `third party interface " +"`_ to the Oracle Berkeley DB." msgstr "" -#: library/dbm.rst:20 +#: library/dbm.rst:24 msgid "" "A tuple containing the exceptions that can be raised by each of the " "supported modules, with a unique exception also named :exc:`dbm.error` as " "the first item --- the latter is used when :exc:`dbm.error` is raised." msgstr "" -#: library/dbm.rst:27 +#: library/dbm.rst:31 msgid "" "This function attempts to guess which of the several simple database modules " -"available --- :mod:`dbm.gnu`, :mod:`dbm.ndbm` or :mod:`dbm.dumb` --- should " -"be used to open a given file." +"available --- :mod:`dbm.sqlite3`, :mod:`dbm.gnu`, :mod:`dbm.ndbm`, or :mod:" +"`dbm.dumb` --- should be used to open a given file." msgstr "" -#: library/dbm.rst:31 +#: library/dbm.rst:35 msgid "Return one of the following values:" msgstr "" -#: library/dbm.rst:33 +#: library/dbm.rst:37 msgid "" "``None`` if the file can't be opened because it's unreadable or doesn't exist" msgstr "" -#: library/dbm.rst:34 +#: library/dbm.rst:38 msgid "the empty string (``''``) if the file's format can't be guessed" msgstr "" -#: library/dbm.rst:35 +#: library/dbm.rst:39 msgid "" "a string containing the required module name, such as ``'dbm.ndbm'`` or " "``'dbm.gnu'``" msgstr "" -#: library/dbm.rst:202 library/dbm.rst:386 +#: library/dbm.rst:250 library/dbm.rst:448 msgid "*filename* accepts a :term:`path-like object`." msgstr "" -#: library/dbm.rst:61 +#: library/dbm.rst:65 msgid "Open a database and return the corresponding database object." msgstr "" @@ -79,7 +93,7 @@ msgstr "" msgid "Parameters" msgstr "" -#: library/dbm.rst:63 +#: library/dbm.rst:67 msgid "" "The database file to open. If the database file already exists, the :func:" "`whichdb` function is used to determine its type and the appropriate module " @@ -87,48 +101,48 @@ msgid "" "imported is used." msgstr "" -#: library/dbm.rst:174 +#: library/dbm.rst:222 msgid "The database file to open." msgstr "" -#: library/dbm.rst:66 +#: library/dbm.rst:70 msgid "" "If the database file already exists, the :func:`whichdb` function is used to " "determine its type and the appropriate module is used; if it does not exist, " "the first submodule listed above that can be imported is used." msgstr "" -#: library/dbm.rst:297 +#: library/dbm.rst:178 library/dbm.rst:353 msgid "" "* ``'r'`` (default): |flag_r| * ``'w'``: |flag_w| * ``'c'``: |flag_c| * " "``'n'``: |flag_n|" msgstr "" -#: library/dbm.rst:179 library/dbm.rst:298 +#: library/dbm.rst:180 library/dbm.rst:354 msgid "``'r'`` (default): |flag_r|" msgstr "" -#: library/dbm.rst:180 library/dbm.rst:367 +#: library/dbm.rst:181 library/dbm.rst:355 library/dbm.rst:429 msgid "``'w'``: |flag_w|" msgstr "" -#: library/dbm.rst:181 library/dbm.rst:300 +#: library/dbm.rst:182 library/dbm.rst:356 msgid "``'c'``: |flag_c|" msgstr "" -#: library/dbm.rst:182 library/dbm.rst:369 +#: library/dbm.rst:183 library/dbm.rst:357 library/dbm.rst:431 msgid "``'n'``: |flag_n|" msgstr "" -#: library/dbm.rst:196 library/dbm.rst:371 +#: library/dbm.rst:244 library/dbm.rst:433 msgid "|mode_param_doc|" msgstr "" -#: library/dbm.rst:80 +#: library/dbm.rst:84 msgid "*file* accepts a :term:`path-like object`." msgstr "" -#: library/dbm.rst:83 +#: library/dbm.rst:87 msgid "" "The object returned by :func:`~dbm.open` supports the same basic " "functionality as a :class:`dict`; keys and their corresponding values can be " @@ -137,44 +151,44 @@ msgid "" "setdefault` methods." msgstr "" -#: library/dbm.rst:88 +#: library/dbm.rst:92 msgid "" "Key and values are always stored as :class:`bytes`. This means that when " "strings are used they are implicitly converted to the default encoding " "before being stored." msgstr "" -#: library/dbm.rst:92 +#: library/dbm.rst:96 msgid "" "These objects also support being used in a :keyword:`with` statement, which " "will automatically close them when done." msgstr "" -#: library/dbm.rst:95 +#: library/dbm.rst:99 msgid "" ":meth:`!get` and :meth:`!setdefault` methods are now available for all :mod:" "`dbm` backends." msgstr "" -#: library/dbm.rst:99 +#: library/dbm.rst:103 msgid "" "Added native support for the context management protocol to the objects " "returned by :func:`~dbm.open`." msgstr "" -#: library/dbm.rst:103 +#: library/dbm.rst:107 msgid "" "Deleting a key from a read-only database raises a database module specific " "exception instead of :exc:`KeyError`." msgstr "" -#: library/dbm.rst:107 +#: library/dbm.rst:111 msgid "" "The following example records some hostnames and a corresponding title, and " "then prints out the contents of the database::" msgstr "" -#: library/dbm.rst:110 +#: library/dbm.rst:114 msgid "" "import dbm\n" "\n" @@ -201,51 +215,100 @@ msgid "" "# db is automatically closed when leaving the with statement." msgstr "" -#: library/dbm.rst:137 +#: library/dbm.rst:141 msgid "Module :mod:`shelve`" msgstr "" -#: library/dbm.rst:138 +#: library/dbm.rst:142 msgid "Persistence module which stores non-string data." msgstr "" -#: library/dbm.rst:141 +#: library/dbm.rst:145 msgid "The individual submodules are described in the following sections." msgstr "" -#: library/dbm.rst:145 +#: library/dbm.rst:148 +msgid ":mod:`dbm.sqlite3` --- SQLite backend for dbm" +msgstr "" + +#: library/dbm.rst:156 +msgid "**Source code:** :source:`Lib/dbm/sqlite3.py`" +msgstr "" + +#: library/dbm.rst:160 +msgid "" +"This module uses the standard library :mod:`sqlite3` module to provide an " +"SQLite backend for the :mod:`dbm` module. The files created by :mod:`dbm." +"sqlite3` can thus be opened by :mod:`sqlite3`, or any other SQLite browser, " +"including the SQLite CLI." +msgstr "" + +#: includes/wasm-mobile-notavail.rst:3 includes/wasm-notavail.rst:3 +msgid "Availability" +msgstr "" + +#: includes/wasm-notavail.rst:5 +msgid "" +"This module does not work or is not available on WebAssembly. See :ref:`wasm-" +"availability` for more information." +msgstr "" + +#: library/dbm.rst:169 +msgid "" +"Open an SQLite database. The returned object behaves like a :term:`mapping`, " +"implements a :meth:`!close` method, and supports a \"closing\" context " +"manager via the :keyword:`with` keyword." +msgstr "" + +#: library/dbm.rst:174 +msgid "The path to the database to be opened." +msgstr "" + +#: library/dbm.rst:185 +msgid "" +"The Unix file access mode of the file (default: octal ``0o666``), used only " +"when the database has to be created." +msgstr "" + +#: library/dbm.rst:191 msgid ":mod:`dbm.gnu` --- GNU database manager" msgstr "" -#: library/dbm.rst:151 +#: library/dbm.rst:197 msgid "**Source code:** :source:`Lib/dbm/gnu.py`" msgstr "" -#: library/dbm.rst:155 +#: library/dbm.rst:201 msgid "" "The :mod:`dbm.gnu` module provides an interface to the :abbr:`GDBM (GNU " "dbm)` library, similar to the :mod:`dbm.ndbm` module, but with additional " "functionality like crash tolerance." msgstr "" -#: library/dbm.rst:267 +#: library/dbm.rst:321 msgid "" "The file formats created by :mod:`dbm.gnu` and :mod:`dbm.ndbm` are " "incompatible and can not be used interchangeably." msgstr "" -#: library/dbm.rst:166 +#: includes/wasm-mobile-notavail.rst:5 +msgid "" +"This module is not supported on :ref:`mobile platforms ` or :ref:`WebAssembly platforms `." +msgstr "" + +#: library/dbm.rst:214 msgid "" "Raised on :mod:`dbm.gnu`-specific errors, such as I/O errors. :exc:" "`KeyError` is raised for general mapping errors like specifying an incorrect " "key." msgstr "" -#: library/dbm.rst:172 +#: library/dbm.rst:220 msgid "Open a GDBM database and return a :class:`!gdbm` object." msgstr "" -#: library/dbm.rst:178 +#: library/dbm.rst:226 msgid "" "* ``'r'`` (default): |flag_r| * ``'w'``: |flag_w| * ``'c'``: |flag_c| * " "``'n'``: |flag_n| The following additional characters may be appended to " @@ -257,29 +320,29 @@ msgid "" "flag characters." msgstr "" -#: library/dbm.rst:184 +#: library/dbm.rst:232 msgid "" "The following additional characters may be appended to control how the " "database is opened:" msgstr "" -#: library/dbm.rst:187 +#: library/dbm.rst:235 msgid "" "``'f'``: Open the database in fast mode. Writes to the database will not be " "synchronized." msgstr "" -#: library/dbm.rst:189 +#: library/dbm.rst:237 msgid "" "``'s'``: Synchronized mode. Changes to the database will be written " "immediately to the file." msgstr "" -#: library/dbm.rst:191 +#: library/dbm.rst:239 msgid "``'u'``: Do not lock database." msgstr "" -#: library/dbm.rst:193 +#: library/dbm.rst:241 msgid "" "Not all flags are valid for all versions of GDBM. See the :data:`open_flags` " "member for a list of supported flag characters." @@ -289,24 +352,24 @@ msgstr "" msgid "Raises" msgstr "" -#: library/dbm.rst:199 +#: library/dbm.rst:247 msgid "If an invalid *flag* argument is passed." msgstr "" -#: library/dbm.rst:207 +#: library/dbm.rst:255 msgid "" "A string of characters the *flag* parameter of :meth:`~dbm.gnu.open` " "supports." msgstr "" -#: library/dbm.rst:209 +#: library/dbm.rst:257 msgid "" ":class:`!gdbm` objects behave similar to :term:`mappings `, but :" "meth:`!items` and :meth:`!values` methods are not supported. The following " "methods are also provided:" msgstr "" -#: library/dbm.rst:215 +#: library/dbm.rst:263 msgid "" "It's possible to loop over every key in the database using this method and " "the :meth:`nextkey` method. The traversal is ordered by GDBM's internal " @@ -314,14 +377,14 @@ msgid "" "starting key." msgstr "" -#: library/dbm.rst:222 +#: library/dbm.rst:270 msgid "" "Returns the key that follows *key* in the traversal. The following code " "prints every key in the database ``db``, without having to create a list in " "memory that contains them all::" msgstr "" -#: library/dbm.rst:226 +#: library/dbm.rst:274 msgid "" "k = db.firstkey()\n" "while k is not None:\n" @@ -329,7 +392,7 @@ msgid "" " k = db.nextkey(k)" msgstr "" -#: library/dbm.rst:233 +#: library/dbm.rst:281 msgid "" "If you have carried out a lot of deletions and would like to shrink the " "space used by the GDBM file, this routine will reorganize the database. :" @@ -338,32 +401,36 @@ msgid "" "reused as new (key, value) pairs are added." msgstr "" -#: library/dbm.rst:241 +#: library/dbm.rst:289 msgid "" "When the database has been opened in fast mode, this method forces any " "unwritten data to be written to the disk." msgstr "" -#: library/dbm.rst:246 +#: library/dbm.rst:294 msgid "Close the GDBM database." msgstr "" -#: library/dbm.rst:250 +#: library/dbm.rst:298 +msgid "Remove all items from the GDBM database." +msgstr "" + +#: library/dbm.rst:304 msgid ":mod:`dbm.ndbm` --- New Database Manager" msgstr "" -#: library/dbm.rst:256 +#: library/dbm.rst:310 msgid "**Source code:** :source:`Lib/dbm/ndbm.py`" msgstr "" -#: library/dbm.rst:260 +#: library/dbm.rst:314 msgid "" "The :mod:`dbm.ndbm` module provides an interface to the :abbr:`NDBM (New " "Database Manager)` library. This module can be used with the \"classic\" " "NDBM interface or the :abbr:`GDBM (GNU dbm)` compatibility interface." msgstr "" -#: library/dbm.rst:272 +#: library/dbm.rst:326 msgid "" "The NDBM library shipped as part of macOS has an undocumented limitation on " "the size of values, which can result in corrupted database files when " @@ -371,51 +438,55 @@ msgid "" "result in a hard crash (segmentation fault)." msgstr "" -#: library/dbm.rst:279 +#: library/dbm.rst:335 msgid "" "Raised on :mod:`dbm.ndbm`-specific errors, such as I/O errors. :exc:" "`KeyError` is raised for general mapping errors like specifying an incorrect " "key." msgstr "" -#: library/dbm.rst:285 +#: library/dbm.rst:341 msgid "Name of the NDBM implementation library used." msgstr "" -#: library/dbm.rst:290 +#: library/dbm.rst:346 msgid "Open an NDBM database and return an :class:`!ndbm` object." msgstr "" -#: library/dbm.rst:292 +#: library/dbm.rst:348 msgid "" "The basename of the database file (without the :file:`.dir` or :file:`.pag` " "extensions)." msgstr "" -#: library/dbm.rst:306 +#: library/dbm.rst:362 msgid "" ":class:`!ndbm` objects behave similar to :term:`mappings `, but :" "meth:`!items` and :meth:`!values` methods are not supported. The following " "methods are also provided:" msgstr "" -#: library/dbm.rst:310 +#: library/dbm.rst:366 msgid "Accepts :term:`path-like object` for filename." msgstr "" -#: library/dbm.rst:315 +#: library/dbm.rst:371 msgid "Close the NDBM database." msgstr "" -#: library/dbm.rst:319 +#: library/dbm.rst:375 +msgid "Remove all items from the NDBM database." +msgstr "" + +#: library/dbm.rst:381 msgid ":mod:`dbm.dumb` --- Portable DBM implementation" msgstr "" -#: library/dbm.rst:324 +#: library/dbm.rst:386 msgid "**Source code:** :source:`Lib/dbm/dumb.py`" msgstr "" -#: library/dbm.rst:330 +#: library/dbm.rst:392 msgid "" "The :mod:`dbm.dumb` module is intended as a last resort fallback for the :" "mod:`dbm` module when a more robust module is not available. The :mod:`dbm." @@ -423,100 +494,100 @@ msgid "" "the other database modules." msgstr "" -#: library/dbm.rst:337 +#: library/dbm.rst:399 msgid "" "The :mod:`dbm.dumb` module provides a persistent :class:`dict`-like " "interface which is written entirely in Python. Unlike other :mod:`dbm` " "backends, such as :mod:`dbm.gnu`, no external library is required." msgstr "" -#: library/dbm.rst:342 +#: library/dbm.rst:404 msgid "The :mod:`!dbm.dumb` module defines the following:" msgstr "" -#: library/dbm.rst:346 +#: library/dbm.rst:408 msgid "" "Raised on :mod:`dbm.dumb`-specific errors, such as I/O errors. :exc:" "`KeyError` is raised for general mapping errors like specifying an incorrect " "key." msgstr "" -#: library/dbm.rst:352 +#: library/dbm.rst:414 msgid "" "Open a :mod:`!dbm.dumb` database. The returned database object behaves " "similar to a :term:`mapping`, in addition to providing :meth:`~dumbdbm.sync` " "and :meth:`~dumbdbm.close` methods." msgstr "" -#: library/dbm.rst:357 +#: library/dbm.rst:419 msgid "" "The basename of the database file (without extensions). A new database " "creates the following files: - :file:`{filename}.dat` - :file:`{filename}." "dir`" msgstr "" -#: library/dbm.rst:358 +#: library/dbm.rst:420 msgid "" "The basename of the database file (without extensions). A new database " "creates the following files:" msgstr "" -#: library/dbm.rst:361 +#: library/dbm.rst:423 msgid ":file:`{filename}.dat`" msgstr "" -#: library/dbm.rst:362 +#: library/dbm.rst:424 msgid ":file:`{filename}.dir`" msgstr "" -#: library/dbm.rst:365 +#: library/dbm.rst:427 msgid "" "* ``'r'``: |flag_r| * ``'w'``: |flag_w| * ``'c'`` (default): |flag_c| * " "``'n'``: |flag_n|" msgstr "" -#: library/dbm.rst:366 +#: library/dbm.rst:428 msgid "``'r'``: |flag_r|" msgstr "" -#: library/dbm.rst:368 +#: library/dbm.rst:430 msgid "``'c'`` (default): |flag_c|" msgstr "" -#: library/dbm.rst:375 +#: library/dbm.rst:437 msgid "" "It is possible to crash the Python interpreter when loading a database with " "a sufficiently large/complex entry due to stack depth limitations in " "Python's AST compiler." msgstr "" -#: library/dbm.rst:379 +#: library/dbm.rst:441 msgid "" ":func:`~dbm.dumb.open` always creates a new database when *flag* is ``'n'``." msgstr "" -#: library/dbm.rst:382 +#: library/dbm.rst:444 msgid "" "A database opened read-only if *flag* is ``'r'``. A database is not created " "if it does not exist if *flag* is ``'r'`` or ``'w'``." msgstr "" -#: library/dbm.rst:389 +#: library/dbm.rst:451 msgid "" "In addition to the methods provided by the :class:`collections.abc." "MutableMapping` class, the following methods are provided:" msgstr "" -#: library/dbm.rst:395 +#: library/dbm.rst:457 msgid "" "Synchronize the on-disk directory and data files. This method is called by " "the :meth:`shelve.Shelf.sync` method." msgstr "" -#: library/dbm.rst:400 +#: library/dbm.rst:462 msgid "Close the database." msgstr "" -#: library/dbm.rst:326 +#: library/dbm.rst:388 msgid "databases" msgstr "" diff --git a/library/debug.po b/library/debug.po index f8292d91..c9160b3b 100644 --- a/library/debug.po +++ b/library/debug.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" diff --git a/library/decimal.po b/library/decimal.po index 7ca50664..bf08650a 100644 --- a/library/decimal.po +++ b/library/decimal.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -437,10 +437,12 @@ msgid "" "Other Unicode decimal digits are also permitted where ``digit`` appears " "above. These include decimal digits from various other alphabets (for " "example, Arabic-Indic and Devanāgarī digits) along with the fullwidth digits " -"``'\\uff10'`` through ``'\\uff19'``." +"``'\\uff10'`` through ``'\\uff19'``. Case is not significant, so, for " +"example, ``inf``, ``Inf``, ``INFINITY``, and ``iNfINity`` are all acceptable " +"spellings for positive infinity." msgstr "" -#: library/decimal.rst:371 +#: library/decimal.rst:373 msgid "" "If *value* is a :class:`tuple`, it should have three components, a sign " "(``0`` for positive or ``1`` for negative), a :class:`tuple` of digits, and " @@ -448,7 +450,7 @@ msgid "" "``Decimal('1.414')``." msgstr "" -#: library/decimal.rst:376 +#: library/decimal.rst:378 msgid "" "If *value* is a :class:`float`, the binary floating-point value is " "losslessly converted to its exact decimal equivalent. This conversion can " @@ -457,7 +459,7 @@ msgid "" "``Decimal('1.100000000000000088817841970012523233890533447265625')``." msgstr "" -#: library/decimal.rst:382 +#: library/decimal.rst:384 msgid "" "The *context* precision does not affect how many digits are stored. That is " "determined exclusively by the number of digits in *value*. For example, " @@ -465,7 +467,7 @@ msgid "" "is only three." msgstr "" -#: library/decimal.rst:387 +#: library/decimal.rst:389 msgid "" "The purpose of the *context* argument is determining what to do if *value* " "is a malformed string. If the context traps :const:`InvalidOperation`, an " @@ -473,29 +475,29 @@ msgid "" "the value of ``NaN``." msgstr "" -#: library/decimal.rst:392 +#: library/decimal.rst:394 msgid "Once constructed, :class:`Decimal` objects are immutable." msgstr "" -#: library/decimal.rst:394 +#: library/decimal.rst:396 msgid "" "The argument to the constructor is now permitted to be a :class:`float` " "instance." msgstr "" -#: library/decimal.rst:398 +#: library/decimal.rst:400 msgid "" ":class:`float` arguments raise an exception if the :exc:`FloatOperation` " "trap is set. By default the trap is off." msgstr "" -#: library/decimal.rst:402 +#: library/decimal.rst:404 msgid "" "Underscores are allowed for grouping, as with integral and floating-point " "literals in code." msgstr "" -#: library/decimal.rst:406 +#: library/decimal.rst:408 msgid "" "Decimal floating-point objects share many properties with the other built-in " "numeric types such as :class:`float` and :class:`int`. All of the usual " @@ -505,7 +507,7 @@ msgid "" "class:`int`)." msgstr "" -#: library/decimal.rst:413 +#: library/decimal.rst:415 msgid "" "There are some small differences between arithmetic on Decimal objects and " "arithmetic on integers and floats. When the remainder operator ``%`` is " @@ -513,7 +515,7 @@ msgid "" "*dividend* rather than the sign of the divisor::" msgstr "" -#: library/decimal.rst:418 +#: library/decimal.rst:420 msgid "" ">>> (-7) % 4\n" "1\n" @@ -521,14 +523,14 @@ msgid "" "Decimal('-3')" msgstr "" -#: library/decimal.rst:423 +#: library/decimal.rst:425 msgid "" "The integer division operator ``//`` behaves analogously, returning the " "integer part of the true quotient (truncating towards zero) rather than its " "floor, so as to preserve the usual identity ``x == (x // y) * y + x % y``::" msgstr "" -#: library/decimal.rst:427 +#: library/decimal.rst:429 msgid "" ">>> -7 // 4\n" "-2\n" @@ -536,13 +538,13 @@ msgid "" "Decimal('-1')" msgstr "" -#: library/decimal.rst:432 +#: library/decimal.rst:434 msgid "" "The ``%`` and ``//`` operators implement the ``remainder`` and ``divide-" "integer`` operations (respectively) as described in the specification." msgstr "" -#: library/decimal.rst:436 +#: library/decimal.rst:438 msgid "" "Decimal objects cannot generally be combined with floats or instances of :" "class:`fractions.Fraction` in arithmetic operations: an attempt to add a :" @@ -553,19 +555,19 @@ msgid "" "numbers of different types." msgstr "" -#: library/decimal.rst:444 +#: library/decimal.rst:446 msgid "" "Mixed-type comparisons between :class:`Decimal` instances and other numeric " "types are now fully supported." msgstr "" -#: library/decimal.rst:448 +#: library/decimal.rst:450 msgid "" "In addition to the standard numeric properties, decimal floating-point " "objects also have a number of specialized methods:" msgstr "" -#: library/decimal.rst:454 +#: library/decimal.rst:456 msgid "" "Return the adjusted exponent after shifting out the coefficient's rightmost " "digits until only the lead digit remains: ``Decimal('321e+5').adjusted()`` " @@ -573,45 +575,45 @@ msgid "" "digit with respect to the decimal point." msgstr "" -#: library/decimal.rst:461 +#: library/decimal.rst:463 msgid "" "Return a pair ``(n, d)`` of integers that represent the given :class:" "`Decimal` instance as a fraction, in lowest terms and with a positive " "denominator::" msgstr "" -#: library/decimal.rst:465 +#: library/decimal.rst:467 msgid "" ">>> Decimal('-3.14').as_integer_ratio()\n" "(-157, 50)" msgstr "" -#: library/decimal.rst:468 +#: library/decimal.rst:470 msgid "" "The conversion is exact. Raise OverflowError on infinities and ValueError " "on NaNs." msgstr "" -#: library/decimal.rst:475 +#: library/decimal.rst:477 msgid "" "Return a :term:`named tuple` representation of the number: " "``DecimalTuple(sign, digits, exponent)``." msgstr "" -#: library/decimal.rst:481 +#: library/decimal.rst:483 msgid "" "Return the canonical encoding of the argument. Currently, the encoding of " "a :class:`Decimal` instance is always canonical, so this operation returns " "its argument unchanged." msgstr "" -#: library/decimal.rst:487 +#: library/decimal.rst:489 msgid "" "Compare the values of two Decimal instances. :meth:`compare` returns a " "Decimal instance, and if either operand is a NaN then the result is a NaN::" msgstr "" -#: library/decimal.rst:491 +#: library/decimal.rst:493 msgid "" "a or b is a NaN ==> Decimal('NaN')\n" "a < b ==> Decimal('-1')\n" @@ -619,14 +621,14 @@ msgid "" "a > b ==> Decimal('1')" msgstr "" -#: library/decimal.rst:498 +#: library/decimal.rst:500 msgid "" "This operation is identical to the :meth:`compare` method, except that all " "NaNs signal. That is, if neither operand is a signaling NaN then any quiet " "NaN operand is treated as though it were a signaling NaN." msgstr "" -#: library/decimal.rst:504 +#: library/decimal.rst:506 msgid "" "Compare two operands using their abstract representation rather than their " "numerical value. Similar to the :meth:`compare` method, but the result " @@ -635,7 +637,7 @@ msgid "" "unequal in this ordering:" msgstr "" -#: library/decimal.rst:513 +#: library/decimal.rst:515 msgid "" "Quiet and signaling NaNs are also included in the total ordering. The " "result of this function is ``Decimal('0')`` if both operands have the same " @@ -645,14 +647,14 @@ msgid "" "details of the total order." msgstr "" -#: library/decimal.rst:531 library/decimal.rst:846 +#: library/decimal.rst:533 library/decimal.rst:848 msgid "" "This operation is unaffected by context and is quiet: no flags are changed " "and no rounding is performed. As an exception, the C version may raise " "InvalidOperation if the second operand cannot be converted exactly." msgstr "" -#: library/decimal.rst:526 +#: library/decimal.rst:528 msgid "" "Compare two operands using their abstract representation rather than their " "value as in :meth:`compare_total`, but ignoring the sign of each operand. " @@ -660,44 +662,44 @@ msgid "" "copy_abs())``." msgstr "" -#: library/decimal.rst:537 +#: library/decimal.rst:539 msgid "" "Just returns self, this method is only to comply with the Decimal " "Specification." msgstr "" -#: library/decimal.rst:542 +#: library/decimal.rst:544 msgid "" "Return the absolute value of the argument. This operation is unaffected by " "the context and is quiet: no flags are changed and no rounding is performed." msgstr "" -#: library/decimal.rst:548 +#: library/decimal.rst:550 msgid "" "Return the negation of the argument. This operation is unaffected by the " "context and is quiet: no flags are changed and no rounding is performed." msgstr "" -#: library/decimal.rst:553 +#: library/decimal.rst:555 msgid "" "Return a copy of the first operand with the sign set to be the same as the " "sign of the second operand. For example:" msgstr "" -#: library/decimal.rst:565 +#: library/decimal.rst:567 msgid "" "Return the value of the (natural) exponential function ``e**x`` at the given " "number. The result is correctly rounded using the :const:`ROUND_HALF_EVEN` " "rounding mode." msgstr "" -#: library/decimal.rst:576 +#: library/decimal.rst:578 msgid "" "Alternative constructor that only accepts instances of :class:`float` or :" "class:`int`." msgstr "" -#: library/decimal.rst:579 +#: library/decimal.rst:581 msgid "" "Note ``Decimal.from_float(0.1)`` is not the same as ``Decimal('0.1')``. " "Since 0.1 is not exactly representable in binary floating point, the value " @@ -706,13 +708,13 @@ msgid "" "``0.1000000000000000055511151231257827021181583404541015625``." msgstr "" -#: library/decimal.rst:585 +#: library/decimal.rst:587 msgid "" "From Python 3.2 onwards, a :class:`Decimal` instance can also be constructed " "directly from a :class:`float`." msgstr "" -#: library/decimal.rst:588 +#: library/decimal.rst:590 msgid "" ">>> Decimal.from_float(0.1)\n" "Decimal('0.1000000000000000055511151231257827021181583404541015625')\n" @@ -724,86 +726,86 @@ msgid "" "Decimal('-Infinity')" msgstr "" -#: library/decimal.rst:603 +#: library/decimal.rst:605 msgid "" "Fused multiply-add. Return self*other+third with no rounding of the " "intermediate product self*other." msgstr "" -#: library/decimal.rst:611 +#: library/decimal.rst:613 msgid "" "Return :const:`True` if the argument is canonical and :const:`False` " "otherwise. Currently, a :class:`Decimal` instance is always canonical, so " "this operation always returns :const:`True`." msgstr "" -#: library/decimal.rst:617 +#: library/decimal.rst:619 msgid "" "Return :const:`True` if the argument is a finite number, and :const:`False` " "if the argument is an infinity or a NaN." msgstr "" -#: library/decimal.rst:622 +#: library/decimal.rst:624 msgid "" "Return :const:`True` if the argument is either positive or negative infinity " "and :const:`False` otherwise." msgstr "" -#: library/decimal.rst:627 +#: library/decimal.rst:629 msgid "" "Return :const:`True` if the argument is a (quiet or signaling) NaN and :" "const:`False` otherwise." msgstr "" -#: library/decimal.rst:632 +#: library/decimal.rst:634 msgid "" "Return :const:`True` if the argument is a *normal* finite number. Return :" "const:`False` if the argument is zero, subnormal, infinite or a NaN." msgstr "" -#: library/decimal.rst:637 +#: library/decimal.rst:639 msgid "" "Return :const:`True` if the argument is a quiet NaN, and :const:`False` " "otherwise." msgstr "" -#: library/decimal.rst:642 +#: library/decimal.rst:644 msgid "" "Return :const:`True` if the argument has a negative sign and :const:`False` " "otherwise. Note that zeros and NaNs can both carry signs." msgstr "" -#: library/decimal.rst:647 +#: library/decimal.rst:649 msgid "" "Return :const:`True` if the argument is a signaling NaN and :const:`False` " "otherwise." msgstr "" -#: library/decimal.rst:652 +#: library/decimal.rst:654 msgid "" "Return :const:`True` if the argument is subnormal, and :const:`False` " "otherwise." msgstr "" -#: library/decimal.rst:657 +#: library/decimal.rst:659 msgid "" "Return :const:`True` if the argument is a (positive or negative) zero and :" "const:`False` otherwise." msgstr "" -#: library/decimal.rst:662 +#: library/decimal.rst:664 msgid "" "Return the natural (base e) logarithm of the operand. The result is " "correctly rounded using the :const:`ROUND_HALF_EVEN` rounding mode." msgstr "" -#: library/decimal.rst:667 +#: library/decimal.rst:669 msgid "" "Return the base ten logarithm of the operand. The result is correctly " "rounded using the :const:`ROUND_HALF_EVEN` rounding mode." msgstr "" -#: library/decimal.rst:672 +#: library/decimal.rst:674 msgid "" "For a nonzero number, return the adjusted exponent of its operand as a :" "class:`Decimal` instance. If the operand is a zero then ``Decimal('-" @@ -811,74 +813,74 @@ msgid "" "the operand is an infinity then ``Decimal('Infinity')`` is returned." msgstr "" -#: library/decimal.rst:680 +#: library/decimal.rst:682 msgid "" ":meth:`logical_and` is a logical operation which takes two *logical " "operands* (see :ref:`logical_operands_label`). The result is the digit-wise " "``and`` of the two operands." msgstr "" -#: library/decimal.rst:686 +#: library/decimal.rst:688 msgid "" ":meth:`logical_invert` is a logical operation. The result is the digit-wise " "inversion of the operand." msgstr "" -#: library/decimal.rst:691 +#: library/decimal.rst:693 msgid "" ":meth:`logical_or` is a logical operation which takes two *logical operands* " "(see :ref:`logical_operands_label`). The result is the digit-wise ``or`` of " "the two operands." msgstr "" -#: library/decimal.rst:697 +#: library/decimal.rst:699 msgid "" ":meth:`logical_xor` is a logical operation which takes two *logical " "operands* (see :ref:`logical_operands_label`). The result is the digit-wise " "exclusive or of the two operands." msgstr "" -#: library/decimal.rst:703 +#: library/decimal.rst:705 msgid "" "Like ``max(self, other)`` except that the context rounding rule is applied " "before returning and that ``NaN`` values are either signaled or ignored " "(depending on the context and whether they are signaling or quiet)." msgstr "" -#: library/decimal.rst:710 +#: library/decimal.rst:712 msgid "" "Similar to the :meth:`.max` method, but the comparison is done using the " "absolute values of the operands." msgstr "" -#: library/decimal.rst:715 +#: library/decimal.rst:717 msgid "" "Like ``min(self, other)`` except that the context rounding rule is applied " "before returning and that ``NaN`` values are either signaled or ignored " "(depending on the context and whether they are signaling or quiet)." msgstr "" -#: library/decimal.rst:722 +#: library/decimal.rst:724 msgid "" "Similar to the :meth:`.min` method, but the comparison is done using the " "absolute values of the operands." msgstr "" -#: library/decimal.rst:727 +#: library/decimal.rst:729 msgid "" "Return the largest number representable in the given context (or in the " "current thread's context if no context is given) that is smaller than the " "given operand." msgstr "" -#: library/decimal.rst:733 +#: library/decimal.rst:735 msgid "" "Return the smallest number representable in the given context (or in the " "current thread's context if no context is given) that is larger than the " "given operand." msgstr "" -#: library/decimal.rst:739 +#: library/decimal.rst:741 msgid "" "If the two operands are unequal, return the number closest to the first " "operand in the direction of the second operand. If both operands are " @@ -886,13 +888,13 @@ msgid "" "be the same as the sign of the second operand." msgstr "" -#: library/decimal.rst:746 +#: library/decimal.rst:748 msgid "" "Used for producing canonical values of an equivalence class within either " "the current context or the specified context." msgstr "" -#: library/decimal.rst:749 +#: library/decimal.rst:751 msgid "" "This has the same semantics as the unary plus operation, except that if the " "final result is finite it is reduced to its simplest form, with all trailing " @@ -902,79 +904,79 @@ msgid "" "exponent is set to 0. In all cases the sign is unchanged." msgstr "" -#: library/decimal.rst:756 +#: library/decimal.rst:758 msgid "" "For example, ``Decimal('32.100')`` and ``Decimal('0.321000e+2')`` both " "normalize to the equivalent value ``Decimal('32.1')``." msgstr "" -#: library/decimal.rst:759 +#: library/decimal.rst:761 msgid "Note that rounding is applied *before* reducing to simplest form." msgstr "" -#: library/decimal.rst:761 +#: library/decimal.rst:763 msgid "" "In the latest versions of the specification, this operation is also known as " "``reduce``." msgstr "" -#: library/decimal.rst:766 +#: library/decimal.rst:768 msgid "" "Return a string describing the *class* of the operand. The returned value " "is one of the following ten strings." msgstr "" -#: library/decimal.rst:769 +#: library/decimal.rst:771 msgid "``\"-Infinity\"``, indicating that the operand is negative infinity." msgstr "" -#: library/decimal.rst:770 +#: library/decimal.rst:772 msgid "" "``\"-Normal\"``, indicating that the operand is a negative normal number." msgstr "" -#: library/decimal.rst:771 +#: library/decimal.rst:773 msgid "" "``\"-Subnormal\"``, indicating that the operand is negative and subnormal." msgstr "" -#: library/decimal.rst:772 +#: library/decimal.rst:774 msgid "``\"-Zero\"``, indicating that the operand is a negative zero." msgstr "" -#: library/decimal.rst:773 +#: library/decimal.rst:775 msgid "``\"+Zero\"``, indicating that the operand is a positive zero." msgstr "" -#: library/decimal.rst:774 +#: library/decimal.rst:776 msgid "" "``\"+Subnormal\"``, indicating that the operand is positive and subnormal." msgstr "" -#: library/decimal.rst:775 +#: library/decimal.rst:777 msgid "" "``\"+Normal\"``, indicating that the operand is a positive normal number." msgstr "" -#: library/decimal.rst:776 +#: library/decimal.rst:778 msgid "``\"+Infinity\"``, indicating that the operand is positive infinity." msgstr "" -#: library/decimal.rst:777 +#: library/decimal.rst:779 msgid "``\"NaN\"``, indicating that the operand is a quiet NaN (Not a Number)." msgstr "" -#: library/decimal.rst:778 +#: library/decimal.rst:780 msgid "``\"sNaN\"``, indicating that the operand is a signaling NaN." msgstr "" -#: library/decimal.rst:782 +#: library/decimal.rst:784 msgid "" "Return a value equal to the first operand after rounding and having the " "exponent of the second operand." msgstr "" -#: library/decimal.rst:788 +#: library/decimal.rst:790 msgid "" "Unlike other operations, if the length of the coefficient after the quantize " "operation would be greater than precision, then an :const:`InvalidOperation` " @@ -982,13 +984,13 @@ msgid "" "quantized exponent is always equal to that of the right-hand operand." msgstr "" -#: library/decimal.rst:794 +#: library/decimal.rst:796 msgid "" "Also unlike other operations, quantize never signals Underflow, even if the " "result is subnormal and inexact." msgstr "" -#: library/decimal.rst:797 +#: library/decimal.rst:799 msgid "" "If the exponent of the second operand is larger than that of the first then " "rounding may be necessary. In this case, the rounding mode is determined by " @@ -997,19 +999,19 @@ msgid "" "context is used." msgstr "" -#: library/decimal.rst:803 +#: library/decimal.rst:805 msgid "" "An error is returned whenever the resulting exponent is greater than :attr:" "`~Context.Emax` or less than :meth:`~Context.Etiny`." msgstr "" -#: library/decimal.rst:808 +#: library/decimal.rst:810 msgid "" "Return ``Decimal(10)``, the radix (base) in which the :class:`Decimal` class " "does all its arithmetic. Included for compatibility with the specification." msgstr "" -#: library/decimal.rst:814 +#: library/decimal.rst:816 msgid "" "Return the remainder from dividing *self* by *other*. This differs from " "``self % other`` in that the sign of the remainder is chosen so as to " @@ -1018,11 +1020,11 @@ msgid "" "other``, and if two integers are equally near then the even one is chosen." msgstr "" -#: library/decimal.rst:821 +#: library/decimal.rst:823 msgid "If the result is zero then its sign will be the sign of *self*." msgstr "" -#: library/decimal.rst:832 +#: library/decimal.rst:834 msgid "" "Return the result of rotating the digits of the first operand by an amount " "specified by the second operand. The second operand must be an integer in " @@ -1034,20 +1036,20 @@ msgid "" "are unchanged." msgstr "" -#: library/decimal.rst:843 +#: library/decimal.rst:845 msgid "" "Test whether self and other have the same exponent or whether both are " "``NaN``." msgstr "" -#: library/decimal.rst:852 +#: library/decimal.rst:854 msgid "" "Return the first operand with exponent adjusted by the second. Equivalently, " "return the first operand multiplied by ``10**other``. The second operand " "must be an integer." msgstr "" -#: library/decimal.rst:858 +#: library/decimal.rst:860 msgid "" "Return the result of shifting the digits of the first operand by an amount " "specified by the second operand. The second operand must be an integer in " @@ -1058,34 +1060,34 @@ msgid "" "exponent of the first operand are unchanged." msgstr "" -#: library/decimal.rst:868 +#: library/decimal.rst:870 msgid "Return the square root of the argument to full precision." msgstr "" -#: library/decimal.rst:1510 +#: library/decimal.rst:1512 msgid "" "Convert to a string, using engineering notation if an exponent is needed." msgstr "" -#: library/decimal.rst:1512 +#: library/decimal.rst:1514 msgid "" "Engineering notation has an exponent which is a multiple of 3. This can " "leave up to 3 digits to the left of the decimal place and may require the " "addition of either one or two trailing zeros." msgstr "" -#: library/decimal.rst:879 +#: library/decimal.rst:881 msgid "" "For example, this converts ``Decimal('123E+1')`` to ``Decimal('1.23E+3')``." msgstr "" -#: library/decimal.rst:883 +#: library/decimal.rst:885 msgid "" "Identical to the :meth:`to_integral_value` method. The ``to_integral`` name " "has been kept for compatibility with older versions." msgstr "" -#: library/decimal.rst:888 +#: library/decimal.rst:890 msgid "" "Round to the nearest integer, signaling :const:`Inexact` or :const:`Rounded` " "as appropriate if rounding occurs. The rounding mode is determined by the " @@ -1093,18 +1095,18 @@ msgid "" "parameter is given then the rounding mode of the current context is used." msgstr "" -#: library/decimal.rst:896 +#: library/decimal.rst:898 msgid "" "Round to the nearest integer without signaling :const:`Inexact` or :const:" "`Rounded`. If given, applies *rounding*; otherwise, uses the rounding " "method in either the supplied *context* or the current context." msgstr "" -#: library/decimal.rst:900 +#: library/decimal.rst:902 msgid "Decimal numbers can be rounded using the :func:`.round` function:" msgstr "" -#: library/decimal.rst:905 +#: library/decimal.rst:907 msgid "" "If *ndigits* is not given or ``None``, returns the nearest :class:`int` to " "*number*, rounding ties to even, and ignoring the rounding mode of the :" @@ -1112,7 +1114,7 @@ msgid "" "infinity or :exc:`ValueError` if it is a (quiet or signaling) NaN." msgstr "" -#: library/decimal.rst:911 +#: library/decimal.rst:913 msgid "" "If *ndigits* is an :class:`int`, the context's rounding mode is respected " "and a :class:`Decimal` representing *number* rounded to the nearest multiple " @@ -1124,27 +1126,27 @@ msgid "" "the current context's precision. In other words, for the non-corner cases:" msgstr "" -#: library/decimal.rst:921 +#: library/decimal.rst:923 msgid "" "if *ndigits* is positive, return *number* rounded to *ndigits* decimal " "places;" msgstr "" -#: library/decimal.rst:923 +#: library/decimal.rst:925 msgid "if *ndigits* is zero, return *number* rounded to the nearest integer;" msgstr "" -#: library/decimal.rst:924 +#: library/decimal.rst:926 msgid "" "if *ndigits* is negative, return *number* rounded to the nearest multiple of " "``10**abs(ndigits)``." msgstr "" -#: library/decimal.rst:927 +#: library/decimal.rst:929 msgid "For example::" msgstr "" -#: library/decimal.rst:929 +#: library/decimal.rst:931 msgid "" ">>> from decimal import Decimal, getcontext, ROUND_DOWN\n" ">>> getcontext().rounding = ROUND_DOWN\n" @@ -1160,11 +1162,11 @@ msgid "" "Decimal('0E+1')" msgstr "" -#: library/decimal.rst:946 +#: library/decimal.rst:948 msgid "Logical operands" msgstr "" -#: library/decimal.rst:948 +#: library/decimal.rst:950 msgid "" "The :meth:`~Decimal.logical_and`, :meth:`~Decimal.logical_invert`, :meth:" "`~Decimal.logical_or`, and :meth:`~Decimal.logical_xor` methods expect their " @@ -1173,38 +1175,38 @@ msgid "" "are all either ``0`` or ``1``." msgstr "" -#: library/decimal.rst:960 +#: library/decimal.rst:962 msgid "Context objects" msgstr "" -#: library/decimal.rst:962 +#: library/decimal.rst:964 msgid "" "Contexts are environments for arithmetic operations. They govern precision, " "set rules for rounding, determine which signals are treated as exceptions, " "and limit the range for exponents." msgstr "" -#: library/decimal.rst:966 +#: library/decimal.rst:968 msgid "" "Each thread has its own current context which is accessed or changed using " "the :func:`getcontext` and :func:`setcontext` functions:" msgstr "" -#: library/decimal.rst:972 +#: library/decimal.rst:974 msgid "Return the current context for the active thread." msgstr "" -#: library/decimal.rst:977 +#: library/decimal.rst:979 msgid "Set the current context for the active thread to *c*." msgstr "" -#: library/decimal.rst:979 +#: library/decimal.rst:981 msgid "" "You can also use the :keyword:`with` statement and the :func:`localcontext` " "function to temporarily change the active context." msgstr "" -#: library/decimal.rst:984 +#: library/decimal.rst:986 msgid "" "Return a context manager that will set the current context for the active " "thread to a copy of *ctx* on entry to the with-statement and restore the " @@ -1213,14 +1215,14 @@ msgid "" "used to set the attributes of the new context." msgstr "" -#: library/decimal.rst:990 +#: library/decimal.rst:992 msgid "" "For example, the following code sets the current decimal precision to 42 " "places, performs a calculation, and then automatically restores the previous " "context::" msgstr "" -#: library/decimal.rst:993 +#: library/decimal.rst:995 msgid "" "from decimal import localcontext\n" "\n" @@ -1230,11 +1232,11 @@ msgid "" "s = +s # Round the final result back to the default precision" msgstr "" -#: library/decimal.rst:1000 +#: library/decimal.rst:1002 msgid "Using keyword arguments, the code would be the following::" msgstr "" -#: library/decimal.rst:1002 +#: library/decimal.rst:1004 msgid "" "from decimal import localcontext\n" "\n" @@ -1243,26 +1245,26 @@ msgid "" "s = +s" msgstr "" -#: library/decimal.rst:1008 +#: library/decimal.rst:1010 msgid "" "Raises :exc:`TypeError` if *kwargs* supplies an attribute that :class:" "`Context` doesn't support. Raises either :exc:`TypeError` or :exc:" "`ValueError` if *kwargs* supplies an invalid value for an attribute." msgstr "" -#: library/decimal.rst:1012 +#: library/decimal.rst:1014 msgid "" ":meth:`localcontext` now supports setting context attributes through the use " "of keyword arguments." msgstr "" -#: library/decimal.rst:1015 +#: library/decimal.rst:1017 msgid "" "New contexts can also be created using the :class:`Context` constructor " "described below. In addition, the module provides three pre-made contexts:" msgstr "" -#: library/decimal.rst:1021 +#: library/decimal.rst:1023 msgid "" "This is a standard context defined by the General Decimal Arithmetic " "Specification. Precision is set to nine. Rounding is set to :const:" @@ -1271,12 +1273,12 @@ msgid "" "`Subnormal`." msgstr "" -#: library/decimal.rst:1027 +#: library/decimal.rst:1029 msgid "" "Because many of the traps are enabled, this context is useful for debugging." msgstr "" -#: library/decimal.rst:1032 +#: library/decimal.rst:1034 msgid "" "This is a standard context defined by the General Decimal Arithmetic " "Specification. Precision is set to nine. Rounding is set to :const:" @@ -1284,7 +1286,7 @@ msgid "" "exceptions are not raised during computations)." msgstr "" -#: library/decimal.rst:1037 +#: library/decimal.rst:1039 msgid "" "Because the traps are disabled, this context is useful for applications that " "prefer to have result value of ``NaN`` or ``Infinity`` instead of raising " @@ -1292,7 +1294,7 @@ msgid "" "conditions that would otherwise halt the program." msgstr "" -#: library/decimal.rst:1045 +#: library/decimal.rst:1047 msgid "" "This context is used by the :class:`Context` constructor as a prototype for " "new contexts. Changing a field (such a precision) has the effect of " @@ -1300,7 +1302,7 @@ msgid "" "constructor." msgstr "" -#: library/decimal.rst:1049 +#: library/decimal.rst:1051 msgid "" "This context is most useful in multi-threaded environments. Changing one of " "the fields before threads are started has the effect of setting system-wide " @@ -1308,65 +1310,65 @@ msgid "" "as it would require thread synchronization to prevent race conditions." msgstr "" -#: library/decimal.rst:1054 +#: library/decimal.rst:1056 msgid "" "In single threaded environments, it is preferable to not use this context at " "all. Instead, simply create contexts explicitly as described below." msgstr "" -#: library/decimal.rst:1057 +#: library/decimal.rst:1059 msgid "" "The default values are :attr:`Context.prec`\\ =\\ ``28``, :attr:`Context." "rounding`\\ =\\ :const:`ROUND_HALF_EVEN`, and enabled traps for :class:" "`Overflow`, :class:`InvalidOperation`, and :class:`DivisionByZero`." msgstr "" -#: library/decimal.rst:1062 +#: library/decimal.rst:1064 msgid "" "In addition to the three supplied contexts, new contexts can be created with " "the :class:`Context` constructor." msgstr "" -#: library/decimal.rst:1068 +#: library/decimal.rst:1070 msgid "" "Creates a new context. If a field is not specified or is :const:`None`, the " "default values are copied from the :const:`DefaultContext`. If the *flags* " "field is not specified or is :const:`None`, all flags are cleared." msgstr "" -#: library/decimal.rst:1072 +#: library/decimal.rst:1074 msgid "" "*prec* is an integer in the range [``1``, :const:`MAX_PREC`] that sets the " "precision for arithmetic operations in the context." msgstr "" -#: library/decimal.rst:1075 +#: library/decimal.rst:1077 msgid "" "The *rounding* option is one of the constants listed in the section " "`Rounding Modes`_." msgstr "" -#: library/decimal.rst:1078 +#: library/decimal.rst:1080 msgid "" "The *traps* and *flags* fields list any signals to be set. Generally, new " "contexts should only set traps and leave the flags clear." msgstr "" -#: library/decimal.rst:1081 +#: library/decimal.rst:1083 msgid "" "The *Emin* and *Emax* fields are integers specifying the outer limits " "allowable for exponents. *Emin* must be in the range [:const:`MIN_EMIN`, " "``0``], *Emax* in the range [``0``, :const:`MAX_EMAX`]." msgstr "" -#: library/decimal.rst:1085 +#: library/decimal.rst:1087 msgid "" "The *capitals* field is either ``0`` or ``1`` (the default). If set to " "``1``, exponents are printed with a capital ``E``; otherwise, a lowercase " "``e`` is used: ``Decimal('6.02e+23')``." msgstr "" -#: library/decimal.rst:1089 +#: library/decimal.rst:1091 msgid "" "The *clamp* field is either ``0`` (the default) or ``1``. If set to ``1``, " "the exponent ``e`` of a :class:`Decimal` instance representable in this " @@ -1380,19 +1382,19 @@ msgid "" "For example::" msgstr "" -#: library/decimal.rst:1101 +#: library/decimal.rst:1103 msgid "" ">>> Context(prec=6, Emax=999, clamp=1).create_decimal('1.23e999')\n" "Decimal('1.23000E+999')" msgstr "" -#: library/decimal.rst:1104 +#: library/decimal.rst:1106 msgid "" "A *clamp* value of ``1`` allows compatibility with the fixed-width decimal " "interchange formats specified in IEEE 754." msgstr "" -#: library/decimal.rst:1107 +#: library/decimal.rst:1109 msgid "" "The :class:`Context` class defines several general purpose methods as well " "as a large number of methods for doing arithmetic directly in a given " @@ -1405,30 +1407,30 @@ msgid "" "instance of :class:`int`) anywhere that a Decimal instance is accepted." msgstr "" -#: library/decimal.rst:1120 +#: library/decimal.rst:1122 msgid "Resets all of the flags to ``0``." msgstr "" -#: library/decimal.rst:1124 +#: library/decimal.rst:1126 msgid "Resets all of the traps to ``0``." msgstr "" -#: library/decimal.rst:1130 +#: library/decimal.rst:1132 msgid "Return a duplicate of the context." msgstr "" -#: library/decimal.rst:1134 +#: library/decimal.rst:1136 msgid "Return a copy of the Decimal instance num." msgstr "" -#: library/decimal.rst:1138 +#: library/decimal.rst:1140 msgid "" "Creates a new Decimal instance from *num* but using *self* as context. " "Unlike the :class:`Decimal` constructor, the context precision, rounding " "method, flags, and traps are applied to the conversion." msgstr "" -#: library/decimal.rst:1142 +#: library/decimal.rst:1144 msgid "" "This is useful because constants are often given to a greater precision than " "is needed by the application. Another benefit is that rounding immediately " @@ -1437,7 +1439,7 @@ msgid "" "sum can change the result:" msgstr "" -#: library/decimal.rst:1148 +#: library/decimal.rst:1150 msgid "" ">>> getcontext().prec = 3\n" ">>> Decimal('3.4445') + Decimal('1.0023')\n" @@ -1446,14 +1448,14 @@ msgid "" "Decimal('4.44')" msgstr "" -#: library/decimal.rst:1156 +#: library/decimal.rst:1158 msgid "" "This method implements the to-number operation of the IBM specification. If " "the argument is a string, no leading or trailing whitespace or underscores " "are permitted." msgstr "" -#: library/decimal.rst:1162 +#: library/decimal.rst:1164 msgid "" "Creates a new Decimal instance from a float *f* but rounding using *self* as " "the context. Unlike the :meth:`Decimal.from_float` class method, the " @@ -1461,7 +1463,7 @@ msgid "" "conversion." msgstr "" -#: library/decimal.rst:1167 +#: library/decimal.rst:1169 msgid "" ">>> context = Context(prec=5, rounding=ROUND_DOWN)\n" ">>> context.create_decimal_from_float(math.pi)\n" @@ -1473,18 +1475,18 @@ msgid "" "decimal.Inexact: None" msgstr "" -#: library/decimal.rst:1182 +#: library/decimal.rst:1184 msgid "" "Returns a value equal to ``Emin - prec + 1`` which is the minimum exponent " "value for subnormal results. When underflow occurs, the exponent is set to :" "const:`Etiny`." msgstr "" -#: library/decimal.rst:1188 +#: library/decimal.rst:1190 msgid "Returns a value equal to ``Emax - prec + 1``." msgstr "" -#: library/decimal.rst:1190 +#: library/decimal.rst:1192 msgid "" "The usual approach to working with decimals is to create :class:`Decimal` " "instances and then apply arithmetic operations which take place within the " @@ -1494,189 +1496,189 @@ msgid "" "recounted here." msgstr "" -#: library/decimal.rst:1200 +#: library/decimal.rst:1202 msgid "Returns the absolute value of *x*." msgstr "" -#: library/decimal.rst:1205 +#: library/decimal.rst:1207 msgid "Return the sum of *x* and *y*." msgstr "" -#: library/decimal.rst:1210 +#: library/decimal.rst:1212 msgid "Returns the same Decimal object *x*." msgstr "" -#: library/decimal.rst:1215 +#: library/decimal.rst:1217 msgid "Compares *x* and *y* numerically." msgstr "" -#: library/decimal.rst:1220 +#: library/decimal.rst:1222 msgid "Compares the values of the two operands numerically." msgstr "" -#: library/decimal.rst:1225 +#: library/decimal.rst:1227 msgid "Compares two operands using their abstract representation." msgstr "" -#: library/decimal.rst:1230 +#: library/decimal.rst:1232 msgid "" "Compares two operands using their abstract representation, ignoring sign." msgstr "" -#: library/decimal.rst:1235 +#: library/decimal.rst:1237 msgid "Returns a copy of *x* with the sign set to 0." msgstr "" -#: library/decimal.rst:1240 +#: library/decimal.rst:1242 msgid "Returns a copy of *x* with the sign inverted." msgstr "" -#: library/decimal.rst:1245 +#: library/decimal.rst:1247 msgid "Copies the sign from *y* to *x*." msgstr "" -#: library/decimal.rst:1250 +#: library/decimal.rst:1252 msgid "Return *x* divided by *y*." msgstr "" -#: library/decimal.rst:1255 +#: library/decimal.rst:1257 msgid "Return *x* divided by *y*, truncated to an integer." msgstr "" -#: library/decimal.rst:1260 +#: library/decimal.rst:1262 msgid "Divides two numbers and returns the integer part of the result." msgstr "" -#: library/decimal.rst:1265 +#: library/decimal.rst:1267 msgid "Returns ``e ** x``." msgstr "" -#: library/decimal.rst:1270 +#: library/decimal.rst:1272 msgid "Returns *x* multiplied by *y*, plus *z*." msgstr "" -#: library/decimal.rst:1275 +#: library/decimal.rst:1277 msgid "Returns ``True`` if *x* is canonical; otherwise returns ``False``." msgstr "" -#: library/decimal.rst:1280 +#: library/decimal.rst:1282 msgid "Returns ``True`` if *x* is finite; otherwise returns ``False``." msgstr "" -#: library/decimal.rst:1285 +#: library/decimal.rst:1287 msgid "Returns ``True`` if *x* is infinite; otherwise returns ``False``." msgstr "" -#: library/decimal.rst:1290 +#: library/decimal.rst:1292 msgid "Returns ``True`` if *x* is a qNaN or sNaN; otherwise returns ``False``." msgstr "" -#: library/decimal.rst:1295 +#: library/decimal.rst:1297 msgid "" "Returns ``True`` if *x* is a normal number; otherwise returns ``False``." msgstr "" -#: library/decimal.rst:1300 +#: library/decimal.rst:1302 msgid "Returns ``True`` if *x* is a quiet NaN; otherwise returns ``False``." msgstr "" -#: library/decimal.rst:1305 +#: library/decimal.rst:1307 msgid "Returns ``True`` if *x* is negative; otherwise returns ``False``." msgstr "" -#: library/decimal.rst:1310 +#: library/decimal.rst:1312 msgid "" "Returns ``True`` if *x* is a signaling NaN; otherwise returns ``False``." msgstr "" -#: library/decimal.rst:1315 +#: library/decimal.rst:1317 msgid "Returns ``True`` if *x* is subnormal; otherwise returns ``False``." msgstr "" -#: library/decimal.rst:1320 +#: library/decimal.rst:1322 msgid "Returns ``True`` if *x* is a zero; otherwise returns ``False``." msgstr "" -#: library/decimal.rst:1325 +#: library/decimal.rst:1327 msgid "Returns the natural (base e) logarithm of *x*." msgstr "" -#: library/decimal.rst:1330 +#: library/decimal.rst:1332 msgid "Returns the base 10 logarithm of *x*." msgstr "" -#: library/decimal.rst:1335 +#: library/decimal.rst:1337 msgid "Returns the exponent of the magnitude of the operand's MSD." msgstr "" -#: library/decimal.rst:1340 +#: library/decimal.rst:1342 msgid "Applies the logical operation *and* between each operand's digits." msgstr "" -#: library/decimal.rst:1345 +#: library/decimal.rst:1347 msgid "Invert all the digits in *x*." msgstr "" -#: library/decimal.rst:1350 +#: library/decimal.rst:1352 msgid "Applies the logical operation *or* between each operand's digits." msgstr "" -#: library/decimal.rst:1355 +#: library/decimal.rst:1357 msgid "Applies the logical operation *xor* between each operand's digits." msgstr "" -#: library/decimal.rst:1360 +#: library/decimal.rst:1362 msgid "Compares two values numerically and returns the maximum." msgstr "" -#: library/decimal.rst:1375 +#: library/decimal.rst:1377 msgid "Compares the values numerically with their sign ignored." msgstr "" -#: library/decimal.rst:1370 +#: library/decimal.rst:1372 msgid "Compares two values numerically and returns the minimum." msgstr "" -#: library/decimal.rst:1380 +#: library/decimal.rst:1382 msgid "Minus corresponds to the unary prefix minus operator in Python." msgstr "" -#: library/decimal.rst:1385 +#: library/decimal.rst:1387 msgid "Return the product of *x* and *y*." msgstr "" -#: library/decimal.rst:1390 +#: library/decimal.rst:1392 msgid "Returns the largest representable number smaller than *x*." msgstr "" -#: library/decimal.rst:1395 +#: library/decimal.rst:1397 msgid "Returns the smallest representable number larger than *x*." msgstr "" -#: library/decimal.rst:1400 +#: library/decimal.rst:1402 msgid "Returns the number closest to *x*, in direction towards *y*." msgstr "" -#: library/decimal.rst:1405 +#: library/decimal.rst:1407 msgid "Reduces *x* to its simplest form." msgstr "" -#: library/decimal.rst:1410 +#: library/decimal.rst:1412 msgid "Returns an indication of the class of *x*." msgstr "" -#: library/decimal.rst:1415 +#: library/decimal.rst:1417 msgid "" "Plus corresponds to the unary prefix plus operator in Python. This " "operation applies the context precision and rounding, so it is *not* an " "identity operation." msgstr "" -#: library/decimal.rst:1422 +#: library/decimal.rst:1424 msgid "Return ``x`` to the power of ``y``, reduced modulo ``modulo`` if given." msgstr "" -#: library/decimal.rst:1424 +#: library/decimal.rst:1426 msgid "" "With two arguments, compute ``x**y``. If ``x`` is negative then ``y`` must " "be integral. The result will be inexact unless ``y`` is integral and the " @@ -1685,42 +1687,42 @@ msgid "" "in the Python version." msgstr "" -#: library/decimal.rst:1430 +#: library/decimal.rst:1432 msgid "" "``Decimal(0) ** Decimal(0)`` results in ``InvalidOperation``, and if " "``InvalidOperation`` is not trapped, then results in ``Decimal('NaN')``." msgstr "" -#: library/decimal.rst:1433 +#: library/decimal.rst:1435 msgid "" "The C module computes :meth:`power` in terms of the correctly rounded :meth:" "`exp` and :meth:`ln` functions. The result is well-defined but only \"almost " "always correctly rounded\"." msgstr "" -#: library/decimal.rst:1438 +#: library/decimal.rst:1440 msgid "" "With three arguments, compute ``(x**y) % modulo``. For the three argument " "form, the following restrictions on the arguments hold:" msgstr "" -#: library/decimal.rst:1441 +#: library/decimal.rst:1443 msgid "all three arguments must be integral" msgstr "" -#: library/decimal.rst:1442 +#: library/decimal.rst:1444 msgid "``y`` must be nonnegative" msgstr "" -#: library/decimal.rst:1443 +#: library/decimal.rst:1445 msgid "at least one of ``x`` or ``y`` must be nonzero" msgstr "" -#: library/decimal.rst:1444 +#: library/decimal.rst:1446 msgid "``modulo`` must be nonzero and have at most 'precision' digits" msgstr "" -#: library/decimal.rst:1446 +#: library/decimal.rst:1448 msgid "" "The value resulting from ``Context.power(x, y, modulo)`` is equal to the " "value that would be obtained by computing ``(x**y) % modulo`` with unbounded " @@ -1729,110 +1731,110 @@ msgid "" "result is always exact." msgstr "" -#: library/decimal.rst:1456 +#: library/decimal.rst:1458 msgid "Returns a value equal to *x* (rounded), having the exponent of *y*." msgstr "" -#: library/decimal.rst:1461 +#: library/decimal.rst:1463 msgid "Just returns 10, as this is Decimal, :)" msgstr "" -#: library/decimal.rst:1466 +#: library/decimal.rst:1468 msgid "Returns the remainder from integer division." msgstr "" -#: library/decimal.rst:1468 +#: library/decimal.rst:1470 msgid "" "The sign of the result, if non-zero, is the same as that of the original " "dividend." msgstr "" -#: library/decimal.rst:1474 +#: library/decimal.rst:1476 msgid "" "Returns ``x - y * n``, where *n* is the integer nearest the exact value of " "``x / y`` (if the result is 0 then its sign will be the sign of *x*)." msgstr "" -#: library/decimal.rst:1480 +#: library/decimal.rst:1482 msgid "Returns a rotated copy of *x*, *y* times." msgstr "" -#: library/decimal.rst:1485 +#: library/decimal.rst:1487 msgid "Returns ``True`` if the two operands have the same exponent." msgstr "" -#: library/decimal.rst:1490 +#: library/decimal.rst:1492 msgid "Returns the first operand after adding the second value its exp." msgstr "" -#: library/decimal.rst:1495 +#: library/decimal.rst:1497 msgid "Returns a shifted copy of *x*, *y* times." msgstr "" -#: library/decimal.rst:1500 +#: library/decimal.rst:1502 msgid "Square root of a non-negative number to context precision." msgstr "" -#: library/decimal.rst:1505 +#: library/decimal.rst:1507 msgid "Return the difference between *x* and *y*." msgstr "" -#: library/decimal.rst:1519 +#: library/decimal.rst:1521 msgid "Rounds to an integer." msgstr "" -#: library/decimal.rst:1524 +#: library/decimal.rst:1526 msgid "Converts a number to a string using scientific notation." msgstr "" -#: library/decimal.rst:1531 +#: library/decimal.rst:1533 msgid "Constants" msgstr "" -#: library/decimal.rst:1533 +#: library/decimal.rst:1535 msgid "" "The constants in this section are only relevant for the C module. They are " "also included in the pure Python version for compatibility." msgstr "" -#: library/decimal.rst:1537 +#: library/decimal.rst:1539 msgid "32-bit" msgstr "" -#: library/decimal.rst:1537 +#: library/decimal.rst:1539 msgid "64-bit" msgstr "" -#: library/decimal.rst:1541 +#: library/decimal.rst:1543 msgid "``425000000``" msgstr "" -#: library/decimal.rst:1541 +#: library/decimal.rst:1543 msgid "``999999999999999999``" msgstr "" -#: library/decimal.rst:1543 +#: library/decimal.rst:1545 msgid "``-425000000``" msgstr "" -#: library/decimal.rst:1543 +#: library/decimal.rst:1545 msgid "``-999999999999999999``" msgstr "" -#: library/decimal.rst:1545 +#: library/decimal.rst:1547 msgid "``-849999999``" msgstr "" -#: library/decimal.rst:1545 +#: library/decimal.rst:1547 msgid "``-1999999999999999997``" msgstr "" -#: library/decimal.rst:1551 +#: library/decimal.rst:1553 msgid "" "The value is ``True``. Deprecated, because Python now always has threads." msgstr "" -#: library/decimal.rst:1557 +#: library/decimal.rst:1559 msgid "" "The default value is ``True``. If Python is :option:`configured using the --" "without-decimal-contextvar option <--without-decimal-contextvar>`, the C " @@ -1841,55 +1843,55 @@ msgid "" "scenarios." msgstr "" -#: library/decimal.rst:1566 +#: library/decimal.rst:1568 msgid "Rounding modes" msgstr "" -#: library/decimal.rst:1570 +#: library/decimal.rst:1572 msgid "Round towards ``Infinity``." msgstr "" -#: library/decimal.rst:1574 +#: library/decimal.rst:1576 msgid "Round towards zero." msgstr "" -#: library/decimal.rst:1578 +#: library/decimal.rst:1580 msgid "Round towards ``-Infinity``." msgstr "" -#: library/decimal.rst:1582 +#: library/decimal.rst:1584 msgid "Round to nearest with ties going towards zero." msgstr "" -#: library/decimal.rst:1586 +#: library/decimal.rst:1588 msgid "Round to nearest with ties going to nearest even integer." msgstr "" -#: library/decimal.rst:1590 +#: library/decimal.rst:1592 msgid "Round to nearest with ties going away from zero." msgstr "" -#: library/decimal.rst:1594 +#: library/decimal.rst:1596 msgid "Round away from zero." msgstr "" -#: library/decimal.rst:1598 +#: library/decimal.rst:1600 msgid "" "Round away from zero if last digit after rounding towards zero would have " "been 0 or 5; otherwise round towards zero." msgstr "" -#: library/decimal.rst:1605 +#: library/decimal.rst:1607 msgid "Signals" msgstr "" -#: library/decimal.rst:1607 +#: library/decimal.rst:1609 msgid "" "Signals represent conditions that arise during computation. Each corresponds " "to one context flag and one context trap enabler." msgstr "" -#: library/decimal.rst:1610 +#: library/decimal.rst:1612 msgid "" "The context flag is set whenever the condition is encountered. After the " "computation, flags may be checked for informational purposes (for instance, " @@ -1897,7 +1899,7 @@ msgid "" "sure to clear all flags before starting the next computation." msgstr "" -#: library/decimal.rst:1615 +#: library/decimal.rst:1617 msgid "" "If the context's trap enabler is set for the signal, then the condition " "causes a Python exception to be raised. For example, if the :class:" @@ -1905,54 +1907,54 @@ msgid "" "raised upon encountering the condition." msgstr "" -#: library/decimal.rst:1623 +#: library/decimal.rst:1625 msgid "Altered an exponent to fit representation constraints." msgstr "" -#: library/decimal.rst:1625 +#: library/decimal.rst:1627 msgid "" "Typically, clamping occurs when an exponent falls outside the context's :" "attr:`~Context.Emin` and :attr:`~Context.Emax` limits. If possible, the " "exponent is reduced to fit by adding zeros to the coefficient." msgstr "" -#: library/decimal.rst:1632 +#: library/decimal.rst:1634 msgid "Base class for other signals and a subclass of :exc:`ArithmeticError`." msgstr "" -#: library/decimal.rst:1637 +#: library/decimal.rst:1639 msgid "Signals the division of a non-infinite number by zero." msgstr "" -#: library/decimal.rst:1639 +#: library/decimal.rst:1641 msgid "" "Can occur with division, modulo division, or when raising a number to a " "negative power. If this signal is not trapped, returns ``Infinity`` or ``-" "Infinity`` with the sign determined by the inputs to the calculation." msgstr "" -#: library/decimal.rst:1646 +#: library/decimal.rst:1648 msgid "Indicates that rounding occurred and the result is not exact." msgstr "" -#: library/decimal.rst:1648 +#: library/decimal.rst:1650 msgid "" "Signals when non-zero digits were discarded during rounding. The rounded " "result is returned. The signal flag or trap is used to detect when results " "are inexact." msgstr "" -#: library/decimal.rst:1655 +#: library/decimal.rst:1657 msgid "An invalid operation was performed." msgstr "" -#: library/decimal.rst:1657 +#: library/decimal.rst:1659 msgid "" "Indicates that an operation was requested that does not make sense. If not " "trapped, returns ``NaN``. Possible causes include::" msgstr "" -#: library/decimal.rst:1660 +#: library/decimal.rst:1662 msgid "" "Infinity - Infinity\n" "0 * Infinity\n" @@ -1965,11 +1967,11 @@ msgid "" "x ** Infinity" msgstr "" -#: library/decimal.rst:1673 +#: library/decimal.rst:1675 msgid "Numerical overflow." msgstr "" -#: library/decimal.rst:1675 +#: library/decimal.rst:1677 msgid "" "Indicates the exponent is larger than :attr:`Context.Emax` after rounding " "has occurred. If not trapped, the result depends on the rounding mode, " @@ -1978,42 +1980,42 @@ msgid "" "`Rounded` are also signaled." msgstr "" -#: library/decimal.rst:1684 +#: library/decimal.rst:1686 msgid "Rounding occurred though possibly no information was lost." msgstr "" -#: library/decimal.rst:1686 +#: library/decimal.rst:1688 msgid "" "Signaled whenever rounding discards digits; even if those digits are zero " "(such as rounding ``5.00`` to ``5.0``). If not trapped, returns the result " "unchanged. This signal is used to detect loss of significant digits." msgstr "" -#: library/decimal.rst:1694 +#: library/decimal.rst:1696 msgid "Exponent was lower than :attr:`~Context.Emin` prior to rounding." msgstr "" -#: library/decimal.rst:1696 +#: library/decimal.rst:1698 msgid "" "Occurs when an operation result is subnormal (the exponent is too small). If " "not trapped, returns the result unchanged." msgstr "" -#: library/decimal.rst:1702 +#: library/decimal.rst:1704 msgid "Numerical underflow with result rounded to zero." msgstr "" -#: library/decimal.rst:1704 +#: library/decimal.rst:1706 msgid "" "Occurs when a subnormal result is pushed to zero by rounding. :class:" "`Inexact` and :class:`Subnormal` are also signaled." msgstr "" -#: library/decimal.rst:1710 +#: library/decimal.rst:1712 msgid "Enable stricter semantics for mixing floats and Decimals." msgstr "" -#: library/decimal.rst:1712 +#: library/decimal.rst:1714 msgid "" "If the signal is not trapped (default), mixing floats and Decimals is " "permitted in the :class:`~decimal.Decimal` constructor, :meth:`~decimal." @@ -2024,18 +2026,18 @@ msgid "" "Context.create_decimal_from_float` do not set the flag." msgstr "" -#: library/decimal.rst:1720 +#: library/decimal.rst:1722 msgid "" "Otherwise (the signal is trapped), only equality comparisons and explicit " "conversions are silent. All other mixed operations raise :exc:" "`FloatOperation`." msgstr "" -#: library/decimal.rst:1724 +#: library/decimal.rst:1726 msgid "The following table summarizes the hierarchy of signals::" msgstr "" -#: library/decimal.rst:1726 +#: library/decimal.rst:1728 msgid "" "exceptions.ArithmeticError(exceptions.Exception)\n" " DecimalException\n" @@ -2050,15 +2052,15 @@ msgid "" " FloatOperation(DecimalException, exceptions.TypeError)" msgstr "" -#: library/decimal.rst:1745 +#: library/decimal.rst:1747 msgid "Floating-Point Notes" msgstr "" -#: library/decimal.rst:1749 +#: library/decimal.rst:1751 msgid "Mitigating round-off error with increased precision" msgstr "" -#: library/decimal.rst:1751 +#: library/decimal.rst:1753 msgid "" "The use of decimal floating point eliminates decimal representation error " "(making it possible to represent ``0.1`` exactly); however, some operations " @@ -2066,7 +2068,7 @@ msgid "" "precision." msgstr "" -#: library/decimal.rst:1755 +#: library/decimal.rst:1757 msgid "" "The effects of round-off error can be amplified by the addition or " "subtraction of nearly offsetting quantities resulting in loss of " @@ -2075,7 +2077,7 @@ msgid "" "of the associative and distributive properties of addition:" msgstr "" -#: library/decimal.rst:1761 +#: library/decimal.rst:1763 msgid "" "# Examples from Seminumerical Algorithms, Section 4.2.2.\n" ">>> from decimal import Decimal, getcontext\n" @@ -2094,13 +2096,13 @@ msgid "" "Decimal('0.0060000')" msgstr "" -#: library/decimal.rst:1779 +#: library/decimal.rst:1781 msgid "" "The :mod:`decimal` module makes it possible to restore the identities by " "expanding the precision sufficiently to avoid loss of significance:" msgstr "" -#: library/decimal.rst:1782 +#: library/decimal.rst:1784 msgid "" ">>> getcontext().prec = 20\n" ">>> u, v, w = Decimal(11111113), Decimal(-11111111), Decimal('7.51111111')\n" @@ -2116,18 +2118,18 @@ msgid "" "Decimal('0.0060000')" msgstr "" -#: library/decimal.rst:1799 +#: library/decimal.rst:1801 msgid "Special values" msgstr "" -#: library/decimal.rst:1801 +#: library/decimal.rst:1803 msgid "" "The number system for the :mod:`decimal` module provides special values " "including ``NaN``, ``sNaN``, ``-Infinity``, ``Infinity``, and two zeros, " "``+0`` and ``-0``." msgstr "" -#: library/decimal.rst:1805 +#: library/decimal.rst:1807 msgid "" "Infinities can be constructed directly with: ``Decimal('Infinity')``. Also, " "they can arise from dividing by zero when the :exc:`DivisionByZero` signal " @@ -2136,14 +2138,14 @@ msgid "" "representable number." msgstr "" -#: library/decimal.rst:1810 +#: library/decimal.rst:1812 msgid "" "The infinities are signed (affine) and can be used in arithmetic operations " "where they get treated as very large, indeterminate numbers. For instance, " "adding a constant to infinity gives another infinite result." msgstr "" -#: library/decimal.rst:1814 +#: library/decimal.rst:1816 msgid "" "Some operations are indeterminate and return ``NaN``, or if the :exc:" "`InvalidOperation` signal is trapped, raise an exception. For example, " @@ -2154,14 +2156,14 @@ msgid "" "the calculation to proceed while flagging specific results as invalid." msgstr "" -#: library/decimal.rst:1822 +#: library/decimal.rst:1824 msgid "" "A variant is ``sNaN`` which signals rather than remaining quiet after every " "operation. This is a useful return value when an invalid result needs to " "interrupt a calculation for special handling." msgstr "" -#: library/decimal.rst:1826 +#: library/decimal.rst:1828 msgid "" "The behavior of Python's comparison operators can be a little surprising " "where a ``NaN`` is involved. A test for equality where one of the operands " @@ -2178,7 +2180,7 @@ msgid "" "compare_signal` methods instead." msgstr "" -#: library/decimal.rst:1839 +#: library/decimal.rst:1841 msgid "" "The signed zeros can result from calculations that underflow. They keep the " "sign that would have resulted if the calculation had been carried out to " @@ -2186,7 +2188,7 @@ msgid "" "negative zeros are treated as equal and their sign is informational." msgstr "" -#: library/decimal.rst:1844 +#: library/decimal.rst:1846 msgid "" "In addition to the two signed zeros which are distinct yet equal, there are " "various representations of zero with differing precisions yet equivalent in " @@ -2195,11 +2197,11 @@ msgid "" "that the following calculation returns a value equal to zero:" msgstr "" -#: library/decimal.rst:1859 +#: library/decimal.rst:1861 msgid "Working with threads" msgstr "" -#: library/decimal.rst:1861 +#: library/decimal.rst:1863 msgid "" "The :func:`getcontext` function accesses a different :class:`Context` object " "for each thread. Having separate thread contexts means that threads may " @@ -2207,20 +2209,20 @@ msgid "" "other threads." msgstr "" -#: library/decimal.rst:1865 +#: library/decimal.rst:1867 msgid "" "Likewise, the :func:`setcontext` function automatically assigns its target " "to the current thread." msgstr "" -#: library/decimal.rst:1868 +#: library/decimal.rst:1870 msgid "" "If :func:`setcontext` has not been called before :func:`getcontext`, then :" "func:`getcontext` will automatically create a new context for use in the " "current thread." msgstr "" -#: library/decimal.rst:1872 +#: library/decimal.rst:1874 msgid "" "The new context is copied from a prototype context called *DefaultContext*. " "To control the defaults so that each thread will use the same values " @@ -2229,7 +2231,7 @@ msgid "" "a race condition between threads calling :func:`getcontext`. For example::" msgstr "" -#: library/decimal.rst:1878 +#: library/decimal.rst:1880 msgid "" "# Set applicationwide defaults for all threads about to be launched\n" "DefaultContext.prec = 12\n" @@ -2245,17 +2247,17 @@ msgid "" " . . ." msgstr "" -#: library/decimal.rst:1897 +#: library/decimal.rst:1899 msgid "Recipes" msgstr "" -#: library/decimal.rst:1899 +#: library/decimal.rst:1901 msgid "" "Here are a few recipes that serve as utility functions and that demonstrate " "ways to work with the :class:`Decimal` class::" msgstr "" -#: library/decimal.rst:1902 +#: library/decimal.rst:1904 msgid "" "def moneyfmt(value, places=2, curr='', sep=',', dp='.',\n" " pos='', neg='-', trailneg=''):\n" @@ -2404,41 +2406,41 @@ msgid "" " return +s" msgstr "" -#: library/decimal.rst:2054 +#: library/decimal.rst:2056 msgid "Decimal FAQ" msgstr "" -#: library/decimal.rst:2056 +#: library/decimal.rst:2058 msgid "" "Q. It is cumbersome to type ``decimal.Decimal('1234.5')``. Is there a way " "to minimize typing when using the interactive interpreter?" msgstr "" -#: library/decimal.rst:2059 +#: library/decimal.rst:2061 msgid "A. Some users abbreviate the constructor to just a single letter:" msgstr "" -#: library/decimal.rst:2065 +#: library/decimal.rst:2067 msgid "" "Q. In a fixed-point application with two decimal places, some inputs have " "many places and need to be rounded. Others are not supposed to have excess " "digits and need to be validated. What methods should be used?" msgstr "" -#: library/decimal.rst:2069 +#: library/decimal.rst:2071 msgid "" "A. The :meth:`~Decimal.quantize` method rounds to a fixed number of decimal " "places. If the :const:`Inexact` trap is set, it is also useful for " "validation:" msgstr "" -#: library/decimal.rst:2087 +#: library/decimal.rst:2089 msgid "" "Q. Once I have valid two place inputs, how do I maintain that invariant " "throughout an application?" msgstr "" -#: library/decimal.rst:2090 +#: library/decimal.rst:2092 msgid "" "A. Some operations like addition, subtraction, and multiplication by an " "integer will automatically preserve fixed point. Others operations, like " @@ -2446,13 +2448,13 @@ msgid "" "places and need to be followed-up with a :meth:`~Decimal.quantize` step:" msgstr "" -#: library/decimal.rst:2108 +#: library/decimal.rst:2110 msgid "" "In developing fixed-point applications, it is convenient to define functions " "to handle the :meth:`~Decimal.quantize` step:" msgstr "" -#: library/decimal.rst:2122 +#: library/decimal.rst:2124 msgid "" "Q. There are many ways to express the same value. The numbers ``200``, " "``200.000``, ``2E2``, and ``.02E+4`` all have the same value at various " @@ -2460,17 +2462,17 @@ msgid "" "canonical value?" msgstr "" -#: library/decimal.rst:2127 +#: library/decimal.rst:2129 msgid "" "A. The :meth:`~Decimal.normalize` method maps all equivalent values to a " "single representative:" msgstr "" -#: library/decimal.rst:2134 +#: library/decimal.rst:2136 msgid "Q. When does rounding occur in a computation?" msgstr "" -#: library/decimal.rst:2136 +#: library/decimal.rst:2138 msgid "" "A. It occurs *after* the computation. The philosophy of the decimal " "specification is that numbers are considered exact and are created " @@ -2480,7 +2482,7 @@ msgid "" "computation::" msgstr "" -#: library/decimal.rst:2143 +#: library/decimal.rst:2145 msgid "" ">>> getcontext().prec = 5\n" ">>> pi = Decimal('3.1415926535') # More than 5 digits\n" @@ -2494,13 +2496,13 @@ msgid "" "Decimal('3.1416')" msgstr "" -#: library/decimal.rst:2154 +#: library/decimal.rst:2156 msgid "" "Q. Some decimal values always print with exponential notation. Is there a " "way to get a non-exponential representation?" msgstr "" -#: library/decimal.rst:2157 +#: library/decimal.rst:2159 msgid "" "A. For some values, exponential notation is the only way to express the " "number of significant places in the coefficient. For example, expressing " @@ -2508,37 +2510,37 @@ msgid "" "original's two-place significance." msgstr "" -#: library/decimal.rst:2162 +#: library/decimal.rst:2164 msgid "" "If an application does not care about tracking significance, it is easy to " "remove the exponent and trailing zeroes, losing significance, but keeping " "the value unchanged:" msgstr "" -#: library/decimal.rst:2172 +#: library/decimal.rst:2174 msgid "Q. Is there a way to convert a regular float to a :class:`Decimal`?" msgstr "" -#: library/decimal.rst:2174 +#: library/decimal.rst:2176 msgid "" "A. Yes, any binary floating-point number can be exactly expressed as a " "Decimal though an exact conversion may take more precision than intuition " "would suggest:" msgstr "" -#: library/decimal.rst:2178 +#: library/decimal.rst:2180 msgid "" ">>> Decimal(math.pi)\n" "Decimal('3.141592653589793115997963468544185161590576171875')" msgstr "" -#: library/decimal.rst:2183 +#: library/decimal.rst:2185 msgid "" "Q. Within a complex calculation, how can I make sure that I haven't gotten a " "spurious result because of insufficient precision or rounding anomalies." msgstr "" -#: library/decimal.rst:2186 +#: library/decimal.rst:2188 msgid "" "A. The decimal module makes it easy to test results. A best practice is to " "re-run calculations using greater precision and with various rounding modes. " @@ -2546,14 +2548,14 @@ msgid "" "issues, ill-conditioned inputs, or a numerically unstable algorithm." msgstr "" -#: library/decimal.rst:2191 +#: library/decimal.rst:2193 msgid "" "Q. I noticed that context precision is applied to the results of operations " "but not to the inputs. Is there anything to watch out for when mixing " "values of different precisions?" msgstr "" -#: library/decimal.rst:2195 +#: library/decimal.rst:2197 msgid "" "A. Yes. The principle is that all values are considered to be exact and so " "is the arithmetic on those values. Only the results are rounded. The " @@ -2562,7 +2564,7 @@ msgid "" "haven't been rounded:" msgstr "" -#: library/decimal.rst:2200 +#: library/decimal.rst:2202 msgid "" ">>> getcontext().prec = 3\n" ">>> Decimal('3.104') + Decimal('2.104')\n" @@ -2571,30 +2573,30 @@ msgid "" "Decimal('5.20')" msgstr "" -#: library/decimal.rst:2208 +#: library/decimal.rst:2210 msgid "" "The solution is either to increase precision or to force rounding of inputs " "using the unary plus operation:" msgstr "" -#: library/decimal.rst:2211 +#: library/decimal.rst:2213 msgid "" ">>> getcontext().prec = 3\n" ">>> +Decimal('1.23456789') # unary plus triggers rounding\n" "Decimal('1.23')" msgstr "" -#: library/decimal.rst:2217 +#: library/decimal.rst:2219 msgid "" "Alternatively, inputs can be rounded upon creation using the :meth:`Context." "create_decimal` method:" msgstr "" -#: library/decimal.rst:2223 +#: library/decimal.rst:2225 msgid "Q. Is the CPython implementation fast for large numbers?" msgstr "" -#: library/decimal.rst:2225 +#: library/decimal.rst:2227 msgid "" "A. Yes. In the CPython and PyPy3 implementations, the C/CFFI versions of " "the decimal module integrate the high speed `libmpdec >> setcontext(Context(prec=MAX_PREC, Emax=MAX_EMAX, Emin=MIN_EMIN))\n" ">>> x = Decimal(2) ** 256\n" @@ -2629,13 +2631,13 @@ msgid "" "Decimal('904625697166532776746648320380374280103671755200316906558262375061821325312')" msgstr "" -#: library/decimal.rst:2248 +#: library/decimal.rst:2250 msgid "" "For inexact results, :const:`MAX_PREC` is far too large on 64-bit platforms " "and the available memory will be insufficient::" msgstr "" -#: library/decimal.rst:2251 +#: library/decimal.rst:2253 msgid "" ">>> Decimal(1) / 3\n" "Traceback (most recent call last):\n" @@ -2643,7 +2645,7 @@ msgid "" "MemoryError" msgstr "" -#: library/decimal.rst:2256 +#: library/decimal.rst:2258 msgid "" "On systems with overallocation (e.g. Linux), a more sophisticated approach " "is to adjust :attr:`~Context.prec` to the amount of available RAM. Suppose " @@ -2651,7 +2653,7 @@ msgid "" "of 500MB each::" msgstr "" -#: library/decimal.rst:2260 +#: library/decimal.rst:2262 msgid "" ">>> import sys\n" ">>>\n" @@ -2675,14 +2677,14 @@ msgid "" " decimal.Inexact: []" msgstr "" -#: library/decimal.rst:2280 +#: library/decimal.rst:2282 msgid "" "In general (and especially on systems without overallocation), it is " "recommended to estimate even tighter bounds and set the :attr:`Inexact` trap " "if all calculations are expected to be exact." msgstr "" -#: library/decimal.rst:2289 +#: library/decimal.rst:2291 msgid "" "This approach now works for all exact results except for non-integer powers." msgstr "" diff --git a/library/development.po b/library/development.po index 94c85d47..916aa955 100644 --- a/library/development.po +++ b/library/development.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -27,10 +27,9 @@ msgid "" "the :mod:`pydoc` module takes a module and generates documentation based on " "the module's contents. The :mod:`doctest` and :mod:`unittest` modules " "contains frameworks for writing unit tests that automatically exercise code " -"and verify that the expected output is produced. :program:`2to3` can " -"translate Python 2.x source code into valid Python 3.x code." +"and verify that the expected output is produced." msgstr "" -#: library/development.rst:14 +#: library/development.rst:13 msgid "The list of modules described in this chapter is:" msgstr "" diff --git a/library/devmode.po b/library/devmode.po index b880204a..7566fbdf 100644 --- a/library/devmode.po +++ b/library/devmode.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" diff --git a/library/dialog.po b/library/dialog.po index 80252d92..dae8dab4 100644 --- a/library/dialog.po +++ b/library/dialog.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" diff --git a/library/difflib.po b/library/difflib.po index f5e98b42..b6e3419d 100644 --- a/library/difflib.po +++ b/library/difflib.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" diff --git a/library/dis.po b/library/dis.po index ebc70231..d2b74454 100644 --- a/library/dis.po +++ b/library/dis.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -78,89 +78,104 @@ msgid "" msgstr "" #: library/dis.rst:54 +msgid "" +"The output shows logical labels rather than instruction offsets for jump " +"targets and exception handlers. The ``-O`` command line option and the " +"``show_offsets`` argument were added." +msgstr "" + +#: library/dis.rst:59 msgid "Example: Given the function :func:`!myfunc`::" msgstr "" -#: library/dis.rst:56 +#: library/dis.rst:61 msgid "" "def myfunc(alist):\n" " return len(alist)" msgstr "" -#: library/dis.rst:59 +#: library/dis.rst:64 msgid "" "the following command can be used to display the disassembly of :func:`!" "myfunc`:" msgstr "" -#: library/dis.rst:62 +#: library/dis.rst:67 msgid "" ">>> dis.dis(myfunc)\n" -" 2 0 RESUME 0\n" +" 2 RESUME 0\n" "\n" -" 3 2 LOAD_GLOBAL 1 (NULL + len)\n" -" 12 LOAD_FAST 0 (alist)\n" -" 14 CALL 1\n" -" 22 RETURN_VALUE" +" 3 LOAD_GLOBAL 1 (len + NULL)\n" +" LOAD_FAST 0 (alist)\n" +" CALL 1\n" +" RETURN_VALUE" msgstr "" -#: library/dis.rst:72 +#: library/dis.rst:77 msgid "(The \"2\" is a line number)." msgstr "" -#: library/dis.rst:77 +#: library/dis.rst:82 msgid "Command-line interface" msgstr "" -#: library/dis.rst:79 +#: library/dis.rst:84 msgid "The :mod:`dis` module can be invoked as a script from the command line:" msgstr "" -#: library/dis.rst:81 -msgid "python -m dis [-h] [infile]" +#: library/dis.rst:86 +msgid "python -m dis [-h] [-C] [-O] [infile]" msgstr "" -#: library/dis.rst:85 +#: library/dis.rst:90 msgid "The following options are accepted:" msgstr "" -#: library/dis.rst:91 +#: library/dis.rst:96 msgid "Display usage and exit." msgstr "" -#: library/dis.rst:93 +#: library/dis.rst:100 +msgid "Show inline caches." +msgstr "" + +#: library/dis.rst:106 +msgid "Show offsets of instructions." +msgstr "" + +#: library/dis.rst:110 msgid "" "If :file:`infile` is specified, its disassembled code will be written to " -"stdout. Otherwise, disassembly is performed on compiled source code recieved " +"stdout. Otherwise, disassembly is performed on compiled source code received " "from stdin." msgstr "" -#: library/dis.rst:97 +#: library/dis.rst:114 msgid "Bytecode analysis" msgstr "" -#: library/dis.rst:101 +#: library/dis.rst:118 msgid "" "The bytecode analysis API allows pieces of Python code to be wrapped in a :" "class:`Bytecode` object that provides easy access to details of the compiled " "code." msgstr "" -#: library/dis.rst:108 +#: library/dis.rst:125 msgid "" "Analyse the bytecode corresponding to a function, generator, asynchronous " "generator, coroutine, method, string of source code, or a code object (as " "returned by :func:`compile`)." msgstr "" -#: library/dis.rst:112 +#: library/dis.rst:129 msgid "" "This is a convenience wrapper around many of the functions listed below, " "most notably :func:`get_instructions`, as iterating over a :class:`Bytecode` " "instance yields the bytecode operations as :class:`Instruction` instances." msgstr "" -#: library/dis.rst:304 +#: library/dis.rst:330 msgid "" "If *first_line* is not ``None``, it indicates the line number that should be " "reported for the first source line in the disassembled code. Otherwise, the " @@ -168,64 +183,70 @@ msgid "" "code object." msgstr "" -#: library/dis.rst:121 +#: library/dis.rst:138 msgid "" "If *current_offset* is not ``None``, it refers to an instruction offset in " "the disassembled code. Setting this means :meth:`.dis` will display a " "\"current instruction\" marker against the specified opcode." msgstr "" -#: library/dis.rst:125 +#: library/dis.rst:142 msgid "" "If *show_caches* is ``True``, :meth:`.dis` will display inline cache entries " "used by the interpreter to specialize the bytecode." msgstr "" -#: library/dis.rst:128 +#: library/dis.rst:145 msgid "" "If *adaptive* is ``True``, :meth:`.dis` will display specialized bytecode " "that may be different from the original bytecode." msgstr "" -#: library/dis.rst:133 +#: library/dis.rst:148 +msgid "" +"If *show_offsets* is ``True``, :meth:`.dis` will include instruction offsets " +"in the output." +msgstr "" + +#: library/dis.rst:153 msgid "" "Construct a :class:`Bytecode` instance from the given traceback, setting " "*current_offset* to the instruction responsible for the exception." msgstr "" -#: library/dis.rst:138 +#: library/dis.rst:158 msgid "The compiled code object." msgstr "" -#: library/dis.rst:142 +#: library/dis.rst:162 msgid "The first source line of the code object (if available)" msgstr "" -#: library/dis.rst:146 +#: library/dis.rst:166 msgid "" "Return a formatted view of the bytecode operations (the same as printed by :" "func:`dis.dis`, but returned as a multi-line string)." msgstr "" -#: library/dis.rst:151 +#: library/dis.rst:171 msgid "" "Return a formatted multi-line string with detailed information about the " "code object, like :func:`code_info`." msgstr "" -#: library/dis.rst:194 library/dis.rst:246 +#: library/dis.rst:214 library/dis.rst:266 msgid "This can now handle coroutine and asynchronous generator objects." msgstr "" -#: library/dis.rst:249 library/dis.rst:292 library/dis.rst:313 +#: library/dis.rst:269 library/dis.rst:316 library/dis.rst:339 msgid "Added the *show_caches* and *adaptive* parameters." msgstr "" -#: library/dis.rst:160 +#: library/dis.rst:180 msgid "Example:" msgstr "" -#: library/dis.rst:162 +#: library/dis.rst:182 msgid "" ">>> bytecode = dis.Bytecode(myfunc)\n" ">>> for instr in bytecode:\n" @@ -238,11 +259,11 @@ msgid "" "RETURN_VALUE" msgstr "" -#: library/dis.rst:176 +#: library/dis.rst:196 msgid "Analysis functions" msgstr "" -#: library/dis.rst:178 +#: library/dis.rst:198 msgid "" "The :mod:`dis` module also defines the following analysis functions that " "convert the input directly to the desired output. They can be useful if only " @@ -250,38 +271,38 @@ msgid "" "isn't useful:" msgstr "" -#: library/dis.rst:184 +#: library/dis.rst:204 msgid "" "Return a formatted multi-line string with detailed code object information " "for the supplied function, generator, asynchronous generator, coroutine, " "method, source code string or code object." msgstr "" -#: library/dis.rst:188 +#: library/dis.rst:208 msgid "" "Note that the exact contents of code info strings are highly implementation " "dependent and they may change arbitrarily across Python VMs or Python " "releases." msgstr "" -#: library/dis.rst:200 +#: library/dis.rst:220 msgid "" "Print detailed code object information for the supplied function, method, " "source code string or code object to *file* (or ``sys.stdout`` if *file* is " "not specified)." msgstr "" -#: library/dis.rst:204 +#: library/dis.rst:224 msgid "" "This is a convenient shorthand for ``print(code_info(x), file=file)``, " "intended for interactive exploration at the interpreter prompt." msgstr "" -#: library/dis.rst:240 library/dis.rst:289 +#: library/dis.rst:260 library/dis.rst:313 msgid "Added *file* parameter." msgstr "" -#: library/dis.rst:215 +#: library/dis.rst:235 msgid "" "Disassemble the *x* object. *x* can denote either a module, a class, a " "method, a function, a generator, an asynchronous generator, a coroutine, a " @@ -297,99 +318,110 @@ msgid "" "disassembles the last traceback." msgstr "" -#: library/dis.rst:259 library/dis.rst:286 +#: library/dis.rst:280 library/dis.rst:310 msgid "" "The disassembly is written as text to the supplied *file* argument if " "provided and to ``sys.stdout`` otherwise." msgstr "" -#: library/dis.rst:231 +#: library/dis.rst:251 msgid "" "The maximal depth of recursion is limited by *depth* unless it is ``None``. " "``depth=0`` means no recursion." msgstr "" -#: library/dis.rst:234 +#: library/dis.rst:254 msgid "" "If *show_caches* is ``True``, this function will display inline cache " "entries used by the interpreter to specialize the bytecode." msgstr "" -#: library/dis.rst:237 +#: library/dis.rst:257 msgid "" "If *adaptive* is ``True``, this function will display specialized bytecode " "that may be different from the original bytecode." msgstr "" -#: library/dis.rst:243 +#: library/dis.rst:263 msgid "Implemented recursive disassembling and added *depth* parameter." msgstr "" -#: library/dis.rst:255 +#: library/dis.rst:276 msgid "" "Disassemble the top-of-stack function of a traceback, using the last " "traceback if none was passed. The instruction causing the exception is " "indicated." msgstr "" -#: library/dis.rst:272 +#: library/dis.rst:319 +msgid "Added the *show_offsets* parameter." +msgstr "" + +#: library/dis.rst:296 msgid "" "Disassemble a code object, indicating the last instruction if *lasti* was " "provided. The output is divided in the following columns:" msgstr "" -#: library/dis.rst:275 +#: library/dis.rst:299 msgid "the line number, for the first instruction of each line" msgstr "" -#: library/dis.rst:276 +#: library/dis.rst:300 msgid "the current instruction, indicated as ``-->``," msgstr "" -#: library/dis.rst:277 +#: library/dis.rst:301 msgid "a labelled instruction, indicated with ``>>``," msgstr "" -#: library/dis.rst:278 +#: library/dis.rst:302 msgid "the address of the instruction," msgstr "" -#: library/dis.rst:279 +#: library/dis.rst:303 msgid "the operation code name," msgstr "" -#: library/dis.rst:280 +#: library/dis.rst:304 msgid "operation parameters, and" msgstr "" -#: library/dis.rst:281 +#: library/dis.rst:305 msgid "interpretation of the parameters in parentheses." msgstr "" -#: library/dis.rst:283 +#: library/dis.rst:307 msgid "" "The parameter interpretation recognizes local and global variable names, " "constant values, branch targets, and compare operators." msgstr "" -#: library/dis.rst:298 +#: library/dis.rst:324 msgid "" "Return an iterator over the instructions in the supplied function, method, " "source code string or code object." msgstr "" -#: library/dis.rst:301 +#: library/dis.rst:327 msgid "" "The iterator generates a series of :class:`Instruction` named tuples giving " "the details of each operation in the supplied code." msgstr "" -#: library/dis.rst:309 +#: library/dis.rst:335 +msgid "The *adaptive* parameter works as it does in :func:`dis`." +msgstr "" + +#: library/dis.rst:342 msgid "" -"The *show_caches* and *adaptive* parameters work as they do in :func:`dis`." +"The *show_caches* parameter is deprecated and has no effect. The iterator " +"generates the :class:`Instruction` instances with the *cache_info* field " +"populated (regardless of the value of *show_caches*) and it no longer " +"generates separate items for the cache entries." msgstr "" -#: library/dis.rst:319 +#: library/dis.rst:350 msgid "" "This generator function uses the :meth:`~codeobject.co_lines` method of the :" "ref:`code object ` *code* to find the offsets which are starts " @@ -397,28 +429,33 @@ msgid "" "pairs." msgstr "" -#: library/dis.rst:324 +#: library/dis.rst:355 msgid "Line numbers can be decreasing. Before, they were always increasing." msgstr "" -#: library/dis.rst:327 +#: library/dis.rst:358 msgid "" "The :pep:`626` :meth:`~codeobject.co_lines` method is used instead of the :" "attr:`~codeobject.co_firstlineno` and :attr:`~codeobject.co_lnotab` " "attributes of the :ref:`code object `." msgstr "" -#: library/dis.rst:335 +#: library/dis.rst:363 +msgid "" +"Line numbers can be ``None`` for bytecode that does not map to source lines." +msgstr "" + +#: library/dis.rst:369 msgid "" "Detect all offsets in the raw compiled bytecode string *code* which are jump " "targets, and return a list of these offsets." msgstr "" -#: library/dis.rst:341 +#: library/dis.rst:375 msgid "Compute the stack effect of *opcode* with argument *oparg*." msgstr "" -#: library/dis.rst:343 +#: library/dis.rst:377 msgid "" "If the code has a jump target and *jump* is ``True``, :func:`~stack_effect` " "will return the stack effect of jumping. If *jump* is ``False``, it will " @@ -426,136 +463,204 @@ msgid "" "it will return the maximal stack effect of both cases." msgstr "" -#: library/dis.rst:350 +#: library/dis.rst:384 msgid "Added *jump* parameter." msgstr "" -#: library/dis.rst:357 +#: library/dis.rst:387 +msgid "" +"If ``oparg`` is omitted (or ``None``), the stack effect is now returned for " +"``oparg=0``. Previously this was an error for opcodes that use their arg. It " +"is also no longer an error to pass an integer ``oparg`` when the ``opcode`` " +"does not use it; the ``oparg`` in this case is ignored." +msgstr "" + +#: library/dis.rst:397 msgid "Python Bytecode Instructions" msgstr "" -#: library/dis.rst:359 +#: library/dis.rst:399 msgid "" "The :func:`get_instructions` function and :class:`Bytecode` class provide " "details of bytecode instructions as :class:`Instruction` instances:" msgstr "" -#: library/dis.rst:364 +#: library/dis.rst:404 msgid "Details for a bytecode operation" msgstr "" -#: library/dis.rst:368 +#: library/dis.rst:408 msgid "" "numeric code for operation, corresponding to the opcode values listed below " "and the bytecode values in the :ref:`opcode_collections`." msgstr "" -#: library/dis.rst:374 +#: library/dis.rst:414 msgid "human readable name for operation" msgstr "" -#: library/dis.rst:379 +#: library/dis.rst:419 +msgid "" +"numeric code for the base operation if operation is specialized; otherwise " +"equal to :data:`opcode`" +msgstr "" + +#: library/dis.rst:425 +msgid "" +"human readable name for the base operation if operation is specialized; " +"otherwise equal to :data:`opname`" +msgstr "" + +#: library/dis.rst:431 msgid "numeric argument to operation (if any), otherwise ``None``" msgstr "" -#: library/dis.rst:384 +#: library/dis.rst:435 +msgid "alias for :data:`arg`" +msgstr "" + +#: library/dis.rst:439 msgid "resolved arg value (if any), otherwise ``None``" msgstr "" -#: library/dis.rst:389 +#: library/dis.rst:444 msgid "" "human readable description of operation argument (if any), otherwise an " "empty string." msgstr "" -#: library/dis.rst:395 +#: library/dis.rst:450 msgid "start index of operation within bytecode sequence" msgstr "" -#: library/dis.rst:400 -msgid "line started by this opcode (if any), otherwise ``None``" +#: library/dis.rst:455 +msgid "" +"start index of operation within bytecode sequence, including prefixed " +"``EXTENDED_ARG`` operations if present; otherwise equal to :data:`offset`" +msgstr "" + +#: library/dis.rst:461 +msgid "start index of the cache entries following the operation" msgstr "" -#: library/dis.rst:405 +#: library/dis.rst:466 +msgid "end index of the cache entries following the operation" +msgstr "" + +#: library/dis.rst:471 +msgid "``True`` if this opcode starts a source line, otherwise ``False``" +msgstr "" + +#: library/dis.rst:476 +msgid "" +"source line number associated with this opcode (if any), otherwise ``None``" +msgstr "" + +#: library/dis.rst:481 msgid "``True`` if other code jumps to here, otherwise ``False``" msgstr "" -#: library/dis.rst:410 +#: library/dis.rst:486 +msgid "" +"bytecode index of the jump target if this is a jump operation, otherwise " +"``None``" +msgstr "" + +#: library/dis.rst:492 msgid "" ":class:`dis.Positions` object holding the start and end locations that are " "covered by this instruction." msgstr "" -#: library/dis.rst:417 +#: library/dis.rst:497 +msgid "" +"Information about the cache entries of this instruction, as triplets of the " +"form ``(name, size, data)``, where the ``name`` and ``size`` describe the " +"cache format and data is the contents of the cache. ``cache_info`` is " +"``None`` if the instruction does not have caches." +msgstr "" + +#: library/dis.rst:507 msgid "Field ``positions`` is added." msgstr "" -#: library/dis.rst:422 +#: library/dis.rst:511 +msgid "Changed field ``starts_line``." +msgstr "" + +#: library/dis.rst:513 +msgid "" +"Added fields ``start_offset``, ``cache_offset``, ``end_offset``, " +"``baseopname``, ``baseopcode``, ``jump_target``, ``oparg``, ``line_number`` " +"and ``cache_info``." +msgstr "" + +#: library/dis.rst:520 msgid "" "In case the information is not available, some fields might be ``None``." msgstr "" -#: library/dis.rst:432 +#: library/dis.rst:530 msgid "" "The Python compiler currently generates the following bytecode instructions." msgstr "" -#: library/dis.rst:435 +#: library/dis.rst:533 msgid "**General instructions**" msgstr "" -#: library/dis.rst:437 +#: library/dis.rst:535 msgid "" "In the following, We will refer to the interpreter stack as ``STACK`` and " "describe operations on it as if it was a Python list. The top of the stack " "corresponds to ``STACK[-1]`` in this language." msgstr "" -#: library/dis.rst:443 +#: library/dis.rst:541 msgid "" "Do nothing code. Used as a placeholder by the bytecode optimizer, and to " "generate line tracing events." msgstr "" -#: library/dis.rst:449 +#: library/dis.rst:547 msgid "Removes the top-of-stack item::" msgstr "" -#: library/dis.rst:451 +#: library/dis.rst:549 msgid "STACK.pop()" msgstr "" -#: library/dis.rst:456 +#: library/dis.rst:554 msgid "" -"Removes the top two values from the stack. Equivalent to ``POP_TOP``; " -"``POP_TOP``. Used to clean up at the end of loops, hence the name." +"Removes the top-of-stack item. Equivalent to ``POP_TOP``. Used to clean up " +"at the end of loops, hence the name." msgstr "" -#: library/dis.rst:465 +#: library/dis.rst:563 msgid "Implements ``del STACK[-2]``. Used to clean up when a generator exits." msgstr "" -#: library/dis.rst:473 +#: library/dis.rst:571 msgid "" "Push the i-th item to the top of the stack without removing it from its " "original location::" msgstr "" -#: library/dis.rst:476 +#: library/dis.rst:574 msgid "" "assert i > 0\n" "STACK.append(STACK[-i])" msgstr "" -#: library/dis.rst:484 +#: library/dis.rst:582 msgid "Swap the top of the stack with the i-th element::" msgstr "" -#: library/dis.rst:486 +#: library/dis.rst:584 msgid "STACK[-i], STACK[-1] = STACK[-1], STACK[-i]" msgstr "" -#: library/dis.rst:493 +#: library/dis.rst:591 msgid "" "Rather than being an actual instruction, this opcode is used to mark extra " "space for the interpreter to cache useful data directly in the bytecode " @@ -563,97 +668,105 @@ msgid "" "viewed with ``show_caches=True``." msgstr "" -#: library/dis.rst:498 +#: library/dis.rst:596 msgid "" "Logically, this space is part of the preceding instruction. Many opcodes " "expect to be followed by an exact number of caches, and will instruct the " "interpreter to skip over them at runtime." msgstr "" -#: library/dis.rst:502 +#: library/dis.rst:600 msgid "" "Populated caches can look like arbitrary instructions, so great care should " "be taken when reading or modifying raw, adaptive bytecode containing " "quickened data." msgstr "" -#: library/dis.rst:509 +#: library/dis.rst:607 msgid "**Unary operations**" msgstr "" -#: library/dis.rst:511 +#: library/dis.rst:609 msgid "" "Unary operations take the top of the stack, apply the operation, and push " "the result back on the stack." msgstr "" -#: library/dis.rst:517 +#: library/dis.rst:615 msgid "Implements ``STACK[-1] = -STACK[-1]``." msgstr "" -#: library/dis.rst:522 +#: library/dis.rst:620 msgid "Implements ``STACK[-1] = not STACK[-1]``." msgstr "" -#: library/dis.rst:527 +#: library/dis.rst:1318 library/dis.rst:1334 +msgid "This instruction now requires an exact :class:`bool` operand." +msgstr "" + +#: library/dis.rst:628 msgid "Implements ``STACK[-1] = ~STACK[-1]``." msgstr "" -#: library/dis.rst:532 +#: library/dis.rst:633 msgid "Implements ``STACK[-1] = iter(STACK[-1])``." msgstr "" -#: library/dis.rst:537 +#: library/dis.rst:638 msgid "" "If ``STACK[-1]`` is a :term:`generator iterator` or :term:`coroutine` object " "it is left as is. Otherwise, implements ``STACK[-1] = iter(STACK[-1])``." msgstr "" -#: library/dis.rst:543 +#: library/dis.rst:646 +msgid "Implements ``STACK[-1] = bool(STACK[-1])``." +msgstr "" + +#: library/dis.rst:651 msgid "**Binary and in-place operations**" msgstr "" -#: library/dis.rst:545 +#: library/dis.rst:653 msgid "" "Binary operations remove the top two items from the stack (``STACK[-1]`` and " "``STACK[-2]``). They perform the operation, then put the result back on the " "stack." msgstr "" -#: library/dis.rst:548 +#: library/dis.rst:656 msgid "" "In-place operations are like binary operations, but the operation is done in-" "place when ``STACK[-2]`` supports it, and the resulting ``STACK[-1]`` may be " "(but does not have to be) the original ``STACK[-2]``." msgstr "" -#: library/dis.rst:555 +#: library/dis.rst:663 msgid "" "Implements the binary and in-place operators (depending on the value of " "*op*)::" msgstr "" -#: library/dis.rst:558 +#: library/dis.rst:666 msgid "" "rhs = STACK.pop()\n" "lhs = STACK.pop()\n" "STACK.append(lhs op rhs)" msgstr "" -#: library/dis.rst:576 library/dis.rst:594 library/dis.rst:694 -#: library/dis.rst:714 library/dis.rst:946 library/dis.rst:1062 -#: library/dis.rst:1074 +#: library/dis.rst:684 library/dis.rst:702 library/dis.rst:802 +#: library/dis.rst:822 library/dis.rst:1057 library/dis.rst:1173 +#: library/dis.rst:1185 msgid "Implements::" msgstr "" -#: library/dis.rst:569 +#: library/dis.rst:677 msgid "" "key = STACK.pop()\n" "container = STACK.pop()\n" "STACK.append(container[key])" msgstr "" -#: library/dis.rst:578 +#: library/dis.rst:686 msgid "" "key = STACK.pop()\n" "container = STACK.pop()\n" @@ -661,14 +774,14 @@ msgid "" "container[key] = value" msgstr "" -#: library/dis.rst:588 +#: library/dis.rst:696 msgid "" "key = STACK.pop()\n" "container = STACK.pop()\n" "del container[key]" msgstr "" -#: library/dis.rst:596 +#: library/dis.rst:704 msgid "" "end = STACK.pop()\n" "start = STACK.pop()\n" @@ -676,7 +789,7 @@ msgid "" "STACK.append(container[start:end])" msgstr "" -#: library/dis.rst:608 +#: library/dis.rst:716 msgid "" "end = STACK.pop()\n" "start = STACK.pop()\n" @@ -685,11 +798,11 @@ msgid "" "container[start:end] = value" msgstr "" -#: library/dis.rst:617 +#: library/dis.rst:725 msgid "**Coroutine opcodes**" msgstr "" -#: library/dis.rst:621 +#: library/dis.rst:729 msgid "" "Implements ``STACK[-1] = get_awaitable(STACK[-1])``, where " "``get_awaitable(o)`` returns ``o`` if ``o`` is a coroutine object or a " @@ -697,39 +810,39 @@ msgid "" "resolves ``o.__await__``." msgstr "" -#: library/dis.rst:626 +#: library/dis.rst:734 msgid "" "If the ``where`` operand is nonzero, it indicates where the instruction " "occurs:" msgstr "" -#: library/dis.rst:629 +#: library/dis.rst:737 msgid "``1``: After a call to ``__aenter__``" msgstr "" -#: library/dis.rst:630 +#: library/dis.rst:738 msgid "``2``: After a call to ``__aexit__``" msgstr "" -#: library/dis.rst:634 +#: library/dis.rst:742 msgid "Previously, this instruction did not have an oparg." msgstr "" -#: library/dis.rst:640 +#: library/dis.rst:748 msgid "Implements ``STACK[-1] = STACK[-1].__aiter__()``." msgstr "" -#: library/dis.rst:643 +#: library/dis.rst:751 msgid "Returning awaitable objects from ``__aiter__`` is no longer supported." msgstr "" -#: library/dis.rst:650 +#: library/dis.rst:758 msgid "" "Implement ``STACK.append(get_awaitable(STACK[-1].__anext__()))`` to the " "stack. See ``GET_AWAITABLE`` for details about ``get_awaitable``." msgstr "" -#: library/dis.rst:658 +#: library/dis.rst:766 msgid "" "Terminates an :keyword:`async for` loop. Handles an exception raised when " "awaiting a next item. The stack contains the async iterable in ``STACK[-2]`` " @@ -737,12 +850,12 @@ msgid "" "is not :exc:`StopAsyncIteration`, it is re-raised." msgstr "" -#: library/dis.rst:770 library/dis.rst:781 +#: library/dis.rst:881 library/dis.rst:892 msgid "" "Exception representation on the stack now consist of one, not three, items." msgstr "" -#: library/dis.rst:671 +#: library/dis.rst:779 msgid "" "Handles an exception raised during a :meth:`~generator.throw` or :meth:" "`~generator.close` call through the current frame. If ``STACK[-1]`` is an " @@ -750,58 +863,58 @@ msgid "" "its ``value`` member. Otherwise, re-raise ``STACK[-1]``." msgstr "" -#: library/dis.rst:681 +#: library/dis.rst:789 msgid "" "Resolves ``__aenter__`` and ``__aexit__`` from ``STACK[-1]``. Pushes " "``__aexit__`` and result of ``__aenter__()`` to the stack::" msgstr "" -#: library/dis.rst:684 +#: library/dis.rst:792 msgid "STACK.extend((__aexit__, __aenter__())" msgstr "" -#: library/dis.rst:690 +#: library/dis.rst:798 msgid "**Miscellaneous opcodes**" msgstr "" -#: library/dis.rst:696 +#: library/dis.rst:804 msgid "" "item = STACK.pop()\n" "set.add(STACK[-i], item)" msgstr "" -#: library/dis.rst:699 +#: library/dis.rst:807 msgid "Used to implement set comprehensions." msgstr "" -#: library/dis.rst:706 +#: library/dis.rst:814 msgid "" "item = STACK.pop()\n" "list.append(STACK[-i], item)" msgstr "" -#: library/dis.rst:709 +#: library/dis.rst:817 msgid "Used to implement list comprehensions." msgstr "" -#: library/dis.rst:716 +#: library/dis.rst:824 msgid "" "value = STACK.pop()\n" "key = STACK.pop()\n" "dict.__setitem__(STACK[-i], key, value)" msgstr "" -#: library/dis.rst:720 +#: library/dis.rst:828 msgid "Used to implement dict comprehensions." msgstr "" -#: library/dis.rst:723 +#: library/dis.rst:831 msgid "" "Map value is ``STACK[-1]`` and map key is ``STACK[-2]``. Before, those were " "reversed." msgstr "" -#: library/dis.rst:727 +#: library/dis.rst:835 msgid "" "For all of the :opcode:`SET_ADD`, :opcode:`LIST_APPEND` and :opcode:" "`MAP_ADD` instructions, while the added value or key/value pair is popped " @@ -809,29 +922,35 @@ msgid "" "further iterations of the loop." msgstr "" -#: library/dis.rst:735 +#: library/dis.rst:843 msgid "Returns with ``STACK[-1]`` to the caller of the function." msgstr "" -#: library/dis.rst:740 +#: library/dis.rst:848 msgid "Returns with ``co_consts[consti]`` to the caller of the function." msgstr "" -#: library/dis.rst:747 +#: library/dis.rst:855 msgid "Yields ``STACK.pop()`` from a :term:`generator`." msgstr "" -#: library/dis.rst:749 +#: library/dis.rst:857 msgid "oparg set to be the stack depth." msgstr "" -#: library/dis.rst:752 +#: library/dis.rst:860 msgid "" "oparg set to be the exception block depth, for efficient closing of " "generators." msgstr "" -#: library/dis.rst:758 +#: library/dis.rst:863 +msgid "" +"oparg is ``1`` if this instruction is part of a yield-from or await, and " +"``0`` otherwise." +msgstr "" + +#: library/dis.rst:869 msgid "" "Checks whether ``__annotations__`` is defined in ``locals()``, if not it is " "set up to an empty ``dict``. This opcode is only emitted if a class or " @@ -839,39 +958,39 @@ msgid "" "statically." msgstr "" -#: library/dis.rst:768 +#: library/dis.rst:879 msgid "" "Pops a value from the stack, which is used to restore the exception state." msgstr "" -#: library/dis.rst:775 +#: library/dis.rst:886 msgid "" "Re-raises the exception currently on top of the stack. If oparg is non-zero, " "pops an additional value from the stack which is used to set :attr:`~frame." "f_lasti` of the current frame." msgstr "" -#: library/dis.rst:786 +#: library/dis.rst:897 msgid "" "Pops a value from the stack. Pushes the current exception to the top of the " "stack. Pushes the value originally popped back to the stack. Used in " "exception handlers." msgstr "" -#: library/dis.rst:794 +#: library/dis.rst:905 msgid "" "Performs exception matching for ``except``. Tests whether the ``STACK[-2]`` " "is an exception matching ``STACK[-1]``. Pops ``STACK[-1]`` and pushes the " "boolean result of the test." msgstr "" -#: library/dis.rst:802 +#: library/dis.rst:913 msgid "" "Performs exception matching for ``except*``. Applies ``split(STACK[-1])`` on " "the exception group representing ``STACK[-2]``." msgstr "" -#: library/dis.rst:805 +#: library/dis.rst:916 msgid "" "In case of a match, pops two items from the stack and pushes the non-" "matching subgroup (``None`` in case of full match) followed by the matching " @@ -879,7 +998,7 @@ msgid "" "``None``." msgstr "" -#: library/dis.rst:814 +#: library/dis.rst:925 msgid "" "Calls the function in position 4 on the stack with arguments (type, val, tb) " "representing the exception at the top of the stack. Used to implement the " @@ -887,25 +1006,25 @@ msgid "" "occurred in a :keyword:`with` statement." msgstr "" -#: library/dis.rst:821 +#: library/dis.rst:932 msgid "" "The ``__exit__`` function is in position 4 of the stack rather than 7. " "Exception representation on the stack now consist of one, not three, items." msgstr "" -#: library/dis.rst:828 +#: library/dis.rst:939 msgid "" "Pushes :exc:`AssertionError` onto the stack. Used by the :keyword:`assert` " "statement." msgstr "" -#: library/dis.rst:836 +#: library/dis.rst:947 msgid "" "Pushes :func:`!builtins.__build_class__` onto the stack. It is later called " "to construct a class." msgstr "" -#: library/dis.rst:842 +#: library/dis.rst:953 msgid "" "This opcode performs several operations before a with block starts. First, " "it loads :meth:`~object.__exit__` from the context manager and pushes it " @@ -914,13 +1033,13 @@ msgid "" "``__enter__()`` method is pushed onto the stack." msgstr "" -#: library/dis.rst:853 +#: library/dis.rst:964 msgid "" "Perform ``STACK.append(len(STACK[-1]))``. Used in :keyword:`match` " "statements where comparison with structure of pattern is needed." msgstr "" -#: library/dis.rst:861 +#: library/dis.rst:972 msgid "" "If ``STACK[-1]`` is an instance of :class:`collections.abc.Mapping` (or, " "more technically: if it has the :c:macro:`Py_TPFLAGS_MAPPING` flag set in " @@ -928,7 +1047,7 @@ msgid "" "Otherwise, push ``False``." msgstr "" -#: library/dis.rst:871 +#: library/dis.rst:982 msgid "" "If ``STACK[-1]`` is an instance of :class:`collections.abc.Sequence` and is " "*not* an instance of :class:`str`/:class:`bytes`/:class:`bytearray` (or, " @@ -937,20 +1056,20 @@ msgid "" "Otherwise, push ``False``." msgstr "" -#: library/dis.rst:881 +#: library/dis.rst:992 msgid "" "``STACK[-1]`` is a tuple of mapping keys, and ``STACK[-2]`` is the match " "subject. If ``STACK[-2]`` contains all of the keys in ``STACK[-1]``, push a :" "class:`tuple` containing the corresponding values. Otherwise, push ``None``." msgstr "" -#: library/dis.rst:1521 +#: library/dis.rst:1684 msgid "" "Previously, this instruction also pushed a boolean value indicating success " "(``True``) or failure (``False``)." msgstr "" -#: library/dis.rst:894 +#: library/dis.rst:1005 msgid "" "Implements ``name = STACK.pop()``. *namei* is the index of *name* in the " "attribute :attr:`~codeobject.co_names` of the :ref:`code object `." msgstr "" -#: library/dis.rst:907 +#: library/dis.rst:1018 msgid "" "Unpacks ``STACK[-1]`` into *count* individual values, which are put onto the " "stack right-to-left. Require there to be exactly *count* values.::" msgstr "" -#: library/dis.rst:910 +#: library/dis.rst:1021 msgid "" "assert(len(STACK[-1]) == count)\n" "STACK.extend(STACK.pop()[:-count-1:-1])" msgstr "" -#: library/dis.rst:916 +#: library/dis.rst:1027 msgid "" "Implements assignment with a starred target: Unpacks an iterable in " "``STACK[-1]`` into individual values, where the total number of values can " @@ -984,11 +1103,11 @@ msgid "" "will be a list of all leftover items." msgstr "" -#: library/dis.rst:921 +#: library/dis.rst:1032 msgid "The number of values before and after the list value is limited to 255." msgstr "" -#: library/dis.rst:923 +#: library/dis.rst:1034 msgid "" "The number of values before the list value is encoded in the argument of the " "opcode. The number of values after the list if any is encoded using an " @@ -997,63 +1116,63 @@ msgid "" "list value, the high byte of *counts* the number of values after it." msgstr "" -#: library/dis.rst:929 +#: library/dis.rst:1040 msgid "" "The extracted values are put onto the stack right-to-left, i.e. ``a, *b, c = " "d`` will be stored after execution as ``STACK.extend((a, b, c))``." msgstr "" -#: library/dis.rst:937 +#: library/dis.rst:1048 msgid "" "obj = STACK.pop()\n" "value = STACK.pop()\n" "obj.name = value" msgstr "" -#: library/dis.rst:941 +#: library/dis.rst:1052 msgid "" "where *namei* is the index of name in :attr:`~codeobject.co_names` of the :" "ref:`code object `." msgstr "" -#: library/dis.rst:948 +#: library/dis.rst:1059 msgid "" "obj = STACK.pop()\n" "del obj.name" msgstr "" -#: library/dis.rst:951 +#: library/dis.rst:1062 msgid "" "where *namei* is the index of name into :attr:`~codeobject.co_names` of the :" "ref:`code object `." msgstr "" -#: library/dis.rst:957 +#: library/dis.rst:1068 msgid "Works as :opcode:`STORE_NAME`, but stores the name as a global." msgstr "" -#: library/dis.rst:962 +#: library/dis.rst:1073 msgid "Works as :opcode:`DELETE_NAME`, but deletes a global name." msgstr "" -#: library/dis.rst:967 +#: library/dis.rst:1078 msgid "Pushes ``co_consts[consti]`` onto the stack." msgstr "" -#: library/dis.rst:972 +#: library/dis.rst:1083 msgid "" "Pushes the value associated with ``co_names[namei]`` onto the stack. The " "name is looked up within the locals, then the globals, then the builtins." msgstr "" -#: library/dis.rst:978 +#: library/dis.rst:1089 msgid "" "Pushes a reference to the locals dictionary onto the stack. This is used to " "prepare namespace dictionaries for :opcode:`LOAD_FROM_DICT_OR_DEREF` and :" "opcode:`LOAD_FROM_DICT_OR_GLOBALS`." msgstr "" -#: library/dis.rst:987 +#: library/dis.rst:1098 msgid "" "Pops a mapping off the stack and looks up the value for ``co_names[namei]``. " "If the name is not found there, looks it up in the globals and then the " @@ -1062,13 +1181,13 @@ msgid "" "bodies." msgstr "" -#: library/dis.rst:998 +#: library/dis.rst:1109 msgid "" "Creates a tuple consuming *count* items from the stack, and pushes the " "resulting tuple onto the stack::" msgstr "" -#: library/dis.rst:1001 +#: library/dis.rst:1112 msgid "" "if count == 0:\n" " value = ()\n" @@ -1079,151 +1198,162 @@ msgid "" "STACK.append(value)" msgstr "" -#: library/dis.rst:1012 +#: library/dis.rst:1123 msgid "Works as :opcode:`BUILD_TUPLE`, but creates a list." msgstr "" -#: library/dis.rst:1017 +#: library/dis.rst:1128 msgid "Works as :opcode:`BUILD_TUPLE`, but creates a set." msgstr "" -#: library/dis.rst:1022 +#: library/dis.rst:1133 msgid "" "Pushes a new dictionary object onto the stack. Pops ``2 * count`` items so " "that the dictionary holds *count* entries: ``{..., STACK[-4]: STACK[-3], " "STACK[-2]: STACK[-1]}``." msgstr "" -#: library/dis.rst:1026 +#: library/dis.rst:1137 msgid "" "The dictionary is created from stack items instead of creating an empty " "dictionary pre-sized to hold *count* items." msgstr "" -#: library/dis.rst:1033 +#: library/dis.rst:1144 msgid "" "The version of :opcode:`BUILD_MAP` specialized for constant keys. Pops the " "top element on the stack which contains a tuple of keys, then starting from " "``STACK[-2]``, pops *count* values to form values in the built dictionary." msgstr "" -#: library/dis.rst:1042 +#: library/dis.rst:1153 msgid "" "Concatenates *count* strings from the stack and pushes the resulting string " "onto the stack." msgstr "" -#: library/dis.rst:1052 +#: library/dis.rst:1163 msgid "" "seq = STACK.pop()\n" "list.extend(STACK[-i], seq)" msgstr "" -#: library/dis.rst:1055 +#: library/dis.rst:1166 msgid "Used to build lists." msgstr "" -#: library/dis.rst:1064 +#: library/dis.rst:1175 msgid "" "seq = STACK.pop()\n" "set.update(STACK[-i], seq)" msgstr "" -#: library/dis.rst:1067 +#: library/dis.rst:1178 msgid "Used to build sets." msgstr "" -#: library/dis.rst:1076 +#: library/dis.rst:1187 msgid "" "map = STACK.pop()\n" "dict.update(STACK[-i], map)" msgstr "" -#: library/dis.rst:1079 +#: library/dis.rst:1190 msgid "Used to build dicts." msgstr "" -#: library/dis.rst:1086 +#: library/dis.rst:1197 msgid "Like :opcode:`DICT_UPDATE` but raises an exception for duplicate keys." msgstr "" -#: library/dis.rst:1093 +#: library/dis.rst:1204 msgid "" "If the low bit of ``namei`` is not set, this replaces ``STACK[-1]`` with " "``getattr(STACK[-1], co_names[namei>>1])``." msgstr "" -#: library/dis.rst:1096 +#: library/dis.rst:1207 msgid "" "If the low bit of ``namei`` is set, this will attempt to load a method named " "``co_names[namei>>1]`` from the ``STACK[-1]`` object. ``STACK[-1]`` is " "popped. This bytecode distinguishes two cases: if ``STACK[-1]`` has a method " "with the correct name, the bytecode pushes the unbound method and " "``STACK[-1]``. ``STACK[-1]`` will be used as the first argument (``self``) " -"by :opcode:`CALL` when calling the unbound method. Otherwise, ``NULL`` and " -"the object returned by the attribute lookup are pushed." +"by :opcode:`CALL` or :opcode:`CALL_KW` when calling the unbound method. " +"Otherwise, ``NULL`` and the object returned by the attribute lookup are " +"pushed." msgstr "" -#: library/dis.rst:1104 +#: library/dis.rst:1216 msgid "" "If the low bit of ``namei`` is set, then a ``NULL`` or ``self`` is pushed to " "the stack before the attribute or unbound method respectively." msgstr "" -#: library/dis.rst:1111 +#: library/dis.rst:1223 msgid "" "This opcode implements :func:`super`, both in its zero-argument and two-" "argument forms (e.g. ``super().method()``, ``super().attr`` and ``super(cls, " "self).method()``, ``super(cls, self).attr``)." msgstr "" -#: library/dis.rst:1115 -msgid "" -"It pops three values from the stack (from top of stack down): - ``self``: " -"the first argument to the current method - ``cls``: the class within which " -"the current method was defined - the global ``super``" +#: library/dis.rst:1227 +msgid "It pops three values from the stack (from top of stack down):" +msgstr "" + +#: library/dis.rst:1229 +msgid "``self``: the first argument to the current method" +msgstr "" + +#: library/dis.rst:1230 +msgid "``cls``: the class within which the current method was defined" +msgstr "" + +#: library/dis.rst:1231 +msgid "the global ``super``" msgstr "" -#: library/dis.rst:1120 +#: library/dis.rst:1233 msgid "" "With respect to its argument, it works similarly to :opcode:`LOAD_ATTR`, " "except that ``namei`` is shifted left by 2 bits instead of 1." msgstr "" -#: library/dis.rst:1123 +#: library/dis.rst:1236 msgid "" "The low bit of ``namei`` signals to attempt a method load, as with :opcode:" "`LOAD_ATTR`, which results in pushing ``NULL`` and the loaded method. When " "it is unset a single value is pushed to the stack." msgstr "" -#: library/dis.rst:1127 +#: library/dis.rst:1240 msgid "" "The second-low bit of ``namei``, if set, means that this was a two-argument " "call to :func:`super` (unset means zero-argument)." msgstr "" -#: library/dis.rst:1135 +#: library/dis.rst:1248 msgid "" "Performs a Boolean operation. The operation name can be found in " -"``cmp_op[opname >> 4]``." +"``cmp_op[opname >> 5]``. If the fifth-lowest bit of ``opname`` is set " +"(``opname & 16``), the result should be coerced to ``bool``." msgstr "" -#: library/dis.rst:1138 +#: library/dis.rst:1252 msgid "" -"The cmp_op index is now stored in the four-highest bits of oparg instead of " -"the four-lowest bits of oparg." +"The fifth-lowest bit of the oparg now indicates a forced conversion to :" +"class:`bool`." msgstr "" -#: library/dis.rst:1144 +#: library/dis.rst:1259 msgid "Performs ``is`` comparison, or ``is not`` if ``invert`` is 1." msgstr "" -#: library/dis.rst:1151 +#: library/dis.rst:1266 msgid "Performs ``in`` comparison, or ``not in`` if ``invert`` is 1." msgstr "" -#: library/dis.rst:1158 +#: library/dis.rst:1273 msgid "" "Imports the module ``co_names[namei]``. ``STACK[-1]`` and ``STACK[-2]`` are " "popped and provide the *fromlist* and *level* arguments of :func:" @@ -1232,67 +1362,61 @@ msgid "" "opcode:`STORE_FAST` instruction modifies the namespace." msgstr "" -#: library/dis.rst:1166 +#: library/dis.rst:1281 msgid "" "Loads the attribute ``co_names[namei]`` from the module found in " "``STACK[-1]``. The resulting object is pushed onto the stack, to be " "subsequently stored by a :opcode:`STORE_FAST` instruction." msgstr "" -#: library/dis.rst:1173 +#: library/dis.rst:1288 msgid "Increments bytecode counter by *delta*." msgstr "" -#: library/dis.rst:1178 +#: library/dis.rst:1293 msgid "Decrements bytecode counter by *delta*. Checks for interrupts." msgstr "" -#: library/dis.rst:1185 +#: library/dis.rst:1300 msgid "Decrements bytecode counter by *delta*. Does not check for interrupts." msgstr "" -#: library/dis.rst:1192 +#: library/dis.rst:1307 msgid "" "If ``STACK[-1]`` is true, increments the bytecode counter by *delta*. " "``STACK[-1]`` is popped." msgstr "" -#: library/dis.rst:1208 +#: library/dis.rst:1326 msgid "" "The oparg is now a relative delta rather than an absolute target. This " "opcode is a pseudo-instruction, replaced in final bytecode by the directed " "versions (forward/backward)." msgstr "" -#: library/dis.rst:1213 library/dis.rst:1240 +#: library/dis.rst:1331 library/dis.rst:1355 msgid "This is no longer a pseudo-instruction." msgstr "" -#: library/dis.rst:1205 +#: library/dis.rst:1323 msgid "" "If ``STACK[-1]`` is false, increments the bytecode counter by *delta*. " "``STACK[-1]`` is popped." msgstr "" -#: library/dis.rst:1218 +#: library/dis.rst:1339 msgid "" "If ``STACK[-1]`` is not ``None``, increments the bytecode counter by " "*delta*. ``STACK[-1]`` is popped." msgstr "" -#: library/dis.rst:1235 -msgid "" -"This opcode is a pseudo-instruction, replaced in final bytecode by the " -"directed versions (forward/backward)." -msgstr "" - -#: library/dis.rst:1232 +#: library/dis.rst:1350 msgid "" "If ``STACK[-1]`` is ``None``, increments the bytecode counter by *delta*. " "``STACK[-1]`` is popped." msgstr "" -#: library/dis.rst:1245 +#: library/dis.rst:1360 msgid "" "``STACK[-1]`` is an :term:`iterator`. Call its :meth:`~iterator.__next__` " "method. If this yields a new value, push it on the stack (leaving the " @@ -1300,184 +1424,206 @@ msgid "" "code counter is incremented by *delta*." msgstr "" -#: library/dis.rst:1250 +#: library/dis.rst:1365 msgid "Up until 3.11 the iterator was popped when it was exhausted." msgstr "" -#: library/dis.rst:1255 +#: library/dis.rst:1370 msgid "Loads the global named ``co_names[namei>>1]`` onto the stack." msgstr "" -#: library/dis.rst:1257 +#: library/dis.rst:1372 msgid "" "If the low bit of ``namei`` is set, then a ``NULL`` is pushed to the stack " "before the global variable." msgstr "" -#: library/dis.rst:1263 +#: library/dis.rst:1378 msgid "" "Pushes a reference to the local ``co_varnames[var_num]`` onto the stack." msgstr "" -#: library/dis.rst:1265 +#: library/dis.rst:1380 msgid "" "This opcode is now only used in situations where the local variable is " "guaranteed to be initialized. It cannot raise :exc:`UnboundLocalError`." msgstr "" -#: library/dis.rst:1271 +#: library/dis.rst:1386 +msgid "" +"Pushes references to ``co_varnames[var_nums >> 4]`` and " +"``co_varnames[var_nums & 15]`` onto the stack." +msgstr "" + +#: library/dis.rst:1393 msgid "" "Pushes a reference to the local ``co_varnames[var_num]`` onto the stack, " "raising an :exc:`UnboundLocalError` if the local variable has not been " "initialized." msgstr "" -#: library/dis.rst:1279 +#: library/dis.rst:1401 msgid "" "Pushes a reference to the local ``co_varnames[var_num]`` onto the stack (or " "pushes ``NULL`` onto the stack if the local variable has not been " "initialized) and sets ``co_varnames[var_num]`` to ``NULL``." msgstr "" -#: library/dis.rst:1287 +#: library/dis.rst:1409 msgid "Stores ``STACK.pop()`` into the local ``co_varnames[var_num]``." msgstr "" -#: library/dis.rst:1292 -msgid "Deletes local ``co_varnames[var_num]``." -msgstr "" - -#: library/dis.rst:1297 +#: library/dis.rst:1413 msgid "" -"Creates a new cell in slot ``i``. If that slot is nonempty then that value " -"is stored into the new cell." +"Stores ``STACK[-1]`` into ``co_varnames[var_nums >> 4]`` and ``STACK[-2]`` " +"into ``co_varnames[var_nums & 15]``." msgstr "" -#: library/dis.rst:1305 +#: library/dis.rst:1420 msgid "" -"Pushes a reference to the cell contained in slot ``i`` of the \"fast " -"locals\" storage. The name of the variable is ``co_fastlocalnames[i]``." +"Stores ``STACK.pop()`` into the local ``co_varnames[var_nums >> 4]`` and " +"pushes a reference to the local ``co_varnames[var_nums & 15]`` onto the " +"stack." msgstr "" -#: library/dis.rst:1308 -msgid "" -"Note that ``LOAD_CLOSURE`` is effectively an alias for ``LOAD_FAST``. It " -"exists to keep bytecode a little more readable." +#: library/dis.rst:1428 +msgid "Deletes local ``co_varnames[var_num]``." msgstr "" -#: library/dis.rst:1311 -msgid "``i`` is no longer offset by the length of ``co_varnames``." +#: library/dis.rst:1433 +msgid "" +"Creates a new cell in slot ``i``. If that slot is nonempty then that value " +"is stored into the new cell." msgstr "" -#: library/dis.rst:1317 +#: library/dis.rst:1441 msgid "" "Loads the cell contained in slot ``i`` of the \"fast locals\" storage. " "Pushes a reference to the object the cell contains on the stack." msgstr "" -#: library/dis.rst:1342 library/dis.rst:1353 +#: library/dis.rst:1466 library/dis.rst:1477 msgid "" "``i`` is no longer offset by the length of :attr:`~codeobject.co_varnames`." msgstr "" -#: library/dis.rst:1326 +#: library/dis.rst:1450 msgid "" "Pops a mapping off the stack and looks up the name associated with slot " "``i`` of the \"fast locals\" storage in this mapping. If the name is not " "found there, loads it from the cell contained in slot ``i``, similar to :" -"opcode:`LOAD_DEREF`. This is used for loading free variables in class bodies " -"(which previously used :opcode:`!LOAD_CLASSDEREF`) and in :ref:`annotation " -"scopes ` within class bodies." +"opcode:`LOAD_DEREF`. This is used for loading :term:`closure variables " +"` in class bodies (which previously used :opcode:`!" +"LOAD_CLASSDEREF`) and in :ref:`annotation scopes ` within " +"class bodies." msgstr "" -#: library/dis.rst:1339 +#: library/dis.rst:1463 msgid "" "Stores ``STACK.pop()`` into the cell contained in slot ``i`` of the \"fast " "locals\" storage." msgstr "" -#: library/dis.rst:1348 +#: library/dis.rst:1472 msgid "" "Empties the cell contained in slot ``i`` of the \"fast locals\" storage. " "Used by the :keyword:`del` statement." msgstr "" -#: library/dis.rst:1359 +#: library/dis.rst:1483 msgid "" -"Copies the ``n`` free variables from the closure into the frame. Removes the " -"need for special code on the caller's side when calling closures." +"Copies the ``n`` :term:`free (closure) variables ` from " +"the closure into the frame. Removes the need for special code on the " +"caller's side when calling closures." msgstr "" -#: library/dis.rst:1368 +#: library/dis.rst:1492 msgid "" "Raises an exception using one of the 3 forms of the ``raise`` statement, " "depending on the value of *argc*:" msgstr "" -#: library/dis.rst:1371 +#: library/dis.rst:1495 msgid "0: ``raise`` (re-raise previous exception)" msgstr "" -#: library/dis.rst:1372 +#: library/dis.rst:1496 msgid "" "1: ``raise STACK[-1]`` (raise exception instance or type at ``STACK[-1]``)" msgstr "" -#: library/dis.rst:1373 +#: library/dis.rst:1497 msgid "" "2: ``raise STACK[-2] from STACK[-1]`` (raise exception instance or type at " "``STACK[-2]`` with ``__cause__`` set to ``STACK[-1]``)" msgstr "" -#: library/dis.rst:1379 +#: library/dis.rst:1503 msgid "" -"Calls a callable object with the number of arguments specified by ``argc``, " -"including the named arguments specified by the preceding :opcode:`KW_NAMES`, " -"if any. On the stack are (in ascending order), either:" +"Calls a callable object with the number of arguments specified by ``argc``. " +"On the stack are (in ascending order):" msgstr "" -#: library/dis.rst:1384 -msgid "NULL" +#: library/dis.rst:1530 +msgid "The callable" msgstr "" -#: library/dis.rst:1391 -msgid "The callable" +#: library/dis.rst:1531 +msgid "``self`` or ``NULL``" msgstr "" -#: library/dis.rst:1386 -msgid "The positional arguments" +#: library/dis.rst:1532 +msgid "The remaining positional arguments" msgstr "" -#: library/dis.rst:1394 -msgid "The named arguments" +#: library/dis.rst:1510 +msgid "``argc`` is the total of the positional arguments, excluding ``self``." msgstr "" -#: library/dis.rst:1389 -msgid "or:" +#: library/dis.rst:1512 +msgid "" +"``CALL`` pops all arguments and the callable object off the stack, calls the " +"callable object with those arguments, and pushes the return value returned " +"by the callable object." msgstr "" -#: library/dis.rst:1392 -msgid "``self``" +#: library/dis.rst:1518 +msgid "The callable now always appears at the same position on the stack." msgstr "" -#: library/dis.rst:1393 -msgid "The remaining positional arguments" +#: library/dis.rst:1521 +msgid "Calls with keyword arguments are now handled by :opcode:`CALL_KW`." msgstr "" -#: library/dis.rst:1396 +#: library/dis.rst:1527 +msgid "" +"Calls a callable object with the number of arguments specified by ``argc``, " +"including one or more named arguments. On the stack are (in ascending order):" +msgstr "" + +#: library/dis.rst:1533 +msgid "The named arguments" +msgstr "" + +#: library/dis.rst:1534 +msgid "A :class:`tuple` of keyword argument names" +msgstr "" + +#: library/dis.rst:1536 msgid "" "``argc`` is the total of the positional and named arguments, excluding " -"``self`` when a ``NULL`` is not present." +"``self``. The length of the tuple of keyword argument names is the number of " +"named arguments." msgstr "" -#: library/dis.rst:1399 +#: library/dis.rst:1539 msgid "" -"``CALL`` pops all arguments and the callable object off the stack, calls the " -"callable object with those arguments, and pushes the return value returned " -"by the callable object." +"``CALL_KW`` pops all arguments, the keyword names, and the callable object " +"off the stack, calls the callable object with those arguments, and pushes " +"the return value returned by the callable object." msgstr "" -#: library/dis.rst:1408 +#: library/dis.rst:1548 msgid "" "Calls a callable object with variable set of positional and keyword " "arguments. If the lowest bit of *flags* is set, the top of the stack " @@ -1489,73 +1635,76 @@ msgid "" "arguments, and pushes the return value returned by the callable object." msgstr "" -#: library/dis.rst:1423 +#: library/dis.rst:1563 msgid "" "Pushes a ``NULL`` to the stack. Used in the call sequence to match the " "``NULL`` pushed by :opcode:`LOAD_METHOD` for non-method calls." msgstr "" -#: library/dis.rst:1432 +#: library/dis.rst:1572 msgid "" -"Prefixes :opcode:`CALL`. Stores a reference to ``co_consts[consti]`` into an " -"internal variable for use by :opcode:`CALL`. ``co_consts[consti]`` must be a " -"tuple of strings." +"Pushes a new function object on the stack built from the code object at " +"``STACK[-1]``." msgstr "" -#: library/dis.rst:1441 +#: library/dis.rst:1574 +msgid "Flag value ``0x04`` is a tuple of strings instead of dictionary" +msgstr "" + +#: library/dis.rst:1577 +msgid "Qualified name at ``STACK[-1]`` was removed." +msgstr "" + +#: library/dis.rst:1580 msgid "" -"Pushes a new function object on the stack. From bottom to top, the consumed " -"stack must consist of values if the argument carries a specified flag value" +"Extra function attributes on the stack, signaled by oparg flags, were " +"removed. They now use :opcode:`SET_FUNCTION_ATTRIBUTE`." msgstr "" -#: library/dis.rst:1444 +#: library/dis.rst:1587 +msgid "" +"Sets an attribute on a function object. Expects the function at " +"``STACK[-1]`` and the attribute value to set at ``STACK[-2]``; consumes both " +"and leaves the function at ``STACK[-1]``. The flag determines which " +"attribute to set:" +msgstr "" + +#: library/dis.rst:1591 msgid "" "``0x01`` a tuple of default values for positional-only and positional-or-" "keyword parameters in positional order" msgstr "" -#: library/dis.rst:1446 +#: library/dis.rst:1593 msgid "``0x02`` a dictionary of keyword-only parameters' default values" msgstr "" -#: library/dis.rst:1447 +#: library/dis.rst:1594 msgid "``0x04`` a tuple of strings containing parameters' annotations" msgstr "" -#: library/dis.rst:1448 +#: library/dis.rst:1595 msgid "``0x08`` a tuple containing cells for free variables, making a closure" msgstr "" -#: library/dis.rst:1449 -msgid "the code associated with the function (at ``STACK[-1]``)" -msgstr "" - -#: library/dis.rst:1451 -msgid "Flag value ``0x04`` is a tuple of strings instead of dictionary" -msgstr "" - -#: library/dis.rst:1454 -msgid "Qualified name at ``STACK[-1]`` was removed." -msgstr "" - -#: library/dis.rst:1462 +#: library/dis.rst:1604 msgid "" "Pushes a slice object on the stack. *argc* must be 2 or 3. If it is 2, " "implements::" msgstr "" -#: library/dis.rst:1464 +#: library/dis.rst:1606 msgid "" "end = STACK.pop()\n" "start = STACK.pop()\n" "STACK.append(slice(start, end))" msgstr "" -#: library/dis.rst:1468 +#: library/dis.rst:1610 msgid "if it is 3, implements::" msgstr "" -#: library/dis.rst:1470 +#: library/dis.rst:1612 msgid "" "step = STACK.pop()\n" "end = STACK.pop()\n" @@ -1563,11 +1712,11 @@ msgid "" "STACK.append(slice(start, end, step))" msgstr "" -#: library/dis.rst:1475 +#: library/dis.rst:1617 msgid "See the :func:`slice` built-in function for more information." msgstr "" -#: library/dis.rst:1480 +#: library/dis.rst:1622 msgid "" "Prefixes any opcode which has an argument too big to fit into the default " "one byte. *ext* holds an additional byte which act as higher bits in the " @@ -1575,54 +1724,64 @@ msgid "" "allowed, forming an argument from two-byte to four-byte." msgstr "" -#: library/dis.rst:1488 +#: library/dis.rst:1630 +msgid "Convert value to a string, depending on ``oparg``::" +msgstr "" + +#: library/dis.rst:1632 msgid "" -"Used for implementing formatted literal strings (f-strings). Pops an " -"optional *fmt_spec* from the stack, then a required *value*. *flags* is " -"interpreted as follows:" +"value = STACK.pop()\n" +"result = func(value)\n" +"STACK.append(result)" msgstr "" -#: library/dis.rst:1492 -msgid "``(flags & 0x03) == 0x00``: *value* is formatted as-is." +#: library/dis.rst:1636 +msgid "``oparg == 1``: call :func:`str` on *value*" msgstr "" -#: library/dis.rst:1493 -msgid "" -"``(flags & 0x03) == 0x01``: call :func:`str` on *value* before formatting it." +#: library/dis.rst:1637 +msgid "``oparg == 2``: call :func:`repr` on *value*" msgstr "" -#: library/dis.rst:1495 -msgid "" -"``(flags & 0x03) == 0x02``: call :func:`repr` on *value* before formatting " -"it." +#: library/dis.rst:1638 +msgid "``oparg == 3``: call :func:`ascii` on *value*" msgstr "" -#: library/dis.rst:1497 -msgid "" -"``(flags & 0x03) == 0x03``: call :func:`ascii` on *value* before formatting " -"it." +#: library/dis.rst:1653 library/dis.rst:1666 +msgid "Used for implementing formatted string literals (f-strings)." +msgstr "" + +#: library/dis.rst:1647 +msgid "Formats the value on top of stack::" msgstr "" -#: library/dis.rst:1499 +#: library/dis.rst:1649 msgid "" -"``(flags & 0x04) == 0x04``: pop *fmt_spec* from the stack and use it, else " -"use an empty *fmt_spec*." +"value = STACK.pop()\n" +"result = value.__format__(\"\")\n" +"STACK.append(result)" msgstr "" -#: library/dis.rst:1502 +#: library/dis.rst:1659 +msgid "Formats the given value with the given format spec::" +msgstr "" + +#: library/dis.rst:1661 msgid "" -"Formatting is performed using :c:func:`PyObject_Format`. The result is " -"pushed on the stack." +"spec = STACK.pop()\n" +"value = STACK.pop()\n" +"result = value.__format__(spec)\n" +"STACK.append(result)" msgstr "" -#: library/dis.rst:1510 +#: library/dis.rst:1673 msgid "" "``STACK[-1]`` is a tuple of keyword attribute names, ``STACK[-2]`` is the " "class being matched against, and ``STACK[-3]`` is the match subject. " "*count* is the number of positional sub-patterns." msgstr "" -#: library/dis.rst:1514 +#: library/dis.rst:1677 msgid "" "Pop ``STACK[-1]``, ``STACK[-2]``, and ``STACK[-3]``. If ``STACK[-3]`` is an " "instance of ``STACK[-2]`` and has the positional and keyword attributes " @@ -1630,265 +1789,281 @@ msgid "" "Otherwise, push ``None``." msgstr "" -#: library/dis.rst:1528 +#: library/dis.rst:1691 msgid "A no-op. Performs internal tracing, debugging and optimization checks." msgstr "" -#: library/dis.rst:1530 -msgid "The ``where`` operand marks where the ``RESUME`` occurs:" +#: library/dis.rst:1693 +msgid "" +"The ``context`` oparand consists of two parts. The lowest two bits indicate " +"where the ``RESUME`` occurs:" msgstr "" -#: library/dis.rst:1532 +#: library/dis.rst:1696 msgid "" "``0`` The start of a function, which is neither a generator, coroutine nor " "an async generator" msgstr "" -#: library/dis.rst:1534 +#: library/dis.rst:1698 msgid "``1`` After a ``yield`` expression" msgstr "" -#: library/dis.rst:1535 +#: library/dis.rst:1699 msgid "``2`` After a ``yield from`` expression" msgstr "" -#: library/dis.rst:1536 +#: library/dis.rst:1700 msgid "``3`` After an ``await`` expression" msgstr "" -#: library/dis.rst:1543 +#: library/dis.rst:1702 +msgid "" +"The next bit is ``1`` if the RESUME is at except-depth ``1``, and ``0`` " +"otherwise." +msgstr "" + +#: library/dis.rst:1707 +msgid "The oparg value changed to include information about except-depth" +msgstr "" + +#: library/dis.rst:1713 msgid "" "Create a generator, coroutine, or async generator from the current frame. " "Used as first opcode of in code object for the above mentioned callables. " "Clear the current frame and return the newly created generator." msgstr "" -#: library/dis.rst:1552 +#: library/dis.rst:1722 msgid "" "Equivalent to ``STACK[-1] = STACK[-2].send(STACK[-1])``. Used in ``yield " "from`` and ``await`` statements." msgstr "" -#: library/dis.rst:1555 +#: library/dis.rst:1725 msgid "" "If the call raises :exc:`StopIteration`, pop the top value from the stack, " "push the exception's ``value`` attribute, and increment the bytecode counter " "by *delta*." msgstr "" -#: library/dis.rst:1564 +#: library/dis.rst:1734 msgid "" "This is not really an opcode. It identifies the dividing line between " "opcodes in the range [0,255] which don't use their argument and those that " "do (``< HAVE_ARGUMENT`` and ``>= HAVE_ARGUMENT``, respectively)." msgstr "" -#: library/dis.rst:1568 +#: library/dis.rst:1738 msgid "" -"If your application uses pseudo instructions, use the :data:`hasarg` " -"collection instead." +"If your application uses pseudo instructions or specialized instructions, " +"use the :data:`hasarg` collection instead." msgstr "" -#: library/dis.rst:1571 +#: library/dis.rst:1741 msgid "" "Now every instruction has an argument, but opcodes ``< HAVE_ARGUMENT`` " "ignore it. Before, only opcodes ``>= HAVE_ARGUMENT`` had an argument." msgstr "" -#: library/dis.rst:1575 +#: library/dis.rst:1745 msgid "" "Pseudo instructions were added to the :mod:`dis` module, and for them it is " "not true that comparison with ``HAVE_ARGUMENT`` indicates whether they use " "their arg." msgstr "" -#: library/dis.rst:1583 +#: library/dis.rst:1750 +msgid "Use :data:`hasarg` instead." +msgstr "" + +#: library/dis.rst:1755 msgid "" "Calls an intrinsic function with one argument. Passes ``STACK[-1]`` as the " "argument and sets ``STACK[-1]`` to the result. Used to implement " "functionality that is not performance critical." msgstr "" -#: library/dis.rst:1641 +#: library/dis.rst:1813 msgid "The operand determines which intrinsic function is called:" msgstr "" -#: library/dis.rst:1644 +#: library/dis.rst:1816 msgid "Operand" msgstr "" -#: library/dis.rst:1644 +#: library/dis.rst:1816 msgid "Description" msgstr "" -#: library/dis.rst:1592 +#: library/dis.rst:1764 msgid "``INTRINSIC_1_INVALID``" msgstr "" -#: library/dis.rst:1646 +#: library/dis.rst:1818 msgid "Not valid" msgstr "" -#: library/dis.rst:1594 +#: library/dis.rst:1766 msgid "``INTRINSIC_PRINT``" msgstr "" -#: library/dis.rst:1594 +#: library/dis.rst:1766 msgid "Prints the argument to standard out. Used in the REPL." msgstr "" -#: library/dis.rst:1597 +#: library/dis.rst:1769 msgid "``INTRINSIC_IMPORT_STAR``" msgstr "" -#: library/dis.rst:1597 +#: library/dis.rst:1769 msgid "Performs ``import *`` for the named module." msgstr "" -#: library/dis.rst:1600 +#: library/dis.rst:1772 msgid "``INTRINSIC_STOPITERATION_ERROR``" msgstr "" -#: library/dis.rst:1600 +#: library/dis.rst:1772 msgid "Extracts the return value from a ``StopIteration`` exception." msgstr "" -#: library/dis.rst:1603 +#: library/dis.rst:1775 msgid "``INTRINSIC_ASYNC_GEN_WRAP``" msgstr "" -#: library/dis.rst:1603 +#: library/dis.rst:1775 msgid "Wraps an async generator value" msgstr "" -#: library/dis.rst:1605 +#: library/dis.rst:1777 msgid "``INTRINSIC_UNARY_POSITIVE``" msgstr "" -#: library/dis.rst:1605 +#: library/dis.rst:1777 msgid "Performs the unary ``+`` operation" msgstr "" -#: library/dis.rst:1608 +#: library/dis.rst:1780 msgid "``INTRINSIC_LIST_TO_TUPLE``" msgstr "" -#: library/dis.rst:1608 +#: library/dis.rst:1780 msgid "Converts a list to a tuple" msgstr "" -#: library/dis.rst:1610 +#: library/dis.rst:1782 msgid "``INTRINSIC_TYPEVAR``" msgstr "" -#: library/dis.rst:1610 +#: library/dis.rst:1782 msgid "Creates a :class:`typing.TypeVar`" msgstr "" -#: library/dis.rst:1612 +#: library/dis.rst:1784 msgid "``INTRINSIC_PARAMSPEC``" msgstr "" -#: library/dis.rst:1612 +#: library/dis.rst:1784 msgid "Creates a :class:`typing.ParamSpec`" msgstr "" -#: library/dis.rst:1615 +#: library/dis.rst:1787 msgid "``INTRINSIC_TYPEVARTUPLE``" msgstr "" -#: library/dis.rst:1615 +#: library/dis.rst:1787 msgid "Creates a :class:`typing.TypeVarTuple`" msgstr "" -#: library/dis.rst:1618 +#: library/dis.rst:1790 msgid "``INTRINSIC_SUBSCRIPT_GENERIC``" msgstr "" -#: library/dis.rst:1618 +#: library/dis.rst:1790 msgid "Returns :class:`typing.Generic` subscripted with the argument" msgstr "" -#: library/dis.rst:1621 +#: library/dis.rst:1793 msgid "``INTRINSIC_TYPEALIAS``" msgstr "" -#: library/dis.rst:1621 +#: library/dis.rst:1793 msgid "" "Creates a :class:`typing.TypeAliasType`; used in the :keyword:`type` " "statement. The argument is a tuple of the type alias's name, type " "parameters, and value." msgstr "" -#: library/dis.rst:1633 +#: library/dis.rst:1805 msgid "" "Calls an intrinsic function with two arguments. Used to implement " "functionality that is not performance critical::" msgstr "" -#: library/dis.rst:1636 +#: library/dis.rst:1808 msgid "" "arg2 = STACK.pop()\n" "arg1 = STACK.pop()\n" "result = intrinsic2(arg1, arg2)\n" -"STACK.push(result)" +"STACK.append(result)" msgstr "" -#: library/dis.rst:1646 +#: library/dis.rst:1818 msgid "``INTRINSIC_2_INVALID``" msgstr "" -#: library/dis.rst:1648 +#: library/dis.rst:1820 msgid "``INTRINSIC_PREP_RERAISE_STAR``" msgstr "" -#: library/dis.rst:1648 +#: library/dis.rst:1820 msgid "Calculates the :exc:`ExceptionGroup` to raise from a ``try-except*``." msgstr "" -#: library/dis.rst:1652 +#: library/dis.rst:1824 msgid "``INTRINSIC_TYPEVAR_WITH_BOUND``" msgstr "" -#: library/dis.rst:1652 +#: library/dis.rst:1824 msgid "Creates a :class:`typing.TypeVar` with a bound." msgstr "" -#: library/dis.rst:1655 +#: library/dis.rst:1827 msgid "``INTRINSIC_TYPEVAR_WITH_CONSTRAINTS``" msgstr "" -#: library/dis.rst:1655 +#: library/dis.rst:1827 msgid "Creates a :class:`typing.TypeVar` with constraints." msgstr "" -#: library/dis.rst:1659 +#: library/dis.rst:1831 msgid "``INTRINSIC_SET_FUNCTION_TYPE_PARAMS``" msgstr "" -#: library/dis.rst:1659 +#: library/dis.rst:1831 msgid "Sets the ``__type_params__`` attribute of a function." msgstr "" -#: library/dis.rst:1666 +#: library/dis.rst:1838 msgid "**Pseudo-instructions**" msgstr "" -#: library/dis.rst:1668 +#: library/dis.rst:1840 msgid "" "These opcodes do not appear in Python bytecode. They are used by the " "compiler but are replaced by real opcodes or removed before bytecode is " "generated." msgstr "" -#: library/dis.rst:1673 +#: library/dis.rst:1845 msgid "" "Set up an exception handler for the following code block. If an exception " "occurs, the value stack level is restored to its current state and control " "is transferred to the exception handler at ``target``." msgstr "" -#: library/dis.rst:1680 +#: library/dis.rst:1852 msgid "" "Like ``SETUP_FINALLY``, but in case of an exception also pushes the last " "instruction (``lasti``) to the stack so that ``RERAISE`` can restore it. If " @@ -1897,111 +2072,139 @@ msgid "" "exception handler at ``target``." msgstr "" -#: library/dis.rst:1689 +#: library/dis.rst:1861 msgid "" "Like ``SETUP_CLEANUP``, but in case of an exception one more item is popped " "from the stack before control is transferred to the exception handler at " "``target``." msgstr "" -#: library/dis.rst:1693 +#: library/dis.rst:1865 msgid "" "This variant is used in :keyword:`with` and :keyword:`async with` " "constructs, which push the return value of the context manager's :meth:" "`~object.__enter__` or :meth:`~object.__aenter__` to the stack." msgstr "" -#: library/dis.rst:1700 +#: library/dis.rst:1872 msgid "" "Marks the end of the code block associated with the last ``SETUP_FINALLY``, " "``SETUP_CLEANUP`` or ``SETUP_WITH``." msgstr "" -#: library/dis.rst:1706 +#: library/dis.rst:1878 msgid "" "Undirected relative jump instructions which are replaced by their directed " "(forward/backward) counterparts by the assembler." msgstr "" -#: library/dis.rst:1711 +#: library/dis.rst:1883 +msgid "" +"Pushes a reference to the cell contained in slot ``i`` of the \"fast " +"locals\" storage." +msgstr "" + +#: library/dis.rst:1886 +msgid "" +"Note that ``LOAD_CLOSURE`` is replaced with ``LOAD_FAST`` in the assembler." +msgstr "" + +#: library/dis.rst:1888 +msgid "This opcode is now a pseudo-instruction." +msgstr "" + +#: library/dis.rst:1894 msgid "" "Optimized unbound method lookup. Emitted as a ``LOAD_ATTR`` opcode with a " "flag set in the arg." msgstr "" -#: library/dis.rst:1718 +#: library/dis.rst:1901 msgid "Opcode collections" msgstr "" -#: library/dis.rst:1720 +#: library/dis.rst:1903 msgid "" "These collections are provided for automatic introspection of bytecode " "instructions:" msgstr "" -#: library/dis.rst:1723 +#: library/dis.rst:1906 msgid "" "The collections now contain pseudo instructions and instrumented " "instructions as well. These are opcodes with values ``>= MIN_PSEUDO_OPCODE`` " "and ``>= MIN_INSTRUMENTED_OPCODE``." msgstr "" -#: library/dis.rst:1730 +#: library/dis.rst:1913 msgid "Sequence of operation names, indexable using the bytecode." msgstr "" -#: library/dis.rst:1735 +#: library/dis.rst:1918 msgid "Dictionary mapping operation names to bytecodes." msgstr "" -#: library/dis.rst:1740 +#: library/dis.rst:1923 msgid "Sequence of all compare operation names." msgstr "" -#: library/dis.rst:1745 +#: library/dis.rst:1928 msgid "Sequence of bytecodes that use their argument." msgstr "" -#: library/dis.rst:1752 +#: library/dis.rst:1935 msgid "Sequence of bytecodes that access a constant." msgstr "" -#: library/dis.rst:1757 +#: library/dis.rst:1940 msgid "" -"Sequence of bytecodes that access a free variable. 'free' in this context " -"refers to names in the current scope that are referenced by inner scopes or " -"names in outer scopes that are referenced from this scope. It does *not* " -"include references to global or builtin scopes." +"Sequence of bytecodes that access a :term:`free (closure) variable `. 'free' in this context refers to names in the current scope that " +"are referenced by inner scopes or names in outer scopes that are referenced " +"from this scope. It does *not* include references to global or builtin " +"scopes." msgstr "" -#: library/dis.rst:1765 +#: library/dis.rst:1948 msgid "Sequence of bytecodes that access an attribute by name." msgstr "" -#: library/dis.rst:1770 -msgid "Sequence of bytecodes that have a relative jump target." +#: library/dis.rst:1953 +msgid "Sequence of bytecodes that have a jump target. All jumps are relative." msgstr "" -#: library/dis.rst:1775 -msgid "Sequence of bytecodes that have an absolute jump target." -msgstr "" - -#: library/dis.rst:1780 +#: library/dis.rst:1960 msgid "Sequence of bytecodes that access a local variable." msgstr "" -#: library/dis.rst:1785 +#: library/dis.rst:1965 msgid "Sequence of bytecodes of Boolean operations." msgstr "" -#: library/dis.rst:1789 +#: library/dis.rst:1969 msgid "Sequence of bytecodes that set an exception handler." msgstr "" -#: library/dis.rst:1460 +#: library/dis.rst:1976 +msgid "Sequence of bytecodes that have a relative jump target." +msgstr "" + +#: library/dis.rst:1978 +msgid "All jumps are now relative. Use :data:`hasjump`." +msgstr "" + +#: library/dis.rst:1984 +msgid "Sequence of bytecodes that have an absolute jump target." +msgstr "" + +#: library/dis.rst:1986 +msgid "All jumps are now relative. This list is empty." +msgstr "" + +#: library/dis.rst:1602 msgid "built-in function" msgstr "" -#: library/dis.rst:1460 +#: library/dis.rst:1602 msgid "slice" msgstr "" diff --git a/library/distribution.po b/library/distribution.po index 23ff23b9..d8e7d378 100644 --- a/library/distribution.po +++ b/library/distribution.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" diff --git a/library/distutils.po b/library/distutils.po index aa4c9e85..3faf8864 100644 --- a/library/distutils.po +++ b/library/distutils.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" diff --git a/library/doctest.po b/library/doctest.po index aabdcd67..75c626c5 100644 --- a/library/doctest.po +++ b/library/doctest.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -162,10 +162,10 @@ msgid "" " OverflowError: n too large\n" "ok\n" "2 items passed all tests:\n" -" 1 tests in __main__\n" -" 8 tests in __main__.factorial\n" -"9 tests in 2 items.\n" -"9 passed and 0 failed.\n" +" 1 test in __main__\n" +" 6 tests in __main__.factorial\n" +"7 tests in 2 items.\n" +"7 passed.\n" "Test passed.\n" "$" msgstr "" @@ -1283,14 +1283,14 @@ msgid "" "continue running examples." msgstr "" -#: library/doctest.rst:1093 +#: library/doctest.rst:1094 msgid "" "Optional argument *parser* specifies a :class:`DocTestParser` (or subclass) " "that should be used to extract tests from the files. It defaults to a " "normal parser (i.e., ``DocTestParser()``)." msgstr "" -#: library/doctest.rst:1097 +#: library/doctest.rst:1098 msgid "" "Optional argument *encoding* specifies an encoding that should be used to " "convert the file to unicode." @@ -1431,24 +1431,26 @@ msgid "" "framework and runs the interactive examples in each file. If an example in " "any file fails, then the synthesized unit test fails, and a :exc:" "`failureException` exception is raised showing the name of the file " -"containing the test and a (sometimes approximate) line number." +"containing the test and a (sometimes approximate) line number. If all the " +"examples in a file are skipped, then the synthesized unit test is also " +"marked as skipped." msgstr "" -#: library/doctest.rst:1048 +#: library/doctest.rst:1049 msgid "Pass one or more paths (as strings) to text files to be examined." msgstr "" -#: library/doctest.rst:1050 +#: library/doctest.rst:1051 msgid "Options may be provided as keyword arguments:" msgstr "" -#: library/doctest.rst:1052 +#: library/doctest.rst:1053 msgid "" "Optional argument *module_relative* specifies how the filenames in *paths* " "should be interpreted:" msgstr "" -#: library/doctest.rst:1055 +#: library/doctest.rst:1056 msgid "" "If *module_relative* is ``True`` (the default), then each filename in " "*paths* specifies an OS-independent module-relative path. By default, this " @@ -1459,14 +1461,14 @@ msgid "" "``)." msgstr "" -#: library/doctest.rst:1063 +#: library/doctest.rst:1064 msgid "" "If *module_relative* is ``False``, then each filename in *paths* specifies " "an OS-specific path. The path may be absolute or relative; relative paths " "are resolved with respect to the current working directory." msgstr "" -#: library/doctest.rst:1067 +#: library/doctest.rst:1068 msgid "" "Optional argument *package* is a Python package or the name of a Python " "package whose directory should be used as the base directory for module-" @@ -1476,7 +1478,7 @@ msgid "" "``False``." msgstr "" -#: library/doctest.rst:1074 +#: library/doctest.rst:1075 msgid "" "Optional argument *setUp* specifies a set-up function for the test suite. " "This is called before running the tests in each file. The *setUp* function " @@ -1484,7 +1486,7 @@ msgid "" "test globals as the *globs* attribute of the test passed." msgstr "" -#: library/doctest.rst:1079 +#: library/doctest.rst:1080 msgid "" "Optional argument *tearDown* specifies a tear-down function for the test " "suite. This is called after running the tests in each file. The *tearDown* " @@ -1492,14 +1494,14 @@ msgid "" "access the test globals as the *globs* attribute of the test passed." msgstr "" -#: library/doctest.rst:1118 +#: library/doctest.rst:1120 msgid "" "Optional argument *globs* is a dictionary containing the initial global " "variables for the tests. A new copy of this dictionary is created for each " "test. By default, *globs* is a new empty dictionary." msgstr "" -#: library/doctest.rst:1088 +#: library/doctest.rst:1089 msgid "" "Optional argument *optionflags* specifies the default doctest options for " "the tests, created by or-ing together individual option flags. See section :" @@ -1507,61 +1509,62 @@ msgid "" "for a better way to set reporting options." msgstr "" -#: library/doctest.rst:1100 +#: library/doctest.rst:1101 msgid "" "The global ``__file__`` is added to the globals provided to doctests loaded " "from a text file using :func:`DocFileSuite`." msgstr "" -#: library/doctest.rst:1106 +#: library/doctest.rst:1107 msgid "Convert doctest tests for a module to a :class:`unittest.TestSuite`." msgstr "" -#: library/doctest.rst:1108 +#: library/doctest.rst:1109 msgid "" "The returned :class:`unittest.TestSuite` is to be run by the unittest " "framework and runs each doctest in the module. If any of the doctests fail, " "then the synthesized unit test fails, and a :exc:`failureException` " "exception is raised showing the name of the file containing the test and a " -"(sometimes approximate) line number." +"(sometimes approximate) line number. If all the examples in a docstring are " +"skipped, then the synthesized unit test is also marked as skipped." msgstr "" -#: library/doctest.rst:1114 +#: library/doctest.rst:1116 msgid "" "Optional argument *module* provides the module to be tested. It can be a " "module object or a (possibly dotted) module name. If not specified, the " "module calling this function is used." msgstr "" -#: library/doctest.rst:1122 +#: library/doctest.rst:1124 msgid "" "Optional argument *extraglobs* specifies an extra set of global variables, " "which is merged into *globs*. By default, no extra globals are used." msgstr "" -#: library/doctest.rst:1125 +#: library/doctest.rst:1127 msgid "" "Optional argument *test_finder* is the :class:`DocTestFinder` object (or a " "drop-in replacement) that is used to extract doctests from the module." msgstr "" -#: library/doctest.rst:1128 +#: library/doctest.rst:1130 msgid "" "Optional arguments *setUp*, *tearDown*, and *optionflags* are the same as " "for function :func:`DocFileSuite` above." msgstr "" -#: library/doctest.rst:1131 +#: library/doctest.rst:1133 msgid "This function uses the same search technique as :func:`testmod`." msgstr "" -#: library/doctest.rst:1133 +#: library/doctest.rst:1135 msgid "" ":func:`DocTestSuite` returns an empty :class:`unittest.TestSuite` if " "*module* contains no docstrings instead of raising :exc:`ValueError`." msgstr "" -#: library/doctest.rst:1139 +#: library/doctest.rst:1141 msgid "" "When doctests which have been converted to unit tests by :func:" "`DocFileSuite` or :func:`DocTestSuite` fail, this exception is raised " @@ -1569,7 +1572,7 @@ msgid "" "approximate) line number." msgstr "" -#: library/doctest.rst:1143 +#: library/doctest.rst:1145 msgid "" "Under the covers, :func:`DocTestSuite` creates a :class:`unittest.TestSuite` " "out of :class:`!doctest.DocTestCase` instances, and :class:`!DocTestCase` is " @@ -1578,14 +1581,14 @@ msgid "" "questions about the exact details of :mod:`unittest` integration." msgstr "" -#: library/doctest.rst:1149 +#: library/doctest.rst:1151 msgid "" "Similarly, :func:`DocFileSuite` creates a :class:`unittest.TestSuite` out " "of :class:`!doctest.DocFileCase` instances, and :class:`!DocFileCase` is a " "subclass of :class:`!DocTestCase`." msgstr "" -#: library/doctest.rst:1153 +#: library/doctest.rst:1155 msgid "" "So both ways of creating a :class:`unittest.TestSuite` run instances of :" "class:`!DocTestCase`. This is important for a subtle reason: when you run :" @@ -1598,23 +1601,23 @@ msgid "" "through :mod:`unittest` to :mod:`doctest` test runners." msgstr "" -#: library/doctest.rst:1163 +#: library/doctest.rst:1165 msgid "" "For this reason, :mod:`doctest` also supports a notion of :mod:`doctest` " "reporting flags specific to :mod:`unittest` support, via this function:" msgstr "" -#: library/doctest.rst:1169 +#: library/doctest.rst:1171 msgid "Set the :mod:`doctest` reporting flags to use." msgstr "" -#: library/doctest.rst:1171 +#: library/doctest.rst:1173 msgid "" "Argument *flags* takes the :ref:`bitwise OR ` of option flags. See " "section :ref:`doctest-options`. Only \"reporting flags\" can be used." msgstr "" -#: library/doctest.rst:1174 +#: library/doctest.rst:1176 msgid "" "This is a module-global setting, and affects all future doctests run by " "module :mod:`unittest`: the :meth:`!runTest` method of :class:`!" @@ -1628,17 +1631,17 @@ msgid "" "`!doctest`'s :mod:`unittest` reporting flags are ignored." msgstr "" -#: library/doctest.rst:1185 +#: library/doctest.rst:1187 msgid "" "The value of the :mod:`unittest` reporting flags in effect before the " "function was called is returned by the function." msgstr "" -#: library/doctest.rst:1192 +#: library/doctest.rst:1194 msgid "Advanced API" msgstr "" -#: library/doctest.rst:1194 +#: library/doctest.rst:1196 msgid "" "The basic API is a simple wrapper that's intended to make doctest easy to " "use. It is fairly flexible, and should meet most users' needs; however, if " @@ -1646,62 +1649,62 @@ msgid "" "doctest's capabilities, then you should use the advanced API." msgstr "" -#: library/doctest.rst:1199 +#: library/doctest.rst:1201 msgid "" "The advanced API revolves around two container classes, which are used to " "store the interactive examples extracted from doctest cases:" msgstr "" -#: library/doctest.rst:1202 +#: library/doctest.rst:1204 msgid "" ":class:`Example`: A single Python :term:`statement`, paired with its " "expected output." msgstr "" -#: library/doctest.rst:1205 +#: library/doctest.rst:1207 msgid "" ":class:`DocTest`: A collection of :class:`Example`\\ s, typically extracted " "from a single docstring or text file." msgstr "" -#: library/doctest.rst:1208 +#: library/doctest.rst:1210 msgid "" "Additional processing classes are defined to find, parse, and run, and check " "doctest examples:" msgstr "" -#: library/doctest.rst:1211 +#: library/doctest.rst:1213 msgid "" ":class:`DocTestFinder`: Finds all docstrings in a given module, and uses a :" "class:`DocTestParser` to create a :class:`DocTest` from every docstring that " "contains interactive examples." msgstr "" -#: library/doctest.rst:1215 +#: library/doctest.rst:1217 msgid "" ":class:`DocTestParser`: Creates a :class:`DocTest` object from a string " "(such as an object's docstring)." msgstr "" -#: library/doctest.rst:1218 +#: library/doctest.rst:1220 msgid "" ":class:`DocTestRunner`: Executes the examples in a :class:`DocTest`, and " "uses an :class:`OutputChecker` to verify their output." msgstr "" -#: library/doctest.rst:1221 +#: library/doctest.rst:1223 msgid "" ":class:`OutputChecker`: Compares the actual output from a doctest example " "with the expected output, and decides whether they match." msgstr "" -#: library/doctest.rst:1224 +#: library/doctest.rst:1226 msgid "" "The relationships among these processing classes are summarized in the " "following diagram::" msgstr "" -#: library/doctest.rst:1227 +#: library/doctest.rst:1229 msgid "" " list of:\n" "+------+ +---------+\n" @@ -1713,30 +1716,30 @@ msgid "" " +---------+" msgstr "" -#: library/doctest.rst:1240 +#: library/doctest.rst:1242 msgid "DocTest Objects" msgstr "" -#: library/doctest.rst:1245 +#: library/doctest.rst:1247 msgid "" "A collection of doctest examples that should be run in a single namespace. " "The constructor arguments are used to initialize the attributes of the same " "names." msgstr "" -#: library/doctest.rst:1249 +#: library/doctest.rst:1251 msgid "" ":class:`DocTest` defines the following attributes. They are initialized by " "the constructor, and should not be modified directly." msgstr "" -#: library/doctest.rst:1255 +#: library/doctest.rst:1257 msgid "" "A list of :class:`Example` objects encoding the individual interactive " "Python examples that should be run by this test." msgstr "" -#: library/doctest.rst:1261 +#: library/doctest.rst:1263 msgid "" "The namespace (aka globals) that the examples should be run in. This is a " "dictionary mapping names to values. Any changes to the namespace made by " @@ -1744,57 +1747,57 @@ msgid "" "`globs` after the test is run." msgstr "" -#: library/doctest.rst:1269 +#: library/doctest.rst:1271 msgid "" "A string name identifying the :class:`DocTest`. Typically, this is the name " "of the object or file that the test was extracted from." msgstr "" -#: library/doctest.rst:1275 +#: library/doctest.rst:1277 msgid "" "The name of the file that this :class:`DocTest` was extracted from; or " "``None`` if the filename is unknown, or if the :class:`DocTest` was not " "extracted from a file." msgstr "" -#: library/doctest.rst:1282 +#: library/doctest.rst:1284 msgid "" "The line number within :attr:`filename` where this :class:`DocTest` begins, " "or ``None`` if the line number is unavailable. This line number is zero-" "based with respect to the beginning of the file." msgstr "" -#: library/doctest.rst:1289 +#: library/doctest.rst:1291 msgid "" "The string that the test was extracted from, or ``None`` if the string is " "unavailable, or if the test was not extracted from a string." msgstr "" -#: library/doctest.rst:1296 +#: library/doctest.rst:1298 msgid "Example Objects" msgstr "" -#: library/doctest.rst:1301 +#: library/doctest.rst:1303 msgid "" "A single interactive example, consisting of a Python statement and its " "expected output. The constructor arguments are used to initialize the " "attributes of the same names." msgstr "" -#: library/doctest.rst:1306 +#: library/doctest.rst:1308 msgid "" ":class:`Example` defines the following attributes. They are initialized by " "the constructor, and should not be modified directly." msgstr "" -#: library/doctest.rst:1312 +#: library/doctest.rst:1314 msgid "" "A string containing the example's source code. This source code consists of " "a single Python statement, and always ends with a newline; the constructor " "adds a newline when necessary." msgstr "" -#: library/doctest.rst:1319 +#: library/doctest.rst:1321 msgid "" "The expected output from running the example's source code (either from " "stdout, or a traceback in case of exception). :attr:`want` ends with a " @@ -1802,7 +1805,7 @@ msgid "" "The constructor adds a newline when necessary." msgstr "" -#: library/doctest.rst:1327 +#: library/doctest.rst:1329 msgid "" "The exception message generated by the example, if the example is expected " "to generate an exception; or ``None`` if it is not expected to generate an " @@ -1811,20 +1814,20 @@ msgid "" "unless it's ``None``. The constructor adds a newline if needed." msgstr "" -#: library/doctest.rst:1336 +#: library/doctest.rst:1338 msgid "" "The line number within the string containing this example where the example " "begins. This line number is zero-based with respect to the beginning of the " "containing string." msgstr "" -#: library/doctest.rst:1343 +#: library/doctest.rst:1345 msgid "" "The example's indentation in the containing string, i.e., the number of " "space characters that precede the example's first prompt." msgstr "" -#: library/doctest.rst:1349 +#: library/doctest.rst:1351 msgid "" "A dictionary mapping from option flags to ``True`` or ``False``, which is " "used to override default options for this example. Any option flags not " @@ -1833,11 +1836,11 @@ msgid "" "default, no options are set." msgstr "" -#: library/doctest.rst:1359 +#: library/doctest.rst:1361 msgid "DocTestFinder objects" msgstr "" -#: library/doctest.rst:1364 +#: library/doctest.rst:1366 msgid "" "A processing class used to extract the :class:`DocTest`\\ s that are " "relevant to a given object, from its docstring and the docstrings of its " @@ -1845,48 +1848,48 @@ msgid "" "classes, functions, methods, staticmethods, classmethods, and properties." msgstr "" -#: library/doctest.rst:1369 +#: library/doctest.rst:1371 msgid "" "The optional argument *verbose* can be used to display the objects searched " "by the finder. It defaults to ``False`` (no output)." msgstr "" -#: library/doctest.rst:1372 +#: library/doctest.rst:1374 msgid "" "The optional argument *parser* specifies the :class:`DocTestParser` object " "(or a drop-in replacement) that is used to extract doctests from docstrings." msgstr "" -#: library/doctest.rst:1375 +#: library/doctest.rst:1377 msgid "" "If the optional argument *recurse* is false, then :meth:`DocTestFinder.find` " "will only examine the given object, and not any contained objects." msgstr "" -#: library/doctest.rst:1378 +#: library/doctest.rst:1380 msgid "" "If the optional argument *exclude_empty* is false, then :meth:`DocTestFinder." "find` will include tests for objects with empty docstrings." msgstr "" -#: library/doctest.rst:1382 +#: library/doctest.rst:1384 msgid ":class:`DocTestFinder` defines the following method:" msgstr "" -#: library/doctest.rst:1387 +#: library/doctest.rst:1389 msgid "" "Return a list of the :class:`DocTest`\\ s that are defined by *obj*'s " "docstring, or by any of its contained objects' docstrings." msgstr "" -#: library/doctest.rst:1390 +#: library/doctest.rst:1392 msgid "" "The optional argument *name* specifies the object's name; this name will be " "used to construct names for the returned :class:`DocTest`\\ s. If *name* is " "not specified, then ``obj.__name__`` is used." msgstr "" -#: library/doctest.rst:1394 +#: library/doctest.rst:1396 msgid "" "The optional parameter *module* is the module that contains the given " "object. If the module is not specified or is ``None``, then the test finder " @@ -1894,26 +1897,26 @@ msgid "" "module is used:" msgstr "" -#: library/doctest.rst:1398 +#: library/doctest.rst:1400 msgid "As a default namespace, if *globs* is not specified." msgstr "" -#: library/doctest.rst:1400 +#: library/doctest.rst:1402 msgid "" "To prevent the DocTestFinder from extracting DocTests from objects that are " "imported from other modules. (Contained objects with modules other than " "*module* are ignored.)" msgstr "" -#: library/doctest.rst:1404 +#: library/doctest.rst:1406 msgid "To find the name of the file containing the object." msgstr "" -#: library/doctest.rst:1406 +#: library/doctest.rst:1408 msgid "To help find the line number of the object within its file." msgstr "" -#: library/doctest.rst:1408 +#: library/doctest.rst:1410 msgid "" "If *module* is ``False``, no attempt to find the module will be made. This " "is obscure, of use mostly in testing doctest itself: if *module* is " @@ -1922,7 +1925,7 @@ msgid "" "contained objects will (recursively) be searched for doctests." msgstr "" -#: library/doctest.rst:1414 +#: library/doctest.rst:1416 msgid "" "The globals for each :class:`DocTest` is formed by combining *globs* and " "*extraglobs* (bindings in *extraglobs* override bindings in *globs*). A new " @@ -1932,34 +1935,34 @@ msgid "" "defaults to ``{}``." msgstr "" -#: library/doctest.rst:1425 +#: library/doctest.rst:1427 msgid "DocTestParser objects" msgstr "" -#: library/doctest.rst:1430 +#: library/doctest.rst:1432 msgid "" "A processing class used to extract interactive examples from a string, and " "use them to create a :class:`DocTest` object." msgstr "" -#: library/doctest.rst:1434 +#: library/doctest.rst:1436 msgid ":class:`DocTestParser` defines the following methods:" msgstr "" -#: library/doctest.rst:1439 +#: library/doctest.rst:1441 msgid "" "Extract all doctest examples from the given string, and collect them into a :" "class:`DocTest` object." msgstr "" -#: library/doctest.rst:1442 +#: library/doctest.rst:1444 msgid "" "*globs*, *name*, *filename*, and *lineno* are attributes for the new :class:" "`DocTest` object. See the documentation for :class:`DocTest` for more " "information." msgstr "" -#: library/doctest.rst:1449 +#: library/doctest.rst:1451 msgid "" "Extract all doctest examples from the given string, and return them as a " "list of :class:`Example` objects. Line numbers are 0-based. The optional " @@ -1967,7 +1970,7 @@ msgid "" "error messages." msgstr "" -#: library/doctest.rst:1456 +#: library/doctest.rst:1458 msgid "" "Divide the given string into examples and intervening text, and return them " "as a list of alternating :class:`Example`\\ s and strings. Line numbers for " @@ -1976,16 +1979,32 @@ msgid "" msgstr "" #: library/doctest.rst:1465 +msgid "TestResults objects" +msgstr "" + +#: library/doctest.rst:1472 +msgid "Number of failed tests." +msgstr "" + +#: library/doctest.rst:1476 +msgid "Number of attempted tests." +msgstr "" + +#: library/doctest.rst:1480 +msgid "Number of skipped tests." +msgstr "" + +#: library/doctest.rst:1488 msgid "DocTestRunner objects" msgstr "" -#: library/doctest.rst:1470 +#: library/doctest.rst:1493 msgid "" "A processing class used to execute and verify the interactive examples in a :" "class:`DocTest`." msgstr "" -#: library/doctest.rst:1473 +#: library/doctest.rst:1496 msgid "" "The comparison between expected outputs and actual outputs is done by an :" "class:`OutputChecker`. This comparison may be customized with a number of " @@ -1995,7 +2014,7 @@ msgid "" "constructor." msgstr "" -#: library/doctest.rst:1479 +#: library/doctest.rst:1502 msgid "" "The test runner's display output can be controlled in two ways. First, an " "output function can be passed to :meth:`run`; this function will be called " @@ -2006,14 +2025,14 @@ msgid "" "`report_unexpected_exception`, and :meth:`report_failure`." msgstr "" -#: library/doctest.rst:1487 +#: library/doctest.rst:1510 msgid "" "The optional keyword argument *checker* specifies the :class:`OutputChecker` " "object (or drop-in replacement) that should be used to compare the expected " "outputs to the actual outputs of doctest examples." msgstr "" -#: library/doctest.rst:1491 +#: library/doctest.rst:1514 msgid "" "The optional keyword argument *verbose* controls the :class:" "`DocTestRunner`'s verbosity. If *verbose* is ``True``, then information is " @@ -2022,60 +2041,68 @@ msgid "" "verbose output is used iff the command-line switch ``-v`` is used." msgstr "" -#: library/doctest.rst:1497 +#: library/doctest.rst:1520 msgid "" "The optional keyword argument *optionflags* can be used to control how the " "test runner compares expected output to actual output, and how it displays " "failures. For more information, see section :ref:`doctest-options`." msgstr "" -#: library/doctest.rst:1502 +#: library/doctest.rst:1524 +msgid "" +"The test runner accumulates statistics. The aggregated number of attempted, " +"failed and skipped examples is also available via the :attr:`tries`, :attr:" +"`failures` and :attr:`skips` attributes. The :meth:`run` and :meth:" +"`summarize` methods return a :class:`TestResults` instance." +msgstr "" + +#: library/doctest.rst:1529 msgid ":class:`DocTestRunner` defines the following methods:" msgstr "" -#: library/doctest.rst:1507 +#: library/doctest.rst:1534 msgid "" "Report that the test runner is about to process the given example. This " "method is provided to allow subclasses of :class:`DocTestRunner` to " "customize their output; it should not be called directly." msgstr "" -#: library/doctest.rst:1511 +#: library/doctest.rst:1538 msgid "" "*example* is the example about to be processed. *test* is the test " "*containing example*. *out* is the output function that was passed to :meth:" "`DocTestRunner.run`." msgstr "" -#: library/doctest.rst:1518 +#: library/doctest.rst:1545 msgid "" "Report that the given example ran successfully. This method is provided to " "allow subclasses of :class:`DocTestRunner` to customize their output; it " "should not be called directly." msgstr "" -#: library/doctest.rst:1533 +#: library/doctest.rst:1560 msgid "" "*example* is the example about to be processed. *got* is the actual output " "from the example. *test* is the test containing *example*. *out* is the " "output function that was passed to :meth:`DocTestRunner.run`." msgstr "" -#: library/doctest.rst:1529 +#: library/doctest.rst:1556 msgid "" "Report that the given example failed. This method is provided to allow " "subclasses of :class:`DocTestRunner` to customize their output; it should " "not be called directly." msgstr "" -#: library/doctest.rst:1540 +#: library/doctest.rst:1567 msgid "" "Report that the given example raised an unexpected exception. This method is " "provided to allow subclasses of :class:`DocTestRunner` to customize their " "output; it should not be called directly." msgstr "" -#: library/doctest.rst:1544 +#: library/doctest.rst:1571 msgid "" "*example* is the example about to be processed. *exc_info* is a tuple " "containing information about the unexpected exception (as returned by :func:" @@ -2083,13 +2110,14 @@ msgid "" "output function that was passed to :meth:`DocTestRunner.run`." msgstr "" -#: library/doctest.rst:1552 +#: library/doctest.rst:1579 msgid "" "Run the examples in *test* (a :class:`DocTest` object), and display the " -"results using the writer function *out*." +"results using the writer function *out*. Return a :class:`TestResults` " +"instance." msgstr "" -#: library/doctest.rst:1555 +#: library/doctest.rst:1583 msgid "" "The examples are run in the namespace ``test.globs``. If *clear_globs* is " "true (the default), then this namespace will be cleared after the test runs, " @@ -2097,39 +2125,54 @@ msgid "" "after the test completes, then use *clear_globs=False*." msgstr "" -#: library/doctest.rst:1560 +#: library/doctest.rst:1588 msgid "" "*compileflags* gives the set of flags that should be used by the Python " "compiler when running the examples. If not specified, then it will default " "to the set of future-import flags that apply to *globs*." msgstr "" -#: library/doctest.rst:1564 +#: library/doctest.rst:1592 msgid "" "The output of each example is checked using the :class:`DocTestRunner`'s " "output checker, and the results are formatted by the :meth:`!DocTestRunner." "report_\\*` methods." msgstr "" -#: library/doctest.rst:1571 +#: library/doctest.rst:1599 msgid "" "Print a summary of all the test cases that have been run by this " -"DocTestRunner, and return a :term:`named tuple` ``TestResults(failed, " -"attempted)``." +"DocTestRunner, and return a :class:`TestResults` instance." msgstr "" -#: library/doctest.rst:1574 +#: library/doctest.rst:1602 msgid "" "The optional *verbose* argument controls how detailed the summary is. If " "the verbosity is not specified, then the :class:`DocTestRunner`'s verbosity " "is used." msgstr "" -#: library/doctest.rst:1581 +#: library/doctest.rst:1606 +msgid ":class:`DocTestParser` has the following attributes:" +msgstr "" + +#: library/doctest.rst:1610 +msgid "Number of attempted examples." +msgstr "" + +#: library/doctest.rst:1614 +msgid "Number of failed examples." +msgstr "" + +#: library/doctest.rst:1618 +msgid "Number of skipped examples." +msgstr "" + +#: library/doctest.rst:1626 msgid "OutputChecker objects" msgstr "" -#: library/doctest.rst:1586 +#: library/doctest.rst:1631 msgid "" "A class used to check the whether the actual output from a doctest example " "matches the expected output. :class:`OutputChecker` defines two methods: :" @@ -2138,11 +2181,11 @@ msgid "" "string describing the differences between two outputs." msgstr "" -#: library/doctest.rst:1593 +#: library/doctest.rst:1638 msgid ":class:`OutputChecker` defines the following methods:" msgstr "" -#: library/doctest.rst:1597 +#: library/doctest.rst:1642 msgid "" "Return ``True`` iff the actual output from an example (*got*) matches the " "expected output (*want*). These strings are always considered to match if " @@ -2151,28 +2194,28 @@ msgid "" "`doctest-options` for more information about option flags." msgstr "" -#: library/doctest.rst:1606 +#: library/doctest.rst:1651 msgid "" "Return a string describing the differences between the expected output for a " "given example (*example*) and the actual output (*got*). *optionflags* is " "the set of option flags used to compare *want* and *got*." msgstr "" -#: library/doctest.rst:1614 +#: library/doctest.rst:1659 msgid "Debugging" msgstr "" -#: library/doctest.rst:1616 +#: library/doctest.rst:1661 msgid "Doctest provides several mechanisms for debugging doctest examples:" msgstr "" -#: library/doctest.rst:1618 +#: library/doctest.rst:1663 msgid "" "Several functions convert doctests to executable Python programs, which can " "be run under the Python debugger, :mod:`pdb`." msgstr "" -#: library/doctest.rst:1621 +#: library/doctest.rst:1666 msgid "" "The :class:`DebugRunner` class is a subclass of :class:`DocTestRunner` that " "raises an exception for the first failing example, containing information " @@ -2180,13 +2223,13 @@ msgid "" "debugging on the example." msgstr "" -#: library/doctest.rst:1626 +#: library/doctest.rst:1671 msgid "" "The :mod:`unittest` cases generated by :func:`DocTestSuite` support the :" "meth:`debug` method defined by :class:`unittest.TestCase`." msgstr "" -#: library/doctest.rst:1629 +#: library/doctest.rst:1674 msgid "" "You can add a call to :func:`pdb.set_trace` in a doctest example, and you'll " "drop into the Python debugger when that line is executed. Then you can " @@ -2194,7 +2237,7 @@ msgid "" "`a.py` contains just this module docstring::" msgstr "" -#: library/doctest.rst:1634 +#: library/doctest.rst:1679 msgid "" "\"\"\"\n" ">>> def f(x):\n" @@ -2207,11 +2250,11 @@ msgid "" "\"\"\"" msgstr "" -#: library/doctest.rst:1644 +#: library/doctest.rst:1689 msgid "Then an interactive Python session may look like this::" msgstr "" -#: library/doctest.rst:1646 +#: library/doctest.rst:1691 msgid "" ">>> import a, doctest\n" ">>> doctest.testmod(a)\n" @@ -2244,17 +2287,17 @@ msgid "" ">>>" msgstr "" -#: library/doctest.rst:1677 +#: library/doctest.rst:1722 msgid "" "Functions that convert doctests to Python code, and possibly run the " "synthesized code under the debugger:" msgstr "" -#: library/doctest.rst:1683 +#: library/doctest.rst:1728 msgid "Convert text with examples to a script." msgstr "" -#: library/doctest.rst:1685 +#: library/doctest.rst:1730 msgid "" "Argument *s* is a string containing doctest examples. The string is " "converted to a Python script, where doctest examples in *s* are converted to " @@ -2262,7 +2305,7 @@ msgid "" "generated script is returned as a string. For example, ::" msgstr "" -#: library/doctest.rst:1690 +#: library/doctest.rst:1735 msgid "" "import doctest\n" "print(doctest.script_from_examples(r\"\"\"\n" @@ -2275,11 +2318,11 @@ msgid "" "\"\"\"))" msgstr "" -#: library/doctest.rst:1700 +#: library/doctest.rst:1745 msgid "displays::" msgstr "" -#: library/doctest.rst:1702 +#: library/doctest.rst:1747 msgid "" "# Set x and y to 1 and 2.\n" "x, y = 1, 2\n" @@ -2290,18 +2333,18 @@ msgid "" "## 3" msgstr "" -#: library/doctest.rst:1710 +#: library/doctest.rst:1755 msgid "" "This function is used internally by other functions (see below), but can " "also be useful when you want to transform an interactive Python session into " "a Python script." msgstr "" -#: library/doctest.rst:1717 +#: library/doctest.rst:1762 msgid "Convert the doctest for an object to a script." msgstr "" -#: library/doctest.rst:1719 +#: library/doctest.rst:1764 msgid "" "Argument *module* is a module object, or dotted name of a module, containing " "the object whose doctests are of interest. Argument *name* is the name " @@ -2311,23 +2354,23 @@ msgid "" "module :file:`a.py` contains a top-level function :func:`!f`, then ::" msgstr "" -#: library/doctest.rst:1726 +#: library/doctest.rst:1771 msgid "" "import a, doctest\n" "print(doctest.testsource(a, \"a.f\"))" msgstr "" -#: library/doctest.rst:1729 +#: library/doctest.rst:1774 msgid "" "prints a script version of function :func:`!f`'s docstring, with doctests " "converted to code, and the rest placed in comments." msgstr "" -#: library/doctest.rst:1735 +#: library/doctest.rst:1780 msgid "Debug the doctests for an object." msgstr "" -#: library/doctest.rst:1737 +#: library/doctest.rst:1782 msgid "" "The *module* and *name* arguments are the same as for function :func:" "`testsource` above. The synthesized Python script for the named object's " @@ -2335,13 +2378,13 @@ msgid "" "the control of the Python debugger, :mod:`pdb`." msgstr "" -#: library/doctest.rst:1742 +#: library/doctest.rst:1787 msgid "" "A shallow copy of ``module.__dict__`` is used for both local and global " "execution context." msgstr "" -#: library/doctest.rst:1745 +#: library/doctest.rst:1790 msgid "" "Optional argument *pm* controls whether post-mortem debugging is used. If " "*pm* has a true value, the script file is run directly, and the debugger " @@ -2353,30 +2396,30 @@ msgid "" "to :func:`pdb.run`." msgstr "" -#: library/doctest.rst:1756 +#: library/doctest.rst:1801 msgid "Debug the doctests in a string." msgstr "" -#: library/doctest.rst:1758 +#: library/doctest.rst:1803 msgid "" "This is like function :func:`debug` above, except that a string containing " "doctest examples is specified directly, via the *src* argument." msgstr "" -#: library/doctest.rst:1761 +#: library/doctest.rst:1806 msgid "" "Optional argument *pm* has the same meaning as in function :func:`debug` " "above." msgstr "" -#: library/doctest.rst:1763 +#: library/doctest.rst:1808 msgid "" "Optional argument *globs* gives a dictionary to use as both local and global " "execution context. If not specified, or ``None``, an empty dictionary is " "used. If specified, a shallow copy of the dictionary is used." msgstr "" -#: library/doctest.rst:1768 +#: library/doctest.rst:1813 msgid "" "The :class:`DebugRunner` class, and the special exceptions it may raise, are " "of most interest to testing framework authors, and will only be sketched " @@ -2384,7 +2427,7 @@ msgid "" "(which is a doctest!) for more details:" msgstr "" -#: library/doctest.rst:1776 +#: library/doctest.rst:1821 msgid "" "A subclass of :class:`DocTestRunner` that raises an exception as soon as a " "failure is encountered. If an unexpected exception occurs, an :exc:" @@ -2394,89 +2437,89 @@ msgid "" "the actual output." msgstr "" -#: library/doctest.rst:1783 +#: library/doctest.rst:1828 msgid "" "For information about the constructor parameters and methods, see the " "documentation for :class:`DocTestRunner` in section :ref:`doctest-advanced-" "api`." msgstr "" -#: library/doctest.rst:1786 +#: library/doctest.rst:1831 msgid "" "There are two exceptions that may be raised by :class:`DebugRunner` " "instances:" msgstr "" -#: library/doctest.rst:1791 +#: library/doctest.rst:1836 msgid "" "An exception raised by :class:`DocTestRunner` to signal that a doctest " "example's actual output did not match its expected output. The constructor " "arguments are used to initialize the attributes of the same names." msgstr "" -#: library/doctest.rst:1795 +#: library/doctest.rst:1840 msgid ":exc:`DocTestFailure` defines the following attributes:" msgstr "" -#: library/doctest.rst:1824 +#: library/doctest.rst:1869 msgid "The :class:`DocTest` object that was being run when the example failed." msgstr "" -#: library/doctest.rst:1829 +#: library/doctest.rst:1874 msgid "The :class:`Example` that failed." msgstr "" -#: library/doctest.rst:1810 +#: library/doctest.rst:1855 msgid "The example's actual output." msgstr "" -#: library/doctest.rst:1815 +#: library/doctest.rst:1860 msgid "" "An exception raised by :class:`DocTestRunner` to signal that a doctest " "example raised an unexpected exception. The constructor arguments are used " "to initialize the attributes of the same names." msgstr "" -#: library/doctest.rst:1819 +#: library/doctest.rst:1864 msgid ":exc:`UnexpectedException` defines the following attributes:" msgstr "" -#: library/doctest.rst:1834 +#: library/doctest.rst:1879 msgid "" "A tuple containing information about the unexpected exception, as returned " "by :func:`sys.exc_info`." msgstr "" -#: library/doctest.rst:1841 +#: library/doctest.rst:1886 msgid "Soapbox" msgstr "" -#: library/doctest.rst:1843 +#: library/doctest.rst:1888 msgid "" "As mentioned in the introduction, :mod:`doctest` has grown to have three " "primary uses:" msgstr "" -#: library/doctest.rst:1846 +#: library/doctest.rst:1891 msgid "Checking examples in docstrings." msgstr "" -#: library/doctest.rst:1848 +#: library/doctest.rst:1893 msgid "Regression testing." msgstr "" -#: library/doctest.rst:1850 +#: library/doctest.rst:1895 msgid "Executable documentation / literate testing." msgstr "" -#: library/doctest.rst:1852 +#: library/doctest.rst:1897 msgid "" "These uses have different requirements, and it is important to distinguish " "them. In particular, filling your docstrings with obscure test cases makes " "for bad documentation." msgstr "" -#: library/doctest.rst:1856 +#: library/doctest.rst:1901 msgid "" "When writing a docstring, choose docstring examples with care. There's an " "art to this that needs to be learned---it may not be natural at first. " @@ -2488,7 +2531,7 @@ msgid "" "\"harmless\" change." msgstr "" -#: library/doctest.rst:1864 +#: library/doctest.rst:1909 msgid "" "Doctest also makes an excellent tool for regression testing, especially if " "you don't skimp on explanatory text. By interleaving prose and examples, it " @@ -2509,13 +2552,13 @@ msgid "" "different results, blurring the distinction between testing and explaining." msgstr "" -#: library/doctest.rst:1882 +#: library/doctest.rst:1927 msgid "" "Regression testing is best confined to dedicated objects or files. There " "are several options for organizing tests:" msgstr "" -#: library/doctest.rst:1885 +#: library/doctest.rst:1930 msgid "" "Write text files containing test cases as interactive examples, and test the " "files using :func:`testfile` or :func:`DocFileSuite`. This is recommended, " @@ -2523,7 +2566,7 @@ msgid "" "doctest." msgstr "" -#: library/doctest.rst:1890 +#: library/doctest.rst:1935 msgid "" "Define functions named ``_regrtest_topic`` that consist of single " "docstrings, containing test cases for the named topics. These functions can " @@ -2531,13 +2574,13 @@ msgid "" "test file." msgstr "" -#: library/doctest.rst:1894 +#: library/doctest.rst:1939 msgid "" "Define a ``__test__`` dictionary mapping from regression test topics to " "docstrings containing test cases." msgstr "" -#: library/doctest.rst:1897 +#: library/doctest.rst:1942 msgid "" "When you have placed your tests in a module, the module can itself be the " "test runner. When a test fails, you can arrange for your test runner to re-" @@ -2545,7 +2588,7 @@ msgid "" "example of such a test runner::" msgstr "" -#: library/doctest.rst:1902 +#: library/doctest.rst:1947 msgid "" "if __name__ == '__main__':\n" " import doctest\n" @@ -2560,14 +2603,14 @@ msgid "" " optionflags=flags)\n" " else:\n" " fail, total = doctest.testmod(optionflags=flags)\n" -" print(\"{} failures out of {} tests\".format(fail, total))" +" print(f\"{fail} failures out of {total} tests\")" msgstr "" -#: library/doctest.rst:1919 +#: library/doctest.rst:1964 msgid "Footnotes" msgstr "" -#: library/doctest.rst:1920 +#: library/doctest.rst:1965 msgid "" "Examples containing both expected output and an exception are not supported. " "Trying to guess where one ends and the other begins is too error-prone, and " diff --git a/library/email.charset.po b/library/email.charset.po index e0bc41eb..d720ad31 100644 --- a/library/email.charset.po +++ b/library/email.charset.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: 2025-01-27 01:00+0200\n" "Last-Translator: Marios Giannopoulos \n" "Language-Team: PyGreece \n" diff --git a/library/email.compat32-message.po b/library/email.compat32-message.po index 2eab10cb..ee2738c7 100644 --- a/library/email.compat32-message.po +++ b/library/email.compat32-message.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" diff --git a/library/email.contentmanager.po b/library/email.contentmanager.po index 56962309..bc378a30 100644 --- a/library/email.contentmanager.po +++ b/library/email.contentmanager.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" diff --git a/library/email.encoders.po b/library/email.encoders.po index 6aa28977..4fe5e55e 100644 --- a/library/email.encoders.po +++ b/library/email.encoders.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" diff --git a/library/email.errors.po b/library/email.errors.po index 0d5d7571..f95411bd 100644 --- a/library/email.errors.po +++ b/library/email.errors.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: 2024-12-14 01:00+0200\n" "Last-Translator: Marios Giannopoulos \n" "Language-Team: PyGreece \n" diff --git a/library/email.examples.po b/library/email.examples.po index 14978fbf..61cf5a69 100644 --- a/library/email.examples.po +++ b/library/email.examples.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -199,7 +199,7 @@ msgid "" " # Guess the content type based on the file's extension. Encoding\n" " # will be ignored, although we should check for simple things like\n" " # gzip'd or compressed files.\n" -" ctype, encoding = mimetypes.guess_type(path)\n" +" ctype, encoding = mimetypes.guess_file_type(path)\n" " if ctype is None or encoding is not None:\n" " # No guess could be made, or the file is encoded (compressed), " "so\n" @@ -308,14 +308,14 @@ msgid "" "\n" "# Create the base text message.\n" "msg = EmailMessage()\n" -"msg['Subject'] = \"Ayons asperges pour le déjeuner\"\n" +"msg['Subject'] = \"Pourquoi pas des asperges pour ce midi ?\"\n" "msg['From'] = Address(\"Pepé Le Pew\", \"pepe\", \"example.com\")\n" "msg['To'] = (Address(\"Penelope Pussycat\", \"penelope\", \"example.com\"),\n" " Address(\"Fabrette Pussycat\", \"fabrette\", \"example.com\"))\n" "msg.set_content(\"\"\"\\\n" "Salut!\n" "\n" -"Cela ressemble à un excellent recipie[1] déjeuner.\n" +"Cette recette [1] sera sûrement un très bon repas.\n" "\n" "[1] http://www.yummly.com/recipe/Roasted-Asparagus-Epicurious-203718\n" "\n" @@ -333,11 +333,11 @@ msgid "" " \n" " \n" "

Salut!

\n" -"

Cela ressemble à un excellent\n" +"

Cette\n" " \n" -" recipie\n" -" déjeuner.\n" +" recette\n" +" sera sûrement un très bon repas.\n" "

\n" " \n" " \n" @@ -465,11 +465,11 @@ msgid "" "To: Penelope Pussycat , Fabrette Pussycat " "\n" "From: Pepé Le Pew \n" -"Subject: Ayons asperges pour le déjeuner\n" +"Subject: Pourquoi pas des asperges pour ce midi ?\n" "\n" "Salut!\n" "\n" -"Cela ressemble à un excellent recipie[1] déjeuner." +"Cette recette [1] sera sûrement un très bon repas." msgstr "" #: library/email.examples.rst:66 diff --git a/library/email.generator.po b/library/email.generator.po index 15ff342b..888fbeca 100644 --- a/library/email.generator.po +++ b/library/email.generator.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -30,9 +30,9 @@ msgid "" "One of the most common tasks is to generate the flat (serialized) version of " "the email message represented by a message object structure. You will need " "to do this if you want to send your message via :meth:`smtplib.SMTP." -"sendmail` or the :mod:`nntplib` module, or print the message on the " -"console. Taking a message object structure and producing a serialized " -"representation is the job of the generator classes." +"sendmail`, or print the message on the console. Taking a message object " +"structure and producing a serialized representation is the job of the " +"generator classes." msgstr "" #: library/email.generator.rst:18 diff --git a/library/email.header.po b/library/email.header.po index 76f6c5a6..0e9afcf4 100644 --- a/library/email.header.po +++ b/library/email.header.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" diff --git a/library/email.headerregistry.po b/library/email.headerregistry.po index c242c1df..61d15d78 100644 --- a/library/email.headerregistry.po +++ b/library/email.headerregistry.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" diff --git a/library/email.iterators.po b/library/email.iterators.po index 216abc20..c9a1f603 100644 --- a/library/email.iterators.po +++ b/library/email.iterators.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" diff --git a/library/email.message.po b/library/email.message.po index 87580566..a95670fc 100644 --- a/library/email.message.po +++ b/library/email.message.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" diff --git a/library/email.mime.po b/library/email.mime.po index 670b7dd1..f461d2a0 100644 --- a/library/email.mime.po +++ b/library/email.mime.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" diff --git a/library/email.parser.po b/library/email.parser.po index 91619075..667fd9fe 100644 --- a/library/email.parser.po +++ b/library/email.parser.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" diff --git a/library/email.po b/library/email.po index 0f553394..e6895021 100644 --- a/library/email.po +++ b/library/email.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -30,10 +30,10 @@ msgid "" "The :mod:`email` package is a library for managing email messages. It is " "specifically *not* designed to do any sending of email messages to SMTP (:" "rfc:`2821`), NNTP, or other servers; those are functions of modules such as :" -"mod:`smtplib` and :mod:`nntplib`. The :mod:`email` package attempts to be " -"as RFC-compliant as possible, supporting :rfc:`5322` and :rfc:`6532`, as " -"well as such MIME-related RFCs as :rfc:`2045`, :rfc:`2046`, :rfc:`2047`, :" -"rfc:`2183`, and :rfc:`2231`." +"mod:`smtplib`. The :mod:`email` package attempts to be as RFC-compliant as " +"possible, supporting :rfc:`5322` and :rfc:`6532`, as well as such MIME-" +"related RFCs as :rfc:`2045`, :rfc:`2046`, :rfc:`2047`, :rfc:`2183`, and :rfc:" +"`2231`." msgstr "" #: library/email.rst:23 @@ -180,18 +180,10 @@ msgid "IMAP (Internet Message Access Protocol) client" msgstr "" #: library/email.rst:144 -msgid "Module :mod:`nntplib`" -msgstr "" - -#: library/email.rst:145 -msgid "NNTP (Net News Transport Protocol) client" -msgstr "" - -#: library/email.rst:147 msgid "Module :mod:`mailbox`" msgstr "" -#: library/email.rst:148 +#: library/email.rst:145 msgid "" "Tools for creating, reading, and managing collections of messages on disk " "using a variety standard formats." diff --git a/library/email.policy.po b/library/email.policy.po index edf4d97e..b36024be 100644 --- a/library/email.policy.po +++ b/library/email.policy.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" diff --git a/library/email.utils.po b/library/email.utils.po index b3081dc3..a7970468 100644 --- a/library/email.utils.po +++ b/library/email.utils.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" diff --git a/library/ensurepip.po b/library/ensurepip.po index 71713e8e..7c964fed 100644 --- a/library/ensurepip.po +++ b/library/ensurepip.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -65,15 +65,14 @@ msgstr "" msgid "The original rationale and specification for this module." msgstr "" -#: includes/wasm-notavail.rst:3 +#: includes/wasm-mobile-notavail.rst:3 msgid "Availability" msgstr "" -#: includes/wasm-notavail.rst:5 +#: includes/wasm-mobile-notavail.rst:5 msgid "" -"This module does not work or is not available on WebAssembly platforms " -"``wasm32-emscripten`` and ``wasm32-wasi``. See :ref:`wasm-availability` for " -"more information." +"This module is not supported on :ref:`mobile platforms ` or :ref:`WebAssembly platforms `." msgstr "" #: library/ensurepip.rst:44 diff --git a/library/enum.po b/library/enum.po index 05dad115..ed055f85 100644 --- a/library/enum.po +++ b/library/enum.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -206,115 +206,127 @@ msgid "" msgstr "" #: library/enum.rst:113 -msgid ":class:`auto`" +msgid ":class:`EnumDict`" msgstr "" #: library/enum.rst:115 +msgid "A subclass of :class:`dict` for use when subclassing :class:`EnumType`." +msgstr "" + +#: library/enum.rst:117 +msgid ":class:`auto`" +msgstr "" + +#: library/enum.rst:119 msgid "" "Instances are replaced with an appropriate value for Enum members. :class:" "`StrEnum` defaults to the lower-cased version of the member name, while " "other Enums default to 1 and increase from there." msgstr "" -#: library/enum.rst:119 +#: library/enum.rst:123 msgid ":func:`~enum.property`" msgstr "" -#: library/enum.rst:121 +#: library/enum.rst:125 msgid "" "Allows :class:`Enum` members to have attributes without conflicting with " "member names. The ``value`` and ``name`` attributes are implemented this " "way." msgstr "" -#: library/enum.rst:125 +#: library/enum.rst:129 msgid ":func:`unique`" msgstr "" -#: library/enum.rst:127 +#: library/enum.rst:131 msgid "" "Enum class decorator that ensures only one name is bound to any one value." msgstr "" -#: library/enum.rst:129 +#: library/enum.rst:133 msgid ":func:`verify`" msgstr "" -#: library/enum.rst:131 +#: library/enum.rst:135 msgid "" "Enum class decorator that checks user-selectable constraints on an " "enumeration." msgstr "" -#: library/enum.rst:134 +#: library/enum.rst:138 msgid ":func:`member`" msgstr "" -#: library/enum.rst:136 +#: library/enum.rst:140 msgid "Make ``obj`` a member. Can be used as a decorator." msgstr "" -#: library/enum.rst:138 +#: library/enum.rst:142 msgid ":func:`nonmember`" msgstr "" -#: library/enum.rst:140 +#: library/enum.rst:144 msgid "Do not make ``obj`` a member. Can be used as a decorator." msgstr "" -#: library/enum.rst:142 +#: library/enum.rst:146 msgid ":func:`global_enum`" msgstr "" -#: library/enum.rst:144 +#: library/enum.rst:148 msgid "" "Modify the :class:`str() ` and :func:`repr` of an enum to show its " "members as belonging to the module instead of its class, and export the enum " "members to the global namespace." msgstr "" -#: library/enum.rst:148 +#: library/enum.rst:152 msgid ":func:`show_flag_values`" msgstr "" -#: library/enum.rst:150 +#: library/enum.rst:154 msgid "Return a list of all power-of-two integers contained in a flag." msgstr "" -#: library/enum.rst:153 +#: library/enum.rst:157 msgid "``Flag``, ``IntFlag``, ``auto``" msgstr "" -#: library/enum.rst:154 +#: library/enum.rst:158 msgid "" "``StrEnum``, ``EnumCheck``, ``ReprEnum``, ``FlagBoundary``, ``property``, " "``member``, ``nonmember``, ``global_enum``, ``show_flag_values``" msgstr "" #: library/enum.rst:159 -msgid "Data Types" +msgid "``EnumDict``" msgstr "" #: library/enum.rst:164 +msgid "Data Types" +msgstr "" + +#: library/enum.rst:169 msgid "" "*EnumType* is the :term:`metaclass` for *enum* enumerations. It is possible " "to subclass *EnumType* -- see :ref:`Subclassing EnumType ` for details." msgstr "" -#: library/enum.rst:168 +#: library/enum.rst:173 msgid "" -"*EnumType* is responsible for setting the correct :meth:`!__repr__`, :meth:`!" -"__str__`, :meth:`!__format__`, and :meth:`!__reduce__` methods on the final " -"*enum*, as well as creating the enum members, properly handling duplicates, " -"providing iteration over the enum class, etc." +"``EnumType`` is responsible for setting the correct :meth:`!__repr__`, :meth:" +"`!__str__`, :meth:`!__format__`, and :meth:`!__reduce__` methods on the " +"final *enum*, as well as creating the enum members, properly handling " +"duplicates, providing iteration over the enum class, etc." msgstr "" -#: library/enum.rst:175 +#: library/enum.rst:180 msgid "This method is called in two different ways:" msgstr "" -#: library/enum.rst:177 +#: library/enum.rst:182 msgid "to look up an existing member:" msgstr "" @@ -322,7 +334,7 @@ msgstr "" msgid "cls" msgstr "" -#: library/enum.rst:185 +#: library/enum.rst:190 msgid "The enum class being called." msgstr "" @@ -330,17 +342,17 @@ msgstr "" msgid "value" msgstr "" -#: library/enum.rst:180 +#: library/enum.rst:185 msgid "The value to lookup." msgstr "" -#: library/enum.rst:182 +#: library/enum.rst:187 msgid "" "to use the ``cls`` enum to create a new enum (only if the existing enum does " "not have any members):" msgstr "" -#: library/enum.rst:186 +#: library/enum.rst:191 msgid "The name of the new Enum to create." msgstr "" @@ -348,7 +360,7 @@ msgstr "" msgid "names" msgstr "" -#: library/enum.rst:187 +#: library/enum.rst:192 msgid "The names/values of the members for the new Enum." msgstr "" @@ -356,7 +368,7 @@ msgstr "" msgid "module" msgstr "" -#: library/enum.rst:188 +#: library/enum.rst:193 msgid "The name of the module the new Enum is created in." msgstr "" @@ -364,7 +376,7 @@ msgstr "" msgid "qualname" msgstr "" -#: library/enum.rst:189 +#: library/enum.rst:194 msgid "The actual location in the module where this Enum can be found." msgstr "" @@ -372,7 +384,7 @@ msgstr "" msgid "type" msgstr "" -#: library/enum.rst:190 +#: library/enum.rst:195 msgid "A mix-in type for the new Enum." msgstr "" @@ -380,7 +392,7 @@ msgstr "" msgid "start" msgstr "" -#: library/enum.rst:191 +#: library/enum.rst:196 msgid "The first integer value for the Enum (used by :class:`auto`)." msgstr "" @@ -388,16 +400,16 @@ msgstr "" msgid "boundary" msgstr "" -#: library/enum.rst:192 +#: library/enum.rst:197 msgid "" "How to handle out-of-range values from bit operations (:class:`Flag` only)." msgstr "" -#: library/enum.rst:196 +#: library/enum.rst:201 msgid "Returns ``True`` if member belongs to the ``cls``::" msgstr "" -#: library/enum.rst:198 +#: library/enum.rst:203 msgid "" ">>> some_var = Color.RED\n" ">>> some_var in Color\n" @@ -406,19 +418,19 @@ msgid "" "True" msgstr "" -#: library/enum.rst:206 +#: library/enum.rst:211 msgid "" "Before Python 3.12, a ``TypeError`` is raised if a non-Enum-member is used " "in a containment check." msgstr "" -#: library/enum.rst:211 +#: library/enum.rst:216 msgid "" "Returns ``['__class__', '__doc__', '__members__', '__module__']`` and the " "names of the members in *cls*::" msgstr "" -#: library/enum.rst:214 +#: library/enum.rst:219 msgid "" ">>> dir(Color)\n" "['BLUE', 'GREEN', 'RED', '__class__', '__contains__', '__doc__', " @@ -426,96 +438,110 @@ msgid "" "'__module__', '__name__', '__qualname__']" msgstr "" -#: library/enum.rst:219 +#: library/enum.rst:224 msgid "" "Returns the Enum member in *cls* matching *name*, or raises a :exc:" "`KeyError`::" msgstr "" -#: library/enum.rst:221 +#: library/enum.rst:226 msgid "" ">>> Color['BLUE']\n" "" msgstr "" -#: library/enum.rst:226 +#: library/enum.rst:231 msgid "Returns each member in *cls* in definition order::" msgstr "" -#: library/enum.rst:228 +#: library/enum.rst:233 msgid "" ">>> list(Color)\n" "[, , ]" msgstr "" -#: library/enum.rst:233 +#: library/enum.rst:238 msgid "Returns the number of member in *cls*::" msgstr "" -#: library/enum.rst:235 +#: library/enum.rst:240 msgid "" ">>> len(Color)\n" "3" msgstr "" -#: library/enum.rst:240 +#: library/enum.rst:245 msgid "Returns a mapping of every enum name to its member, including aliases" msgstr "" -#: library/enum.rst:244 +#: library/enum.rst:249 msgid "Returns each member in *cls* in reverse definition order::" msgstr "" -#: library/enum.rst:246 +#: library/enum.rst:251 msgid "" ">>> list(reversed(Color))\n" "[, , ]" msgstr "" -#: library/enum.rst:251 -msgid "Before 3.11 ``enum`` used ``EnumMeta`` type, which is kept as an alias." +#: library/enum.rst:256 +msgid "" +"Adds a new name as an alias to an existing member. Raises a :exc:" +"`NameError` if the name is already assigned to a different member." msgstr "" -#: library/enum.rst:256 +#: library/enum.rst:261 +msgid "" +"Adds a new value as an alias to an existing member. Raises a :exc:" +"`ValueError` if the value is already linked with a different member." +msgstr "" + +#: library/enum.rst:266 +msgid "" +"Before 3.11 ``EnumType`` was called ``EnumMeta``, which is still available " +"as an alias." +msgstr "" + +#: library/enum.rst:271 msgid "*Enum* is the base class for all *enum* enumerations." msgstr "" -#: library/enum.rst:260 +#: library/enum.rst:275 msgid "The name used to define the ``Enum`` member::" msgstr "" -#: library/enum.rst:262 +#: library/enum.rst:277 msgid "" ">>> Color.BLUE.name\n" "'BLUE'" msgstr "" -#: library/enum.rst:267 +#: library/enum.rst:282 msgid "The value given to the ``Enum`` member::" msgstr "" -#: library/enum.rst:269 +#: library/enum.rst:284 msgid "" ">>> Color.RED.value\n" "1" msgstr "" -#: library/enum.rst:292 +#: library/enum.rst:307 msgid "Value of the member, can be set in :meth:`~Enum.__new__`." msgstr "" -#: library/enum.rst:274 +#: library/enum.rst:289 msgid "Enum member values" msgstr "" -#: library/enum.rst:276 +#: library/enum.rst:291 msgid "" "Member values can be anything: :class:`int`, :class:`str`, etc. If the " "exact value is unimportant you may use :class:`auto` instances and an " "appropriate value will be chosen for you. See :class:`auto` for the details." msgstr "" -#: library/enum.rst:281 +#: library/enum.rst:296 msgid "" "While mutable/unhashable values, such as :class:`dict`, :class:`list` or a " "mutable :class:`~dataclasses.dataclass`, can be used, they will have a " @@ -523,36 +549,36 @@ msgid "" "mutable/unhashable values in the enum." msgstr "" -#: library/enum.rst:288 +#: library/enum.rst:303 msgid "Name of the member." msgstr "" -#: library/enum.rst:296 +#: library/enum.rst:311 msgid "" "No longer used, kept for backward compatibility. (class attribute, removed " "during class creation)." msgstr "" -#: library/enum.rst:301 +#: library/enum.rst:316 msgid "" "``_ignore_`` is only used during creation and is removed from the " "enumeration once creation is complete." msgstr "" -#: library/enum.rst:304 +#: library/enum.rst:319 msgid "" "``_ignore_`` is a list of names that will not become members, and whose " "names will also be removed from the completed enumeration. See :ref:" "`TimePeriod ` for an example." msgstr "" -#: library/enum.rst:310 +#: library/enum.rst:325 msgid "" "Returns ``['__class__', '__doc__', '__module__', 'name', 'value']`` and any " "public methods defined on *self.__class__*::" msgstr "" -#: library/enum.rst:313 +#: library/enum.rst:328 msgid "" ">>> from datetime import date\n" ">>> class Weekday(Enum):\n" @@ -576,11 +602,11 @@ msgstr "" msgid "name" msgstr "" -#: library/enum.rst:331 +#: library/enum.rst:346 msgid "The name of the member being defined (e.g. 'RED')." msgstr "" -#: library/enum.rst:332 +#: library/enum.rst:347 msgid "The start value for the Enum; the default is 1." msgstr "" @@ -588,7 +614,7 @@ msgstr "" msgid "count" msgstr "" -#: library/enum.rst:333 +#: library/enum.rst:348 msgid "The number of members currently defined, not including this one." msgstr "" @@ -596,17 +622,17 @@ msgstr "" msgid "last_values" msgstr "" -#: library/enum.rst:334 +#: library/enum.rst:349 msgid "A list of the previous values." msgstr "" -#: library/enum.rst:336 +#: library/enum.rst:351 msgid "" "A *staticmethod* that is used to determine the next value returned by :class:" "`auto`::" msgstr "" -#: library/enum.rst:339 +#: library/enum.rst:354 msgid "" ">>> from enum import auto\n" ">>> class PowersOfThree(Enum):\n" @@ -620,31 +646,31 @@ msgid "" "9" msgstr "" -#: library/enum.rst:352 +#: library/enum.rst:367 msgid "" "By default, does nothing. If multiple values are given in the member " "assignment, those values become separate arguments to ``__init__``; e.g." msgstr "" -#: library/enum.rst:359 +#: library/enum.rst:374 msgid "" "``Weekday.__init__()`` would be called as ``Weekday.__init__(self, 1, " "'Mon')``" msgstr "" -#: library/enum.rst:363 +#: library/enum.rst:378 msgid "" "A *classmethod* that is used to further configure subsequent subclasses. By " "default, does nothing." msgstr "" -#: library/enum.rst:368 +#: library/enum.rst:383 msgid "" "A *classmethod* for looking up values not found in *cls*. By default it " "does nothing, but can be overridden to implement custom search behavior::" msgstr "" -#: library/enum.rst:371 +#: library/enum.rst:386 msgid "" ">>> from enum import StrEnum\n" ">>> class Build(StrEnum):\n" @@ -664,31 +690,31 @@ msgid "" "" msgstr "" -#: library/enum.rst:390 +#: library/enum.rst:405 msgid "" "By default, doesn't exist. If specified, either in the enum class " "definition or in a mixin class (such as ``int``), all values given in the " "member assignment will be passed; e.g." msgstr "" -#: library/enum.rst:398 +#: library/enum.rst:413 msgid "" "results in the call ``int('1a', 16)`` and a value of ``26`` for the member." msgstr "" -#: library/enum.rst:402 +#: library/enum.rst:417 msgid "" "When writing a custom ``__new__``, do not use ``super().__new__`` -- call " "the appropriate ``__new__`` instead." msgstr "" -#: library/enum.rst:407 +#: library/enum.rst:422 msgid "" "Returns the string used for *repr()* calls. By default, returns the *Enum* " "name, member name, and value, but can be overridden::" msgstr "" -#: library/enum.rst:410 +#: library/enum.rst:425 msgid "" ">>> class OtherStyle(Enum):\n" "... ALTERNATE = auto()\n" @@ -703,13 +729,13 @@ msgid "" "(OtherStyle.ALTERNATE, 'OtherStyle.ALTERNATE', 'OtherStyle.ALTERNATE')" msgstr "" -#: library/enum.rst:423 +#: library/enum.rst:438 msgid "" "Returns the string used for *str()* calls. By default, returns the *Enum* " "name and member name, but can be overridden::" msgstr "" -#: library/enum.rst:426 +#: library/enum.rst:441 msgid "" ">>> class OtherStyle(Enum):\n" "... ALTERNATE = auto()\n" @@ -723,13 +749,13 @@ msgid "" "(, 'ALTERNATE', 'ALTERNATE')" msgstr "" -#: library/enum.rst:438 +#: library/enum.rst:453 msgid "" "Returns the string used for *format()* and *f-string* calls. By default, " "returns :meth:`__str__` return value, but can be overridden::" msgstr "" -#: library/enum.rst:441 +#: library/enum.rst:456 msgid "" ">>> class OtherStyle(Enum):\n" "... ALTERNATE = auto()\n" @@ -743,46 +769,46 @@ msgid "" "(, 'OtherStyle.ALTERNATE', 'ALTERNATE')" msgstr "" -#: library/enum.rst:453 +#: library/enum.rst:468 msgid "" "Using :class:`auto` with :class:`Enum` results in integers of increasing " "value, starting with ``1``." msgstr "" -#: library/enum.rst:456 +#: library/enum.rst:471 msgid "Added :ref:`enum-dataclass-support`" msgstr "" -#: library/enum.rst:461 +#: library/enum.rst:476 msgid "" -"*IntEnum* is the same as *Enum*, but its members are also integers and can " -"be used anywhere that an integer can be used. If any integer operation is " -"performed with an *IntEnum* member, the resulting value loses its " -"enumeration status." +"*IntEnum* is the same as :class:`Enum`, but its members are also integers " +"and can be used anywhere that an integer can be used. If any integer " +"operation is performed with an *IntEnum* member, the resulting value loses " +"its enumeration status." msgstr "" -#: library/enum.rst:482 +#: library/enum.rst:497 msgid "" "Using :class:`auto` with :class:`IntEnum` results in integers of increasing " "value, starting with ``1``." msgstr "" -#: library/enum.rst:485 +#: library/enum.rst:500 msgid "" ":meth:`~object.__str__` is now :meth:`!int.__str__` to better support the " "*replacement of existing constants* use-case. :meth:`~object.__format__` was " "already :meth:`!int.__format__` for that same reason." msgstr "" -#: library/enum.rst:492 +#: library/enum.rst:507 msgid "" -"*StrEnum* is the same as *Enum*, but its members are also strings and can be " -"used in most of the same places that a string can be used. The result of " -"any string operation performed on or with a *StrEnum* member is not part of " -"the enumeration." +"``StrEnum`` is the same as :class:`Enum`, but its members are also strings " +"and can be used in most of the same places that a string can be used. The " +"result of any string operation performed on or with a *StrEnum* member is " +"not part of the enumeration." msgstr "" -#: library/enum.rst:498 +#: library/enum.rst:513 msgid "" "There are places in the stdlib that check for an exact :class:`str` instead " "of a :class:`str` subclass (i.e. ``type(unknown) == str`` instead of " @@ -790,31 +816,31 @@ msgid "" "``str(StrEnum.member)``." msgstr "" -#: library/enum.rst:505 +#: library/enum.rst:520 msgid "" "Using :class:`auto` with :class:`StrEnum` results in the lower-cased member " "name as the value." msgstr "" -#: library/enum.rst:510 +#: library/enum.rst:525 msgid "" ":meth:`~object.__str__` is :meth:`!str.__str__` to better support the " "*replacement of existing constants* use-case. :meth:`~object.__format__` is " "likewise :meth:`!str.__format__` for that same reason." msgstr "" -#: library/enum.rst:518 +#: library/enum.rst:533 msgid "" "``Flag`` is the same as :class:`Enum`, but its members support the bitwise " "operators ``&`` (*AND*), ``|`` (*OR*), ``^`` (*XOR*), and ``~`` (*INVERT*); " "the results of those operations are (aliases of) members of the enumeration." msgstr "" -#: library/enum.rst:524 +#: library/enum.rst:539 msgid "Returns *True* if value is in self::" msgstr "" -#: library/enum.rst:526 +#: library/enum.rst:541 msgid "" ">>> from enum import Flag, auto\n" ">>> class Color(Flag):\n" @@ -834,11 +860,11 @@ msgid "" "False" msgstr "" -#: library/enum.rst:545 +#: library/enum.rst:560 msgid "Returns all contained non-alias members::" msgstr "" -#: library/enum.rst:547 +#: library/enum.rst:562 msgid "" ">>> list(Color.RED)\n" "[]\n" @@ -846,11 +872,11 @@ msgid "" "[, ]" msgstr "" -#: library/enum.rst:556 +#: library/enum.rst:571 msgid "Returns number of members in flag::" msgstr "" -#: library/enum.rst:558 +#: library/enum.rst:573 msgid "" ">>> len(Color.GREEN)\n" "1\n" @@ -858,11 +884,11 @@ msgid "" "3" msgstr "" -#: library/enum.rst:567 +#: library/enum.rst:582 msgid "Returns *True* if any members in flag, *False* otherwise::" msgstr "" -#: library/enum.rst:569 +#: library/enum.rst:584 msgid "" ">>> bool(Color.GREEN)\n" "True\n" @@ -873,21 +899,21 @@ msgid "" "False" msgstr "" -#: library/enum.rst:579 +#: library/enum.rst:594 msgid "Returns current flag binary or'ed with other::" msgstr "" -#: library/enum.rst:581 +#: library/enum.rst:596 msgid "" ">>> Color.RED | Color.GREEN\n" "" msgstr "" -#: library/enum.rst:586 +#: library/enum.rst:601 msgid "Returns current flag binary and'ed with other::" msgstr "" -#: library/enum.rst:588 +#: library/enum.rst:603 msgid "" ">>> purple & white\n" "\n" @@ -895,11 +921,11 @@ msgid "" "" msgstr "" -#: library/enum.rst:595 +#: library/enum.rst:610 msgid "Returns current flag binary xor'ed with other::" msgstr "" -#: library/enum.rst:597 +#: library/enum.rst:612 msgid "" ">>> purple ^ white\n" "\n" @@ -907,11 +933,11 @@ msgid "" "" msgstr "" -#: library/enum.rst:604 -msgid "Returns all the flags in *type(self)* that are not in self::" +#: library/enum.rst:619 +msgid "Returns all the flags in *type(self)* that are not in *self*::" msgstr "" -#: library/enum.rst:606 +#: library/enum.rst:621 msgid "" ">>> ~white\n" "\n" @@ -921,110 +947,110 @@ msgid "" "" msgstr "" -#: library/enum.rst:615 +#: library/enum.rst:630 msgid "" "Function used to format any remaining unnamed numeric values. Default is " "the value's repr; common choices are :func:`hex` and :func:`oct`." msgstr "" -#: library/enum.rst:620 +#: library/enum.rst:635 msgid "" "Using :class:`auto` with :class:`Flag` results in integers that are powers " "of two, starting with ``1``." msgstr "" -#: library/enum.rst:623 +#: library/enum.rst:638 msgid "The *repr()* of zero-valued flags has changed. It is now::" msgstr "" -#: library/enum.rst:631 +#: library/enum.rst:646 msgid "" -"*IntFlag* is the same as *Flag*, but its members are also integers and can " -"be used anywhere that an integer can be used." +"``IntFlag`` is the same as :class:`Flag`, but its members are also integers " +"and can be used anywhere that an integer can be used." msgstr "" -#: library/enum.rst:645 +#: library/enum.rst:660 msgid "" "If any integer operation is performed with an *IntFlag* member, the result " "is not an *IntFlag*::" msgstr "" -#: library/enum.rst:648 +#: library/enum.rst:663 msgid "" ">>> Color.RED + 2\n" "3" msgstr "" -#: library/enum.rst:651 -msgid "If a *Flag* operation is performed with an *IntFlag* member and:" +#: library/enum.rst:666 +msgid "If a :class:`Flag` operation is performed with an *IntFlag* member and:" msgstr "" -#: library/enum.rst:653 +#: library/enum.rst:668 msgid "the result is a valid *IntFlag*: an *IntFlag* is returned" msgstr "" -#: library/enum.rst:654 +#: library/enum.rst:669 msgid "" -"the result is not a valid *IntFlag*: the result depends on the " -"*FlagBoundary* setting" +"the result is not a valid *IntFlag*: the result depends on the :class:" +"`FlagBoundary` setting" msgstr "" -#: library/enum.rst:656 -msgid "The *repr()* of unnamed zero-valued flags has changed. It is now:" +#: library/enum.rst:671 +msgid "The :func:`repr` of unnamed zero-valued flags has changed. It is now:" msgstr "" -#: library/enum.rst:663 +#: library/enum.rst:678 msgid "" "Using :class:`auto` with :class:`IntFlag` results in integers that are " "powers of two, starting with ``1``." msgstr "" -#: library/enum.rst:668 +#: library/enum.rst:683 msgid "" ":meth:`~object.__str__` is now :meth:`!int.__str__` to better support the " "*replacement of existing constants* use-case. :meth:`~object.__format__` " "was already :meth:`!int.__format__` for that same reason." msgstr "" -#: library/enum.rst:672 +#: library/enum.rst:687 msgid "" "Inversion of an :class:`!IntFlag` now returns a positive value that is the " "union of all flags not in the given flag, rather than a negative value. This " "matches the existing :class:`Flag` behavior." msgstr "" -#: library/enum.rst:678 +#: library/enum.rst:693 msgid "" ":class:`!ReprEnum` uses the :meth:`repr() ` of :class:`Enum`, " "but the :class:`str() ` of the mixed-in data type:" msgstr "" -#: library/enum.rst:681 +#: library/enum.rst:696 msgid ":meth:`!int.__str__` for :class:`IntEnum` and :class:`IntFlag`" msgstr "" -#: library/enum.rst:682 +#: library/enum.rst:697 msgid ":meth:`!str.__str__` for :class:`StrEnum`" msgstr "" -#: library/enum.rst:684 +#: library/enum.rst:699 msgid "" "Inherit from :class:`!ReprEnum` to keep the :class:`str() ` / :func:" "`format` of the mixed-in data type instead of using the :class:`Enum`-" "default :meth:`str() `." msgstr "" -#: library/enum.rst:693 +#: library/enum.rst:708 msgid "" "*EnumCheck* contains the options used by the :func:`verify` decorator to " "ensure various constraints; failed constraints result in a :exc:`ValueError`." msgstr "" -#: library/enum.rst:698 +#: library/enum.rst:713 msgid "Ensure that each value has only one name::" msgstr "" -#: library/enum.rst:700 +#: library/enum.rst:715 msgid "" ">>> from enum import Enum, verify, UNIQUE\n" ">>> @verify(UNIQUE)\n" @@ -1038,13 +1064,13 @@ msgid "" "ValueError: aliases found in : CRIMSON -> RED" msgstr "" -#: library/enum.rst:714 +#: library/enum.rst:729 msgid "" "Ensure that there are no missing values between the lowest-valued member and " "the highest-valued member::" msgstr "" -#: library/enum.rst:717 +#: library/enum.rst:732 msgid "" ">>> from enum import Enum, verify, CONTINUOUS\n" ">>> @verify(CONTINUOUS)\n" @@ -1057,13 +1083,13 @@ msgid "" "ValueError: invalid enum 'Color': missing values 3, 4" msgstr "" -#: library/enum.rst:729 +#: library/enum.rst:744 msgid "" "Ensure that any flag groups/masks contain only named flags -- useful when " "values are specified instead of being generated by :func:`auto`::" msgstr "" -#: library/enum.rst:732 +#: library/enum.rst:747 msgid "" ">>> from enum import Flag, verify, NAMED_FLAGS\n" ">>> @verify(NAMED_FLAGS)\n" @@ -1079,24 +1105,24 @@ msgid "" "combined values of 0x18 [use enum.show_flag_values(value) for details]" msgstr "" -#: library/enum.rst:746 +#: library/enum.rst:761 msgid "" "CONTINUOUS and NAMED_FLAGS are designed to work with integer-valued members." msgstr "" -#: library/enum.rst:752 +#: library/enum.rst:767 msgid "" -"*FlagBoundary* controls how out-of-range values are handled in *Flag* and " -"its subclasses." +"``FlagBoundary`` controls how out-of-range values are handled in :class:" +"`Flag` and its subclasses." msgstr "" -#: library/enum.rst:757 +#: library/enum.rst:772 msgid "" "Out-of-range values cause a :exc:`ValueError` to be raised. This is the " "default for :class:`Flag`::" msgstr "" -#: library/enum.rst:760 +#: library/enum.rst:775 msgid "" ">>> from enum import Flag, STRICT, auto\n" ">>> class StrictFlag(Flag, boundary=STRICT):\n" @@ -1112,13 +1138,13 @@ msgid "" " allowed 0b0 00111" msgstr "" -#: library/enum.rst:775 +#: library/enum.rst:790 msgid "" -"Out-of-range values have invalid values removed, leaving a valid *Flag* " -"value::" +"Out-of-range values have invalid values removed, leaving a valid :class:" +"`Flag` value::" msgstr "" -#: library/enum.rst:778 +#: library/enum.rst:793 msgid "" ">>> from enum import Flag, CONFORM, auto\n" ">>> class ConformFlag(Flag, boundary=CONFORM):\n" @@ -1130,18 +1156,19 @@ msgid "" "" msgstr "" -#: library/enum.rst:789 +#: library/enum.rst:804 msgid "" -"Out-of-range values lose their *Flag* membership and revert to :class:`int`." +"Out-of-range values lose their :class:`Flag` membership and revert to :class:" +"`int`." msgstr "" -#: library/enum.rst:802 +#: library/enum.rst:817 msgid "" -"Out-of-range values are kept, and the *Flag* membership is kept. This is the " -"default for :class:`IntFlag`::" +"Out-of-range values are kept, and the :class:`Flag` membership is kept. This " +"is the default for :class:`IntFlag`::" msgstr "" -#: library/enum.rst:805 +#: library/enum.rst:820 msgid "" ">>> from enum import Flag, KEEP, auto\n" ">>> class KeepFlag(Flag, boundary=KEEP):\n" @@ -1153,143 +1180,192 @@ msgid "" "" msgstr "" -#: library/enum.rst:819 +#: library/enum.rst:833 +msgid "" +"*EnumDict* is a subclass of :class:`dict` that is used as the namespace for " +"defining enum classes (see :ref:`prepare`). It is exposed to allow " +"subclasses of :class:`EnumType` with advanced behavior like having multiple " +"values per member. It should be called with the name of the enum class being " +"created, otherwise private names and internal classes will not be handled " +"correctly." +msgstr "" + +#: library/enum.rst:840 +msgid "" +"Note that only the :class:`~collections.abc.MutableMapping` interface (:meth:" +"`~object.__setitem__` and :meth:`~dict.update`) is overridden. It may be " +"possible to bypass the checks using other :class:`!dict` operations like :" +"meth:`|= `." +msgstr "" + +#: library/enum.rst:847 +msgid "A list of member names." +msgstr "" + +#: library/enum.rst:854 msgid "Supported ``__dunder__`` names" msgstr "" -#: library/enum.rst:821 +#: library/enum.rst:856 msgid "" ":attr:`~EnumType.__members__` is a read-only ordered mapping of " "``member_name``:``member`` items. It is only available on the class." msgstr "" -#: library/enum.rst:824 +#: library/enum.rst:859 msgid "" ":meth:`~Enum.__new__`, if specified, must create and return the enum " "members; it is also a very good idea to set the member's :attr:`!_value_` " -"appropriately. Once all the members are created it is no longer used." +"appropriately. Once all the members are created it is no longer used." msgstr "" -#: library/enum.rst:830 +#: library/enum.rst:865 msgid "Supported ``_sunder_`` names" msgstr "" -#: library/enum.rst:832 +#: library/enum.rst:867 +msgid "" +":meth:`~EnumType._add_alias_` -- adds a new name as an alias to an existing " +"member." +msgstr "" + +#: library/enum.rst:869 +msgid "" +":meth:`~EnumType._add_value_alias_` -- adds a new value as an alias to an " +"existing member." +msgstr "" + +#: library/enum.rst:871 msgid ":attr:`~Enum._name_` -- name of the member" msgstr "" -#: library/enum.rst:833 +#: library/enum.rst:872 msgid ":attr:`~Enum._value_` -- value of the member; can be set in ``__new__``" msgstr "" -#: library/enum.rst:834 +#: library/enum.rst:873 msgid "" ":meth:`~Enum._missing_` -- a lookup function used when a value is not found; " "may be overridden" msgstr "" -#: library/enum.rst:836 +#: library/enum.rst:875 msgid "" ":attr:`~Enum._ignore_` -- a list of names, either as a :class:`list` or a :" "class:`str`, that will not be transformed into members, and will be removed " "from the final class" msgstr "" -#: library/enum.rst:839 +#: library/enum.rst:878 msgid "" ":attr:`~Enum._order_` -- no longer used, kept for backward compatibility " "(class attribute, removed during class creation)" msgstr "" -#: library/enum.rst:841 +#: library/enum.rst:880 msgid "" ":meth:`~Enum._generate_next_value_` -- used to get an appropriate value for " "an enum member; may be overridden" msgstr "" -#: library/enum.rst:846 +#: library/enum.rst:885 msgid "" -"For standard :class:`Enum` classes the next value chosen is the last value " -"seen incremented by one." +"For standard :class:`Enum` classes the next value chosen is the highest " +"value seen incremented by one." msgstr "" -#: library/enum.rst:849 +#: library/enum.rst:888 msgid "" "For :class:`Flag` classes the next value chosen will be the next highest " -"power-of-two, regardless of the last value seen." +"power-of-two." msgstr "" -#: library/enum.rst:852 +#: library/enum.rst:891 +msgid "" +"While ``_sunder_`` names are generally reserved for the further development " +"of the :class:`Enum` class and can not be used, some are explicitly allowed:" +msgstr "" + +#: library/enum.rst:894 +msgid "" +"``_repr_*`` (e.g. ``_repr_html_``), as used in `IPython's rich display`_" +msgstr "" + +#: library/enum.rst:896 msgid "``_missing_``, ``_order_``, ``_generate_next_value_``" msgstr "" -#: library/enum.rst:853 +#: library/enum.rst:897 msgid "``_ignore_``" msgstr "" -#: library/enum.rst:858 +#: library/enum.rst:898 +msgid "``_add_alias_``, ``_add_value_alias_``, ``_repr_*``" +msgstr "" + +#: library/enum.rst:904 msgid "Utilities and Decorators" msgstr "" -#: library/enum.rst:862 +#: library/enum.rst:908 msgid "" "*auto* can be used in place of a value. If used, the *Enum* machinery will " -"call an *Enum*'s :meth:`~Enum._generate_next_value_` to get an appropriate " -"value. For *Enum* and *IntEnum* that appropriate value will be the last " -"value plus one; for *Flag* and *IntFlag* it will be the first power-of-two " -"greater than the highest value; for *StrEnum* it will be the lower-cased " -"version of the member's name. Care must be taken if mixing *auto()* with " -"manually specified values." +"call an :class:`Enum`'s :meth:`~Enum._generate_next_value_` to get an " +"appropriate value. For :class:`Enum` and :class:`IntEnum` that appropriate " +"value will be the last value plus one; for :class:`Flag` and :class:" +"`IntFlag` it will be the first power-of-two greater than the highest value; " +"for :class:`StrEnum` it will be the lower-cased version of the member's " +"name. Care must be taken if mixing *auto()* with manually specified values." msgstr "" -#: library/enum.rst:870 +#: library/enum.rst:916 msgid "" "*auto* instances are only resolved when at the top level of an assignment:" msgstr "" -#: library/enum.rst:872 +#: library/enum.rst:918 msgid "``FIRST = auto()`` will work (auto() is replaced with ``1``);" msgstr "" -#: library/enum.rst:873 +#: library/enum.rst:919 msgid "" "``SECOND = auto(), -2`` will work (auto is replaced with ``2``, so ``2, -2`` " "is used to create the ``SECOND`` enum member;" msgstr "" -#: library/enum.rst:875 +#: library/enum.rst:921 msgid "" "``THREE = [auto(), -3]`` will *not* work (``, -3`` is used to " "create the ``THREE`` enum member)" msgstr "" -#: library/enum.rst:880 +#: library/enum.rst:926 msgid "" "In prior versions, ``auto()`` had to be the only thing on the assignment " "line to work properly." msgstr "" -#: library/enum.rst:883 +#: library/enum.rst:929 msgid "" "``_generate_next_value_`` can be overridden to customize the values used by " "*auto*." msgstr "" -#: library/enum.rst:886 +#: library/enum.rst:932 msgid "" "in 3.13 the default ``_generate_next_value_`` will always return the highest " "member value incremented by 1, and will fail if any member is an " "incompatible type." msgstr "" -#: library/enum.rst:892 +#: library/enum.rst:938 msgid "" "A decorator similar to the built-in *property*, but specifically for " "enumerations. It allows member attributes to have the same names as members " "themselves." msgstr "" -#: library/enum.rst:896 +#: library/enum.rst:942 msgid "" "the *property* and the member must be defined in separate classes; for " "example, the *value* and *name* attributes are defined in the *Enum* class, " @@ -1297,14 +1373,14 @@ msgid "" "``name``." msgstr "" -#: library/enum.rst:905 +#: library/enum.rst:951 msgid "" "A :keyword:`class` decorator specifically for enumerations. It searches an " "enumeration's :attr:`~EnumType.__members__`, gathering any aliases it finds; " "if any are found :exc:`ValueError` is raised with the details::" msgstr "" -#: library/enum.rst:909 +#: library/enum.rst:955 msgid "" ">>> from enum import Enum, unique\n" ">>> @unique\n" @@ -1319,22 +1395,22 @@ msgid "" "ValueError: duplicate values found in : FOUR -> THREE" msgstr "" -#: library/enum.rst:923 +#: library/enum.rst:969 msgid "" "A :keyword:`class` decorator specifically for enumerations. Members from :" "class:`EnumCheck` are used to specify which constraints should be checked on " "the decorated enumeration." msgstr "" -#: library/enum.rst:931 +#: library/enum.rst:977 msgid "A decorator for use in enums: its target will become a member." msgstr "" -#: library/enum.rst:937 +#: library/enum.rst:983 msgid "A decorator for use in enums: its target will not become a member." msgstr "" -#: library/enum.rst:943 +#: library/enum.rst:989 msgid "" "A decorator to change the :class:`str() ` and :func:`repr` of an enum " "to show its members as belonging to the module instead of its class. Should " @@ -1342,52 +1418,52 @@ msgid "" "namespace (see :class:`re.RegexFlag` for an example)." msgstr "" -#: library/enum.rst:953 +#: library/enum.rst:998 msgid "Return a list of all power-of-two integers contained in a flag *value*." msgstr "" -#: library/enum.rst:960 +#: library/enum.rst:1006 msgid "Notes" msgstr "" -#: library/enum.rst:962 +#: library/enum.rst:1008 msgid ":class:`IntEnum`, :class:`StrEnum`, and :class:`IntFlag`" msgstr "" -#: library/enum.rst:964 +#: library/enum.rst:1010 msgid "" "These three enum types are designed to be drop-in replacements for existing " "integer- and string-based values; as such, they have extra limitations:" msgstr "" -#: library/enum.rst:967 +#: library/enum.rst:1013 msgid "``__str__`` uses the value and not the name of the enum member" msgstr "" -#: library/enum.rst:969 +#: library/enum.rst:1015 msgid "" "``__format__``, because it uses ``__str__``, will also use the value of the " "enum member instead of its name" msgstr "" -#: library/enum.rst:972 +#: library/enum.rst:1018 msgid "" "If you do not need/want those limitations, you can either create your own " "base class by mixing in the ``int`` or ``str`` type yourself::" msgstr "" -#: library/enum.rst:975 +#: library/enum.rst:1021 msgid "" ">>> from enum import Enum\n" ">>> class MyIntEnum(int, Enum):\n" "... pass" msgstr "" -#: library/enum.rst:979 +#: library/enum.rst:1025 msgid "or you can reassign the appropriate :meth:`str`, etc., in your enum::" msgstr "" -#: library/enum.rst:981 +#: library/enum.rst:1027 msgid "" ">>> from enum import Enum, IntEnum\n" ">>> class MyIntEnum(IntEnum):\n" diff --git a/library/errno.po b/library/errno.po index 79160f7e..94d04945 100644 --- a/library/errno.po +++ b/library/errno.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" diff --git a/library/exceptions.po b/library/exceptions.po index f259d47c..917e1eea 100644 --- a/library/exceptions.po +++ b/library/exceptions.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -482,16 +482,41 @@ msgstr "" #: library/exceptions.rst:423 msgid "" -"This exception is derived from :exc:`RuntimeError`. It is raised when the " -"interpreter detects that the maximum recursion depth (see :func:`sys." -"getrecursionlimit`) is exceeded." +"This exception is derived from :exc:`RuntimeError`. It is raised when an " +"operation is blocked during interpreter shutdown also known as :term:`Python " +"finalization `." msgstr "" #: library/exceptions.rst:427 -msgid "Previously, a plain :exc:`RuntimeError` was raised." +msgid "" +"Examples of operations which can be blocked with a :exc:" +"`PythonFinalizationError` during the Python finalization:" +msgstr "" + +#: library/exceptions.rst:430 +msgid "Creating a new Python thread." +msgstr "" + +#: library/exceptions.rst:431 +msgid ":func:`os.fork`." msgstr "" #: library/exceptions.rst:433 +msgid "See also the :func:`sys.is_finalizing` function." +msgstr "" + +#: library/exceptions.rst:445 +msgid "Previously, a plain :exc:`RuntimeError` was raised." +msgstr "" + +#: library/exceptions.rst:441 +msgid "" +"This exception is derived from :exc:`RuntimeError`. It is raised when the " +"interpreter detects that the maximum recursion depth (see :func:`sys." +"getrecursionlimit`) is exceeded." +msgstr "" + +#: library/exceptions.rst:451 msgid "" "This exception is raised when a weak reference proxy, created by the :func:" "`weakref.proxy` function, is used to access an attribute of the referent " @@ -499,66 +524,66 @@ msgid "" "references, see the :mod:`weakref` module." msgstr "" -#: library/exceptions.rst:441 +#: library/exceptions.rst:459 msgid "" "Raised when an error is detected that doesn't fall in any of the other " "categories. The associated value is a string indicating what precisely went " "wrong." msgstr "" -#: library/exceptions.rst:448 +#: library/exceptions.rst:466 msgid "" "Raised by built-in function :func:`next` and an :term:`iterator`\\'s :meth:" "`~iterator.__next__` method to signal that there are no further items " "produced by the iterator." msgstr "" -#: library/exceptions.rst:454 +#: library/exceptions.rst:472 msgid "" "The exception object has a single attribute :attr:`!value`, which is given " "as an argument when constructing the exception, and defaults to :const:" "`None`." msgstr "" -#: library/exceptions.rst:458 +#: library/exceptions.rst:476 msgid "" "When a :term:`generator` or :term:`coroutine` function returns, a new :exc:" "`StopIteration` instance is raised, and the value returned by the function " "is used as the :attr:`value` parameter to the constructor of the exception." msgstr "" -#: library/exceptions.rst:463 +#: library/exceptions.rst:481 msgid "" "If a generator code directly or indirectly raises :exc:`StopIteration`, it " "is converted into a :exc:`RuntimeError` (retaining the :exc:`StopIteration` " "as the new exception's cause)." msgstr "" -#: library/exceptions.rst:467 +#: library/exceptions.rst:485 msgid "" "Added ``value`` attribute and the ability for generator functions to use it " "to return a value." msgstr "" -#: library/exceptions.rst:471 +#: library/exceptions.rst:489 msgid "" "Introduced the RuntimeError transformation via ``from __future__ import " "generator_stop``, see :pep:`479`." msgstr "" -#: library/exceptions.rst:475 +#: library/exceptions.rst:493 msgid "" "Enable :pep:`479` for all code by default: a :exc:`StopIteration` error " "raised in a generator is transformed into a :exc:`RuntimeError`." msgstr "" -#: library/exceptions.rst:481 +#: library/exceptions.rst:499 msgid "" "Must be raised by :meth:`~object.__anext__` method of an :term:`asynchronous " "iterator` object to stop the iteration." msgstr "" -#: library/exceptions.rst:488 +#: library/exceptions.rst:506 msgid "" "Raised when the parser encounters a syntax error. This may occur in an :" "keyword:`import` statement, in a call to the built-in functions :func:" @@ -566,45 +591,45 @@ msgid "" "or standard input (also interactively)." msgstr "" -#: library/exceptions.rst:494 +#: library/exceptions.rst:512 msgid "" "The :func:`str` of the exception instance returns only the error message. " "Details is a tuple whose members are also available as separate attributes." msgstr "" -#: library/exceptions.rst:499 +#: library/exceptions.rst:517 msgid "The name of the file the syntax error occurred in." msgstr "" -#: library/exceptions.rst:503 +#: library/exceptions.rst:521 msgid "" "Which line number in the file the error occurred in. This is 1-indexed: the " "first line in the file has a ``lineno`` of 1." msgstr "" -#: library/exceptions.rst:508 +#: library/exceptions.rst:526 msgid "" "The column in the line where the error occurred. This is 1-indexed: the " "first character in the line has an ``offset`` of 1." msgstr "" -#: library/exceptions.rst:513 +#: library/exceptions.rst:531 msgid "The source code text involved in the error." msgstr "" -#: library/exceptions.rst:517 +#: library/exceptions.rst:535 msgid "" "Which line number in the file the error occurred ends in. This is 1-indexed: " "the first line in the file has a ``lineno`` of 1." msgstr "" -#: library/exceptions.rst:522 +#: library/exceptions.rst:540 msgid "" "The column in the end line where the error occurred finishes. This is 1-" "indexed: the first character in the line has an ``offset`` of 1." msgstr "" -#: library/exceptions.rst:525 +#: library/exceptions.rst:543 msgid "" "For errors in f-string fields, the message is prefixed by \"f-string: \" and " "the offsets are offsets in a text constructed from the replacement " @@ -612,23 +637,23 @@ msgid "" "attribute: ('f-string: ...', ('', 1, 2, '(a b)\\n', 1, 5))." msgstr "" -#: library/exceptions.rst:530 +#: library/exceptions.rst:548 msgid "Added the :attr:`end_lineno` and :attr:`end_offset` attributes." msgstr "" -#: library/exceptions.rst:535 +#: library/exceptions.rst:553 msgid "" "Base class for syntax errors related to incorrect indentation. This is a " "subclass of :exc:`SyntaxError`." msgstr "" -#: library/exceptions.rst:541 +#: library/exceptions.rst:559 msgid "" "Raised when indentation contains an inconsistent use of tabs and spaces. " "This is a subclass of :exc:`IndentationError`." msgstr "" -#: library/exceptions.rst:547 +#: library/exceptions.rst:565 msgid "" "Raised when the interpreter finds an internal error, but the situation does " "not look so serious to cause it to abandon all hope. The associated value is " @@ -637,7 +662,7 @@ msgid "" "returning a ``NULL`` value without an exception set." msgstr "" -#: library/exceptions.rst:553 +#: library/exceptions.rst:571 msgid "" "If you're confident that this exception wasn't your fault, or the fault of a " "package you're using, you should report this to the author or maintainer of " @@ -648,7 +673,7 @@ msgid "" "the error." msgstr "" -#: library/exceptions.rst:564 +#: library/exceptions.rst:582 msgid "" "This exception is raised by the :func:`sys.exit` function. It inherits " "from :exc:`BaseException` instead of :exc:`Exception` so that it is not " @@ -662,7 +687,7 @@ msgid "" "printed and the exit status is one." msgstr "" -#: library/exceptions.rst:575 +#: library/exceptions.rst:593 msgid "" "A call to :func:`sys.exit` is translated into an exception so that clean-up " "handlers (:keyword:`finally` clauses of :keyword:`try` statements) can be " @@ -672,20 +697,20 @@ msgid "" "child process after a call to :func:`os.fork`)." msgstr "" -#: library/exceptions.rst:584 +#: library/exceptions.rst:602 msgid "" "The exit status or error message that is passed to the constructor. " "(Defaults to ``None``.)" msgstr "" -#: library/exceptions.rst:590 +#: library/exceptions.rst:608 msgid "" "Raised when an operation or function is applied to an object of " "inappropriate type. The associated value is a string giving details about " "the type mismatch." msgstr "" -#: library/exceptions.rst:593 +#: library/exceptions.rst:611 msgid "" "This exception may be raised by user code to indicate that an attempted " "operation on an object is not supported, and is not meant to be. If an " @@ -693,7 +718,7 @@ msgid "" "implementation, :exc:`NotImplementedError` is the proper exception to raise." msgstr "" -#: library/exceptions.rst:598 +#: library/exceptions.rst:616 msgid "" "Passing arguments of the wrong type (e.g. passing a :class:`list` when an :" "class:`int` is expected) should result in a :exc:`TypeError`, but passing " @@ -701,99 +726,99 @@ msgid "" "should result in a :exc:`ValueError`." msgstr "" -#: library/exceptions.rst:605 +#: library/exceptions.rst:623 msgid "" "Raised when a reference is made to a local variable in a function or method, " "but no value has been bound to that variable. This is a subclass of :exc:" "`NameError`." msgstr "" -#: library/exceptions.rst:612 +#: library/exceptions.rst:630 msgid "" "Raised when a Unicode-related encoding or decoding error occurs. It is a " "subclass of :exc:`ValueError`." msgstr "" -#: library/exceptions.rst:615 +#: library/exceptions.rst:633 msgid "" ":exc:`UnicodeError` has attributes that describe the encoding or decoding " "error. For example, ``err.object[err.start:err.end]`` gives the particular " "invalid input that the codec failed on." msgstr "" -#: library/exceptions.rst:621 +#: library/exceptions.rst:639 msgid "The name of the encoding that raised the error." msgstr "" -#: library/exceptions.rst:625 +#: library/exceptions.rst:643 msgid "A string describing the specific codec error." msgstr "" -#: library/exceptions.rst:629 +#: library/exceptions.rst:647 msgid "The object the codec was attempting to encode or decode." msgstr "" -#: library/exceptions.rst:633 +#: library/exceptions.rst:651 msgid "The first index of invalid data in :attr:`object`." msgstr "" -#: library/exceptions.rst:637 +#: library/exceptions.rst:655 msgid "The index after the last invalid data in :attr:`object`." msgstr "" -#: library/exceptions.rst:642 +#: library/exceptions.rst:660 msgid "" "Raised when a Unicode-related error occurs during encoding. It is a " "subclass of :exc:`UnicodeError`." msgstr "" -#: library/exceptions.rst:648 +#: library/exceptions.rst:666 msgid "" "Raised when a Unicode-related error occurs during decoding. It is a " "subclass of :exc:`UnicodeError`." msgstr "" -#: library/exceptions.rst:654 +#: library/exceptions.rst:672 msgid "" "Raised when a Unicode-related error occurs during translating. It is a " "subclass of :exc:`UnicodeError`." msgstr "" -#: library/exceptions.rst:660 +#: library/exceptions.rst:678 msgid "" "Raised when an operation or function receives an argument that has the right " "type but an inappropriate value, and the situation is not described by a " "more precise exception such as :exc:`IndexError`." msgstr "" -#: library/exceptions.rst:667 +#: library/exceptions.rst:685 msgid "" "Raised when the second argument of a division or modulo operation is zero. " "The associated value is a string indicating the type of the operands and the " "operation." msgstr "" -#: library/exceptions.rst:672 +#: library/exceptions.rst:690 msgid "" "The following exceptions are kept for compatibility with previous versions; " "starting from Python 3.3, they are aliases of :exc:`OSError`." msgstr "" -#: library/exceptions.rst:681 +#: library/exceptions.rst:699 msgid "Only available on Windows." msgstr "" -#: library/exceptions.rst:685 +#: library/exceptions.rst:703 msgid "OS exceptions" msgstr "" -#: library/exceptions.rst:687 +#: library/exceptions.rst:705 msgid "" "The following exceptions are subclasses of :exc:`OSError`, they get raised " "depending on the system error code." msgstr "" -#: library/exceptions.rst:692 +#: library/exceptions.rst:710 msgid "" "Raised when an operation would block on an object (e.g. socket) set for non-" "blocking operation. Corresponds to :c:data:`errno` :py:const:`~errno." @@ -801,36 +826,36 @@ msgid "" "const:`~errno.EINPROGRESS`." msgstr "" -#: library/exceptions.rst:697 +#: library/exceptions.rst:715 msgid "" "In addition to those of :exc:`OSError`, :exc:`BlockingIOError` can have one " "more attribute:" msgstr "" -#: library/exceptions.rst:702 +#: library/exceptions.rst:720 msgid "" "An integer containing the number of characters written to the stream before " "it blocked. This attribute is available when using the buffered I/O classes " "from the :mod:`io` module." msgstr "" -#: library/exceptions.rst:708 +#: library/exceptions.rst:726 msgid "" "Raised when an operation on a child process failed. Corresponds to :c:data:" "`errno` :py:const:`~errno.ECHILD`." msgstr "" -#: library/exceptions.rst:713 +#: library/exceptions.rst:731 msgid "A base class for connection-related issues." msgstr "" -#: library/exceptions.rst:715 +#: library/exceptions.rst:733 msgid "" "Subclasses are :exc:`BrokenPipeError`, :exc:`ConnectionAbortedError`, :exc:" "`ConnectionRefusedError` and :exc:`ConnectionResetError`." msgstr "" -#: library/exceptions.rst:720 +#: library/exceptions.rst:738 msgid "" "A subclass of :exc:`ConnectionError`, raised when trying to write on a pipe " "while the other end has been closed, or trying to write on a socket which " @@ -838,58 +863,58 @@ msgid "" "`~errno.EPIPE` and :py:const:`~errno.ESHUTDOWN`." msgstr "" -#: library/exceptions.rst:727 +#: library/exceptions.rst:745 msgid "" "A subclass of :exc:`ConnectionError`, raised when a connection attempt is " "aborted by the peer. Corresponds to :c:data:`errno` :py:const:`~errno." "ECONNABORTED`." msgstr "" -#: library/exceptions.rst:733 +#: library/exceptions.rst:751 msgid "" "A subclass of :exc:`ConnectionError`, raised when a connection attempt is " "refused by the peer. Corresponds to :c:data:`errno` :py:const:`~errno." "ECONNREFUSED`." msgstr "" -#: library/exceptions.rst:739 +#: library/exceptions.rst:757 msgid "" "A subclass of :exc:`ConnectionError`, raised when a connection is reset by " "the peer. Corresponds to :c:data:`errno` :py:const:`~errno.ECONNRESET`." msgstr "" -#: library/exceptions.rst:745 +#: library/exceptions.rst:763 msgid "" "Raised when trying to create a file or directory which already exists. " "Corresponds to :c:data:`errno` :py:const:`~errno.EEXIST`." msgstr "" -#: library/exceptions.rst:750 +#: library/exceptions.rst:768 msgid "" "Raised when a file or directory is requested but doesn't exist. Corresponds " "to :c:data:`errno` :py:const:`~errno.ENOENT`." msgstr "" -#: library/exceptions.rst:755 +#: library/exceptions.rst:773 msgid "" "Raised when a system call is interrupted by an incoming signal. Corresponds " "to :c:data:`errno` :py:const:`~errno.EINTR`." msgstr "" -#: library/exceptions.rst:758 +#: library/exceptions.rst:776 msgid "" "Python now retries system calls when a syscall is interrupted by a signal, " "except if the signal handler raises an exception (see :pep:`475` for the " "rationale), instead of raising :exc:`InterruptedError`." msgstr "" -#: library/exceptions.rst:765 +#: library/exceptions.rst:783 msgid "" "Raised when a file operation (such as :func:`os.remove`) is requested on a " "directory. Corresponds to :c:data:`errno` :py:const:`~errno.EISDIR`." msgstr "" -#: library/exceptions.rst:771 +#: library/exceptions.rst:789 msgid "" "Raised when a directory operation (such as :func:`os.listdir`) is requested " "on something which is not a directory. On most POSIX platforms, it may also " @@ -898,7 +923,7 @@ msgid "" "ENOTDIR`." msgstr "" -#: library/exceptions.rst:779 +#: library/exceptions.rst:797 msgid "" "Raised when trying to run an operation without the adequate access rights - " "for example filesystem permissions. Corresponds to :c:data:`errno` :py:const:" @@ -906,130 +931,130 @@ msgid "" "ENOTCAPABLE`." msgstr "" -#: library/exceptions.rst:784 +#: library/exceptions.rst:802 msgid "" "WASI's :py:const:`~errno.ENOTCAPABLE` is now mapped to :exc:" "`PermissionError`." msgstr "" -#: library/exceptions.rst:790 +#: library/exceptions.rst:808 msgid "" "Raised when a given process doesn't exist. Corresponds to :c:data:`errno` :" "py:const:`~errno.ESRCH`." msgstr "" -#: library/exceptions.rst:795 +#: library/exceptions.rst:813 msgid "" "Raised when a system function timed out at the system level. Corresponds to :" "c:data:`errno` :py:const:`~errno.ETIMEDOUT`." msgstr "" -#: library/exceptions.rst:798 +#: library/exceptions.rst:816 msgid "All the above :exc:`OSError` subclasses were added." msgstr "" -#: library/exceptions.rst:804 +#: library/exceptions.rst:822 msgid ":pep:`3151` - Reworking the OS and IO exception hierarchy" msgstr "" -#: library/exceptions.rst:810 +#: library/exceptions.rst:828 msgid "Warnings" msgstr "" -#: library/exceptions.rst:812 +#: library/exceptions.rst:830 msgid "" "The following exceptions are used as warning categories; see the :ref:" "`warning-categories` documentation for more details." msgstr "" -#: library/exceptions.rst:817 +#: library/exceptions.rst:835 msgid "Base class for warning categories." msgstr "" -#: library/exceptions.rst:822 +#: library/exceptions.rst:840 msgid "Base class for warnings generated by user code." msgstr "" -#: library/exceptions.rst:827 +#: library/exceptions.rst:845 msgid "" "Base class for warnings about deprecated features when those warnings are " "intended for other Python developers." msgstr "" -#: library/exceptions.rst:830 +#: library/exceptions.rst:848 msgid "" "Ignored by the default warning filters, except in the ``__main__`` module (:" "pep:`565`). Enabling the :ref:`Python Development Mode ` shows this " "warning." msgstr "" -#: library/exceptions.rst:850 +#: library/exceptions.rst:868 msgid "The deprecation policy is described in :pep:`387`." msgstr "" -#: library/exceptions.rst:839 +#: library/exceptions.rst:857 msgid "" "Base class for warnings about features which are obsolete and expected to be " "deprecated in the future, but are not deprecated at the moment." msgstr "" -#: library/exceptions.rst:843 +#: library/exceptions.rst:861 msgid "" "This class is rarely used as emitting a warning about a possible upcoming " "deprecation is unusual, and :exc:`DeprecationWarning` is preferred for " "already active deprecations." msgstr "" -#: library/exceptions.rst:873 library/exceptions.rst:900 +#: library/exceptions.rst:891 library/exceptions.rst:918 msgid "" "Ignored by the default warning filters. Enabling the :ref:`Python " "Development Mode ` shows this warning." msgstr "" -#: library/exceptions.rst:855 +#: library/exceptions.rst:873 msgid "Base class for warnings about dubious syntax." msgstr "" -#: library/exceptions.rst:860 +#: library/exceptions.rst:878 msgid "Base class for warnings about dubious runtime behavior." msgstr "" -#: library/exceptions.rst:865 +#: library/exceptions.rst:883 msgid "" "Base class for warnings about deprecated features when those warnings are " "intended for end users of applications that are written in Python." msgstr "" -#: library/exceptions.rst:871 +#: library/exceptions.rst:889 msgid "Base class for warnings about probable mistakes in module imports." msgstr "" -#: library/exceptions.rst:879 +#: library/exceptions.rst:897 msgid "Base class for warnings related to Unicode." msgstr "" -#: library/exceptions.rst:884 +#: library/exceptions.rst:902 msgid "Base class for warnings related to encodings." msgstr "" -#: library/exceptions.rst:886 +#: library/exceptions.rst:904 msgid "See :ref:`io-encoding-warning` for details." msgstr "" -#: library/exceptions.rst:893 +#: library/exceptions.rst:911 msgid "" "Base class for warnings related to :class:`bytes` and :class:`bytearray`." msgstr "" -#: library/exceptions.rst:898 +#: library/exceptions.rst:916 msgid "Base class for warnings related to resource usage." msgstr "" -#: library/exceptions.rst:909 +#: library/exceptions.rst:927 msgid "Exception groups" msgstr "" -#: library/exceptions.rst:911 +#: library/exceptions.rst:929 msgid "" "The following are used when it is necessary to raise multiple unrelated " "exceptions. They are part of the exception hierarchy so they can be handled " @@ -1038,7 +1063,7 @@ msgid "" "based on the types of the contained exceptions." msgstr "" -#: library/exceptions.rst:920 +#: library/exceptions.rst:938 msgid "" "Both of these exception types wrap the exceptions in the sequence ``excs``. " "The ``msg`` parameter must be a string. The difference between the two " @@ -1049,7 +1074,7 @@ msgid "" "exc:`BaseExceptionGroup`." msgstr "" -#: library/exceptions.rst:928 +#: library/exceptions.rst:946 msgid "" "The :exc:`BaseExceptionGroup` constructor returns an :exc:`ExceptionGroup` " "rather than a :exc:`BaseExceptionGroup` if all contained exceptions are :exc:" @@ -1058,31 +1083,32 @@ msgid "" "`TypeError` if any contained exception is not an :exc:`Exception` subclass." msgstr "" -#: library/exceptions.rst:937 +#: library/exceptions.rst:955 msgid "The ``msg`` argument to the constructor. This is a read-only attribute." msgstr "" -#: library/exceptions.rst:941 +#: library/exceptions.rst:959 msgid "" "A tuple of the exceptions in the ``excs`` sequence given to the constructor. " "This is a read-only attribute." msgstr "" -#: library/exceptions.rst:946 +#: library/exceptions.rst:964 msgid "" "Returns an exception group that contains only the exceptions from the " "current group that match *condition*, or ``None`` if the result is empty." msgstr "" -#: library/exceptions.rst:949 +#: library/exceptions.rst:967 msgid "" -"The condition can be either a function that accepts an exception and returns " -"true for those that should be in the subgroup, or it can be an exception " -"type or a tuple of exception types, which is used to check for a match using " -"the same check that is used in an ``except`` clause." +"The condition can be an exception type or tuple of exception types, in which " +"case each exception is checked for a match using the same check that is used " +"in an ``except`` clause. The condition can also be a callable (other than a " +"type object) that accepts an exception as its single argument and returns " +"true for the exceptions that should be in the subgroup." msgstr "" -#: library/exceptions.rst:954 +#: library/exceptions.rst:973 msgid "" "The nesting structure of the current exception is preserved in the result, " "as are the values of its :attr:`message`, :attr:`~BaseException." @@ -1091,27 +1117,31 @@ msgid "" "groups are omitted from the result." msgstr "" -#: library/exceptions.rst:961 +#: library/exceptions.rst:980 msgid "" "The condition is checked for all exceptions in the nested exception group, " "including the top-level and any nested exception groups. If the condition is " "true for such an exception group, it is included in the result in full." msgstr "" -#: library/exceptions.rst:967 +#: library/exceptions.rst:984 +msgid "``condition`` can be any callable which is not a type object." +msgstr "" + +#: library/exceptions.rst:989 msgid "" "Like :meth:`subgroup`, but returns the pair ``(match, rest)`` where " "``match`` is ``subgroup(condition)`` and ``rest`` is the remaining non-" "matching part." msgstr "" -#: library/exceptions.rst:973 +#: library/exceptions.rst:995 msgid "" "Returns an exception group with the same :attr:`message`, but which wraps " "the exceptions in ``excs``." msgstr "" -#: library/exceptions.rst:976 +#: library/exceptions.rst:998 msgid "" "This method is used by :meth:`subgroup` and :meth:`split`, which are used in " "various contexts to break up an exception group. A subclass needs to " @@ -1119,7 +1149,7 @@ msgid "" "instances of the subclass rather than :exc:`ExceptionGroup`." msgstr "" -#: library/exceptions.rst:982 +#: library/exceptions.rst:1004 msgid "" ":meth:`subgroup` and :meth:`split` copy the :attr:`~BaseException." "__traceback__`, :attr:`~BaseException.__cause__`, :attr:`~BaseException." @@ -1128,7 +1158,7 @@ msgid "" "not need to be updated by :meth:`derive`." msgstr "" -#: library/exceptions.rst:989 +#: library/exceptions.rst:1011 msgid "" ">>> class MyGroup(ExceptionGroup):\n" "... def derive(self, excs):\n" @@ -1157,7 +1187,7 @@ msgid "" "True" msgstr "" -#: library/exceptions.rst:1015 +#: library/exceptions.rst:1037 msgid "" "Note that :exc:`BaseExceptionGroup` defines :meth:`~object.__new__`, so " "subclasses that need a different constructor signature need to override that " @@ -1166,7 +1196,7 @@ msgid "" "group's message from it. ::" msgstr "" -#: library/exceptions.rst:1021 +#: library/exceptions.rst:1043 msgid "" "class Errors(ExceptionGroup):\n" " def __new__(cls, errors, exit_code):\n" @@ -1178,22 +1208,22 @@ msgid "" " return Errors(excs, self.exit_code)" msgstr "" -#: library/exceptions.rst:1030 +#: library/exceptions.rst:1052 msgid "" "Like :exc:`ExceptionGroup`, any subclass of :exc:`BaseExceptionGroup` which " "is also a subclass of :exc:`Exception` can only wrap instances of :exc:" "`Exception`." msgstr "" -#: library/exceptions.rst:1038 +#: library/exceptions.rst:1060 msgid "Exception hierarchy" msgstr "" -#: library/exceptions.rst:1040 +#: library/exceptions.rst:1062 msgid "The class hierarchy for built-in exceptions is:" msgstr "" -#: library/exceptions.rst:1042 +#: library/exceptions.rst:1064 msgid "" "BaseException\n" " ├── BaseExceptionGroup\n" @@ -1237,6 +1267,7 @@ msgid "" " ├── ReferenceError\n" " ├── RuntimeError\n" " │ ├── NotImplementedError\n" +" │ ├── PythonFinalizationError\n" " │ └── RecursionError\n" " ├── StopAsyncIteration\n" " ├── StopIteration\n" diff --git a/library/faulthandler.po b/library/faulthandler.po index 331d4072..98154171 100644 --- a/library/faulthandler.po +++ b/library/faulthandler.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" diff --git a/library/fcntl.po b/library/fcntl.po index ddd3563c..fc41fd7b 100644 --- a/library/fcntl.po +++ b/library/fcntl.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -50,29 +50,30 @@ msgstr "" #: library/fcntl.rst:33 msgid "" -"The fcntl module now contains ``F_ADD_SEALS``, ``F_GET_SEALS``, and " +"The :mod:`!fcntl` module now contains ``F_ADD_SEALS``, ``F_GET_SEALS``, and " "``F_SEAL_*`` constants for sealing of :func:`os.memfd_create` file " "descriptors." msgstr "" #: library/fcntl.rst:38 msgid "" -"On macOS, the fcntl module exposes the ``F_GETPATH`` constant, which obtains " -"the path of a file from a file descriptor. On Linux(>=3.15), the fcntl " -"module exposes the ``F_OFD_GETLK``, ``F_OFD_SETLK`` and ``F_OFD_SETLKW`` " -"constants, which are used when working with open file description locks." +"On macOS, the :mod:`!fcntl` module exposes the ``F_GETPATH`` constant, which " +"obtains the path of a file from a file descriptor. On Linux(>=3.15), the :" +"mod:`!fcntl` module exposes the ``F_OFD_GETLK``, ``F_OFD_SETLK`` and " +"``F_OFD_SETLKW`` constants, which are used when working with open file " +"description locks." msgstr "" #: library/fcntl.rst:45 msgid "" -"On Linux >= 2.6.11, the fcntl module exposes the ``F_GETPIPE_SZ`` and " -"``F_SETPIPE_SZ`` constants, which allow to check and modify a pipe's size " -"respectively." +"On Linux >= 2.6.11, the :mod:`!fcntl` module exposes the ``F_GETPIPE_SZ`` " +"and ``F_SETPIPE_SZ`` constants, which allow to check and modify a pipe's " +"size respectively." msgstr "" #: library/fcntl.rst:50 msgid "" -"On FreeBSD, the fcntl module exposes the ``F_DUP2FD`` and " +"On FreeBSD, the :mod:`!fcntl` module exposes the ``F_DUP2FD`` and " "``F_DUP2FD_CLOEXEC`` constants, which allow to duplicate a file descriptor, " "the latter setting ``FD_CLOEXEC`` flag in addition." msgstr "" @@ -86,100 +87,137 @@ msgid "" msgstr "" #: library/fcntl.rst:61 +msgid "" +"On Linux >= 2.6.32, the :mod:`!fcntl` module exposes the ``F_GETOWN_EX``, " +"``F_SETOWN_EX``, ``F_OWNER_TID``, ``F_OWNER_PID``, ``F_OWNER_PGRP`` " +"constants, which allow to direct I/O availability signals to a specific " +"thread, process, or process group. On Linux >= 4.13, the :mod:`!fcntl` " +"module exposes the ``F_GET_RW_HINT``, ``F_SET_RW_HINT``, " +"``F_GET_FILE_RW_HINT``, ``F_SET_FILE_RW_HINT``, and ``RWH_WRITE_LIFE_*`` " +"constants, which allow to inform the kernel about the relative expected " +"lifetime of writes on a given inode or via a particular open file " +"description. On Linux >= 5.1 and NetBSD, the :mod:`!fcntl` module exposes " +"the ``F_SEAL_FUTURE_WRITE`` constant for use with ``F_ADD_SEALS`` and " +"``F_GET_SEALS`` operations. On FreeBSD, the :mod:`!fcntl` module exposes the " +"``F_READAHEAD``, ``F_ISUNIONSTACK``, and ``F_KINFO`` constants. On macOS and " +"FreeBSD, the :mod:`!fcntl` module exposes the ``F_RDAHEAD`` constant. On " +"NetBSD and AIX, the :mod:`!fcntl` module exposes the ``F_CLOSEM`` constant. " +"On NetBSD, the :mod:`!fcntl` module exposes the ``F_MAXFD`` constant. On " +"macOS and NetBSD, the :mod:`!fcntl` module exposes the ``F_GETNOSIGPIPE`` " +"and ``F_SETNOSIGPIPE`` constant." +msgstr "" + +#: library/fcntl.rst:82 msgid "The module defines the following functions:" msgstr "" -#: library/fcntl.rst:66 +#: library/fcntl.rst:87 msgid "" "Perform the operation *cmd* on file descriptor *fd* (file objects providing " "a :meth:`~io.IOBase.fileno` method are accepted as well). The values used " "for *cmd* are operating system dependent, and are available as constants in " "the :mod:`fcntl` module, using the same names as used in the relevant C " -"header files. The argument *arg* can either be an integer value, or a :class:" -"`bytes` object. With an integer value, the return value of this function is " -"the integer return value of the C :c:func:`fcntl` call. When the argument " -"is bytes it represents a binary structure, e.g. created by :func:`struct." -"pack`. The binary data is copied to a buffer whose address is passed to the " -"C :c:func:`fcntl` call. The return value after a successful call is the " -"contents of the buffer, converted to a :class:`bytes` object. The length of " -"the returned object will be the same as the length of the *arg* argument. " -"This is limited to 1024 bytes. If the information returned in the buffer by " -"the operating system is larger than 1024 bytes, this is most likely to " -"result in a segmentation violation or a more subtle data corruption." -msgstr "" - -#: library/fcntl.rst:83 +"header files. The argument *arg* can either be an integer value, a :class:" +"`bytes` object, or a string. The type and size of *arg* must match the type " +"and size of the argument of the operation as specified in the relevant C " +"documentation." +msgstr "" + +#: library/fcntl.rst:96 +msgid "" +"When *arg* is an integer, the function returns the integer return value of " +"the C :c:func:`fcntl` call." +msgstr "" + +#: library/fcntl.rst:99 +msgid "" +"When the argument is bytes, it represents a binary structure, for example, " +"created by :func:`struct.pack`. A string value is encoded to binary using " +"the UTF-8 encoding. The binary data is copied to a buffer whose address is " +"passed to the C :c:func:`fcntl` call. The return value after a successful " +"call is the contents of the buffer, converted to a :class:`bytes` object. " +"The length of the returned object will be the same as the length of the " +"*arg* argument. This is limited to 1024 bytes." +msgstr "" + +#: library/fcntl.rst:108 msgid "If the :c:func:`fcntl` call fails, an :exc:`OSError` is raised." msgstr "" -#: library/fcntl.rst:85 +#: library/fcntl.rst:111 +msgid "" +"If the type or the size of *arg* does not match the type or size of the " +"argument of the operation (for example, if an integer is passed when a " +"pointer is expected, or the information returned in the buffer by the " +"operating system is larger than 1024 bytes), this is most likely to result " +"in a segmentation violation or a more subtle data corruption." +msgstr "" + +#: library/fcntl.rst:118 msgid "" "Raises an :ref:`auditing event ` ``fcntl.fcntl`` with arguments " "``fd``, ``cmd``, ``arg``." msgstr "" -#: library/fcntl.rst:90 +#: library/fcntl.rst:123 msgid "" "This function is identical to the :func:`~fcntl.fcntl` function, except that " "the argument handling is even more complicated." msgstr "" -#: library/fcntl.rst:93 +#: library/fcntl.rst:126 msgid "" -"The *request* parameter is limited to values that can fit in 32-bits. " -"Additional constants of interest for use as the *request* argument can be " -"found in the :mod:`termios` module, under the same names as used in the " -"relevant C header files." +"The *request* parameter is limited to values that can fit in 32-bits or 64-" +"bits, depending on the platform. Additional constants of interest for use as " +"the *request* argument can be found in the :mod:`termios` module, under the " +"same names as used in the relevant C header files." msgstr "" -#: library/fcntl.rst:98 +#: library/fcntl.rst:132 msgid "" -"The parameter *arg* can be one of an integer, an object supporting the read-" -"only buffer interface (like :class:`bytes`) or an object supporting the read-" -"write buffer interface (like :class:`bytearray`)." +"The parameter *arg* can be an integer, a :term:`bytes-like object`, or a " +"string. The type and size of *arg* must match the type and size of the " +"argument of the operation as specified in the relevant C documentation." msgstr "" -#: library/fcntl.rst:102 +#: library/fcntl.rst:137 msgid "" -"In all but the last case, behaviour is as for the :func:`~fcntl.fcntl` " -"function." +"If *arg* does not support the read-write buffer interface or the " +"*mutate_flag* is false, behavior is as for the :func:`~fcntl.fcntl` function." msgstr "" -#: library/fcntl.rst:105 -msgid "" -"If a mutable buffer is passed, then the behaviour is determined by the value " -"of the *mutate_flag* parameter." -msgstr "" - -#: library/fcntl.rst:108 +#: library/fcntl.rst:141 msgid "" -"If it is false, the buffer's mutability is ignored and behaviour is as for a " -"read-only buffer, except that the 1024 byte limit mentioned above is avoided " -"-- so long as the buffer you pass is at least as long as what the operating " -"system wants to put there, things should work." +"If *arg* supports the read-write buffer interface (like :class:`bytearray`) " +"and *mutate_flag* is true (the default), then the buffer is (in effect) " +"passed to the underlying :c:func:`!ioctl` system call, the latter's return " +"code is passed back to the calling Python, and the buffer's new contents " +"reflect the action of the :c:func:`ioctl`. This is a slight simplification, " +"because if the supplied buffer is less than 1024 bytes long it is first " +"copied into a static buffer 1024 bytes long which is then passed to :func:" +"`ioctl` and copied back into the supplied buffer." msgstr "" -#: library/fcntl.rst:113 +#: library/fcntl.rst:150 msgid "" -"If *mutate_flag* is true (the default), then the buffer is (in effect) " -"passed to the underlying :func:`ioctl` system call, the latter's return code " -"is passed back to the calling Python, and the buffer's new contents reflect " -"the action of the :func:`ioctl`. This is a slight simplification, because " -"if the supplied buffer is less than 1024 bytes long it is first copied into " -"a static buffer 1024 bytes long which is then passed to :func:`ioctl` and " -"copied back into the supplied buffer." +"If the :c:func:`ioctl` call fails, an :exc:`OSError` exception is raised." msgstr "" -#: library/fcntl.rst:121 +#: library/fcntl.rst:153 msgid "" -"If the :c:func:`ioctl` call fails, an :exc:`OSError` exception is raised." +"If the type or size of *arg* does not match the type or size of the " +"operation's argument (for example, if an integer is passed when a pointer is " +"expected, or the information returned in the buffer by the operating system " +"is larger than 1024 bytes, or the size of the mutable bytes-like object is " +"too small), this is most likely to result in a segmentation violation or a " +"more subtle data corruption." msgstr "" -#: library/fcntl.rst:123 +#: library/fcntl.rst:161 msgid "An example::" msgstr "" -#: library/fcntl.rst:125 +#: library/fcntl.rst:163 msgid "" ">>> import array, fcntl, struct, termios, os\n" ">>> os.getpgrp()\n" @@ -193,13 +231,13 @@ msgid "" "array('h', [13341])" msgstr "" -#: library/fcntl.rst:136 +#: library/fcntl.rst:174 msgid "" "Raises an :ref:`auditing event ` ``fcntl.ioctl`` with arguments " "``fd``, ``request``, ``arg``." msgstr "" -#: library/fcntl.rst:141 +#: library/fcntl.rst:179 msgid "" "Perform the lock operation *operation* on file descriptor *fd* (file objects " "providing a :meth:`~io.IOBase.fileno` method are accepted as well). See the " @@ -207,18 +245,18 @@ msgid "" "function is emulated using :c:func:`fcntl`.)" msgstr "" -#: library/fcntl.rst:146 +#: library/fcntl.rst:184 msgid "" "If the :c:func:`flock` call fails, an :exc:`OSError` exception is raised." msgstr "" -#: library/fcntl.rst:148 +#: library/fcntl.rst:186 msgid "" "Raises an :ref:`auditing event ` ``fcntl.flock`` with arguments " "``fd``, ``operation``." msgstr "" -#: library/fcntl.rst:153 +#: library/fcntl.rst:191 msgid "" "This is essentially a wrapper around the :func:`~fcntl.fcntl` locking calls. " "*fd* is the file descriptor (file objects providing a :meth:`~io.IOBase." @@ -226,25 +264,25 @@ msgid "" "*cmd* is one of the following values:" msgstr "" -#: library/fcntl.rst:160 +#: library/fcntl.rst:198 msgid "Release an existing lock." msgstr "" -#: library/fcntl.rst:164 +#: library/fcntl.rst:202 msgid "Acquire a shared lock." msgstr "" -#: library/fcntl.rst:168 +#: library/fcntl.rst:206 msgid "Acquire an exclusive lock." msgstr "" -#: library/fcntl.rst:172 +#: library/fcntl.rst:210 msgid "" "Bitwise OR with any of the other three ``LOCK_*`` constants to make the " "request non-blocking." msgstr "" -#: library/fcntl.rst:175 +#: library/fcntl.rst:213 msgid "" "If :const:`!LOCK_NB` is used and the lock cannot be acquired, an :exc:" "`OSError` will be raised and the exception will have an *errno* attribute " @@ -254,43 +292,43 @@ msgid "" "a file opened for writing." msgstr "" -#: library/fcntl.rst:182 +#: library/fcntl.rst:220 msgid "" "*len* is the number of bytes to lock, *start* is the byte offset at which " "the lock starts, relative to *whence*, and *whence* is as with :func:`io." "IOBase.seek`, specifically:" msgstr "" -#: library/fcntl.rst:186 +#: library/fcntl.rst:224 msgid "``0`` -- relative to the start of the file (:const:`os.SEEK_SET`)" msgstr "" -#: library/fcntl.rst:187 +#: library/fcntl.rst:225 msgid "``1`` -- relative to the current buffer position (:const:`os.SEEK_CUR`)" msgstr "" -#: library/fcntl.rst:188 +#: library/fcntl.rst:226 msgid "``2`` -- relative to the end of the file (:const:`os.SEEK_END`)" msgstr "" -#: library/fcntl.rst:190 +#: library/fcntl.rst:228 msgid "" "The default for *start* is 0, which means to start at the beginning of the " "file. The default for *len* is 0 which means to lock to the end of the " "file. The default for *whence* is also 0." msgstr "" -#: library/fcntl.rst:194 +#: library/fcntl.rst:232 msgid "" "Raises an :ref:`auditing event ` ``fcntl.lockf`` with arguments " "``fd``, ``cmd``, ``len``, ``start``, ``whence``." msgstr "" -#: library/fcntl.rst:196 +#: library/fcntl.rst:234 msgid "Examples (all on a SVR4 compliant system)::" msgstr "" -#: library/fcntl.rst:198 +#: library/fcntl.rst:236 msgid "" "import struct, fcntl, os\n" "\n" @@ -301,7 +339,7 @@ msgid "" "rv = fcntl.fcntl(f, fcntl.F_SETLKW, lockdata)" msgstr "" -#: library/fcntl.rst:206 +#: library/fcntl.rst:244 msgid "" "Note that in the first example the return value variable *rv* will hold an " "integer value; in the second example it will hold a :class:`bytes` object. " @@ -309,11 +347,11 @@ msgid "" "therefore using the :func:`flock` call may be better." msgstr "" -#: library/fcntl.rst:214 +#: library/fcntl.rst:252 msgid "Module :mod:`os`" msgstr "" -#: library/fcntl.rst:215 +#: library/fcntl.rst:253 msgid "" "If the locking flags :const:`~os.O_SHLOCK` and :const:`~os.O_EXLOCK` are " "present in the :mod:`os` module (on BSD only), the :func:`os.open` function " diff --git a/library/filecmp.po b/library/filecmp.po index 80a9da26..bc8f25c6 100644 --- a/library/filecmp.po +++ b/library/filecmp.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -119,124 +119,128 @@ msgstr "" #: library/filecmp.rst:80 msgid "" "The :class:`dircmp` class compares files by doing *shallow* comparisons as " -"described for :func:`filecmp.cmp`." +"described for :func:`filecmp.cmp` by default using the *shallow* parameter." msgstr "" -#: library/filecmp.rst:83 +#: library/filecmp.rst:86 +msgid "Added the *shallow* parameter." +msgstr "" + +#: library/filecmp.rst:88 msgid "The :class:`dircmp` class provides the following methods:" msgstr "" -#: library/filecmp.rst:87 +#: library/filecmp.rst:92 msgid "Print (to :data:`sys.stdout`) a comparison between *a* and *b*." msgstr "" -#: library/filecmp.rst:91 +#: library/filecmp.rst:96 msgid "" "Print a comparison between *a* and *b* and common immediate subdirectories." msgstr "" -#: library/filecmp.rst:96 +#: library/filecmp.rst:101 msgid "" "Print a comparison between *a* and *b* and common subdirectories " "(recursively)." msgstr "" -#: library/filecmp.rst:99 +#: library/filecmp.rst:104 msgid "" "The :class:`dircmp` class offers a number of interesting attributes that may " "be used to get various bits of information about the directory trees being " "compared." msgstr "" -#: library/filecmp.rst:103 +#: library/filecmp.rst:108 msgid "" "Note that via :meth:`~object.__getattr__` hooks, all attributes are computed " "lazily, so there is no speed penalty if only those attributes which are " "lightweight to compute are used." msgstr "" -#: library/filecmp.rst:110 +#: library/filecmp.rst:115 msgid "The directory *a*." msgstr "" -#: library/filecmp.rst:115 +#: library/filecmp.rst:120 msgid "The directory *b*." msgstr "" -#: library/filecmp.rst:120 +#: library/filecmp.rst:125 msgid "Files and subdirectories in *a*, filtered by *hide* and *ignore*." msgstr "" -#: library/filecmp.rst:125 +#: library/filecmp.rst:130 msgid "Files and subdirectories in *b*, filtered by *hide* and *ignore*." msgstr "" -#: library/filecmp.rst:130 +#: library/filecmp.rst:135 msgid "Files and subdirectories in both *a* and *b*." msgstr "" -#: library/filecmp.rst:135 +#: library/filecmp.rst:140 msgid "Files and subdirectories only in *a*." msgstr "" -#: library/filecmp.rst:140 +#: library/filecmp.rst:145 msgid "Files and subdirectories only in *b*." msgstr "" -#: library/filecmp.rst:145 +#: library/filecmp.rst:150 msgid "Subdirectories in both *a* and *b*." msgstr "" -#: library/filecmp.rst:150 +#: library/filecmp.rst:155 msgid "Files in both *a* and *b*." msgstr "" -#: library/filecmp.rst:155 +#: library/filecmp.rst:160 msgid "" "Names in both *a* and *b*, such that the type differs between the " "directories, or names for which :func:`os.stat` reports an error." msgstr "" -#: library/filecmp.rst:161 +#: library/filecmp.rst:166 msgid "" "Files which are identical in both *a* and *b*, using the class's file " "comparison operator." msgstr "" -#: library/filecmp.rst:167 +#: library/filecmp.rst:172 msgid "" "Files which are in both *a* and *b*, whose contents differ according to the " "class's file comparison operator." msgstr "" -#: library/filecmp.rst:173 +#: library/filecmp.rst:178 msgid "Files which are in both *a* and *b*, but could not be compared." msgstr "" -#: library/filecmp.rst:178 +#: library/filecmp.rst:183 msgid "" "A dictionary mapping names in :attr:`common_dirs` to :class:`dircmp` " "instances (or MyDirCmp instances if this instance is of type MyDirCmp, a " "subclass of :class:`dircmp`)." msgstr "" -#: library/filecmp.rst:182 +#: library/filecmp.rst:187 msgid "" "Previously entries were always :class:`dircmp` instances. Now entries are " "the same type as *self*, if *self* is a subclass of :class:`dircmp`." msgstr "" -#: library/filecmp.rst:191 +#: library/filecmp.rst:196 msgid "List of directories ignored by :class:`dircmp` by default." msgstr "" -#: library/filecmp.rst:194 +#: library/filecmp.rst:199 msgid "" "Here is a simplified example of using the ``subdirs`` attribute to search " "recursively through two directories to show common different files::" msgstr "" -#: library/filecmp.rst:197 +#: library/filecmp.rst:202 msgid "" ">>> from filecmp import dircmp\n" ">>> def print_diff_files(dcmp):\n" diff --git a/library/fileformats.po b/library/fileformats.po index 97e14b71..1b14bfd0 100644 --- a/library/fileformats.po +++ b/library/fileformats.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" diff --git a/library/fileinput.po b/library/fileinput.po index 8d413efc..83c84205 100644 --- a/library/fileinput.po +++ b/library/fileinput.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" diff --git a/library/filesys.po b/library/filesys.po index 7b7f954e..e125f709 100644 --- a/library/filesys.po +++ b/library/filesys.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -29,30 +29,30 @@ msgid "" "full list of modules in this chapter is:" msgstr "" -#: library/filesys.rst:29 +#: library/filesys.rst:28 msgid "Module :mod:`os`" msgstr "" -#: library/filesys.rst:30 +#: library/filesys.rst:29 msgid "" "Operating system interfaces, including functions to work with files at a " "lower level than Python :term:`file objects `." msgstr "" -#: library/filesys.rst:33 +#: library/filesys.rst:32 msgid "Module :mod:`io`" msgstr "" -#: library/filesys.rst:34 +#: library/filesys.rst:33 msgid "" "Python's built-in I/O library, including both abstract classes and some " "concrete classes such as file I/O." msgstr "" -#: library/filesys.rst:37 +#: library/filesys.rst:36 msgid "Built-in function :func:`open`" msgstr "" -#: library/filesys.rst:38 +#: library/filesys.rst:37 msgid "The standard way to open files for reading and writing with Python." msgstr "" diff --git a/library/fnmatch.po b/library/fnmatch.po index 1be5a674..2ba85492 100644 --- a/library/fnmatch.po +++ b/library/fnmatch.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" diff --git a/library/fractions.po b/library/fractions.po index c5a3f27f..a6d56236 100644 --- a/library/fractions.po +++ b/library/fractions.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -143,73 +143,79 @@ msgid "" "``\"G\"`` and ``\"%\"\"``." msgstr "" -#: library/fractions.rst:111 -msgid "Numerator of the Fraction in lowest term." +#: library/fractions.rst:109 +msgid "" +"Formatting of :class:`Fraction` instances without a presentation type now " +"supports fill, alignment, sign handling, minimum width and grouping." msgstr "" #: library/fractions.rst:115 +msgid "Numerator of the Fraction in lowest term." +msgstr "" + +#: library/fractions.rst:119 msgid "Denominator of the Fraction in lowest term." msgstr "" -#: library/fractions.rst:120 +#: library/fractions.rst:124 msgid "" "Return a tuple of two integers, whose ratio is equal to the original " "Fraction. The ratio is in lowest terms and has a positive denominator." msgstr "" -#: library/fractions.rst:128 +#: library/fractions.rst:132 msgid "Return ``True`` if the Fraction is an integer." msgstr "" -#: library/fractions.rst:134 +#: library/fractions.rst:138 msgid "" "Alternative constructor which only accepts instances of :class:`float` or :" "class:`numbers.Integral`. Beware that ``Fraction.from_float(0.3)`` is not " "the same value as ``Fraction(3, 10)``." msgstr "" -#: library/fractions.rst:140 +#: library/fractions.rst:144 msgid "" "From Python 3.2 onwards, you can also construct a :class:`Fraction` instance " "directly from a :class:`float`." msgstr "" -#: library/fractions.rst:146 +#: library/fractions.rst:150 msgid "" "Alternative constructor which only accepts instances of :class:`decimal." "Decimal` or :class:`numbers.Integral`." msgstr "" -#: library/fractions.rst:151 +#: library/fractions.rst:155 msgid "" "From Python 3.2 onwards, you can also construct a :class:`Fraction` instance " "directly from a :class:`decimal.Decimal` instance." msgstr "" -#: library/fractions.rst:158 +#: library/fractions.rst:162 msgid "" "Finds and returns the closest :class:`Fraction` to ``self`` that has " "denominator at most max_denominator. This method is useful for finding " "rational approximations to a given floating-point number:" msgstr "" -#: library/fractions.rst:166 +#: library/fractions.rst:170 msgid "or for recovering a rational number that's represented as a float:" msgstr "" -#: library/fractions.rst:179 +#: library/fractions.rst:183 msgid "" "Returns the greatest :class:`int` ``<= self``. This method can also be " "accessed through the :func:`math.floor` function:" msgstr "" -#: library/fractions.rst:189 +#: library/fractions.rst:193 msgid "" "Returns the least :class:`int` ``>= self``. This method can also be " "accessed through the :func:`math.ceil` function." msgstr "" -#: library/fractions.rst:196 +#: library/fractions.rst:200 msgid "" "The first version returns the nearest :class:`int` to ``self``, rounding " "half to even. The second version rounds ``self`` to the nearest multiple of " @@ -218,24 +224,48 @@ msgid "" "func:`round` function." msgstr "" -#: library/fractions.rst:204 +#: library/fractions.rst:208 msgid "" -"Provides support for float-style formatting of :class:`Fraction` instances " -"via the :meth:`str.format` method, the :func:`format` built-in function, or :" -"ref:`Formatted string literals `. The presentation types " -"``\"e\"``, ``\"E\"``, ``\"f\"``, ``\"F\"``, ``\"g\"``, ``\"G\"`` and ``\"%" -"\"`` are supported. For these presentation types, formatting for a :class:" -"`Fraction` object ``x`` follows the rules outlined for the :class:`float` " -"type in the :ref:`formatspec` section." +"Provides support for formatting of :class:`Fraction` instances via the :meth:" +"`str.format` method, the :func:`format` built-in function, or :ref:" +"`Formatted string literals `." msgstr "" #: library/fractions.rst:212 +msgid "" +"If the ``format_spec`` format specification string does not end with one of " +"the presentation types ``'e'``, ``'E'``, ``'f'``, ``'F'``, ``'g'``, ``'G'`` " +"or ``'%'`` then formatting follows the general rules for fill, alignment, " +"sign handling, minimum width, and grouping as described in the :ref:`format " +"specification mini-language `. The \"alternate form\" flag " +"``'#'`` is supported: if present, it forces the output string to always " +"include an explicit denominator, even when the value being formatted is an " +"exact integer. The zero-fill flag ``'0'`` is not supported." +msgstr "" + +#: library/fractions.rst:222 +msgid "" +"If the ``format_spec`` format specification string ends with one of the " +"presentation types ``'e'``, ``'E'``, ``'f'``, ``'F'``, ``'g'``, ``'G'`` or " +"``'%'`` then formatting follows the rules outlined for the :class:`float` " +"type in the :ref:`formatspec` section." +msgstr "" + +#: library/fractions.rst:227 msgid "Here are some examples::" msgstr "" -#: library/fractions.rst:214 +#: library/fractions.rst:229 msgid "" ">>> from fractions import Fraction\n" +">>> format(Fraction(103993, 33102), '_')\n" +"'103_993/33_102'\n" +">>> format(Fraction(1, 7), '.^+10')\n" +"'...+1/7...'\n" +">>> format(Fraction(3, 1), '')\n" +"'3'\n" +">>> format(Fraction(3, 1), '#')\n" +"'3/1'\n" ">>> format(Fraction(1, 7), '.40g')\n" "'0.1428571428571428571428571428571428571429'\n" ">>> format(Fraction('1234567.855'), '_.2f')\n" @@ -247,10 +277,10 @@ msgid "" "'34.67% price increase'" msgstr "" -#: library/fractions.rst:228 +#: library/fractions.rst:251 msgid "Module :mod:`numbers`" msgstr "" -#: library/fractions.rst:229 +#: library/fractions.rst:252 msgid "The abstract base classes making up the numeric tower." msgstr "" diff --git a/library/frameworks.po b/library/frameworks.po index bedf6be7..da7bd6ad 100644 --- a/library/frameworks.po +++ b/library/frameworks.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" diff --git a/library/ftplib.po b/library/ftplib.po index 6fe46892..166eface 100644 --- a/library/ftplib.po +++ b/library/ftplib.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -45,9 +45,8 @@ msgstr "" #: includes/wasm-notavail.rst:5 msgid "" -"This module does not work or is not available on WebAssembly platforms " -"``wasm32-emscripten`` and ``wasm32-wasi``. See :ref:`wasm-availability` for " -"more information." +"This module does not work or is not available on WebAssembly. See :ref:`wasm-" +"availability` for more information." msgstr "" #: library/ftplib.rst:26 diff --git a/library/functional.po b/library/functional.po index 27bbdd4c..ecf72673 100644 --- a/library/functional.po +++ b/library/functional.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" diff --git a/library/functions.po b/library/functions.po index b3bcd621..a0ae609c 100644 --- a/library/functions.po +++ b/library/functions.po @@ -8,8 +8,8 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" -"PO-Revision-Date: 2024-05-03 00:08+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" +"PO-Revision-Date: 2024-05-05 22:38+0300\n" "Last-Translator: Panagiotis Skias \n" "Language-Team: PyGreece \n" "Language: el\n" @@ -526,7 +526,7 @@ msgstr "" "Εάν το πρόθεμα \"0b\" είναι επιθυμητό ή όχι, μπορείτε να χρησιμοποιήσετε " "έναν από τους παρακάτω τρόπους." -#: library/functions.rst:921 library/functions.rst:1260 +#: library/functions.rst:942 library/functions.rst:1323 msgid "See also :func:`format` for more information." msgstr "Δείτε επίσης τη :func:`format` για περισσότερες πληροφορίες." @@ -547,7 +547,7 @@ msgstr "" "μπορεί να γίνει περαιτέρω υποκλάση. Οι μόνες περιπτώσεις είναι ``False`` " "και ``True`` (βλ. :ref:`typebool`)." -#: library/functions.rst:786 +#: library/functions.rst:807 msgid "The parameter is now positional-only." msgstr "Η παράμετρος είναι πλέον μόνο παράμετρος θέσης." @@ -999,7 +999,7 @@ msgstr "" "Μετατρέπει μια συμβολοσειρά ή έναν αριθμό σε έναν μιγαδικό αριθμό ή " "δημιουργεί έναν μιγαδικό αριθμός από πραγματικά και φανταστικά μέρη." -#: library/functions.rst:731 library/functions.rst:977 +#: library/functions.rst:752 library/functions.rst:998 msgid "Examples:" msgstr "Παραδείγματα:" @@ -1110,7 +1110,7 @@ msgstr "Εάν παραληφθούν όλα τα ορίσματα, επιστρ msgid "The complex type is described in :ref:`typesnumeric`." msgstr "Ο μιγαδικός τύπος περιγράφεται στο :ref:`typesnumeric`." -#: library/functions.rst:783 library/functions.rst:1026 +#: library/functions.rst:804 library/functions.rst:1047 msgid "Grouping digits with underscores as in code literals is allowed." msgstr "" "Επιτρέπεται η ομαδοποίηση ψηφίων με κάτω παύλες όπως στα literals του κώδικα." @@ -1339,7 +1339,7 @@ msgstr "κάνει raise" msgid "Syntax errors are reported as exceptions." msgstr "Τα συντακτικά σφάλματα αναφέρονται ως εξαιρέσεις" -#: library/functions.rst:644 +#: library/functions.rst:654 msgid "" "This function executes arbitrary code. Calling it with user-supplied input " "may lead to security vulnerabilities." @@ -1351,38 +1351,42 @@ msgstr "" msgid "" "The *expression* argument is parsed and evaluated as a Python expression " "(technically speaking, a condition list) using the *globals* and *locals* " -"dictionaries as global and local namespace. If the *globals* dictionary is " +"mappings as global and local namespace. If the *globals* dictionary is " "present and does not contain a value for the key ``__builtins__``, a " "reference to the dictionary of the built-in module :mod:`builtins` is " "inserted under that key before *expression* is parsed. That way you can " "control what builtins are available to the executed code by inserting your " "own ``__builtins__`` dictionary into *globals* before passing it to :func:" -"`eval`. If the *locals* dictionary is omitted it defaults to the *globals* " -"dictionary. If both dictionaries are omitted, the expression is executed " -"with the *globals* and *locals* in the environment where :func:`eval` is " -"called. Note, *eval()* does not have access to the :term:`nested scopes " -"` (non-locals) in the enclosing environment." +"`eval`. If the *locals* mapping is omitted it defaults to the *globals* " +"dictionary. If both mappings are omitted, the expression is executed with " +"the *globals* and *locals* in the environment where :func:`eval` is called. " +"Note, *eval()* will only have access to the :term:`nested scopes ` (non-locals) in the enclosing environment if they are already " +"referenced in the scope that is calling :func:`eval` (e.g. via a :keyword:" +"`nonlocal` statement)." msgstr "" "Το όρισμα *expression* αναλύεται και αξιολογείται ως μια έκφραση της Python " -"(από τεχνικής άποψης, μια λίστα συνθηκών) χρησιμοποιώντας τα λεξικά " -"(dictionaries) *globals* και *locals* ως global και local namespace. Εάν το " -"λεξικό *globals* υπάρχει και δεν περιέχει μια τιμή για το κλειδί " -"``__builtins__``, μια αναφορά στο λεξικό του ενσωματωμένου module :mod:" -"`builtins` εισάγεται κάτω από αυτό το κλειδί πριν αναλυθεί το *expression*. " -"Με αυτόν τον τρόπο μπορείτε να ελέγξετε ποια από τα ενσωματωμένα στοιχεία " -"είναι διαθέσιμα για τον εκτελέσιμο κώδικα, εισάγοντας το δικό σας λεξικό " -"``__builtins__`` στο *globals* πριν διαβαστεί στη :func:`eval`. Εάν το " -"λεξικό *locals* παραλειφθεί, ορίζεται από προεπιλογή στο λεξικό *globals*. " -"Εάν παραληφθούν και τα δύο λεξικά, η έκφραση εκτελείται με τα *globals* και " -"*locals* στο περιβάλλον όπου καλείται η :func:`eval`. Σημείωση, το *eval()* " -"δεν έχει πρόσβαση στο :term:`nested scopes ` (μη τοπικά) στο " -"περιβάλλον που περικλείει." - -#: library/functions.rst:611 +"(από τεχνικής άποψης, μια λίστα συνθηκών) χρησιμοποιώντας τις αντιστοιχίσεις " +"*globals* και *locals* ως global και local namespace. Εάν το λεξικό " +"*globals* υπάρχει και δεν περιέχει μια τιμή για το κλειδί ``__builtins__``, " +"μια αναφορά στο λεξικό του ενσωματωμένου module :mod:`builtins` εισάγεται " +"κάτω από αυτό το κλειδί πριν αναλυθεί το *expression*. Με αυτόν τον τρόπο " +"μπορείτε να ελέγξετε ποια από τα ενσωματωμένα στοιχεία είναι διαθέσιμα για " +"τον εκτελέσιμο κώδικα, εισάγοντας το δικό σας λεξικό ``__builtins__`` στο " +"*globals* πριν διαβαστεί στη :func:`eval`. Εάν το λεξικό *locals* " +"παραλειφθεί, ορίζεται από προεπιλογή στο λεξικό *globals*. Εάν παραληφθούν " +"και οι δύο αντιστοιχίσεις, η έκφραση εκτελείται με τα *globals* και *locals* " +"στο περιβάλλον όπου καλείται η :func:`eval`. Σημείωση, το *eval()* θα έχει " +"πρόσβαση στο :term:`nested scopes ` (μη τοπικούς) του " +"περιβάλλοντος που την περικλείει μόνο εάν αυτοί έχουν ήδη αναφερθεί στον " +"χώρο ονομάτων που καλεί τη :func:`eval` (π.χ. μέσω μιας δήλωσης :keyword:" +"`nonlocal`)." + +#: library/functions.rst:612 msgid "Example:" msgstr "Παράδειγμα:" -#: library/functions.rst:617 +#: library/functions.rst:618 msgid "" "This function can also be used to execute arbitrary code objects (such as " "those created by :func:`compile`). In this case, pass a code object instead " @@ -1396,7 +1400,7 @@ msgstr "" "ως το όρισμα *mode*, η επιστρεφόμενη τιμή του :func:`eval`\\'s θα είναι " "``None``." -#: library/functions.rst:622 +#: library/functions.rst:623 msgid "" "Hints: dynamic execution of statements is supported by the :func:`exec` " "function. The :func:`globals` and :func:`locals` functions return the " @@ -1408,7 +1412,7 @@ msgstr "" "τρέχον global και local λεξικό, αντίστοιχα, το οποίο μπορεί να είναι χρήσιμο " "για μεταβίβαση γύρω από τη χρήση από τις :func:`eval` ή :func:`exec`." -#: library/functions.rst:627 +#: library/functions.rst:628 msgid "" "If the given source is a string, then leading and trailing spaces and tabs " "are stripped." @@ -1416,7 +1420,7 @@ msgstr "" "Εάν η δεδομένη πηγή είναι μια συμβολοσειρά, τότε αφαιρούνται τα κενά και τα " "tabs που προηγούνται ή έπονται." -#: library/functions.rst:630 +#: library/functions.rst:631 msgid "" "See :func:`ast.literal_eval` for a function that can safely evaluate strings " "with expressions containing only literals." @@ -1424,7 +1428,7 @@ msgstr "" "Βλ. τη :func:`ast.literal_eval` για μια συνάρτηση που μπορεί με ασφάλεια να " "αξιολογήσει τις συμβολοσειρές με εκφράσεις που περιέχουν μόνο literals." -#: library/functions.rst:635 library/functions.rst:685 +#: library/functions.rst:636 library/functions.rst:698 msgid "" "Raises an :ref:`auditing event ` ``exec`` with the code object as " "the argument. Code compilation events may also be raised." @@ -1432,9 +1436,23 @@ msgstr "" "Κάνει raise ένα :ref:`auditing event ` ``exec`` με το αντικείμενο " "κώδικα ως όρισμα. Μπορεί επίσης να εμφανιστούν συμβάντα μεταγλώττισης κώδικα." -#: library/functions.rst:647 +#: library/functions.rst:718 +msgid "The *globals* and *locals* arguments can now be passed as keywords." +msgstr "" +"Τα ορίσματα *globals* και *locals* υποστηρίζονται πλέον και ως ορίσματα " +"λέξεων-κλειδιών." + +#: library/functions.rst:722 msgid "" -"This function supports dynamic execution of Python code. *object* must be " +"The semantics of the default *locals* namespace have been adjusted as " +"described for the :func:`locals` builtin." +msgstr "" +"Η σημασιολογία του προεπιλεγμένου ονόματος χώρου *locals* έχει τροποποιηθεί, " +"όπως περιγράφεται για την ενσωματωμένη συνάρτηση :func:`locals`." + +#: library/functions.rst:657 +msgid "" +"This function supports dynamic execution of Python code. *source* must be " "either a string or a code object. If it is a string, the string is parsed " "as a suite of Python statements which is then executed (unless a syntax " "error occurs). [#]_ If it is a code object, it is simply executed. In all " @@ -1444,7 +1462,7 @@ msgid "" "not be used outside of function definitions even within the context of code " "passed to the :func:`exec` function. The return value is ``None``." msgstr "" -"Αυτή η συνάρτηση υποστηρίζει δυναμική εκτέλεση κώδικα Python. Το *object* " +"Αυτή η συνάρτηση υποστηρίζει δυναμική εκτέλεση κώδικα Python. Το *source* " "πρέπει να είναι είτε μια συμβολοσειρά (string) είτε ένα αντικείμενο κώδικα. " "Εάν είναι μια συμβολοσειρά, η συμβολοσειρά αναλύεται ως μια σουίτα δηλώσεων " "Python που στη συνέχεια εκτελείται (εκτός εάν παρουσιαστεί σφάλμα σύνταξης). " @@ -1456,7 +1474,7 @@ msgstr "" "συναρτήσεων, ακόμη και στο πλαίσιο του κώδικα που διαβιβάζεται στη :func:" "`exec`. Η επιστρεφόμενη τιμή είναι ``None``." -#: library/functions.rst:658 +#: library/functions.rst:668 msgid "" "In all cases, if the optional parts are omitted, the code is executed in the " "current scope. If only *globals* is provided, it must be a dictionary (and " @@ -1473,18 +1491,22 @@ msgstr "" "είναι οποιοδήποτε αντικείμενο αντιστοίχισης. Να θυμάστε ότι σε επίπεδο " "module, τα globals και locals είναι το ίδιο λεξικό." -#: library/functions.rst:668 +#: library/functions.rst:678 msgid "" -"Most users should just pass a *globals* argument and never *locals*. If exec " -"gets two separate objects as *globals* and *locals*, the code will be " -"executed as if it were embedded in a class definition." +"When ``exec`` gets two separate objects as *globals* and *locals*, the code " +"will be executed as if it were embedded in a class definition. This means " +"functions and classes defined in the executed code will not be able to " +"access variables assigned at the top level (as the \"top level\" variables " +"are treated as class variables in a class definition)." msgstr "" -"Οι περισσότεροι χρήστες θα πρέπει απλώς να περάσουν ένα όρισμα *globals* και " -"ποτέ *locals*. Εάν το exec λάβει δύο ξεχωριστά αντικείμενα ως *globals* και " -"*locals*, ο κώδικας θα εκτελεστεί σαν να ήταν ενσωματωμένος σε έναν ορισμό " -"κλάσης." +"Όταν η ``exec`` λαμβάνει δύο ξεχωριστά αντικείμενα ως *globals* και " +"*locals*, ο κώδικας εκτελείται σαν να ήταν ενσωματωμένος σε ορισμό κλάσης. " +"Αυτό σημαίνει ότι συναρτήσεις και κλάσεις που ορίζονται στον εκτελούμενο " +"κώδικα δεν θα έχουν πρόσβαση σε μεταβλητές που έχουν οριστεί στο ανώτερο " +"επίπεδο (καθώς αυτές οι \"ανωτέρου επιπέδου\" μεταβλητές θεωρούνται ως " +"μεταβλητές κλάσης, όπως συμβαίνει μέσα σε έναν ορισμό κλάσης)." -#: library/functions.rst:672 +#: library/functions.rst:684 msgid "" "If the *globals* dictionary does not contain a value for the key " "``__builtins__``, a reference to the dictionary of the built-in module :mod:" @@ -1499,47 +1521,45 @@ msgstr "" "το δικό σας ``__builtins__`` λεξικό στο *globals* πριν το διαβάσετε στο :" "func:`exec`." -#: library/functions.rst:678 +#: library/functions.rst:690 msgid "" "The *closure* argument specifies a closure--a tuple of cellvars. It's only " -"valid when the *object* is a code object containing free variables. The " -"length of the tuple must exactly match the number of free variables " -"referenced by the code object." +"valid when the *object* is a code object containing :term:`free (closure) " +"variables `. The length of the tuple must exactly match " +"the length of the code object's :attr:`~codeobject.co_freevars` attribute." msgstr "" "Το όρισμα *closure* καθορίζει ένα clossure--μια πλειάδα από cellvars. Είναι " -"έγκυρο μόνο όταν το *object* είναι ένα αντικείμενο κώδικα που περιέχει " -"ελεύθερες μεταβλητές. Το μήκος της πλειάδας πρέπει να ταιριάζει ακριβώς με " -"τον αριθμό των ελεύθερων μεταβλητών που αναφέρονται από το αντικείμενο " -"κώδικα." +"έγκυρο μόνο όταν το *object* είναι ένα αντικείμενο κώδικα που περιέχει :term:" +"`free (closure) variables `. Το μήκος της πλειάδας πρέπει " +"να ταιριάζει ακριβώς με το μήκος το χαρακτηριστικό :attr:`~codeobject." +"co_freevars` του αντικειμένου κώδικα." -#: library/functions.rst:690 +#: library/functions.rst:703 msgid "" "The built-in functions :func:`globals` and :func:`locals` return the current " -"global and local dictionary, respectively, which may be useful to pass " -"around for use as the second and third argument to :func:`exec`." +"global and local namespace, respectively, which may be useful to pass around " +"for use as the second and third argument to :func:`exec`." msgstr "" "Οι ενσωματωμένες συναρτήσεις :func:`globals` και :func:`locals` επιστρέφουν " -"το τρέχον global και local λεξικό, αντίστοιχα, που μπορεί να είναι χρήσιμο " -"για χρήση ως δεύτερο και τρίτο όρισμα στο :func:`exec`." +"το τρέχον χώρο ονομάτων global και local, αντίστοιχα, που μπορεί να είναι " +"χρήσιμο για χρήση ως δεύτερο και τρίτο όρισμα στο :func:`exec`." -#: library/functions.rst:696 +#: library/functions.rst:709 msgid "" -"The default *locals* act as described for function :func:`locals` below: " -"modifications to the default *locals* dictionary should not be attempted. " +"The default *locals* act as described for function :func:`locals` below. " "Pass an explicit *locals* dictionary if you need to see effects of the code " "on *locals* after function :func:`exec` returns." msgstr "" "Το προεπιλεγμένο *locals* ενεργεί όπως περιγράφεται για τη συνάρτηση :func:" -"`locals` παρακάτω: δεν πρέπει να επιχειρήσετε τροποποιήσεις στο " -"προεπιλεγμένο *locals* λεξικό. Περνάει ένα ρητό *locals* λεξικό εάν θέλετε " -"να δείτε τα αποτελέσματα του κώδικα στο *locals* με την επιστροφή της " -"συνάρτησης :func:`exec`." +"`locals` παρακάτω. Δώστε ρητά ένα λεξικό *locals* αν χρειάζεται να δείτε τις " +"επιδράσεις του κώδικα *locals* μετά την επιστροφή της συνάρτησης :func:" +"`exec`." -#: library/functions.rst:701 +#: library/functions.rst:713 msgid "Added the *closure* parameter." msgstr "Προστέθηκε η παράμετρος *closure*." -#: library/functions.rst:707 +#: library/functions.rst:728 msgid "" "Construct an iterator from those elements of *iterable* for which *function* " "is true. *iterable* may be either a sequence, a container which supports " @@ -1552,7 +1572,7 @@ msgstr "" "*function* είναι ``None``, η συνάρτηση ταυτότητας υποτίθεται, δηλαδή, όλα τα " "στοιχεία του *iterable* που είναι ψευδή αφαιρούνται." -#: library/functions.rst:713 +#: library/functions.rst:734 msgid "" "Note that ``filter(function, iterable)`` is equivalent to the generator " "expression ``(item for item in iterable if function(item))`` if function is " @@ -1564,7 +1584,7 @@ msgstr "" "η συνάρτηση δεν είναι ``None`` και ``(item for item in iterable if item)`` " "εάν η συνάρτηση είναι ``None``." -#: library/functions.rst:718 +#: library/functions.rst:739 msgid "" "See :func:`itertools.filterfalse` for the complementary function that " "returns elements of *iterable* for which *function* is false." @@ -1572,13 +1592,13 @@ msgstr "" "Βλ. :func:`itertools.filterfalse` για τη συμπληρωματική συνάρτηση που " "επιστρέφει στοιχεία του *iterable* για τα οποία η *function* είναι ψευδής." -#: library/functions.rst:729 +#: library/functions.rst:750 msgid "Return a floating-point number constructed from a number or a string." msgstr "" "Επιστέφει έναν αριθμό κινητής υποδιαστολής που κατασκευάστηκε από έναν " "αριθμό ή μια συμβολοσειρά." -#: library/functions.rst:733 +#: library/functions.rst:754 msgid "" ">>> float('+1.23')\n" "1.23\n" @@ -1602,7 +1622,7 @@ msgstr "" ">>> float('-Infinity')\n" "-inf" -#: library/functions.rst:746 +#: library/functions.rst:767 msgid "" "If the argument is a string, it should contain a decimal number, optionally " "preceded by a sign, and optionally embedded in whitespace. The optional " @@ -1622,7 +1642,7 @@ msgstr "" "token:`~float:floatvalue` στην ακόλουθη γραμματική, αφού αφαιρεθούν οι " "χαρακτήρες κενού διαστήματος που έπονται και προηγούνται:" -#: library/functions.rst:767 +#: library/functions.rst:788 msgid "" "Case is not significant, so, for example, \"inf\", \"Inf\", \"INFINITY\", " "and \"iNfINity\" are all acceptable spellings for positive infinity." @@ -1631,7 +1651,7 @@ msgstr "" "\"Inf\", \"INFINITY\", και \"iNfINity\" είναι όλες αποδεκτές ορθογραφίες για " "το θετικό άπειρο." -#: library/functions.rst:770 +#: library/functions.rst:791 msgid "" "Otherwise, if the argument is an integer or a floating-point number, a " "floating-point number with the same value (within Python's floating-point " @@ -1643,7 +1663,7 @@ msgstr "" "ακρίβειας κινητής υποδιαστολής της Python). Εάν το όρισμα βρίσκεται εκτός " "του εύρους ενός float της Python θα γίνει raise ένα :exc:`OverflowError`." -#: library/functions.rst:775 +#: library/functions.rst:796 msgid "" "For a general Python object ``x``, ``float(x)`` delegates to ``x." "__float__()``. If :meth:`~object.__float__` is not defined then it falls " @@ -1653,15 +1673,15 @@ msgstr "" "__float__()``. Εάν το :meth:`~object.__float__` δεν έχει οριστεί, τότε " "επιστρέφει στο :meth:`~object.__index__`." -#: library/functions.rst:779 +#: library/functions.rst:800 msgid "If no argument is given, ``0.0`` is returned." msgstr "Εάν δεν δοθεί όρισμα, επιστρέφεται το ``0.0``." -#: library/functions.rst:781 +#: library/functions.rst:802 msgid "The float type is described in :ref:`typesnumeric`." msgstr "Ο τύπος float περιγράφεται στο :ref:`typesnumeric`." -#: library/functions.rst:789 +#: library/functions.rst:810 msgid "" "Falls back to :meth:`~object.__index__` if :meth:`~object.__float__` is not " "defined." @@ -1669,7 +1689,7 @@ msgstr "" "Επιστρέφει στο :meth:`~object.__index__` εάν το :meth:`~object.__float__` " "δεν έχει οριστεί." -#: library/functions.rst:799 +#: library/functions.rst:820 msgid "" "Convert a *value* to a \"formatted\" representation, as controlled by " "*format_spec*. The interpretation of *format_spec* will depend on the type " @@ -1682,7 +1702,7 @@ msgstr "" "χρησιμοποιείται από τους περισσότερους ενσωματωμένους τύπους: :ref:" "`formatspec`." -#: library/functions.rst:804 +#: library/functions.rst:825 msgid "" "The default *format_spec* is an empty string which usually gives the same " "effect as calling :func:`str(value) `." @@ -1690,7 +1710,7 @@ msgstr "" "Η προεπιλεγμένη *format_spec* είναι μια κενή συμβολοσειρά που συνήθως δίνει " "το ίδιο αποτέλεσμα με την κλήση του :func:`str(value) `." -#: library/functions.rst:807 +#: library/functions.rst:828 msgid "" "A call to ``format(value, format_spec)`` is translated to ``type(value)." "__format__(value, format_spec)`` which bypasses the instance dictionary when " @@ -1706,7 +1726,7 @@ msgstr "" "φτάσει στο :mod:`object` και το *format_spec* δεν είναι κενό ή εάν είτε το " "*format_spec* είτε η τιμή επιστροφής δεν είναι συμβολοσειρές." -#: library/functions.rst:814 +#: library/functions.rst:835 msgid "" "``object().__format__(format_spec)`` raises :exc:`TypeError` if " "*format_spec* is not an empty string." @@ -1714,7 +1734,7 @@ msgstr "" "Το ``object().__format__(format_spec)`` κάνει raise το :exc:`TypeError` εάν " "το *format_spec* δεν είναι κενή συμβολοσειρά." -#: library/functions.rst:823 +#: library/functions.rst:844 msgid "" "Return a new :class:`frozenset` object, optionally with elements taken from " "*iterable*. ``frozenset`` is a built-in class. See :class:`frozenset` and :" @@ -1725,7 +1745,7 @@ msgstr "" "κλάση. Δείτε το :class:`frozenset` και το :ref:`types-set` για τεκμηρίωση " "αυτής της κλάσης." -#: library/functions.rst:827 +#: library/functions.rst:848 msgid "" "For other containers see the built-in :class:`set`, :class:`list`, :class:" "`tuple`, and :class:`dict` classes, as well as the :mod:`collections` module." @@ -1734,7 +1754,7 @@ msgstr "" "class:`list`, :class:`tuple`, και :class:`dict`, καθώς και το module :mod:" "`collections`." -#: library/functions.rst:835 +#: library/functions.rst:856 msgid "" "Return the value of the named attribute of *object*. *name* must be a " "string. If the string is the name of one of the object's attributes, the " @@ -1752,7 +1772,7 @@ msgstr "" "`AttributeError`. Το *name* δεν χρειάζεται να είναι αναγνωριστικό Python " "(δείτε :func:`setattr`)." -#: library/functions.rst:844 +#: library/functions.rst:865 msgid "" "Since :ref:`private name mangling ` happens at " "compilation time, one must manually mangle a private attribute's (attributes " @@ -1764,7 +1784,7 @@ msgstr "" "χειροκίνητα το όνομα ενός ιδιωτικού χαρακτηριστικού (χαρακτηριστικά με δύο " "κορυφαίες υπογραμμίσεις) για να ανακτήσει με :func:`getattr`." -#: library/functions.rst:852 +#: library/functions.rst:873 msgid "" "Return the dictionary implementing the current module namespace. For code " "within functions, this is set when the function is defined and remains the " @@ -1774,7 +1794,7 @@ msgstr "" "κώδικα εντός συναρτήσεων, αυτό ορίζεται όταν ορίζεται η συνάρτηση και " "παραμένει το ίδιο ανεξάρτητη από το που καλείται η συνάρτηση." -#: library/functions.rst:859 +#: library/functions.rst:880 msgid "" "The arguments are an object and a string. The result is ``True`` if the " "string is the name of one of the object's attributes, ``False`` if not. " @@ -1787,7 +1807,7 @@ msgstr "" "καλώντας το ``getattr(object, name)`` και να δούμε αν γίνεται raise ένα :exc:" "`AttributeError` ή όχι.)" -#: library/functions.rst:867 +#: library/functions.rst:888 msgid "" "Return the hash value of the object (if it has one). Hash values are " "integers. They are used to quickly compare dictionary keys during a " @@ -1800,7 +1820,7 @@ msgstr "" "αριθμητικές τιμές που συγκρίνονται ίσες έχουν την ίδια τιμή κατακερματισμού " "(ακόμα και αν είναι διαφορετικοί τύποι, όπως συμβαίνει για τα 1 και 1.0)." -#: library/functions.rst:874 +#: library/functions.rst:895 msgid "" "For objects with custom :meth:`~object.__hash__` methods, note that :func:" "`hash` truncates the return value based on the bit width of the host machine." @@ -1809,7 +1829,7 @@ msgstr "" "σημειώστε ότι το :func:`hash` περικόπτει την τιμή επιστροφής με βάση το " "πλάτος bit του υπολογιστή." -#: library/functions.rst:881 +#: library/functions.rst:902 msgid "" "Invoke the built-in help system. (This function is intended for interactive " "use.) If no argument is given, the interactive help system starts on the " @@ -1827,7 +1847,7 @@ msgstr "" "είναι οποιοδήποτε άλλο είδος αντικειμένου, δημιουργείται μια σελίδα βοήθειας " "στο αντικείμενο." -#: library/functions.rst:888 +#: library/functions.rst:909 msgid "" "Note that if a slash(/) appears in the parameter list of a function when " "invoking :func:`help`, it means that the parameters prior to the slash are " @@ -1839,14 +1859,14 @@ msgstr "" "την κάθετο είναι μόνο θέσης. Για περισσότερες πληροφορίες, βλέπε :ref:`the " "FAQ entry on positional-only parameters `." -#: library/functions.rst:893 +#: library/functions.rst:914 msgid "" "This function is added to the built-in namespace by the :mod:`site` module." msgstr "" "Αυτή η συνάρτηση προστίθεται στον ενσωματωμένο χώρο ονομάτων από το module :" "mod:`site`." -#: library/functions.rst:895 +#: library/functions.rst:916 msgid "" "Changes to :mod:`pydoc` and :mod:`inspect` mean that the reported signatures " "for callables are now more comprehensive and consistent." @@ -1854,7 +1874,7 @@ msgstr "" "Οι αλλαγές σε :mod:`pydoc` και :mod:`inspect` σημαίνουν ότι οι αναφερόμενες " "υπογραφές για callables είναι πλέον πιο ολοκληρωμένες και συνεπείς." -#: library/functions.rst:902 +#: library/functions.rst:923 msgid "" "Convert an integer number to a lowercase hexadecimal string prefixed with " "\"0x\". If *x* is not a Python :class:`int` object, it has to define an :" @@ -1865,7 +1885,7 @@ msgstr "" "class:`int`, πρέπει να ορίσει μια μέθοδο :meth:`~object.__index__` που " "επιστρέφει έναν ακέραιο αριθμό. Κάποια παραδείγματα:" -#: library/functions.rst:911 +#: library/functions.rst:932 msgid "" "If you want to convert an integer number to an uppercase or lower " "hexadecimal string with prefix or not, you can use either of the following " @@ -1875,7 +1895,7 @@ msgstr "" "δεκαεξαδική συμβολοσειρά (string) με πρόθεμα ή όχι, μπορείτε να " "χρησιμοποιήσετε έναν από τους παρακάτω τρόπους:" -#: library/functions.rst:923 +#: library/functions.rst:944 msgid "" "See also :func:`int` for converting a hexadecimal string to an integer using " "a base of 16." @@ -1883,7 +1903,7 @@ msgstr "" "Δείτε επίσης τη :func:`int` για τη μετατροπή μιας δεκαεξαδικής συμβολοσειράς " "σε ακέραιο χρησιμοποιώντας μια βάση του 16." -#: library/functions.rst:928 +#: library/functions.rst:949 msgid "" "To obtain a hexadecimal string representation for a float, use the :meth:" "`float.hex` method." @@ -1891,7 +1911,7 @@ msgstr "" "Για να αποκτήσετε μια αναπαράσταση δεκαεξαδικής συμβολοσειράς για ένα float, " "χρησιμοποιήστε τη μέθοδο :meth:`float.hex`." -#: library/functions.rst:934 +#: library/functions.rst:955 msgid "" "Return the \"identity\" of an object. This is an integer which is " "guaranteed to be unique and constant for this object during its lifetime. " @@ -1903,11 +1923,11 @@ msgstr "" "αντικείμενο κατά τη διάρκεια της ζωής του. Δύο αντικείμενα με μη " "επικαλυπτόμενες διάρκειες ζωής μπορεί να έχουν την ίδια τιμή :func:`id`." -#: library/functions.rst:939 +#: library/functions.rst:960 msgid "This is the address of the object in memory." msgstr "Αυτό είναι η διεύθυνση του αντικειμένου στην μνήμη." -#: library/functions.rst:941 +#: library/functions.rst:962 msgid "" "Raises an :ref:`auditing event ` ``builtins.id`` with argument " "``id``." @@ -1915,7 +1935,7 @@ msgstr "" "Εγείρει ένα :ref:`auditing event ` ``builtins.id`` με όρισμα " "``id``." -#: library/functions.rst:947 +#: library/functions.rst:968 msgid "" "If the *prompt* argument is present, it is written to standard output " "without a trailing newline. The function then reads a line from input, " @@ -1928,7 +1948,7 @@ msgstr "" "γραμμής) και την επιστρέφει. Όταν διαβάζεται το EOF, γίνεται raise η :exc:" "`EOFError`. Παράδειγμα::" -#: library/functions.rst:952 +#: library/functions.rst:973 msgid "" ">>> s = input('--> ')\n" "--> Monty Python's Flying Circus\n" @@ -1940,7 +1960,7 @@ msgstr "" ">>> s\n" "\"Monty Python's Flying Circus\"" -#: library/functions.rst:957 +#: library/functions.rst:978 msgid "" "If the :mod:`readline` module was loaded, then :func:`input` will use it to " "provide elaborate line editing and history features." @@ -1949,7 +1969,7 @@ msgstr "" "χρησιμοποιήσει για να παρέχει περίπλοκες λειτουργίες επεξεργασίας γραμμής " "και ιστορικού." -#: library/functions.rst:962 +#: library/functions.rst:983 msgid "" "Raises an :ref:`auditing event ` ``builtins.input`` with argument " "``prompt`` before reading input" @@ -1957,7 +1977,7 @@ msgstr "" "Κάνει raise ένα :ref:`auditing event ` ``builtins.input`` με " "όρισμα ``prompt`` προτού διαβάσει την είσοδο" -#: library/functions.rst:967 +#: library/functions.rst:988 msgid "" "Raises an :ref:`auditing event ` ``builtins.input/result`` with " "the result after successfully reading input." @@ -1965,7 +1985,7 @@ msgstr "" "Κάνει raise ένα :ref:`auditing event ` ``builtins.input/result`` " "με το αποτέλεσμα μετά την επιτυχή ανάγνωση των δεδομένων." -#: library/functions.rst:974 +#: library/functions.rst:995 msgid "" "Return an integer object constructed from a number or a string, or return " "``0`` if no arguments are given." @@ -1973,7 +1993,7 @@ msgstr "" "Επιστέφει έναν αριθμό κινητής υποδιαστολής που κατασκευάστηκε από έναν " "αριθμό ή μια συμβολοσειρά, ή επιστρέφει ``0`` εάν δεν δίνεται κάποιο όρισμα." -#: library/functions.rst:979 +#: library/functions.rst:1000 msgid "" ">>> int(123.45)\n" "123\n" @@ -2001,7 +2021,7 @@ msgstr "" ">>> int('01110011', base=2)\n" "115" -#: library/functions.rst:994 +#: library/functions.rst:1015 msgid "" "If the argument defines :meth:`~object.__int__`, ``int(x)`` returns ``x." "__int__()``. If the argument defines :meth:`~object.__index__`, it returns " @@ -2015,7 +2035,7 @@ msgstr "" "επιστρέφει ``x.__trunc__()``. Για αριθμούς κινητής υποδιαστολής, αυτό " "περικόπτεται προς το μηδέν." -#: library/functions.rst:1000 +#: library/functions.rst:1021 msgid "" "If the argument is not a number or if *base* is given, then it must be a " "string, :class:`bytes`, or :class:`bytearray` instance representing an " @@ -2030,7 +2050,7 @@ msgstr "" "μηδενικά, να περιβάλλεται από κενό διάστημα και να έχει μονές υπογραμμίσεις " "διάσπαρτες μεταξύ των ψηφίων." -#: library/functions.rst:1006 +#: library/functions.rst:1027 msgid "" "A base-n integer string contains digits, each representing a value from 0 to " "n-1. The values 0--9 can be represented by any Unicode decimal digit. The " @@ -2056,11 +2076,11 @@ msgstr "" "βάση 0 δεν επιτρέπει επίσης τα μηδενικά στην αρχή : ``int('010', 0)`` δεν " "είναι εφικτό, ενώ το ``int('010')`` και ``int('010', 8)`` είναι." -#: library/functions.rst:1017 +#: library/functions.rst:1038 msgid "The integer type is described in :ref:`typesnumeric`." msgstr "Ο ακέραιος τύπος περιγράφεται στο :ref:`typesnumeric`." -#: library/functions.rst:1019 +#: library/functions.rst:1040 msgid "" "If *base* is not an instance of :class:`int` and the *base* object has a :" "meth:`base.__index__ ` method, that method is called to " @@ -2073,11 +2093,11 @@ msgstr "" "εκδόσεις χρησιμοποιούσαν την :meth:`base.__int__ ` αντί της :" "meth:`base.__index__ `." -#: library/functions.rst:1029 +#: library/functions.rst:1050 msgid "The first parameter is now positional-only." msgstr "Η πρώτη παράμετρος είναι πλέον μόνο θέσεως." -#: library/functions.rst:1032 +#: library/functions.rst:1053 msgid "" "Falls back to :meth:`~object.__index__` if :meth:`~object.__int__` is not " "defined." @@ -2085,11 +2105,11 @@ msgstr "" "Επιστρέφει πίσω στη :meth:`~object.__index__` αν η :meth:`~object.__int__` " "δεν έχει οριστεί." -#: library/functions.rst:1035 +#: library/functions.rst:1056 msgid "The delegation to :meth:`~object.__trunc__` is deprecated." msgstr "Η ανάθεση στη :meth:`~object.__trunc__` έχει καταργηθεί." -#: library/functions.rst:1038 +#: library/functions.rst:1059 msgid "" ":class:`int` string inputs and string representations can be limited to help " "avoid denial of service attacks. A :exc:`ValueError` is raised when the " @@ -2105,7 +2125,7 @@ msgstr "" "class:`int` σε μια συμβολοσειρά θα υπερβεί το όριο. Δείτε την τεκμηρίωση :" "ref:`integer string conversion length limitation `." -#: library/functions.rst:1048 +#: library/functions.rst:1069 msgid "" "Return ``True`` if the *object* argument is an instance of the *classinfo* " "argument, or of a (direct, indirect, or :term:`virtual `) of *classinfo*. A class is considered a " @@ -2150,7 +2170,7 @@ msgstr "" "καταχώρισης στο *classinfo*. Σε οποιαδήποτε άλλη περίπτωση, γίνεται raise " "μια εξαίρεση :exc:`TypeError`." -#: library/functions.rst:1080 +#: library/functions.rst:1101 msgid "" "Return an :term:`iterator` object. The first argument is interpreted very " "differently depending on the presence of the second argument. Without a " @@ -2179,11 +2199,11 @@ msgstr "" "*sentinel*, θα γίνει raise η :exc:`StopIteration`, διαφορετικά θα επιστραφεί " "η τιμή." -#: library/functions.rst:1094 +#: library/functions.rst:1115 msgid "See also :ref:`typeiter`." msgstr "Δείτε επίσης :ref:`typeiter`." -#: library/functions.rst:1096 +#: library/functions.rst:1117 msgid "" "One useful application of the second form of :func:`iter` is to build a " "block-reader. For example, reading fixed-width blocks from a binary database " @@ -2193,7 +2213,7 @@ msgstr "" "ενός block-reader. Για παράδειγμα, η ανάγνωση μπλοκ σταθερού πλάτους από ένα " "δυαδικό αρχείο βάσης δεδομένων μέχρι να φτάσει στο τέλος του αρχείου::" -#: library/functions.rst:1100 +#: library/functions.rst:1121 msgid "" "from functools import partial\n" "with open('mydata.db', 'rb') as f:\n" @@ -2205,7 +2225,7 @@ msgstr "" " for block in iter(partial(f.read, 64), b''):\n" " process_block(block)" -#: library/functions.rst:1108 +#: library/functions.rst:1129 msgid "" "Return the length (the number of items) of an object. The argument may be a " "sequence (such as a string, bytes, tuple, list, or range) or a collection " @@ -2216,7 +2236,7 @@ msgstr "" "πλειάδα, λίστα, ή εύρος) ή μια συλλογή (όπως ένα λεξικό, ένα σετ, ή ένα " "παγωμένο σετ)." -#: library/functions.rst:1114 +#: library/functions.rst:1135 msgid "" "``len`` raises :exc:`OverflowError` on lengths larger than :data:`sys." "maxsize`, such as :class:`range(2 ** 100) `." @@ -2224,7 +2244,7 @@ msgstr "" "Το ``len`` κάνει raise μια :exc:`OverflowError` σε μήκη τα οποία είναι " "μεγαλύτερα από :data:`sys.maxsize`, όπως :class:`range(2 ** 100) `." -#: library/functions.rst:1123 +#: library/functions.rst:1144 msgid "" "Rather than being a function, :class:`list` is actually a mutable sequence " "type, as documented in :ref:`typesseq-list` and :ref:`typesseq`." @@ -2233,29 +2253,128 @@ msgstr "" "μεταβλητός τύπος ακολουθίας, όπως τεκμηριώνεται στα :ref:`typesseq-list` " "και :ref:`typesseq`." -#: library/functions.rst:1129 +#: library/functions.rst:1150 msgid "" -"Update and return a dictionary representing the current local symbol table. " -"Free variables are returned by :func:`locals` when it is called in function " -"blocks, but not in class blocks. Note that at the module level, :func:" -"`locals` and :func:`globals` are the same dictionary." +"Return a mapping object representing the current local symbol table, with " +"variable names as the keys, and their currently bound references as the " +"values." msgstr "" -"Ενημέρωση και επιστροφή ενός λεξικού που αντιπροσωπεύει τον τρέχοντα πίνακα " -"τοπικών συμβόλων. Οι ελεύθερες μεταβλητές επιστρέφονται από :func:`locals` " -"όταν καλείται σε μπλοκ συναρτήσεων, αλλά όχι σε μπλοκ κλάσεων. Σημειώστε ότι " -"σε επίπεδο module, οι :func:`locals` και :func:`globals` είναι το ίδιο " -"λεξικό." +"Επιστρέφει ένα αντικείμενο αντιστοίχισης που αναπαριστά τον τρέχοντα τοπικό " +"πίνακα συμβόλων, με τα ονόματα μεταβλητών ως κλειδιά και τις αντίστοιχες " +"τιμές στις οποίες είναι δεσμευμένες ως τιμές." -#: library/functions.rst:1135 +#: library/functions.rst:1154 +msgid "" +"At module scope, as well as when using :func:`exec` or :func:`eval` with a " +"single namespace, this function returns the same namespace as :func:" +"`globals`." +msgstr "" +"Στο επίπεδο module, καθώς και όταν χρησιμοποιείται η :func:`exec` ή η :func:" +"`eval` με έναν μόνο χώρο ονομάτων, αυτή η συνάρτηση επιστρέφει τον ίδιο χώρο " +"ονομάτων με τη :func:`globals`." + +#: library/functions.rst:1158 +msgid "" +"At class scope, it returns the namespace that will be passed to the " +"metaclass constructor." +msgstr "" +"Στο πεδίο ορισμού κλάσης, επιστρέφει τον χώρο ονομάτων που θα περαστεί στον " +"κατασκευαστή της μετακλάσης." + +#: library/functions.rst:1161 msgid "" -"The contents of this dictionary should not be modified; changes may not " -"affect the values of local and free variables used by the interpreter." +"When using ``exec()`` or ``eval()`` with separate local and global " +"arguments, it returns the local namespace passed in to the function call." msgstr "" -"Τα περιεχόμενα αυτού του λεξικού δεν πρέπει να τροποποιηθούν∙ οι αλλαγές " -"ενδέχεται να μην επηρεάσουν τις τιμές των τοπικών και ελεύθερων μεταβλητών " -"που χρησιμοποιούνται από τον διερμηνέα." +"Όταν χρησιμοποιείται η ``exec()`` ή η ``eval()`` με ξεχωριστά local και " +"global ορίσματα, επιστρέφει στον τοπικό χώρο ονομάτων που περάστηκε στην " +"κλήση της συνάρτησης." -#: library/functions.rst:1140 +#: library/functions.rst:1164 +msgid "" +"In all of the above cases, each call to ``locals()`` in a given frame of " +"execution will return the *same* mapping object. Changes made through the " +"mapping object returned from ``locals()`` will be visible as assigned, " +"reassigned, or deleted local variables, and assigning, reassigning, or " +"deleting local variables will immediately affect the contents of the " +"returned mapping object." +msgstr "" +"Σε όλες τις παραπάνω περιπτώσεις, κάθε κλήση της ``locals()`` σε ένα " +"συγκεκριμένο πλαίσιο εκτέλεσης θα επιστρέφει το *ίδιο* αντικείμενο " +"αντιστοίχισης. Οι αλλαγές που γίνονται μέσω του αντικειμένου αντιστοίχισης " +"που επιστρέφεται από την ``locals()`` θα είναι ορατές ως τοπικές μεταβλητές " +"που ανατίθενται, επανακαθορίζονται ή διαγράφονται, και η ανάθεση, " +"επανακαθορισμός ή διαγραφή τοπικών μεταβλητών θα επηρεάζει άμεσα τα " +"περιεχόμενα του επιστρεφόμενου αντικειμένου αντιστοίχισης." + +#: library/functions.rst:1171 +msgid "" +"In an :term:`optimized scope` (including functions, generators, and " +"coroutines), each call to ``locals()`` instead returns a fresh dictionary " +"containing the current bindings of the function's local variables and any " +"nonlocal cell references. In this case, name binding changes made via the " +"returned dict are *not* written back to the corresponding local variables or " +"nonlocal cell references, and assigning, reassigning, or deleting local " +"variables and nonlocal cell references does *not* affect the contents of " +"previously returned dictionaries." +msgstr "" +"Σε ένα :term:`optimized scope` (όπως οι συναρτήσεις, οι γεννήτριες και οι " +"συναρτήσεις συνεργασίας), κάθε κλήση της ``locals()`` επιστρέφει ένα νέο " +"λεξικό που περιέχει τις τρέχουσες δεσμεύσεις των τοπικών μεταβλητών της " +"συνάρτησης καθώς και οποιεσδήποτε αναφορές σε μη τοπικά κελιά. Σε αυτή την " +"περίπτωση, οι αλλαγές στις δεσμεύσεις ονομάτων που γίνονται μέσω του " +"επιστρεφόμενου λεξικού *δεν* εγγράφονται πίσω στις αντίστοιχες τοπικές " +"μεταβλητές ή μη τοπικές αναφορές, και η ανάθεση, επανακαθορισμός ή διαγραφή " +"τοπικών ή μη τοπικών μεταβλητών *δεν* επηρεάζει το περιεχόμενο των λεξικών " +"που είχαν επιστραφεί προηγουμένως." + +#: library/functions.rst:1180 +msgid "" +"Calling ``locals()`` as part of a comprehension in a function, generator, or " +"coroutine is equivalent to calling it in the containing scope, except that " +"the comprehension's initialised iteration variables will be included. In " +"other scopes, it behaves as if the comprehension were running as a nested " +"function." +msgstr "" +"Καλώντας την ``locals()`` ως μέρος μιας σύμπτυξης (comprehension) που " +"βρίσκεται σε μια συνάρτηση, γεννήτρια ή coroutine είναι ισοδύναμη με την " +"κλήση της στο περιβάλλον που περικλείει την την σύμπτυξη, με τη διαφορά ότι " +"οι αρχικοποιημένες μεταβλητές επανάληψης της σύμπτυξης θα περιλαμβάνονται " +"στο αποτέλεσμα. Σε άλλα πεδία ορατότητας, η συμπεριφορά είναι σαν η σύμπτυξη " +"να εκτελείται ως μια εμφωλευμένη συνάρτηση." + +#: library/functions.rst:1186 +msgid "" +"Calling ``locals()`` as part of a generator expression is equivalent to " +"calling it in a nested generator function." +msgstr "" +"Καλώντας την ``locals()`` ως μέρος μιας έκφρασης γεννήτριας είναι ισοδύναμη " +"με την κλήση της μέσα σε μια εμφωλευμένη συνάρτηση γεννήτριας." + +#: library/functions.rst:1189 +msgid "" +"The behaviour of ``locals()`` in a comprehension has been updated as " +"described in :pep:`709`." +msgstr "" +"Η συμπεριφορά της ``locals()`` μέσα σε μια έκφραση σύμπτυξης έχει ενημερωθεί " +"όπως περιγράφεται στην :pep:`709`." + +#: library/functions.rst:1193 +msgid "" +"As part of :pep:`667`, the semantics of mutating the mapping objects " +"returned from this function are now defined. The behavior in :term:" +"`optimized scopes ` is now as described above. Aside from " +"being defined, the behaviour in other scopes remains unchanged from previous " +"versions." +msgstr "" +"Στο πλαίσιο της :pep:`667`, τα σημασιολογικά χαρακτηριστικά της τροποποίησης " +"των αντικειμένων αντιστοιχίσεων που επιστρέφονται από αυτήν τη συνάρτηση " +"έχουν πλέον οριστεί. Η συμπεριφορά σε :term:`optimized scopes ` είναι πλέον όπως περιγράφεται παραπάνω. Πέραν του ότι πλέον είναι " +"ορισμένη, η συμπεριφορά σε άλλα πεδία παραμένει αμετάβλητη σε σχέση με " +"προηγούμενες εκδόσεις." + +#: library/functions.rst:1203 msgid "" "Return an iterator that applies *function* to every item of *iterable*, " "yielding the results. If additional *iterables* arguments are passed, " @@ -2272,7 +2391,7 @@ msgstr "" "όπου οι είσοδοι συνάρτησης είναι ήδη διατεταγμένες σε πλειάδες ορισμάτων, " "βλέπε :func:`itertools.starmap`\\." -#: library/functions.rst:1152 +#: library/functions.rst:1215 msgid "" "Return the largest item in an iterable or the largest of two or more " "arguments." @@ -2280,7 +2399,7 @@ msgstr "" "Επιστρέφει το μεγαλύτερο στοιχείο σε ένα iterable ή το μεγαλύτερο από δύο ή " "περισσότερα ορίσματα." -#: library/functions.rst:1155 +#: library/functions.rst:1218 msgid "" "If one positional argument is provided, it should be an :term:`iterable`. " "The largest item in the iterable is returned. If two or more positional " @@ -2290,7 +2409,7 @@ msgstr "" "Επιστρέφεται το μεγαλύτερο στοιχείο στο iterable. Εάν παρέχονται δύο ή " "περισσότερα ορίσματα θέσης, επιστρέφεται το μεγαλύτερο από τα ορίσματα θέσης." -#: library/functions.rst:1198 +#: library/functions.rst:1261 msgid "" "There are two optional keyword-only arguments. The *key* argument specifies " "a one-argument ordering function like that used for :meth:`list.sort`. The " @@ -2305,7 +2424,7 @@ msgstr "" "είναι κενό και το *default* δεν παρέχεται, γίνεται raise μια :exc:" "`ValueError`." -#: library/functions.rst:1166 +#: library/functions.rst:1229 msgid "" "If multiple items are maximal, the function returns the first one " "encountered. This is consistent with other sort-stability preserving tools " @@ -2317,15 +2436,15 @@ msgstr "" "ταξινόμησης όπως ``sorted(iterable, key=keyfunc, reverse=True)[0]`` και " "``heapq.nlargest(1, iterable, key=keyfunc)``." -#: library/functions.rst:1209 +#: library/functions.rst:1272 msgid "Added the *default* keyword-only parameter." msgstr "Προστέθηκε η παράμετρος μόνο λέξης-κλειδί *default*." -#: library/functions.rst:1212 +#: library/functions.rst:1275 msgid "The *key* can be ``None``." msgstr "Το *key* μπορεί να είναι ``None``." -#: library/functions.rst:1182 +#: library/functions.rst:1245 msgid "" "Return a \"memory view\" object created from the given argument. See :ref:" "`typememoryview` for more information." @@ -2334,7 +2453,7 @@ msgstr "" "συγκεκριμένο όρισμα. Βλέπε :ref:`typememoryview` για περισσότερες " "λεπτομέρειες." -#: library/functions.rst:1190 +#: library/functions.rst:1253 msgid "" "Return the smallest item in an iterable or the smallest of two or more " "arguments." @@ -2342,7 +2461,7 @@ msgstr "" "Επιστρέφει το μικρότερο στοιχείο σε έναν iterable ή το μικρότερο από δύο ή " "περισσότερα ορίσματα." -#: library/functions.rst:1193 +#: library/functions.rst:1256 msgid "" "If one positional argument is provided, it should be an :term:`iterable`. " "The smallest item in the iterable is returned. If two or more positional " @@ -2352,7 +2471,7 @@ msgstr "" "Επιστρέφει το μικρότερο στοιχείο στον iterable. Εάν παρέχονται δύο ή " "περισσότερα ορίσματα θέσης, επιστρέφεται το μικρότερο από τα ορίσματα θέσης." -#: library/functions.rst:1204 +#: library/functions.rst:1267 msgid "" "If multiple items are minimal, the function returns the first one " "encountered. This is consistent with other sort-stability preserving tools " @@ -2364,7 +2483,7 @@ msgstr "" "ταξινόμησης, όπως ``sorted(iterable, key=keyfunc)[0]`` και ``heapq." "nsmallest(1, iterable, key=keyfunc)``." -#: library/functions.rst:1219 +#: library/functions.rst:1282 msgid "" "Retrieve the next item from the :term:`iterator` by calling its :meth:" "`~iterator.__next__` method. If *default* is given, it is returned if the " @@ -2374,7 +2493,7 @@ msgstr "" "meth:`~iterator.__next__`. Εάν δοθεί *default*, επιστρέφεται εάν ο iterator " "έχει εξαντληθεί, διαφορετικά γίνεται raise μια :exc:`StopIteration`." -#: library/functions.rst:1226 +#: library/functions.rst:1289 msgid "" "This is the ultimate base class of all other classes. It has methods that " "are common to all instances of Python classes. When the constructor is " @@ -2386,7 +2505,7 @@ msgstr "" "κατασκευαστής, επιστρέφει ένα νέο αντικείμενο χωρίς χαρακτηριστικά. Ο " "κατασκευαστής δεν δέχεται ορίσματα." -#: library/functions.rst:1233 +#: library/functions.rst:1296 msgid "" ":class:`object` instances do *not* have :attr:`~object.__dict__` attributes, " "so you can't assign arbitrary attributes to an instance of :class:`object`." @@ -2395,7 +2514,7 @@ msgstr "" "__dict__`, επομένως δεν μπορείτε να εκχωρήσετε αυθαίρετα χαρακτηριστικά σε " "ένα στιγμιότυπο του :class:`object`." -#: library/functions.rst:1240 +#: library/functions.rst:1303 msgid "" "Convert an integer number to an octal string prefixed with \"0o\". The " "result is a valid Python expression. If *x* is not a Python :class:`int` " @@ -2407,7 +2526,7 @@ msgstr "" "ένα αντικείμενο Python :class:`int`, πρέπει να ορίσει μια μέθοδο :meth:" "`~object.__index__` που επιστρέφει έναν ακέραιο αριθμό. Για παράδειγμα:" -#: library/functions.rst:1250 +#: library/functions.rst:1313 msgid "" "If you want to convert an integer number to an octal string either with the " "prefix \"0o\" or not, you can use either of the following ways." @@ -2416,7 +2535,7 @@ msgstr "" "με το πρόθεμα \"0o\" είτε όχι, μπορείτε να χρησιμοποιήσετε έναν από τους " "παρακάτω τρόπους." -#: library/functions.rst:1267 +#: library/functions.rst:1330 msgid "" "Open *file* and return a corresponding :term:`file object`. If the file " "cannot be opened, an :exc:`OSError` is raised. See :ref:`tut-files` for more " @@ -2426,7 +2545,7 @@ msgstr "" "αρχείο δεν μπορεί να ανοίξει, γίνεται raise μια :exc:`OSError`. Δείτε το :" "ref:`tut-files` για περισσότερα παραδείγματα χρήσης αυτής της συνάρτησης." -#: library/functions.rst:1271 +#: library/functions.rst:1334 msgid "" "*file* is a :term:`path-like object` giving the pathname (absolute or " "relative to the current working directory) of the file to be opened or an " @@ -2441,7 +2560,7 @@ msgstr "" "επιστρεφόμενο αντικείμενο I/O είναι κλειστό εκτός εάν *closefd* έχει οριστεί " "ως ``False``.)" -#: library/functions.rst:1277 +#: library/functions.rst:1340 msgid "" "*mode* is an optional string that specifies the mode in which the file is " "opened. It defaults to ``'r'`` which means open for reading in text mode. " @@ -2468,72 +2587,72 @@ msgstr "" "λειτουργία και αφήνουν το *encoding* απροσδιόριστο.) Οι διαθέσιμες " "λειτουργίες είναι:" -#: library/functions.rst:1294 +#: library/functions.rst:1357 msgid "Character" msgstr "Χαρακτήρας" -#: library/functions.rst:1294 +#: library/functions.rst:1357 msgid "Meaning" msgstr "Έννοια" -#: library/functions.rst:1296 +#: library/functions.rst:1359 msgid "``'r'``" msgstr "``'r'``" -#: library/functions.rst:1296 +#: library/functions.rst:1359 msgid "open for reading (default)" msgstr "άνοιγμα για ανάγνωση (default)" -#: library/functions.rst:1297 +#: library/functions.rst:1360 msgid "``'w'``" msgstr "``'w'``" -#: library/functions.rst:1297 +#: library/functions.rst:1360 msgid "open for writing, truncating the file first" msgstr "άνοιγμα για εγγραφή, περικόπτοντας πρώτα το αρχείο" -#: library/functions.rst:1298 +#: library/functions.rst:1361 msgid "``'x'``" msgstr "``'x'``" -#: library/functions.rst:1298 +#: library/functions.rst:1361 msgid "open for exclusive creation, failing if the file already exists" msgstr "" "άνοιγμα για αποκλειστική δημιουργία, αποτυγχάνοντας εάν το αρχείο υπάρχει ήδη" -#: library/functions.rst:1299 +#: library/functions.rst:1362 msgid "``'a'``" msgstr "``'a'``" -#: library/functions.rst:1299 +#: library/functions.rst:1362 msgid "open for writing, appending to the end of file if it exists" msgstr "άνοιγμα για εγγραφή, προσαρτάται στο τέλος του αρχείου εάν υπάρχει" -#: library/functions.rst:1300 +#: library/functions.rst:1363 msgid "``'b'``" msgstr "``'b'``" -#: library/functions.rst:1444 +#: library/functions.rst:1507 msgid "binary mode" msgstr "δυαδική (binary) λειτουργία" -#: library/functions.rst:1301 +#: library/functions.rst:1364 msgid "``'t'``" msgstr "``'t'``" -#: library/functions.rst:1301 +#: library/functions.rst:1364 msgid "text mode (default)" msgstr "λειτουργία κειμένου (default)" -#: library/functions.rst:1302 +#: library/functions.rst:1365 msgid "``'+'``" msgstr "``'+'``" -#: library/functions.rst:1302 +#: library/functions.rst:1365 msgid "open for updating (reading and writing)" msgstr "άνοιγμα για ενημέρωση (ανάγνωση και εγγραφή)" -#: library/functions.rst:1305 +#: library/functions.rst:1368 msgid "" "The default mode is ``'r'`` (open for reading text, a synonym of ``'rt'``). " "Modes ``'w+'`` and ``'w+b'`` open and truncate the file. Modes ``'r+'`` and " @@ -2544,7 +2663,7 @@ msgstr "" "περικόβει το αρχείο. Οι λειτουργίες ``'r+'`` and ``'r+b'`` ανοίγουν το " "αρχείο χωρίς περικοπή." -#: library/functions.rst:1309 +#: library/functions.rst:1372 msgid "" "As mentioned in the :ref:`io-overview`, Python distinguishes between binary " "and text I/O. Files opened in binary mode (including ``'b'`` in the *mode* " @@ -2563,7 +2682,7 @@ msgstr "" "bytes έχουν πρώτα αποκωδικοποιηθεί χρησιμοποιώντας μια εξαρτώμενη από " "πλατφόρμα κωδικοποίηση ή χρήση της καθορισμένης *κωδικοποίησης* εάν δίνεται." -#: library/functions.rst:1319 +#: library/functions.rst:1382 msgid "" "Python doesn't depend on the underlying operating system's notion of text " "files; all the processing is done by Python itself, and is therefore " @@ -2573,7 +2692,7 @@ msgstr "" "λειτουργικού συστήματος∙ όλη η επεξεργασία γίνεται από την ίδια την Python " "και επομένως είναι ανεξάρτητη από την πλατφόρμα." -#: library/functions.rst:1323 +#: library/functions.rst:1386 msgid "" "*buffering* is an optional integer used to set the buffering policy. Pass 0 " "to switch buffering off (only allowed in binary mode), 1 to select line " @@ -2600,7 +2719,7 @@ msgstr "" "δίνεται όρισμα *buffering*, η προεπιλεγμένη πολιτική προσωρινής αποθήκευσης " "λειτουργεί ως εξής:" -#: library/functions.rst:1333 +#: library/functions.rst:1396 msgid "" "Binary files are buffered in fixed-size chunks; the size of the buffer is " "chosen using a heuristic trying to determine the underlying device's \"block " @@ -2613,7 +2732,7 @@ msgstr "" "και επανέρχεται σε :const:`io.DEFAULT_BUFFER_SIZE`. Σε πολλά συστήματα, η " "προσωρινή μνήμη θα έχει συνήθως μήκος 4096 ή 8192 bytes." -#: library/functions.rst:1338 +#: library/functions.rst:1401 msgid "" "\"Interactive\" text files (files for which :meth:`~io.IOBase.isatty` " "returns ``True``) use line buffering. Other text files use the policy " @@ -2624,7 +2743,7 @@ msgstr "" "κειμένου χρησιμοποιούν την πολιτική που περιγράφεται παραπάνω για δυαδικά " "αρχεία." -#: library/functions.rst:1342 +#: library/functions.rst:1405 msgid "" "*encoding* is the name of the encoding used to decode or encode the file. " "This should only be used in text mode. The default encoding is platform " @@ -2639,7 +2758,7 @@ msgstr "" "οποιοδήποτε :term:`text encoding` που υποστηρίζεται από την Python. Δείτε το " "module :mod:`codecs` για τη λίστα των υποστηριζόμενων κωδικοποιήσεων." -#: library/functions.rst:1348 +#: library/functions.rst:1411 msgid "" "*errors* is an optional string that specifies how encoding and decoding " "errors are to be handled—this cannot be used in binary mode. A variety of " @@ -2655,7 +2774,7 @@ msgstr "" "το :func:`codecs.register_error` είναι επίσης έγκυρο. Τα τυπικά ονόματα " "περιλαμβάνουν:" -#: library/functions.rst:1356 +#: library/functions.rst:1419 msgid "" "``'strict'`` to raise a :exc:`ValueError` exception if there is an encoding " "error. The default value of ``None`` has the same effect." @@ -2664,7 +2783,7 @@ msgstr "" "σφάλμα κωδικοποίησης. Η προεπιλεγμένη τιμή του ``None`` έχει το ίδιο " "αποτέλεσμα." -#: library/functions.rst:1360 +#: library/functions.rst:1423 msgid "" "``'ignore'`` ignores errors. Note that ignoring encoding errors can lead to " "data loss." @@ -2672,7 +2791,7 @@ msgstr "" "Το ``'ignore'`` αγνοεί τα σφάλματα. Σημειώστε ότι η παράβλεψη σφαλμάτων " "κωδικοποίησης μπορεί να οδηγήσει σε απώλεια δεδομένων." -#: library/functions.rst:1363 +#: library/functions.rst:1426 msgid "" "``'replace'`` causes a replacement marker (such as ``'?'``) to be inserted " "where there is malformed data." @@ -2680,7 +2799,7 @@ msgstr "" "Το ``'replace'`` προκαλεί την εισαγωγή ενός δείκτη αντικατάστασης (όπως " "``'?'``) όταν υπάρχουν δεδομένα με λανθασμένη μορφή." -#: library/functions.rst:1366 +#: library/functions.rst:1429 msgid "" "``'surrogateescape'`` will represent any incorrect bytes as low surrogate " "code units ranging from U+DC80 to U+DCFF. These surrogate code units will " @@ -2695,7 +2814,7 @@ msgstr "" "εγγραφή δεδομένων. Αυτό είναι χρήσιμο για την επεξεργασία αρχείων σε " "άγνωστη κωδικοποίηση." -#: library/functions.rst:1373 +#: library/functions.rst:1436 msgid "" "``'xmlcharrefreplace'`` is only supported when writing to a file. Characters " "not supported by the encoding are replaced with the appropriate XML " @@ -2705,7 +2824,7 @@ msgstr "" "χαρακτήρες που δεν υποστηρίζονται από την κωδικοποίηση αντικαθίστανται με " "την κατάλληλη αναφορά χαρακτήρων XML :samp:`&#{nnn};`." -#: library/functions.rst:1377 +#: library/functions.rst:1440 msgid "" "``'backslashreplace'`` replaces malformed data by Python's backslashed " "escape sequences." @@ -2713,7 +2832,7 @@ msgstr "" "Το ``'backslashreplace'`` αντικαθιστά δεδομένα με λανθασμένη μορφή από τις " "ακολουθίες διαφυγής με ανάστροφης καθέτου Python." -#: library/functions.rst:1380 +#: library/functions.rst:1443 msgid "" "``'namereplace'`` (also only supported when writing) replaces unsupported " "characters with ``\\N{...}`` escape sequences." @@ -2721,7 +2840,7 @@ msgstr "" "Το ``'namereplace'`` (υποστηρίζεται επίσης μόνο κατά τη σύνταξη) αντικαθιστά " "τους μη υποστηριζόμενους χαρακτήρες με ακολουθίες διαφυγής ``\\N{...}``." -#: library/functions.rst:1388 +#: library/functions.rst:1451 msgid "" "*newline* determines how to parse newline characters from the stream. It can " "be ``None``, ``''``, ``'\\n'``, ``'\\r'``, and ``'\\r\\n'``. It works as " @@ -2731,7 +2850,7 @@ msgstr "" "ροή. Μπορεί να είναι και ``None``, ``''``, ``'\\n'``, ``'\\r'``, και " "``'\\r\\n'``. Λειτουργεί ως εξής:" -#: library/functions.rst:1392 +#: library/functions.rst:1455 msgid "" "When reading input from the stream, if *newline* is ``None``, universal " "newlines mode is enabled. Lines in the input can end in ``'\\n'``, " @@ -2751,7 +2870,7 @@ msgstr "" "δεδομένη συμβολοσειρά και η κατάληξη γραμμής επιστρέφεται στον καλούντα " "αμετάφραστη." -#: library/functions.rst:1400 +#: library/functions.rst:1463 msgid "" "When writing output to the stream, if *newline* is ``None``, any ``'\\n'`` " "characters written are translated to the system default line separator, :" @@ -2766,7 +2885,7 @@ msgstr "" "από τις άλλες νόμιμες τιμές, γράφονται οποιοιδήποτε χαρακτήρες ``'\\n'`` " "μεταφράζονται στη δεδομένη συμβολοσειρά." -#: library/functions.rst:1406 +#: library/functions.rst:1469 msgid "" "If *closefd* is ``False`` and a file descriptor rather than a filename was " "given, the underlying file descriptor will be kept open when the file is " @@ -2779,7 +2898,7 @@ msgstr "" "*closefd* πρέπει να είναι ``True`` (η προεπιλογή)∙ διαφορετικά, θα προκύψει " "ένα σφάλμα." -#: library/functions.rst:1411 +#: library/functions.rst:1474 msgid "" "A custom opener can be used by passing a callable as *opener*. The " "underlying file descriptor for the file object is then obtained by calling " @@ -2794,12 +2913,12 @@ msgstr "" "αρχείου (περνώντας :mod:`os.open` ως *opener* έχει ως αποτέλεσμα " "λειτουργικότητας παρόμοια με το να περάσουμε το ``None``)." -#: library/functions.rst:1417 +#: library/functions.rst:1480 msgid "The newly created file is :ref:`non-inheritable `." msgstr "" "Το νέο δημιουργημένο αρχείο είναι :ref:`non-inheritable `." -#: library/functions.rst:1419 +#: library/functions.rst:1482 msgid "" "The following example uses the :ref:`dir_fd ` parameter of the :func:" "`os.open` function to open a file relative to a given directory::" @@ -2808,7 +2927,7 @@ msgstr "" "συνάρτησης :func:`os.open` για να ανοίξει ένα αρχείο σε σχέση με έναν " "δεδομένο κατάλογο::" -#: library/functions.rst:1422 +#: library/functions.rst:1485 msgid "" ">>> import os\n" ">>> dir_fd = os.open('somedir', os.O_RDONLY)\n" @@ -2830,7 +2949,7 @@ msgstr "" "...\n" ">>> os.close(dir_fd) # don't leak a file descriptor" -#: library/functions.rst:1432 +#: library/functions.rst:1495 msgid "" "The type of :term:`file object` returned by the :func:`open` function " "depends on the mode. When :func:`open` is used to open a file in a text " @@ -2858,7 +2977,7 @@ msgstr "" "προσωρινή αποθήκευση είναι απενεργοποιημένη, επιστρέφεται, η ακατέργαστη " "ροή , μια υποκλάση :class:`io.RawIOBase`, :class:`io.FileIO`." -#: library/functions.rst:1453 +#: library/functions.rst:1516 msgid "" "See also the file handling modules, such as :mod:`fileinput`, :mod:`io` " "(where :func:`open` is declared), :mod:`os`, :mod:`os.path`, :mod:" @@ -2868,7 +2987,7 @@ msgstr "" "`io` (όπου ορίζεται η :func:`open`), :mod:`os`, :mod:`os.path`, :mod:" "`tempfile`, και :mod:`shutil`." -#: library/functions.rst:1457 +#: library/functions.rst:1520 msgid "" "Raises an :ref:`auditing event ` ``open`` with arguments ``path``, " "``mode``, ``flags``." @@ -2876,7 +2995,7 @@ msgstr "" "Κάνει raise ένα :ref:`auditing event ` ``open`` με ορίσματα " "``path``, ``mode``, ``flags``." -#: library/functions.rst:1459 +#: library/functions.rst:1522 msgid "" "The ``mode`` and ``flags`` arguments may have been modified or inferred from " "the original call." @@ -2884,21 +3003,21 @@ msgstr "" "Τα ορίσματα ``mode`` και ``flags`` μπορεί να έχουν τροποποιηθεί ή να έχουν " "συναχθεί από την αρχική κλήση." -#: library/functions.rst:1464 +#: library/functions.rst:1527 msgid "The *opener* parameter was added." msgstr "Προστέθηκε η παράμετρος *opener*." -#: library/functions.rst:1465 +#: library/functions.rst:1528 msgid "The ``'x'`` mode was added." msgstr "Προστέθηκε η λειτουργία ``'x'``." -#: library/functions.rst:1466 +#: library/functions.rst:1529 msgid ":exc:`IOError` used to be raised, it is now an alias of :exc:`OSError`." msgstr "" "Το :exc:`IOError` γινόταν raise παλιά, τώρα είναι ψευδώνυμο του :exc:" "`OSError`." -#: library/functions.rst:1467 +#: library/functions.rst:1530 msgid "" ":exc:`FileExistsError` is now raised if the file opened in exclusive " "creation mode (``'x'``) already exists." @@ -2906,11 +3025,11 @@ msgstr "" "Το :exc:`FileExistsError` γίνεται raise τώρα εάν το αρχείο που ανοίγει σε " "λειτουργία αποκλειστικής δημιουργίας (``'x'``) υπάρχει ήδη." -#: library/functions.rst:1472 +#: library/functions.rst:1535 msgid "The file is now non-inheritable." msgstr "Το αρχείο είναι πλέον μη κληρονομικό." -#: library/functions.rst:1476 +#: library/functions.rst:1539 msgid "" "If the system call is interrupted and the signal handler does not raise an " "exception, the function now retries the system call instead of raising an :" @@ -2921,17 +3040,17 @@ msgstr "" "raise μια εξαίρεση :exc:`InterruptedError` (δείτε το :pep:`475` για το " "σκεπτικό)." -#: library/functions.rst:1479 +#: library/functions.rst:1542 msgid "The ``'namereplace'`` error handler was added." msgstr "Προστέθηκε το πρόγραμμα χειρισμού σφαλμάτων ``'namereplace'``." -#: library/functions.rst:1483 +#: library/functions.rst:1546 msgid "Support added to accept objects implementing :class:`os.PathLike`." msgstr "" "Προστέθηκε υποστήριξη για την αποδοχή αντικειμένων που υλοποιούν :class:`os." "PathLike`." -#: library/functions.rst:1484 +#: library/functions.rst:1547 msgid "" "On Windows, opening a console buffer may return a subclass of :class:`io." "RawIOBase` other than :class:`io.FileIO`." @@ -2939,11 +3058,11 @@ msgstr "" "Στα Windows, το άνοιγμα μιας προσωρινής μνήμης κονσόλας μπορεί να επιστρέψει " "μια υποκλάση του :class:`io.RawIOBase` εκτός από το :class:`io.FileIO`." -#: library/functions.rst:1487 +#: library/functions.rst:1550 msgid "The ``'U'`` mode has been removed." msgstr "Η λειτουργία ``'U'`` έχει αφαιρεθεί." -#: library/functions.rst:1492 +#: library/functions.rst:1555 msgid "" "Given a string representing one Unicode character, return an integer " "representing the Unicode code point of that character. For example, " @@ -2956,7 +3075,7 @@ msgstr "" "αριθμό ``97`` και ``ord('€')`` (σύμβολο του ευρώ) επιστρέφει ``8364``. Αυτό " "είναι το αντίστροφο του :func:`chr`." -#: library/functions.rst:1500 +#: library/functions.rst:1563 msgid "" "Return *base* to the power *exp*; if *mod* is present, return *base* to the " "power *exp*, modulo *mod* (computed more efficiently than ``pow(base, exp) % " @@ -2968,7 +3087,7 @@ msgstr "" "``pow(base, exp) % mod``). Η φόρμα δύο ορισμάτων ``pow(base, exp)`` " "ισοδυναμεί με τη χρήση του τελεστή δύναμης: ``base**exp``." -#: library/functions.rst:1505 +#: library/functions.rst:1568 msgid "" "The arguments must have numeric types. With mixed operand types, the " "coercion rules for binary arithmetic operators apply. For :class:`int` " @@ -2996,7 +3115,7 @@ msgstr "" "παραδίδεται ένα αποτέλεσμα float. Για παράδειγμα, το ``pow(-9, 2.0)`` " "επιστρέφει το ``81.0``." -#: library/functions.rst:1517 +#: library/functions.rst:1580 msgid "" "For :class:`int` operands *base* and *exp*, if *mod* is present, *mod* must " "also be of integer type and *mod* must be nonzero. If *mod* is present and " @@ -3011,13 +3130,13 @@ msgstr "" "``pow(inv_base, -exp, mod)``, όπου το *inv_base* είναι αντίστροφο του *base* " "modulo *mod*." -#: library/functions.rst:1523 +#: library/functions.rst:1586 msgid "Here's an example of computing an inverse for ``38`` modulo ``97``::" msgstr "" "Ακολουθεί ένα παράδειγμα υπολογισμού ενός αντίστροφου για το ``38`` modulo " "``97``::" -#: library/functions.rst:1525 +#: library/functions.rst:1588 msgid "" ">>> pow(38, -1, mod=97)\n" "23\n" @@ -3029,7 +3148,7 @@ msgstr "" ">>> 23 * 38 % 97 == 1\n" "True" -#: library/functions.rst:1530 +#: library/functions.rst:1593 msgid "" "For :class:`int` operands, the three-argument form of ``pow`` now allows the " "second argument to be negative, permitting computation of modular inverses." @@ -3038,14 +3157,14 @@ msgstr "" "τώρα το δεύτερο όρισμα να είναι αρνητικό, επιτρέποντας τον υπολογισμό των " "αρθρωτών αντίστροφων." -#: library/functions.rst:1535 +#: library/functions.rst:1598 msgid "" "Allow keyword arguments. Formerly, only positional arguments were supported." msgstr "" "Επιτρέπονται ορίσματα keyword. Παλαιότερα, υποστηρίζονταν μόνο ορίσματα " "θέσης." -#: library/functions.rst:1542 +#: library/functions.rst:1605 msgid "" "Print *objects* to the text stream *file*, separated by *sep* and followed " "by *end*. *sep*, *end*, *file*, and *flush*, if present, must be given as " @@ -3055,7 +3174,7 @@ msgstr "" "ακολουθούμενα από *end*. Τα *sep*, *end*, *file*, και *flush*, εάν υπάρχουν, " "πρέπει να δίνονται ως ορίσματα keyword." -#: library/functions.rst:1546 +#: library/functions.rst:1609 msgid "" "All non-keyword arguments are converted to strings like :func:`str` does and " "written to the stream, separated by *sep* and followed by *end*. Both *sep* " @@ -3070,7 +3189,7 @@ msgstr "" "προεπιλεγμένες τιμές. Εάν δεν δίνονται *αντικείμενα*, η :func:`print` θα " "γράψει απλά *end*." -#: library/functions.rst:1552 +#: library/functions.rst:1615 msgid "" "The *file* argument must be an object with a ``write(string)`` method; if it " "is not present or ``None``, :data:`sys.stdout` will be used. Since printed " @@ -3084,7 +3203,7 @@ msgstr "" "αντικείμενα αρχείου δυαδικής λειτουργίας. Για αυτά, χρησιμοποιούμε το " "``file.write(...)``." -#: library/functions.rst:1557 +#: library/functions.rst:1620 msgid "" "Output buffering is usually determined by *file*. However, if *flush* is " "true, the stream is forcibly flushed." @@ -3092,15 +3211,15 @@ msgstr "" "Η προσωρινή αποθήκευση εξόδου καθορίζεται συνήθως από το *αρχείο*. Ωστόσο, " "εάν το *flush* είναι αληθές, η ροή ξεπλένεται αναγκαστικά." -#: library/functions.rst:1561 +#: library/functions.rst:1624 msgid "Added the *flush* keyword argument." msgstr "Προστέθηκε το όρισμα keyword *flush*." -#: library/functions.rst:1567 +#: library/functions.rst:1630 msgid "Return a property attribute." msgstr "Επιστρέφει ένα χαρακτηριστικό ιδιότητας." -#: library/functions.rst:1569 +#: library/functions.rst:1632 msgid "" "*fget* is a function for getting an attribute value. *fset* is a function " "for setting an attribute value. *fdel* is a function for deleting an " @@ -3111,12 +3230,12 @@ msgstr "" "*fdel* είναι μια συνάρτηση για τη διαγραφή μιας τιμής χαρακτηριστικού. Και " "το *doc* δημιουργεί μια συμβολοσειρά εγγράφων για το χαρακτηριστικό." -#: library/functions.rst:1573 +#: library/functions.rst:1636 msgid "A typical use is to define a managed attribute ``x``::" msgstr "" "Μια τυπική χρήση είναι ο ορισμός ενός διαχειριζόμενου χαρακτηριστικού ``x``::" -#: library/functions.rst:1575 +#: library/functions.rst:1638 msgid "" "class C:\n" " def __init__(self):\n" @@ -3148,7 +3267,7 @@ msgstr "" "\n" " x = property(getx, setx, delx, \"I'm the 'x' property.\")" -#: library/functions.rst:1590 +#: library/functions.rst:1653 msgid "" "If *c* is an instance of *C*, ``c.x`` will invoke the getter, ``c.x = " "value`` will invoke the setter, and ``del c.x`` the deleter." @@ -3156,7 +3275,7 @@ msgstr "" "Εάν το *c* είναι ένα instance του *C*, το ``c.x`` θα καλέσει τον λήπτη, το " "``c.x = value` θα καλέσει τον ρυθμιστή, και το ``del c.x`` τον διαγραφέα." -#: library/functions.rst:1593 +#: library/functions.rst:1656 msgid "" "If given, *doc* will be the docstring of the property attribute. Otherwise, " "the property will copy *fget*'s docstring (if it exists). This makes it " @@ -3168,7 +3287,7 @@ msgstr "" "υπάρχει). Αυτό καθιστά δυνατή τη δημιουργία ιδιοτήτων μόνο για ανάγνωση, " "εύκολα χρησιμοποιώντας τη :func:`property` ως :term:`decorator`::" -#: library/functions.rst:1597 +#: library/functions.rst:1660 msgid "" "class Parrot:\n" " def __init__(self):\n" @@ -3188,7 +3307,7 @@ msgstr "" " \"\"\"Get the current voltage.\"\"\"\n" " return self._voltage" -#: library/functions.rst:1606 +#: library/functions.rst:1669 msgid "" "The ``@property`` decorator turns the :meth:`!voltage` method into a " "\"getter\" for a read-only attribute with the same name, and it sets the " @@ -3198,7 +3317,7 @@ msgstr "" "\"getter\" για ένα χαρακτηριστικό μόνο για ανάγνωση με το ίδιο όνομα, και " "ορίζει τη συμβολοσειρά εγγράφων για *voltage* σε \"Get the current voltage.\"" -#: library/functions.rst:1614 +#: library/functions.rst:1677 msgid "" "A property object has ``getter``, ``setter``, and ``deleter`` methods usable " "as decorators that create a copy of the property with the corresponding " @@ -3210,7 +3329,7 @@ msgstr "" "ένα αντίγραφο της ιδιότητας με την αντίστοιχη συνάρτηση accessor που έχει " "οριστεί στον decorator. Αυτό εξηγείται καλύτερα με ένα παράδειγμα:" -#: library/functions.rst:1619 +#: library/functions.rst:1682 msgid "" "class C:\n" " def __init__(self):\n" @@ -3246,7 +3365,7 @@ msgstr "" " def x(self):\n" " del self._x" -#: library/functions.rst:1638 +#: library/functions.rst:1701 msgid "" "This code is exactly equivalent to the first example. Be sure to give the " "additional functions the same name as the original property (``x`` in this " @@ -3256,7 +3375,7 @@ msgstr "" "να δώσετε στις πρόσθετες συναρτήσεις το ίδιο όνομα με την αρχική ιδιότητα " "(``x`` σε αυτήν την περίπτωση.)" -#: library/functions.rst:1642 +#: library/functions.rst:1705 msgid "" "The returned property object also has the attributes ``fget``, ``fset``, and " "``fdel`` corresponding to the constructor arguments." @@ -3265,11 +3384,19 @@ msgstr "" "``fget``, ``fset``, και ``fdel`` που αντιστοιχούν στα ορίσματα του " "κατασκευαστή." -#: library/functions.rst:1645 +#: library/functions.rst:1708 msgid "The docstrings of property objects are now writeable." msgstr "Τα *docstrings* των αντικειμένων ιδιότητας είναι πλέον εγγράψιμες." -#: library/functions.rst:1654 +#: library/functions.rst:1713 +msgid "" +"Attribute holding the name of the property. The name of the property can be " +"changed at runtime." +msgstr "" +"Χαρακτηριστικό που περιέχει το όνομα της ιδιότητας. Το όνομα της ιδιότητας " +"μπορεί να αλλάξει κατά την εκτέλεση." + +#: library/functions.rst:1724 msgid "" "Rather than being a function, :class:`range` is actually an immutable " "sequence type, as documented in :ref:`typesseq-range` and :ref:`typesseq`." @@ -3278,7 +3405,7 @@ msgstr "" "αμετάβλητος τύπος ακολουθίας, όπως τεκμηριώνεται στα :ref:`typesseq-range` " "και :ref:`typesseq`." -#: library/functions.rst:1660 +#: library/functions.rst:1730 msgid "" "Return a string containing a printable representation of an object. For " "many types, this function makes an attempt to return a string that would " @@ -3301,12 +3428,12 @@ msgstr "" "`~object.__repr__`. Εάν η :func:`sys.displayhook` δεν είναι προσβάσιμη, αυτή " "η συνάρτηση θα κάνει raise το :exc:`RuntimeError`." -#: library/functions.rst:1671 +#: library/functions.rst:1741 msgid "This class has a custom representation that can be evaluated::" msgstr "" "Αυτή η κλάση έχει μια προσαρμοσμένη αναπαράσταση που μπορεί να αξιολογηθεί::" -#: library/functions.rst:1673 +#: library/functions.rst:1743 msgid "" "class Person:\n" " def __init__(self, name, age):\n" @@ -3324,7 +3451,7 @@ msgstr "" " def __repr__(self):\n" " return f\"Person('{self.name}', {self.age})\"" -#: library/functions.rst:1684 +#: library/functions.rst:1754 msgid "" "Return a reverse :term:`iterator`. *seq* must be an object which has a :" "meth:`~object.__reversed__` method or supports the sequence protocol (the :" @@ -3336,7 +3463,7 @@ msgstr "" "το πρωτόκολλο ακολουθίας (η μέθοδος :meth:`~object.__len__` και η μέθοδος :" "meth:`~object.__getitem__` με ακέραια ορίσματα που ξεκινούν από ``0``)." -#: library/functions.rst:1692 +#: library/functions.rst:1762 msgid "" "Return *number* rounded to *ndigits* precision after the decimal point. If " "*ndigits* is omitted or is ``None``, it returns the nearest integer to its " @@ -3346,7 +3473,7 @@ msgstr "" "υποδιαστολή. Εάν το *ndigits* παραληφθεί ή είναι ``None``, επιστρέφει τον " "πλησιέστερο ακέραιο αριθμό στην είσοδό του." -#: library/functions.rst:1696 +#: library/functions.rst:1766 msgid "" "For the built-in types supporting :func:`round`, values are rounded to the " "closest multiple of 10 to the power minus *ndigits*; if two multiples are " @@ -3365,7 +3492,7 @@ msgstr "" "επιστρεφόμενη τιμή είναι ακέραιος εάν το *ndigits* παραλειφθεί ή είναι " "``None``. Διαφορετικά, η τιμή επιστροφής έχει τον ίδιο τύπο με το *number*." -#: library/functions.rst:1705 +#: library/functions.rst:1775 msgid "" "For a general Python object ``number``, ``round`` delegates to ``number." "__round__``." @@ -3373,7 +3500,7 @@ msgstr "" "Για ένα γενικό αντικείμενο Python ``number``, ``round`` εκχωρεί στο ``number." "__round__``." -#: library/functions.rst:1710 +#: library/functions.rst:1780 msgid "" "The behavior of :func:`round` for floats can be surprising: for example, " "``round(2.675, 2)`` gives ``2.67`` instead of the expected ``2.68``. This is " @@ -3387,7 +3514,7 @@ msgstr "" "περισσότερα δεκαδικά κλάσματα δεν μπορούν να αναπαρασταθούν ακριβώς ως " "float. Δείτε το :ref:`tut-fp-issues` για περισσότερες πληροφορίες." -#: library/functions.rst:1722 +#: library/functions.rst:1792 msgid "" "Return a new :class:`set` object, optionally with elements taken from " "*iterable*. ``set`` is a built-in class. See :class:`set` and :ref:`types-" @@ -3397,7 +3524,7 @@ msgstr "" "λαμβάνονται από το *iterable*. Το ``set`` είναι μια ενσωματωμένη κλάση. " "Δείτε :class:`set` και :ref:`types-set` για τεκμηρίωση αυτής της κλάσης." -#: library/functions.rst:1726 +#: library/functions.rst:1796 msgid "" "For other containers see the built-in :class:`frozenset`, :class:`list`, :" "class:`tuple`, and :class:`dict` classes, as well as the :mod:`collections` " @@ -3407,7 +3534,7 @@ msgstr "" "class:`list`, :class:`tuple`, και :class:`dict`, καθώς και το module :mod:" "`collections`." -#: library/functions.rst:1733 +#: library/functions.rst:1803 msgid "" "This is the counterpart of :func:`getattr`. The arguments are an object, a " "string, and an arbitrary value. The string may name an existing attribute " @@ -3422,7 +3549,7 @@ msgstr "" "επιτρέπει. Για παράδειγμα ``setattr(x, 'foobar', 123)`` ισοδυναμεί με το " "``x.foobar = 123``." -#: library/functions.rst:1739 +#: library/functions.rst:1809 msgid "" "*name* need not be a Python identifier as defined in :ref:`identifiers` " "unless the object chooses to enforce that, for example in a custom :meth:" @@ -3437,7 +3564,7 @@ msgstr "" "αναγνωριστικό δεν θα είναι προσβάσιμο χρησιμοποιώντας τη σημειογραφία, αλλά " "είναι προσβάσιμο μέσω του :func:`getattr` κ.λπ.." -#: library/functions.rst:1747 +#: library/functions.rst:1817 msgid "" "Since :ref:`private name mangling ` happens at " "compilation time, one must manually mangle a private attribute's (attributes " @@ -3448,7 +3575,7 @@ msgstr "" "μη αυτόματο τρόπο το όνομα ενός ιδιωτικού χαρακτηριστικού (χαρακτηριστικά με " "δύο προπορευόμενες κάτω παύλες) για να το ορίσει με :func:`setattr`." -#: library/functions.rst:1756 +#: library/functions.rst:1826 msgid "" "Return a :term:`slice` object representing the set of indices specified by " "``range(start, stop, step)``. The *start* and *step* arguments default to " @@ -3458,7 +3585,7 @@ msgstr "" "δεικτών που καθορίζονται από το ``range(start, stop, step)``. Τα ορίσματα " "*start* και *step* είναι από προεπιλογή ``None``." -#: library/functions.rst:1764 +#: library/functions.rst:1834 msgid "" "Slice objects have read-only data attributes :attr:`!start`, :attr:`!stop`, " "and :attr:`!step` which merely return the argument values (or their " @@ -3471,7 +3598,7 @@ msgstr "" "λειτουργικότητα∙ ωστόσο, χρησιμοποιούνται από το NumPy και άλλα πακέτα " "τρίτων." -#: library/functions.rst:1769 +#: library/functions.rst:1839 msgid "" "Slice objects are also generated when extended indexing syntax is used. For " "example: ``a[start:stop:step]`` or ``a[start:stop, i]``. See :func:" @@ -3482,7 +3609,7 @@ msgstr "" "stop, i]``. Δείτε τη :func:`itertools.islice` για μια εναλλακτική έκδοση " "που επιστρέφει ένα :term:`iterator`." -#: library/functions.rst:1774 +#: library/functions.rst:1844 msgid "" "Slice objects are now :term:`hashable` (provided :attr:`~slice.start`, :attr:" "`~slice.stop`, and :attr:`~slice.step` are hashable)." @@ -3491,18 +3618,18 @@ msgstr "" "`~slice.start`, :attr:`~slice.stop`, και :attr:`~slice.step` μπορούν να " "κατακερματιστούν)." -#: library/functions.rst:1780 +#: library/functions.rst:1850 msgid "Return a new sorted list from the items in *iterable*." msgstr "Επιστρέφει μια νέα ταξινομημένη λίστα από τα στοιχεία στο *iterable*." -#: library/functions.rst:1782 +#: library/functions.rst:1852 msgid "" "Has two optional arguments which must be specified as keyword arguments." msgstr "" "Έχει δύο προαιρετικά ορίσματα που πρέπει να καθοριστούν ως ορίσματα λέξεων-" "κλειδιών." -#: library/functions.rst:1784 +#: library/functions.rst:1854 msgid "" "*key* specifies a function of one argument that is used to extract a " "comparison key from each element in *iterable* (for example, ``key=str." @@ -3513,7 +3640,7 @@ msgstr "" "παράδειγμα, ``key=str.lower``). Η προεπιλεγμένη τιμή είναι ``None`` " "(συγκρίνει τα στοιχεία απευθείας)." -#: library/functions.rst:1788 +#: library/functions.rst:1858 msgid "" "*reverse* is a boolean value. If set to ``True``, then the list elements " "are sorted as if each comparison were reversed." @@ -3521,7 +3648,7 @@ msgstr "" "Το *reverse* είναι μια δυαδική τιμή. Εάν οριστεί σε ``True``, τότε τα " "στοιχεία της λίστας ταξινομούνται σαν να είχε αντιστραφεί κάθε σύγκριση." -#: library/functions.rst:1791 +#: library/functions.rst:1861 msgid "" "Use :func:`functools.cmp_to_key` to convert an old-style *cmp* function to a " "*key* function." @@ -3529,7 +3656,7 @@ msgstr "" "Χρησιμοποιήστε το :func:`functools.cmp_to_key` για να μετατρέψετε μια " "συνάρτηση *cmp* παλιού τύπου σε συνάρτηση *key*." -#: library/functions.rst:1794 +#: library/functions.rst:1864 msgid "" "The built-in :func:`sorted` function is guaranteed to be stable. A sort is " "stable if it guarantees not to change the relative order of elements that " @@ -3542,7 +3669,7 @@ msgstr "" "πολλαπλά περάσματα (για παράδειγμα, ταξινόμηση ανά τμήμα, μετά ανά " "μισθολογικό βαθμό)." -#: library/functions.rst:1799 +#: library/functions.rst:1869 msgid "" "The sort algorithm uses only ``<`` comparisons between items. While " "defining an :meth:`~object.__lt__` method will suffice for sorting, :PEP:`8` " @@ -3562,18 +3689,18 @@ msgstr "" "έξι συγκρίσεων βοηθά επίσης στην αποφυγή σύγχυσης για συγκρίσεις μικτού " "τύπου που μπορούν να καλέσουν την ανακλώμενη μέθοδο :meth:`~object.__gt__`." -#: library/functions.rst:1808 +#: library/functions.rst:1878 msgid "" "For sorting examples and a brief sorting tutorial, see :ref:`sortinghowto`." msgstr "" "Για παραδείγματα ταξινόμησης και ένα σύντομο σεμινάριο ταξινόμησης, " "ανατρέξτε στο :ref:`sortinghowto`." -#: library/functions.rst:1812 +#: library/functions.rst:1882 msgid "Transform a method into a static method." msgstr "Μετατροπή μιας μεθόδου σε στατική μέθοδο." -#: library/functions.rst:1814 +#: library/functions.rst:1884 msgid "" "A static method does not receive an implicit first argument. To declare a " "static method, use this idiom::" @@ -3581,7 +3708,7 @@ msgstr "" "Μια στατική μέθοδος δεν λαμβάνει ένα σιωπηρό πρώτο όρισμα. Για να δηλώσετε " "μια στατική μέθοδο, χρησιμοποιήστε αυτό το ιδίωμα::" -#: library/functions.rst:1817 +#: library/functions.rst:1887 msgid "" "class C:\n" " @staticmethod\n" @@ -3591,7 +3718,7 @@ msgstr "" " @staticmethod\n" " def f(arg1, arg2, argN): ..." -#: library/functions.rst:1821 +#: library/functions.rst:1891 msgid "" "The ``@staticmethod`` form is a function :term:`decorator` -- see :ref:" "`function` for details." @@ -3599,7 +3726,7 @@ msgstr "" "Η φόρμα ``@staticmethod`` είναι μια συνάρτηση :term:`decorator` -- δείτε :" "ref:`function` για λεπτομέρειες." -#: library/functions.rst:1824 +#: library/functions.rst:1894 msgid "" "A static method can be called either on the class (such as ``C.f()``) or on " "an instance (such as ``C().f()``). Moreover, the static method :term:" @@ -3611,7 +3738,7 @@ msgstr "" "`descriptor` μπορεί επίσης να κληθεί, επομένως μπορεί να χρησιμοποιηθεί στον " "ορισμός της κλάσης (όπως ``f()``)." -#: library/functions.rst:1829 +#: library/functions.rst:1899 msgid "" "Static methods in Python are similar to those found in Java or C++. Also, " "see :func:`classmethod` for a variant that is useful for creating alternate " @@ -3621,7 +3748,7 @@ msgstr "" "Java ή στη C++. Επίσης, ανατρέξτε στη :func:`classmethod` για μια παραλλαγή " "που είναι χρήσιμη για τη δημιουργία εναλλακτικών κατασκευαστών κλάσεων." -#: library/functions.rst:1833 +#: library/functions.rst:1903 msgid "" "Like all decorators, it is also possible to call ``staticmethod`` as a " "regular function and do something with its result. This is needed in some " @@ -3636,7 +3763,7 @@ msgstr "" "αυτόματη μετατροπή σε instance μέθοδο. Για αυτές τις περιπτώσεις, " "χρησιμοποιήστε αυτό το ιδίωμα::" -#: library/functions.rst:1839 +#: library/functions.rst:1909 msgid "" "def regular_function():\n" " ...\n" @@ -3650,13 +3777,13 @@ msgstr "" "class C:\n" " method = staticmethod(regular_function)" -#: library/functions.rst:1845 +#: library/functions.rst:1915 msgid "For more information on static methods, see :ref:`types`." msgstr "" "Για περισσότερες πληροφορίες σχετικά με τις στατικές μεθόδους, δείτε το :ref:" "`types`." -#: library/functions.rst:1847 +#: library/functions.rst:1917 msgid "" "Static methods now inherit the method attributes (:attr:`~function." "__module__`, :attr:`~function.__name__`, :attr:`~function.__qualname__`, :" @@ -3669,14 +3796,14 @@ msgstr "" "__annotations__`),, έχουν ένα νέο χαρακτηριστικό ``__wrapped__``, και " "μπορούν πλέον να καλούνται ως κανονικές λειτουργίες." -#: library/functions.rst:1863 +#: library/functions.rst:1933 msgid "" "Return a :class:`str` version of *object*. See :func:`str` for details." msgstr "" "Επιστρέφει μια έκδοση :class:`str` του *object*. Δείτε :func:`str` για " "λεπτομέρειες." -#: library/functions.rst:1865 +#: library/functions.rst:1935 msgid "" "``str`` is the built-in string :term:`class`. For general information about " "strings, see :ref:`textseq`." @@ -3684,7 +3811,7 @@ msgstr "" "Το ``str`` είναι η ενσωματωμένη συμβολοσειρά :term:`class`. Για γενικές " "πληροφορίες σχετικά με τις συμβολοσειρές, ανατρέξτε :ref:`textseq`." -#: library/functions.rst:1871 +#: library/functions.rst:1941 msgid "" "Sums *start* and the items of an *iterable* from left to right and returns " "the total. The *iterable*'s items are normally numbers, and the start value " @@ -3694,7 +3821,7 @@ msgstr "" "και επιστρέφει το σύνολο. Τα στοιχεία του *iterable* είναι συνήθως αριθμοί " "και η τιμή έναρξης δεν επιτρέπεται να είναι συμβολοσειρά." -#: library/functions.rst:1875 +#: library/functions.rst:1945 msgid "" "For some use cases, there are good alternatives to :func:`sum`. The " "preferred, fast way to concatenate a sequence of strings is by calling ``''." @@ -3709,19 +3836,19 @@ msgstr "" "να συνδυάσετε μια σειρά iterable, σκεφτείτε να χρησιμοποιήσετε το :func:" "`itertools.chain`." -#: library/functions.rst:1881 +#: library/functions.rst:1951 msgid "The *start* parameter can be specified as a keyword argument." msgstr "Η παράμετρος *start* μπορεί να καθοριστεί ως όρισμα keyword." -#: library/functions.rst:1884 +#: library/functions.rst:1954 msgid "" -"Summation of floats switched to an algorithm that gives higher accuracy on " -"most builds." +"Summation of floats switched to an algorithm that gives higher accuracy and " +"better commutativity on most builds." msgstr "" "Η άθροιση των floats άλλαξε σε έναν αλγόριθμο που δίνει μεγαλύτερη ακρίβεια " -"στις περισσότερες κατασκευές." +"και καλύτερη αντιμεταθετικότητα στις περισσότερες κατασκευές." -#: library/functions.rst:1891 +#: library/functions.rst:1961 msgid "" "Return a proxy object that delegates method calls to a parent or sibling " "class of *type*. This is useful for accessing inherited methods that have " @@ -3731,7 +3858,7 @@ msgstr "" "μεθόδου σε μια γονική ή αδερφή κλάση *type*. Αυτό είναι χρήσιμο για την " "πρόσβαση σε μεταβιβασμένες μεθόδους που έχουν παρακαμφθεί σε μια κλάση." -#: library/functions.rst:1895 +#: library/functions.rst:1965 msgid "" "The *object_or_type* determines the :term:`method resolution order` to be " "searched. The search starts from the class right after the *type*." @@ -3739,7 +3866,7 @@ msgstr "" "Το *object_or_type* καθορίζει το :term:`method resolution order` που θα " "αναζητηθεί. Η αναζήτηση ξεκινά από την κλάση αμέσως μετά τον *type*." -#: library/functions.rst:1899 +#: library/functions.rst:1969 msgid "" "For example, if :attr:`~type.__mro__` of *object_or_type* is ``D -> B -> C -" "> A -> object`` and the value of *type* is ``B``, then :func:`super` " @@ -3749,7 +3876,7 @@ msgstr "" "B -> C -> A -> object`` και η τιμή του *type* είναι ``B``, τότε η :func:" "`super` αναζητά ``C -> A -> object``." -#: library/functions.rst:1903 +#: library/functions.rst:1973 msgid "" "The :attr:`~type.__mro__` attribute of the class corresponding to " "*object_or_type* lists the method resolution search order used by both :func:" @@ -3762,7 +3889,7 @@ msgstr "" "χαρακτηριστικό είναι δυναμικό και μπορεί να αλλάξει κάθε φορά που " "ενημερώνεται η ιεραρχία κληρονομικότητας." -#: library/functions.rst:1908 +#: library/functions.rst:1978 msgid "" "If the second argument is omitted, the super object returned is unbound. If " "the second argument is an object, ``isinstance(obj, type)`` must be true. " @@ -3775,7 +3902,24 @@ msgstr "" "είναι ένας τύπος, το ``issubclass(type2, type)`` πρέπει να είναι αληθές " "(αυτό είναι χρήσιμο για μεθόδους κλάσης)." -#: library/functions.rst:1913 +#: library/functions.rst:1983 +msgid "" +"When called directly within an ordinary method of a class, both arguments " +"may be omitted (\"zero-argument :func:`!super`\"). In this case, *type* will " +"be the enclosing class, and *obj* will be the first argument of the " +"immediately enclosing function (typically ``self``). (This means that zero-" +"argument :func:`!super` will not work as expected within nested functions, " +"including generator expressions, which implicitly create nested functions.)" +msgstr "" +"Όταν καλείται απευθείας μέσα σε μια κανονική μέθοδο μιας κλάσης, και τα δύο " +"ορίσματα μπορούν να παραλειφθούν (\"χωρίς ορίσματα :func:`!super`\"). Σε " +"αυτή την περίπτωση, το *type* είναι η περιβάλλουσα κλάση και το *obj* είναι " +"το πρώτο όρισμα της αμέσως περιβάλλουσας συνάρτησης (συνήθως ``self``). " +"(Αυτό σημαίνει ότι η :func:`!super` χωρίς ορίσματα δεν θα λειτουργήσει όπως " +"αναμένεται μέσα σε φωλιασμένες συναρτήσεις, συμπεριλαμβανομένων και των " +"γεννητριών εκφράσεων, οι οποίες δημιουργούν έμμεσα φωλιασμένες συναρτήσεις.)" + +#: library/functions.rst:1990 msgid "" "There are two typical use cases for *super*. In a class hierarchy with " "single inheritance, *super* can be used to refer to parent classes without " @@ -3788,7 +3932,7 @@ msgstr "" "έτσι τον κώδικα πιο διατηρήσιμο. Αυτή η χρήση είναι πολύ παράλληλη με τη " "χρήση του *super* σε άλλες γλώσσες προγραμματισμού." -#: library/functions.rst:1918 +#: library/functions.rst:1995 msgid "" "The second use case is to support cooperative multiple inheritance in a " "dynamic execution environment. This use case is unique to Python and is not " @@ -3812,13 +3956,13 @@ msgstr "" "διάταξη μπορεί να περιλαμβάνει αδερφικές κλάσεις πριν από τον χρόνο " "εκτέλεσης)." -#: library/functions.rst:1928 +#: library/functions.rst:2005 msgid "For both use cases, a typical superclass call looks like this::" msgstr "" "Και για τις δύο περιπτώσεις χρήσης, μια τυπική κλήση υπερκλάσης μοιάζει με " "αυτό::" -#: library/functions.rst:1930 +#: library/functions.rst:2007 msgid "" "class C(B):\n" " def method(self, arg):\n" @@ -3830,7 +3974,7 @@ msgstr "" " super().method(arg) # This does the same thing as:\n" " # super(C, self).method(arg)" -#: library/functions.rst:1935 +#: library/functions.rst:2012 msgid "" "In addition to method lookups, :func:`super` also works for attribute " "lookups. One possible use case for this is calling :term:`descriptors " @@ -3840,7 +3984,7 @@ msgstr "" "αναζητήσεις χαρακτηριστικών. Μια πιθανή περίπτωση χρήσης για αυτό είναι η " "κλήση :term:`descriptors ` σε μια κλάση γονέα ή αδελφού." -#: library/functions.rst:1939 +#: library/functions.rst:2016 msgid "" "Note that :func:`super` is implemented as part of the binding process for " "explicit dotted attribute lookups such as ``super().__getitem__(name)``. It " @@ -3857,7 +4001,7 @@ msgstr "" "οριστεί για σιωπηρές αναζητήσεις που χρησιμοποιούν δηλώσεις ή τελεστές όπως " "``super()[name]``." -#: library/functions.rst:1947 +#: library/functions.rst:2024 msgid "" "Also note that, aside from the zero argument form, :func:`super` is not " "limited to use inside methods. The two argument form specifies the " @@ -3874,7 +4018,7 @@ msgstr "" "ανάκτηση της κλάσης που ορίζεται, καθώς και για την πρόσβαση στην τρέχουσα " "παρουσία για συνηθισμένες μεθόδους." -#: library/functions.rst:1954 +#: library/functions.rst:2031 msgid "" "For practical suggestions on how to design cooperative classes using :func:" "`super`, see `guide to using super() `_." -#: library/functions.rst:1964 +#: library/functions.rst:2041 msgid "" "Rather than being a function, :class:`tuple` is actually an immutable " "sequence type, as documented in :ref:`typesseq-tuple` and :ref:`typesseq`." @@ -3893,7 +4037,7 @@ msgstr "" "αμετάβλητος τύπος ακολουθίας, όπως τεκμηριώνεται στα :ref:`typesseq-tuple` " "και :ref:`typesseq`." -#: library/functions.rst:1973 +#: library/functions.rst:2050 msgid "" "With one argument, return the type of an *object*. The return value is a " "type object and generally the same object as returned by :attr:`object." @@ -3903,7 +4047,7 @@ msgstr "" "είναι ένα αντικείμενο τύπου και γενικά το ίδιο αντικείμενο με αυτό που " "επιστρέφεται από το :attr:`object.__class__`." -#: library/functions.rst:1977 +#: library/functions.rst:2054 msgid "" "The :func:`isinstance` built-in function is recommended for testing the type " "of an object, because it takes subclasses into account." @@ -3911,7 +4055,7 @@ msgstr "" "Η ενσωματωμένη συνάρτηση :func:`isinstance` συνίσταται για τη δοκιμή του " "τύπου ενός αντικειμένου, επειδή λαμβάνει υπόψη τις υποκλάσεις." -#: library/functions.rst:1980 +#: library/functions.rst:2057 msgid "" "With three arguments, return a new type object. This is essentially a " "dynamic form of the :keyword:`class` statement. The *name* string is the " @@ -3934,11 +4078,11 @@ msgstr "" "__dict__`. Οι ακόλουθες δύο προτάσεις δημιουργούν πανομοιότυπα αντικείμενα :" "class:`!type`" -#: library/functions.rst:1995 +#: library/functions.rst:2072 msgid "See also:" msgstr "Δείτε επίσης:" -#: library/functions.rst:1997 +#: library/functions.rst:2074 msgid "" ":ref:`Documentation on attributes and methods on classes `." @@ -3946,11 +4090,11 @@ msgstr "" ":ref:`Τεκμηρίωση για χαρακτηριστικά και μεθόδους σε κλάσεις `." -#: library/functions.rst:1998 +#: library/functions.rst:2075 msgid ":ref:`bltin-type-objects`" msgstr ":ref:`bltin-type-objects`" -#: library/functions.rst:2000 +#: library/functions.rst:2077 msgid "" "Keyword arguments provided to the three argument form are passed to the " "appropriate metaclass machinery (usually :meth:`~object.__init_subclass__`) " @@ -3962,11 +4106,11 @@ msgstr "" "__init_subclass__`) με τον ίδιο τρόπο που θα έκαναν οι λέξεις-κλειδιά στον " "ορισμό μιας κλάσης (εκτός από το *metaclass*)." -#: library/functions.rst:2005 +#: library/functions.rst:2082 msgid "See also :ref:`class-customization`." msgstr "Δείτε επίσης :ref:`class-customization`." -#: library/functions.rst:2007 +#: library/functions.rst:2084 msgid "" "Subclasses of :class:`!type` which don't override ``type.__new__`` may no " "longer use the one-argument form to get the type of an object." @@ -3975,7 +4119,7 @@ msgstr "" "δεν μπορούν πλέον να χρησιμοποιούν τη φόρμα ενός επιχειρήματος για να λάβουν " "τον τύπο ενός αντικειμένου." -#: library/functions.rst:2014 +#: library/functions.rst:2091 msgid "" "Return the :attr:`~object.__dict__` attribute for a module, class, instance, " "or any other object with a :attr:`!__dict__` attribute." @@ -3984,7 +4128,7 @@ msgstr "" "στιγμιότυπο, ή οποιοδήποτε άλλο αντικείμενο με ένα χαρακτηριστικό :attr:`!" "__dict__`." -#: library/functions.rst:2017 +#: library/functions.rst:2094 msgid "" "Objects such as modules and instances have an updateable :attr:`~object." "__dict__` attribute; however, other objects may have write restrictions on " @@ -3997,17 +4141,11 @@ msgstr "" "(για παράδειγμα, οι κλάσεις χρησιμοποιούν ένα :class:`types." "MappingProxyType` για την αποτροπή άμεσων ενημερώσεων λεξικού)." -#: library/functions.rst:2022 -msgid "" -"Without an argument, :func:`vars` acts like :func:`locals`. Note, the " -"locals dictionary is only useful for reads since updates to the locals " -"dictionary are ignored." -msgstr "" -"Χωρίς ένα όρισμα, το :func:`vars` λειτουργεί όπως :func:`locals`. " -"Σημειώστε, ότι το λεξικό των τοπικών είναι χρήσιμο μόνο για ανάγνωση, καθώς " -"οι ενημερώσεις στο λεξικό των τοπικών αγνοούνται." +#: library/functions.rst:2099 +msgid "Without an argument, :func:`vars` acts like :func:`locals`." +msgstr "Χωρίς ένα όρισμα, :func:`vars` συμπεριφέρεται όπως :func:`locals`." -#: library/functions.rst:2026 +#: library/functions.rst:2101 msgid "" "A :exc:`TypeError` exception is raised if an object is specified but it " "doesn't have a :attr:`~object.__dict__` attribute (for example, if its class " @@ -4018,7 +4156,15 @@ msgstr "" "παράδειγμα, εάν η κλάση του ορίζει το :attr:`~object.__slots__` " "χαρακτηριστικό)." -#: library/functions.rst:2032 +#: library/functions.rst:2107 +msgid "" +"The result of calling this function without an argument has been updated as " +"described for the :func:`locals` builtin." +msgstr "" +"Το αποτέλεσμα της κλήσης αυτής της συνάρτησης χωρίς ένα όρισμα έχει " +"ενημερωθεί, όπως περιγράφεται για τη ενσωματωμένη :func:`locals`." + +#: library/functions.rst:2113 msgid "" "Iterate over several iterables in parallel, producing tuples with an item " "from each one." @@ -4026,11 +4172,11 @@ msgstr "" "Επανάληψη σε πολλούς iterables παράλληλα, δημιουργώντας πλειάδες με ένα " "αντικείμενο από το καθένα." -#: library/functions.rst:2035 +#: library/functions.rst:2116 msgid "Example::" msgstr "Παράδειγμα::" -#: library/functions.rst:2037 +#: library/functions.rst:2118 msgid "" ">>> for item in zip([1, 2, 3], ['sugar', 'spice', 'everything nice']):\n" "... print(item)\n" @@ -4046,7 +4192,7 @@ msgstr "" "(2, 'spice')\n" "(3, 'everything nice')" -#: library/functions.rst:2044 +#: library/functions.rst:2125 msgid "" "More formally: :func:`zip` returns an iterator of tuples, where the *i*-th " "tuple contains the *i*-th element from each of the argument iterables." @@ -4055,7 +4201,7 @@ msgstr "" "πλειάδα περιέχει το *i*-ο στοιχείο από κάθε ένα από τους επαναλήψιμους " "ορισμάτων." -#: library/functions.rst:2047 +#: library/functions.rst:2128 msgid "" "Another way to think of :func:`zip` is that it turns rows into columns, and " "columns into rows. This is similar to `transposing a matrix `_." -#: library/functions.rst:2051 +#: library/functions.rst:2132 msgid "" ":func:`zip` is lazy: The elements won't be processed until the iterable is " "iterated on, e.g. by a :keyword:`!for` loop or by wrapping in a :class:" @@ -4075,7 +4221,7 @@ msgstr "" "μέχρι να επαναληφθεί ο iterable, π.χ. με έναν βρόχο :keyword:`!for` ή με " "αναδίπλωση σε μια :class:`list`." -#: library/functions.rst:2055 +#: library/functions.rst:2136 msgid "" "One thing to consider is that the iterables passed to :func:`zip` could have " "different lengths; sometimes by design, and sometimes because of a bug in " @@ -4088,7 +4234,7 @@ msgstr "" "κώδικα που προετοίμασε αυτά τα iterables. Η Python προσφέρει τρεις " "διαφορετικές προσεγγίσεις για την αντιμετώπιση αυτού του ζητήματος::" -#: library/functions.rst:2060 +#: library/functions.rst:2141 msgid "" "By default, :func:`zip` stops when the shortest iterable is exhausted. It " "will ignore the remaining items in the longer iterables, cutting off the " @@ -4098,7 +4244,7 @@ msgstr "" "Αυτό θα αγνοήσει τα υπόλοιπα στοιχεία στους μεγαλύτερους iterables, κόβοντας " "το αποτέλεσμα στο μήκος του συντομότερου iterable::" -#: library/functions.rst:2064 +#: library/functions.rst:2145 msgid "" ">>> list(zip(range(3), ['fee', 'fi', 'fo', 'fum']))\n" "[(0, 'fee'), (1, 'fi'), (2, 'fo')]" @@ -4106,7 +4252,7 @@ msgstr "" ">>> list(zip(range(3), ['fee', 'fi', 'fo', 'fum']))\n" "[(0, 'fee'), (1, 'fi'), (2, 'fo')]" -#: library/functions.rst:2067 +#: library/functions.rst:2148 msgid "" ":func:`zip` is often used in cases where the iterables are assumed to be of " "equal length. In such cases, it's recommended to use the ``strict=True`` " @@ -4117,7 +4263,7 @@ msgstr "" "της επιλογής ``strict=True``. Η έξοδος είναι ίδια με την κανονική :func:" "`zip`::" -#: library/functions.rst:2071 +#: library/functions.rst:2152 msgid "" ">>> list(zip(('a', 'b', 'c'), (1, 2, 3), strict=True))\n" "[('a', 1), ('b', 2), ('c', 3)]" @@ -4125,7 +4271,7 @@ msgstr "" ">>> list(zip(('a', 'b', 'c'), (1, 2, 3), strict=True))\n" "[('a', 1), ('b', 2), ('c', 3)]" -#: library/functions.rst:2074 +#: library/functions.rst:2155 msgid "" "Unlike the default behavior, it raises a :exc:`ValueError` if one iterable " "is exhausted before the others:" @@ -4133,7 +4279,7 @@ msgstr "" "Σε αντίθεση με την προεπιλεγμένη συμπεριφορά, γίνεται raise ένα :exc:" "`ValueError` εάν ένα iterable εξαντληθεί πριν από τα άλλα:" -#: library/functions.rst:2092 +#: library/functions.rst:2173 msgid "" "Without the ``strict=True`` argument, any bug that results in iterables of " "different lengths will be silenced, possibly manifesting as a hard-to-find " @@ -4143,7 +4289,7 @@ msgstr "" "μήκη διαφορετικού μήκους θα τεθεί σε σίγαση, πιθανώς να εμφανίζεται ως " "δυσεύρετο σφάλμα σε άλλο μέρος του προγράμματος." -#: library/functions.rst:2096 +#: library/functions.rst:2177 msgid "" "Shorter iterables can be padded with a constant value to make all the " "iterables have the same length. This is done by :func:`itertools." @@ -4153,7 +4299,7 @@ msgstr "" "τα iterables να έχουνε το ίδιο μήκος. Αυτό γίνεται από το :func:`itertools." "zip_longest`." -#: library/functions.rst:2100 +#: library/functions.rst:2181 msgid "" "Edge cases: With a single iterable argument, :func:`zip` returns an iterator " "of 1-tuples. With no arguments, it returns an empty iterator." @@ -4161,11 +4307,11 @@ msgstr "" "Περιπτώσεις άκρων: Με ένα μόνο επαναληπτικό όρισμα, η :func:`zip` επιστρέφει " "έναν iterator 1-πλειάδων. Χωρίς ορίσματα, επιστρέφει έναν κενό iterator." -#: library/functions.rst:2103 +#: library/functions.rst:2184 msgid "Tips and tricks:" msgstr "Συμβουλές και κόλπα:" -#: library/functions.rst:2105 +#: library/functions.rst:2186 msgid "" "The left-to-right evaluation order of the iterables is guaranteed. This " "makes possible an idiom for clustering a data series into n-length groups " @@ -4181,7 +4327,7 @@ msgstr "" "επαναλήπτη. Αυτό έχει ως αποτέλεσμα τη διαίρεση της εισόδου σε κομμάτια " "μήκους." -#: library/functions.rst:2111 +#: library/functions.rst:2192 msgid "" ":func:`zip` in conjunction with the ``*`` operator can be used to unzip a " "list::" @@ -4189,7 +4335,7 @@ msgstr "" "Η :func:`zip` σε συνδυασμό με τον τελεστή ``*`` μπορεί να χρησιμοποιηθεί για " "την αποσυμπίεση μιας λίστας::" -#: library/functions.rst:2114 +#: library/functions.rst:2195 msgid "" ">>> x = [1, 2, 3]\n" ">>> y = [4, 5, 6]\n" @@ -4207,11 +4353,11 @@ msgstr "" ">>> x == list(x2) and y == list(y2)\n" "True" -#: library/functions.rst:2122 +#: library/functions.rst:2203 msgid "Added the ``strict`` argument." msgstr "Προστέθηκε το όρισμα ``strict``." -#: library/functions.rst:2134 +#: library/functions.rst:2215 msgid "" "This is an advanced function that is not needed in everyday Python " "programming, unlike :func:`importlib.import_module`." @@ -4219,7 +4365,7 @@ msgstr "" "Αυτή είναι μια προηγμένη συνάρτηση που δεν χρειάζεται στον καθημερινό " "προγραμματισμό της Python, σε αντίθεση με το :func:`importlib.import_module`." -#: library/functions.rst:2137 +#: library/functions.rst:2218 msgid "" "This function is invoked by the :keyword:`import` statement. It can be " "replaced (by importing the :mod:`builtins` module and assigning to " @@ -4240,7 +4386,7 @@ msgstr "" "χρήση του :func:`__import__` επίσης αποθαρρύνεται υπέρ του :func:`importlib." "import_module`." -#: library/functions.rst:2146 +#: library/functions.rst:2227 msgid "" "The function imports the module *name*, potentially using the given " "*globals* and *locals* to determine how to interpret the name in a package " @@ -4257,7 +4403,7 @@ msgstr "" "χρησιμοποιεί τα *globals* της μόνο για να προσδιορίσει το πλαίσιο του " "πακέτου της δήλωσης :keyword:`import`." -#: library/functions.rst:2153 +#: library/functions.rst:2234 msgid "" "*level* specifies whether to use absolute or relative imports. ``0`` (the " "default) means only perform absolute imports. Positive values for *level* " @@ -4271,7 +4417,7 @@ msgstr "" "σε σχέση με τον κατάλογο του module που καλεί την :func:`__import__` (δείτε " "το :pep:`328` για λεπτομέρειες)." -#: library/functions.rst:2159 +#: library/functions.rst:2240 msgid "" "When the *name* variable is of the form ``package.module``, normally, the " "top-level package (the name up till the first dot) is returned, *not* the " @@ -4283,7 +4429,7 @@ msgstr "" "κουκκίδα), *όχι* το module που ονομάζεται *name*. Ωστόσο, όταν δίνεται ένα " "μη κενό όρισμα *fromlist*, επιστρέφεται το module με το όνομα *name*." -#: library/functions.rst:2164 +#: library/functions.rst:2245 msgid "" "For example, the statement ``import spam`` results in bytecode resembling " "the following code::" @@ -4291,19 +4437,19 @@ msgstr "" "Για παράδειγμα, η δήλωση ``import spam`` καταλήγει σε bytecode που μοιάζει " "με τον ακόλουθο κώδικα::" -#: library/functions.rst:2167 +#: library/functions.rst:2248 msgid "spam = __import__('spam', globals(), locals(), [], 0)" msgstr "spam = __import__('spam', globals(), locals(), [], 0)" -#: library/functions.rst:2169 +#: library/functions.rst:2250 msgid "The statement ``import spam.ham`` results in this call::" msgstr "Η δήλωση ``import spam.ham`` καταλήγει σε αυτήν την κλήση::" -#: library/functions.rst:2171 +#: library/functions.rst:2252 msgid "spam = __import__('spam.ham', globals(), locals(), [], 0)" msgstr "spam = __import__('spam.ham', globals(), locals(), [], 0)" -#: library/functions.rst:2173 +#: library/functions.rst:2254 msgid "" "Note how :func:`__import__` returns the toplevel module here because this is " "the object that is bound to a name by the :keyword:`import` statement." @@ -4312,7 +4458,7 @@ msgstr "" "εδώ, επειδή αυτό είναι το αντικείμενο που συνδέεται με ένα όνομα με τη " "δήλωση :keyword:`import`." -#: library/functions.rst:2176 +#: library/functions.rst:2257 msgid "" "On the other hand, the statement ``from spam.ham import eggs, sausage as " "saus`` results in ::" @@ -4320,7 +4466,7 @@ msgstr "" "Από την άλλη πλευρά, η δήλωση ``from spam.ham import eggs, sausage as saus`` " "καταλήγει σε ::" -#: library/functions.rst:2179 +#: library/functions.rst:2260 msgid "" "_temp = __import__('spam.ham', globals(), locals(), ['eggs', 'sausage'], 0)\n" "eggs = _temp.eggs\n" @@ -4330,7 +4476,7 @@ msgstr "" "eggs = _temp.eggs\n" "saus = _temp.sausage" -#: library/functions.rst:2183 +#: library/functions.rst:2264 msgid "" "Here, the ``spam.ham`` module is returned from :func:`__import__`. From " "this object, the names to import are retrieved and assigned to their " @@ -4340,7 +4486,7 @@ msgstr "" "αυτό το αντικείμενο, τα ονόματα προς εισαγωγή ανακτώνται και εκχωρούνται στα " "αντίστοιχα ονόματά τους." -#: library/functions.rst:2187 +#: library/functions.rst:2268 msgid "" "If you simply want to import a module (potentially within a package) by " "name, use :func:`importlib.import_module`." @@ -4348,7 +4494,7 @@ msgstr "" "Εάν θέλετε απλώς να εισάγετε ένα module (ενδεχομένως μέσα σε ένα πακέτο) με " "το όνομα, χρησιμοποιήστε το :func:`importlib.import_module`." -#: library/functions.rst:2190 +#: library/functions.rst:2271 msgid "" "Negative values for *level* are no longer supported (which also changes the " "default value to 0)." @@ -4356,7 +4502,7 @@ msgstr "" "Αρνητικές τιμές για το *level* δεν υποστηρίζονται πλέον (το οποίο επίσης " "αλλάζει την προεπιλεγμένη τιμή σε 0)." -#: library/functions.rst:2194 +#: library/functions.rst:2275 msgid "" "When the command line options :option:`-E` or :option:`-I` are being used, " "the environment variable :envvar:`PYTHONCASEOK` is now ignored." @@ -4365,11 +4511,11 @@ msgstr "" "I`, τότε η μεταβλητή περιβάλλοντος :envvar:`PYTHONCASEOK` δεν λαμβάνεται " "υπόψιν." -#: library/functions.rst:2199 +#: library/functions.rst:2280 msgid "Footnotes" msgstr "Υποσημειώσεις" -#: library/functions.rst:2200 +#: library/functions.rst:2281 msgid "" "Note that the parser only accepts the Unix-style end of line convention. If " "you are reading the code from a file, make sure to use newline conversion " @@ -4384,110 +4530,149 @@ msgstr "" msgid "Boolean" msgstr "Boolean" -#: library/functions.rst:1971 +#: library/functions.rst:2048 msgid "type" msgstr "τύπος" -#: library/functions.rst:638 +#: library/functions.rst:648 msgid "built-in function" msgstr "ενσωματωμένη συνάρτηση" -#: library/functions.rst:638 +#: library/functions.rst:648 msgid "exec" msgstr "exec" -#: library/functions.rst:725 +#: library/functions.rst:746 msgid "NaN" msgstr "NaN" -#: library/functions.rst:725 +#: library/functions.rst:746 msgid "Infinity" msgstr "Άπειρο" -#: library/functions.rst:793 +#: library/functions.rst:814 msgid "__format__" msgstr "__format__" -#: library/functions.rst:1855 +#: library/functions.rst:1925 msgid "string" msgstr "string" -#: library/functions.rst:793 +#: library/functions.rst:814 msgid "format() (built-in function)" msgstr "format() (ενσωματωμένη συνάρτηση)" -#: library/functions.rst:1262 +#: library/functions.rst:1325 msgid "file object" msgstr "αντικείμενο αρχείου" -#: library/functions.rst:1383 +#: library/functions.rst:1446 msgid "open() built-in function" msgstr "open() ενσωματωμένη συνάρτηση" -#: library/functions.rst:1290 +#: library/functions.rst:1353 msgid "file" msgstr "αρχείο" -#: library/functions.rst:1290 +#: library/functions.rst:1353 msgid "modes" msgstr "λειτουργίες" -#: library/functions.rst:1383 +#: library/functions.rst:1446 msgid "universal newlines" msgstr "καθολικές νέες γραμμές" -#: library/functions.rst:1444 +#: library/functions.rst:1507 msgid "line-buffered I/O" msgstr "γραμμική προσωρινή μνήμη I/O" -#: library/functions.rst:1444 +#: library/functions.rst:1507 msgid "unbuffered I/O" msgstr "unbuffered I/O" -#: library/functions.rst:1444 +#: library/functions.rst:1507 msgid "buffer size, I/O" msgstr "μέγεθος bugger, I/O" -#: library/functions.rst:1444 +#: library/functions.rst:1507 msgid "I/O control" msgstr "Έλεγχος I/O" -#: library/functions.rst:1444 +#: library/functions.rst:1507 msgid "buffering" msgstr "buffering" -#: library/functions.rst:1444 +#: library/functions.rst:1507 msgid "text mode" msgstr "λειτουργία κειμένου" -#: library/functions.rst:2128 +#: library/functions.rst:2209 msgid "module" msgstr "module" -#: library/functions.rst:1444 +#: library/functions.rst:1507 msgid "sys" msgstr "sys" -#: library/functions.rst:1855 +#: library/functions.rst:1925 msgid "str() (built-in function)" msgstr "str() (ενσωματωμένη συνάρτηση)" -#: library/functions.rst:1971 +#: library/functions.rst:2048 msgid "object" msgstr "αντικείμενο" -#: library/functions.rst:2128 +#: library/functions.rst:2209 msgid "statement" msgstr "δήλωση" -#: library/functions.rst:2128 +#: library/functions.rst:2209 msgid "import" msgstr "import" -#: library/functions.rst:2128 +#: library/functions.rst:2209 msgid "builtins" msgstr "builtins" +#~ msgid "" +#~ "Most users should just pass a *globals* argument and never *locals*. If " +#~ "exec gets two separate objects as *globals* and *locals*, the code will " +#~ "be executed as if it were embedded in a class definition." +#~ msgstr "" +#~ "Οι περισσότεροι χρήστες θα πρέπει απλώς να περάσουν ένα όρισμα *globals* " +#~ "και ποτέ *locals*. Εάν το exec λάβει δύο ξεχωριστά αντικείμενα ως " +#~ "*globals* και *locals*, ο κώδικας θα εκτελεστεί σαν να ήταν ενσωματωμένος " +#~ "σε έναν ορισμό κλάσης." + +#~ msgid "" +#~ "Update and return a dictionary representing the current local symbol " +#~ "table. Free variables are returned by :func:`locals` when it is called in " +#~ "function blocks, but not in class blocks. Note that at the module level, :" +#~ "func:`locals` and :func:`globals` are the same dictionary." +#~ msgstr "" +#~ "Ενημέρωση και επιστροφή ενός λεξικού που αντιπροσωπεύει τον τρέχοντα " +#~ "πίνακα τοπικών συμβόλων. Οι ελεύθερες μεταβλητές επιστρέφονται από :func:" +#~ "`locals` όταν καλείται σε μπλοκ συναρτήσεων, αλλά όχι σε μπλοκ κλάσεων. " +#~ "Σημειώστε ότι σε επίπεδο module, οι :func:`locals` και :func:`globals` " +#~ "είναι το ίδιο λεξικό." + +#~ msgid "" +#~ "The contents of this dictionary should not be modified; changes may not " +#~ "affect the values of local and free variables used by the interpreter." +#~ msgstr "" +#~ "Τα περιεχόμενα αυτού του λεξικού δεν πρέπει να τροποποιηθούν∙ οι αλλαγές " +#~ "ενδέχεται να μην επηρεάσουν τις τιμές των τοπικών και ελεύθερων " +#~ "μεταβλητών που χρησιμοποιούνται από τον διερμηνέα." + +#~ msgid "" +#~ "Without an argument, :func:`vars` acts like :func:`locals`. Note, the " +#~ "locals dictionary is only useful for reads since updates to the locals " +#~ "dictionary are ignored." +#~ msgstr "" +#~ "Χωρίς ένα όρισμα, το :func:`vars` λειτουργεί όπως :func:`locals`. " +#~ "Σημειώστε, ότι το λεξικό των τοπικών είναι χρήσιμο μόνο για ανάγνωση, " +#~ "καθώς οι ενημερώσεις στο λεξικό των τοπικών αγνοούνται." + #~ msgid "" #~ "Raises an :ref:`auditing event ` ``compile`` with arguments " #~ "``source``, ``filename``." diff --git a/library/functools.po b/library/functools.po index 2d2f3c4e..bea8e52b 100644 --- a/library/functools.po +++ b/library/functools.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -527,10 +527,10 @@ msgid "" "example, ``reduce(lambda x, y: x+y, [1, 2, 3, 4, 5])`` calculates " "``((((1+2)+3)+4)+5)``. The left argument, *x*, is the accumulated value and " "the right argument, *y*, is the update value from the *iterable*. If the " -"optional *initializer* is present, it is placed before the items of the " -"iterable in the calculation, and serves as a default when the iterable is " -"empty. If *initializer* is not given and *iterable* contains only one item, " -"the first item is returned." +"optional *initial* is present, it is placed before the items of the iterable " +"in the calculation, and serves as a default when the iterable is empty. If " +"*initial* is not given and *iterable* contains only one item, the first item " +"is returned." msgstr "" #: library/functools.rst:417 @@ -539,37 +539,39 @@ msgstr "" #: library/functools.rst:419 msgid "" -"def reduce(function, iterable, initializer=None):\n" +"initial_missing = object()\n" +"\n" +"def reduce(function, iterable, initial=initial_missing, /):\n" " it = iter(iterable)\n" -" if initializer is None:\n" +" if initial is initial_missing:\n" " value = next(it)\n" " else:\n" -" value = initializer\n" +" value = initial\n" " for element in it:\n" " value = function(value, element)\n" " return value" msgstr "" -#: library/functools.rst:429 +#: library/functools.rst:431 msgid "" "See :func:`itertools.accumulate` for an iterator that yields all " "intermediate values." msgstr "" -#: library/functools.rst:434 +#: library/functools.rst:436 msgid "" "Transform a function into a :term:`single-dispatch ` :term:" "`generic function`." msgstr "" -#: library/functools.rst:437 +#: library/functools.rst:439 msgid "" "To define a generic function, decorate it with the ``@singledispatch`` " "decorator. When defining a function using ``@singledispatch``, note that the " "dispatch happens on the type of the first argument::" msgstr "" -#: library/functools.rst:441 +#: library/functools.rst:443 msgid "" ">>> from functools import singledispatch\n" ">>> @singledispatch\n" @@ -579,7 +581,7 @@ msgid "" "... print(arg)" msgstr "" -#: library/functools.rst:448 +#: library/functools.rst:450 msgid "" "To add overloaded implementations to the function, use the :func:`register` " "attribute of the generic function, which can be used as a decorator. For " @@ -587,7 +589,7 @@ msgid "" "first argument automatically::" msgstr "" -#: library/functools.rst:453 +#: library/functools.rst:455 msgid "" ">>> @fun.register\n" "... def _(arg: int, verbose=False):\n" @@ -603,11 +605,11 @@ msgid "" "... print(i, elem)" msgstr "" -#: library/functools.rst:466 +#: library/functools.rst:468 msgid ":data:`types.UnionType` and :data:`typing.Union` can also be used::" msgstr "" -#: library/functools.rst:468 +#: library/functools.rst:470 msgid "" ">>> @fun.register\n" "... def _(arg: int | float, verbose=False):\n" @@ -625,13 +627,13 @@ msgid "" "..." msgstr "" -#: library/functools.rst:483 +#: library/functools.rst:485 msgid "" "For code which doesn't use type annotations, the appropriate type argument " "can be passed explicitly to the decorator itself::" msgstr "" -#: library/functools.rst:486 +#: library/functools.rst:488 msgid "" ">>> @fun.register(complex)\n" "... def _(arg, verbose=False):\n" @@ -641,7 +643,7 @@ msgid "" "..." msgstr "" -#: library/functools.rst:493 +#: library/functools.rst:495 msgid "" "For code that dispatches on a collections type (e.g., ``list``), but wants " "to typehint the items of the collection (e.g., ``list[int]``), the dispatch " @@ -649,7 +651,7 @@ msgid "" "going into the function definition::" msgstr "" -#: library/functools.rst:498 +#: library/functools.rst:500 msgid "" ">>> @fun.register(list)\n" "... def _(arg: list[int], verbose=False):\n" @@ -659,7 +661,7 @@ msgid "" "... print(i, elem)" msgstr "" -#: library/functools.rst:507 +#: library/functools.rst:509 msgid "" "At runtime the function will dispatch on an instance of a list regardless of " "the type contained within the list i.e. ``[1,2,3]`` will be dispatched the " @@ -667,13 +669,13 @@ msgid "" "example is for static type checkers only and has no runtime impact." msgstr "" -#: library/functools.rst:513 +#: library/functools.rst:515 msgid "" "To enable registering :term:`lambdas` and pre-existing functions, " "the :func:`register` attribute can also be used in a functional form::" msgstr "" -#: library/functools.rst:516 +#: library/functools.rst:518 msgid "" ">>> def nothing(arg, verbose=False):\n" "... print(\"Nothing.\")\n" @@ -681,14 +683,14 @@ msgid "" ">>> fun.register(type(None), nothing)" msgstr "" -#: library/functools.rst:521 +#: library/functools.rst:523 msgid "" "The :func:`register` attribute returns the undecorated function. This " "enables decorator stacking, :mod:`pickling`, and the creation of " "unit tests for each variant independently::" msgstr "" -#: library/functools.rst:525 +#: library/functools.rst:527 msgid "" ">>> @fun.register(float)\n" "... @fun.register(Decimal)\n" @@ -701,13 +703,13 @@ msgid "" "False" msgstr "" -#: library/functools.rst:535 +#: library/functools.rst:537 msgid "" "When called, the generic function dispatches on the type of the first " "argument::" msgstr "" -#: library/functools.rst:538 +#: library/functools.rst:540 msgid "" ">>> fun(\"Hello, world.\")\n" "Hello, world.\n" @@ -727,7 +729,7 @@ msgid "" "0.615" msgstr "" -#: library/functools.rst:555 +#: library/functools.rst:557 msgid "" "Where there is no registered implementation for a specific type, its method " "resolution order is used to find a more generic implementation. The original " @@ -736,14 +738,14 @@ msgid "" "found." msgstr "" -#: library/functools.rst:561 +#: library/functools.rst:563 msgid "" "If an implementation is registered to an :term:`abstract base class`, " "virtual subclasses of the base class will be dispatched to that " "implementation::" msgstr "" -#: library/functools.rst:565 +#: library/functools.rst:567 msgid "" ">>> from collections.abc import Mapping\n" ">>> @fun.register\n" @@ -757,13 +759,13 @@ msgid "" "a => b" msgstr "" -#: library/functools.rst:576 +#: library/functools.rst:578 msgid "" "To check which implementation the generic function will choose for a given " "type, use the ``dispatch()`` attribute::" msgstr "" -#: library/functools.rst:579 +#: library/functools.rst:581 msgid "" ">>> fun.dispatch(float)\n" "\n" @@ -771,13 +773,13 @@ msgid "" "" msgstr "" -#: library/functools.rst:584 +#: library/functools.rst:586 msgid "" "To access all registered implementations, use the read-only ``registry`` " "attribute::" msgstr "" -#: library/functools.rst:587 +#: library/functools.rst:589 msgid "" ">>> fun.registry.keys()\n" "dict_keys([, , ,\n" @@ -789,23 +791,23 @@ msgid "" "" msgstr "" -#: library/functools.rst:598 +#: library/functools.rst:600 msgid "The :func:`register` attribute now supports using type annotations." msgstr "" -#: library/functools.rst:601 +#: library/functools.rst:603 msgid "" "The :func:`register` attribute now supports :data:`types.UnionType` and :" "data:`typing.Union` as type annotations." msgstr "" -#: library/functools.rst:608 +#: library/functools.rst:610 msgid "" "Transform a method into a :term:`single-dispatch ` :term:" "`generic function`." msgstr "" -#: library/functools.rst:611 +#: library/functools.rst:613 msgid "" "To define a generic method, decorate it with the ``@singledispatchmethod`` " "decorator. When defining a function using ``@singledispatchmethod``, note " @@ -813,7 +815,7 @@ msgid "" "argument::" msgstr "" -#: library/functools.rst:616 +#: library/functools.rst:618 msgid "" "class Negator:\n" " @singledispatchmethod\n" @@ -829,7 +831,7 @@ msgid "" " return not arg" msgstr "" -#: library/functools.rst:629 +#: library/functools.rst:631 msgid "" "``@singledispatchmethod`` supports nesting with other decorators such as :" "func:`@classmethod`. Note that to allow for ``dispatcher." @@ -838,7 +840,7 @@ msgid "" "rather than an instance of the class::" msgstr "" -#: library/functools.rst:635 +#: library/functools.rst:637 msgid "" "class Negator:\n" " @singledispatchmethod\n" @@ -857,14 +859,14 @@ msgid "" " return not arg" msgstr "" -#: library/functools.rst:651 +#: library/functools.rst:653 msgid "" "The same pattern can be used for other similar decorators: :func:" "`@staticmethod`, :func:`@abstractmethod`, " "and others." msgstr "" -#: library/functools.rst:660 +#: library/functools.rst:662 msgid "" "Update a *wrapper* function to look like the *wrapped* function. The " "optional arguments are tuples to specify which attributes of the original " @@ -880,7 +882,7 @@ msgid "" "dictionary)." msgstr "" -#: library/functools.rst:672 +#: library/functools.rst:674 msgid "" "To allow access to the original function for introspection and other " "purposes (e.g. bypassing a caching decorator such as :func:`lru_cache`), " @@ -888,7 +890,7 @@ msgid "" "that refers to the function being wrapped." msgstr "" -#: library/functools.rst:677 +#: library/functools.rst:679 msgid "" "The main intended use for this function is in :term:`decorator` functions " "which wrap the decorated function and return the wrapper. If the wrapper " @@ -897,7 +899,7 @@ msgid "" "is typically less than helpful." msgstr "" -#: library/functools.rst:683 +#: library/functools.rst:685 msgid "" ":func:`update_wrapper` may be used with callables other than functions. Any " "attributes named in *assigned* or *updated* that are missing from the object " @@ -906,26 +908,26 @@ msgid "" "wrapper function itself is missing any attributes named in *updated*." msgstr "" -#: library/functools.rst:689 +#: library/functools.rst:691 msgid "" "The ``__wrapped__`` attribute is now automatically added. The :attr:" "`~function.__annotations__` attribute is now copied by default. Missing " "attributes no longer trigger an :exc:`AttributeError`." msgstr "" -#: library/functools.rst:694 +#: library/functools.rst:696 msgid "" "The ``__wrapped__`` attribute now always refers to the wrapped function, " "even if that function defined a ``__wrapped__`` attribute. (see :issue:" "`17482`)" msgstr "" -#: library/functools.rst:699 +#: library/functools.rst:701 msgid "" "The :attr:`~function.__type_params__` attribute is now copied by default." msgstr "" -#: library/functools.rst:705 +#: library/functools.rst:707 msgid "" "This is a convenience function for invoking :func:`update_wrapper` as a " "function decorator when defining a wrapper function. It is equivalent to " @@ -933,7 +935,7 @@ msgid "" "updated=updated)``. For example::" msgstr "" -#: library/functools.rst:710 +#: library/functools.rst:712 msgid "" ">>> from functools import wraps\n" ">>> def my_decorator(f):\n" @@ -957,42 +959,42 @@ msgid "" "'Docstring'" msgstr "" -#: library/functools.rst:731 +#: library/functools.rst:733 msgid "" "Without the use of this decorator factory, the name of the example function " "would have been ``'wrapper'``, and the docstring of the original :func:" "`example` would have been lost." msgstr "" -#: library/functools.rst:739 +#: library/functools.rst:741 msgid ":class:`partial` Objects" msgstr "" -#: library/functools.rst:741 +#: library/functools.rst:743 msgid "" ":class:`partial` objects are callable objects created by :func:`partial`. " "They have three read-only attributes:" msgstr "" -#: library/functools.rst:747 +#: library/functools.rst:749 msgid "" "A callable object or function. Calls to the :class:`partial` object will be " "forwarded to :attr:`func` with new arguments and keywords." msgstr "" -#: library/functools.rst:753 +#: library/functools.rst:755 msgid "" "The leftmost positional arguments that will be prepended to the positional " "arguments provided to a :class:`partial` object call." msgstr "" -#: library/functools.rst:759 +#: library/functools.rst:761 msgid "" "The keyword arguments that will be supplied when the :class:`partial` object " "is called." msgstr "" -#: library/functools.rst:762 +#: library/functools.rst:764 msgid "" ":class:`partial` objects are like :ref:`function objects ` in that they are callable, weak referenceable, and can have " diff --git a/library/gc.po b/library/gc.po index c7c2160a..37b4b3eb 100644 --- a/library/gc.po +++ b/library/gc.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -55,8 +55,8 @@ msgstr "" msgid "" "With no arguments, run a full collection. The optional argument " "*generation* may be an integer specifying which generation to collect (from " -"0 to 2). A :exc:`ValueError` is raised if the generation number is " -"invalid. The number of unreachable objects found is returned." +"0 to 2). A :exc:`ValueError` is raised if the generation number is invalid. " +"The sum of collected objects and uncollectable objects is returned." msgstr "" #: library/gc.rst:48 diff --git a/library/getopt.po b/library/getopt.po index 22371b4a..f3575752 100644 --- a/library/getopt.po +++ b/library/getopt.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -27,44 +27,54 @@ msgstr "" #: library/getopt.rst:12 msgid "" -"The :mod:`getopt` module is a parser for command line options whose API is " -"designed to be familiar to users of the C :c:func:`getopt` function. Users " -"who are unfamiliar with the C :c:func:`getopt` function or who would like to " -"write less code and get better help and error messages should consider using " -"the :mod:`argparse` module instead." +"This module is considered feature complete. A more declarative and " +"extensible alternative to this API is provided in the :mod:`optparse` " +"module. Further functional enhancements for command line parameter " +"processing are provided either as third party modules on PyPI, or else as " +"features in the :mod:`argparse` module." msgstr "" #: library/getopt.rst:20 msgid "" "This module helps scripts to parse the command line arguments in ``sys." -"argv``. It supports the same conventions as the Unix :c:func:`getopt` " +"argv``. It supports the same conventions as the Unix :c:func:`!getopt` " "function (including the special meanings of arguments of the form '``-``' " "and '``--``'). Long options similar to those supported by GNU software may " "be used as well via an optional third argument." msgstr "" #: library/getopt.rst:26 +msgid "" +"Users who are unfamiliar with the Unix :c:func:`!getopt` function should " +"consider using the :mod:`argparse` module instead. Users who are familiar " +"with the Unix :c:func:`!getopt` function, but would like to get equivalent " +"behavior while writing less code and getting better help and error messages " +"should consider using the :mod:`optparse` module. See :ref:`choosing-an-" +"argument-parser` for additional details." +msgstr "" + +#: library/getopt.rst:33 msgid "This module provides two functions and an exception:" msgstr "" -#: library/getopt.rst:32 +#: library/getopt.rst:39 msgid "" "Parses command line options and parameter list. *args* is the argument list " "to be parsed, without the leading reference to the running program. " "Typically, this means ``sys.argv[1:]``. *shortopts* is the string of option " "letters that the script wants to recognize, with options that require an " "argument followed by a colon (``':'``; i.e., the same format that Unix :c:" -"func:`getopt` uses)." +"func:`!getopt` uses)." msgstr "" -#: library/getopt.rst:40 +#: library/getopt.rst:47 msgid "" -"Unlike GNU :c:func:`getopt`, after a non-option argument, all further " +"Unlike GNU :c:func:`!getopt`, after a non-option argument, all further " "arguments are considered also non-options. This is similar to the way non-" "GNU Unix systems work." msgstr "" -#: library/getopt.rst:44 +#: library/getopt.rst:51 msgid "" "*longopts*, if specified, must be a list of strings with the names of the " "long options which should be supported. The leading ``'--'`` characters " @@ -78,7 +88,7 @@ msgid "" "uniquely, so :exc:`GetoptError` will be raised." msgstr "" -#: library/getopt.rst:55 +#: library/getopt.rst:62 msgid "" "The return value consists of two elements: the first is a list of ``(option, " "value)`` pairs; the second is the list of program arguments left after the " @@ -91,7 +101,7 @@ msgid "" "occurrences. Long and short options may be mixed." msgstr "" -#: library/getopt.rst:68 +#: library/getopt.rst:75 msgid "" "This function works like :func:`getopt`, except that GNU style scanning mode " "is used by default. This means that option and non-option arguments may be " @@ -99,33 +109,33 @@ msgid "" "a non-option argument is encountered." msgstr "" -#: library/getopt.rst:73 +#: library/getopt.rst:80 msgid "" "If the first character of the option string is ``'+'``, or if the " -"environment variable :envvar:`POSIXLY_CORRECT` is set, then option " +"environment variable :envvar:`!POSIXLY_CORRECT` is set, then option " "processing stops as soon as a non-option argument is encountered." msgstr "" -#: library/getopt.rst:80 +#: library/getopt.rst:87 msgid "" "This is raised when an unrecognized option is found in the argument list or " "when an option requiring an argument is given none. The argument to the " "exception is a string indicating the cause of the error. For long options, " "an argument given to an option which does not require one will also cause " -"this exception to be raised. The attributes :attr:`msg` and :attr:`opt` " +"this exception to be raised. The attributes :attr:`!msg` and :attr:`!opt` " "give the error message and related option; if there is no specific option to " -"which the exception relates, :attr:`opt` is an empty string." +"which the exception relates, :attr:`!opt` is an empty string." msgstr "" -#: library/getopt.rst:91 +#: library/getopt.rst:98 msgid "Alias for :exc:`GetoptError`; for backward compatibility." msgstr "" -#: library/getopt.rst:93 +#: library/getopt.rst:100 msgid "An example using only Unix style options:" msgstr "" -#: library/getopt.rst:95 +#: library/getopt.rst:102 msgid "" ">>> import getopt\n" ">>> args = '-a -b -cfoo -d bar a1 a2'.split()\n" @@ -138,11 +148,11 @@ msgid "" "['a1', 'a2']" msgstr "" -#: library/getopt.rst:107 +#: library/getopt.rst:114 msgid "Using long option names is equally easy:" msgstr "" -#: library/getopt.rst:109 +#: library/getopt.rst:116 msgid "" ">>> s = '--condition=foo --testing --output-file abc.def -x a1 a2'\n" ">>> args = s.split()\n" @@ -158,11 +168,11 @@ msgid "" "['a1', 'a2']" msgstr "" -#: library/getopt.rst:122 +#: library/getopt.rst:129 msgid "In a script, typical usage is something like this:" msgstr "" -#: library/getopt.rst:124 +#: library/getopt.rst:131 msgid "" "import getopt, sys\n" "\n" @@ -188,20 +198,38 @@ msgid "" " output = a\n" " else:\n" " assert False, \"unhandled option\"\n" -" # ...\n" +" process(args, output=output, verbose=verbose)\n" "\n" "if __name__ == \"__main__\":\n" " main()" msgstr "" -#: library/getopt.rst:153 +#: library/getopt.rst:160 msgid "" "Note that an equivalent command line interface could be produced with less " "code and more informative help and error messages by using the :mod:" -"`argparse` module:" +"`optparse` module:" +msgstr "" + +#: library/getopt.rst:163 +msgid "" +"import optparse\n" +"\n" +"if __name__ == '__main__':\n" +" parser = optparse.OptionParser()\n" +" parser.add_option('-o', '--output')\n" +" parser.add_option('-v', dest='verbose', action='store_true')\n" +" opts, args = parser.parse_args()\n" +" process(args, output=opts.output, verbose=opts.verbose)" msgstr "" -#: library/getopt.rst:156 +#: library/getopt.rst:174 +msgid "" +"A roughly equivalent command line interface for this case can also be " +"produced by using the :mod:`argparse` module:" +msgstr "" + +#: library/getopt.rst:177 msgid "" "import argparse\n" "\n" @@ -209,15 +237,30 @@ msgid "" " parser = argparse.ArgumentParser()\n" " parser.add_argument('-o', '--output')\n" " parser.add_argument('-v', dest='verbose', action='store_true')\n" +" parser.add_argument('rest', nargs='*')\n" " args = parser.parse_args()\n" -" # ... do something with args.output ...\n" -" # ... do something with args.verbose .." +" process(args.rest, output=args.output, verbose=args.verbose)" +msgstr "" + +#: library/getopt.rst:189 +msgid "" +"See :ref:`choosing-an-argument-parser` for details on how the ``argparse`` " +"version of this code differs in behaviour from the ``optparse`` (and " +"``getopt``) version." +msgstr "" + +#: library/getopt.rst:195 +msgid "Module :mod:`optparse`" +msgstr "" + +#: library/getopt.rst:196 +msgid "Declarative command line option parsing." msgstr "" -#: library/getopt.rst:170 +#: library/getopt.rst:198 msgid "Module :mod:`argparse`" msgstr "" -#: library/getopt.rst:171 -msgid "Alternative command line option and argument parsing library." +#: library/getopt.rst:199 +msgid "More opinionated command line option and argument parsing library." msgstr "" diff --git a/library/getpass.po b/library/getpass.po index 202e9b55..fb1c81bf 100644 --- a/library/getpass.po +++ b/library/getpass.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -31,9 +31,8 @@ msgstr "" #: includes/wasm-notavail.rst:5 msgid "" -"This module does not work or is not available on WebAssembly platforms " -"``wasm32-emscripten`` and ``wasm32-wasi``. See :ref:`wasm-availability` for " -"more information." +"This module does not work or is not available on WebAssembly. See :ref:`wasm-" +"availability` for more information." msgstr "" #: library/getpass.rst:17 @@ -77,9 +76,13 @@ msgid "" "`USER`, :envvar:`!LNAME` and :envvar:`USERNAME`, in order, and returns the " "value of the first one which is set to a non-empty string. If none are set, " "the login name from the password database is returned on systems which " -"support the :mod:`pwd` module, otherwise, an exception is raised." +"support the :mod:`pwd` module, otherwise, an :exc:`OSError` is raised." msgstr "" #: library/getpass.rst:52 msgid "In general, this function should be preferred over :func:`os.getlogin`." msgstr "" + +#: library/getpass.rst:54 +msgid "Previously, various exceptions beyond just :exc:`OSError` were raised." +msgstr "" diff --git a/library/gettext.po b/library/gettext.po index 95e1cae8..a9913c9c 100644 --- a/library/gettext.po +++ b/library/gettext.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" diff --git a/library/glob.po b/library/glob.po index 08614e15..8414263a 100644 --- a/library/glob.po +++ b/library/glob.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -49,11 +49,11 @@ msgid "" "``'[?]'`` matches the character ``'?'``." msgstr "" -#: library/glob.rst:39 -msgid "The :mod:`pathlib` module offers high-level path objects." +#: library/glob.rst:37 +msgid "The :mod:`glob` module defines the following functions:" msgstr "" -#: library/glob.rst:45 +#: library/glob.rst:43 msgid "" "Return a possibly empty list of path names that match *pathname*, which must " "be a string containing a path specification. *pathname* can be either " @@ -65,7 +65,7 @@ msgid "" "path name for that file will be included is unspecified." msgstr "" -#: library/glob.rst:54 +#: library/glob.rst:52 msgid "" "If *root_dir* is not ``None``, it should be a :term:`path-like object` " "specifying the root directory for searching. It has the same effect on :" @@ -73,13 +73,13 @@ msgid "" "*pathname* is relative, the result will contain paths relative to *root_dir*." msgstr "" -#: library/glob.rst:60 +#: library/glob.rst:58 msgid "" "This function can support :ref:`paths relative to directory descriptors " "` with the *dir_fd* parameter." msgstr "" -#: library/glob.rst:66 +#: library/glob.rst:64 msgid "" "If *recursive* is true, the pattern \"``**``\" will match any files and zero " "or more directories, subdirectories and symbolic links to directories. If " @@ -87,55 +87,55 @@ msgid "" "will not match." msgstr "" -#: library/glob.rst:71 +#: library/glob.rst:69 msgid "" "If *include_hidden* is true, \"``**``\" pattern will match hidden " "directories." msgstr "" -#: library/glob.rst:100 +#: library/glob.rst:98 msgid "" "Raises an :ref:`auditing event ` ``glob.glob`` with arguments " "``pathname``, ``recursive``." msgstr "" -#: library/glob.rst:101 +#: library/glob.rst:99 msgid "" "Raises an :ref:`auditing event ` ``glob.glob/2`` with arguments " "``pathname``, ``recursive``, ``root_dir``, ``dir_fd``." msgstr "" -#: library/glob.rst:77 +#: library/glob.rst:75 msgid "" "Using the \"``**``\" pattern in large directory trees may consume an " "inordinate amount of time." msgstr "" -#: library/glob.rst:104 +#: library/glob.rst:102 msgid "" "This function may return duplicate path names if *pathname* contains " "multiple \"``**``\" patterns and *recursive* is true." msgstr "" -#: library/glob.rst:107 +#: library/glob.rst:105 msgid "Support for recursive globs using \"``**``\"." msgstr "" -#: library/glob.rst:110 +#: library/glob.rst:108 msgid "Added the *root_dir* and *dir_fd* parameters." msgstr "" -#: library/glob.rst:113 +#: library/glob.rst:111 msgid "Added the *include_hidden* parameter." msgstr "" -#: library/glob.rst:97 +#: library/glob.rst:95 msgid "" "Return an :term:`iterator` which yields the same values as :func:`glob` " "without actually storing them all simultaneously." msgstr "" -#: library/glob.rst:119 +#: library/glob.rst:117 msgid "" "Escape all special characters (``'?'``, ``'*'`` and ``'['``). This is useful " "if you want to match an arbitrary literal string that may have special " @@ -146,14 +146,58 @@ msgstr "" #: library/glob.rst:128 msgid "" -"For example, consider a directory containing the following files: :file:`1." -"gif`, :file:`2.txt`, :file:`card.gif` and a subdirectory :file:`sub` which " -"contains only the file :file:`3.txt`. :func:`glob` will produce the " -"following results. Notice how any leading components of the path are " -"preserved. ::" +"Convert the given path specification to a regular expression for use with :" +"func:`re.match`. The path specification can contain shell-style wildcards." +msgstr "" + +#: library/glob.rst:131 +msgid "For example:" +msgstr "" + +#: library/glob.rst:142 +msgid "" +"Path separators and segments are meaningful to this function, unlike :func:" +"`fnmatch.translate`. By default wildcards do not match path separators, and " +"``*`` pattern segments match precisely one path segment." +msgstr "" + +#: library/glob.rst:146 +msgid "" +"If *recursive* is true, the pattern segment \"``**``\" will match any number " +"of path segments." msgstr "" -#: library/glob.rst:134 +#: library/glob.rst:149 +msgid "" +"If *include_hidden* is true, wildcards can match path segments that start " +"with a dot (``.``)." +msgstr "" + +#: library/glob.rst:152 +msgid "" +"A sequence of path separators may be supplied to the *seps* argument. If not " +"given, :data:`os.sep` and :data:`~os.altsep` (if available) are used." +msgstr "" + +#: library/glob.rst:157 +msgid "" +":meth:`pathlib.PurePath.full_match` and :meth:`pathlib.Path.glob` methods, " +"which call this function to implement pattern matching and globbing." +msgstr "" + +#: library/glob.rst:165 +msgid "Examples" +msgstr "" + +#: library/glob.rst:167 +msgid "" +"Consider a directory containing the following files: :file:`1.gif`, :file:`2." +"txt`, :file:`card.gif` and a subdirectory :file:`sub` which contains only " +"the file :file:`3.txt`. :func:`glob` will produce the following results. " +"Notice how any leading components of the path are preserved. ::" +msgstr "" + +#: library/glob.rst:173 msgid "" ">>> import glob\n" ">>> glob.glob('./[0-9].*')\n" @@ -168,14 +212,14 @@ msgid "" "['./', './sub/']" msgstr "" -#: library/glob.rst:146 +#: library/glob.rst:185 msgid "" "If the directory contains files starting with ``.`` they won't be matched by " "default. For example, consider a directory containing :file:`card.gif` and :" "file:`.card.gif`::" msgstr "" -#: library/glob.rst:150 +#: library/glob.rst:189 msgid "" ">>> import glob\n" ">>> glob.glob('*.gif')\n" @@ -184,12 +228,13 @@ msgid "" "['.card.gif']" msgstr "" -#: library/glob.rst:158 -msgid "Module :mod:`fnmatch`" +#: library/glob.rst:196 +msgid "" +"The :mod:`fnmatch` module offers shell-style filename (not path) expansion." msgstr "" -#: library/glob.rst:159 -msgid "Shell-style filename (not path) expansion" +#: library/glob.rst:199 +msgid "The :mod:`pathlib` module offers high-level path objects." msgstr "" #: library/glob.rst:9 @@ -204,7 +249,7 @@ msgstr "" msgid "* (asterisk)" msgstr "" -#: library/glob.rst:63 +#: library/glob.rst:61 msgid "in glob-style wildcards" msgstr "" @@ -228,6 +273,6 @@ msgstr "" msgid ". (dot)" msgstr "" -#: library/glob.rst:63 +#: library/glob.rst:61 msgid "**" msgstr "" diff --git a/library/graphlib.po b/library/graphlib.po index 2b4510bb..b582c430 100644 --- a/library/graphlib.po +++ b/library/graphlib.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" diff --git a/library/grp.po b/library/grp.po index 89a35fd1..a294c2ca 100644 --- a/library/grp.po +++ b/library/grp.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -141,11 +141,3 @@ msgstr "" #: library/grp.rst:65 msgid "An interface to the user database, similar to this." msgstr "" - -#: library/grp.rst:67 -msgid "Module :mod:`spwd`" -msgstr "" - -#: library/grp.rst:68 -msgid "An interface to the shadow password database, similar to this." -msgstr "" diff --git a/library/gzip.po b/library/gzip.po index e9aaeab8..c4404836 100644 --- a/library/gzip.po +++ b/library/gzip.po @@ -8,8 +8,8 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" -"PO-Revision-Date: 2025-02-27 12:39+0200\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" +"PO-Revision-Date: 2025-05-06 13:54+0200\n" "Last-Translator: Marios Giannopoulos \n" "Language-Team: PyGreece \n" "Language: \n" @@ -139,7 +139,7 @@ msgid "Added support for the ``'x'``, ``'xb'`` and ``'xt'`` modes." msgstr "" "Προστέθηκε υποστήριξη για τις λειτουργίες ``'x'``, ``'xb'`` και ``'xt'``." -#: library/gzip.rst:171 +#: library/gzip.rst:173 msgid "Accepts a :term:`path-like object`." msgstr "Δέχεται ένα :term:`path-like object`." @@ -236,19 +236,26 @@ msgstr "" #: library/gzip.rst:103 msgid "" -"The *mtime* argument is an optional numeric timestamp to be written to the " -"last modification time field in the stream when compressing. It should only " -"be provided in compression mode. If omitted or ``None``, the current time " -"is used. See the :attr:`mtime` attribute for more details." +"The optional *mtime* argument is the timestamp requested by gzip. The time " +"is in Unix format, i.e., seconds since 00:00:00 UTC, January 1, 1970. If " +"*mtime* is omitted or ``None``, the current time is used. Use *mtime* = 0 to " +"generate a compressed stream that does not depend on creation time." msgstr "" -"Η παράμετρος *mtime* είναι ένας προαιρετικός αριθμητικός χρονικός δείκτης " -"που γράφεται στο πεδίο τελευταίας τροποποίησης στη ροή κατά τη συμπίεση. " -"Πρέπει να παράγεται μόνο σε λειτουργία συμπίεσης. Αν παραλειφθεί ή είναι " -"``None``, χρησιμοποιείται η τρέχουσα χρονική στιγμή. Δείτε το " -"χαρακτηριστικό :attr:`mtime` για περισσότερες λεπτομέρειες." +"Το προαιρετικό όρισμα *mtime* είναι η χρονική σήμανση που ζητείται από το " +"gzip. Η ώρα είναι σε μορφή Unix, δηλαδή δευτερόλεπτα από τις 00:00:00 UTC, " +"1η Ιανουαρίου 1970. Εάν παραληφθεί το *mtime* ή ``None``, χρησιμοποιείται η " +"τρέχουσα ώρα. Χρησιμοποιήστε *mtime* = 0 για να δημιουργήσετε μια " +"συμπιεσμένη ροή που δεν εξαρτάται από το χρόνο δημιουργίας." #: library/gzip.rst:108 msgid "" +"See below for the :attr:`mtime` attribute that is set when decompressing." +msgstr "" +"Δείτε παρακάτω για το χαρακτηριστικό :attr:`mtime` που ορίζεται κατά την " +"αποσυμπίεση." + +#: library/gzip.rst:110 +msgid "" "Calling a :class:`GzipFile` object's :meth:`!close` method does not close " "*fileobj*, since you might wish to append more material after the compressed " "data. This also allows you to pass an :class:`io.BytesIO` object opened for " @@ -262,7 +269,7 @@ msgstr "" "ανακτήσετε τον τελικό buffer μνήμης χρησιμοποιώντας τη μέθοδο :meth:`~io." "BytesIO.getvalue` του αντικειμένου :class:`io.BytesIO`." -#: library/gzip.rst:114 +#: library/gzip.rst:116 msgid "" ":class:`GzipFile` supports the :class:`io.BufferedIOBase` interface, " "including iteration and the :keyword:`with` statement. Only the :meth:`~io." @@ -273,20 +280,18 @@ msgstr "" "keyword:`with`. Μόνο η μέθοδος :meth:`~io.IOBase.truncate` δεν είναι " "υλοποιημένη." -#: library/gzip.rst:118 +#: library/gzip.rst:120 msgid ":class:`GzipFile` also provides the following method and attribute:" msgstr "Η :class:`GzipFile` παρέχει επίσης την ακόλουθη μέθοδο και ιδιότητα:" -#: library/gzip.rst:122 +#: library/gzip.rst:124 msgid "" -"Read *n* uncompressed bytes without advancing the file position. At most one " -"single read on the compressed stream is done to satisfy the call. The " -"number of bytes returned may be more or less than requested." +"Read *n* uncompressed bytes without advancing the file position. The number " +"of bytes returned may be more or less than requested." msgstr "" -"Διαβάζει *n* μη συμπιεσμένα bytes χωρίς να μετακινεί τη θέση του αρχείου. " -"Γίνεται το πολύ μία μόνο ανάγνωση στη συμπιεσμένη ροή για να ικανοποιηθεί η " -"κλήση. Ο αριθμός των bytes που επιστρέφονται μπορεί να είναι περισσότερα ή " -"λιγότερα από τα ζητούμενα." +"Διαβάζει *n* μη συμπιεσμένα bytes χωρίς να μετακινεί τη θέση του αρχείου. Ο " +"αριθμός των bytes που επιστρέφονται μπορεί να είναι περισσότερα ή λιγότερα " +"από τα ζητούμενα." #: library/gzip.rst:127 msgid "" @@ -300,32 +305,27 @@ msgstr "" "παράμετρο *fileobj*)." #: library/gzip.rst:136 -msgid "" -"When decompressing, the value of the last modification time field in the " -"most recently read header may be read from this attribute, as an integer. " -"The initial value before reading any headers is ``None``." -msgstr "" -"Κατά την αποσυμπίεση, η τιμή του πεδίου τελευταίας τροποποίησης στην πιο " -"πρόσφατα αναγνωσμένη κεφαλίδα μπορεί να διαβαστεί από αυτή την ιδιότητα, ως " -"ακέραιος αριθμός. Η αρχική τιμή πριν από την ανάγνωση οποιασδήποτε κεφαλίδας " -"είναι ``None``." +msgid "``'rb'`` for reading and ``'wb'`` for writing." +msgstr "``'rb'`` για ανάγνωση και ``'wb'`` για εγγραφή." + +#: library/gzip.rst:138 +msgid "In previous versions it was an integer ``1`` or ``2``." +msgstr "Σε προηγούμενες εκδόσεις αυτό ήταν ένα ακέραιος ``1`` ή ``2``." -#: library/gzip.rst:140 +#: library/gzip.rst:143 msgid "" -"All :program:`gzip` compressed streams are required to contain this " -"timestamp field. Some programs, such as :program:`gunzip`\\ , make use of " -"the timestamp. The format is the same as the return value of :func:`time." -"time` and the :attr:`~os.stat_result.st_mtime` attribute of the object " -"returned by :func:`os.stat`." +"When decompressing, this attribute is set to the last timestamp in the most " +"recently read header. It is an integer, holding the number of seconds since " +"the Unix epoch (00:00:00 UTC, January 1, 1970). The initial value before " +"reading any headers is ``None``." msgstr "" -"Όλες οι συμπιεσμένες ροές :program:`gzip` απαιτείται να περιέχουν αυτό το " -"πεδίο χρονικής σήμανσης. Ορισμένα προγράμματα, όπως το :program:`gunzip`, " -"χρησιμοποιούν αυτήν τη χρονική σήμανση. Η μορφή της είναι ίδια με την τιμή " -"που επιστρέφει η συνάρτηση :func:`time.time` και το χαρακτηριστικό :attr:" -"`~os.stat_result.st_mtime` του αντικειμένου που επιστρέφει η συνάρτηση :func:" -"`os.stat`." +"Κατά την αποσυμπίεση, αυτό το χαρακτηριστικό ορίζεται στην τελευταία σήμανση " +"στην πιο πρόσφατα αναγνωσμένη κεφαλίδα. Είναι ένας ακέραιος αριθμός, που " +"κρατά τον αριθμό των δευτερολέπτων από την εποχή του Unix (00:00:00 UTC, 1 " +"Ιανουαρίου, 1970). Η αρχική τιμή πριν από την ανάγνωση οποιωνδήποτε " +"κεφαλίδων είναι ``None``." -#: library/gzip.rst:148 +#: library/gzip.rst:150 msgid "" "The path to the gzip file on disk, as a :class:`str` or :class:`bytes`. " "Equivalent to the output of :func:`os.fspath` on the original input path, " @@ -335,7 +335,7 @@ msgstr "" "Ισοδυναμεί με την έξοδο της συνάρτησης :func:`os.fspath` για την αρχική " "διαδρομή εισόδου, χωρίς καμία άλλη κανονικοποίηση, επίλυση ή επέκταση." -#: library/gzip.rst:152 +#: library/gzip.rst:154 msgid "" "Support for the :keyword:`with` statement was added, along with the *mtime* " "constructor argument and :attr:`mtime` attribute." @@ -343,21 +343,21 @@ msgstr "" "Προστέθηκε η υποστήριξη για τη δήλωση :keyword:`with`, μαζί με την παράμετρο " "*mtime* στον κατασκευαστή και την ιδιότητα :attr:`mtime`." -#: library/gzip.rst:156 +#: library/gzip.rst:158 msgid "Support for zero-padded and unseekable files was added." msgstr "" "Προστέθηκε υποστήριξη για αρχεία με μηδενική συμπλήρωση και μη αναζητήσιμα " "αρχεία." -#: library/gzip.rst:159 +#: library/gzip.rst:161 msgid "The :meth:`io.BufferedIOBase.read1` method is now implemented." msgstr "Η μέθοδος :meth:`io.BufferedIOBase.read1` έχει πλέον υλοποιηθεί." -#: library/gzip.rst:162 +#: library/gzip.rst:164 msgid "Added support for the ``'x'`` and ``'xb'`` modes." msgstr "Προστέθηκε υποστήριξη για τις λειτουργίες ``'x'`` και ``'xb'``." -#: library/gzip.rst:165 +#: library/gzip.rst:167 msgid "" "Added support for writing arbitrary :term:`bytes-like objects `. The :meth:`~io.BufferedIOBase.read` method now accepts an argument " @@ -367,15 +367,7 @@ msgstr "" "`. Η μέθοδος :meth:`~io.BufferedIOBase.read` δέχεται " "πλέον ένα όρισμα ``None``." -#: library/gzip.rst:174 -msgid "" -"Remove the ``filename`` attribute, use the :attr:`~GzipFile.name` attribute " -"instead." -msgstr "" -"Καταργήθηκε το χαρακτηριστικό ``filename``, χρησιμοποιήστε το " -"χαρακτηριστικό :attr:`~GzipFile.name` αντ' αυτού." - -#: library/gzip.rst:178 +#: library/gzip.rst:176 msgid "" "Opening :class:`GzipFile` for writing without specifying the *mode* argument " "is deprecated." @@ -383,20 +375,23 @@ msgstr "" "Το άνοιγμα ενός :class:`GzipFile` για εγγραφή χωρίς να καθοριστεί η " "παράμετρος *mode* έχει καταργηθεί." -#: library/gzip.rst:185 +#: library/gzip.rst:180 +msgid "" +"Remove the ``filename`` attribute, use the :attr:`~GzipFile.name` attribute " +"instead." +msgstr "" +"Καταργήθηκε το χαρακτηριστικό ``filename``, χρησιμοποιήστε το " +"χαρακτηριστικό :attr:`~GzipFile.name` αντ' αυτού." + +#: library/gzip.rst:187 msgid "" "Compress the *data*, returning a :class:`bytes` object containing the " "compressed data. *compresslevel* and *mtime* have the same meaning as in " -"the :class:`GzipFile` constructor above. When *mtime* is set to ``0``, this " -"function is equivalent to :func:`zlib.compress` with *wbits* set to ``31``. " -"The zlib function is faster." +"the :class:`GzipFile` constructor above." msgstr "" "Συμπιέζει τα *data* και επιστρέφει ένα αντικείμενο :class:`bytes` που " "περιέχει τα συμπιεσμένα δεδομένα. Οι παράμετροι *compresslevel* και *mtime* " -"έχουν την ίδια σημασία όπως στον κατασκευαστή της κλάσης :class:`GzipFile`. " -"Όταν η *mtime* οριστεί σε ``0``, αυτή η συνάρτηση είναι ισοδύναμη με τη :" -"func:`zlib.compress` με *wbits* ορισμένο σε ``31``. Η συνάρτηση του zlib " -"είναι ταχύτερη." +"έχουν την ίδια σημασία όπως στον κατασκευαστή της κλάσης :class:`GzipFile`." #: library/gzip.rst:192 msgid "Added the *mtime* parameter for reproducible output." @@ -416,7 +411,16 @@ msgstr "" "μπορεί να περιέχει μια τιμή byte \"OS\" στην κεφαλίδα gzip διαφορετική από " "255 \"unknown\", όπως καθορίζεται από την υποκείμενη υλοποίηση της zlib." -#: library/gzip.rst:203 +#: library/gzip.rst:201 +msgid "" +"The gzip header OS byte is guaranteed to be set to 255 when this function is " +"used as was the case in 3.10 and earlier." +msgstr "" +"Το byte του λειτουργικού συστήματος κεφαλίδα gzip είναι εγγυημένο ότι θα " +"ρυθμιστεί στο 255 όταν χρησιμοποιείται αυτή η συνάρτηση, όπως συνέβαινε στην " +"έκδοση 3.10 και παλαιότερα." + +#: library/gzip.rst:207 msgid "" "Decompress the *data*, returning a :class:`bytes` object containing the " "uncompressed data. This function is capable of decompressing multi-member " @@ -430,7 +434,7 @@ msgstr "" "τους). Όταν τα δεδομένα είναι βέβαιο ότι περιέχουν μόνο ένα μέλος, η " "συνάρτηση :func:`zlib.decompress` με *wbits* ρυθμισμένο σε 31 είναι ταχύτερη." -#: library/gzip.rst:210 +#: library/gzip.rst:214 msgid "" "Speed is improved by decompressing members at once in memory instead of in a " "streamed fashion." @@ -438,15 +442,15 @@ msgstr "" "Η ταχύτητα βελτιώνεται αποσυμπιέζοντας τα μέλη απευθείας στην μνήμη αντί να " "γίνεται αποσυμπίεση σε ροή." -#: library/gzip.rst:217 +#: library/gzip.rst:221 msgid "Examples of usage" msgstr "Παραδείγματα χρήσης" -#: library/gzip.rst:219 +#: library/gzip.rst:223 msgid "Example of how to read a compressed file::" msgstr "Παράδειγμα ανάγνωσης ενός συμπιεσμένου αρχείου::" -#: library/gzip.rst:221 +#: library/gzip.rst:225 msgid "" "import gzip\n" "with gzip.open('/home/joe/file.txt.gz', 'rb') as f:\n" @@ -456,11 +460,11 @@ msgstr "" "with gzip.open('/home/joe/file.txt.gz', 'rb') as f:\n" " file_content = f.read()" -#: library/gzip.rst:225 +#: library/gzip.rst:229 msgid "Example of how to create a compressed GZIP file::" msgstr "Παράδειγμα δημιουργίας ενός συμπιεσμένου αρχείου GZIP::" -#: library/gzip.rst:227 +#: library/gzip.rst:231 msgid "" "import gzip\n" "content = b\"Lots of content here\"\n" @@ -472,11 +476,11 @@ msgstr "" "with gzip.open('/home/joe/file.txt.gz', 'wb') as f:\n" " f.write(content)" -#: library/gzip.rst:232 +#: library/gzip.rst:236 msgid "Example of how to GZIP compress an existing file::" msgstr "Παράδειγμα συμπίεσης ενός υπάρχοντος αρχείου σε μορφή GZIP::" -#: library/gzip.rst:234 +#: library/gzip.rst:238 msgid "" "import gzip\n" "import shutil\n" @@ -490,11 +494,11 @@ msgstr "" " with gzip.open('/home/joe/file.txt.gz', 'wb') as f_out:\n" " shutil.copyfileobj(f_in, f_out)" -#: library/gzip.rst:240 +#: library/gzip.rst:244 msgid "Example of how to GZIP compress a binary string::" msgstr "Παράδειγμα συμπίεσης μιας δυαδικής συμβολοσειράς σε μορφή GZIP::" -#: library/gzip.rst:242 +#: library/gzip.rst:246 msgid "" "import gzip\n" "s_in = b\"Lots of content here\"\n" @@ -504,11 +508,11 @@ msgstr "" "s_in = b\"Lots of content here\"\n" "s_out = gzip.compress(s_in)" -#: library/gzip.rst:248 +#: library/gzip.rst:252 msgid "Module :mod:`zlib`" msgstr "Module :mod:`zlib`" -#: library/gzip.rst:249 +#: library/gzip.rst:253 msgid "" "The basic data compression module needed to support the :program:`gzip` file " "format." @@ -516,11 +520,20 @@ msgstr "" "Το βασικό module συμπίεσης δεδομένων που απαιτείται για την υποστήριξη της " "μορφής αρχείου :program:`gzip`." -#: library/gzip.rst:258 +#: library/gzip.rst:256 +msgid "" +"In case gzip (de)compression is a bottleneck, the `python-isal`_ package " +"speeds up (de)compression with a mostly compatible API." +msgstr "" +"Σε περίπτωση που η (από)συμπίεση gzip είναι ένα σημείο συμφόρησης, το πακέτο " +"`python-isal`_ επιταχύνει την (από)συμπίεση με ένα ως επί το πλείστον " +"συμβατό API." + +#: library/gzip.rst:266 msgid "Command Line Interface" msgstr "Διεπαφή Γραμμής Εντολών" -#: library/gzip.rst:260 +#: library/gzip.rst:268 msgid "" "The :mod:`gzip` module provides a simple command line interface to compress " "or decompress files." @@ -528,12 +541,12 @@ msgstr "" "Το module :mod:`gzip` παρέχει μια απλή διεπαφή γραμμής εντολών για τη " "συμπίεση ή αποσυμπίεση αρχείων." -#: library/gzip.rst:263 +#: library/gzip.rst:271 msgid "Once executed the :mod:`gzip` module keeps the input file(s)." msgstr "" "Μόλις εκτελεστεί, το module :mod:`gzip` διατηρεί το(α) αρχείο(α) εισόδου." -#: library/gzip.rst:267 +#: library/gzip.rst:275 msgid "" "Add a new command line interface with a usage. By default, when you will " "execute the CLI, the default compression level is 6." @@ -541,27 +554,53 @@ msgstr "" "Προστέθηκε νέα διεπαφή γραμμής εντολών με οδηγίες χρήσης. Από προεπιλογή, " "όταν εκτελείτε την CLI, το προεπιλεγμένο επίπεδο συμπίεσης είναι 6." -#: library/gzip.rst:271 +#: library/gzip.rst:279 msgid "Command line options" msgstr "Επιλογές γραμμής εντολών" -#: library/gzip.rst:275 +#: library/gzip.rst:283 msgid "If *file* is not specified, read from :data:`sys.stdin`." msgstr "" "Εάν δεν καθοριστεί το *file*, η ανάγνωση γίνεται από το :data:`sys.stdin`." -#: library/gzip.rst:279 +#: library/gzip.rst:287 msgid "Indicates the fastest compression method (less compression)." msgstr "Δηλώνει τη γρηγορότερη μέθοδο συμπίεσης (λιγότερη συμπίεση)." -#: library/gzip.rst:283 +#: library/gzip.rst:291 msgid "Indicates the slowest compression method (best compression)." msgstr "Δηλώνει την βραδύτερη μέθοδο συμπίεσης (καλύτερη συμπίεση)." -#: library/gzip.rst:287 +#: library/gzip.rst:295 msgid "Decompress the given file." msgstr "Αποσυμπιέζει το δοσμένο αρχείο." -#: library/gzip.rst:291 +#: library/gzip.rst:299 msgid "Show the help message." msgstr "Εμφανίζει το μήνυμα βοήθειας." + +#~ msgid "" +#~ "The *mtime* argument is an optional numeric timestamp to be written to " +#~ "the last modification time field in the stream when compressing. It " +#~ "should only be provided in compression mode. If omitted or ``None``, the " +#~ "current time is used. See the :attr:`mtime` attribute for more details." +#~ msgstr "" +#~ "Η παράμετρος *mtime* είναι ένας προαιρετικός αριθμητικός χρονικός δείκτης " +#~ "που γράφεται στο πεδίο τελευταίας τροποποίησης στη ροή κατά τη συμπίεση. " +#~ "Πρέπει να παράγεται μόνο σε λειτουργία συμπίεσης. Αν παραλειφθεί ή είναι " +#~ "``None``, χρησιμοποιείται η τρέχουσα χρονική στιγμή. Δείτε το " +#~ "χαρακτηριστικό :attr:`mtime` για περισσότερες λεπτομέρειες." + +#~ msgid "" +#~ "All :program:`gzip` compressed streams are required to contain this " +#~ "timestamp field. Some programs, such as :program:`gunzip`\\ , make use " +#~ "of the timestamp. The format is the same as the return value of :func:" +#~ "`time.time` and the :attr:`~os.stat_result.st_mtime` attribute of the " +#~ "object returned by :func:`os.stat`." +#~ msgstr "" +#~ "Όλες οι συμπιεσμένες ροές :program:`gzip` απαιτείται να περιέχουν αυτό το " +#~ "πεδίο χρονικής σήμανσης. Ορισμένα προγράμματα, όπως το :program:`gunzip`, " +#~ "χρησιμοποιούν αυτήν τη χρονική σήμανση. Η μορφή της είναι ίδια με την " +#~ "τιμή που επιστρέφει η συνάρτηση :func:`time.time` και το χαρακτηριστικό :" +#~ "attr:`~os.stat_result.st_mtime` του αντικειμένου που επιστρέφει η " +#~ "συνάρτηση :func:`os.stat`." diff --git a/library/hashlib.po b/library/hashlib.po index 476a0984..801a60ee 100644 --- a/library/hashlib.po +++ b/library/hashlib.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -27,26 +27,24 @@ msgstr "" #: library/hashlib.rst:23 msgid "" -"This module implements a common interface to many different secure hash and " -"message digest algorithms. Included are the FIPS secure hash algorithms " -"SHA1, SHA224, SHA256, SHA384, SHA512, (defined in `the FIPS 180-4 " -"standard`_), the SHA-3 series (defined in `the FIPS 202 standard`_) as well " -"as RSA's MD5 algorithm (defined in internet :rfc:`1321`). The terms " -"\"secure hash\" and \"message digest\" are interchangeable. Older " -"algorithms were called message digests. The modern term is secure hash." +"This module implements a common interface to many different hash algorithms. " +"Included are the FIPS secure hash algorithms SHA224, SHA256, SHA384, SHA512, " +"(defined in `the FIPS 180-4 standard`_), the SHA-3 series (defined in `the " +"FIPS 202 standard`_) as well as the legacy algorithms SHA1 (`formerly part " +"of FIPS`_) and the MD5 algorithm (defined in internet :rfc:`1321`)." msgstr "" -#: library/hashlib.rst:33 +#: library/hashlib.rst:31 msgid "" "If you want the adler32 or crc32 hash functions, they are available in the :" "mod:`zlib` module." msgstr "" -#: library/hashlib.rst:40 +#: library/hashlib.rst:38 msgid "Hash algorithms" msgstr "" -#: library/hashlib.rst:42 +#: library/hashlib.rst:40 msgid "" "There is one constructor method named for each type of :dfn:`hash`. All " "return a hash object with the same simple interface. For example: use :func:" @@ -58,14 +56,14 @@ msgid "" "hexdigest>` methods." msgstr "" -#: library/hashlib.rst:50 +#: library/hashlib.rst:48 msgid "" "To allow multithreading, the Python :term:`GIL` is released while computing " "a hash supplied more than 2047 bytes of data at once in its constructor or :" "meth:`.update` method." msgstr "" -#: library/hashlib.rst:57 +#: library/hashlib.rst:55 msgid "" "Constructors for hash algorithms that are always present in this module are :" "func:`sha1`, :func:`sha224`, :func:`sha256`, :func:`sha384`, :func:" @@ -76,7 +74,7 @@ msgid "" "Python. These correspond to :data:`algorithms_guaranteed`." msgstr "" -#: library/hashlib.rst:65 +#: library/hashlib.rst:63 msgid "" "Additional algorithms may also be available if your Python distribution's :" "mod:`hashlib` was linked against a build of OpenSSL that provides others. " @@ -84,21 +82,21 @@ msgid "" "accessible by name via :func:`new`. See :data:`algorithms_available`." msgstr "" -#: library/hashlib.rst:72 +#: library/hashlib.rst:70 msgid "" "Some algorithms have known hash collision weaknesses (including MD5 and " "SHA1). Refer to `Attacks on cryptographic hash algorithms`_ and the `hashlib-" "seealso`_ section at the end of this document." msgstr "" -#: library/hashlib.rst:76 +#: library/hashlib.rst:74 msgid "" "SHA3 (Keccak) and SHAKE constructors :func:`sha3_224`, :func:`sha3_256`, :" "func:`sha3_384`, :func:`sha3_512`, :func:`shake_128`, :func:`shake_256` were " "added. :func:`blake2b` and :func:`blake2s` were added." msgstr "" -#: library/hashlib.rst:84 +#: library/hashlib.rst:82 msgid "" "All hashlib constructors take a keyword-only argument *usedforsecurity* with " "default value ``True``. A false value allows the use of insecure and blocked " @@ -107,28 +105,28 @@ msgid "" "cryptographic one-way compression function." msgstr "" -#: library/hashlib.rst:91 +#: library/hashlib.rst:89 msgid "Hashlib now uses SHA3 and SHAKE from OpenSSL if it provides it." msgstr "" -#: library/hashlib.rst:94 +#: library/hashlib.rst:92 msgid "" "For any of the MD5, SHA1, SHA2, or SHA3 algorithms that the linked OpenSSL " "does not provide we fall back to a verified implementation from the `HACL\\* " "project`_." msgstr "" -#: library/hashlib.rst:100 +#: library/hashlib.rst:98 msgid "Usage" msgstr "" -#: library/hashlib.rst:102 +#: library/hashlib.rst:100 msgid "" "To obtain the digest of the byte string ``b\"Nobody inspects the spammish " "repetition\"``::" msgstr "" -#: library/hashlib.rst:105 +#: library/hashlib.rst:103 msgid "" ">>> import hashlib\n" ">>> m = hashlib.sha256()\n" @@ -142,15 +140,15 @@ msgid "" "'031edd7d41651593c5fe5c006fa5752b37fddff7bc4e843aa6af0c950f4b9406'" msgstr "" -#: library/hashlib.rst:114 +#: library/hashlib.rst:112 msgid "More condensed:" msgstr "" -#: library/hashlib.rst:120 +#: library/hashlib.rst:118 msgid "Constructors" msgstr "" -#: library/hashlib.rst:124 +#: library/hashlib.rst:122 msgid "" "Is a generic constructor that takes the string *name* of the desired " "algorithm as its first parameter. It also exists to allow access to the " @@ -158,25 +156,25 @@ msgid "" "library may offer." msgstr "" -#: library/hashlib.rst:129 +#: library/hashlib.rst:127 msgid "Using :func:`new` with an algorithm name:" msgstr "" -#: library/hashlib.rst:148 +#: library/hashlib.rst:146 msgid "" "Named constructors such as these are faster than passing an algorithm name " "to :func:`new`." msgstr "" -#: library/hashlib.rst:152 +#: library/hashlib.rst:150 msgid "Attributes" msgstr "" -#: library/hashlib.rst:154 +#: library/hashlib.rst:152 msgid "Hashlib provides the following constant module attributes:" msgstr "" -#: library/hashlib.rst:158 +#: library/hashlib.rst:156 msgid "" "A set containing the names of the hash algorithms guaranteed to be supported " "by this module on all platforms. Note that 'md5' is in this list despite " @@ -184,7 +182,7 @@ msgid "" "excludes it." msgstr "" -#: library/hashlib.rst:167 +#: library/hashlib.rst:165 msgid "" "A set containing the names of the hash algorithms that are available in the " "running Python interpreter. These names will be recognized when passed to :" @@ -193,77 +191,77 @@ msgid "" "(thanks to OpenSSL)." msgstr "" -#: library/hashlib.rst:176 +#: library/hashlib.rst:174 msgid "Hash Objects" msgstr "" -#: library/hashlib.rst:178 +#: library/hashlib.rst:176 msgid "" "The following values are provided as constant attributes of the hash objects " "returned by the constructors:" msgstr "" -#: library/hashlib.rst:183 +#: library/hashlib.rst:181 msgid "The size of the resulting hash in bytes." msgstr "" -#: library/hashlib.rst:187 +#: library/hashlib.rst:185 msgid "The internal block size of the hash algorithm in bytes." msgstr "" -#: library/hashlib.rst:189 +#: library/hashlib.rst:187 msgid "A hash object has the following attributes:" msgstr "" -#: library/hashlib.rst:193 +#: library/hashlib.rst:191 msgid "" "The canonical name of this hash, always lowercase and always suitable as a " "parameter to :func:`new` to create another hash of this type." msgstr "" -#: library/hashlib.rst:196 +#: library/hashlib.rst:194 msgid "" "The name attribute has been present in CPython since its inception, but " "until Python 3.4 was not formally specified, so may not exist on some " "platforms." msgstr "" -#: library/hashlib.rst:201 +#: library/hashlib.rst:199 msgid "A hash object has the following methods:" msgstr "" -#: library/hashlib.rst:206 +#: library/hashlib.rst:204 msgid "" "Update the hash object with the :term:`bytes-like object`. Repeated calls " "are equivalent to a single call with the concatenation of all the arguments: " "``m.update(a); m.update(b)`` is equivalent to ``m.update(a+b)``." msgstr "" -#: library/hashlib.rst:214 +#: library/hashlib.rst:212 msgid "" "Return the digest of the data passed to the :meth:`update` method so far. " "This is a bytes object of size :attr:`digest_size` which may contain bytes " "in the whole range from 0 to 255." msgstr "" -#: library/hashlib.rst:221 +#: library/hashlib.rst:219 msgid "" "Like :meth:`digest` except the digest is returned as a string object of " "double length, containing only hexadecimal digits. This may be used to " "exchange the value safely in email or other non-binary environments." msgstr "" -#: library/hashlib.rst:228 +#: library/hashlib.rst:226 msgid "" "Return a copy (\"clone\") of the hash object. This can be used to " "efficiently compute the digests of data sharing a common initial substring." msgstr "" -#: library/hashlib.rst:233 +#: library/hashlib.rst:231 msgid "SHAKE variable length digests" msgstr "" -#: library/hashlib.rst:238 +#: library/hashlib.rst:236 msgid "" "The :func:`shake_128` and :func:`shake_256` algorithms provide variable " "length digests with length_in_bits//2 up to 128 or 256 bits of security. As " @@ -271,65 +269,77 @@ msgid "" "by the SHAKE algorithm." msgstr "" -#: library/hashlib.rst:245 +#: library/hashlib.rst:243 msgid "" "Return the digest of the data passed to the :meth:`~hash.update` method so " "far. This is a bytes object of size *length* which may contain bytes in the " "whole range from 0 to 255." msgstr "" -#: library/hashlib.rst:252 +#: library/hashlib.rst:250 msgid "" "Like :meth:`digest` except the digest is returned as a string object of " "double length, containing only hexadecimal digits. This may be used to " "exchange the value in email or other non-binary environments." msgstr "" -#: library/hashlib.rst:256 +#: library/hashlib.rst:254 msgid "Example use:" msgstr "" -#: library/hashlib.rst:263 +#: library/hashlib.rst:261 msgid "File hashing" msgstr "" -#: library/hashlib.rst:265 +#: library/hashlib.rst:263 msgid "" "The hashlib module provides a helper function for efficient hashing of a " "file or file-like object." msgstr "" -#: library/hashlib.rst:270 +#: library/hashlib.rst:268 msgid "" "Return a digest object that has been updated with contents of file object." msgstr "" -#: library/hashlib.rst:272 +#: library/hashlib.rst:270 msgid "" "*fileobj* must be a file-like object opened for reading in binary mode. It " "accepts file objects from builtin :func:`open`, :class:`~io.BytesIO` " "instances, SocketIO objects from :meth:`socket.socket.makefile`, and " -"similar. The function may bypass Python's I/O and use the file descriptor " -"from :meth:`~io.IOBase.fileno` directly. *fileobj* must be assumed to be in " -"an unknown state after this function returns or raises. It is up to the " -"caller to close *fileobj*." +"similar. *fileobj* must be opened in blocking mode, otherwise a :exc:" +"`BlockingIOError` may be raised." msgstr "" -#: library/hashlib.rst:280 +#: library/hashlib.rst:276 +msgid "" +"The function may bypass Python's I/O and use the file descriptor from :meth:" +"`~io.IOBase.fileno` directly. *fileobj* must be assumed to be in an unknown " +"state after this function returns or raises. It is up to the caller to close " +"*fileobj*." +msgstr "" + +#: library/hashlib.rst:281 msgid "" "*digest* must either be a hash algorithm name as a *str*, a hash " "constructor, or a callable that returns a hash object." msgstr "" -#: library/hashlib.rst:283 +#: library/hashlib.rst:284 msgid "Example:" msgstr "" -#: library/hashlib.rst:306 +#: library/hashlib.rst:305 +msgid "" +"Now raises a :exc:`BlockingIOError` if the file is opened in blocking mode. " +"Previously, spurious null bytes were added to the digest." +msgstr "" + +#: library/hashlib.rst:311 msgid "Key derivation" msgstr "" -#: library/hashlib.rst:308 +#: library/hashlib.rst:313 msgid "" "Key derivation and key stretching algorithms are designed for secure " "password hashing. Naive algorithms such as ``sha1(password)`` are not " @@ -338,13 +348,13 @@ msgid "" "Salt_%28cryptography%29>`_." msgstr "" -#: library/hashlib.rst:316 +#: library/hashlib.rst:321 msgid "" "The function provides PKCS#5 password-based key derivation function 2. It " "uses HMAC as pseudorandom function." msgstr "" -#: library/hashlib.rst:319 +#: library/hashlib.rst:324 msgid "" "The string *hash_name* is the desired name of the hash digest algorithm for " "HMAC, e.g. 'sha1' or 'sha256'. *password* and *salt* are interpreted as " @@ -353,7 +363,7 @@ msgid "" "proper source, e.g. :func:`os.urandom`." msgstr "" -#: library/hashlib.rst:325 +#: library/hashlib.rst:330 msgid "" "The number of *iterations* should be chosen based on the hash algorithm and " "computing power. As of 2022, hundreds of thousands of iterations of SHA-256 " @@ -362,30 +372,30 @@ msgid "" "the `stackexchange pbkdf2 iterations question`_ explain in detail." msgstr "" -#: library/hashlib.rst:331 +#: library/hashlib.rst:336 msgid "" "*dklen* is the length of the derived key in bytes. If *dklen* is ``None`` " "then the digest size of the hash algorithm *hash_name* is used, e.g. 64 for " "SHA-512." msgstr "" -#: library/hashlib.rst:340 +#: library/hashlib.rst:345 msgid "Function only available when Python is compiled with OpenSSL." msgstr "" -#: library/hashlib.rst:344 +#: library/hashlib.rst:349 msgid "" "Function now only available when Python is built with OpenSSL. The slow pure " "Python implementation has been removed." msgstr "" -#: library/hashlib.rst:350 +#: library/hashlib.rst:355 msgid "" "The function provides scrypt password-based key derivation function as " "defined in :rfc:`7914`." msgstr "" -#: library/hashlib.rst:353 +#: library/hashlib.rst:358 msgid "" "*password* and *salt* must be :term:`bytes-like objects `. Applications and libraries should limit *password* to a sensible " @@ -393,138 +403,138 @@ msgid "" "source, e.g. :func:`os.urandom`." msgstr "" -#: library/hashlib.rst:358 +#: library/hashlib.rst:363 msgid "" "*n* is the CPU/Memory cost factor, *r* the block size, *p* parallelization " "factor and *maxmem* limits memory (OpenSSL 1.1.0 defaults to 32 MiB). " "*dklen* is the length of the derived key in bytes." msgstr "" -#: library/hashlib.rst:366 +#: library/hashlib.rst:373 msgid "BLAKE2" msgstr "" -#: library/hashlib.rst:373 +#: library/hashlib.rst:380 msgid "" "BLAKE2_ is a cryptographic hash function defined in :rfc:`7693` that comes " "in two flavors:" msgstr "" -#: library/hashlib.rst:376 +#: library/hashlib.rst:383 msgid "" "**BLAKE2b**, optimized for 64-bit platforms and produces digests of any size " "between 1 and 64 bytes," msgstr "" -#: library/hashlib.rst:379 +#: library/hashlib.rst:386 msgid "" "**BLAKE2s**, optimized for 8- to 32-bit platforms and produces digests of " "any size between 1 and 32 bytes." msgstr "" -#: library/hashlib.rst:382 +#: library/hashlib.rst:389 msgid "" "BLAKE2 supports **keyed mode** (a faster and simpler replacement for HMAC_), " "**salted hashing**, **personalization**, and **tree hashing**." msgstr "" -#: library/hashlib.rst:385 +#: library/hashlib.rst:392 msgid "" "Hash objects from this module follow the API of standard library's :mod:" "`hashlib` objects." msgstr "" -#: library/hashlib.rst:390 +#: library/hashlib.rst:397 msgid "Creating hash objects" msgstr "" -#: library/hashlib.rst:392 +#: library/hashlib.rst:399 msgid "New hash objects are created by calling constructor functions:" msgstr "" -#: library/hashlib.rst:406 +#: library/hashlib.rst:413 msgid "" "These functions return the corresponding hash objects for calculating " "BLAKE2b or BLAKE2s. They optionally take these general parameters:" msgstr "" -#: library/hashlib.rst:409 +#: library/hashlib.rst:416 msgid "" "*data*: initial chunk of data to hash, which must be :term:`bytes-like " "object`. It can be passed only as positional argument." msgstr "" -#: library/hashlib.rst:412 +#: library/hashlib.rst:419 msgid "*digest_size*: size of output digest in bytes." msgstr "" -#: library/hashlib.rst:414 +#: library/hashlib.rst:421 msgid "" "*key*: key for keyed hashing (up to 64 bytes for BLAKE2b, up to 32 bytes for " "BLAKE2s)." msgstr "" -#: library/hashlib.rst:417 +#: library/hashlib.rst:424 msgid "" "*salt*: salt for randomized hashing (up to 16 bytes for BLAKE2b, up to 8 " "bytes for BLAKE2s)." msgstr "" -#: library/hashlib.rst:420 +#: library/hashlib.rst:427 msgid "" "*person*: personalization string (up to 16 bytes for BLAKE2b, up to 8 bytes " "for BLAKE2s)." msgstr "" -#: library/hashlib.rst:423 +#: library/hashlib.rst:430 msgid "The following table shows limits for general parameters (in bytes):" msgstr "" -#: library/hashlib.rst:426 +#: library/hashlib.rst:433 msgid "Hash" msgstr "" -#: library/hashlib.rst:426 +#: library/hashlib.rst:433 msgid "digest_size" msgstr "" -#: library/hashlib.rst:426 +#: library/hashlib.rst:433 msgid "len(key)" msgstr "" -#: library/hashlib.rst:426 +#: library/hashlib.rst:433 msgid "len(salt)" msgstr "" -#: library/hashlib.rst:426 +#: library/hashlib.rst:433 msgid "len(person)" msgstr "" -#: library/hashlib.rst:428 +#: library/hashlib.rst:435 msgid "BLAKE2b" msgstr "" -#: library/hashlib.rst:428 +#: library/hashlib.rst:435 msgid "64" msgstr "" -#: library/hashlib.rst:428 +#: library/hashlib.rst:435 msgid "16" msgstr "" -#: library/hashlib.rst:429 +#: library/hashlib.rst:436 msgid "BLAKE2s" msgstr "" -#: library/hashlib.rst:429 +#: library/hashlib.rst:436 msgid "32" msgstr "" -#: library/hashlib.rst:429 +#: library/hashlib.rst:436 msgid "8" msgstr "" -#: library/hashlib.rst:434 +#: library/hashlib.rst:441 msgid "" "BLAKE2 specification defines constant lengths for salt and personalization " "parameters, however, for convenience, this implementation accepts byte " @@ -534,94 +544,94 @@ msgid "" "the case for *key*.)" msgstr "" -#: library/hashlib.rst:441 +#: library/hashlib.rst:448 msgid "These sizes are available as module `constants`_ described below." msgstr "" -#: library/hashlib.rst:443 +#: library/hashlib.rst:450 msgid "" "Constructor functions also accept the following tree hashing parameters:" msgstr "" -#: library/hashlib.rst:445 +#: library/hashlib.rst:452 msgid "*fanout*: fanout (0 to 255, 0 if unlimited, 1 in sequential mode)." msgstr "" -#: library/hashlib.rst:447 +#: library/hashlib.rst:454 msgid "" "*depth*: maximal depth of tree (1 to 255, 255 if unlimited, 1 in sequential " "mode)." msgstr "" -#: library/hashlib.rst:450 +#: library/hashlib.rst:457 msgid "" "*leaf_size*: maximal byte length of leaf (0 to ``2**32-1``, 0 if unlimited " "or in sequential mode)." msgstr "" -#: library/hashlib.rst:453 +#: library/hashlib.rst:460 msgid "" "*node_offset*: node offset (0 to ``2**64-1`` for BLAKE2b, 0 to ``2**48-1`` " "for BLAKE2s, 0 for the first, leftmost, leaf, or in sequential mode)." msgstr "" -#: library/hashlib.rst:456 +#: library/hashlib.rst:463 msgid "" "*node_depth*: node depth (0 to 255, 0 for leaves, or in sequential mode)." msgstr "" -#: library/hashlib.rst:458 +#: library/hashlib.rst:465 msgid "" "*inner_size*: inner digest size (0 to 64 for BLAKE2b, 0 to 32 for BLAKE2s, 0 " "in sequential mode)." msgstr "" -#: library/hashlib.rst:461 +#: library/hashlib.rst:468 msgid "" "*last_node*: boolean indicating whether the processed node is the last one " "(``False`` for sequential mode)." msgstr "" -#: library/hashlib.rst:464 +#: library/hashlib.rst:471 msgid "Explanation of tree mode parameters." msgstr "" -#: library/hashlib.rst:468 +#: library/hashlib.rst:475 msgid "" "See section 2.10 in `BLAKE2 specification `_ for comprehensive review of tree hashing." msgstr "" -#: library/hashlib.rst:474 +#: library/hashlib.rst:481 msgid "Constants" msgstr "" -#: library/hashlib.rst:479 +#: library/hashlib.rst:486 msgid "Salt length (maximum length accepted by constructors)." msgstr "" -#: library/hashlib.rst:485 +#: library/hashlib.rst:492 msgid "" "Personalization string length (maximum length accepted by constructors)." msgstr "" -#: library/hashlib.rst:491 +#: library/hashlib.rst:498 msgid "Maximum key size." msgstr "" -#: library/hashlib.rst:497 +#: library/hashlib.rst:504 msgid "Maximum digest size that the hash function can output." msgstr "" -#: library/hashlib.rst:501 +#: library/hashlib.rst:508 msgid "Examples" msgstr "" -#: library/hashlib.rst:504 +#: library/hashlib.rst:511 msgid "Simple hashing" msgstr "" -#: library/hashlib.rst:506 +#: library/hashlib.rst:513 msgid "" "To calculate hash of some data, you should first construct a hash object by " "calling the appropriate constructor function (:func:`blake2b` or :func:" @@ -630,41 +640,41 @@ msgid "" "`~hash.digest` (or :meth:`~hash.hexdigest` for hex-encoded string)." msgstr "" -#: library/hashlib.rst:519 +#: library/hashlib.rst:526 msgid "" "As a shortcut, you can pass the first chunk of data to update directly to " "the constructor as the positional argument:" msgstr "" -#: library/hashlib.rst:526 +#: library/hashlib.rst:533 msgid "" "You can call :meth:`hash.update` as many times as you need to iteratively " "update the hash:" msgstr "" -#: library/hashlib.rst:540 +#: library/hashlib.rst:547 msgid "Using different digest sizes" msgstr "" -#: library/hashlib.rst:542 +#: library/hashlib.rst:549 msgid "" "BLAKE2 has configurable size of digests up to 64 bytes for BLAKE2b and up to " "32 bytes for BLAKE2s. For example, to replace SHA-1 with BLAKE2b without " "changing the size of output, we can tell BLAKE2b to produce 20-byte digests:" msgstr "" -#: library/hashlib.rst:556 +#: library/hashlib.rst:563 msgid "" "Hash objects with different digest sizes have completely different outputs " "(shorter hashes are *not* prefixes of longer hashes); BLAKE2b and BLAKE2s " "produce different outputs even if the output length is the same:" msgstr "" -#: library/hashlib.rst:572 +#: library/hashlib.rst:579 msgid "Keyed hashing" msgstr "" -#: library/hashlib.rst:574 +#: library/hashlib.rst:581 msgid "" "Keyed hashing can be used for authentication as a faster and simpler " "replacement for `Hash-based message authentication code >> from hashlib import blake2b\n" ">>> h = blake2b(key=b'pseudorandom key', digest_size=16)\n" @@ -687,13 +697,13 @@ msgid "" "'3d363ff7401e02026f4a4687d4863ced'" msgstr "" -#: library/hashlib.rst:590 +#: library/hashlib.rst:597 msgid "" "As a practical example, a web application can symmetrically sign cookies " "sent to users and later verify them to make sure they weren't tampered with::" msgstr "" -#: library/hashlib.rst:593 +#: library/hashlib.rst:600 msgid "" ">>> from hashlib import blake2b\n" ">>> from hmac import compare_digest\n" @@ -722,13 +732,13 @@ msgid "" "False" msgstr "" -#: library/hashlib.rst:619 +#: library/hashlib.rst:626 msgid "" "Even though there's a native keyed hashing mode, BLAKE2 can, of course, be " "used in HMAC construction with :mod:`hmac` module::" msgstr "" -#: library/hashlib.rst:622 +#: library/hashlib.rst:629 msgid "" ">>> import hmac, hashlib\n" ">>> m = hmac.new(b'secret key', digestmod=hashlib.blake2s)\n" @@ -737,18 +747,18 @@ msgid "" "'e3c8102868d28b5ff85fc35dda07329970d1a01e273c37481326fe0c861c8142'" msgstr "" -#: library/hashlib.rst:630 +#: library/hashlib.rst:637 msgid "Randomized hashing" msgstr "" -#: library/hashlib.rst:632 +#: library/hashlib.rst:639 msgid "" "By setting *salt* parameter users can introduce randomization to the hash " "function. Randomized hashing is useful for protecting against collision " "attacks on the hash function used in digital signatures." msgstr "" -#: library/hashlib.rst:636 +#: library/hashlib.rst:643 msgid "" "Randomized hashing is designed for situations where one party, the message " "preparer, generates all or part of a message to be signed by a second party, " @@ -769,19 +779,19 @@ msgid "" "when all portions of the message are prepared by the signer." msgstr "" -#: library/hashlib.rst:655 +#: library/hashlib.rst:662 msgid "" "(`NIST SP-800-106 \"Randomized Hashing for Digital Signatures\" `_)" msgstr "" -#: library/hashlib.rst:658 +#: library/hashlib.rst:665 msgid "" "In BLAKE2 the salt is processed as a one-time input to the hash function " "during initialization, rather than as an input to each compression function." msgstr "" -#: library/hashlib.rst:663 +#: library/hashlib.rst:670 msgid "" "*Salted hashing* (or just hashing) with BLAKE2 or any other general-purpose " "cryptographic hash function, such as SHA-256, is not suitable for hashing " @@ -789,18 +799,18 @@ msgid "" "information." msgstr "" -#: library/hashlib.rst:686 +#: library/hashlib.rst:693 msgid "Personalization" msgstr "" -#: library/hashlib.rst:688 +#: library/hashlib.rst:695 msgid "" "Sometimes it is useful to force hash function to produce different digests " "for the same input for different purposes. Quoting the authors of the Skein " "hash function:" msgstr "" -#: library/hashlib.rst:692 +#: library/hashlib.rst:699 msgid "" "We recommend that all application designers seriously consider doing this; " "we have seen many protocols where a hash that is computed in one part of the " @@ -810,17 +820,17 @@ msgid "" "hash function used in the protocol summarily stops this type of attack." msgstr "" -#: library/hashlib.rst:699 +#: library/hashlib.rst:706 msgid "" "(`The Skein Hash Function Family `_, p. 21)" msgstr "" -#: library/hashlib.rst:703 +#: library/hashlib.rst:710 msgid "BLAKE2 can be personalized by passing bytes to the *person* argument::" msgstr "" -#: library/hashlib.rst:705 +#: library/hashlib.rst:712 msgid "" ">>> from hashlib import blake2b\n" ">>> FILES_HASH_PERSON = b'MyApp Files Hash'\n" @@ -835,34 +845,34 @@ msgid "" "'cf68fb5761b9c44e7878bfb2c4c9aea52264a80b75005e65619778de59f383a3'" msgstr "" -#: library/hashlib.rst:717 +#: library/hashlib.rst:724 msgid "" "Personalization together with the keyed mode can also be used to derive " "different keys from a single one." msgstr "" -#: library/hashlib.rst:731 +#: library/hashlib.rst:738 msgid "Tree mode" msgstr "" -#: library/hashlib.rst:733 +#: library/hashlib.rst:740 msgid "Here's an example of hashing a minimal tree with two leaf nodes::" msgstr "" -#: library/hashlib.rst:735 +#: library/hashlib.rst:742 msgid "" " 10\n" " / \\\n" "00 01" msgstr "" -#: library/hashlib.rst:739 +#: library/hashlib.rst:746 msgid "" "This example uses 64-byte internal digests, and returns the 32-byte final " "digest::" msgstr "" -#: library/hashlib.rst:742 +#: library/hashlib.rst:749 msgid "" ">>> from hashlib import blake2b\n" ">>>\n" @@ -891,11 +901,11 @@ msgid "" "'3ad2a9b37c6070e374c7a8c508fe20ca86b6ed54e286e93a0318e95e881db5aa'" msgstr "" -#: library/hashlib.rst:769 +#: library/hashlib.rst:776 msgid "Credits" msgstr "" -#: library/hashlib.rst:771 +#: library/hashlib.rst:778 msgid "" "BLAKE2_ was designed by *Jean-Philippe Aumasson*, *Samuel Neves*, *Zooko " "Wilcox-O'Hearn*, and *Christian Winnerlein* based on SHA-3_ finalist BLAKE_ " @@ -903,118 +913,118 @@ msgid "" "*Raphael C.-W. Phan*." msgstr "" -#: library/hashlib.rst:776 +#: library/hashlib.rst:783 msgid "" "It uses core algorithm from ChaCha_ cipher designed by *Daniel J. " "Bernstein*." msgstr "" -#: library/hashlib.rst:778 +#: library/hashlib.rst:785 msgid "" "The stdlib implementation is based on pyblake2_ module. It was written by " "*Dmitry Chestnykh* based on C implementation written by *Samuel Neves*. The " "documentation was copied from pyblake2_ and written by *Dmitry Chestnykh*." msgstr "" -#: library/hashlib.rst:782 +#: library/hashlib.rst:789 msgid "The C code was partly rewritten for Python by *Christian Heimes*." msgstr "" -#: library/hashlib.rst:784 +#: library/hashlib.rst:791 msgid "" "The following public domain dedication applies for both C hash function " "implementation, extension code, and this documentation:" msgstr "" -#: library/hashlib.rst:787 +#: library/hashlib.rst:794 msgid "" "To the extent possible under law, the author(s) have dedicated all copyright " "and related and neighboring rights to this software to the public domain " "worldwide. This software is distributed without any warranty." msgstr "" -#: library/hashlib.rst:791 +#: library/hashlib.rst:798 msgid "" "You should have received a copy of the CC0 Public Domain Dedication along " "with this software. If not, see https://creativecommons.org/publicdomain/" "zero/1.0/." msgstr "" -#: library/hashlib.rst:795 +#: library/hashlib.rst:802 msgid "" "The following people have helped with development or contributed their " "changes to the project and the public domain according to the Creative " "Commons Public Domain Dedication 1.0 Universal:" msgstr "" -#: library/hashlib.rst:799 +#: library/hashlib.rst:806 msgid "*Alexandr Sokolovskiy*" msgstr "" -#: library/hashlib.rst:819 +#: library/hashlib.rst:827 msgid "Module :mod:`hmac`" msgstr "" -#: library/hashlib.rst:820 +#: library/hashlib.rst:828 msgid "A module to generate message authentication codes using hashes." msgstr "" -#: library/hashlib.rst:822 +#: library/hashlib.rst:830 msgid "Module :mod:`base64`" msgstr "" -#: library/hashlib.rst:823 +#: library/hashlib.rst:831 msgid "Another way to encode binary hashes for non-binary environments." msgstr "" -#: library/hashlib.rst:825 +#: library/hashlib.rst:833 msgid "https://nvlpubs.nist.gov/nistpubs/fips/nist.fips.180-4.pdf" msgstr "" -#: library/hashlib.rst:826 +#: library/hashlib.rst:834 msgid "The FIPS 180-4 publication on Secure Hash Algorithms." msgstr "" -#: library/hashlib.rst:828 +#: library/hashlib.rst:836 msgid "https://csrc.nist.gov/pubs/fips/202/final" msgstr "" -#: library/hashlib.rst:829 +#: library/hashlib.rst:837 msgid "The FIPS 202 publication on the SHA-3 Standard." msgstr "" -#: library/hashlib.rst:831 +#: library/hashlib.rst:839 msgid "https://www.blake2.net/" msgstr "" -#: library/hashlib.rst:832 +#: library/hashlib.rst:840 msgid "Official BLAKE2 website." msgstr "" -#: library/hashlib.rst:834 +#: library/hashlib.rst:842 msgid "https://en.wikipedia.org/wiki/Cryptographic_hash_function" msgstr "" -#: library/hashlib.rst:835 +#: library/hashlib.rst:843 msgid "" "Wikipedia article with information on which algorithms have known issues and " "what that means regarding their use." msgstr "" -#: library/hashlib.rst:838 +#: library/hashlib.rst:846 msgid "https://www.ietf.org/rfc/rfc8018.txt" msgstr "" -#: library/hashlib.rst:839 +#: library/hashlib.rst:847 msgid "PKCS #5: Password-Based Cryptography Specification Version 2.1" msgstr "" -#: library/hashlib.rst:841 +#: library/hashlib.rst:849 msgid "" "https://nvlpubs.nist.gov/nistpubs/Legacy/SP/nistspecialpublication800-132.pdf" msgstr "" -#: library/hashlib.rst:842 +#: library/hashlib.rst:850 msgid "NIST Recommendation for Password-Based Key Derivation." msgstr "" @@ -1028,14 +1038,14 @@ msgid "" "Shake, Blake2" msgstr "" -#: library/hashlib.rst:55 +#: library/hashlib.rst:53 msgid "OpenSSL" msgstr "" -#: library/hashlib.rst:55 +#: library/hashlib.rst:53 msgid "(use in module hashlib)" msgstr "" -#: library/hashlib.rst:370 +#: library/hashlib.rst:377 msgid "blake2b, blake2s" msgstr "" diff --git a/library/heapq.po b/library/heapq.po index a39e55e4..68e5629c 100644 --- a/library/heapq.po +++ b/library/heapq.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" diff --git a/library/hmac.po b/library/hmac.po index 60e845e2..e2d6ab70 100644 --- a/library/hmac.po +++ b/library/hmac.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" diff --git a/library/html.entities.po b/library/html.entities.po index 7dd1c128..da36c4fe 100644 --- a/library/html.entities.po +++ b/library/html.entities.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" diff --git a/library/html.parser.po b/library/html.parser.po index fdb53048..1fe798e8 100644 --- a/library/html.parser.po +++ b/library/html.parser.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" diff --git a/library/html.po b/library/html.po index 529f70ad..53b26f55 100644 --- a/library/html.po +++ b/library/html.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" diff --git a/library/http.client.po b/library/http.client.po index db4e04dc..4d4bd641 100644 --- a/library/http.client.po +++ b/library/http.client.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -50,9 +50,8 @@ msgstr "" #: includes/wasm-notavail.rst:5 msgid "" -"This module does not work or is not available on WebAssembly platforms " -"``wasm32-emscripten`` and ``wasm32-wasi``. See :ref:`wasm-availability` for " -"more information." +"This module does not work or is not available on WebAssembly. See :ref:`wasm-" +"availability` for more information." msgstr "" #: library/http.client.rst:33 diff --git a/library/http.cookiejar.po b/library/http.cookiejar.po index ab0d230d..ff90bac7 100644 --- a/library/http.cookiejar.po +++ b/library/http.cookiejar.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" diff --git a/library/http.cookies.po b/library/http.cookies.po index 58053d0c..c7b41fde 100644 --- a/library/http.cookies.po +++ b/library/http.cookies.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" diff --git a/library/http.po b/library/http.po index ad0e4e3d..209328f1 100644 --- a/library/http.po +++ b/library/http.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -65,7 +65,7 @@ msgid "" "reason phrases and long descriptions written in English." msgstr "" -#: library/http.rst:157 library/http.rst:171 +#: library/http.rst:161 library/http.rst:175 msgid "Usage::" msgstr "" @@ -101,11 +101,11 @@ msgstr "" msgid "Code" msgstr "" -#: library/http.rst:204 +#: library/http.rst:208 msgid "Enum Name" msgstr "" -#: library/http.rst:148 library/http.rst:204 +#: library/http.rst:152 library/http.rst:208 msgid "Details" msgstr "" @@ -118,7 +118,7 @@ msgid "``CONTINUE``" msgstr "" #: library/http.rst:62 -msgid "HTTP/1.1 :rfc:`7231`, Section 6.2.1" +msgid "HTTP Semantics :rfc:`9110`, Section 15.2.1" msgstr "" #: library/http.rst:63 @@ -130,7 +130,7 @@ msgid "``SWITCHING_PROTOCOLS``" msgstr "" #: library/http.rst:63 -msgid "HTTP/1.1 :rfc:`7231`, Section 6.2.2" +msgid "HTTP Semantics :rfc:`9110`, Section 15.2.2" msgstr "" #: library/http.rst:64 @@ -166,7 +166,7 @@ msgid "``OK``" msgstr "" #: library/http.rst:66 -msgid "HTTP/1.1 :rfc:`7231`, Section 6.3.1" +msgid "HTTP Semantics :rfc:`9110`, Section 15.3.1" msgstr "" #: library/http.rst:67 @@ -178,7 +178,7 @@ msgid "``CREATED``" msgstr "" #: library/http.rst:67 -msgid "HTTP/1.1 :rfc:`7231`, Section 6.3.2" +msgid "HTTP Semantics :rfc:`9110`, Section 15.3.2" msgstr "" #: library/http.rst:68 @@ -190,7 +190,7 @@ msgid "``ACCEPTED``" msgstr "" #: library/http.rst:68 -msgid "HTTP/1.1 :rfc:`7231`, Section 6.3.3" +msgid "HTTP Semantics :rfc:`9110`, Section 15.3.3" msgstr "" #: library/http.rst:69 @@ -202,7 +202,7 @@ msgid "``NON_AUTHORITATIVE_INFORMATION``" msgstr "" #: library/http.rst:69 -msgid "HTTP/1.1 :rfc:`7231`, Section 6.3.4" +msgid "HTTP Semantics :rfc:`9110`, Section 15.3.4" msgstr "" #: library/http.rst:70 @@ -214,7 +214,7 @@ msgid "``NO_CONTENT``" msgstr "" #: library/http.rst:70 -msgid "HTTP/1.1 :rfc:`7231`, Section 6.3.5" +msgid "HTTP Semantics :rfc:`9110`, Section 15.3.5" msgstr "" #: library/http.rst:71 @@ -226,7 +226,7 @@ msgid "``RESET_CONTENT``" msgstr "" #: library/http.rst:71 -msgid "HTTP/1.1 :rfc:`7231`, Section 6.3.6" +msgid "HTTP Semantics :rfc:`9110`, Section 15.3.6" msgstr "" #: library/http.rst:72 @@ -238,7 +238,7 @@ msgid "``PARTIAL_CONTENT``" msgstr "" #: library/http.rst:72 -msgid "HTTP/1.1 :rfc:`7233`, Section 4.1" +msgid "HTTP Semantics :rfc:`9110`, Section 15.3.7" msgstr "" #: library/http.rst:73 @@ -286,7 +286,7 @@ msgid "``MULTIPLE_CHOICES``" msgstr "" #: library/http.rst:76 -msgid "HTTP/1.1 :rfc:`7231`, Section 6.4.1" +msgid "HTTP Semantics :rfc:`9110`, Section 15.4.1" msgstr "" #: library/http.rst:77 @@ -298,7 +298,7 @@ msgid "``MOVED_PERMANENTLY``" msgstr "" #: library/http.rst:77 -msgid "HTTP/1.1 :rfc:`7231`, Section 6.4.2" +msgid "HTTP Semantics :rfc:`9110`, Section 15.4.2" msgstr "" #: library/http.rst:78 @@ -310,7 +310,7 @@ msgid "``FOUND``" msgstr "" #: library/http.rst:78 -msgid "HTTP/1.1 :rfc:`7231`, Section 6.4.3" +msgid "HTTP Semantics :rfc:`9110`, Section 15.4.3" msgstr "" #: library/http.rst:79 @@ -322,7 +322,7 @@ msgid "``SEE_OTHER``" msgstr "" #: library/http.rst:79 -msgid "HTTP/1.1 :rfc:`7231`, Section 6.4.4" +msgid "HTTP Semantics :rfc:`9110`, Section 15.4.4" msgstr "" #: library/http.rst:80 @@ -334,7 +334,7 @@ msgid "``NOT_MODIFIED``" msgstr "" #: library/http.rst:80 -msgid "HTTP/1.1 :rfc:`7232`, Section 4.1" +msgid "HTTP Semantics :rfc:`9110`, Section 15.4.5" msgstr "" #: library/http.rst:81 @@ -346,7 +346,7 @@ msgid "``USE_PROXY``" msgstr "" #: library/http.rst:81 -msgid "HTTP/1.1 :rfc:`7231`, Section 6.4.5" +msgid "HTTP Semantics :rfc:`9110`, Section 15.4.6" msgstr "" #: library/http.rst:82 @@ -358,7 +358,7 @@ msgid "``TEMPORARY_REDIRECT``" msgstr "" #: library/http.rst:82 -msgid "HTTP/1.1 :rfc:`7231`, Section 6.4.7" +msgid "HTTP Semantics :rfc:`9110`, Section 15.4.8" msgstr "" #: library/http.rst:83 @@ -370,7 +370,7 @@ msgid "``PERMANENT_REDIRECT``" msgstr "" #: library/http.rst:83 -msgid "Permanent Redirect :rfc:`7238`, Section 3 (Experimental)" +msgid "HTTP Semantics :rfc:`9110`, Section 15.4.9" msgstr "" #: library/http.rst:84 @@ -382,7 +382,7 @@ msgid "``BAD_REQUEST``" msgstr "" #: library/http.rst:84 -msgid "HTTP/1.1 :rfc:`7231`, Section 6.5.1" +msgid "HTTP Semantics :rfc:`9110`, Section 15.5.1" msgstr "" #: library/http.rst:85 @@ -394,7 +394,7 @@ msgid "``UNAUTHORIZED``" msgstr "" #: library/http.rst:85 -msgid "HTTP/1.1 Authentication :rfc:`7235`, Section 3.1" +msgid "HTTP Semantics :rfc:`9110`, Section 15.5.2" msgstr "" #: library/http.rst:86 @@ -406,7 +406,7 @@ msgid "``PAYMENT_REQUIRED``" msgstr "" #: library/http.rst:86 -msgid "HTTP/1.1 :rfc:`7231`, Section 6.5.2" +msgid "HTTP Semantics :rfc:`9110`, Section 15.5.3" msgstr "" #: library/http.rst:87 @@ -418,7 +418,7 @@ msgid "``FORBIDDEN``" msgstr "" #: library/http.rst:87 -msgid "HTTP/1.1 :rfc:`7231`, Section 6.5.3" +msgid "HTTP Semantics :rfc:`9110`, Section 15.5.4" msgstr "" #: library/http.rst:88 @@ -430,7 +430,7 @@ msgid "``NOT_FOUND``" msgstr "" #: library/http.rst:88 -msgid "HTTP/1.1 :rfc:`7231`, Section 6.5.4" +msgid "HTTP Semantics :rfc:`9110`, Section 15.5.5" msgstr "" #: library/http.rst:89 @@ -442,7 +442,7 @@ msgid "``METHOD_NOT_ALLOWED``" msgstr "" #: library/http.rst:89 -msgid "HTTP/1.1 :rfc:`7231`, Section 6.5.5" +msgid "HTTP Semantics :rfc:`9110`, Section 15.5.6" msgstr "" #: library/http.rst:90 @@ -454,7 +454,7 @@ msgid "``NOT_ACCEPTABLE``" msgstr "" #: library/http.rst:90 -msgid "HTTP/1.1 :rfc:`7231`, Section 6.5.6" +msgid "HTTP Semantics :rfc:`9110`, Section 15.5.7" msgstr "" #: library/http.rst:91 @@ -466,7 +466,7 @@ msgid "``PROXY_AUTHENTICATION_REQUIRED``" msgstr "" #: library/http.rst:91 -msgid "HTTP/1.1 Authentication :rfc:`7235`, Section 3.2" +msgid "HTTP Semantics :rfc:`9110`, Section 15.5.8" msgstr "" #: library/http.rst:92 @@ -478,7 +478,7 @@ msgid "``REQUEST_TIMEOUT``" msgstr "" #: library/http.rst:92 -msgid "HTTP/1.1 :rfc:`7231`, Section 6.5.7" +msgid "HTTP Semantics :rfc:`9110`, Section 15.5.9" msgstr "" #: library/http.rst:93 @@ -490,7 +490,7 @@ msgid "``CONFLICT``" msgstr "" #: library/http.rst:93 -msgid "HTTP/1.1 :rfc:`7231`, Section 6.5.8" +msgid "HTTP Semantics :rfc:`9110`, Section 15.5.10" msgstr "" #: library/http.rst:94 @@ -502,7 +502,7 @@ msgid "``GONE``" msgstr "" #: library/http.rst:94 -msgid "HTTP/1.1 :rfc:`7231`, Section 6.5.9" +msgid "HTTP Semantics :rfc:`9110`, Section 15.5.11" msgstr "" #: library/http.rst:95 @@ -514,7 +514,7 @@ msgid "``LENGTH_REQUIRED``" msgstr "" #: library/http.rst:95 -msgid "HTTP/1.1 :rfc:`7231`, Section 6.5.10" +msgid "HTTP Semantics :rfc:`9110`, Section 15.5.12" msgstr "" #: library/http.rst:96 @@ -526,7 +526,7 @@ msgid "``PRECONDITION_FAILED``" msgstr "" #: library/http.rst:96 -msgid "HTTP/1.1 :rfc:`7232`, Section 4.2" +msgid "HTTP Semantics :rfc:`9110`, Section 15.5.13" msgstr "" #: library/http.rst:97 @@ -534,11 +534,11 @@ msgid "``413``" msgstr "" #: library/http.rst:97 -msgid "``REQUEST_ENTITY_TOO_LARGE``" +msgid "``CONTENT_TOO_LARGE``" msgstr "" #: library/http.rst:97 -msgid "HTTP/1.1 :rfc:`7231`, Section 6.5.11" +msgid "HTTP Semantics :rfc:`9110`, Section 15.5.14" msgstr "" #: library/http.rst:98 @@ -546,11 +546,11 @@ msgid "``414``" msgstr "" #: library/http.rst:98 -msgid "``REQUEST_URI_TOO_LONG``" +msgid "``URI_TOO_LONG``" msgstr "" #: library/http.rst:98 -msgid "HTTP/1.1 :rfc:`7231`, Section 6.5.12" +msgid "HTTP Semantics :rfc:`9110`, Section 15.5.15" msgstr "" #: library/http.rst:99 @@ -562,7 +562,7 @@ msgid "``UNSUPPORTED_MEDIA_TYPE``" msgstr "" #: library/http.rst:99 -msgid "HTTP/1.1 :rfc:`7231`, Section 6.5.13" +msgid "HTTP Semantics :rfc:`9110`, Section 15.5.16" msgstr "" #: library/http.rst:100 @@ -570,11 +570,11 @@ msgid "``416``" msgstr "" #: library/http.rst:100 -msgid "``REQUESTED_RANGE_NOT_SATISFIABLE``" +msgid "``RANGE_NOT_SATISFIABLE``" msgstr "" #: library/http.rst:100 -msgid "HTTP/1.1 Range Requests :rfc:`7233`, Section 4.4" +msgid "HTTP Semantics :rfc:`9110`, Section 15.5.17" msgstr "" #: library/http.rst:101 @@ -586,7 +586,7 @@ msgid "``EXPECTATION_FAILED``" msgstr "" #: library/http.rst:101 -msgid "HTTP/1.1 :rfc:`7231`, Section 6.5.14" +msgid "HTTP Semantics :rfc:`9110`, Section 15.5.18" msgstr "" #: library/http.rst:102 @@ -610,7 +610,7 @@ msgid "``MISDIRECTED_REQUEST``" msgstr "" #: library/http.rst:103 -msgid "HTTP/2 :rfc:`7540`, Section 9.1.2" +msgid "HTTP Semantics :rfc:`9110`, Section 15.5.20" msgstr "" #: library/http.rst:104 @@ -618,11 +618,11 @@ msgid "``422``" msgstr "" #: library/http.rst:104 -msgid "``UNPROCESSABLE_ENTITY``" +msgid "``UNPROCESSABLE_CONTENT``" msgstr "" #: library/http.rst:104 -msgid "WebDAV :rfc:`4918`, Section 11.2" +msgid "HTTP Semantics :rfc:`9110`, Section 15.5.21" msgstr "" #: library/http.rst:105 @@ -670,7 +670,7 @@ msgid "``UPGRADE_REQUIRED``" msgstr "" #: library/http.rst:108 -msgid "HTTP/1.1 :rfc:`7231`, Section 6.5.15" +msgid "HTTP Semantics :rfc:`9110`, Section 15.5.22" msgstr "" #: library/http.rst:109 @@ -722,7 +722,7 @@ msgid "``INTERNAL_SERVER_ERROR``" msgstr "" #: library/http.rst:113 -msgid "HTTP/1.1 :rfc:`7231`, Section 6.6.1" +msgid "HTTP Semantics :rfc:`9110`, Section 15.6.1" msgstr "" #: library/http.rst:114 @@ -734,7 +734,7 @@ msgid "``NOT_IMPLEMENTED``" msgstr "" #: library/http.rst:114 -msgid "HTTP/1.1 :rfc:`7231`, Section 6.6.2" +msgid "HTTP Semantics :rfc:`9110`, Section 15.6.2" msgstr "" #: library/http.rst:115 @@ -746,7 +746,7 @@ msgid "``BAD_GATEWAY``" msgstr "" #: library/http.rst:115 -msgid "HTTP/1.1 :rfc:`7231`, Section 6.6.3" +msgid "HTTP Semantics :rfc:`9110`, Section 15.6.3" msgstr "" #: library/http.rst:116 @@ -758,7 +758,7 @@ msgid "``SERVICE_UNAVAILABLE``" msgstr "" #: library/http.rst:116 -msgid "HTTP/1.1 :rfc:`7231`, Section 6.6.4" +msgid "HTTP Semantics :rfc:`9110`, Section 15.6.4" msgstr "" #: library/http.rst:117 @@ -770,7 +770,7 @@ msgid "``GATEWAY_TIMEOUT``" msgstr "" #: library/http.rst:117 -msgid "HTTP/1.1 :rfc:`7231`, Section 6.6.5" +msgid "HTTP Semantics :rfc:`9110`, Section 15.6.5" msgstr "" #: library/http.rst:118 @@ -782,7 +782,7 @@ msgid "``HTTP_VERSION_NOT_SUPPORTED``" msgstr "" #: library/http.rst:118 -msgid "HTTP/1.1 :rfc:`7231`, Section 6.6.6" +msgid "HTTP Semantics :rfc:`9110`, Section 15.6.6" msgstr "" #: library/http.rst:119 @@ -869,68 +869,74 @@ msgid "" "codes." msgstr "" -#: library/http.rst:141 -msgid "HTTP status category" +#: library/http.rst:140 +msgid "" +"Implemented RFC9110 naming for status constants. Old constant names are " +"preserved for backwards compatibility." msgstr "" #: library/http.rst:145 +msgid "HTTP status category" +msgstr "" + +#: library/http.rst:149 msgid "" "The enum values have several properties to indicate the HTTP status category:" msgstr "" -#: library/http.rst:148 +#: library/http.rst:152 msgid "Property" msgstr "" -#: library/http.rst:148 +#: library/http.rst:152 msgid "Indicates that" msgstr "" -#: library/http.rst:150 +#: library/http.rst:154 msgid "``is_informational``" msgstr "" -#: library/http.rst:150 +#: library/http.rst:154 msgid "``100 <= status <= 199``" msgstr "" -#: library/http.rst:151 library/http.rst:153 library/http.rst:154 -msgid "HTTP/1.1 :rfc:`7231`, Section 6" +#: library/http.rst:155 library/http.rst:157 library/http.rst:158 +msgid "HTTP Semantics :rfc:`9110`, Section 15" msgstr "" -#: library/http.rst:151 +#: library/http.rst:155 msgid "``is_success``" msgstr "" -#: library/http.rst:151 +#: library/http.rst:155 msgid "``200 <= status <= 299``" msgstr "" -#: library/http.rst:152 +#: library/http.rst:156 msgid "``is_redirection``" msgstr "" -#: library/http.rst:152 +#: library/http.rst:156 msgid "``300 <= status <= 399``" msgstr "" -#: library/http.rst:153 +#: library/http.rst:157 msgid "``is_client_error``" msgstr "" -#: library/http.rst:153 +#: library/http.rst:157 msgid "``400 <= status <= 499``" msgstr "" -#: library/http.rst:154 +#: library/http.rst:158 msgid "``is_server_error``" msgstr "" -#: library/http.rst:154 +#: library/http.rst:158 msgid "``500 <= status <= 599``" msgstr "" -#: library/http.rst:159 +#: library/http.rst:163 msgid "" ">>> from http import HTTPStatus\n" ">>> HTTPStatus.OK.is_success\n" @@ -939,13 +945,13 @@ msgid "" "False" msgstr "" -#: library/http.rst:169 +#: library/http.rst:173 msgid "" "A subclass of :class:`enum.StrEnum` that defines a set of HTTP methods and " "descriptions written in English." msgstr "" -#: library/http.rst:173 +#: library/http.rst:177 msgid "" ">>> from http import HTTPMethod\n" ">>>\n" @@ -969,89 +975,89 @@ msgid "" " ]" msgstr "" -#: library/http.rst:197 +#: library/http.rst:201 msgid "HTTP methods" msgstr "" -#: library/http.rst:199 +#: library/http.rst:203 msgid "" "Supported, `IANA-registered methods `_ available in :class:`http.HTTPMethod` are:" msgstr "" -#: library/http.rst:204 +#: library/http.rst:208 msgid "Method" msgstr "" -#: library/http.rst:206 +#: library/http.rst:210 msgid "``GET``" msgstr "" -#: library/http.rst:206 -msgid "HTTP/1.1 :rfc:`7231`, Section 4.3.1" +#: library/http.rst:210 +msgid "HTTP Semantics :rfc:`9110`, Section 9.3.1" msgstr "" -#: library/http.rst:207 +#: library/http.rst:211 msgid "``HEAD``" msgstr "" -#: library/http.rst:207 -msgid "HTTP/1.1 :rfc:`7231`, Section 4.3.2" +#: library/http.rst:211 +msgid "HTTP Semantics :rfc:`9110`, Section 9.3.2" msgstr "" -#: library/http.rst:208 +#: library/http.rst:212 msgid "``POST``" msgstr "" -#: library/http.rst:208 -msgid "HTTP/1.1 :rfc:`7231`, Section 4.3.3" +#: library/http.rst:212 +msgid "HTTP Semantics :rfc:`9110`, Section 9.3.3" msgstr "" -#: library/http.rst:209 +#: library/http.rst:213 msgid "``PUT``" msgstr "" -#: library/http.rst:209 -msgid "HTTP/1.1 :rfc:`7231`, Section 4.3.4" +#: library/http.rst:213 +msgid "HTTP Semantics :rfc:`9110`, Section 9.3.4" msgstr "" -#: library/http.rst:210 +#: library/http.rst:214 msgid "``DELETE``" msgstr "" -#: library/http.rst:210 -msgid "HTTP/1.1 :rfc:`7231`, Section 4.3.5" +#: library/http.rst:214 +msgid "HTTP Semantics :rfc:`9110`, Section 9.3.5" msgstr "" -#: library/http.rst:211 +#: library/http.rst:215 msgid "``CONNECT``" msgstr "" -#: library/http.rst:211 -msgid "HTTP/1.1 :rfc:`7231`, Section 4.3.6" +#: library/http.rst:215 +msgid "HTTP Semantics :rfc:`9110`, Section 9.3.6" msgstr "" -#: library/http.rst:212 +#: library/http.rst:216 msgid "``OPTIONS``" msgstr "" -#: library/http.rst:212 -msgid "HTTP/1.1 :rfc:`7231`, Section 4.3.7" +#: library/http.rst:216 +msgid "HTTP Semantics :rfc:`9110`, Section 9.3.7" msgstr "" -#: library/http.rst:213 +#: library/http.rst:217 msgid "``TRACE``" msgstr "" -#: library/http.rst:213 -msgid "HTTP/1.1 :rfc:`7231`, Section 4.3.8" +#: library/http.rst:217 +msgid "HTTP Semantics :rfc:`9110`, Section 9.3.8" msgstr "" -#: library/http.rst:214 +#: library/http.rst:218 msgid "``PATCH``" msgstr "" -#: library/http.rst:214 +#: library/http.rst:218 msgid "HTTP/1.1 :rfc:`5789`" msgstr "" diff --git a/library/http.server.po b/library/http.server.po index e4a88de0..7e67d901 100644 --- a/library/http.server.po +++ b/library/http.server.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -41,9 +41,8 @@ msgstr "" #: includes/wasm-notavail.rst:5 msgid "" -"This module does not work or is not available on WebAssembly platforms " -"``wasm32-emscripten`` and ``wasm32-wasi``. See :ref:`wasm-availability` for " -"more information." +"This module does not work or is not available on WebAssembly. See :ref:`wasm-" +"availability` for more information." msgstr "" #: library/http.server.rst:27 @@ -582,36 +581,45 @@ msgid "" "reasons. Problems with the CGI script will be translated to error 403." msgstr "" -#: library/http.server.rst:466 +#: library/http.server.rst:464 +msgid "" +":class:`CGIHTTPRequestHandler` is being removed in 3.15. CGI has not been " +"considered a good way to do things for well over a decade. This code has " +"been unmaintained for a while now and sees very little practical use. " +"Retaining it could lead to further :ref:`security considerations `." +msgstr "" + +#: library/http.server.rst:474 msgid "Command-line interface" msgstr "" -#: library/http.server.rst:468 +#: library/http.server.rst:476 msgid "" ":mod:`http.server` can also be invoked directly using the :option:`-m` " "switch of the interpreter. The following example illustrates how to serve " "files relative to the current directory::" msgstr "" -#: library/http.server.rst:472 +#: library/http.server.rst:480 msgid "python -m http.server [OPTIONS] [port]" msgstr "" -#: library/http.server.rst:474 +#: library/http.server.rst:482 msgid "The following options are accepted:" msgstr "" -#: library/http.server.rst:480 +#: library/http.server.rst:488 msgid "" "The server listens to port 8000 by default. The default can be overridden by " "passing the desired port number as an argument::" msgstr "" -#: library/http.server.rst:483 +#: library/http.server.rst:491 msgid "python -m http.server 9000" msgstr "" -#: library/http.server.rst:487 +#: library/http.server.rst:495 msgid "" "Specifies a specific address to which it should bind. Both IPv4 and IPv6 " "addresses are supported. By default, the server binds itself to all " @@ -619,65 +627,71 @@ msgid "" "localhost only::" msgstr "" -#: library/http.server.rst:492 +#: library/http.server.rst:500 msgid "python -m http.server --bind 127.0.0.1" msgstr "" -#: library/http.server.rst:496 +#: library/http.server.rst:504 msgid "Support IPv6 in the ``--bind`` option." msgstr "" -#: library/http.server.rst:501 +#: library/http.server.rst:509 msgid "" "Specifies a directory to which it should serve the files. By default, the " "server uses the current directory. For example, the following command uses a " "specific directory::" msgstr "" -#: library/http.server.rst:505 +#: library/http.server.rst:513 msgid "python -m http.server --directory /tmp/" msgstr "" -#: library/http.server.rst:511 +#: library/http.server.rst:519 msgid "" "Specifies the HTTP version to which the server is conformant. By default, " "the server is conformant to HTTP/1.0. For example, the following command " "runs an HTTP/1.1 conformant server::" msgstr "" -#: library/http.server.rst:515 +#: library/http.server.rst:523 msgid "python -m http.server --protocol HTTP/1.1" msgstr "" -#: library/http.server.rst:521 +#: library/http.server.rst:529 msgid "" ":class:`CGIHTTPRequestHandler` can be enabled in the command line by passing " "the ``--cgi`` option::" msgstr "" -#: library/http.server.rst:524 +#: library/http.server.rst:532 msgid "python -m http.server --cgi" msgstr "" -#: library/http.server.rst:528 +#: library/http.server.rst:536 +msgid "" +":mod:`http.server` command line ``--cgi`` support is being removed because :" +"class:`CGIHTTPRequestHandler` is being removed." +msgstr "" + +#: library/http.server.rst:541 msgid "" ":class:`CGIHTTPRequestHandler` and the ``--cgi`` command-line option are not " "intended for use by untrusted clients and may be vulnerable to exploitation. " "Always use within a secure environment." msgstr "" -#: library/http.server.rst:536 +#: library/http.server.rst:549 msgid "Security considerations" msgstr "" -#: library/http.server.rst:540 +#: library/http.server.rst:553 msgid "" ":class:`SimpleHTTPRequestHandler` will follow symbolic links when handling " "requests, this makes it possible for files outside of the specified " "directory to be served." msgstr "" -#: library/http.server.rst:544 +#: library/http.server.rst:557 msgid "" "Earlier versions of Python did not scrub control characters from the log " "messages emitted to stderr from ``python -m http.server`` or the default :" @@ -686,7 +700,7 @@ msgid "" "codes to your terminal." msgstr "" -#: library/http.server.rst:550 +#: library/http.server.rst:563 msgid "Control characters are scrubbed in stderr logs." msgstr "" @@ -714,10 +728,10 @@ msgstr "" msgid "httpd" msgstr "" -#: library/http.server.rst:538 +#: library/http.server.rst:551 msgid "http.server" msgstr "" -#: library/http.server.rst:538 +#: library/http.server.rst:551 msgid "security" msgstr "" diff --git a/library/i18n.po b/library/i18n.po index 4a1e8ff7..9c0a0139 100644 --- a/library/i18n.po +++ b/library/i18n.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" diff --git a/library/idle.po b/library/idle.po index 699469e8..caccf970 100644 --- a/library/idle.po +++ b/library/idle.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" diff --git a/library/imaplib.po b/library/imaplib.po index a6c220ab..27fa4af5 100644 --- a/library/imaplib.po +++ b/library/imaplib.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -40,9 +40,8 @@ msgstr "" #: includes/wasm-notavail.rst:5 msgid "" -"This module does not work or is not available on WebAssembly platforms " -"``wasm32-emscripten`` and ``wasm32-wasi``. See :ref:`wasm-availability` for " -"more information." +"This module does not work or is not available on WebAssembly. See :ref:`wasm-" +"availability` for more information." msgstr "" #: library/imaplib.rst:31 @@ -610,7 +609,7 @@ msgid "" "such tags, and popular IMAP servers, such as Gmail, accept and produce such " "flags. There are non-Python programs which also create such tags. Although " "it is an RFC violation and IMAP clients and servers are supposed to be " -"strict, imaplib nonetheless continues to allow such tags to be created for " +"strict, imaplib still continues to allow such tags to be created for " "backward compatibility reasons, and as of Python 3.6, handles them if they " "are sent from the server, since this improves real-world compatibility." msgstr "" diff --git a/library/imghdr.po b/library/imghdr.po index 94addb32..7d93d793 100644 --- a/library/imghdr.po +++ b/library/imghdr.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -18,188 +18,25 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" #: library/imghdr.rst:2 -msgid ":mod:`imghdr` --- Determine the type of an image" -msgstr "" - -#: library/imghdr.rst:8 -msgid "**Source code:** :source:`Lib/imghdr.py`" +msgid ":mod:`!imghdr` --- Determine the type of an image" msgstr "" #: library/imghdr.rst:10 msgid "" -"The :mod:`imghdr` module is deprecated (see :pep:`PEP 594 <594#imghdr>` for " -"details and alternatives)." +"This module is no longer part of the Python standard library. It was :ref:" +"`removed in Python 3.13 ` after being deprecated in " +"Python 3.11. The removal was decided in :pep:`594`." msgstr "" -#: library/imghdr.rst:16 +#: library/imghdr.rst:14 msgid "" -"The :mod:`imghdr` module determines the type of image contained in a file or " -"byte stream." -msgstr "" - -#: library/imghdr.rst:19 -msgid "The :mod:`imghdr` module defines the following function:" -msgstr "" - -#: library/imghdr.rst:24 -msgid "" -"Test the image data contained in the file named *file* and return a string " -"describing the image type. If *h* is provided, the *file* argument is " -"ignored and *h* is assumed to contain the byte stream to test." -msgstr "" - -#: library/imghdr.rst:28 -msgid "Accepts a :term:`path-like object`." -msgstr "" - -#: library/imghdr.rst:31 -msgid "" -"The following image types are recognized, as listed below with the return " -"value from :func:`what`:" -msgstr "" - -#: library/imghdr.rst:35 -msgid "Value" -msgstr "" - -#: library/imghdr.rst:35 -msgid "Image format" -msgstr "" - -#: library/imghdr.rst:37 -msgid "``'rgb'``" -msgstr "" - -#: library/imghdr.rst:37 -msgid "SGI ImgLib Files" -msgstr "" - -#: library/imghdr.rst:39 -msgid "``'gif'``" -msgstr "" - -#: library/imghdr.rst:39 -msgid "GIF 87a and 89a Files" -msgstr "" - -#: library/imghdr.rst:41 -msgid "``'pbm'``" -msgstr "" - -#: library/imghdr.rst:41 -msgid "Portable Bitmap Files" -msgstr "" - -#: library/imghdr.rst:43 -msgid "``'pgm'``" -msgstr "" - -#: library/imghdr.rst:43 -msgid "Portable Graymap Files" -msgstr "" - -#: library/imghdr.rst:45 -msgid "``'ppm'``" -msgstr "" - -#: library/imghdr.rst:45 -msgid "Portable Pixmap Files" -msgstr "" - -#: library/imghdr.rst:47 -msgid "``'tiff'``" -msgstr "" - -#: library/imghdr.rst:47 -msgid "TIFF Files" -msgstr "" - -#: library/imghdr.rst:49 -msgid "``'rast'``" -msgstr "" - -#: library/imghdr.rst:49 -msgid "Sun Raster Files" -msgstr "" - -#: library/imghdr.rst:51 -msgid "``'xbm'``" -msgstr "" - -#: library/imghdr.rst:51 -msgid "X Bitmap Files" -msgstr "" - -#: library/imghdr.rst:53 -msgid "``'jpeg'``" -msgstr "" - -#: library/imghdr.rst:53 -msgid "JPEG data in JFIF or Exif formats" -msgstr "" - -#: library/imghdr.rst:55 -msgid "``'bmp'``" -msgstr "" - -#: library/imghdr.rst:55 -msgid "BMP files" -msgstr "" - -#: library/imghdr.rst:57 -msgid "``'png'``" -msgstr "" - -#: library/imghdr.rst:57 -msgid "Portable Network Graphics" -msgstr "" - -#: library/imghdr.rst:59 -msgid "``'webp'``" -msgstr "" - -#: library/imghdr.rst:59 -msgid "WebP files" -msgstr "" - -#: library/imghdr.rst:61 -msgid "``'exr'``" -msgstr "" - -#: library/imghdr.rst:61 -msgid "OpenEXR Files" -msgstr "" - -#: library/imghdr.rst:64 -msgid "The *exr* and *webp* formats were added." -msgstr "" - -#: library/imghdr.rst:68 -msgid "" -"You can extend the list of file types :mod:`imghdr` can recognize by " -"appending to this variable:" -msgstr "" - -#: library/imghdr.rst:74 -msgid "" -"A list of functions performing the individual tests. Each function takes " -"two arguments: the byte-stream and an open file-like object. When :func:" -"`what` is called with a byte-stream, the file-like object will be ``None``." -msgstr "" - -#: library/imghdr.rst:78 -msgid "" -"The test function should return a string describing the image type if the " -"test succeeded, or ``None`` if it failed." -msgstr "" - -#: library/imghdr.rst:81 -msgid "Example::" +"Possible replacements are third-party libraries from PyPI: :pypi:" +"`filetype`, :pypi:`puremagic`, or :pypi:`python-magic`. These are not " +"supported or maintained by the Python core team." msgstr "" -#: library/imghdr.rst:83 +#: library/imghdr.rst:18 msgid "" -">>> import imghdr\n" -">>> imghdr.what('bass.gif')\n" -"'gif'" +"The last version of Python that provided the :mod:`!imghdr` module was " +"`Python 3.12 `_." msgstr "" diff --git a/library/imp.po b/library/imp.po index 5607fca6..58b450dc 100644 --- a/library/imp.po +++ b/library/imp.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" diff --git a/library/importlib.metadata.po b/library/importlib.metadata.po index d4a12a96..d2addfbd 100644 --- a/library/importlib.metadata.po +++ b/library/importlib.metadata.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -60,7 +60,7 @@ msgid "" "*distribution package* can contain multiple *import packages* (and single " "modules), and one top-level *import package* may map to multiple " "*distribution packages* if it is a namespace package. You can use :ref:" -"`package_distributions() ` to get a mapping between " +"`packages_distributions() ` to get a mapping between " "them." msgstr "" @@ -300,10 +300,6 @@ msgid "" msgstr "" #: library/importlib.metadata.rst:203 -msgid "*Compatibility Note*" -msgstr "" - -#: library/importlib.metadata.rst:205 msgid "" "The \"selectable\" entry points were introduced in ``importlib_metadata`` " "3.6 and Python 3.10. Prior to those changes, ``entry_points`` accepted no " @@ -313,137 +309,143 @@ msgid "" "entry_points_selectable` for compatibility options." msgstr "" -#: library/importlib.metadata.rst:217 +#: library/importlib.metadata.rst:212 +msgid "" +"``EntryPoint`` objects no longer present a tuple-like interface (:meth:" +"`~object.__getitem__`)." +msgstr "" + +#: library/importlib.metadata.rst:219 msgid "Distribution metadata" msgstr "" -#: library/importlib.metadata.rst:221 +#: library/importlib.metadata.rst:223 msgid "" "Return the distribution metadata corresponding to the named distribution " "package as a :class:`PackageMetadata` instance." msgstr "" -#: library/importlib.metadata.rst:224 library/importlib.metadata.rst:273 -#: library/importlib.metadata.rst:294 library/importlib.metadata.rst:357 -#: library/importlib.metadata.rst:408 +#: library/importlib.metadata.rst:226 library/importlib.metadata.rst:275 +#: library/importlib.metadata.rst:296 library/importlib.metadata.rst:359 +#: library/importlib.metadata.rst:410 msgid "" "Raises :exc:`PackageNotFoundError` if the named distribution package is not " "installed in the current Python environment." msgstr "" -#: library/importlib.metadata.rst:229 +#: library/importlib.metadata.rst:231 msgid "" "A concrete implementation of the `PackageMetadata protocol `_." msgstr "" -#: library/importlib.metadata.rst:232 +#: library/importlib.metadata.rst:234 msgid "" "In addition to providing the defined protocol methods and attributes, " "subscripting the instance is equivalent to calling the :meth:`!get` method." msgstr "" -#: library/importlib.metadata.rst:235 +#: library/importlib.metadata.rst:237 msgid "" "Every `Distribution Package `_ includes some metadata, which you can extract " "using the :func:`!metadata` function::" msgstr "" -#: library/importlib.metadata.rst:238 +#: library/importlib.metadata.rst:240 msgid ">>> wheel_metadata = metadata('wheel')" msgstr "" -#: library/importlib.metadata.rst:240 +#: library/importlib.metadata.rst:242 msgid "" "The keys of the returned data structure name the metadata keywords, and the " "values are returned unparsed from the distribution metadata::" msgstr "" -#: library/importlib.metadata.rst:243 +#: library/importlib.metadata.rst:245 msgid "" ">>> wheel_metadata['Requires-Python']\n" "'>=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*'" msgstr "" -#: library/importlib.metadata.rst:246 +#: library/importlib.metadata.rst:248 msgid "" ":class:`PackageMetadata` also presents a :attr:`!json` attribute that " "returns all the metadata in a JSON-compatible form per :PEP:`566`::" msgstr "" -#: library/importlib.metadata.rst:249 +#: library/importlib.metadata.rst:251 msgid "" ">>> wheel_metadata.json['requires_python']\n" "'>=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*'" msgstr "" -#: library/importlib.metadata.rst:252 library/importlib.metadata.rst:445 +#: library/importlib.metadata.rst:254 library/importlib.metadata.rst:453 msgid "" "The full set of available metadata is not described here. See the PyPA `Core " "metadata specification `_ for additional details." msgstr "" -#: library/importlib.metadata.rst:255 +#: library/importlib.metadata.rst:257 msgid "" "The ``Description`` is now included in the metadata when presented through " "the payload. Line continuation characters have been removed." msgstr "" -#: library/importlib.metadata.rst:259 +#: library/importlib.metadata.rst:261 msgid "The ``json`` attribute was added." msgstr "" -#: library/importlib.metadata.rst:265 +#: library/importlib.metadata.rst:267 msgid "Distribution versions" msgstr "" -#: library/importlib.metadata.rst:269 +#: library/importlib.metadata.rst:271 msgid "" "Return the installed distribution package `version `__ for the named " "distribution package." msgstr "" -#: library/importlib.metadata.rst:276 +#: library/importlib.metadata.rst:278 msgid "" "The :func:`!version` function is the quickest way to get a `Distribution " "Package `_'s version number, as a string::" msgstr "" -#: library/importlib.metadata.rst:280 +#: library/importlib.metadata.rst:282 msgid "" ">>> version('wheel')\n" "'0.32.3'" msgstr "" -#: library/importlib.metadata.rst:287 +#: library/importlib.metadata.rst:289 msgid "Distribution files" msgstr "" -#: library/importlib.metadata.rst:291 +#: library/importlib.metadata.rst:293 msgid "" "Return the full set of files contained within the named distribution package." msgstr "" -#: library/importlib.metadata.rst:297 +#: library/importlib.metadata.rst:299 msgid "" "Returns :const:`None` if the distribution is found but the installation " "database records reporting the files associated with the distribuion package " "are missing." msgstr "" -#: library/importlib.metadata.rst:303 +#: library/importlib.metadata.rst:305 msgid "" "A :class:`pathlib.PurePath` derived object with additional ``dist``, " "``size``, and ``hash`` properties corresponding to the distribution " "package's installation metadata for that file." msgstr "" -#: library/importlib.metadata.rst:307 +#: library/importlib.metadata.rst:309 msgid "" "The :func:`!files` function takes a `Distribution Package `_ name and returns " @@ -451,7 +453,7 @@ msgid "" "class:`PackagePath` instance. For example::" msgstr "" -#: library/importlib.metadata.rst:312 +#: library/importlib.metadata.rst:314 msgid "" ">>> util = [p for p in files('wheel') if 'util.py' in str(p)][0]\n" ">>> util\n" @@ -464,11 +466,11 @@ msgid "" "" msgstr "" -#: library/importlib.metadata.rst:322 +#: library/importlib.metadata.rst:324 msgid "Once you have the file, you can also read its contents::" msgstr "" -#: library/importlib.metadata.rst:324 +#: library/importlib.metadata.rst:326 msgid "" ">>> print(util.read_text())\n" "import base64\n" @@ -480,19 +482,19 @@ msgid "" " return s" msgstr "" -#: library/importlib.metadata.rst:333 +#: library/importlib.metadata.rst:335 msgid "" "You can also use the :meth:`!locate` method to get the absolute path to the " "file::" msgstr "" -#: library/importlib.metadata.rst:336 +#: library/importlib.metadata.rst:338 msgid "" ">>> util.locate()\n" "PosixPath('/home/gustav/example/lib/site-packages/wheel/util.py')" msgstr "" -#: library/importlib.metadata.rst:339 +#: library/importlib.metadata.rst:341 msgid "" "In the case where the metadata file listing files (``RECORD`` or ``SOURCES." "txt``) is missing, :func:`!files` will return :const:`None`. The caller may " @@ -502,47 +504,47 @@ msgid "" "distribution is not known to have the metadata present." msgstr "" -#: library/importlib.metadata.rst:350 +#: library/importlib.metadata.rst:352 msgid "Distribution requirements" msgstr "" -#: library/importlib.metadata.rst:354 +#: library/importlib.metadata.rst:356 msgid "" "Return the declared dependency specifiers for the named distribution package." msgstr "" -#: library/importlib.metadata.rst:360 +#: library/importlib.metadata.rst:362 msgid "" "To get the full set of requirements for a `Distribution Package `_, use " "the :func:`!requires` function::" msgstr "" -#: library/importlib.metadata.rst:364 +#: library/importlib.metadata.rst:366 msgid "" ">>> requires('wheel')\n" "[\"pytest (>=3.0.0) ; extra == 'test'\", \"pytest-cov ; extra == 'test'\"]" msgstr "" -#: library/importlib.metadata.rst:372 +#: library/importlib.metadata.rst:374 msgid "Mapping import to distribution packages" msgstr "" -#: library/importlib.metadata.rst:376 +#: library/importlib.metadata.rst:378 msgid "" "Return a mapping from the top level module and import package names found " "via :data:`sys.meta_path` to the names of the distribution packages (if any) " "that provide the corresponding files." msgstr "" -#: library/importlib.metadata.rst:380 +#: library/importlib.metadata.rst:382 msgid "" "To allow for namespace packages (which may have members provided by multiple " "distribution packages), each top level import name maps to a list of " "distribution names rather than mapping directly to a single name." msgstr "" -#: library/importlib.metadata.rst:384 +#: library/importlib.metadata.rst:386 msgid "" "A convenience method to resolve the `Distribution Package `_ name (or names, " @@ -551,42 +553,42 @@ msgid "" "glossary/#term-Import-Package>`_::" msgstr "" -#: library/importlib.metadata.rst:389 +#: library/importlib.metadata.rst:391 msgid "" ">>> packages_distributions()\n" "{'importlib_metadata': ['importlib-metadata'], 'yaml': ['PyYAML'], 'jaraco': " "['jaraco.classes', 'jaraco.functools'], ...}" msgstr "" -#: library/importlib.metadata.rst:392 +#: library/importlib.metadata.rst:394 msgid "" "Some editable installs, `do not supply top-level names `_, and thus this function is not " "reliable with such installs." msgstr "" -#: library/importlib.metadata.rst:401 +#: library/importlib.metadata.rst:403 msgid "Distributions" msgstr "" -#: library/importlib.metadata.rst:405 +#: library/importlib.metadata.rst:407 msgid "" "Return a :class:`Distribution` instance describing the named distribution " "package." msgstr "" -#: library/importlib.metadata.rst:413 +#: library/importlib.metadata.rst:415 msgid "Details of an installed distribution package." msgstr "" -#: library/importlib.metadata.rst:415 +#: library/importlib.metadata.rst:417 msgid "" "Note: different :class:`!Distribution` instances do not currently compare " "equal, even if they relate to the same installed distribution and " "accordingly have the same attributes." msgstr "" -#: library/importlib.metadata.rst:419 +#: library/importlib.metadata.rst:421 msgid "" "While the module level API described above is the most common and convenient " "usage, you can get all of that information from the :class:`!Distribution` " @@ -597,7 +599,7 @@ msgid "" "package by calling the :func:`distribution` function::" msgstr "" -#: library/importlib.metadata.rst:426 +#: library/importlib.metadata.rst:428 msgid "" ">>> from importlib.metadata import distribution\n" ">>> dist = distribution('wheel')\n" @@ -605,25 +607,25 @@ msgid "" "" msgstr "" -#: library/importlib.metadata.rst:431 +#: library/importlib.metadata.rst:433 msgid "" "Thus, an alternative way to get the version number is through the :class:`!" "Distribution` instance::" msgstr "" -#: library/importlib.metadata.rst:434 +#: library/importlib.metadata.rst:436 msgid "" ">>> dist.version\n" "'0.32.3'" msgstr "" -#: library/importlib.metadata.rst:437 +#: library/importlib.metadata.rst:439 msgid "" "There are all kinds of additional metadata available on :class:`!" "Distribution` instances::" msgstr "" -#: library/importlib.metadata.rst:440 +#: library/importlib.metadata.rst:442 msgid "" ">>> dist.metadata['Requires-Python']\n" "'>=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*'\n" @@ -631,11 +633,27 @@ msgid "" "'MIT'" msgstr "" +#: library/importlib.metadata.rst:447 +msgid "" +"For editable packages, an ``origin`` property may present :pep:`610` " +"metadata::" +msgstr "" + #: library/importlib.metadata.rst:450 +msgid "" +">>> dist.origin.url\n" +"'file:///path/to/wheel-0.32.3.editable-py3-none-any.whl'" +msgstr "" + +#: library/importlib.metadata.rst:456 +msgid "The ``.origin`` property was added." +msgstr "" + +#: library/importlib.metadata.rst:460 msgid "Distribution Discovery" msgstr "" -#: library/importlib.metadata.rst:452 +#: library/importlib.metadata.rst:462 msgid "" "By default, this package provides built-in support for discovery of metadata " "for file system and zip file `Distribution Package `_ metadata is not available through :" @@ -670,14 +688,14 @@ msgid "" "on :data:`sys.meta_path`." msgstr "" -#: library/importlib.metadata.rst:471 +#: library/importlib.metadata.rst:481 msgid "" "By default ``importlib.metadata`` installs a finder for distribution " "packages found on the file system. This finder doesn't actually find any " "*distributions*, but it can find their metadata." msgstr "" -#: library/importlib.metadata.rst:476 +#: library/importlib.metadata.rst:486 msgid "" "The abstract class :py:class:`importlib.abc.MetaPathFinder` defines the " "interface expected of finders by Python's import system. ``importlib." @@ -687,7 +705,7 @@ msgid "" "base class, which defines this abstract method::" msgstr "" -#: library/importlib.metadata.rst:484 +#: library/importlib.metadata.rst:494 msgid "" "@abc.abstractmethod\n" "def find_distributions(context=DistributionFinder.Context()):\n" @@ -696,14 +714,14 @@ msgid "" " \"\"\"" msgstr "" -#: library/importlib.metadata.rst:490 +#: library/importlib.metadata.rst:500 msgid "" "The ``DistributionFinder.Context`` object provides ``.path`` and ``.name`` " "properties indicating the path to search and name to match and may supply " "other relevant context." msgstr "" -#: library/importlib.metadata.rst:494 +#: library/importlib.metadata.rst:504 msgid "" "What this means in practice is that to support finding distribution package " "metadata in locations other than the file system, subclass ``Distribution`` " @@ -711,3 +729,109 @@ msgid "" "instances of this derived ``Distribution`` in the ``find_distributions()`` " "method." msgstr "" + +#: library/importlib.metadata.rst:511 +msgid "Example" +msgstr "" + +#: library/importlib.metadata.rst:513 +msgid "" +"Consider for example a custom finder that loads Python modules from a " +"database::" +msgstr "" + +#: library/importlib.metadata.rst:516 +msgid "" +"class DatabaseImporter(importlib.abc.MetaPathFinder):\n" +" def __init__(self, db):\n" +" self.db = db\n" +"\n" +" def find_spec(self, fullname, target=None) -> ModuleSpec:\n" +" return self.db.spec_from_name(fullname)\n" +"\n" +"sys.meta_path.append(DatabaseImporter(connect_db(...)))" +msgstr "" + +#: library/importlib.metadata.rst:525 +msgid "" +"That importer now presumably provides importable modules from a database, " +"but it provides no metadata or entry points. For this custom importer to " +"provide metadata, it would also need to implement ``DistributionFinder``::" +msgstr "" + +#: library/importlib.metadata.rst:530 +msgid "" +"from importlib.metadata import DistributionFinder\n" +"\n" +"class DatabaseImporter(DistributionFinder):\n" +" ...\n" +"\n" +" def find_distributions(self, context=DistributionFinder.Context()):\n" +" query = dict(name=context.name) if context.name else {}\n" +" for dist_record in self.db.query_distributions(query):\n" +" yield DatabaseDistribution(dist_record)" +msgstr "" + +#: library/importlib.metadata.rst:540 +msgid "" +"In this way, ``query_distributions`` would return records for each " +"distribution served by the database matching the query. For example, if " +"``requests-1.0`` is in the database, ``find_distributions`` would yield a " +"``DatabaseDistribution`` for ``Context(name='requests')`` or " +"``Context(name=None)``." +msgstr "" + +#: library/importlib.metadata.rst:546 +msgid "" +"For the sake of simplicity, this example ignores ``context.path``\\. The " +"``path`` attribute defaults to ``sys.path`` and is the set of import paths " +"to be considered in the search. A ``DatabaseImporter`` could potentially " +"function without any concern for a search path. Assuming the importer does " +"no partitioning, the \"path\" would be irrelevant. In order to illustrate " +"the purpose of ``path``, the example would need to illustrate a more complex " +"``DatabaseImporter`` whose behavior varied depending on ``sys.path``/" +"``PYTHONPATH``. In that case, the ``find_distributions`` should honor the " +"``context.path`` and only yield ``Distribution``\\ s pertinent to that path." +msgstr "" + +#: library/importlib.metadata.rst:557 +msgid "``DatabaseDistribution``, then, would look something like::" +msgstr "" + +#: library/importlib.metadata.rst:559 +msgid "" +"class DatabaseDistribution(importlib.metadata.Distribution):\n" +" def __init__(self, record):\n" +" self.record = record\n" +"\n" +" def read_text(self, filename):\n" +" \"\"\"\n" +" Read a file like \"METADATA\" for the current distribution.\n" +" \"\"\"\n" +" if filename == \"METADATA\":\n" +" return f\"\"\"Name: {self.record.name}\n" +"Version: {self.record.version}\n" +"\"\"\"\n" +" if filename == \"entry_points.txt\":\n" +" return \"\\n\".join(\n" +" f\"\"\"[{ep.group}]\\n{ep.name}={ep.value}\"\"\"\n" +" for ep in self.record.entry_points)\n" +"\n" +" def locate_file(self, path):\n" +" raise RuntimeError(\"This distribution has no file system\")" +msgstr "" + +#: library/importlib.metadata.rst:579 +msgid "" +"This basic implementation should provide metadata and entry points for " +"packages served by the ``DatabaseImporter``, assuming that the ``record`` " +"supplies suitable ``.name``, ``.version``, and ``.entry_points`` attributes." +msgstr "" + +#: library/importlib.metadata.rst:584 +msgid "" +"The ``DatabaseDistribution`` may also provide other metadata files, like " +"``RECORD`` (required for ``Distribution.files``) or override the " +"implementation of ``Distribution.files``. See the source for more " +"inspiration." +msgstr "" diff --git a/library/importlib.po b/library/importlib.po index 2b01dd5e..900c74a9 100644 --- a/library/importlib.po +++ b/library/importlib.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -521,7 +521,7 @@ msgid ":attr:`module.__file__`" msgstr "" #: library/importlib.rst:360 -msgid ":attr:`module.__cached__`" +msgid ":attr:`module.__cached__` *(deprecated)*" msgstr "" #: library/importlib.rst:361 @@ -529,7 +529,7 @@ msgid ":attr:`module.__path__`" msgstr "" #: library/importlib.rst:362 -msgid ":attr:`module.__package__`" +msgid ":attr:`module.__package__` *(deprecated)*" msgstr "" #: library/importlib.rst:363 @@ -1309,7 +1309,7 @@ msgstr "" msgid "Multi-phase init is now required for use in subinterpreters." msgstr "" -#: library/importlib.rst:1106 +#: library/importlib.rst:1292 msgid "Name of the module the loader supports." msgstr "" @@ -1436,27 +1436,100 @@ msgid "" "and how the module's :attr:`~module.__file__` is populated." msgstr "" -#: library/importlib.rst:1237 +#: library/importlib.rst:1238 +msgid "" +"A specialization of :class:`importlib.machinery.ExtensionFileLoader` that is " +"able to load extension modules in Framework format." +msgstr "" + +#: library/importlib.rst:1241 +msgid "" +"For compatibility with the iOS App Store, *all* binary modules in an iOS app " +"must be dynamic libraries, contained in a framework with appropriate " +"metadata, stored in the ``Frameworks`` folder of the packaged app. There can " +"be only a single binary per framework, and there can be no executable binary " +"material outside the Frameworks folder." +msgstr "" + +#: library/importlib.rst:1247 +msgid "" +"To accommodate this requirement, when running on iOS, extension module " +"binaries are *not* packaged as ``.so`` files on ``sys.path``, but as " +"individual standalone frameworks. To discover those frameworks, this loader " +"is be registered against the ``.fwork`` file extension, with a ``.fwork`` " +"file acting as a placeholder in the original location of the binary on ``sys." +"path``. The ``.fwork`` file contains the path of the actual binary in the " +"``Frameworks`` folder, relative to the app bundle. To allow for resolving a " +"framework-packaged binary back to the original location, the framework is " +"expected to contain a ``.origin`` file that contains the location of the ``." +"fwork`` file, relative to the app bundle." +msgstr "" + +#: library/importlib.rst:1258 +msgid "" +"For example, consider the case of an import ``from foo.bar import _whiz``, " +"where ``_whiz`` is implemented with the binary module ``sources/foo/bar/" +"_whiz.abi3.so``, with ``sources`` being the location registered on ``sys." +"path``, relative to the application bundle. This module *must* be " +"distributed as ``Frameworks/foo.bar._whiz.framework/foo.bar._whiz`` " +"(creating the framework name from the full import path of the module), with " +"an ``Info.plist`` file in the ``.framework`` directory identifying the " +"binary as a framework. The ``foo.bar._whiz`` module would be represented in " +"the original location with a ``sources/foo/bar/_whiz.abi3.fwork`` marker " +"file, containing the path ``Frameworks/foo.bar._whiz/foo.bar._whiz``. The " +"framework would also contain ``Frameworks/foo.bar._whiz.framework/foo.bar." +"_whiz.origin``, containing the path to the ``.fwork`` file." +msgstr "" + +#: library/importlib.rst:1272 +msgid "" +"When a module is loaded with this loader, the ``__file__`` for the module " +"will report as the location of the ``.fwork`` file. This allows code to use " +"the ``__file__`` of a module as an anchor for file system traveral. " +"However, the spec origin will reference the location of the *actual* binary " +"in the ``.framework`` folder." +msgstr "" + +#: library/importlib.rst:1278 +msgid "" +"The Xcode project building the app is responsible for converting any ``.so`` " +"files from wherever they exist in the ``PYTHONPATH`` into frameworks in the " +"``Frameworks`` folder (including stripping extensions from the module file, " +"the addition of framework metadata, and signing the resulting framework), " +"and creating the ``.fwork`` and ``.origin`` files. This will usually be done " +"with a build step in the Xcode project; see the iOS documentation for " +"details on how to construct this build step." +msgstr "" + +#: library/importlib.rst:1288 +msgid "Availability" +msgstr "" + +#: library/importlib.rst:1296 +msgid "Path to the ``.fwork`` file for the extension module." +msgstr "" + +#: library/importlib.rst:1300 msgid ":mod:`importlib.util` -- Utility code for importers" msgstr "" -#: library/importlib.rst:1243 +#: library/importlib.rst:1306 msgid "**Source code:** :source:`Lib/importlib/util.py`" msgstr "" -#: library/importlib.rst:1247 +#: library/importlib.rst:1310 msgid "" "This module contains the various objects that help in the construction of " "an :term:`importer`." msgstr "" -#: library/importlib.rst:1252 +#: library/importlib.rst:1315 msgid "" "The bytes which represent the bytecode version number. If you need help with " "loading/writing bytecode then consider :class:`importlib.abc.SourceLoader`." msgstr "" -#: library/importlib.rst:1259 +#: library/importlib.rst:1322 msgid "" "Return the :pep:`3147`/:pep:`488` path to the byte-compiled file associated " "with the source *path*. For example, if *path* is ``/foo/bar/baz.py`` the " @@ -1466,7 +1539,7 @@ msgid "" "`NotImplementedError` will be raised)." msgstr "" -#: library/importlib.rst:1266 +#: library/importlib.rst:1329 msgid "" "The *optimization* parameter is used to specify the optimization level of " "the bytecode file. An empty string represents no optimization, so ``/foo/bar/" @@ -1479,7 +1552,7 @@ msgid "" "be alphanumeric, else :exc:`ValueError` is raised." msgstr "" -#: library/importlib.rst:1276 +#: library/importlib.rst:1339 msgid "" "The *debug_override* parameter is deprecated and can be used to override the " "system's value for ``__debug__``. A ``True`` value is the equivalent of " @@ -1488,17 +1561,17 @@ msgid "" "are not ``None`` then :exc:`TypeError` is raised." msgstr "" -#: library/importlib.rst:1284 +#: library/importlib.rst:1347 msgid "" "The *optimization* parameter was added and the *debug_override* parameter " "was deprecated." msgstr "" -#: library/importlib.rst:1304 library/importlib.rst:1393 +#: library/importlib.rst:1367 library/importlib.rst:1456 msgid "Accepts a :term:`path-like object`." msgstr "" -#: library/importlib.rst:1294 +#: library/importlib.rst:1357 msgid "" "Given the *path* to a :pep:`3147` file name, return the associated source " "code file path. For example, if *path* is ``/foo/bar/__pycache__/baz." @@ -1508,25 +1581,25 @@ msgid "" "cache_tag` is not defined, :exc:`NotImplementedError` is raised." msgstr "" -#: library/importlib.rst:1309 +#: library/importlib.rst:1372 msgid "" "Decode the given bytes representing source code and return it as a string " "with universal newlines (as required by :meth:`importlib.abc.InspectLoader." "get_source`)." msgstr "" -#: library/importlib.rst:1317 +#: library/importlib.rst:1380 msgid "Resolve a relative module name to an absolute one." msgstr "" -#: library/importlib.rst:1319 +#: library/importlib.rst:1382 msgid "" "If **name** has no leading dots, then **name** is simply returned. This " "allows for usage such as ``importlib.util.resolve_name('sys', __spec__." "parent)`` without doing a check to see if the **package** argument is needed." msgstr "" -#: library/importlib.rst:1324 +#: library/importlib.rst:1387 msgid "" ":exc:`ImportError` is raised if **name** is a relative module name but " "**package** is a false value (e.g. ``None`` or the empty string). :exc:" @@ -1534,13 +1607,13 @@ msgid "" "package (e.g. requesting ``..bacon`` from within the ``spam`` package)." msgstr "" -#: library/importlib.rst:1332 +#: library/importlib.rst:1395 msgid "" "To improve consistency with import statements, raise :exc:`ImportError` " "instead of :exc:`ValueError` for invalid relative import attempts." msgstr "" -#: library/importlib.rst:1339 +#: library/importlib.rst:1402 msgid "" "Find the :term:`spec ` for a module, optionally relative to the " "specified **package** name. If the module is in :data:`sys.modules`, then " @@ -1550,30 +1623,30 @@ msgid "" "if no spec is found." msgstr "" -#: library/importlib.rst:1346 +#: library/importlib.rst:1409 msgid "" "If **name** is for a submodule (contains a dot), the parent module is " "automatically imported." msgstr "" -#: library/importlib.rst:1349 +#: library/importlib.rst:1412 msgid "**name** and **package** work the same as for :func:`import_module`." msgstr "" -#: library/importlib.rst:1353 +#: library/importlib.rst:1416 msgid "" "Raises :exc:`ModuleNotFoundError` instead of :exc:`AttributeError` if " "**package** is in fact not a package (i.e. lacks a :attr:`~module.__path__` " "attribute)." msgstr "" -#: library/importlib.rst:1360 +#: library/importlib.rst:1423 msgid "" "Create a new module based on **spec** and :meth:`spec.loader.create_module " "`." msgstr "" -#: library/importlib.rst:1363 +#: library/importlib.rst:1426 msgid "" "If :meth:`spec.loader.create_module ` " "does not return ``None``, then any pre-existing attributes will not be " @@ -1581,14 +1654,14 @@ msgid "" "accessing **spec** or setting an attribute on the module." msgstr "" -#: library/importlib.rst:1368 +#: library/importlib.rst:1431 msgid "" "This function is preferred over using :class:`types.ModuleType` to create a " "new module as **spec** is used to set as many import-controlled attributes " "on the module as possible." msgstr "" -#: library/importlib.rst:1376 +#: library/importlib.rst:1439 msgid "" "A factory function for creating a :class:`~importlib.machinery.ModuleSpec` " "instance based on a loader. The parameters have the same meaning as they do " @@ -1597,7 +1670,7 @@ msgid "" "spec." msgstr "" -#: library/importlib.rst:1386 +#: library/importlib.rst:1449 msgid "" "A factory function for creating a :class:`~importlib.machinery.ModuleSpec` " "instance based on the path to a file. Missing information will be filled in " @@ -1605,14 +1678,14 @@ msgid "" "module will be file-based." msgstr "" -#: library/importlib.rst:1398 +#: library/importlib.rst:1461 msgid "" "Return the hash of *source_bytes* as bytes. A hash-based ``.pyc`` file " "embeds the :func:`source_hash` of the corresponding source file's contents " "in its header." msgstr "" -#: library/importlib.rst:1406 +#: library/importlib.rst:1469 msgid "" "A context manager that can temporarily skip the compatibility check for " "extension modules. By default the check is enabled and will fail when a " @@ -1621,33 +1694,33 @@ msgid "" "interpreter GIL, when imported in an interpreter with its own GIL." msgstr "" -#: library/importlib.rst:1413 +#: library/importlib.rst:1476 msgid "" "Note that this function is meant to accommodate an unusual case; one which " "is likely to eventually go away. There's is a pretty good chance this is " "not what you were looking for." msgstr "" -#: library/importlib.rst:1417 +#: library/importlib.rst:1480 msgid "" "You can get the same effect as this function by implementing the basic " "interface of multi-phase init (:pep:`489`) and lying about support for " "multiple interpreters (or per-interpreter GIL)." msgstr "" -#: library/importlib.rst:1422 +#: library/importlib.rst:1485 msgid "" "Using this function to disable the check can lead to unexpected behavior and " "even crashes. It should only be used during extension module development." msgstr "" -#: library/importlib.rst:1430 +#: library/importlib.rst:1493 msgid "" "A class which postpones the execution of the loader of a module until the " "module has an attribute accessed." msgstr "" -#: library/importlib.rst:1433 +#: library/importlib.rst:1496 msgid "" "This class **only** works with loaders that define :meth:`~importlib.abc." "Loader.exec_module` as control over what module type is used for the module " @@ -1660,7 +1733,7 @@ msgid "" "raised if such a substitution is detected." msgstr "" -#: library/importlib.rst:1444 +#: library/importlib.rst:1507 msgid "" "For projects where startup time is critical, this class allows for " "potentially minimizing the cost of loading a module if it is never used. For " @@ -1669,21 +1742,21 @@ msgid "" "postponed and thus occurring out of context." msgstr "" -#: library/importlib.rst:1452 +#: library/importlib.rst:1515 msgid "" "Began calling :meth:`~importlib.abc.Loader.create_module`, removing the " "compatibility warning for :class:`importlib.machinery.BuiltinImporter` and :" "class:`importlib.machinery.ExtensionFileLoader`." msgstr "" -#: library/importlib.rst:1459 +#: library/importlib.rst:1522 msgid "" "A class method which returns a callable that creates a lazy loader. This is " "meant to be used in situations where the loader is passed by class instead " "of by instance. ::" msgstr "" -#: library/importlib.rst:1464 +#: library/importlib.rst:1527 msgid "" "suffixes = importlib.machinery.SOURCE_SUFFIXES\n" "loader = importlib.machinery.SourceFileLoader\n" @@ -1691,43 +1764,43 @@ msgid "" "finder = importlib.machinery.FileFinder(path, (lazy_loader, suffixes))" msgstr "" -#: library/importlib.rst:1472 +#: library/importlib.rst:1535 msgid "Examples" msgstr "" -#: library/importlib.rst:1475 +#: library/importlib.rst:1538 msgid "Importing programmatically" msgstr "" -#: library/importlib.rst:1477 +#: library/importlib.rst:1540 msgid "" "To programmatically import a module, use :func:`importlib.import_module`. ::" msgstr "" -#: library/importlib.rst:1480 +#: library/importlib.rst:1543 msgid "" "import importlib\n" "\n" "itertools = importlib.import_module('itertools')" msgstr "" -#: library/importlib.rst:1486 +#: library/importlib.rst:1549 msgid "Checking if a module can be imported" msgstr "" -#: library/importlib.rst:1488 +#: library/importlib.rst:1551 msgid "" "If you need to find out if a module can be imported without actually doing " "the import, then you should use :func:`importlib.util.find_spec`." msgstr "" -#: library/importlib.rst:1491 +#: library/importlib.rst:1554 msgid "" "Note that if ``name`` is a submodule (contains a dot), :func:`importlib.util." "find_spec` will import the parent module. ::" msgstr "" -#: library/importlib.rst:1495 +#: library/importlib.rst:1558 msgid "" "import importlib.util\n" "import sys\n" @@ -1747,11 +1820,11 @@ msgid "" " print(f\"can't find the {name!r} module\")" msgstr "" -#: library/importlib.rst:1514 +#: library/importlib.rst:1577 msgid "Importing a source file directly" msgstr "" -#: library/importlib.rst:1516 +#: library/importlib.rst:1579 msgid "" "This recipe should be used with caution: it is an approximation of an import " "statement where the file path is specified directly, rather than :data:`sys." @@ -1761,13 +1834,13 @@ msgid "" "file is appropriate." msgstr "" -#: library/importlib.rst:1523 +#: library/importlib.rst:1586 msgid "" "To import a Python source file directly from a path, use the following " "recipe::" msgstr "" -#: library/importlib.rst:1525 +#: library/importlib.rst:1588 msgid "" "import importlib.util\n" "import sys\n" @@ -1790,15 +1863,15 @@ msgid "" "json = import_from_path(module_name, file_path)" msgstr "" -#: library/importlib.rst:1547 +#: library/importlib.rst:1610 msgid "Implementing lazy imports" msgstr "" -#: library/importlib.rst:1549 +#: library/importlib.rst:1612 msgid "The example below shows how to implement lazy imports::" msgstr "" -#: library/importlib.rst:1551 +#: library/importlib.rst:1614 msgid "" ">>> import importlib.util\n" ">>> import sys\n" @@ -1818,11 +1891,11 @@ msgid "" "False" msgstr "" -#: library/importlib.rst:1570 +#: library/importlib.rst:1633 msgid "Setting up an importer" msgstr "" -#: library/importlib.rst:1572 +#: library/importlib.rst:1635 msgid "" "For deep customizations of import, you typically want to implement an :term:" "`importer`. This means managing both the :term:`finder` and :term:`loader` " @@ -1836,7 +1909,7 @@ msgid "" "for the appropriate classes defined within this package)::" msgstr "" -#: library/importlib.rst:1583 +#: library/importlib.rst:1646 msgid "" "import importlib.machinery\n" "import sys\n" @@ -1860,11 +1933,11 @@ msgid "" "sys.path_hooks.append(SpamPathEntryFinder.path_hook(loader_details))" msgstr "" -#: library/importlib.rst:1604 +#: library/importlib.rst:1667 msgid "Approximating :func:`importlib.import_module`" msgstr "" -#: library/importlib.rst:1606 +#: library/importlib.rst:1669 msgid "" "Import itself is implemented in Python code, making it possible to expose " "most of the import machinery through importlib. The following helps " @@ -1872,7 +1945,7 @@ msgid "" "approximate implementation of :func:`importlib.import_module`::" msgstr "" -#: library/importlib.rst:1612 +#: library/importlib.rst:1675 msgid "" "import importlib.util\n" "import sys\n" diff --git a/library/importlib.resources.abc.po b/library/importlib.resources.abc.po index f45b4575..b7543f57 100644 --- a/library/importlib.resources.abc.po +++ b/library/importlib.resources.abc.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" diff --git a/library/importlib.resources.po b/library/importlib.resources.po index 29c0f5d7..7a052c1f 100644 --- a/library/importlib.resources.po +++ b/library/importlib.resources.po @@ -8,8 +8,8 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" -"PO-Revision-Date: 2025-05-03 00:09+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" +"PO-Revision-Date: 2025-05-06 12:58+0300\n" "Last-Translator: Marios Giannopoulos \n" "Language-Team: PyGreece \n" "Language: \n" @@ -201,251 +201,393 @@ msgid "Added support for *traversable* representing a directory." msgstr "" "Προστέθηκε υποστήριξη για *traversable* που αντιπροσωπεύει έναν κατάλογο." -#: library/importlib.resources.rst:103 +#: library/importlib.resources.rst:105 msgid "Functional API" msgstr "Λειτουργικό API" -#: library/importlib.resources.rst:105 +#: library/importlib.resources.rst:107 msgid "" -"An older, previously deprecated set of functions is still available. The " -"main drawback of these functions is that they do not support directories: " -"they assume all resources are located directly within a *package*." +"A set of simplified, backwards-compatible helpers is available. These allow " +"common operations in a single function call." msgstr "" -"Μια παλαιότερη, απαρχαιωμένη σειρά συναρτήσεων εξακολουθεί να είναι " -"διαθέσιμη. Το κύριο μειονέκτημα αυτών των συναρτήσεων είναι ότι δεν " -"υποστηρίζουν καταλόγους: υποθέτουν ότι όλοι οι πόροι βρίσκονται απευθείας " -"μέσα σε ένα *package*." +"Ένα σύνολο απλοποιημένων, βοηθών συμβατών με προηγούμενες εκδόσεις είναι " +"διαθέσιμο. Αυτά επιτρέπουν κοινές λειτουργίες σε μια κλήση συνάρτησης." + +#: library/importlib.resources.rst:110 +msgid "For all the following functions:" +msgstr "Για όλες τις παρακάτω λειτουργίες:" -#: library/importlib.resources.rst:111 +#: library/importlib.resources.rst:112 msgid "" -"Whenever a function accepts a ``Package`` argument, you can pass in either " -"a :class:`module object ` or a module name as a string. " -"You can only pass module objects whose ``__spec__." -"submodule_search_locations`` is not ``None``." +"*anchor* is an :class:`~importlib.resources.Anchor`, as in :func:`~importlib." +"resources.files`. Unlike in ``files``, it may not be omitted." msgstr "" -"Όταν μια συνάρτηση δέχεται ένα όρισμα ``Package``, μπορείτε να περάσετε είτε " -"ένα :class:`module object ` είτε όνομα module ως " -"συμβολοσειρά. Μπορείτε να περάσετε μόνο αντικείμενα module των οποίων το " -"``__spec__.submodule_search_locations`` δεν είναι ``None``." +"Το *anchor* είναι μια :class:`~importlib.resources.Anchor`, όπως στη :func:" +"`~importlib.resources.files`. Σε αντίθεση με τα ``αρχεία``, ενδέχεται να μην " +"παραλειφθεί." #: library/importlib.resources.rst:116 -msgid "The ``Package`` type is defined as ``Union[str, ModuleType]``." -msgstr "Ο τύπος ``Package`` ορίζεται ως ``Union[str, ModuleType]``." +msgid "" +"*path_names* are components of a resource's path name, relative to the " +"anchor. For example, to get the text of resource named ``info.txt``, use::" +msgstr "" +"Τα *path_names* είναι στοιχεία του ονόματος διαδρομής ενός πόρου, σε σχέση " +"με το anchor. Για παράδειγμα, για να λάβετε το κείμενο του πόρου με το όνομα " +"``info.txt``, χρησιμοποιήστε::" + +#: library/importlib.resources.rst:120 +msgid "importlib.resources.read_text(my_module, \"info.txt\")" +msgstr "importlib.resources.read_text(my_module, \"info.txt\")" -#: library/importlib.resources.rst:121 +#: library/importlib.resources.rst:122 msgid "" -"For *resource* arguments of the functions below, you can pass in the name of " -"a resource as a string or a :class:`path-like object `." +"Like :meth:`Traversable.joinpath `, The " +"individual components should use forward slashes (``/``) as path separators. " +"For example, the following are equivalent::" msgstr "" -"Για τα ορίσματα *resource* στις παρακάτω συναρτήσεις, μπορείτε να περάσετε " -"το όνομα ενός πόρου ως συμβολοσειρά ή ένα :class:`path-like object `." +"Όπως :meth:`Traversable.joinpath `, Τα " +"μεμονωμένα στοιχεία θα πρέπει να χρησιμοποιούν κάθετε (``/``) ως διαχωριστές " +"διαδρομή. Για παράδειγμα, τα ακόλουθα είναι ισοδύναμα::" -#: library/importlib.resources.rst:125 -msgid "The ``Resource`` type is defined as ``Union[str, os.PathLike]``." -msgstr "Ο τύπος ``Resource`` ορίζεται ως ``Union[str, os.PathLike]``." +#: library/importlib.resources.rst:127 +msgid "" +"importlib.resources.read_binary(my_module, \"pics/painting.png\")\n" +"importlib.resources.read_binary(my_module, \"pics\", \"painting.png\")" +msgstr "" +"importlib.resources.read_binary(my_module, \"pics/painting.png\")\n" +"importlib.resources.read_binary(my_module, \"pics\", \"painting.png\")" #: library/importlib.resources.rst:130 -msgid "Open for binary reading the *resource* within *package*." -msgstr "Ανοίγει για δυαδική ανάγνωση το *resource* μέσα στο *package*." - -#: library/importlib.resources.rst:132 -msgid "" -"*package* is either a name or a module object which conforms to the " -"``Package`` requirements. *resource* is the name of the resource to open " -"within *package*; it may not contain path separators and it may not have sub-" -"resources (i.e. it cannot be a directory). This function returns a ``typing." -"BinaryIO`` instance, a binary I/O stream open for reading." -msgstr "" -"Το *package* είναι είτε όνομα είτε αντικείμενο module που συμμορφώνεται με " -"τις απαιτήσεις της κλάσης ``Package``. Το *resource* είναι το όνομα του " -"πόρου που θα ανοιχτεί μέσα στο *package*· δεν μπορεί να περιέχει " -"διαχωριστικά διαδρομών και δεν μπορεί να έχει υπο-πόρους (δηλαδή δεν μπορεί " -"να είναι κατάλογος). Αυτή η συνάρτηση επιστρέφει ένα στιγμιότυπο ``typing." -"BinaryIO``, δηλαδή ένα δυαδικό ρεύμα εισόδου (binary I/O stream) ανοιχτό για " -"ανάγνωση." - -#: library/importlib.resources.rst:138 library/importlib.resources.rst:157 -#: library/importlib.resources.rst:173 library/importlib.resources.rst:190 -#: library/importlib.resources.rst:222 library/importlib.resources.rst:236 -msgid "This function is roughly equivalent to::" -msgstr "Αυτή η συνάρτηση είναι περίπου ισοδύναμη με::" - -#: library/importlib.resources.rst:140 -msgid "files(package).joinpath(resource).open('rb')" -msgstr "files(package).joinpath(resource).open('rb')" +msgid "" +"For backward compatibility reasons, functions that read text require an " +"explicit *encoding* argument if multiple *path_names* are given. For " +"example, to get the text of ``info/chapter1.txt``, use::" +msgstr "" +"Για λόγους συμβατότητας προς τα πίσω, οι συναρτήσεις που διαβάζουν κείμενο " +"απαιτούν ένα ρητό όρισμα *encoding* εάν δίνονται πολλά *path_names*. Για " +"παράδειγμα, για να λάβετε το κείμενο του ``info/chapter1.txt``, " +"χρησιμοποιήστε::" -#: library/importlib.resources.rst:145 +#: library/importlib.resources.rst:134 msgid "" -"Open for text reading the *resource* within *package*. By default, the " -"resource is opened for reading as UTF-8." +"importlib.resources.read_text(my_module, \"info\", \"chapter1.txt\",\n" +" encoding='utf-8')" msgstr "" -"Ανοίγει για ανάγνωση κειμένου το *resource* μέσα στο *package*. Από " -"προεπιλογή, ο πόρος ανοίγει για ανάγνωση ως UTF-8." +"importlib.resources.read_text(my_module, \"info\", \"chapter1.txt\",\n" +" encoding='utf-8')" + +#: library/importlib.resources.rst:139 +msgid "Open the named resource for binary reading." +msgstr "Ανοίξτε τον πόρο με όνομα για δυαδική ανάγνωση." -#: library/importlib.resources.rst:148 +#: library/importlib.resources.rst:141 library/importlib.resources.rst:184 +#: library/importlib.resources.rst:232 library/importlib.resources.rst:249 +#: library/importlib.resources.rst:267 msgid "" -"*package* is either a name or a module object which conforms to the " -"``Package`` requirements. *resource* is the name of the resource to open " -"within *package*; it may not contain path separators and it may not have sub-" -"resources (i.e. it cannot be a directory). *encoding* and *errors* have the " -"same meaning as with built-in :func:`open`." +"See :ref:`the introduction ` for details on " +"*anchor* and *path_names*." msgstr "" -"Το *package* είναι είτε ένα όνομα είτε ένα αντικείμενο module που " -"συμμορφώνεται με τις απαιτήσεις της κλάσης ``Package``. Το *resource* είναι " -"το όνομα του πόρου που θα ανοιχτεί μέσα στο *package*· δεν μπορεί να " -"περιέχει διαχωριστικά διαδρομών και δεν μπορεί να έχει υπο-πόρους (δηλαδή " -"δεν μπορεί να είναι κατάλογος). Οι παράμετροι *encoding* και *errors* έχουν " -"την ίδια σημασία όπως στην ενσωματωμένη :func:`open`." +"Δείτε :ref:`the introduction ` για " +"λεπτομέρειες σχετικά με το *anchor* και *path_names*." -#: library/importlib.resources.rst:154 +#: library/importlib.resources.rst:144 msgid "" -"This function returns a ``typing.TextIO`` instance, a text I/O stream open " -"for reading." +"This function returns a :class:`~typing.BinaryIO` object, that is, a binary " +"stream open for reading." msgstr "" -"Αυτή η συνάρτηση επιστρέφει ένα στιγμιότυπο ``typing.TextIO``, δηλαδή ένα " -"ρεύμα εισόδου κειμένου (text I/O stream) ανοιχτό για ανάγνωση." +"Αυτή η συνάρτηση επιστρέφει ένα αντικείμενο :class:`~typing.BinaryIO`, ένα " +"δυαδικό ρεύμα εισόδου για ανάγνωση." + +#: library/importlib.resources.rst:147 library/importlib.resources.rst:171 +#: library/importlib.resources.rst:187 library/importlib.resources.rst:208 +#: library/importlib.resources.rst:235 library/importlib.resources.rst:252 +#: library/importlib.resources.rst:270 +msgid "This function is roughly equivalent to::" +msgstr "Αυτή η συνάρτηση είναι περίπου ισοδύναμη με::" + +#: library/importlib.resources.rst:149 +msgid "files(anchor).joinpath(*path_names).open('rb')" +msgstr "files(anchor).joinpath(*path_names).open('rb')" -#: library/importlib.resources.rst:159 -msgid "files(package).joinpath(resource).open('r', encoding=encoding)" -msgstr "files(package).joinpath(resource).open('r', encoding=encoding)" +#: library/importlib.resources.rst:151 library/importlib.resources.rst:191 +#: library/importlib.resources.rst:256 +msgid "Multiple *path_names* are accepted." +msgstr "Γίνονται αποδεκτά πολλά *path_names*." -#: library/importlib.resources.rst:164 +#: library/importlib.resources.rst:157 msgid "" -"Read and return the contents of the *resource* within *package* as ``bytes``." +"Open the named resource for text reading. By default, the contents are read " +"as strict UTF-8." msgstr "" -"Διαβάζει και επιστρέφει τα περιεχόμενα του *resource* μέσα στο *package* ως " -"``bytes``." +"Ανοίγει τον δεδομένο πόρο για ανάγνωση κειμένου. Από προεπιλογή, τα " +"περιεχόμενα διαβάζονται ως αυστηρά UTF-8." -#: library/importlib.resources.rst:167 +#: library/importlib.resources.rst:160 library/importlib.resources.rst:200 msgid "" -"*package* is either a name or a module object which conforms to the " -"``Package`` requirements. *resource* is the name of the resource to open " -"within *package*; it may not contain path separators and it may not have sub-" -"resources (i.e. it cannot be a directory). This function returns the " -"contents of the resource as :class:`bytes`." +"See :ref:`the introduction ` for details on " +"*anchor* and *path_names*. *encoding* and *errors* have the same meaning as " +"in built-in :func:`open`." msgstr "" -"Το *package* είναι είτε ένα όνομα είτε ένα αντικείμενο module που " -"συμμορφώνεται με τις απαιτήσεις της κλάσης ``Package``. Το *resource* είναι " -"το όνομα του πόρου μέσα στο *package*· δεν μπορεί να περιέχει διαχωριστικά " -"διαδρομών και δεν μπορεί να έχει υπο-πόρους (δηλαδή δεν μπορεί να είναι " -"κατάλογος). Αυτή η συνάρτηση επιστρέφει τα περιεχόμενα του πόρου ως :class:" -"`bytes`." +"Δείτε :ref:`the introduction ` για " +"λεπτομέρειες σχετικά με το *anchor* και το *path_names*. Τα *encoding* και " +"*errors* έχουν την ίδια σημασία όπως στο ενσωματωμένο :func:`open`." -#: library/importlib.resources.rst:175 -msgid "files(package).joinpath(resource).read_bytes()" -msgstr "files(package).joinpath(resource).read_bytes()" +#: library/importlib.resources.rst:164 library/importlib.resources.rst:204 +msgid "" +"For backward compatibility reasons, the *encoding* argument must be given " +"explicitly if there are multiple *path_names*. This limitation is scheduled " +"to be removed in Python 3.15." +msgstr "" +"Για λόγους συμβατότητας για προηγούμενες εκδόσεις, το όρισμα *encoding* " +"πρέπει να δίνεται ρητά εάν υπάρχουν πολλά *path_names*. Αυτό ο περιορισμός " +"έχει προγραμματιστεί να καταργηθεί στην Python 3.15." -#: library/importlib.resources.rst:180 +#: library/importlib.resources.rst:168 msgid "" -"Read and return the contents of *resource* within *package* as a ``str``. By " -"default, the contents are read as strict UTF-8." +"This function returns a :class:`~typing.TextIO` object, that is, a text " +"stream open for reading." msgstr "" -"Διαβάζει και επιστρέφει τα περιεχόμενα του *resource* μέσα στο *package* ως " -"``str``. Από προεπιλογή, τα περιεχόμενα διαβάζονται ως αυστηρό UTF-8." +"Αυτή η συνάρτηση επιστρέφει ένα :class:`~typing.TextIO` αντικείμενο, δηλαδή " +"ένα ρεύμα εισόδου για ανάγνωση." -#: library/importlib.resources.rst:183 +#: library/importlib.resources.rst:173 +msgid "files(anchor).joinpath(*path_names).open('r', encoding=encoding)" +msgstr "files(anchor).joinpath(*path_names).open('r', encoding=encoding)" + +#: library/importlib.resources.rst:175 library/importlib.resources.rst:212 +#: library/importlib.resources.rst:239 msgid "" -"*package* is either a name or a module object which conforms to the " -"``Package`` requirements. *resource* is the name of the resource to open " -"within *package*; it may not contain path separators and it may not have sub-" -"resources (i.e. it cannot be a directory). *encoding* and *errors* have the " -"same meaning as with built-in :func:`open`. This function returns the " -"contents of the resource as :class:`str`." +"Multiple *path_names* are accepted. *encoding* and *errors* must be given as " +"keyword arguments." +msgstr "" +"Πολλαπλά *path_names* γίνονται δεκτά. Τα *encoding* και *errors* πρέπει να " +"δίνονται ως ορίσματα λέξεων-κλειδιών." + +#: library/importlib.resources.rst:182 +msgid "Read and return the contents of the named resource as :class:`bytes`." msgstr "" -"Το *package* είναι είτε όνομα είτε αντικείμενο module που συμμορφώνεται με " -"τις απαιτήσεις της κλάσης ``Package``. Το *resource* είναι το όνομα του " -"πόρου μέσα στο *package*· δεν μπορεί να περιέχει διαχωριστικά διαδρομών και " -"δεν μπορεί να έχει υπο-πόρους (δηλαδή δεν μπορεί να είναι κατάλογος). Οι " -"παράμετροι *encoding* και *errors* έχουν την ίδια σημασία όπως στην " -"ενσωματωμένη :func:`open`. Αυτή η συνάρτηση επιστρέφει τα περιεχόμενα του " -"πόρου ως :class:`str`." +"Διαβάζει και επιστρέφει τα περιεχόμενα του δεδομένου πόρου ως :class:`bytes`." -#: library/importlib.resources.rst:192 -msgid "files(package).joinpath(resource).read_text(encoding=encoding)" -msgstr "files(package).joinpath(resource).read_text(encoding=encoding)" +#: library/importlib.resources.rst:189 +msgid "files(anchor).joinpath(*path_names).read_bytes()" +msgstr "files(anchor).joinpath(*path_names).read_bytes()" #: library/importlib.resources.rst:197 msgid "" -"Return the path to the *resource* as an actual file system path. This " +"Read and return the contents of the named resource as :class:`str`. By " +"default, the contents are read as strict UTF-8." +msgstr "" +"Διαβάζει και επιστρέφει τα περιεχόμενα του δεδομένου πόρου μέσα στο ως :" +"class:`str`. Από προεπιλογή, τα περιεχόμενα διαβάζονται ως αυστηρό UTF-8." + +#: library/importlib.resources.rst:210 +msgid "files(anchor).joinpath(*path_names).read_text(encoding=encoding)" +msgstr "files(anchor).joinpath(*path_names).read_text(encoding=encoding)" + +#: library/importlib.resources.rst:219 +msgid "" +"Provides the path to the *resource* as an actual file system path. This " "function returns a context manager for use in a :keyword:`with` statement. " "The context manager provides a :class:`pathlib.Path` object." msgstr "" -"Επιστρέφει τη διαδρομή του *resource* ως πραγματική διαδρομή συστήματος " -"αρχείων. Αυτή η συνάρτηση επιστρέφει ένα context manager για χρήση σε μια :" -"keyword:`with` πρόταση. Ο context manager παρέχει ένα αντικείμενο :class:" -"`pathlib.Path`." +"Παρέχει τη διαδρομή του *resource* ως πραγματική διαδρομή συστήματος " +"αρχείων. Αυτή η συνάρτηση επιστρέφει ένα διαχειριστή περιεχομένου για χρήση " +"σε μια :keyword:`with` πρόταση. Ο διαχειριστής περιεχομένου παρέχει ένα " +"αντικείμενο :class:`pathlib.Path`." -#: library/importlib.resources.rst:201 +#: library/importlib.resources.rst:223 msgid "" -"Exiting the context manager cleans up any temporary file created when the " -"resource needs to be extracted from e.g. a zip file." +"Exiting the context manager cleans up any temporary files created, e.g. when " +"the resource needs to be extracted from a zip file." msgstr "" -"Η έξοδος από τον context manager καθαρίζει οποιοδήποτε προσωρινό αρχείο " -"δημιουργήθηκε όταν ο πόρος χρειάστηκε να εξαχθεί, π.χ. από αρχείο zip." +"Η έξοδος από τον context manager καθαρίζει οποιοδήποτε προσωρινό αρχείο που " +"δημιουργήθηκε, π.χ. όταν ο πόρος χρειάστηκε να εξαχθεί από ένα αρχείο zip." -#: library/importlib.resources.rst:204 +#: library/importlib.resources.rst:226 msgid "" -"*package* is either a name or a module object which conforms to the " -"``Package`` requirements. *resource* is the name of the resource to open " -"within *package*; it may not contain path separators and it may not have sub-" -"resources (i.e. it cannot be a directory)." +"For example, the :meth:`~pathlib.Path.stat` method requires an actual file " +"system path; it can be used like this::" msgstr "" -"Το *package* είναι είτε ένα όνομα είτε ένα αντικείμενο module που " -"συμμορφώνεται με τις απαιτήσεις της κλάσης ``Package``. Το *resource* είναι " -"το όνομα του πόρου μέσα στο *package*· δεν μπορεί να περιέχει διαχωριστικά " -"διαδρομών και δεν μπορεί να έχει υπο-πόρους (δηλαδή δεν μπορεί να είναι " -"κατάλογος)." +"Για παράδειγμα, η μέθοδος :meth:`~pathlib.Path.stat` απαιτεί μια πραγματική " +"διαδρομή συστήματος αρχείων· μπορεί να χρησιμοποιηθεί ως εξής::" -#: library/importlib.resources.rst:209 -msgid "This function is roughly equivalent to ::" -msgstr "Αυτή η συνάρτηση είναι περίπου ισοδύναμη με ::" +#: library/importlib.resources.rst:229 +msgid "" +"with importlib.resources.path(anchor, \"resource.txt\") as fspath:\n" +" result = fspath.stat()" +msgstr "" +"with importlib.resources.path(anchor, \"resource.txt\") as fspath:\n" +" result = fspath.stat()" -#: library/importlib.resources.rst:211 -msgid "as_file(files(package).joinpath(resource))" -msgstr "as_file(files(package).joinpath(resource))" +#: library/importlib.resources.rst:237 +msgid "as_file(files(anchor).joinpath(*path_names))" +msgstr "as_file(files(anchor).joinpath(*path_names))" -#: library/importlib.resources.rst:216 +#: library/importlib.resources.rst:246 msgid "" -"Return ``True`` if there is a resource named *name* in the package, " -"otherwise ``False``. This function does not consider directories to be " -"resources. *package* is either a name or a module object which conforms to " -"the ``Package`` requirements." +"Return ``True`` if the named resource exists, otherwise ``False``. This " +"function does not consider directories to be resources." msgstr "" -"Επιστρέφει ``True`` αν υπάρχει πόρος με όνομα *name* στο πακέτο, αλλιώς " -"``False``. Αυτή η συνάρτηση δεν θεωρεί τους καταλόγους ως πόρους. *package* " -"είναι είτε όνομα είτε αντικείμενο module που πληροί τις απαιτήσεις " -"``Package``." +"Επιστρέφετε ``True`` εάν υπάρχει ο δεδομένος πόρος, διαφορετικά ``False``. " +"Αυτή η συνάρτηση δεν θεωρεί τους καταλόγους ως πόρους." -#: library/importlib.resources.rst:224 -msgid "files(package).joinpath(resource).is_file()" -msgstr "files(package).joinpath(resource).is_file()" +#: library/importlib.resources.rst:254 +msgid "files(anchor).joinpath(*path_names).is_file()" +msgstr "files(anchor).joinpath(*path_names).is_file()" -#: library/importlib.resources.rst:229 +#: library/importlib.resources.rst:262 msgid "" -"Return an iterable over the named items within the package. The iterable " -"returns :class:`str` resources (e.g. files) and non-resources (e.g. " -"directories). The iterable does not recurse into subdirectories." +"Return an iterable over the named items within the package or path. The " +"iterable returns names of resources (e.g. files) and non-resources (e.g. " +"directories) as :class:`str`. The iterable does not recurse into " +"subdirectories." msgstr "" -"Επιστρέφει ένα iterable πάνω στα ονομασμένα στοιχεία μέσα στο πακέτο. Το " -"iterable επιστρέφει πόρους :class:`str` (π.χ. αρχεία) και μη-πόρους (π.χ. " -"καταλόγους). Το iterable δεν επαναλαμβάνεται σε υποκαταλόγους." +"Επιστρέφει ένα iterable πάνω στα ονομασμένα στοιχεία μέσα στο πακέτο ή στη " +"διαδρομή. Το iterable επιστρέφει τα ονόματα των πόρων (π.χ. αρχεία) και μη-" +"πόρους (π.χ. καταλόγους) ως :class:`str`. Το iterable δεν επαναλαμβάνεται σε " +"υποκαταλόγους." -#: library/importlib.resources.rst:233 +#: library/importlib.resources.rst:272 msgid "" -"*package* is either a name or a module object which conforms to the " -"``Package`` requirements." +"for resource in files(anchor).joinpath(*path_names).iterdir():\n" +" yield resource.name" msgstr "" -"Το *package* είναι είτε ένα όνομα είτε ένα αντικείμενο module που " -"συμμορφώνεται με τις απαιτήσεις της κλάσης ``Package``." +"for resource in files(anchor).joinpath(*path_names).iterdir():\n" +" yield resource.name" -#: library/importlib.resources.rst:238 +#: library/importlib.resources.rst:275 msgid "" -"(resource.name for resource in files(package).iterdir() if resource." -"is_file())" +"Prefer ``iterdir()`` as above, which offers more control over the results " +"and richer functionality." msgstr "" -"(resource.name for resource in files(package).iterdir() if resource." -"is_file())" +"Προτιμήστε το ``iterdir()`` όπως παραπάνω, το οποίο προσφέρει περισσότερο " +"έλεγχο στα αποτελέσματα και πιο πλούσια λειτουργικότητα." + +#~ msgid "" +#~ "An older, previously deprecated set of functions is still available. The " +#~ "main drawback of these functions is that they do not support directories: " +#~ "they assume all resources are located directly within a *package*." +#~ msgstr "" +#~ "Μια παλαιότερη, απαρχαιωμένη σειρά συναρτήσεων εξακολουθεί να είναι " +#~ "διαθέσιμη. Το κύριο μειονέκτημα αυτών των συναρτήσεων είναι ότι δεν " +#~ "υποστηρίζουν καταλόγους: υποθέτουν ότι όλοι οι πόροι βρίσκονται απευθείας " +#~ "μέσα σε ένα *package*." + +#~ msgid "" +#~ "Whenever a function accepts a ``Package`` argument, you can pass in " +#~ "either a :class:`module object ` or a module name as a " +#~ "string. You can only pass module objects whose ``__spec__." +#~ "submodule_search_locations`` is not ``None``." +#~ msgstr "" +#~ "Όταν μια συνάρτηση δέχεται ένα όρισμα ``Package``, μπορείτε να περάσετε " +#~ "είτε ένα :class:`module object ` είτε όνομα module ως " +#~ "συμβολοσειρά. Μπορείτε να περάσετε μόνο αντικείμενα module των οποίων το " +#~ "``__spec__.submodule_search_locations`` δεν είναι ``None``." + +#~ msgid "The ``Package`` type is defined as ``Union[str, ModuleType]``." +#~ msgstr "Ο τύπος ``Package`` ορίζεται ως ``Union[str, ModuleType]``." + +#~ msgid "" +#~ "For *resource* arguments of the functions below, you can pass in the name " +#~ "of a resource as a string or a :class:`path-like object `." +#~ msgstr "" +#~ "Για τα ορίσματα *resource* στις παρακάτω συναρτήσεις, μπορείτε να " +#~ "περάσετε το όνομα ενός πόρου ως συμβολοσειρά ή ένα :class:`path-like " +#~ "object `." + +#~ msgid "The ``Resource`` type is defined as ``Union[str, os.PathLike]``." +#~ msgstr "Ο τύπος ``Resource`` ορίζεται ως ``Union[str, os.PathLike]``." + +#~ msgid "Open for binary reading the *resource* within *package*." +#~ msgstr "Ανοίγει για δυαδική ανάγνωση το *resource* μέσα στο *package*." + +#~ msgid "" +#~ "*package* is either a name or a module object which conforms to the " +#~ "``Package`` requirements. *resource* is the name of the resource to open " +#~ "within *package*; it may not contain path separators and it may not have " +#~ "sub-resources (i.e. it cannot be a directory). This function returns a " +#~ "``typing.BinaryIO`` instance, a binary I/O stream open for reading." +#~ msgstr "" +#~ "Το *package* είναι είτε όνομα είτε αντικείμενο module που συμμορφώνεται " +#~ "με τις απαιτήσεις της κλάσης ``Package``. Το *resource* είναι το όνομα " +#~ "του πόρου που θα ανοιχτεί μέσα στο *package*· δεν μπορεί να περιέχει " +#~ "διαχωριστικά διαδρομών και δεν μπορεί να έχει υπο-πόρους (δηλαδή δεν " +#~ "μπορεί να είναι κατάλογος). Αυτή η συνάρτηση επιστρέφει ένα στιγμιότυπο " +#~ "``typing.BinaryIO``, δηλαδή ένα δυαδικό ρεύμα εισόδου (binary I/O stream) " +#~ "ανοιχτό για ανάγνωση." + +#~ msgid "" +#~ "Open for text reading the *resource* within *package*. By default, the " +#~ "resource is opened for reading as UTF-8." +#~ msgstr "" +#~ "Ανοίγει για ανάγνωση κειμένου το *resource* μέσα στο *package*. Από " +#~ "προεπιλογή, ο πόρος ανοίγει για ανάγνωση ως UTF-8." + +#~ msgid "" +#~ "*package* is either a name or a module object which conforms to the " +#~ "``Package`` requirements. *resource* is the name of the resource to open " +#~ "within *package*; it may not contain path separators and it may not have " +#~ "sub-resources (i.e. it cannot be a directory). *encoding* and *errors* " +#~ "have the same meaning as with built-in :func:`open`." +#~ msgstr "" +#~ "Το *package* είναι είτε ένα όνομα είτε ένα αντικείμενο module που " +#~ "συμμορφώνεται με τις απαιτήσεις της κλάσης ``Package``. Το *resource* " +#~ "είναι το όνομα του πόρου που θα ανοιχτεί μέσα στο *package*· δεν μπορεί " +#~ "να περιέχει διαχωριστικά διαδρομών και δεν μπορεί να έχει υπο-πόρους " +#~ "(δηλαδή δεν μπορεί να είναι κατάλογος). Οι παράμετροι *encoding* και " +#~ "*errors* έχουν την ίδια σημασία όπως στην ενσωματωμένη :func:`open`." + +#~ msgid "" +#~ "*package* is either a name or a module object which conforms to the " +#~ "``Package`` requirements. *resource* is the name of the resource to open " +#~ "within *package*; it may not contain path separators and it may not have " +#~ "sub-resources (i.e. it cannot be a directory). This function returns the " +#~ "contents of the resource as :class:`bytes`." +#~ msgstr "" +#~ "Το *package* είναι είτε ένα όνομα είτε ένα αντικείμενο module που " +#~ "συμμορφώνεται με τις απαιτήσεις της κλάσης ``Package``. Το *resource* " +#~ "είναι το όνομα του πόρου μέσα στο *package*· δεν μπορεί να περιέχει " +#~ "διαχωριστικά διαδρομών και δεν μπορεί να έχει υπο-πόρους (δηλαδή δεν " +#~ "μπορεί να είναι κατάλογος). Αυτή η συνάρτηση επιστρέφει τα περιεχόμενα " +#~ "του πόρου ως :class:`bytes`." + +#~ msgid "" +#~ "*package* is either a name or a module object which conforms to the " +#~ "``Package`` requirements. *resource* is the name of the resource to open " +#~ "within *package*; it may not contain path separators and it may not have " +#~ "sub-resources (i.e. it cannot be a directory). *encoding* and *errors* " +#~ "have the same meaning as with built-in :func:`open`. This function " +#~ "returns the contents of the resource as :class:`str`." +#~ msgstr "" +#~ "Το *package* είναι είτε όνομα είτε αντικείμενο module που συμμορφώνεται " +#~ "με τις απαιτήσεις της κλάσης ``Package``. Το *resource* είναι το όνομα " +#~ "του πόρου μέσα στο *package*· δεν μπορεί να περιέχει διαχωριστικά " +#~ "διαδρομών και δεν μπορεί να έχει υπο-πόρους (δηλαδή δεν μπορεί να είναι " +#~ "κατάλογος). Οι παράμετροι *encoding* και *errors* έχουν την ίδια σημασία " +#~ "όπως στην ενσωματωμένη :func:`open`. Αυτή η συνάρτηση επιστρέφει τα " +#~ "περιεχόμενα του πόρου ως :class:`str`." + +#~ msgid "" +#~ "*package* is either a name or a module object which conforms to the " +#~ "``Package`` requirements. *resource* is the name of the resource to open " +#~ "within *package*; it may not contain path separators and it may not have " +#~ "sub-resources (i.e. it cannot be a directory)." +#~ msgstr "" +#~ "Το *package* είναι είτε ένα όνομα είτε ένα αντικείμενο module που " +#~ "συμμορφώνεται με τις απαιτήσεις της κλάσης ``Package``. Το *resource* " +#~ "είναι το όνομα του πόρου μέσα στο *package*· δεν μπορεί να περιέχει " +#~ "διαχωριστικά διαδρομών και δεν μπορεί να έχει υπο-πόρους (δηλαδή δεν " +#~ "μπορεί να είναι κατάλογος)." + +#~ msgid "This function is roughly equivalent to ::" +#~ msgstr "Αυτή η συνάρτηση είναι περίπου ισοδύναμη με ::" + +#~ msgid "" +#~ "*package* is either a name or a module object which conforms to the " +#~ "``Package`` requirements." +#~ msgstr "" +#~ "Το *package* είναι είτε ένα όνομα είτε ένα αντικείμενο module που " +#~ "συμμορφώνεται με τις απαιτήσεις της κλάσης ``Package``." #~ msgid "Deprecated functions" #~ msgstr "Απαρχαιωμένες συναρτήσεις" diff --git a/library/index.po b/library/index.po index 16dbc9a8..dd0f5132 100644 --- a/library/index.po +++ b/library/index.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" diff --git a/library/inspect.po b/library/inspect.po index ad238a4c..42f0b4ad 100644 --- a/library/inspect.po +++ b/library/inspect.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -652,11 +652,17 @@ msgid "" "wrapped function is a Python generator function." msgstr "" -#: library/inspect.rst:369 +#: library/inspect.rst:366 +msgid "" +"Functions wrapped in :func:`functools.partialmethod` now return ``True`` if " +"the wrapped function is a Python generator function." +msgstr "" + +#: library/inspect.rst:372 msgid "Return ``True`` if the object is a generator." msgstr "" -#: library/inspect.rst:374 +#: library/inspect.rst:377 msgid "" "Return ``True`` if the object is a :term:`coroutine function` (a function " "defined with an :keyword:`async def` syntax), a :func:`functools.partial` " @@ -664,54 +670,60 @@ msgid "" "`markcoroutinefunction`." msgstr "" -#: library/inspect.rst:381 +#: library/inspect.rst:384 msgid "" "Functions wrapped in :func:`functools.partial` now return ``True`` if the " "wrapped function is a :term:`coroutine function`." msgstr "" -#: library/inspect.rst:385 +#: library/inspect.rst:388 msgid "" "Sync functions marked with :func:`markcoroutinefunction` now return ``True``." msgstr "" -#: library/inspect.rst:392 +#: library/inspect.rst:462 +msgid "" +"Functions wrapped in :func:`functools.partialmethod` now return ``True`` if " +"the wrapped function is a :term:`coroutine function`." +msgstr "" + +#: library/inspect.rst:399 msgid "" "Decorator to mark a callable as a :term:`coroutine function` if it would not " "otherwise be detected by :func:`iscoroutinefunction`." msgstr "" -#: library/inspect.rst:395 +#: library/inspect.rst:402 msgid "" "This may be of use for sync functions that return a :term:`coroutine`, if " "the function is passed to an API that requires :func:`iscoroutinefunction`." msgstr "" -#: library/inspect.rst:398 +#: library/inspect.rst:405 msgid "" "When possible, using an :keyword:`async def` function is preferred. Also " "acceptable is calling the function and testing the return with :func:" "`iscoroutine`." msgstr "" -#: library/inspect.rst:407 +#: library/inspect.rst:414 msgid "" "Return ``True`` if the object is a :term:`coroutine` created by an :keyword:" "`async def` function." msgstr "" -#: library/inspect.rst:415 +#: library/inspect.rst:422 msgid "" "Return ``True`` if the object can be used in :keyword:`await` expression." msgstr "" -#: library/inspect.rst:417 +#: library/inspect.rst:424 msgid "" "Can also be used to distinguish generator-based coroutines from regular " "generators:" msgstr "" -#: library/inspect.rst:420 +#: library/inspect.rst:427 msgid "" "import types\n" "\n" @@ -725,13 +737,13 @@ msgid "" "assert isawaitable(gen_coro())" msgstr "" -#: library/inspect.rst:438 +#: library/inspect.rst:445 msgid "" "Return ``True`` if the object is an :term:`asynchronous generator` function, " "for example:" msgstr "" -#: library/inspect.rst:441 +#: library/inspect.rst:448 msgid "" ">>> async def agen():\n" "... yield 1\n" @@ -740,74 +752,74 @@ msgid "" "True" msgstr "" -#: library/inspect.rst:451 +#: library/inspect.rst:458 msgid "" "Functions wrapped in :func:`functools.partial` now return ``True`` if the " "wrapped function is an :term:`asynchronous generator` function." msgstr "" -#: library/inspect.rst:458 +#: library/inspect.rst:468 msgid "" "Return ``True`` if the object is an :term:`asynchronous generator iterator` " "created by an :term:`asynchronous generator` function." msgstr "" -#: library/inspect.rst:465 +#: library/inspect.rst:475 msgid "Return ``True`` if the object is a traceback." msgstr "" -#: library/inspect.rst:470 +#: library/inspect.rst:480 msgid "Return ``True`` if the object is a frame." msgstr "" -#: library/inspect.rst:475 +#: library/inspect.rst:485 msgid "Return ``True`` if the object is a code." msgstr "" -#: library/inspect.rst:480 +#: library/inspect.rst:490 msgid "" "Return ``True`` if the object is a built-in function or a bound built-in " "method." msgstr "" -#: library/inspect.rst:485 +#: library/inspect.rst:495 msgid "" "Return ``True`` if the type of object is a :class:`~types.MethodWrapperType`." msgstr "" -#: library/inspect.rst:487 +#: library/inspect.rst:497 msgid "" "These are instances of :class:`~types.MethodWrapperType`, such as :meth:" "`~object.__str__`, :meth:`~object.__eq__` and :meth:`~object.__repr__`." msgstr "" -#: library/inspect.rst:495 +#: library/inspect.rst:505 msgid "" "Return ``True`` if the object is a user-defined or built-in function or " "method." msgstr "" -#: library/inspect.rst:500 +#: library/inspect.rst:510 msgid "Return ``True`` if the object is an abstract base class." msgstr "" -#: library/inspect.rst:505 +#: library/inspect.rst:515 msgid "" "Return ``True`` if the object is a method descriptor, but not if :func:" "`ismethod`, :func:`isclass`, :func:`isfunction` or :func:`isbuiltin` are " "true." msgstr "" -#: library/inspect.rst:509 +#: library/inspect.rst:519 msgid "" "This, for example, is true of ``int.__add__``. An object passing this test " -"has a :meth:`~object.__get__` method but not a :meth:`~object.__set__` " -"method, but beyond that the set of attributes varies. A :attr:`~definition." -"__name__` attribute is usually sensible, and :attr:`~definition.__doc__` " -"often is." +"has a :meth:`~object.__get__` method, but not a :meth:`~object.__set__` " +"method or a :meth:`~object.__delete__` method. Beyond that, the set of " +"attributes varies. A :attr:`~definition.__name__` attribute is usually " +"sensible, and :attr:`~definition.__doc__` often is." msgstr "" -#: library/inspect.rst:515 +#: library/inspect.rst:525 msgid "" "Methods implemented via descriptors that also pass one of the other tests " "return ``False`` from the :func:`ismethoddescriptor` test, simply because " @@ -815,11 +827,19 @@ msgid "" "`~method.__func__` attribute (etc) when an object passes :func:`ismethod`." msgstr "" -#: library/inspect.rst:524 +#: library/inspect.rst:531 +msgid "" +"This function no longer incorrectly reports objects with :meth:`~object." +"__get__` and :meth:`~object.__delete__`, but not :meth:`~object.__set__`, as " +"being method descriptors (such objects are data descriptors, not method " +"descriptors)." +msgstr "" + +#: library/inspect.rst:539 msgid "Return ``True`` if the object is a data descriptor." msgstr "" -#: library/inspect.rst:526 +#: library/inspect.rst:541 msgid "" "Data descriptors have a :attr:`~object.__set__` or a :attr:`~object." "__delete__` method. Examples are properties (defined in Python), getsets, " @@ -830,33 +850,33 @@ msgid "" "and members have both of these attributes), but this is not guaranteed." msgstr "" -#: library/inspect.rst:537 +#: library/inspect.rst:552 msgid "Return ``True`` if the object is a getset descriptor." msgstr "" -#: library/inspect.rst:541 +#: library/inspect.rst:556 msgid "" "getsets are attributes defined in extension modules via :c:type:" "`PyGetSetDef` structures. For Python implementations without such types, " "this method will always return ``False``." msgstr "" -#: library/inspect.rst:548 +#: library/inspect.rst:563 msgid "Return ``True`` if the object is a member descriptor." msgstr "" -#: library/inspect.rst:552 +#: library/inspect.rst:567 msgid "" "Member descriptors are attributes defined in extension modules via :c:type:" "`PyMemberDef` structures. For Python implementations without such types, " "this method will always return ``False``." msgstr "" -#: library/inspect.rst:560 +#: library/inspect.rst:575 msgid "Retrieving source code" msgstr "" -#: library/inspect.rst:564 +#: library/inspect.rst:579 msgid "" "Get the documentation string for an object, cleaned up with :func:" "`cleandoc`. If the documentation string for an object is not provided and " @@ -865,11 +885,11 @@ msgid "" "documentation string is invalid or missing." msgstr "" -#: library/inspect.rst:570 +#: library/inspect.rst:585 msgid "Documentation strings are now inherited if not overridden." msgstr "" -#: library/inspect.rst:576 +#: library/inspect.rst:591 msgid "" "Return in a single string any lines of comments immediately preceding the " "object's source code (for a class, function, or method), or at the top of " @@ -878,27 +898,27 @@ msgid "" "been defined in C or the interactive shell." msgstr "" -#: library/inspect.rst:585 +#: library/inspect.rst:600 msgid "" "Return the name of the (text or binary) file in which an object was defined. " "This will fail with a :exc:`TypeError` if the object is a built-in module, " "class, or function." msgstr "" -#: library/inspect.rst:592 +#: library/inspect.rst:607 msgid "" "Try to guess which module an object was defined in. Return ``None`` if the " "module cannot be determined." msgstr "" -#: library/inspect.rst:598 +#: library/inspect.rst:613 msgid "" "Return the name of the Python source file in which an object was defined or " "``None`` if no way can be identified to get the source. This will fail with " "a :exc:`TypeError` if the object is a built-in module, class, or function." msgstr "" -#: library/inspect.rst:606 +#: library/inspect.rst:621 msgid "" "Return a list of source lines and starting line number for an object. The " "argument may be a module, class, method, function, traceback, frame, or code " @@ -909,13 +929,13 @@ msgid "" "built-in module, class, or function." msgstr "" -#: library/inspect.rst:629 +#: library/inspect.rst:644 msgid "" ":exc:`OSError` is raised instead of :exc:`IOError`, now an alias of the " "former." msgstr "" -#: library/inspect.rst:622 +#: library/inspect.rst:637 msgid "" "Return the text of the source code for an object. The argument may be a " "module, class, method, function, traceback, frame, or code object. The " @@ -924,13 +944,13 @@ msgid "" "object is a built-in module, class, or function." msgstr "" -#: library/inspect.rst:636 +#: library/inspect.rst:651 msgid "" "Clean up indentation from docstrings that are indented to line up with " "blocks of code." msgstr "" -#: library/inspect.rst:639 +#: library/inspect.rst:654 msgid "" "All leading whitespace is removed from the first line. Any leading " "whitespace that can be uniformly removed from the second line onwards is " @@ -938,22 +958,22 @@ msgid "" "Also, all tabs are expanded to spaces." msgstr "" -#: library/inspect.rst:648 +#: library/inspect.rst:663 msgid "Introspecting callables with the Signature object" msgstr "" -#: library/inspect.rst:652 +#: library/inspect.rst:667 msgid "" "The :class:`Signature` object represents the call signature of a callable " "object and its return annotation. To retrieve a :class:`!Signature` object, " "use the :func:`!signature` function." msgstr "" -#: library/inspect.rst:659 +#: library/inspect.rst:674 msgid "Return a :class:`Signature` object for the given *callable*:" msgstr "" -#: library/inspect.rst:661 +#: library/inspect.rst:676 msgid "" ">>> from inspect import signature\n" ">>> def foo(a, *, b:int, **kwargs):\n" @@ -971,13 +991,13 @@ msgid "" "" msgstr "" -#: library/inspect.rst:678 +#: library/inspect.rst:693 msgid "" "Accepts a wide range of Python callables, from plain functions and classes " "to :func:`functools.partial` objects." msgstr "" -#: library/inspect.rst:681 +#: library/inspect.rst:696 msgid "" "For objects defined in modules using stringized annotations (``from " "__future__ import annotations``), :func:`signature` will attempt to " @@ -987,7 +1007,7 @@ msgid "" "func:`get_annotations` for instructions on how to use these parameters." msgstr "" -#: library/inspect.rst:690 +#: library/inspect.rst:705 msgid "" "Raises :exc:`ValueError` if no signature can be provided, and :exc:" "`TypeError` if that type of object is not supported. Also, if the " @@ -996,32 +1016,32 @@ msgid "" "potentially raise any kind of exception." msgstr "" -#: library/inspect.rst:696 +#: library/inspect.rst:711 msgid "" "A slash(/) in the signature of a function denotes that the parameters prior " "to it are positional-only. For more info, see :ref:`the FAQ entry on " "positional-only parameters `." msgstr "" -#: library/inspect.rst:700 +#: library/inspect.rst:715 msgid "" "The *follow_wrapped* parameter was added. Pass ``False`` to get a signature " "of *callable* specifically (``callable.__wrapped__`` will not be used to " "unwrap decorated callables.)" msgstr "" -#: library/inspect.rst:816 +#: library/inspect.rst:845 msgid "The *globals*, *locals*, and *eval_str* parameters were added." msgstr "" -#: library/inspect.rst:711 +#: library/inspect.rst:726 msgid "" "Some callables may not be introspectable in certain implementations of " "Python. For example, in CPython, some built-in functions defined in C " "provide no metadata about their arguments." msgstr "" -#: library/inspect.rst:717 +#: library/inspect.rst:732 msgid "" "If the passed object has a :attr:`!__signature__` attribute, we may use it " "to create the signature. The exact semantics are an implementation detail " @@ -1029,14 +1049,14 @@ msgid "" "semantics." msgstr "" -#: library/inspect.rst:725 +#: library/inspect.rst:740 msgid "" "A :class:`!Signature` object represents the call signature of a function and " "its return annotation. For each parameter accepted by the function it " "stores a :class:`Parameter` object in its :attr:`parameters` collection." msgstr "" -#: library/inspect.rst:730 +#: library/inspect.rst:745 msgid "" "The optional *parameters* argument is a sequence of :class:`Parameter` " "objects, which is validated to check that there are no parameters with " @@ -1045,54 +1065,54 @@ msgid "" "defaults follow parameters without defaults." msgstr "" -#: library/inspect.rst:736 +#: library/inspect.rst:751 msgid "" "The optional *return_annotation* argument can be an arbitrary Python object. " "It represents the \"return\" annotation of the callable." msgstr "" -#: library/inspect.rst:739 +#: library/inspect.rst:754 msgid "" ":class:`!Signature` objects are *immutable*. Use :meth:`Signature.replace` " -"to make a modified copy." +"or :func:`copy.replace` to make a modified copy." msgstr "" -#: library/inspect.rst:742 +#: library/inspect.rst:757 msgid ":class:`!Signature` objects are now picklable and :term:`hashable`." msgstr "" -#: library/inspect.rst:747 +#: library/inspect.rst:762 msgid "A special class-level marker to specify absence of a return annotation." msgstr "" -#: library/inspect.rst:751 +#: library/inspect.rst:766 msgid "" "An ordered mapping of parameters' names to the corresponding :class:" "`Parameter` objects. Parameters appear in strict definition order, " "including keyword-only parameters." msgstr "" -#: library/inspect.rst:1093 +#: library/inspect.rst:1125 msgid "" "Python only explicitly guaranteed that it preserved the declaration order of " "keyword-only parameters as of version 3.7, although in practice this order " "had always been preserved in Python 3." msgstr "" -#: library/inspect.rst:762 +#: library/inspect.rst:777 msgid "" "The \"return\" annotation for the callable. If the callable has no " "\"return\" annotation, this attribute is set to :attr:`Signature.empty`." msgstr "" -#: library/inspect.rst:767 +#: library/inspect.rst:782 msgid "" "Create a mapping from positional and keyword arguments to parameters. " "Returns :class:`BoundArguments` if ``*args`` and ``**kwargs`` match the " "signature, or raises a :exc:`TypeError`." msgstr "" -#: library/inspect.rst:773 +#: library/inspect.rst:788 msgid "" "Works the same way as :meth:`Signature.bind`, but allows the omission of " "some required arguments (mimics :func:`functools.partial` behavior.) " @@ -1100,7 +1120,7 @@ msgid "" "arguments do not match the signature." msgstr "" -#: library/inspect.rst:780 +#: library/inspect.rst:795 msgid "" "Create a new :class:`Signature` instance based on the instance :meth:" "`replace` was invoked on. It is possible to pass different *parameters* and/" @@ -1109,7 +1129,7 @@ msgid "" "Signature`, pass in :attr:`Signature.empty`." msgstr "" -#: library/inspect.rst:788 +#: library/inspect.rst:803 msgid "" ">>> def test(a, b):\n" "... pass\n" @@ -1120,17 +1140,34 @@ msgid "" "\"(a, b) -> 'new return anno'\"" msgstr "" -#: library/inspect.rst:800 +#: library/inspect.rst:813 +msgid "" +":class:`Signature` objects are also supported by the generic function :func:" +"`copy.replace`." +msgstr "" + +#: library/inspect.rst:818 +msgid "Create a string representation of the :class:`Signature` object." +msgstr "" + +#: library/inspect.rst:820 +msgid "" +"If *max_width* is passed, the method will attempt to fit the signature into " +"lines of at most *max_width* characters. If the signature is longer than " +"*max_width*, all parameters will be on separate lines." +msgstr "" + +#: library/inspect.rst:829 msgid "" "Return a :class:`Signature` (or its subclass) object for a given callable " "*obj*." msgstr "" -#: library/inspect.rst:803 +#: library/inspect.rst:832 msgid "This method simplifies subclassing of :class:`Signature`:" msgstr "" -#: library/inspect.rst:805 +#: library/inspect.rst:834 msgid "" "class MySignature(Signature):\n" " pass\n" @@ -1138,129 +1175,129 @@ msgid "" "assert isinstance(sig, MySignature)" msgstr "" -#: library/inspect.rst:812 +#: library/inspect.rst:841 msgid "Its behavior is otherwise identical to that of :func:`signature`." msgstr "" -#: library/inspect.rst:822 +#: library/inspect.rst:851 msgid "" ":class:`!Parameter` objects are *immutable*. Instead of modifying a :class:`!" -"Parameter` object, you can use :meth:`Parameter.replace` to create a " -"modified copy." +"Parameter` object, you can use :meth:`Parameter.replace` or :func:`copy." +"replace` to create a modified copy." msgstr "" -#: library/inspect.rst:826 +#: library/inspect.rst:855 msgid "Parameter objects are now picklable and :term:`hashable`." msgstr "" -#: library/inspect.rst:831 +#: library/inspect.rst:860 msgid "" "A special class-level marker to specify absence of default values and " "annotations." msgstr "" -#: library/inspect.rst:836 +#: library/inspect.rst:865 msgid "" "The name of the parameter as a string. The name must be a valid Python " "identifier." msgstr "" -#: library/inspect.rst:841 +#: library/inspect.rst:870 msgid "" "CPython generates implicit parameter names of the form ``.0`` on the code " "objects used to implement comprehensions and generator expressions." msgstr "" -#: library/inspect.rst:845 +#: library/inspect.rst:874 msgid "" "These parameter names are now exposed by this module as names like " "``implicit0``." msgstr "" -#: library/inspect.rst:851 +#: library/inspect.rst:880 msgid "" "The default value for the parameter. If the parameter has no default value, " "this attribute is set to :attr:`Parameter.empty`." msgstr "" -#: library/inspect.rst:856 +#: library/inspect.rst:885 msgid "" "The annotation for the parameter. If the parameter has no annotation, this " "attribute is set to :attr:`Parameter.empty`." msgstr "" -#: library/inspect.rst:861 +#: library/inspect.rst:890 msgid "" "Describes how argument values are bound to the parameter. The possible " "values are accessible via :class:`Parameter` (like ``Parameter." "KEYWORD_ONLY``), and support comparison and ordering, in the following order:" msgstr "" -#: library/inspect.rst:868 +#: library/inspect.rst:897 msgid "Name" msgstr "" -#: library/inspect.rst:868 +#: library/inspect.rst:897 msgid "Meaning" msgstr "" -#: library/inspect.rst:870 +#: library/inspect.rst:899 msgid "*POSITIONAL_ONLY*" msgstr "" -#: library/inspect.rst:870 +#: library/inspect.rst:899 msgid "" "Value must be supplied as a positional argument. Positional only parameters " "are those which appear before a ``/`` entry (if present) in a Python " "function definition." msgstr "" -#: library/inspect.rst:875 +#: library/inspect.rst:904 msgid "*POSITIONAL_OR_KEYWORD*" msgstr "" -#: library/inspect.rst:875 +#: library/inspect.rst:904 msgid "" "Value may be supplied as either a keyword or positional argument (this is " "the standard binding behaviour for functions implemented in Python.)" msgstr "" -#: library/inspect.rst:880 +#: library/inspect.rst:909 msgid "*VAR_POSITIONAL*" msgstr "" -#: library/inspect.rst:880 +#: library/inspect.rst:909 msgid "" "A tuple of positional arguments that aren't bound to any other parameter. " "This corresponds to a ``*args`` parameter in a Python function definition." msgstr "" -#: library/inspect.rst:885 +#: library/inspect.rst:914 msgid "*KEYWORD_ONLY*" msgstr "" -#: library/inspect.rst:885 +#: library/inspect.rst:914 msgid "" "Value must be supplied as a keyword argument. Keyword only parameters are " "those which appear after a ``*`` or ``*args`` entry in a Python function " "definition." msgstr "" -#: library/inspect.rst:890 +#: library/inspect.rst:919 msgid "*VAR_KEYWORD*" msgstr "" -#: library/inspect.rst:890 +#: library/inspect.rst:919 msgid "" "A dict of keyword arguments that aren't bound to any other parameter. This " "corresponds to a ``**kwargs`` parameter in a Python function definition." msgstr "" -#: library/inspect.rst:896 +#: library/inspect.rst:925 msgid "Example: print all keyword-only arguments without default values:" msgstr "" -#: library/inspect.rst:898 +#: library/inspect.rst:927 msgid "" ">>> def foo(a, b, *, c, d=10):\n" "... pass\n" @@ -1273,15 +1310,15 @@ msgid "" "Parameter: c" msgstr "" -#: library/inspect.rst:912 +#: library/inspect.rst:941 msgid "Describes an enum value of :attr:`Parameter.kind`." msgstr "" -#: library/inspect.rst:916 +#: library/inspect.rst:945 msgid "Example: print all descriptions of arguments:" msgstr "" -#: library/inspect.rst:918 +#: library/inspect.rst:947 msgid "" ">>> def foo(a, b, *, c, d=10):\n" "... pass\n" @@ -1295,7 +1332,7 @@ msgid "" "keyword-only" msgstr "" -#: library/inspect.rst:933 +#: library/inspect.rst:962 msgid "" "Create a new :class:`Parameter` instance based on the instance replaced was " "invoked on. To override a :class:`!Parameter` attribute, pass the " @@ -1303,7 +1340,7 @@ msgid "" "a :class:`!Parameter`, pass :attr:`Parameter.empty`." msgstr "" -#: library/inspect.rst:938 +#: library/inspect.rst:967 msgid "" ">>> from inspect import Parameter\n" ">>> param = Parameter('foo', Parameter.KEYWORD_ONLY, default=42)\n" @@ -1317,77 +1354,83 @@ msgid "" "\"foo: 'spam'\"" msgstr "" -#: library/inspect.rst:951 +#: library/inspect.rst:980 +msgid "" +":class:`Parameter` objects are also supported by the generic function :func:" +"`copy.replace`." +msgstr "" + +#: library/inspect.rst:983 msgid "" "In Python 3.3 :class:`Parameter` objects were allowed to have ``name`` set " "to ``None`` if their ``kind`` was set to ``POSITIONAL_ONLY``. This is no " "longer permitted." msgstr "" -#: library/inspect.rst:958 +#: library/inspect.rst:990 msgid "" "Result of a :meth:`Signature.bind` or :meth:`Signature.bind_partial` call. " "Holds the mapping of arguments to the function's parameters." msgstr "" -#: library/inspect.rst:963 +#: library/inspect.rst:995 msgid "" "A mutable mapping of parameters' names to arguments' values. Contains only " "explicitly bound arguments. Changes in :attr:`arguments` will reflect in :" "attr:`args` and :attr:`kwargs`." msgstr "" -#: library/inspect.rst:967 +#: library/inspect.rst:999 msgid "" "Should be used in conjunction with :attr:`Signature.parameters` for any " "argument processing purposes." msgstr "" -#: library/inspect.rst:972 +#: library/inspect.rst:1004 msgid "" "Arguments for which :meth:`Signature.bind` or :meth:`Signature.bind_partial` " "relied on a default value are skipped. However, if needed, use :meth:" "`BoundArguments.apply_defaults` to add them." msgstr "" -#: library/inspect.rst:977 +#: library/inspect.rst:1009 msgid "" ":attr:`arguments` is now of type :class:`dict`. Formerly, it was of type :" "class:`collections.OrderedDict`." msgstr "" -#: library/inspect.rst:983 +#: library/inspect.rst:1015 msgid "" "A tuple of positional arguments values. Dynamically computed from the :attr:" "`arguments` attribute." msgstr "" -#: library/inspect.rst:988 +#: library/inspect.rst:1020 msgid "" "A dict of keyword arguments values. Dynamically computed from the :attr:" "`arguments` attribute. Arguments that can be passed positionally are " "included in :attr:`args` instead." msgstr "" -#: library/inspect.rst:994 +#: library/inspect.rst:1026 msgid "A reference to the parent :class:`Signature` object." msgstr "" -#: library/inspect.rst:998 +#: library/inspect.rst:1030 msgid "Set default values for missing arguments." msgstr "" -#: library/inspect.rst:1000 +#: library/inspect.rst:1032 msgid "" "For variable-positional arguments (``*args``) the default is an empty tuple." msgstr "" -#: library/inspect.rst:1003 +#: library/inspect.rst:1035 msgid "" "For variable-keyword arguments (``**kwargs``) the default is an empty dict." msgstr "" -#: library/inspect.rst:1006 +#: library/inspect.rst:1038 msgid "" ">>> def foo(a, b='ham', *args): pass\n" ">>> ba = inspect.signature(foo).bind('spam')\n" @@ -1396,13 +1439,13 @@ msgid "" "{'a': 'spam', 'b': 'ham', 'args': ()}" msgstr "" -#: library/inspect.rst:1016 +#: library/inspect.rst:1048 msgid "" "The :attr:`args` and :attr:`kwargs` properties can be used to invoke " "functions:" msgstr "" -#: library/inspect.rst:1019 +#: library/inspect.rst:1051 msgid "" "def test(a, *, b):\n" " ...\n" @@ -1412,19 +1455,19 @@ msgid "" "test(*ba.args, **ba.kwargs)" msgstr "" -#: library/inspect.rst:1031 +#: library/inspect.rst:1063 msgid ":pep:`362` - Function Signature Object." msgstr "" -#: library/inspect.rst:1032 +#: library/inspect.rst:1064 msgid "The detailed specification, implementation details and examples." msgstr "" -#: library/inspect.rst:1038 +#: library/inspect.rst:1070 msgid "Classes and functions" msgstr "" -#: library/inspect.rst:1042 +#: library/inspect.rst:1074 msgid "" "Arrange the given list of classes into a hierarchy of nested lists. Where a " "nested list appears, it contains classes derived from the class whose entry " @@ -1435,19 +1478,19 @@ msgid "" "will appear multiple times." msgstr "" -#: library/inspect.rst:1053 +#: library/inspect.rst:1085 msgid "" "Get the names and default values of a Python function's parameters. A :term:" "`named tuple` is returned:" msgstr "" -#: library/inspect.rst:1056 +#: library/inspect.rst:1088 msgid "" "``FullArgSpec(args, varargs, varkw, defaults, kwonlyargs, kwonlydefaults, " "annotations)``" msgstr "" -#: library/inspect.rst:1059 +#: library/inspect.rst:1091 msgid "" "*args* is a list of the positional parameter names. *varargs* is the name of " "the ``*`` parameter or ``None`` if arbitrary positional arguments are not " @@ -1462,7 +1505,7 @@ msgid "" "report the function return value annotation (if any)." msgstr "" -#: library/inspect.rst:1074 +#: library/inspect.rst:1106 msgid "" "Note that :func:`signature` and :ref:`Signature Object ` provide the recommended API for callable introspection, and support " @@ -1472,14 +1515,14 @@ msgid "" "``inspect`` module API." msgstr "" -#: library/inspect.rst:1081 +#: library/inspect.rst:1113 msgid "" "This function is now based on :func:`signature`, but still ignores " "``__wrapped__`` attributes and includes the already bound first parameter in " "the signature output for bound methods." msgstr "" -#: library/inspect.rst:1086 +#: library/inspect.rst:1118 msgid "" "This method was previously documented as deprecated in favour of :func:" "`signature` in Python 3.5, but that decision has been reversed in order to " @@ -1487,7 +1530,7 @@ msgid "" "code migrating away from the legacy :func:`getargspec` API." msgstr "" -#: library/inspect.rst:1101 +#: library/inspect.rst:1133 msgid "" "Get information about arguments passed into a particular frame. A :term:" "`named tuple` ``ArgInfo(args, varargs, keywords, locals)`` is returned. " @@ -1496,18 +1539,18 @@ msgid "" "dictionary of the given frame." msgstr "" -#: library/inspect.rst:1118 +#: library/inspect.rst:1150 msgid "This function was inadvertently marked as deprecated in Python 3.5." msgstr "" -#: library/inspect.rst:1113 +#: library/inspect.rst:1145 msgid "" "Format a pretty argument spec from the four values returned by :func:" "`getargvalues`. The format\\* arguments are the corresponding optional " "formatting functions that are called to turn names and values into strings." msgstr "" -#: library/inspect.rst:1123 +#: library/inspect.rst:1155 msgid "" "Return a tuple of class cls's base classes, including cls, in method " "resolution order. No class appears more than once in this tuple. Note that " @@ -1515,7 +1558,7 @@ msgid "" "user-defined metatype is in use, cls will be the first element of the tuple." msgstr "" -#: library/inspect.rst:1131 +#: library/inspect.rst:1163 msgid "" "Bind the *args* and *kwds* to the argument names of the Python function or " "method *func*, as if it was called with them. For bound methods, bind also " @@ -1528,7 +1571,7 @@ msgid "" "example:" msgstr "" -#: library/inspect.rst:1140 +#: library/inspect.rst:1172 msgid "" ">>> from inspect import getcallargs\n" ">>> def f(a, b=1, *pos, **named):\n" @@ -1545,11 +1588,11 @@ msgid "" "TypeError: f() missing 1 required positional argument: 'a'" msgstr "" -#: library/inspect.rst:1157 +#: library/inspect.rst:1189 msgid "Use :meth:`Signature.bind` and :meth:`Signature.bind_partial` instead." msgstr "" -#: library/inspect.rst:1163 +#: library/inspect.rst:1195 msgid "" "Get the mapping of external name references in a Python function or method " "*func* to their current values. A :term:`named tuple` " @@ -1561,18 +1604,18 @@ msgid "" "builtins." msgstr "" -#: library/inspect.rst:1172 +#: library/inspect.rst:1204 msgid "" ":exc:`TypeError` is raised if *func* is not a Python function or method." msgstr "" -#: library/inspect.rst:1179 +#: library/inspect.rst:1211 msgid "" "Get the object wrapped by *func*. It follows the chain of :attr:" "`__wrapped__` attributes returning the last object in the chain." msgstr "" -#: library/inspect.rst:1182 +#: library/inspect.rst:1214 msgid "" "*stop* is an optional callback accepting an object in the wrapper chain as " "its sole argument that allows the unwrapping to be terminated early if the " @@ -1582,80 +1625,80 @@ msgid "" "``__signature__`` attribute defined." msgstr "" -#: library/inspect.rst:1189 +#: library/inspect.rst:1221 msgid ":exc:`ValueError` is raised if a cycle is encountered." msgstr "" -#: library/inspect.rst:1196 +#: library/inspect.rst:1228 msgid "Compute the annotations dict for an object." msgstr "" -#: library/inspect.rst:1198 +#: library/inspect.rst:1230 msgid "" "``obj`` may be a callable, class, or module. Passing in an object of any " "other type raises :exc:`TypeError`." msgstr "" -#: library/inspect.rst:1201 +#: library/inspect.rst:1233 msgid "" "Returns a dict. ``get_annotations()`` returns a new dict every time it's " "called; calling it twice on the same object will return two different but " "equivalent dicts." msgstr "" -#: library/inspect.rst:1205 +#: library/inspect.rst:1237 msgid "This function handles several details for you:" msgstr "" -#: library/inspect.rst:1207 +#: library/inspect.rst:1239 msgid "" "If ``eval_str`` is true, values of type ``str`` will be un-stringized using :" "func:`eval`. This is intended for use with stringized annotations (``from " "__future__ import annotations``)." msgstr "" -#: library/inspect.rst:1211 +#: library/inspect.rst:1243 msgid "" "If ``obj`` doesn't have an annotations dict, returns an empty dict. " "(Functions and methods always have an annotations dict; classes, modules, " "and other types of callables may not.)" msgstr "" -#: library/inspect.rst:1215 +#: library/inspect.rst:1247 msgid "" "Ignores inherited annotations on classes. If a class doesn't have its own " "annotations dict, returns an empty dict." msgstr "" -#: library/inspect.rst:1217 +#: library/inspect.rst:1249 msgid "" "All accesses to object members and dict values are done using ``getattr()`` " "and ``dict.get()`` for safety." msgstr "" -#: library/inspect.rst:1219 +#: library/inspect.rst:1251 msgid "Always, always, always returns a freshly created dict." msgstr "" -#: library/inspect.rst:1221 +#: library/inspect.rst:1253 msgid "" "``eval_str`` controls whether or not values of type ``str`` are replaced " "with the result of calling :func:`eval` on those values:" msgstr "" -#: library/inspect.rst:1224 +#: library/inspect.rst:1256 msgid "" "If eval_str is true, :func:`eval` is called on values of type ``str``. (Note " "that ``get_annotations`` doesn't catch exceptions; if :func:`eval` raises an " "exception, it will unwind the stack past the ``get_annotations`` call.)" msgstr "" -#: library/inspect.rst:1228 +#: library/inspect.rst:1260 msgid "" "If eval_str is false (the default), values of type ``str`` are unchanged." msgstr "" -#: library/inspect.rst:1230 +#: library/inspect.rst:1262 msgid "" "``globals`` and ``locals`` are passed in to :func:`eval`; see the " "documentation for :func:`eval` for more information. If ``globals`` or " @@ -1663,35 +1706,35 @@ msgid "" "specific default, contingent on ``type(obj)``:" msgstr "" -#: library/inspect.rst:1235 +#: library/inspect.rst:1267 msgid "If ``obj`` is a module, ``globals`` defaults to ``obj.__dict__``." msgstr "" -#: library/inspect.rst:1236 +#: library/inspect.rst:1268 msgid "" "If ``obj`` is a class, ``globals`` defaults to ``sys.modules[obj.__module__]." "__dict__`` and ``locals`` defaults to the ``obj`` class namespace." msgstr "" -#: library/inspect.rst:1239 +#: library/inspect.rst:1271 msgid "" "If ``obj`` is a callable, ``globals`` defaults to :attr:`obj.__globals__ " "`, although if ``obj`` is a wrapped function (using :" "func:`functools.update_wrapper`) it is first unwrapped." msgstr "" -#: library/inspect.rst:1244 +#: library/inspect.rst:1276 msgid "" "Calling ``get_annotations`` is best practice for accessing the annotations " "dict of any object. See :ref:`annotations-howto` for more information on " "annotations best practices." msgstr "" -#: library/inspect.rst:1254 +#: library/inspect.rst:1286 msgid "The interpreter stack" msgstr "" -#: library/inspect.rst:1256 +#: library/inspect.rst:1288 msgid "" "Some of the following functions return :class:`FrameInfo` objects. For " "backwards compatibility these objects allow tuple-like operations on all " @@ -1699,95 +1742,95 @@ msgid "" "may be removed in the future." msgstr "" -#: library/inspect.rst:1265 +#: library/inspect.rst:1297 msgid "The :ref:`frame object ` that the record corresponds to." msgstr "" -#: library/inspect.rst:1269 +#: library/inspect.rst:1301 msgid "" "The file name associated with the code being executed by the frame this " "record corresponds to." msgstr "" -#: library/inspect.rst:1274 +#: library/inspect.rst:1306 msgid "" "The line number of the current line associated with the code being executed " "by the frame this record corresponds to." msgstr "" -#: library/inspect.rst:1279 +#: library/inspect.rst:1311 msgid "" "The function name that is being executed by the frame this record " "corresponds to." msgstr "" -#: library/inspect.rst:1283 +#: library/inspect.rst:1315 msgid "" "A list of lines of context from the source code that's being executed by the " "frame this record corresponds to." msgstr "" -#: library/inspect.rst:1327 +#: library/inspect.rst:1359 msgid "" "The index of the current line being executed in the :attr:`code_context` " "list." msgstr "" -#: library/inspect.rst:1292 +#: library/inspect.rst:1324 msgid "" "A :class:`dis.Positions` object containing the start line number, end line " "number, start column offset, and end column offset associated with the " "instruction being executed by the frame this record corresponds to." msgstr "" -#: library/inspect.rst:1296 +#: library/inspect.rst:1328 msgid "Return a :term:`named tuple` instead of a :class:`tuple`." msgstr "" -#: library/inspect.rst:1299 +#: library/inspect.rst:1331 msgid "" ":class:`!FrameInfo` is now a class instance (that is backwards compatible " "with the previous :term:`named tuple`)." msgstr "" -#: library/inspect.rst:1308 +#: library/inspect.rst:1340 msgid "" "The file name associated with the code being executed by the frame this " "traceback corresponds to." msgstr "" -#: library/inspect.rst:1313 +#: library/inspect.rst:1345 msgid "" "The line number of the current line associated with the code being executed " "by the frame this traceback corresponds to." msgstr "" -#: library/inspect.rst:1318 +#: library/inspect.rst:1350 msgid "" "The function name that is being executed by the frame this traceback " "corresponds to." msgstr "" -#: library/inspect.rst:1322 +#: library/inspect.rst:1354 msgid "" "A list of lines of context from the source code that's being executed by the " "frame this traceback corresponds to." msgstr "" -#: library/inspect.rst:1331 +#: library/inspect.rst:1363 msgid "" "A :class:`dis.Positions` object containing the start line number, end line " "number, start column offset, and end column offset associated with the " "instruction being executed by the frame this traceback corresponds to." msgstr "" -#: library/inspect.rst:1336 +#: library/inspect.rst:1368 msgid "" ":class:`!Traceback` is now a class instance (that is backwards compatible " "with the previous :term:`named tuple`)." msgstr "" -#: library/inspect.rst:1343 +#: library/inspect.rst:1375 msgid "" "Keeping references to frame objects, as found in the first element of the " "frame records these functions return, can cause your program to create " @@ -1799,7 +1842,7 @@ msgid "" "consumption which occurs." msgstr "" -#: library/inspect.rst:1351 +#: library/inspect.rst:1383 msgid "" "Though the cycle detector will catch these, destruction of the frames (and " "local variables) can be made deterministic by removing the cycle in a :" @@ -1807,7 +1850,7 @@ msgid "" "disabled when Python was compiled or using :func:`gc.disable`. For example::" msgstr "" -#: library/inspect.rst:1356 +#: library/inspect.rst:1388 msgid "" "def handle_stackframe_without_leak():\n" " frame = inspect.currentframe()\n" @@ -1817,31 +1860,31 @@ msgid "" " del frame" msgstr "" -#: library/inspect.rst:1363 +#: library/inspect.rst:1395 msgid "" "If you want to keep the frame around (for example to print a traceback " "later), you can also break reference cycles by using the :meth:`frame.clear` " "method." msgstr "" -#: library/inspect.rst:1367 +#: library/inspect.rst:1399 msgid "" "The optional *context* argument supported by most of these functions " "specifies the number of lines of context to return, which are centered " "around the current line." msgstr "" -#: library/inspect.rst:1374 +#: library/inspect.rst:1406 msgid "" "Get information about a frame or traceback object. A :class:`Traceback` " "object is returned." msgstr "" -#: library/inspect.rst:1377 +#: library/inspect.rst:1409 msgid "A :class:`Traceback` object is returned instead of a named tuple." msgstr "" -#: library/inspect.rst:1382 +#: library/inspect.rst:1414 msgid "" "Get a list of :class:`FrameInfo` objects for a frame and all outer frames. " "These frames represent the calls that lead to the creation of *frame*. The " @@ -1849,17 +1892,17 @@ msgid "" "represents the outermost call on *frame*'s stack." msgstr "" -#: library/inspect.rst:1402 library/inspect.rst:1443 +#: library/inspect.rst:1434 library/inspect.rst:1475 msgid "" "A list of :term:`named tuples ` ``FrameInfo(frame, filename, " "lineno, function, code_context, index)`` is returned." msgstr "" -#: library/inspect.rst:1407 library/inspect.rst:1448 +#: library/inspect.rst:1439 library/inspect.rst:1480 msgid "A list of :class:`FrameInfo` objects is returned." msgstr "" -#: library/inspect.rst:1397 +#: library/inspect.rst:1429 msgid "" "Get a list of :class:`FrameInfo` objects for a traceback's frame and all " "inner frames. These frames represent calls made as a consequence of " @@ -1867,11 +1910,11 @@ msgid "" "represents where the exception was raised." msgstr "" -#: library/inspect.rst:1412 +#: library/inspect.rst:1444 msgid "Return the frame object for the caller's stack frame." msgstr "" -#: library/inspect.rst:1416 +#: library/inspect.rst:1448 msgid "" "This function relies on Python stack frame support in the interpreter, which " "isn't guaranteed to exist in all implementations of Python. If running in " @@ -1879,14 +1922,14 @@ msgid "" "``None``." msgstr "" -#: library/inspect.rst:1424 +#: library/inspect.rst:1456 msgid "" "Return a list of :class:`FrameInfo` objects for the caller's stack. The " "first entry in the returned list represents the caller; the last entry " "represents the outermost call on the stack." msgstr "" -#: library/inspect.rst:1438 +#: library/inspect.rst:1470 msgid "" "Return a list of :class:`FrameInfo` objects for the stack between the " "current frame and the frame in which an exception currently being handled " @@ -1894,11 +1937,11 @@ msgid "" "entry represents where the exception was raised." msgstr "" -#: library/inspect.rst:1452 +#: library/inspect.rst:1484 msgid "Fetching attributes statically" msgstr "" -#: library/inspect.rst:1454 +#: library/inspect.rst:1486 msgid "" "Both :func:`getattr` and :func:`hasattr` can trigger code execution when " "fetching or checking for the existence of attributes. Descriptors, like " @@ -1906,20 +1949,20 @@ msgid "" "`~object.__getattribute__` may be called." msgstr "" -#: library/inspect.rst:1460 +#: library/inspect.rst:1492 msgid "" "For cases where you want passive introspection, like documentation tools, " "this can be inconvenient. :func:`getattr_static` has the same signature as :" "func:`getattr` but avoids executing code when it fetches attributes." msgstr "" -#: library/inspect.rst:1466 +#: library/inspect.rst:1498 msgid "" "Retrieve attributes without triggering dynamic lookup via the descriptor " "protocol, :meth:`~object.__getattr__` or :meth:`~object.__getattribute__`." msgstr "" -#: library/inspect.rst:1470 +#: library/inspect.rst:1502 msgid "" "Note: this function may not be able to retrieve all attributes that getattr " "can fetch (like dynamically created attributes) and may find attributes that " @@ -1927,27 +1970,27 @@ msgid "" "return descriptors objects instead of instance members." msgstr "" -#: library/inspect.rst:1476 +#: library/inspect.rst:1508 msgid "" "If the instance :attr:`~object.__dict__` is shadowed by another member (for " "example a property) then this function will be unable to find instance " "members." msgstr "" -#: library/inspect.rst:1482 +#: library/inspect.rst:1514 msgid "" ":func:`getattr_static` does not resolve descriptors, for example slot " "descriptors or getset descriptors on objects implemented in C. The " "descriptor object is returned instead of the underlying attribute." msgstr "" -#: library/inspect.rst:1486 +#: library/inspect.rst:1518 msgid "" "You can handle these with code like the following. Note that for arbitrary " "getset descriptors invoking these may trigger code execution::" msgstr "" -#: library/inspect.rst:1490 +#: library/inspect.rst:1522 msgid "" "# example code for resolving the builtin descriptor types\n" "class _foo:\n" @@ -1970,11 +2013,11 @@ msgid "" " pass" msgstr "" -#: library/inspect.rst:1512 +#: library/inspect.rst:1544 msgid "Current State of Generators, Coroutines, and Asynchronous Generators" msgstr "" -#: library/inspect.rst:1514 +#: library/inspect.rst:1546 msgid "" "When implementing coroutine schedulers and for other advanced uses of " "generators, it is useful to determine whether a generator is currently " @@ -1983,31 +2026,31 @@ msgid "" "generator to be determined easily." msgstr "" -#: library/inspect.rst:1522 +#: library/inspect.rst:1554 msgid "Get current state of a generator-iterator." msgstr "" -#: library/inspect.rst:1540 library/inspect.rst:1557 +#: library/inspect.rst:1572 library/inspect.rst:1589 msgid "Possible states are:" msgstr "" -#: library/inspect.rst:1526 +#: library/inspect.rst:1558 msgid "GEN_CREATED: Waiting to start execution." msgstr "" -#: library/inspect.rst:1527 +#: library/inspect.rst:1559 msgid "GEN_RUNNING: Currently being executed by the interpreter." msgstr "" -#: library/inspect.rst:1528 +#: library/inspect.rst:1560 msgid "GEN_SUSPENDED: Currently suspended at a yield expression." msgstr "" -#: library/inspect.rst:1529 +#: library/inspect.rst:1561 msgid "GEN_CLOSED: Execution has completed." msgstr "" -#: library/inspect.rst:1535 +#: library/inspect.rst:1567 msgid "" "Get current state of a coroutine object. The function is intended to be " "used with coroutine objects created by :keyword:`async def` functions, but " @@ -2015,23 +2058,23 @@ msgid "" "``cr_frame`` attributes." msgstr "" -#: library/inspect.rst:1542 +#: library/inspect.rst:1574 msgid "CORO_CREATED: Waiting to start execution." msgstr "" -#: library/inspect.rst:1543 +#: library/inspect.rst:1575 msgid "CORO_RUNNING: Currently being executed by the interpreter." msgstr "" -#: library/inspect.rst:1544 +#: library/inspect.rst:1576 msgid "CORO_SUSPENDED: Currently suspended at an await expression." msgstr "" -#: library/inspect.rst:1545 +#: library/inspect.rst:1577 msgid "CORO_CLOSED: Execution has completed." msgstr "" -#: library/inspect.rst:1551 +#: library/inspect.rst:1583 msgid "" "Get current state of an asynchronous generator object. The function is " "intended to be used with asynchronous iterator objects created by :keyword:" @@ -2040,30 +2083,30 @@ msgid "" "``ag_frame`` attributes." msgstr "" -#: library/inspect.rst:1559 +#: library/inspect.rst:1591 msgid "AGEN_CREATED: Waiting to start execution." msgstr "" -#: library/inspect.rst:1560 +#: library/inspect.rst:1592 msgid "AGEN_RUNNING: Currently being executed by the interpreter." msgstr "" -#: library/inspect.rst:1561 +#: library/inspect.rst:1593 msgid "AGEN_SUSPENDED: Currently suspended at a yield expression." msgstr "" -#: library/inspect.rst:1562 +#: library/inspect.rst:1594 msgid "AGEN_CLOSED: Execution has completed." msgstr "" -#: library/inspect.rst:1566 +#: library/inspect.rst:1598 msgid "" "The current internal state of the generator can also be queried. This is " "mostly useful for testing purposes, to ensure that internal state is being " "updated as expected:" msgstr "" -#: library/inspect.rst:1572 +#: library/inspect.rst:1604 msgid "" "Get the mapping of live local variables in *generator* to their current " "values. A dictionary is returned that maps from variable names to values. " @@ -2071,14 +2114,14 @@ msgid "" "generator, and all the same caveats apply." msgstr "" -#: library/inspect.rst:1577 +#: library/inspect.rst:1609 msgid "" "If *generator* is a :term:`generator` with no currently associated frame, " "then an empty dictionary is returned. :exc:`TypeError` is raised if " "*generator* is not a Python generator object." msgstr "" -#: library/inspect.rst:1583 +#: library/inspect.rst:1615 msgid "" "This function relies on the generator exposing a Python stack frame for " "introspection, which isn't guaranteed to be the case in all implementations " @@ -2086,79 +2129,79 @@ msgid "" "dictionary." msgstr "" -#: library/inspect.rst:1592 +#: library/inspect.rst:1624 msgid "" "This function is analogous to :func:`~inspect.getgeneratorlocals`, but works " "for coroutine objects created by :keyword:`async def` functions." msgstr "" -#: library/inspect.rst:1599 +#: library/inspect.rst:1631 msgid "" "This function is analogous to :func:`~inspect.getgeneratorlocals`, but works " "for asynchronous generator objects created by :keyword:`async def` functions " "which use the :keyword:`yield` statement." msgstr "" -#: library/inspect.rst:1609 +#: library/inspect.rst:1641 msgid "Code Objects Bit Flags" msgstr "" -#: library/inspect.rst:1611 +#: library/inspect.rst:1643 msgid "" "Python code objects have a :attr:`~codeobject.co_flags` attribute, which is " "a bitmap of the following flags:" msgstr "" -#: library/inspect.rst:1616 +#: library/inspect.rst:1648 msgid "The code object is optimized, using fast locals." msgstr "" -#: library/inspect.rst:1620 +#: library/inspect.rst:1652 msgid "" "If set, a new dict will be created for the frame's :attr:`~frame.f_locals` " "when the code object is executed." msgstr "" -#: library/inspect.rst:1625 +#: library/inspect.rst:1657 msgid "The code object has a variable positional parameter (``*args``-like)." msgstr "" -#: library/inspect.rst:1629 +#: library/inspect.rst:1661 msgid "The code object has a variable keyword parameter (``**kwargs``-like)." msgstr "" -#: library/inspect.rst:1633 +#: library/inspect.rst:1665 msgid "The flag is set when the code object is a nested function." msgstr "" -#: library/inspect.rst:1637 +#: library/inspect.rst:1669 msgid "" "The flag is set when the code object is a generator function, i.e. a " "generator object is returned when the code object is executed." msgstr "" -#: library/inspect.rst:1642 +#: library/inspect.rst:1674 msgid "" "The flag is set when the code object is a coroutine function. When the code " "object is executed it returns a coroutine object. See :pep:`492` for more " "details." msgstr "" -#: library/inspect.rst:1650 +#: library/inspect.rst:1682 msgid "" "The flag is used to transform generators into generator-based coroutines. " "Generator objects with this flag can be used in ``await`` expression, and " "can ``yield from`` coroutine objects. See :pep:`492` for more details." msgstr "" -#: library/inspect.rst:1659 +#: library/inspect.rst:1691 msgid "" "The flag is set when the code object is an asynchronous generator function. " "When the code object is executed it returns an asynchronous generator " "object. See :pep:`525` for more details." msgstr "" -#: library/inspect.rst:1666 +#: library/inspect.rst:1698 msgid "" "The flags are specific to CPython, and may not be defined in other Python " "implementations. Furthermore, the flags are an implementation detail, and " @@ -2166,39 +2209,39 @@ msgid "" "use public APIs from the :mod:`inspect` module for any introspection needs." msgstr "" -#: library/inspect.rst:1674 +#: library/inspect.rst:1706 msgid "Buffer flags" msgstr "" -#: library/inspect.rst:1678 +#: library/inspect.rst:1710 msgid "" "This is an :class:`enum.IntFlag` that represents the flags that can be " "passed to the :meth:`~object.__buffer__` method of objects implementing the :" "ref:`buffer protocol `." msgstr "" -#: library/inspect.rst:1682 +#: library/inspect.rst:1714 msgid "The meaning of the flags is explained at :ref:`buffer-request-types`." msgstr "" -#: library/inspect.rst:1709 +#: library/inspect.rst:1741 msgid "Command Line Interface" msgstr "" -#: library/inspect.rst:1711 +#: library/inspect.rst:1743 msgid "" "The :mod:`inspect` module also provides a basic introspection capability " "from the command line." msgstr "" -#: library/inspect.rst:1716 +#: library/inspect.rst:1748 msgid "" "By default, accepts the name of a module and prints the source of that " "module. A class or function within the module can be printed instead by " "appended a colon and the qualified name of the target object." msgstr "" -#: library/inspect.rst:1722 +#: library/inspect.rst:1754 msgid "" "Print information about the specified object rather than the source code" msgstr "" diff --git a/library/internet.po b/library/internet.po index d30e0af9..a30bccd2 100644 --- a/library/internet.po +++ b/library/internet.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: 2024-12-15 13:44+0000\n" "Last-Translator: Artemis Leonardou \n" "Language-Team: PyGreece \n" diff --git a/library/intro.po b/library/intro.po index 15924252..dfe55386 100644 --- a/library/intro.po +++ b/library/intro.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -99,7 +99,7 @@ msgstr "" #: library/intro.rst:60 msgid "" "If not separately noted, all functions that claim \"Availability: Unix\" are " -"supported on macOS, which builds on a Unix core." +"supported on macOS, iOS and Android, all of which build on a Unix core." msgstr "" #: library/intro.rst:63 @@ -177,3 +177,87 @@ msgid "" "links are limited and don't support some operations. For example, WASI does " "not permit symlinks with absolute file names." msgstr "" + +#: library/intro.rst:127 +msgid "Mobile platforms" +msgstr "" + +#: library/intro.rst:129 +msgid "" +"Android and iOS are, in most respects, POSIX operating systems. File I/O, " +"socket handling, and threading all behave as they would on any POSIX " +"operating system. However, there are several major differences:" +msgstr "" + +#: library/intro.rst:133 +msgid "" +"Mobile platforms can only use Python in \"embedded\" mode. There is no " +"Python REPL, and no ability to use separate executables such as :program:" +"`python` or :program:`pip`. To add Python code to your mobile app, you must " +"use the :ref:`Python embedding API `. For more details, see :ref:" +"`using-android` and :ref:`using-ios`." +msgstr "" + +#: library/intro.rst:139 +msgid "Subprocesses:" +msgstr "" + +#: library/intro.rst:141 +msgid "" +"On Android, creating subprocesses is possible but `officially unsupported " +"`__. In " +"particular, Android does not support any part of the System V IPC API, so :" +"mod:`multiprocessing` is not available." +msgstr "" + +#: library/intro.rst:146 +msgid "" +"An iOS app cannot use any form of subprocessing, multiprocessing, or inter-" +"process communication. If an iOS app attempts to create a subprocess, the " +"process creating the subprocess will either lock up, or crash. An iOS app " +"has no visibility of other applications that are running, nor any ability to " +"communicate with other running applications, outside of the iOS-specific " +"APIs that exist for this purpose." +msgstr "" + +#: library/intro.rst:153 +msgid "" +"Mobile apps have limited access to modify system resources (such as the " +"system clock). These resources will often be *readable*, but attempts to " +"modify those resources will usually fail." +msgstr "" + +#: library/intro.rst:157 +msgid "Console input and output:" +msgstr "" + +#: library/intro.rst:159 +msgid "" +"On Android, the native ``stdout`` and ``stderr`` are not connected to " +"anything, so Python installs its own streams which redirect messages to the " +"system log. These can be seen under the tags ``python.stdout`` and ``python." +"stderr`` respectively." +msgstr "" + +#: library/intro.rst:164 +msgid "" +"iOS apps have a limited concept of console output. ``stdout`` and ``stderr`` " +"*exist*, and content written to ``stdout`` and ``stderr`` will be visible in " +"logs when running in Xcode, but this content *won't* be recorded in the " +"system log. If a user who has installed your app provides their app logs as " +"a diagnostic aid, they will not include any detail written to ``stdout`` or " +"``stderr``." +msgstr "" + +#: library/intro.rst:171 +msgid "" +"Mobile apps have no usable ``stdin`` at all. While apps can display an on-" +"screen keyboard, this is a software feature, not something that is attached " +"to ``stdin``." +msgstr "" + +#: library/intro.rst:175 +msgid "" +"As a result, Python modules that involve console manipulation (such as :mod:" +"`curses` and :mod:`readline`) are not available on mobile platforms." +msgstr "" diff --git a/library/io.po b/library/io.po index 62d0cdd0..4a678178 100644 --- a/library/io.po +++ b/library/io.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -62,7 +62,7 @@ msgid "" "since :exc:`IOError` is now an alias of :exc:`OSError`." msgstr "" -#: library/io.rst:855 library/io.rst:1149 +#: library/io.rst:855 library/io.rst:1150 msgid "Text I/O" msgstr "" @@ -99,7 +99,7 @@ msgid "" "`TextIOBase`." msgstr "" -#: library/io.rst:1137 +#: library/io.rst:1138 msgid "Binary I/O" msgstr "" @@ -1335,12 +1335,13 @@ msgstr "" #: library/io.rst:952 msgid "" "*encoding* gives the name of the encoding that the stream will be decoded or " -"encoded with. It defaults to :func:`locale.getencoding`. " +"encoded with. In :ref:`UTF-8 Mode `, this defaults to UTF-8. " +"Otherwise, it defaults to :func:`locale.getencoding`. " "``encoding=\"locale\"`` can be used to specify the current locale's encoding " "explicitly. See :ref:`io-text-encoding` for more information." msgstr "" -#: library/io.rst:957 +#: library/io.rst:958 msgid "" "*errors* is an optional string that specifies how encoding and decoding " "errors are to be handled. Pass ``'strict'`` to raise a :exc:`ValueError` " @@ -1355,13 +1356,13 @@ msgid "" "that has been registered with :func:`codecs.register_error` is also valid." msgstr "" -#: library/io.rst:973 +#: library/io.rst:974 msgid "" "*newline* controls how line endings are handled. It can be ``None``, " "``''``, ``'\\n'``, ``'\\r'``, and ``'\\r\\n'``. It works as follows:" msgstr "" -#: library/io.rst:976 +#: library/io.rst:977 msgid "" "When reading input from the stream, if *newline* is ``None``, :term:" "`universal newlines` mode is enabled. Lines in the input can end in " @@ -1373,7 +1374,7 @@ msgid "" "returned to the caller untranslated." msgstr "" -#: library/io.rst:985 +#: library/io.rst:986 msgid "" "When writing output to the stream, if *newline* is ``None``, any ``'\\n'`` " "characters written are translated to the system default line separator, :" @@ -1382,13 +1383,13 @@ msgid "" "characters written are translated to the given string." msgstr "" -#: library/io.rst:991 +#: library/io.rst:992 msgid "" "If *line_buffering* is ``True``, :meth:`~IOBase.flush` is implied when a " "call to write contains a newline character or a carriage return." msgstr "" -#: library/io.rst:994 +#: library/io.rst:995 msgid "" "If *write_through* is ``True``, calls to :meth:`~BufferedIOBase.write` are " "guaranteed not to be buffered: any data written on the :class:" @@ -1396,11 +1397,11 @@ msgid "" "*buffer*." msgstr "" -#: library/io.rst:998 +#: library/io.rst:999 msgid "The *write_through* argument has been added." msgstr "" -#: library/io.rst:1001 +#: library/io.rst:1002 msgid "" "The default *encoding* is now ``locale.getpreferredencoding(False)`` instead " "of ``locale.getpreferredencoding()``. Don't change temporary the locale " @@ -1408,108 +1409,108 @@ msgid "" "instead of the user preferred encoding." msgstr "" -#: library/io.rst:1007 +#: library/io.rst:1008 msgid "" "The *encoding* argument now supports the ``\"locale\"`` dummy encoding name." msgstr "" -#: library/io.rst:1010 +#: library/io.rst:1011 msgid "" ":class:`TextIOWrapper` provides these data attributes and methods in " "addition to those from :class:`TextIOBase` and :class:`IOBase`:" msgstr "" -#: library/io.rst:1015 +#: library/io.rst:1016 msgid "Whether line buffering is enabled." msgstr "" -#: library/io.rst:1019 +#: library/io.rst:1020 msgid "Whether writes are passed immediately to the underlying binary buffer." msgstr "" -#: library/io.rst:1027 +#: library/io.rst:1028 msgid "" "Reconfigure this text stream using new settings for *encoding*, *errors*, " "*newline*, *line_buffering* and *write_through*." msgstr "" -#: library/io.rst:1030 +#: library/io.rst:1031 msgid "" "Parameters not specified keep current settings, except ``errors='strict'`` " "is used when *encoding* is specified but *errors* is not specified." msgstr "" -#: library/io.rst:1034 +#: library/io.rst:1035 msgid "" "It is not possible to change the encoding or newline if some data has " "already been read from the stream. On the other hand, changing encoding " "after write is possible." msgstr "" -#: library/io.rst:1038 +#: library/io.rst:1039 msgid "" "This method does an implicit stream flush before setting the new parameters." msgstr "" -#: library/io.rst:1043 +#: library/io.rst:1044 msgid "The method supports ``encoding=\"locale\"`` option." msgstr "" -#: library/io.rst:1048 +#: library/io.rst:1049 msgid "" "Set the stream position. Return the new stream position as an :class:`int`." msgstr "" -#: library/io.rst:1051 +#: library/io.rst:1052 msgid "" "Four operations are supported, given by the following argument combinations:" msgstr "" -#: library/io.rst:1054 +#: library/io.rst:1055 msgid "``seek(0, SEEK_SET)``: Rewind to the start of the stream." msgstr "" -#: library/io.rst:1055 +#: library/io.rst:1056 msgid "" "``seek(cookie, SEEK_SET)``: Restore a previous position; *cookie* **must " "be** a number returned by :meth:`tell`." msgstr "" -#: library/io.rst:1057 +#: library/io.rst:1058 msgid "``seek(0, SEEK_END)``: Fast-forward to the end of the stream." msgstr "" -#: library/io.rst:1058 +#: library/io.rst:1059 msgid "``seek(0, SEEK_CUR)``: Leave the current stream position unchanged." msgstr "" -#: library/io.rst:1060 +#: library/io.rst:1061 msgid "Any other argument combinations are invalid, and may raise exceptions." msgstr "" -#: library/io.rst:1065 +#: library/io.rst:1066 msgid ":data:`os.SEEK_SET`, :data:`os.SEEK_CUR`, and :data:`os.SEEK_END`." msgstr "" -#: library/io.rst:1069 +#: library/io.rst:1070 msgid "" "Return the stream position as an opaque number. The return value of :meth:`!" "tell` can be given as input to :meth:`seek`, to restore a previous stream " "position." msgstr "" -#: library/io.rst:1076 +#: library/io.rst:1077 msgid "" "A text stream using an in-memory text buffer. It inherits from :class:" "`TextIOBase`." msgstr "" -#: library/io.rst:1079 +#: library/io.rst:1080 msgid "" "The text buffer is discarded when the :meth:`~IOBase.close` method is called." msgstr "" -#: library/io.rst:1082 +#: library/io.rst:1083 msgid "" "The initial value of the buffer can be set by providing *initial_value*. If " "newline translation is enabled, newlines will be encoded as if by :meth:" @@ -1521,31 +1522,31 @@ msgid "" "at the end of the buffer." msgstr "" -#: library/io.rst:1091 +#: library/io.rst:1092 msgid "" "The *newline* argument works like that of :class:`TextIOWrapper`, except " "that when writing output to the stream, if *newline* is ``None``, newlines " "are written as ``\\n`` on all platforms." msgstr "" -#: library/io.rst:1095 +#: library/io.rst:1096 msgid "" ":class:`StringIO` provides this method in addition to those from :class:" "`TextIOBase` and :class:`IOBase`:" msgstr "" -#: library/io.rst:1100 +#: library/io.rst:1101 msgid "" "Return a :class:`str` containing the entire contents of the buffer. Newlines " "are decoded as if by :meth:`~TextIOBase.read`, although the stream position " "is not changed." msgstr "" -#: library/io.rst:1104 +#: library/io.rst:1105 msgid "Example usage::" msgstr "" -#: library/io.rst:1106 +#: library/io.rst:1107 msgid "" "import io\n" "\n" @@ -1562,23 +1563,23 @@ msgid "" "output.close()" msgstr "" -#: library/io.rst:1126 +#: library/io.rst:1127 msgid "" "A helper codec that decodes newlines for :term:`universal newlines` mode. It " "inherits from :class:`codecs.IncrementalDecoder`." msgstr "" -#: library/io.rst:1131 +#: library/io.rst:1132 msgid "Performance" msgstr "" -#: library/io.rst:1133 +#: library/io.rst:1134 msgid "" "This section discusses the performance of the provided concrete I/O " "implementations." msgstr "" -#: library/io.rst:1139 +#: library/io.rst:1140 msgid "" "By reading and writing only large chunks of data even when the user asks for " "a single byte, buffered I/O hides any inefficiency in calling and executing " @@ -1591,7 +1592,7 @@ msgid "" "data." msgstr "" -#: library/io.rst:1151 +#: library/io.rst:1152 msgid "" "Text I/O over a binary storage (such as a file) is significantly slower than " "binary I/O over the same storage, because it requires conversions between " @@ -1601,24 +1602,24 @@ msgid "" "the reconstruction algorithm used." msgstr "" -#: library/io.rst:1158 +#: library/io.rst:1159 msgid "" ":class:`StringIO`, however, is a native in-memory unicode container and will " "exhibit similar speed to :class:`BytesIO`." msgstr "" -#: library/io.rst:1162 +#: library/io.rst:1163 msgid "Multi-threading" msgstr "" -#: library/io.rst:1164 +#: library/io.rst:1165 msgid "" ":class:`FileIO` objects are thread-safe to the extent that the operating " "system calls (such as :manpage:`read(2)` under Unix) they wrap are thread-" "safe too." msgstr "" -#: library/io.rst:1167 +#: library/io.rst:1168 msgid "" "Binary buffered objects (instances of :class:`BufferedReader`, :class:" "`BufferedWriter`, :class:`BufferedRandom` and :class:`BufferedRWPair`) " @@ -1626,15 +1627,15 @@ msgid "" "them from multiple threads at once." msgstr "" -#: library/io.rst:1172 +#: library/io.rst:1173 msgid ":class:`TextIOWrapper` objects are not thread-safe." msgstr "" -#: library/io.rst:1175 +#: library/io.rst:1176 msgid "Reentrancy" msgstr "" -#: library/io.rst:1177 +#: library/io.rst:1178 msgid "" "Binary buffered objects (instances of :class:`BufferedReader`, :class:" "`BufferedWriter`, :class:`BufferedRandom` and :class:`BufferedRWPair`) are " @@ -1645,7 +1646,7 @@ msgid "" "from entering the buffered object." msgstr "" -#: library/io.rst:1185 +#: library/io.rst:1186 msgid "" "The above implicitly extends to text files, since the :func:`open` function " "will wrap a buffered object inside a :class:`TextIOWrapper`. This includes " @@ -1661,14 +1662,14 @@ msgstr "" msgid "io module" msgstr "" -#: library/io.rst:1121 +#: library/io.rst:1122 msgid "universal newlines" msgstr "" -#: library/io.rst:970 +#: library/io.rst:971 msgid "io.TextIOWrapper class" msgstr "" -#: library/io.rst:1121 +#: library/io.rst:1122 msgid "io.IncrementalNewlineDecoder class" msgstr "" diff --git a/library/ipaddress.po b/library/ipaddress.po index 0b5ecbe2..427cf232 100644 --- a/library/ipaddress.po +++ b/library/ipaddress.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -314,7 +314,13 @@ msgid "" "``True`` if the address is reserved for link-local usage. See :RFC:`3927`." msgstr "" -#: library/ipaddress.rst:252 +#: library/ipaddress.rst:249 +msgid "" +":class:`IPv4Address` object representing the IPv4-mapped IPv6 address. See :" +"RFC:`4291`." +msgstr "" + +#: library/ipaddress.rst:259 msgid "" "Returns a string representation of the IP address, controlled by an explicit " "format string. *fmt* can be one of the following: ``'s'``, the default " @@ -326,17 +332,17 @@ msgid "" "used by ``format``, ``str.format`` and f-strings." msgstr "" -#: library/ipaddress.rst:279 +#: library/ipaddress.rst:286 msgid "" "Construct an IPv6 address. An :exc:`AddressValueError` is raised if " "*address* is not a valid IPv6 address." msgstr "" -#: library/ipaddress.rst:282 +#: library/ipaddress.rst:289 msgid "The following constitutes a valid IPv6 address:" msgstr "" -#: library/ipaddress.rst:284 +#: library/ipaddress.rst:291 msgid "" "A string consisting of eight groups of four hexadecimal digits, each group " "representing 16 bits. The groups are separated by colons. This describes an " @@ -346,7 +352,7 @@ msgid "" "to ``\"::abc:7:def\"``." msgstr "" -#: library/ipaddress.rst:292 +#: library/ipaddress.rst:299 msgid "" "Optionally, the string may also have a scope zone ID, expressed with a " "suffix ``%scope_id``. If present, the scope ID must be non-empty, and may " @@ -355,39 +361,39 @@ msgid "" "the node." msgstr "" -#: library/ipaddress.rst:297 +#: library/ipaddress.rst:304 msgid "An integer that fits into 128 bits." msgstr "" -#: library/ipaddress.rst:298 +#: library/ipaddress.rst:305 msgid "" "An integer packed into a :class:`bytes` object of length 16, big-endian." msgstr "" -#: library/ipaddress.rst:308 +#: library/ipaddress.rst:315 msgid "" "The short form of the address representation, with leading zeroes in groups " "omitted and the longest sequence of groups consisting entirely of zeroes " "collapsed to a single empty group." msgstr "" -#: library/ipaddress.rst:312 +#: library/ipaddress.rst:319 msgid "This is also the value returned by ``str(addr)`` for IPv6 addresses." msgstr "" -#: library/ipaddress.rst:316 +#: library/ipaddress.rst:323 msgid "" "The long form of the address representation, with all leading zeroes and " "groups consisting entirely of zeroes included." msgstr "" -#: library/ipaddress.rst:320 +#: library/ipaddress.rst:327 msgid "" "For the following attributes and methods, see the corresponding " "documentation of the :class:`IPv4Address` class:" msgstr "" -#: library/ipaddress.rst:340 +#: library/ipaddress.rst:347 msgid "" "``True`` if the address is reserved for site-local usage. Note that the " "site-local address space has been deprecated by :RFC:`3879`. Use :attr:" @@ -395,21 +401,21 @@ msgid "" "local addresses as defined by :RFC:`4193`." msgstr "" -#: library/ipaddress.rst:347 +#: library/ipaddress.rst:354 msgid "" "For addresses that appear to be IPv4 mapped addresses (starting with ``::" "FFFF/96``), this property will report the embedded IPv4 address. For any " "other address, this property will be ``None``." msgstr "" -#: library/ipaddress.rst:353 +#: library/ipaddress.rst:360 msgid "" "For scoped addresses as defined by :RFC:`4007`, this property identifies the " "particular zone of the address's scope that the address belongs to, as a " "string. When no scope zone is specified, this property will be ``None``." msgstr "" -#: library/ipaddress.rst:359 +#: library/ipaddress.rst:366 msgid "" "For addresses that appear to be 6to4 addresses (starting with " "``2002::/16``) as defined by :RFC:`3056`, this property will report the " @@ -417,7 +423,7 @@ msgid "" "``None``." msgstr "" -#: library/ipaddress.rst:366 +#: library/ipaddress.rst:373 msgid "" "For addresses that appear to be Teredo addresses (starting with " "``2001::/32``) as defined by :RFC:`4380`, this property will report the " @@ -425,23 +431,23 @@ msgid "" "property will be ``None``." msgstr "" -#: library/ipaddress.rst:373 +#: library/ipaddress.rst:380 msgid "" "Refer to the corresponding method documentation in :class:`IPv4Address`." msgstr "" -#: library/ipaddress.rst:379 +#: library/ipaddress.rst:386 msgid "Conversion to Strings and Integers" msgstr "" -#: library/ipaddress.rst:381 +#: library/ipaddress.rst:388 msgid "" "To interoperate with networking interfaces such as the socket module, " "addresses must be converted to strings or integers. This is handled using " "the :func:`str` and :func:`int` builtin functions::" msgstr "" -#: library/ipaddress.rst:385 +#: library/ipaddress.rst:392 msgid "" ">>> str(ipaddress.IPv4Address('192.168.0.1'))\n" "'192.168.0.1'\n" @@ -453,35 +459,35 @@ msgid "" "1" msgstr "" -#: library/ipaddress.rst:394 +#: library/ipaddress.rst:401 msgid "" "Note that IPv6 scoped addresses are converted to integers without scope zone " "ID." msgstr "" -#: library/ipaddress.rst:782 library/ipaddress.rst:918 +#: library/ipaddress.rst:789 library/ipaddress.rst:925 msgid "Operators" msgstr "" -#: library/ipaddress.rst:400 +#: library/ipaddress.rst:407 msgid "" "Address objects support some operators. Unless stated otherwise, operators " "can only be applied between compatible objects (i.e. IPv4 with IPv4, IPv6 " "with IPv6)." msgstr "" -#: library/ipaddress.rst:406 +#: library/ipaddress.rst:413 msgid "Comparison operators" msgstr "" -#: library/ipaddress.rst:408 +#: library/ipaddress.rst:415 msgid "" "Address objects can be compared with the usual set of comparison operators. " "Same IPv6 addresses with different scope zone IDs are not equal. Some " "examples::" msgstr "" -#: library/ipaddress.rst:412 +#: library/ipaddress.rst:419 msgid "" ">>> IPv4Address('127.0.0.2') > IPv4Address('127.0.0.1')\n" "True\n" @@ -495,16 +501,16 @@ msgid "" "True" msgstr "" -#: library/ipaddress.rst:425 +#: library/ipaddress.rst:432 msgid "Arithmetic operators" msgstr "" -#: library/ipaddress.rst:427 +#: library/ipaddress.rst:434 msgid "" "Integers can be added to or subtracted from address objects. Some examples::" msgstr "" -#: library/ipaddress.rst:429 +#: library/ipaddress.rst:436 msgid "" ">>> IPv4Address('127.0.0.2') + 3\n" "IPv4Address('127.0.0.5')\n" @@ -517,11 +523,11 @@ msgid "" "IPv4 address" msgstr "" -#: library/ipaddress.rst:440 +#: library/ipaddress.rst:447 msgid "IP Network definitions" msgstr "" -#: library/ipaddress.rst:442 +#: library/ipaddress.rst:449 msgid "" "The :class:`IPv4Network` and :class:`IPv6Network` objects provide a " "mechanism for defining and inspecting IP network definitions. A network " @@ -532,11 +538,11 @@ msgid "" "addresses in the inclusive range ``192.168.1.0`` to ``192.168.1.255``." msgstr "" -#: library/ipaddress.rst:452 +#: library/ipaddress.rst:459 msgid "Prefix, net mask and host mask" msgstr "" -#: library/ipaddress.rst:454 +#: library/ipaddress.rst:461 msgid "" "There are several equivalent ways to specify IP network masks. A *prefix* " "``/`` is a notation that denotes how many high-order bits are set in " @@ -548,11 +554,11 @@ msgid "" "mask equivalent to ``/24`` in IPv4 is ``0.0.0.255``." msgstr "" -#: library/ipaddress.rst:465 +#: library/ipaddress.rst:472 msgid "Network objects" msgstr "" -#: library/ipaddress.rst:467 +#: library/ipaddress.rst:474 msgid "" "All attributes implemented by address objects are implemented by network " "objects as well. In addition, network objects implement additional " @@ -562,12 +568,12 @@ msgid "" "keys in dictionaries." msgstr "" -#: library/ipaddress.rst:476 +#: library/ipaddress.rst:483 msgid "" "Construct an IPv4 network definition. *address* can be one of the following:" msgstr "" -#: library/ipaddress.rst:478 +#: library/ipaddress.rst:485 msgid "" "A string consisting of an IP address and an optional mask, separated by a " "slash (``/``). The IP address is the network address, and the mask can be " @@ -579,26 +585,26 @@ msgid "" "it's considered to be ``/32``." msgstr "" -#: library/ipaddress.rst:487 +#: library/ipaddress.rst:494 msgid "" "For example, the following *address* specifications are equivalent: " "``192.168.1.0/24``, ``192.168.1.0/255.255.255.0`` and " "``192.168.1.0/0.0.0.255``." msgstr "" -#: library/ipaddress.rst:491 +#: library/ipaddress.rst:498 msgid "" "An integer that fits into 32 bits. This is equivalent to a single-address " "network, with the network address being *address* and the mask being ``/32``." msgstr "" -#: library/ipaddress.rst:495 +#: library/ipaddress.rst:502 msgid "" "An integer packed into a :class:`bytes` object of length 4, big-endian. The " "interpretation is similar to an integer *address*." msgstr "" -#: library/ipaddress.rst:498 +#: library/ipaddress.rst:505 msgid "" "A two-tuple of an address description and a netmask, where the address " "description is either a string, a 32-bits integer, a 4-bytes packed integer, " @@ -607,92 +613,92 @@ msgid "" "prefix mask (e.g. ``255.255.255.0``)." msgstr "" -#: library/ipaddress.rst:504 +#: library/ipaddress.rst:511 msgid "" "An :exc:`AddressValueError` is raised if *address* is not a valid IPv4 " "address. A :exc:`NetmaskValueError` is raised if the mask is not valid for " "an IPv4 address." msgstr "" -#: library/ipaddress.rst:728 +#: library/ipaddress.rst:735 msgid "" "If *strict* is ``True`` and host bits are set in the supplied address, then :" "exc:`ValueError` is raised. Otherwise, the host bits are masked out to " "determine the appropriate network address." msgstr "" -#: library/ipaddress.rst:512 +#: library/ipaddress.rst:519 msgid "" "Unless stated otherwise, all network methods accepting other network/address " "objects will raise :exc:`TypeError` if the argument's IP version is " "incompatible to ``self``." msgstr "" -#: library/ipaddress.rst:734 +#: library/ipaddress.rst:741 msgid "Added the two-tuple form for the *address* constructor parameter." msgstr "" -#: library/ipaddress.rst:523 +#: library/ipaddress.rst:530 msgid "" "Refer to the corresponding attribute documentation in :class:`IPv4Address`." msgstr "" -#: library/ipaddress.rst:533 +#: library/ipaddress.rst:540 msgid "" "These attributes are true for the network as a whole if they are true for " "both the network address and the broadcast address." msgstr "" -#: library/ipaddress.rst:538 +#: library/ipaddress.rst:545 msgid "" "The network address for the network. The network address and the prefix " "length together uniquely define a network." msgstr "" -#: library/ipaddress.rst:543 +#: library/ipaddress.rst:550 msgid "" "The broadcast address for the network. Packets sent to the broadcast address " "should be received by every host on the network." msgstr "" -#: library/ipaddress.rst:548 +#: library/ipaddress.rst:555 msgid "The host mask, as an :class:`IPv4Address` object." msgstr "" -#: library/ipaddress.rst:552 +#: library/ipaddress.rst:559 msgid "The net mask, as an :class:`IPv4Address` object." msgstr "" -#: library/ipaddress.rst:558 +#: library/ipaddress.rst:565 msgid "" "A string representation of the network, with the mask in prefix notation." msgstr "" -#: library/ipaddress.rst:561 +#: library/ipaddress.rst:568 msgid "" "``with_prefixlen`` and ``compressed`` are always the same as " "``str(network)``. ``exploded`` uses the exploded form the network address." msgstr "" -#: library/ipaddress.rst:567 +#: library/ipaddress.rst:574 msgid "" "A string representation of the network, with the mask in net mask notation." msgstr "" -#: library/ipaddress.rst:572 +#: library/ipaddress.rst:579 msgid "" "A string representation of the network, with the mask in host mask notation." msgstr "" -#: library/ipaddress.rst:577 +#: library/ipaddress.rst:584 msgid "The total number of addresses in the network." msgstr "" -#: library/ipaddress.rst:581 +#: library/ipaddress.rst:588 msgid "Length of the network prefix, in bits." msgstr "" -#: library/ipaddress.rst:585 +#: library/ipaddress.rst:592 msgid "" "Returns an iterator over the usable hosts in the network. The usable hosts " "are all the IP addresses that belong to the network, except the network " @@ -702,20 +708,20 @@ msgid "" "containing the single host address." msgstr "" -#: library/ipaddress.rst:603 +#: library/ipaddress.rst:610 msgid "" "``True`` if this network is partly or wholly contained in *other* or *other* " "is wholly contained in this network." msgstr "" -#: library/ipaddress.rst:608 +#: library/ipaddress.rst:615 msgid "" "Computes the network definitions resulting from removing the given *network* " "from this one. Returns an iterator of network objects. Raises :exc:" "`ValueError` if *network* is not completely contained in this network." msgstr "" -#: library/ipaddress.rst:621 +#: library/ipaddress.rst:628 msgid "" "The subnets that join to make the current network definition, depending on " "the argument values. *prefixlen_diff* is the amount our prefix length " @@ -725,7 +731,7 @@ msgid "" "network objects." msgstr "" -#: library/ipaddress.rst:646 +#: library/ipaddress.rst:653 msgid "" "The supernet containing this network definition, depending on the argument " "values. *prefixlen_diff* is the amount our prefix length should be " @@ -734,33 +740,33 @@ msgid "" "*new_prefix* must be set. Returns a single network object." msgstr "" -#: library/ipaddress.rst:662 +#: library/ipaddress.rst:669 msgid "Return ``True`` if this network is a subnet of *other*." msgstr "" -#: library/ipaddress.rst:673 +#: library/ipaddress.rst:680 msgid "Return ``True`` if this network is a supernet of *other*." msgstr "" -#: library/ipaddress.rst:684 +#: library/ipaddress.rst:691 msgid "" "Compare this network to *other*. In this comparison only the network " "addresses are considered; host bits aren't. Returns either ``-1``, ``0`` or " "``1``." msgstr "" -#: library/ipaddress.rst:695 +#: library/ipaddress.rst:702 msgid "" "It uses the same ordering and comparison algorithm as \"<\", \"==\", and " "\">\"" msgstr "" -#: library/ipaddress.rst:701 +#: library/ipaddress.rst:708 msgid "" "Construct an IPv6 network definition. *address* can be one of the following:" msgstr "" -#: library/ipaddress.rst:703 +#: library/ipaddress.rst:710 msgid "" "A string consisting of an IP address and an optional prefix length, " "separated by a slash (``/``). The IP address is the network address, and " @@ -768,26 +774,26 @@ msgid "" "length is provided, it's considered to be ``/128``." msgstr "" -#: library/ipaddress.rst:708 +#: library/ipaddress.rst:715 msgid "" "Note that currently expanded netmasks are not supported. That means ``2001:" "db00::0/24`` is a valid argument while ``2001:db00::0/ffff:ff00::`` is not." msgstr "" -#: library/ipaddress.rst:712 +#: library/ipaddress.rst:719 msgid "" "An integer that fits into 128 bits. This is equivalent to a single-address " "network, with the network address being *address* and the mask being " "``/128``." msgstr "" -#: library/ipaddress.rst:716 +#: library/ipaddress.rst:723 msgid "" "An integer packed into a :class:`bytes` object of length 16, big-endian. The " "interpretation is similar to an integer *address*." msgstr "" -#: library/ipaddress.rst:719 +#: library/ipaddress.rst:726 msgid "" "A two-tuple of an address description and a netmask, where the address " "description is either a string, a 128-bits integer, a 16-bytes packed " @@ -795,14 +801,14 @@ msgid "" "representing the prefix length." msgstr "" -#: library/ipaddress.rst:724 +#: library/ipaddress.rst:731 msgid "" "An :exc:`AddressValueError` is raised if *address* is not a valid IPv6 " "address. A :exc:`NetmaskValueError` is raised if the mask is not valid for " "an IPv6 address." msgstr "" -#: library/ipaddress.rst:757 +#: library/ipaddress.rst:764 msgid "" "Returns an iterator over the usable hosts in the network. The usable hosts " "are all the IP addresses that belong to the network, except the Subnet-" @@ -811,46 +817,46 @@ msgid "" "of 128 will return a list containing the single host address." msgstr "" -#: library/ipaddress.rst:772 +#: library/ipaddress.rst:779 msgid "" "Refer to the corresponding attribute documentation in :class:`IPv4Network`." msgstr "" -#: library/ipaddress.rst:777 +#: library/ipaddress.rst:784 msgid "" "These attribute is true for the network as a whole if it is true for both " "the network address and the broadcast address." msgstr "" -#: library/ipaddress.rst:784 +#: library/ipaddress.rst:791 msgid "" "Network objects support some operators. Unless stated otherwise, operators " "can only be applied between compatible objects (i.e. IPv4 with IPv4, IPv6 " "with IPv6)." msgstr "" -#: library/ipaddress.rst:926 +#: library/ipaddress.rst:933 msgid "Logical operators" msgstr "" -#: library/ipaddress.rst:792 +#: library/ipaddress.rst:799 msgid "" "Network objects can be compared with the usual set of logical operators. " "Network objects are ordered first by network address, then by net mask." msgstr "" -#: library/ipaddress.rst:797 +#: library/ipaddress.rst:804 msgid "Iteration" msgstr "" -#: library/ipaddress.rst:799 +#: library/ipaddress.rst:806 msgid "" "Network objects can be iterated to list all the addresses belonging to the " "network. For iteration, *all* hosts are returned, including unusable hosts " "(for usable hosts, use the :meth:`~IPv4Network.hosts` method). An example::" msgstr "" -#: library/ipaddress.rst:804 +#: library/ipaddress.rst:811 msgid "" ">>> for addr in IPv4Network('192.0.2.0/28'):\n" "... addr\n" @@ -873,15 +879,15 @@ msgid "" "IPv4Address('192.0.2.15')" msgstr "" -#: library/ipaddress.rst:826 +#: library/ipaddress.rst:833 msgid "Networks as containers of addresses" msgstr "" -#: library/ipaddress.rst:828 +#: library/ipaddress.rst:835 msgid "Network objects can act as containers of addresses. Some examples::" msgstr "" -#: library/ipaddress.rst:830 +#: library/ipaddress.rst:837 msgid "" ">>> IPv4Network('192.0.2.0/28')[0]\n" "IPv4Address('192.0.2.0')\n" @@ -893,92 +899,92 @@ msgid "" "False" msgstr "" -#: library/ipaddress.rst:841 +#: library/ipaddress.rst:848 msgid "Interface objects" msgstr "" -#: library/ipaddress.rst:843 +#: library/ipaddress.rst:850 msgid "" "Interface objects are :term:`hashable`, so they can be used as keys in " "dictionaries." msgstr "" -#: library/ipaddress.rst:848 +#: library/ipaddress.rst:855 msgid "" "Construct an IPv4 interface. The meaning of *address* is as in the " "constructor of :class:`IPv4Network`, except that arbitrary host addresses " "are always accepted." msgstr "" -#: library/ipaddress.rst:852 +#: library/ipaddress.rst:859 msgid "" ":class:`IPv4Interface` is a subclass of :class:`IPv4Address`, so it inherits " "all the attributes from that class. In addition, the following attributes " "are available:" msgstr "" -#: library/ipaddress.rst:858 +#: library/ipaddress.rst:865 msgid "The address (:class:`IPv4Address`) without network information." msgstr "" -#: library/ipaddress.rst:866 +#: library/ipaddress.rst:873 msgid "The network (:class:`IPv4Network`) this interface belongs to." msgstr "" -#: library/ipaddress.rst:874 +#: library/ipaddress.rst:881 msgid "" "A string representation of the interface with the mask in prefix notation." msgstr "" -#: library/ipaddress.rst:882 +#: library/ipaddress.rst:889 msgid "" "A string representation of the interface with the network as a net mask." msgstr "" -#: library/ipaddress.rst:890 +#: library/ipaddress.rst:897 msgid "" "A string representation of the interface with the network as a host mask." msgstr "" -#: library/ipaddress.rst:899 +#: library/ipaddress.rst:906 msgid "" "Construct an IPv6 interface. The meaning of *address* is as in the " "constructor of :class:`IPv6Network`, except that arbitrary host addresses " "are always accepted." msgstr "" -#: library/ipaddress.rst:903 +#: library/ipaddress.rst:910 msgid "" ":class:`IPv6Interface` is a subclass of :class:`IPv6Address`, so it inherits " "all the attributes from that class. In addition, the following attributes " "are available:" msgstr "" -#: library/ipaddress.rst:913 +#: library/ipaddress.rst:920 msgid "" "Refer to the corresponding attribute documentation in :class:`IPv4Interface`." msgstr "" -#: library/ipaddress.rst:920 +#: library/ipaddress.rst:927 msgid "" "Interface objects support some operators. Unless stated otherwise, " "operators can only be applied between compatible objects (i.e. IPv4 with " "IPv4, IPv6 with IPv6)." msgstr "" -#: library/ipaddress.rst:928 +#: library/ipaddress.rst:935 msgid "" "Interface objects can be compared with the usual set of logical operators." msgstr "" -#: library/ipaddress.rst:930 +#: library/ipaddress.rst:937 msgid "" "For equality comparison (``==`` and ``!=``), both the IP address and network " "must be the same for the objects to be equal. An interface will not compare " "equal to any address or network object." msgstr "" -#: library/ipaddress.rst:934 +#: library/ipaddress.rst:941 msgid "" "For ordering (``<``, ``>``, etc) the rules are different. Interface and " "address objects with the same IP version can be compared, and the address " @@ -987,15 +993,15 @@ msgid "" "then by their IP addresses." msgstr "" -#: library/ipaddress.rst:942 +#: library/ipaddress.rst:949 msgid "Other Module Level Functions" msgstr "" -#: library/ipaddress.rst:944 +#: library/ipaddress.rst:951 msgid "The module also provides the following module level functions:" msgstr "" -#: library/ipaddress.rst:948 +#: library/ipaddress.rst:955 msgid "" "Represent an address as 4 packed bytes in network (big-endian) order. " "*address* is an integer representation of an IPv4 IP address. A :exc:" @@ -1003,7 +1009,7 @@ msgid "" "IP address." msgstr "" -#: library/ipaddress.rst:961 +#: library/ipaddress.rst:968 msgid "" "Represent an address as 16 packed bytes in network (big-endian) order. " "*address* is an integer representation of an IPv6 IP address. A :exc:" @@ -1011,7 +1017,7 @@ msgid "" "IP address." msgstr "" -#: library/ipaddress.rst:969 +#: library/ipaddress.rst:976 msgid "" "Return an iterator of the summarized network range given the first and last " "IP addresses. *first* is the first :class:`IPv4Address` or :class:" @@ -1022,7 +1028,7 @@ msgid "" "address version is not 4 or 6." msgstr "" -#: library/ipaddress.rst:985 +#: library/ipaddress.rst:992 msgid "" "Return an iterator of the collapsed :class:`IPv4Network` or :class:" "`IPv6Network` objects. *addresses* is an :term:`iterable` of :class:" @@ -1030,42 +1036,42 @@ msgid "" "if *addresses* contains mixed version objects." msgstr "" -#: library/ipaddress.rst:998 +#: library/ipaddress.rst:1005 msgid "" "Return a key suitable for sorting between networks and addresses. Address " "and Network objects are not sortable by default; they're fundamentally " "different, so the expression::" msgstr "" -#: library/ipaddress.rst:1002 +#: library/ipaddress.rst:1009 msgid "IPv4Address('192.0.2.0') <= IPv4Network('192.0.2.0/24')" msgstr "" -#: library/ipaddress.rst:1004 +#: library/ipaddress.rst:1011 msgid "" "doesn't make sense. There are some times however, where you may wish to " "have :mod:`ipaddress` sort these anyway. If you need to do this, you can " "use this function as the *key* argument to :func:`sorted`." msgstr "" -#: library/ipaddress.rst:1008 +#: library/ipaddress.rst:1015 msgid "*obj* is either a network or address object." msgstr "" -#: library/ipaddress.rst:1012 +#: library/ipaddress.rst:1019 msgid "Custom Exceptions" msgstr "" -#: library/ipaddress.rst:1014 +#: library/ipaddress.rst:1021 msgid "" "To support more specific error reporting from class constructors, the module " "defines the following exceptions:" msgstr "" -#: library/ipaddress.rst:1019 +#: library/ipaddress.rst:1026 msgid "Any value error related to the address." msgstr "" -#: library/ipaddress.rst:1024 +#: library/ipaddress.rst:1031 msgid "Any value error related to the net mask." msgstr "" diff --git a/library/ipc.po b/library/ipc.po index a4687b3e..5a6d639a 100644 --- a/library/ipc.po +++ b/library/ipc.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" diff --git a/library/itertools.po b/library/itertools.po index 07f49dfb..7afa15aa 100644 --- a/library/itertools.po +++ b/library/itertools.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -44,403 +44,398 @@ msgid "" "by combining :func:`map` and :func:`count` to form ``map(f, count())``." msgstr "" -#: library/itertools.rst:33 -msgid "" -"These tools and their built-in counterparts also work well with the high-" -"speed functions in the :mod:`operator` module. For example, the " -"multiplication operator can be mapped across two vectors to form an " -"efficient dot-product: ``sum(starmap(operator.mul, zip(vec1, vec2, " -"strict=True)))``." -msgstr "" - -#: library/itertools.rst:39 +#: library/itertools.rst:34 msgid "**Infinite iterators:**" msgstr "" -#: library/itertools.rst:52 library/itertools.rst:73 +#: library/itertools.rst:47 library/itertools.rst:68 msgid "Iterator" msgstr "" -#: library/itertools.rst:52 library/itertools.rst:73 +#: library/itertools.rst:47 library/itertools.rst:68 msgid "Arguments" msgstr "" -#: library/itertools.rst:52 library/itertools.rst:82 +#: library/itertools.rst:47 library/itertools.rst:77 msgid "Results" msgstr "" -#: library/itertools.rst:52 +#: library/itertools.rst:47 msgid "Example" msgstr "" -#: library/itertools.rst:44 +#: library/itertools.rst:39 msgid ":func:`count`" msgstr "" -#: library/itertools.rst:44 +#: library/itertools.rst:39 msgid "[start[, step]]" msgstr "" -#: library/itertools.rst:44 +#: library/itertools.rst:39 msgid "start, start+step, start+2*step, ..." msgstr "" -#: library/itertools.rst:44 +#: library/itertools.rst:39 msgid "``count(10) → 10 11 12 13 14 ...``" msgstr "" -#: library/itertools.rst:45 +#: library/itertools.rst:40 msgid ":func:`cycle`" msgstr "" -#: library/itertools.rst:45 +#: library/itertools.rst:40 msgid "p" msgstr "" -#: library/itertools.rst:45 +#: library/itertools.rst:40 msgid "p0, p1, ... plast, p0, p1, ..." msgstr "" -#: library/itertools.rst:45 +#: library/itertools.rst:40 msgid "``cycle('ABCD') → A B C D A B C D ...``" msgstr "" -#: library/itertools.rst:46 +#: library/itertools.rst:41 msgid ":func:`repeat`" msgstr "" -#: library/itertools.rst:46 +#: library/itertools.rst:41 msgid "elem [,n]" msgstr "" -#: library/itertools.rst:46 +#: library/itertools.rst:41 msgid "elem, elem, elem, ... endlessly or up to n times" msgstr "" -#: library/itertools.rst:46 +#: library/itertools.rst:41 msgid "``repeat(10, 3) → 10 10 10``" msgstr "" -#: library/itertools.rst:49 +#: library/itertools.rst:44 msgid "**Iterators terminating on the shortest input sequence:**" msgstr "" -#: library/itertools.rst:54 +#: library/itertools.rst:49 msgid ":func:`accumulate`" msgstr "" -#: library/itertools.rst:54 +#: library/itertools.rst:49 msgid "p [,func]" msgstr "" -#: library/itertools.rst:54 +#: library/itertools.rst:49 msgid "p0, p0+p1, p0+p1+p2, ..." msgstr "" -#: library/itertools.rst:54 +#: library/itertools.rst:49 msgid "``accumulate([1,2,3,4,5]) → 1 3 6 10 15``" msgstr "" -#: library/itertools.rst:55 +#: library/itertools.rst:50 msgid ":func:`batched`" msgstr "" -#: library/itertools.rst:55 +#: library/itertools.rst:50 msgid "p, n" msgstr "" -#: library/itertools.rst:55 +#: library/itertools.rst:50 msgid "(p0, p1, ..., p_n-1), ..." msgstr "" -#: library/itertools.rst:55 +#: library/itertools.rst:50 msgid "``batched('ABCDEFG', n=3) → ABC DEF G``" msgstr "" -#: library/itertools.rst:56 +#: library/itertools.rst:51 msgid ":func:`chain`" msgstr "" -#: library/itertools.rst:67 +#: library/itertools.rst:62 msgid "p, q, ..." msgstr "" -#: library/itertools.rst:57 +#: library/itertools.rst:52 msgid "p0, p1, ... plast, q0, q1, ..." msgstr "" -#: library/itertools.rst:56 +#: library/itertools.rst:51 msgid "``chain('ABC', 'DEF') → A B C D E F``" msgstr "" -#: library/itertools.rst:57 +#: library/itertools.rst:52 msgid ":func:`chain.from_iterable`" msgstr "" -#: library/itertools.rst:63 +#: library/itertools.rst:58 msgid "iterable" msgstr "" -#: library/itertools.rst:57 +#: library/itertools.rst:52 msgid "``chain.from_iterable(['ABC', 'DEF']) → A B C D E F``" msgstr "" -#: library/itertools.rst:58 +#: library/itertools.rst:53 msgid ":func:`compress`" msgstr "" -#: library/itertools.rst:58 +#: library/itertools.rst:53 msgid "data, selectors" msgstr "" -#: library/itertools.rst:58 +#: library/itertools.rst:53 msgid "(d[0] if s[0]), (d[1] if s[1]), ..." msgstr "" -#: library/itertools.rst:58 +#: library/itertools.rst:53 msgid "``compress('ABCDEF', [1,0,1,0,1,1]) → A C E F``" msgstr "" -#: library/itertools.rst:59 +#: library/itertools.rst:54 msgid ":func:`dropwhile`" msgstr "" -#: library/itertools.rst:60 library/itertools.rst:65 +#: library/itertools.rst:55 library/itertools.rst:60 msgid "predicate, seq" msgstr "" -#: library/itertools.rst:59 +#: library/itertools.rst:54 msgid "seq[n], seq[n+1], starting when predicate fails" msgstr "" -#: library/itertools.rst:59 +#: library/itertools.rst:54 msgid "``dropwhile(lambda x: x<5, [1,4,6,3,8]) → 6 3 8``" msgstr "" -#: library/itertools.rst:60 +#: library/itertools.rst:55 msgid ":func:`filterfalse`" msgstr "" -#: library/itertools.rst:60 +#: library/itertools.rst:55 msgid "elements of seq where predicate(elem) fails" msgstr "" -#: library/itertools.rst:60 +#: library/itertools.rst:55 msgid "``filterfalse(lambda x: x<5, [1,4,6,3,8]) → 6 8``" msgstr "" -#: library/itertools.rst:61 +#: library/itertools.rst:56 msgid ":func:`groupby`" msgstr "" -#: library/itertools.rst:61 +#: library/itertools.rst:56 msgid "iterable[, key]" msgstr "" -#: library/itertools.rst:61 +#: library/itertools.rst:56 msgid "sub-iterators grouped by value of key(v)" msgstr "" -#: library/itertools.rst:62 +#: library/itertools.rst:56 +msgid "``groupby(['A','B','DEF'], len) → (1, A B) (3, DEF)``" +msgstr "" + +#: library/itertools.rst:57 msgid ":func:`islice`" msgstr "" -#: library/itertools.rst:62 +#: library/itertools.rst:57 msgid "seq, [start,] stop [, step]" msgstr "" -#: library/itertools.rst:62 +#: library/itertools.rst:57 msgid "elements from seq[start:stop:step]" msgstr "" -#: library/itertools.rst:62 +#: library/itertools.rst:57 msgid "``islice('ABCDEFG', 2, None) → C D E F G``" msgstr "" -#: library/itertools.rst:63 +#: library/itertools.rst:58 msgid ":func:`pairwise`" msgstr "" -#: library/itertools.rst:63 +#: library/itertools.rst:58 msgid "(p[0], p[1]), (p[1], p[2])" msgstr "" -#: library/itertools.rst:63 +#: library/itertools.rst:58 msgid "``pairwise('ABCDEFG') → AB BC CD DE EF FG``" msgstr "" -#: library/itertools.rst:64 +#: library/itertools.rst:59 msgid ":func:`starmap`" msgstr "" -#: library/itertools.rst:64 +#: library/itertools.rst:59 msgid "func, seq" msgstr "" -#: library/itertools.rst:64 +#: library/itertools.rst:59 msgid "func(\\*seq[0]), func(\\*seq[1]), ..." msgstr "" -#: library/itertools.rst:64 +#: library/itertools.rst:59 msgid "``starmap(pow, [(2,5), (3,2), (10,3)]) → 32 9 1000``" msgstr "" -#: library/itertools.rst:65 +#: library/itertools.rst:60 msgid ":func:`takewhile`" msgstr "" -#: library/itertools.rst:65 +#: library/itertools.rst:60 msgid "seq[0], seq[1], until predicate fails" msgstr "" -#: library/itertools.rst:65 +#: library/itertools.rst:60 msgid "``takewhile(lambda x: x<5, [1,4,6,3,8]) → 1 4``" msgstr "" -#: library/itertools.rst:66 +#: library/itertools.rst:61 msgid ":func:`tee`" msgstr "" -#: library/itertools.rst:66 +#: library/itertools.rst:61 msgid "it, n" msgstr "" -#: library/itertools.rst:66 +#: library/itertools.rst:61 msgid "it1, it2, ... itn splits one iterator into n" msgstr "" -#: library/itertools.rst:67 +#: library/itertools.rst:62 msgid ":func:`zip_longest`" msgstr "" -#: library/itertools.rst:67 +#: library/itertools.rst:62 msgid "(p[0], q[0]), (p[1], q[1]), ..." msgstr "" -#: library/itertools.rst:67 +#: library/itertools.rst:62 msgid "``zip_longest('ABCD', 'xy', fillvalue='-') → Ax By C- D-``" msgstr "" -#: library/itertools.rst:70 +#: library/itertools.rst:65 msgid "**Combinatoric iterators:**" msgstr "" -#: library/itertools.rst:75 +#: library/itertools.rst:70 msgid ":func:`product`" msgstr "" -#: library/itertools.rst:75 +#: library/itertools.rst:70 msgid "p, q, ... [repeat=1]" msgstr "" -#: library/itertools.rst:75 +#: library/itertools.rst:70 msgid "cartesian product, equivalent to a nested for-loop" msgstr "" -#: library/itertools.rst:76 +#: library/itertools.rst:71 msgid ":func:`permutations`" msgstr "" -#: library/itertools.rst:76 +#: library/itertools.rst:71 msgid "p[, r]" msgstr "" -#: library/itertools.rst:76 +#: library/itertools.rst:71 msgid "r-length tuples, all possible orderings, no repeated elements" msgstr "" -#: library/itertools.rst:77 +#: library/itertools.rst:72 msgid ":func:`combinations`" msgstr "" -#: library/itertools.rst:78 +#: library/itertools.rst:73 msgid "p, r" msgstr "" -#: library/itertools.rst:77 +#: library/itertools.rst:72 msgid "r-length tuples, in sorted order, no repeated elements" msgstr "" -#: library/itertools.rst:78 +#: library/itertools.rst:73 msgid ":func:`combinations_with_replacement`" msgstr "" -#: library/itertools.rst:78 +#: library/itertools.rst:73 msgid "r-length tuples, in sorted order, with repeated elements" msgstr "" -#: library/itertools.rst:82 +#: library/itertools.rst:77 msgid "Examples" msgstr "" -#: library/itertools.rst:84 +#: library/itertools.rst:79 msgid "``product('ABCD', repeat=2)``" msgstr "" -#: library/itertools.rst:84 +#: library/itertools.rst:79 msgid "``AA AB AC AD BA BB BC BD CA CB CC CD DA DB DC DD``" msgstr "" -#: library/itertools.rst:85 +#: library/itertools.rst:80 msgid "``permutations('ABCD', 2)``" msgstr "" -#: library/itertools.rst:85 +#: library/itertools.rst:80 msgid "``AB AC AD BA BC BD CA CB CD DA DB DC``" msgstr "" -#: library/itertools.rst:86 +#: library/itertools.rst:81 msgid "``combinations('ABCD', 2)``" msgstr "" -#: library/itertools.rst:86 +#: library/itertools.rst:81 msgid "``AB AC AD BC BD CD``" msgstr "" -#: library/itertools.rst:87 +#: library/itertools.rst:82 msgid "``combinations_with_replacement('ABCD', 2)``" msgstr "" -#: library/itertools.rst:87 +#: library/itertools.rst:82 msgid "``AA AB AC AD BB BC BD CC CD DD``" msgstr "" -#: library/itertools.rst:94 +#: library/itertools.rst:89 msgid "Itertool Functions" msgstr "" -#: library/itertools.rst:96 +#: library/itertools.rst:91 msgid "" -"The following module functions all construct and return iterators. Some " -"provide streams of infinite length, so they should only be accessed by " -"functions or loops that truncate the stream." +"The following functions all construct and return iterators. Some provide " +"streams of infinite length, so they should only be accessed by functions or " +"loops that truncate the stream." msgstr "" -#: library/itertools.rst:103 +#: library/itertools.rst:98 msgid "" "Make an iterator that returns accumulated sums or accumulated results from " "other binary functions." msgstr "" -#: library/itertools.rst:106 +#: library/itertools.rst:101 msgid "" "The *function* defaults to addition. The *function* should accept two " "arguments, an accumulated total and a value from the *iterable*." msgstr "" -#: library/itertools.rst:109 +#: library/itertools.rst:104 msgid "" "If an *initial* value is provided, the accumulation will start with that " "value and the output will have one more element than the input iterable." msgstr "" -#: library/itertools.rst:182 library/itertools.rst:279 -#: library/itertools.rst:507 library/itertools.rst:615 -#: library/itertools.rst:731 +#: library/itertools.rst:181 library/itertools.rst:283 +#: library/itertools.rst:519 library/itertools.rst:632 +#: library/itertools.rst:774 msgid "Roughly equivalent to::" msgstr "" -#: library/itertools.rst:115 +#: library/itertools.rst:110 msgid "" "def accumulate(iterable, function=operator.add, *, initial=None):\n" " 'Return running totals'\n" @@ -462,16 +457,16 @@ msgid "" " yield total" msgstr "" -#: library/itertools.rst:134 +#: library/itertools.rst:129 msgid "" -"The *function* argument can be set to :func:`min` for a running minimum, :" -"func:`max` for a running maximum, or :func:`operator.mul` for a running " -"product. `Amortization tables `_ can be built by accumulating interest and applying " -"payments:" +"To compute a running minimum, set *function* to :func:`min`. For a running " +"maximum, set *function* to :func:`max`. Or for a running product, set " +"*function* to :func:`operator.mul`. To build an `amortization table `_, accumulate the " +"interest and apply payments:" msgstr "" -#: library/itertools.rst:140 +#: library/itertools.rst:136 msgid "" ">>> data = [3, 4, 6, 2, 1, 9, 0, 7, 5, 8]\n" ">>> list(accumulate(data, max)) # running maximum\n" @@ -485,27 +480,33 @@ msgid "" "[1000, 960, 918, 874, 828, 779, 728, 674, 618, 559, 497]" msgstr "" -#: library/itertools.rst:153 +#: library/itertools.rst:149 msgid "" "See :func:`functools.reduce` for a similar function that returns only the " "final accumulated value." msgstr "" -#: library/itertools.rst:158 +#: library/itertools.rst:154 msgid "Added the optional *function* parameter." msgstr "" -#: library/itertools.rst:161 +#: library/itertools.rst:157 msgid "Added the optional *initial* parameter." msgstr "" -#: library/itertools.rst:167 +#: library/itertools.rst:163 msgid "" "Batch data from the *iterable* into tuples of length *n*. The last batch may " "be shorter than *n*." msgstr "" -#: library/itertools.rst:170 +#: library/itertools.rst:166 +msgid "" +"If *strict* is true, will raise a :exc:`ValueError` if the final batch is " +"shorter than *n*." +msgstr "" + +#: library/itertools.rst:169 msgid "" "Loops over the input iterable and accumulates data into tuples up to size " "*n*. The input is consumed lazily, just enough to fill a batch. The result " @@ -513,7 +514,7 @@ msgid "" "exhausted:" msgstr "" -#: library/itertools.rst:175 +#: library/itertools.rst:174 msgid "" ">>> flattened_data = ['roses', 'red', 'violets', 'blue', 'sugar', 'sweet']\n" ">>> unflattened = list(batched(flattened_data, 2))\n" @@ -521,26 +522,32 @@ msgid "" "[('roses', 'red'), ('violets', 'blue'), ('sugar', 'sweet')]" msgstr "" -#: library/itertools.rst:184 +#: library/itertools.rst:183 msgid "" -"def batched(iterable, n):\n" +"def batched(iterable, n, *, strict=False):\n" " # batched('ABCDEFG', 3) → ABC DEF G\n" " if n < 1:\n" " raise ValueError('n must be at least one')\n" " iterator = iter(iterable)\n" " while batch := tuple(islice(iterator, n)):\n" +" if strict and len(batch) != n:\n" +" raise ValueError('batched(): incomplete batch')\n" " yield batch" msgstr "" -#: library/itertools.rst:197 +#: library/itertools.rst:195 +msgid "Added the *strict* option." +msgstr "" + +#: library/itertools.rst:201 msgid "" "Make an iterator that returns elements from the first iterable until it is " "exhausted, then proceeds to the next iterable, until all of the iterables " -"are exhausted. Used for treating consecutive sequences as a single " -"sequence. Roughly equivalent to::" +"are exhausted. This combines multiple data sources into a single iterator. " +"Roughly equivalent to::" msgstr "" -#: library/itertools.rst:202 +#: library/itertools.rst:206 msgid "" "def chain(*iterables):\n" " # chain('ABC', 'DEF') → A B C D E F\n" @@ -548,13 +555,13 @@ msgid "" " yield from iterable" msgstr "" -#: library/itertools.rst:210 +#: library/itertools.rst:214 msgid "" "Alternate constructor for :func:`chain`. Gets chained inputs from a single " "iterable argument that is evaluated lazily. Roughly equivalent to::" msgstr "" -#: library/itertools.rst:213 +#: library/itertools.rst:217 msgid "" "def from_iterable(iterables):\n" " # chain.from_iterable(['ABC', 'DEF']) → A B C D E F\n" @@ -562,11 +569,11 @@ msgid "" " yield from iterable" msgstr "" -#: library/itertools.rst:221 +#: library/itertools.rst:225 msgid "Return *r* length subsequences of elements from the input *iterable*." msgstr "" -#: library/itertools.rst:223 +#: library/itertools.rst:227 msgid "" "The output is a subsequence of :func:`product` keeping only entries that are " "subsequences of the *iterable*. The length of the output is given by :func:" @@ -574,21 +581,21 @@ msgid "" "when ``r > n``." msgstr "" -#: library/itertools.rst:228 +#: library/itertools.rst:232 msgid "" "The combination tuples are emitted in lexicographic order according to the " "order of the input *iterable*. If the input *iterable* is sorted, the output " "tuples will be produced in sorted order." msgstr "" -#: library/itertools.rst:232 +#: library/itertools.rst:236 msgid "" "Elements are treated as unique based on their position, not on their value. " "If the input elements are unique, there will be no repeated values within " "each combination." msgstr "" -#: library/itertools.rst:238 +#: library/itertools.rst:242 msgid "" "def combinations(iterable, r):\n" " # combinations('ABCD', 2) → AB AC AD BC BD CD\n" @@ -613,13 +620,13 @@ msgid "" " yield tuple(pool[i] for i in indices)" msgstr "" -#: library/itertools.rst:263 +#: library/itertools.rst:267 msgid "" "Return *r* length subsequences of elements from the input *iterable* " "allowing individual elements to be repeated more than once." msgstr "" -#: library/itertools.rst:266 +#: library/itertools.rst:270 msgid "" "The output is a subsequence of :func:`product` that keeps only entries that " "are subsequences (with possible repeated elements) of the *iterable*. The " @@ -627,21 +634,21 @@ msgid "" "> 0``." msgstr "" -#: library/itertools.rst:271 +#: library/itertools.rst:275 msgid "" "The combination tuples are emitted in lexicographic order according to the " "order of the input *iterable*. if the input *iterable* is sorted, the output " "tuples will be produced in sorted order." msgstr "" -#: library/itertools.rst:275 +#: library/itertools.rst:279 msgid "" "Elements are treated as unique based on their position, not on their value. " "If the input elements are unique, the generated combinations will also be " "unique." msgstr "" -#: library/itertools.rst:281 +#: library/itertools.rst:285 msgid "" "def combinations_with_replacement(iterable, r):\n" " # combinations_with_replacement('ABC', 2) → AA AB AC BB BC CC\n" @@ -663,28 +670,28 @@ msgid "" " yield tuple(pool[i] for i in indices)" msgstr "" -#: library/itertools.rst:305 +#: library/itertools.rst:309 msgid "" "Make an iterator that returns elements from *data* where the corresponding " "element in *selectors* is true. Stops when either the *data* or *selectors* " "iterables have been exhausted. Roughly equivalent to::" msgstr "" -#: library/itertools.rst:310 +#: library/itertools.rst:314 msgid "" "def compress(data, selectors):\n" " # compress('ABCDEF', [1,0,1,0,1,1]) → A C E F\n" " return (datum for datum, selector in zip(data, selectors) if selector)" msgstr "" -#: library/itertools.rst:319 +#: library/itertools.rst:323 msgid "" "Make an iterator that returns evenly spaced values beginning with *start*. " "Can be used with :func:`map` to generate consecutive data points or with :" "func:`zip` to add sequence numbers. Roughly equivalent to::" msgstr "" -#: library/itertools.rst:324 +#: library/itertools.rst:328 msgid "" "def count(start=0, step=1):\n" " # count(10) → 10 11 12 13 14 ...\n" @@ -695,51 +702,53 @@ msgid "" " n += step" msgstr "" -#: library/itertools.rst:332 +#: library/itertools.rst:336 msgid "" "When counting with floating-point numbers, better accuracy can sometimes be " "achieved by substituting multiplicative code such as: ``(start + step * i " "for i in count())``." msgstr "" -#: library/itertools.rst:336 +#: library/itertools.rst:340 msgid "Added *step* argument and allowed non-integer arguments." msgstr "" -#: library/itertools.rst:342 +#: library/itertools.rst:346 msgid "" "Make an iterator returning elements from the *iterable* and saving a copy of " "each. When the iterable is exhausted, return elements from the saved copy. " "Repeats indefinitely. Roughly equivalent to::" msgstr "" -#: library/itertools.rst:346 +#: library/itertools.rst:350 msgid "" "def cycle(iterable):\n" " # cycle('ABCD') → A B C D A B C D A B C D ...\n" +"\n" " saved = []\n" " for element in iterable:\n" " yield element\n" " saved.append(element)\n" +"\n" " while saved:\n" " for element in saved:\n" " yield element" msgstr "" -#: library/itertools.rst:356 +#: library/itertools.rst:362 msgid "" "This itertool may require significant auxiliary storage (depending on the " "length of the iterable)." msgstr "" -#: library/itertools.rst:362 +#: library/itertools.rst:368 msgid "" "Make an iterator that drops elements from the *iterable* while the " "*predicate* is true and afterwards returns every element. Roughly " "equivalent to::" msgstr "" -#: library/itertools.rst:366 +#: library/itertools.rst:372 msgid "" "def dropwhile(predicate, iterable):\n" " # dropwhile(lambda x: x<5, [1,4,6,3,8]) → 6 3 8\n" @@ -754,31 +763,33 @@ msgid "" " yield x" msgstr "" -#: library/itertools.rst:378 +#: library/itertools.rst:384 msgid "" "Note this does not produce *any* output until the predicate first becomes " "false, so this itertool may have a lengthy start-up time." msgstr "" -#: library/itertools.rst:384 +#: library/itertools.rst:390 msgid "" "Make an iterator that filters elements from the *iterable* returning only " "those for which the *predicate* returns a false value. If *predicate* is " "``None``, returns the items that are false. Roughly equivalent to::" msgstr "" -#: library/itertools.rst:389 +#: library/itertools.rst:395 msgid "" "def filterfalse(predicate, iterable):\n" " # filterfalse(lambda x: x<5, [1,4,6,3,8]) → 6 8\n" +"\n" " if predicate is None:\n" " predicate = bool\n" +"\n" " for x in iterable:\n" " if not predicate(x):\n" " yield x" msgstr "" -#: library/itertools.rst:400 +#: library/itertools.rst:408 msgid "" "Make an iterator that returns consecutive keys and groups from the " "*iterable*. The *key* is a function computing a key value for each element. " @@ -787,7 +798,7 @@ msgid "" "sorted on the same key function." msgstr "" -#: library/itertools.rst:406 +#: library/itertools.rst:414 msgid "" "The operation of :func:`groupby` is similar to the ``uniq`` filter in Unix. " "It generates a break or new group every time the value of the key function " @@ -796,7 +807,7 @@ msgid "" "aggregates common elements regardless of their input order." msgstr "" -#: library/itertools.rst:412 +#: library/itertools.rst:420 msgid "" "The returned group is itself an iterator that shares the underlying iterable " "with :func:`groupby`. Because the source is shared, when the :func:" @@ -804,7 +815,7 @@ msgid "" "if that data is needed later, it should be stored as a list::" msgstr "" -#: library/itertools.rst:417 +#: library/itertools.rst:425 msgid "" "groups = []\n" "uniquekeys = []\n" @@ -814,11 +825,11 @@ msgid "" " uniquekeys.append(k)" msgstr "" -#: library/itertools.rst:424 +#: library/itertools.rst:432 msgid ":func:`groupby` is roughly equivalent to::" msgstr "" -#: library/itertools.rst:426 +#: library/itertools.rst:434 msgid "" "def groupby(iterable, key=None):\n" " # [k for k, g in groupby('AAAABBBCCDAABBB')] → A B C D A B\n" @@ -853,33 +864,33 @@ msgid "" " pass" msgstr "" -#: library/itertools.rst:462 +#: library/itertools.rst:470 msgid "" "Make an iterator that returns selected elements from the iterable. Works " "like sequence slicing but does not support negative values for *start*, " "*stop*, or *step*." msgstr "" -#: library/itertools.rst:466 +#: library/itertools.rst:474 msgid "" "If *start* is zero or ``None``, iteration starts at zero. Otherwise, " "elements from the iterable are skipped until *start* is reached." msgstr "" -#: library/itertools.rst:469 +#: library/itertools.rst:477 msgid "" -"If *stop* is ``None``, iteration continues until the iterator is exhausted, " -"if at all. Otherwise, it stops at the specified position." +"If *stop* is ``None``, iteration continues until the input is exhausted, if " +"at all. Otherwise, it stops at the specified position." msgstr "" -#: library/itertools.rst:472 +#: library/itertools.rst:480 msgid "" "If *step* is ``None``, the step defaults to one. Elements are returned " "consecutively unless *step* is set higher than one which results in items " "being skipped." msgstr "" -#: library/itertools.rst:478 +#: library/itertools.rst:486 msgid "" "def islice(iterable, *args):\n" " # islice('ABCDEFG', 2) → A B\n" @@ -902,41 +913,49 @@ msgid "" " next_i += step" msgstr "" -#: library/itertools.rst:501 +#: library/itertools.rst:506 +msgid "" +"If the input is an iterator, then fully consuming the *islice* advances the " +"input iterator by ``max(start, stop)`` steps regardless of the *step* value." +msgstr "" + +#: library/itertools.rst:513 msgid "Return successive overlapping pairs taken from the input *iterable*." msgstr "" -#: library/itertools.rst:503 +#: library/itertools.rst:515 msgid "" "The number of 2-tuples in the output iterator will be one fewer than the " "number of inputs. It will be empty if the input iterable has fewer than two " "values." msgstr "" -#: library/itertools.rst:509 +#: library/itertools.rst:521 msgid "" "def pairwise(iterable):\n" " # pairwise('ABCDEFG') → AB BC CD DE EF FG\n" +"\n" " iterator = iter(iterable)\n" " a = next(iterator, None)\n" +"\n" " for b in iterator:\n" " yield a, b\n" " a = b" msgstr "" -#: library/itertools.rst:522 +#: library/itertools.rst:536 msgid "" "Return successive *r* length `permutations of elements `_ from the *iterable*." msgstr "" -#: library/itertools.rst:525 +#: library/itertools.rst:539 msgid "" "If *r* is not specified or is ``None``, then *r* defaults to the length of " "the *iterable* and all possible full-length permutations are generated." msgstr "" -#: library/itertools.rst:529 +#: library/itertools.rst:543 msgid "" "The output is a subsequence of :func:`product` where entries with repeated " "elements have been filtered out. The length of the output is given by :func:" @@ -944,21 +963,21 @@ msgid "" "``r > n``." msgstr "" -#: library/itertools.rst:534 +#: library/itertools.rst:548 msgid "" "The permutation tuples are emitted in lexicographic order according to the " "order of the input *iterable*. If the input *iterable* is sorted, the " "output tuples will be produced in sorted order." msgstr "" -#: library/itertools.rst:538 +#: library/itertools.rst:552 msgid "" "Elements are treated as unique based on their position, not on their value. " "If the input elements are unique, there will be no repeated values within a " "permutation." msgstr "" -#: library/itertools.rst:544 +#: library/itertools.rst:558 msgid "" "def permutations(iterable, r=None):\n" " # permutations('ABCD', 2) → AB AC AD BA BC BD CA CB CD DA DB DC\n" @@ -989,18 +1008,20 @@ msgid "" " return" msgstr "" -#: library/itertools.rst:575 -msgid "Cartesian product of input iterables." +#: library/itertools.rst:589 +msgid "" +"`Cartesian product `_ of " +"the input iterables." msgstr "" -#: library/itertools.rst:577 +#: library/itertools.rst:592 msgid "" "Roughly equivalent to nested for-loops in a generator expression. For " "example, ``product(A, B)`` returns the same as ``((x,y) for x in A for y in " "B)``." msgstr "" -#: library/itertools.rst:580 +#: library/itertools.rst:595 msgid "" "The nested loops cycle like an odometer with the rightmost element advancing " "on every iteration. This pattern creates a lexicographic ordering so that " @@ -1008,25 +1029,27 @@ msgid "" "sorted order." msgstr "" -#: library/itertools.rst:585 +#: library/itertools.rst:600 msgid "" "To compute the product of an iterable with itself, specify the number of " "repetitions with the optional *repeat* keyword argument. For example, " "``product(A, repeat=4)`` means the same as ``product(A, A, A, A)``." msgstr "" -#: library/itertools.rst:589 +#: library/itertools.rst:604 msgid "" "This function is roughly equivalent to the following code, except that the " "actual implementation does not build up intermediate results in memory::" msgstr "" -#: library/itertools.rst:592 +#: library/itertools.rst:607 msgid "" "def product(*iterables, repeat=1):\n" " # product('ABCD', 'xy') → Ax Ay Bx By Cx Cy Dx Dy\n" " # product(range(2), repeat=3) → 000 001 010 011 100 101 110 111\n" "\n" +" if repeat < 0:\n" +" raise ValueError('repeat argument cannot be negative')\n" " pools = [tuple(pool) for pool in iterables] * repeat\n" "\n" " result = [[]]\n" @@ -1037,20 +1060,20 @@ msgid "" " yield tuple(prod)" msgstr "" -#: library/itertools.rst:605 +#: library/itertools.rst:622 msgid "" "Before :func:`product` runs, it completely consumes the input iterables, " "keeping pools of values in memory to generate the products. Accordingly, it " "is only useful with finite inputs." msgstr "" -#: library/itertools.rst:612 +#: library/itertools.rst:629 msgid "" "Make an iterator that returns *object* over and over again. Runs " "indefinitely unless the *times* argument is specified." msgstr "" -#: library/itertools.rst:617 +#: library/itertools.rst:634 msgid "" "def repeat(object, times=None):\n" " # repeat(10, 3) → 10 10 10\n" @@ -1062,33 +1085,33 @@ msgid "" " yield object" msgstr "" -#: library/itertools.rst:626 +#: library/itertools.rst:643 msgid "" "A common use for *repeat* is to supply a stream of constant values to *map* " "or *zip*:" msgstr "" -#: library/itertools.rst:629 +#: library/itertools.rst:646 msgid "" ">>> list(map(pow, range(10), repeat(2)))\n" "[0, 1, 4, 9, 16, 25, 36, 49, 64, 81]" msgstr "" -#: library/itertools.rst:637 +#: library/itertools.rst:654 msgid "" "Make an iterator that computes the *function* using arguments obtained from " "the *iterable*. Used instead of :func:`map` when argument parameters have " "already been \"pre-zipped\" into tuples." msgstr "" -#: library/itertools.rst:641 +#: library/itertools.rst:658 msgid "" "The difference between :func:`map` and :func:`starmap` parallels the " "distinction between ``function(a,b)`` and ``function(*c)``. Roughly " "equivalent to::" msgstr "" -#: library/itertools.rst:645 +#: library/itertools.rst:662 msgid "" "def starmap(function, iterable):\n" " # starmap(pow, [(2,5), (3,2), (10,3)]) → 32 9 1000\n" @@ -1096,13 +1119,13 @@ msgid "" " yield function(*args)" msgstr "" -#: library/itertools.rst:653 +#: library/itertools.rst:670 msgid "" "Make an iterator that returns elements from the *iterable* as long as the " "*predicate* is true. Roughly equivalent to::" msgstr "" -#: library/itertools.rst:656 +#: library/itertools.rst:673 msgid "" "def takewhile(predicate, iterable):\n" " # takewhile(lambda x: x<5, [1,4,6,3,8]) → 1 4\n" @@ -1112,7 +1135,7 @@ msgid "" " yield x" msgstr "" -#: library/itertools.rst:663 +#: library/itertools.rst:680 msgid "" "Note, the element that first fails the predicate condition is consumed from " "the input iterator and there is no way to access it. This could be an issue " @@ -1122,11 +1145,11 @@ msgid "" "readthedocs.io/en/stable/api.html#more_itertools.before_and_after>`_ instead." msgstr "" -#: library/itertools.rst:674 +#: library/itertools.rst:691 msgid "Return *n* independent iterators from a single iterable." msgstr "" -#: library/itertools.rst:678 +#: library/itertools.rst:695 msgid "" "def tee(iterable, n=2):\n" " if n < 0:\n" @@ -1162,14 +1185,47 @@ msgid "" " return value" msgstr "" -#: library/itertools.rst:711 +#: library/itertools.rst:728 +msgid "" +"When the input *iterable* is already a tee iterator object, all members of " +"the return tuple are constructed as if they had been produced by the " +"upstream :func:`tee` call. This \"flattening step\" allows nested :func:" +"`tee` calls to share the same underlying data chain and to have a single " +"update step rather than a chain of calls." +msgstr "" + +#: library/itertools.rst:734 +msgid "The flattening property makes tee iterators efficiently peekable:" +msgstr "" + +#: library/itertools.rst:736 +msgid "" +"def lookahead(tee_iterator):\n" +" \"Return the next value without moving the input forward\"\n" +" [forked_iterator] = tee(tee_iterator, 1)\n" +" return next(forked_iterator)" +msgstr "" + +#: library/itertools.rst:743 +msgid "" +">>> iterator = iter('abcdef')\n" +">>> [iterator] = tee(iterator, 1) # Make the input peekable\n" +">>> next(iterator) # Move the iterator forward\n" +"'a'\n" +">>> lookahead(iterator) # Check next value\n" +"'b'\n" +">>> next(iterator) # Continue moving forward\n" +"'b'" +msgstr "" + +#: library/itertools.rst:754 msgid "" "``tee`` iterators are not threadsafe. A :exc:`RuntimeError` may be raised " "when simultaneously using iterators returned by the same :func:`tee` call, " "even if the original *iterable* is threadsafe." msgstr "" -#: library/itertools.rst:715 +#: library/itertools.rst:758 msgid "" "This itertool may require significant auxiliary storage (depending on how " "much temporary data needs to be stored). In general, if one iterator uses " @@ -1177,21 +1233,21 @@ msgid "" "func:`list` instead of :func:`tee`." msgstr "" -#: library/itertools.rst:723 +#: library/itertools.rst:766 msgid "Make an iterator that aggregates elements from each of the *iterables*." msgstr "" -#: library/itertools.rst:726 +#: library/itertools.rst:769 msgid "" "If the iterables are of uneven length, missing values are filled-in with " "*fillvalue*. If not specified, *fillvalue* defaults to ``None``." msgstr "" -#: library/itertools.rst:729 +#: library/itertools.rst:772 msgid "Iteration continues until the longest iterable is exhausted." msgstr "" -#: library/itertools.rst:733 +#: library/itertools.rst:776 msgid "" "def zip_longest(*iterables, fillvalue=None):\n" " # zip_longest('ABCD', 'xy', fillvalue='-') → Ax By C- D-\n" @@ -1216,24 +1272,24 @@ msgid "" " yield tuple(values)" msgstr "" -#: library/itertools.rst:755 +#: library/itertools.rst:798 msgid "" "If one of the iterables is potentially infinite, then the :func:" "`zip_longest` function should be wrapped with something that limits the " "number of calls (for example :func:`islice` or :func:`takewhile`)." msgstr "" -#: library/itertools.rst:763 +#: library/itertools.rst:806 msgid "Itertools Recipes" msgstr "" -#: library/itertools.rst:765 +#: library/itertools.rst:808 msgid "" "This section shows recipes for creating an extended toolset using the " "existing itertools as building blocks." msgstr "" -#: library/itertools.rst:768 +#: library/itertools.rst:811 msgid "" "The primary purpose of the itertools recipes is educational. The recipes " "show various ways of thinking about individual tools — for example, that " @@ -1245,7 +1301,7 @@ msgid "" "``map()``, ``filter()``, ``reversed()``, and ``enumerate()``." msgstr "" -#: library/itertools.rst:777 +#: library/itertools.rst:820 msgid "" "A secondary purpose of the recipes is to serve as an incubator. The " "``accumulate()``, ``compress()``, and ``pairwise()`` itertools started out " @@ -1253,17 +1309,17 @@ msgid "" "``sieve()`` recipes are being tested to see whether they prove their worth." msgstr "" -#: library/itertools.rst:782 +#: library/itertools.rst:825 msgid "" "Substantially all of these recipes and many, many others can be installed " "from the :pypi:`more-itertools` project found on the Python Package Index::" msgstr "" -#: library/itertools.rst:786 +#: library/itertools.rst:829 msgid "python -m pip install more-itertools" msgstr "" -#: library/itertools.rst:788 +#: library/itertools.rst:831 msgid "" "Many of the recipes offer the same high performance as the underlying " "toolset. Superior memory performance is kept by processing elements one at a " @@ -1275,14 +1331,13 @@ msgid "" "overhead." msgstr "" -#: library/itertools.rst:796 +#: library/itertools.rst:839 msgid "" -"import collections\n" -"import contextlib\n" -"import functools\n" -"import math\n" -"import operator\n" -"import random\n" +"from collections import Counter, deque\n" +"from contextlib import suppress\n" +"from functools import reduce\n" +"from math import comb, prod, sumprod, isqrt\n" +"from operator import itemgetter, getitem, mul, neg\n" "\n" "def take(n, iterable):\n" " \"Return first n items of the iterable as a list.\"\n" @@ -1297,11 +1352,11 @@ msgid "" " \"Return function(0), function(1), ...\"\n" " return map(function, count(start))\n" "\n" -"def repeatfunc(func, times=None, *args):\n" -" \"Repeat calls to func with specified arguments.\"\n" +"def repeatfunc(function, times=None, *args):\n" +" \"Repeat calls to a function with specified arguments.\"\n" " if times is None:\n" -" return starmap(func, repeat(args))\n" -" return starmap(func, repeat(args, times))\n" +" return starmap(function, repeat(args))\n" +" return starmap(function, repeat(args, times))\n" "\n" "def flatten(list_of_lists):\n" " \"Flatten one level of nesting.\"\n" @@ -1319,13 +1374,13 @@ msgid "" "def tail(n, iterable):\n" " \"Return an iterator over the last n items.\"\n" " # tail(3, 'ABCDEFG') → E F G\n" -" return iter(collections.deque(iterable, maxlen=n))\n" +" return iter(deque(iterable, maxlen=n))\n" "\n" "def consume(iterator, n=None):\n" " \"Advance the iterator n-steps ahead. If n is None, consume entirely.\"\n" " # Use functions that consume iterators at C speed.\n" " if n is None:\n" -" collections.deque(iterator, maxlen=0)\n" +" deque(iterator, maxlen=0)\n" " else:\n" " next(islice(iterator, n, n), None)\n" "\n" @@ -1356,8 +1411,8 @@ msgid "" " # unique_justseen('AAAABBBCCDAABBB') → A B C D A B\n" " # unique_justseen('ABBcCAD', str.casefold) → A B c A D\n" " if key is None:\n" -" return map(operator.itemgetter(0), groupby(iterable))\n" -" return map(next, map(operator.itemgetter(1), groupby(iterable, key)))\n" +" return map(itemgetter(0), groupby(iterable))\n" +" return map(next, map(itemgetter(1), groupby(iterable, key)))\n" "\n" "def unique_everseen(iterable, key=None):\n" " \"Yield unique elements, preserving order. Remember all elements ever " @@ -1379,14 +1434,14 @@ msgid "" "def unique(iterable, key=None, reverse=False):\n" " \"Yield unique elements in sorted order. Supports unhashable inputs.\"\n" " # unique([[1, 2], [3, 4], [1, 2]]) → [1, 2] [3, 4]\n" -" return unique_justseen(sorted(iterable, key=key, reverse=reverse), " -"key=key)\n" +" sequenced = sorted(iterable, key=key, reverse=reverse)\n" +" return unique_justseen(sequenced, key=key)\n" "\n" "def sliding_window(iterable, n):\n" " \"Collect data into overlapping fixed-length chunks or blocks.\"\n" " # sliding_window('ABCDEFG', 4) → ABCD BCDE CDEF DEFG\n" " iterator = iter(iterable)\n" -" window = collections.deque(islice(iterator, n - 1), maxlen=n)\n" +" window = deque(islice(iterator, n - 1), maxlen=n)\n" " for x in iterator:\n" " window.append(x)\n" " yield tuple(window)\n" @@ -1416,21 +1471,11 @@ msgid "" " iterators = cycle(islice(iterators, num_active))\n" " yield from map(next, iterators)\n" "\n" -"def partition(predicate, iterable):\n" -" \"\"\"Partition entries into false entries and true entries.\n" -"\n" -" If *predicate* is slow, consider wrapping it with functools." -"lru_cache().\n" -" \"\"\"\n" -" # partition(is_odd, range(10)) → 0 2 4 6 8 and 1 3 5 7 9\n" -" t1, t2 = tee(iterable)\n" -" return filterfalse(predicate, t1), filter(predicate, t2)\n" -"\n" "def subslices(seq):\n" " \"Return all contiguous non-empty subslices of a sequence.\"\n" " # subslices('ABCD') → A AB ABC ABCD B BC BCD C CD D\n" " slices = starmap(slice, combinations(range(len(seq) + 1), 2))\n" -" return map(operator.getitem, repeat(seq), slices)\n" +" return map(getitem, repeat(seq), slices)\n" "\n" "def iter_index(iterable, value, start=0, stop=None):\n" " \"Return indices where a value occurs in a sequence or iterable.\"\n" @@ -1444,41 +1489,48 @@ msgid "" " else:\n" " stop = len(iterable) if stop is None else stop\n" " i = start\n" -" with contextlib.suppress(ValueError):\n" +" with suppress(ValueError):\n" " while True:\n" " yield (i := seq_index(value, i, stop))\n" " i += 1\n" "\n" -"def iter_except(func, exception, first=None):\n" +"def iter_except(function, exception, first=None):\n" " \"Convert a call-until-exception interface to an iterator interface.\"\n" " # iter_except(d.popitem, KeyError) → non-blocking dictionary iterator\n" -" with contextlib.suppress(exception):\n" +" with suppress(exception):\n" " if first is not None:\n" " yield first()\n" " while True:\n" -" yield func()" +" yield function()" msgstr "" -#: library/itertools.rst:974 +#: library/itertools.rst:1008 msgid "The following recipes have a more mathematical flavor:" msgstr "" -#: library/itertools.rst:976 +#: library/itertools.rst:1010 msgid "" +"def multinomial(*counts):\n" +" \"Number of distinct arrangements of a multiset.\"\n" +" # Counter('abracadabra').values() → 5 2 2 1 1\n" +" # multinomial(5, 2, 2, 1, 1) → 83160\n" +" return prod(map(comb, accumulate(counts), counts))\n" +"\n" "def powerset(iterable):\n" -" \"powerset([1,2,3]) → () (1,) (2,) (3,) (1,2) (1,3) (2,3) (1,2,3)\"\n" +" \"Subsequences of the iterable from shortest to longest.\"\n" +" # powerset([1,2,3]) → () (1,) (2,) (3,) (1,2) (1,3) (2,3) (1,2,3)\n" " s = list(iterable)\n" " return chain.from_iterable(combinations(s, r) for r in range(len(s)+1))\n" "\n" "def sum_of_squares(iterable):\n" " \"Add up the squares of the input values.\"\n" " # sum_of_squares([10, 20, 30]) → 1400\n" -" return math.sumprod(*tee(iterable))\n" +" return sumprod(*tee(iterable))\n" "\n" -"def reshape(matrix, cols):\n" +"def reshape(matrix, columns):\n" " \"Reshape a 2-D matrix to have a given number of columns.\"\n" " # reshape([(0, 1), (2, 3), (4, 5)], 3) → (0, 1, 2), (3, 4, 5)\n" -" return batched(chain.from_iterable(matrix), cols)\n" +" return batched(chain.from_iterable(matrix), columns, strict=True)\n" "\n" "def transpose(matrix):\n" " \"Swap the rows and columns of a 2-D matrix.\"\n" @@ -1489,7 +1541,7 @@ msgid "" " \"Multiply two matrices.\"\n" " # matmul([(7, 5), (3, 5)], [(2, 5), (7, 9)]) → (49, 80), (41, 60)\n" " n = len(m2[0])\n" -" return batched(starmap(math.sumprod, product(m1, transpose(m2))), n)\n" +" return batched(starmap(sumprod, product(m1, transpose(m2))), n)\n" "\n" "def convolve(signal, kernel):\n" " \"\"\"Discrete linear convolution of two iterables.\n" @@ -1510,7 +1562,7 @@ msgid "" " n = len(kernel)\n" " padded_signal = chain(repeat(0, n-1), signal, repeat(0, n-1))\n" " windowed_signal = sliding_window(padded_signal, n)\n" -" return map(math.sumprod, repeat(kernel), windowed_signal)\n" +" return map(sumprod, repeat(kernel), windowed_signal)\n" "\n" "def polynomial_from_roots(roots):\n" " \"\"\"Compute a polynomial's coefficients from its roots.\n" @@ -1518,8 +1570,8 @@ msgid "" " (x - 5) (x + 4) (x - 3) expands to: x³ -4x² -17x + 60\n" " \"\"\"\n" " # polynomial_from_roots([5, -4, 3]) → [1, -4, -17, 60]\n" -" factors = zip(repeat(1), map(operator.neg, roots))\n" -" return list(functools.reduce(convolve, factors, [1]))\n" +" factors = zip(repeat(1), map(neg, roots))\n" +" return list(reduce(convolve, factors, [1]))\n" "\n" "def polynomial_eval(coefficients, x):\n" " \"\"\"Evaluate a polynomial at a specific value.\n" @@ -1532,7 +1584,7 @@ msgid "" " if not n:\n" " return type(x)(0)\n" " powers = map(pow, repeat(x), reversed(range(n)))\n" -" return math.sumprod(coefficients, powers)\n" +" return sumprod(coefficients, powers)\n" "\n" "def polynomial_derivative(coefficients):\n" " \"\"\"Compute the first derivative of a polynomial.\n" @@ -1543,7 +1595,7 @@ msgid "" " # polynomial_derivative([1, -4, -17, 60]) → [3, -8, -17]\n" " n = len(coefficients)\n" " powers = reversed(range(1, n))\n" -" return list(map(operator.mul, coefficients, powers))\n" +" return list(map(mul, coefficients, powers))\n" "\n" "def sieve(n):\n" " \"Primes less than n.\"\n" @@ -1551,21 +1603,16 @@ msgid "" " if n > 2:\n" " yield 2\n" " data = bytearray((0, 1)) * (n // 2)\n" -" for p in iter_index(data, 1, start=3, stop=math.isqrt(n) + 1):\n" +" for p in iter_index(data, 1, start=3, stop=isqrt(n) + 1):\n" " data[p*p : n : p+p] = bytes(len(range(p*p, n, p+p)))\n" " yield from iter_index(data, 1, start=3)\n" "\n" -"def is_prime(n):\n" -" \"Return True if n is prime.\"\n" -" # is_prime(1_000_000_000_000_403) → True\n" -" return n > 1 and all(n % p for p in sieve(math.isqrt(n) + 1))\n" -"\n" "def factor(n):\n" " \"Prime factors of n.\"\n" " # factor(99) → 3 3 11\n" " # factor(1_000_000_000_000_007) → 47 59 360620266859\n" " # factor(1_000_000_000_000_403) → 1000000000000403\n" -" for prime in sieve(math.isqrt(n) + 1):\n" +" for prime in sieve(isqrt(n) + 1):\n" " while not n % prime:\n" " yield prime\n" " n //= prime\n" @@ -1574,17 +1621,16 @@ msgid "" " if n > 1:\n" " yield n\n" "\n" +"def is_prime(n):\n" +" \"Return True if n is prime.\"\n" +" # is_prime(1_000_000_000_000_403) → True\n" +" return n > 1 and next(factor(n)) == n\n" +"\n" "def totient(n):\n" " \"Count of natural numbers up to n that are coprime to n.\"\n" " # https://mathworld.wolfram.com/TotientFunction.html\n" " # totient(12) → 4 because len([1, 5, 7, 11]) == 4\n" " for prime in set(factor(n)):\n" " n -= n // prime\n" -" return n\n" -"\n" -"def multinomial(*counts):\n" -" \"Number of distinct arrangements of a multiset.\"\n" -" # Counter('abracadabra').values() -> 5 2 1 1 2\n" -" # multinomial(5, 2, 1, 1, 2) → 83160\n" -" return math.prod(map(math.comb, accumulate(counts), counts))" +" return n" msgstr "" diff --git a/library/json.po b/library/json.po index 6ecf1c20..e1a14245 100644 --- a/library/json.po +++ b/library/json.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -90,7 +90,7 @@ msgstr "" #: library/json.rst:56 msgid "" ">>> import json\n" -">>> print(json.dumps({'4': 5, '6': 7}, sort_keys=True, indent=4))\n" +">>> print(json.dumps({'6': 7, '4': 5}, sort_keys=True, indent=4))\n" "{\n" " \"4\": 5,\n" " \"6\": 7\n" @@ -98,12 +98,29 @@ msgid "" msgstr "" #: library/json.rst:63 -msgid "Decoding JSON::" +msgid "Specializing JSON object encoding::" msgstr "" #: library/json.rst:65 msgid "" ">>> import json\n" +">>> def custom_json(obj):\n" +"... if isinstance(obj, complex):\n" +"... return {'__complex__': True, 'real': obj.real, 'imag': obj." +"imag}\n" +"... raise TypeError(f'Cannot serialize object of {type(obj)}')\n" +"...\n" +">>> json.dumps(1 + 2j, default=custom_json)\n" +"'{\"__complex__\": true, \"real\": 1.0, \"imag\": 2.0}'" +msgstr "" + +#: library/json.rst:74 +msgid "Decoding JSON::" +msgstr "" + +#: library/json.rst:76 +msgid "" +">>> import json\n" ">>> json.loads('[\"foo\", {\"bar\":[\"baz\", null, 1.0, 2]}]')\n" "['foo', {'bar': ['baz', None, 1.0, 2]}]\n" ">>> json.loads('\"\\\\\"foo\\\\bar\"')\n" @@ -114,11 +131,11 @@ msgid "" "['streaming API']" msgstr "" -#: library/json.rst:75 +#: library/json.rst:86 msgid "Specializing JSON object decoding::" msgstr "" -#: library/json.rst:77 +#: library/json.rst:88 msgid "" ">>> import json\n" ">>> def as_complex(dct):\n" @@ -134,11 +151,11 @@ msgid "" "Decimal('1.1')" msgstr "" -#: library/json.rst:90 +#: library/json.rst:101 msgid "Extending :class:`JSONEncoder`::" msgstr "" -#: library/json.rst:92 +#: library/json.rst:103 msgid "" ">>> import json\n" ">>> class ComplexEncoder(json.JSONEncoder):\n" @@ -156,11 +173,11 @@ msgid "" "['[2.0', ', 1.0', ']']" msgstr "" -#: library/json.rst:108 +#: library/json.rst:119 msgid "Using :mod:`json.tool` from the shell to validate and pretty-print:" msgstr "" -#: library/json.rst:110 +#: library/json.rst:121 msgid "" "$ echo '{\"json\":\"obj\"}' | python -m json.tool\n" "{\n" @@ -170,11 +187,11 @@ msgid "" "Expecting property name enclosed in double quotes: line 1 column 2 (char 1)" msgstr "" -#: library/json.rst:119 +#: library/json.rst:130 msgid "See :ref:`json-commandline` for detailed documentation." msgstr "" -#: library/json.rst:123 +#: library/json.rst:134 msgid "" "JSON is a subset of `YAML `_ 1.2. The JSON produced by " "this module's default settings (in particular, the default *separators* " @@ -182,24 +199,24 @@ msgid "" "used as a YAML serializer." msgstr "" -#: library/json.rst:130 +#: library/json.rst:141 msgid "" "This module's encoders and decoders preserve input and output order by " "default. Order is only lost if the underlying containers are unordered." msgstr "" -#: library/json.rst:135 +#: library/json.rst:146 msgid "Basic Usage" msgstr "" -#: library/json.rst:142 +#: library/json.rst:153 msgid "" "Serialize *obj* as a JSON formatted stream to *fp* (a ``.write()``-" "supporting :term:`file-like object`) using this :ref:`Python-to-JSON " "conversion table `." msgstr "" -#: library/json.rst:148 +#: library/json.rst:159 msgid "" "Unlike :mod:`pickle` and :mod:`marshal`, JSON is not a framed protocol, so " "trying to serialize multiple objects with repeated calls to :func:`dump` " @@ -210,39 +227,39 @@ msgstr "" msgid "Parameters" msgstr "" -#: library/json.rst:152 +#: library/json.rst:163 msgid "The Python object to be serialized." msgstr "" -#: library/json.rst:155 +#: library/json.rst:166 msgid "" "The file-like object *obj* will be serialized to. The :mod:`!json` module " "always produces :class:`str` objects, not :class:`bytes` objects, therefore " "``fp.write()`` must support :class:`str` input." msgstr "" -#: library/json.rst:162 +#: library/json.rst:173 msgid "" "If ``True``, keys that are not of a basic type (:class:`str`, :class:`int`, :" "class:`float`, :class:`bool`, ``None``) will be skipped instead of raising " "a :exc:`TypeError`. Default ``False``." msgstr "" -#: library/json.rst:168 +#: library/json.rst:179 msgid "" "If ``True`` (the default), the output is guaranteed to have all incoming non-" "ASCII characters escaped. If ``False``, these characters will be outputted " "as-is." msgstr "" -#: library/json.rst:173 +#: library/json.rst:184 msgid "" "If ``False``, the circular reference check for container types is skipped " "and a circular reference will result in a :exc:`RecursionError` (or worse). " "Default ``True``." msgstr "" -#: library/json.rst:178 +#: library/json.rst:189 msgid "" "If ``False``, serialization of out-of-range :class:`float` values (``nan``, " "``inf``, ``-inf``) will result in a :exc:`ValueError`, in strict compliance " @@ -250,14 +267,14 @@ msgid "" "equivalents (``NaN``, ``Infinity``, ``-Infinity``) are used." msgstr "" -#: library/json.rst:185 +#: library/json.rst:196 msgid "" "If set, a custom JSON encoder with the :meth:`~JSONEncoder.default` method " "overridden, for serializing into custom datatypes. If ``None`` (the " "default), :class:`!JSONEncoder` is used." msgstr "" -#: library/json.rst:192 +#: library/json.rst:203 msgid "" "If a positive integer or string, JSON array elements and object members will " "be pretty-printed with that indent level. A positive integer indents that " @@ -266,7 +283,7 @@ msgid "" "inserted. If ``None`` (the default), the most compact representation is used." msgstr "" -#: library/json.rst:202 +#: library/json.rst:213 msgid "" "A two-tuple: ``(item_separator, key_separator)``. If ``None`` (the default), " "*separators* defaults to ``(', ', ': ')`` if *indent* is ``None``, and " @@ -274,39 +291,39 @@ msgid "" "to eliminate whitespace." msgstr "" -#: library/json.rst:211 +#: library/json.rst:222 msgid "" "A function that is called for objects that can't otherwise be serialized. It " "should return a JSON encodable version of the object or raise a :exc:" "`TypeError`. If ``None`` (the default), :exc:`!TypeError` is raised." msgstr "" -#: library/json.rst:218 +#: library/json.rst:229 msgid "" "If ``True``, dictionaries will be outputted sorted by key. Default ``False``." msgstr "" -#: library/json.rst:507 +#: library/json.rst:518 msgid "Allow strings for *indent* in addition to integers." msgstr "" -#: library/json.rst:515 +#: library/json.rst:526 msgid "Use ``(',', ': ')`` as default if *indent* is not ``None``." msgstr "" -#: library/json.rst:327 +#: library/json.rst:338 msgid "" "All optional parameters are now :ref:`keyword-only `." msgstr "" -#: library/json.rst:237 +#: library/json.rst:248 msgid "" "Serialize *obj* to a JSON formatted :class:`str` using this :ref:`conversion " "table `. The arguments have the same meaning as in :func:" "`dump`." msgstr "" -#: library/json.rst:243 +#: library/json.rst:254 msgid "" "Keys in key/value pairs of JSON are always of the type :class:`str`. When a " "dictionary is converted into JSON, all the keys of the dictionary are " @@ -315,26 +332,26 @@ msgid "" "original one. That is, ``loads(dumps(x)) != x`` if x has non-string keys." msgstr "" -#: library/json.rst:254 +#: library/json.rst:265 msgid "" "Deserialize *fp* to a Python object using the :ref:`JSON-to-Python " "conversion table `." msgstr "" -#: library/json.rst:257 +#: library/json.rst:268 msgid "" "A ``.read()``-supporting :term:`text file` or :term:`binary file` containing " "the JSON document to be deserialized." msgstr "" -#: library/json.rst:262 +#: library/json.rst:273 msgid "" "If set, a custom JSON decoder. Additional keyword arguments to :func:`!load` " "will be passed to the constructor of *cls*. If ``None`` (the default), :" "class:`!JSONDecoder` is used." msgstr "" -#: library/json.rst:269 +#: library/json.rst:280 msgid "" "If set, a function that is called with the result of any object literal " "decoded (a :class:`dict`). The return value of this function will be used " @@ -343,7 +360,7 @@ msgid "" "Default ``None``." msgstr "" -#: library/json.rst:279 +#: library/json.rst:290 msgid "" "If set, a function that is called with the result of any object literal " "decoded with an ordered list of pairs. The return value of this function " @@ -352,7 +369,7 @@ msgid "" "takes priority. Default ``None``." msgstr "" -#: library/json.rst:289 +#: library/json.rst:300 msgid "" "If set, a function that is called with the string of every JSON float to be " "decoded. If ``None`` (the default), it is equivalent to ``float(num_str)``. " @@ -360,7 +377,7 @@ msgid "" "class:`decimal.Decimal`." msgstr "" -#: library/json.rst:297 +#: library/json.rst:308 msgid "" "If set, a function that is called with the string of every JSON int to be " "decoded. If ``None`` (the default), it is equivalent to ``int(num_str)``. " @@ -368,7 +385,7 @@ msgid "" "class:`float`." msgstr "" -#: library/json.rst:305 +#: library/json.rst:316 msgid "" "If set, a function that is called with one of the following strings: ``'-" "Infinity'``, ``'Infinity'``, or ``'NaN'``. This can be used to raise an " @@ -379,38 +396,38 @@ msgstr "" msgid "Raises" msgstr "" -#: library/json.rst:313 +#: library/json.rst:324 msgid "When the data being deserialized is not a valid JSON document." msgstr "" -#: library/json.rst:316 +#: library/json.rst:327 msgid "" "When the data being deserialized does not contain UTF-8, UTF-16 or UTF-32 " "encoded data." msgstr "" -#: library/json.rst:322 +#: library/json.rst:333 msgid "Added the optional *object_pairs_hook* parameter." msgstr "" -#: library/json.rst:323 +#: library/json.rst:334 msgid "*parse_constant* doesn't get called on 'null', 'true', 'false' anymore." msgstr "" -#: library/json.rst:328 +#: library/json.rst:339 msgid "" "*fp* can now be a :term:`binary file`. The input encoding should be UTF-8, " "UTF-16 or UTF-32." msgstr "" -#: library/json.rst:331 +#: library/json.rst:342 msgid "" "The default *parse_int* of :func:`int` now limits the maximum length of the " "integer string via the interpreter's :ref:`integer string conversion length " "limitation ` to help avoid denial of service attacks." msgstr "" -#: library/json.rst:339 +#: library/json.rst:350 msgid "" "Identical to :func:`load`, but instead of a file-like object, deserialize " "*s* (a :class:`str`, :class:`bytes` or :class:`bytearray` instance " @@ -418,107 +435,107 @@ msgid "" "table `." msgstr "" -#: library/json.rst:344 +#: library/json.rst:355 msgid "" "*s* can now be of type :class:`bytes` or :class:`bytearray`. The input " "encoding should be UTF-8, UTF-16 or UTF-32." msgstr "" -#: library/json.rst:348 +#: library/json.rst:359 msgid "The keyword argument *encoding* has been removed." msgstr "" -#: library/json.rst:353 +#: library/json.rst:364 msgid "Encoders and Decoders" msgstr "" -#: library/json.rst:357 +#: library/json.rst:368 msgid "Simple JSON decoder." msgstr "" -#: library/json.rst:359 +#: library/json.rst:370 msgid "Performs the following translations in decoding by default:" msgstr "" -#: library/json.rst:452 +#: library/json.rst:463 msgid "JSON" msgstr "" -#: library/json.rst:452 +#: library/json.rst:463 msgid "Python" msgstr "" -#: library/json.rst:454 +#: library/json.rst:465 msgid "object" msgstr "" -#: library/json.rst:454 +#: library/json.rst:465 msgid "dict" msgstr "" -#: library/json.rst:456 +#: library/json.rst:467 msgid "array" msgstr "" -#: library/json.rst:368 +#: library/json.rst:379 msgid "list" msgstr "" -#: library/json.rst:458 +#: library/json.rst:469 msgid "string" msgstr "" -#: library/json.rst:458 +#: library/json.rst:469 msgid "str" msgstr "" -#: library/json.rst:372 +#: library/json.rst:383 msgid "number (int)" msgstr "" -#: library/json.rst:372 +#: library/json.rst:383 msgid "int" msgstr "" -#: library/json.rst:374 +#: library/json.rst:385 msgid "number (real)" msgstr "" -#: library/json.rst:374 +#: library/json.rst:385 msgid "float" msgstr "" -#: library/json.rst:462 +#: library/json.rst:473 msgid "true" msgstr "" -#: library/json.rst:462 +#: library/json.rst:473 msgid "True" msgstr "" -#: library/json.rst:464 +#: library/json.rst:475 msgid "false" msgstr "" -#: library/json.rst:464 +#: library/json.rst:475 msgid "False" msgstr "" -#: library/json.rst:466 +#: library/json.rst:477 msgid "null" msgstr "" -#: library/json.rst:466 +#: library/json.rst:477 msgid "None" msgstr "" -#: library/json.rst:383 +#: library/json.rst:394 msgid "" "It also understands ``NaN``, ``Infinity``, and ``-Infinity`` as their " "corresponding ``float`` values, which is outside the JSON spec." msgstr "" -#: library/json.rst:386 +#: library/json.rst:397 msgid "" "*object_hook* is an optional function that will be called with the result of " "every JSON object decoded and its return value will be used in place of the " @@ -526,7 +543,7 @@ msgid "" "g. to support `JSON-RPC `_ class hinting)." msgstr "" -#: library/json.rst:391 +#: library/json.rst:402 msgid "" "*object_pairs_hook* is an optional function that will be called with the " "result of every JSON object decoded with an ordered list of pairs. The " @@ -535,11 +552,11 @@ msgid "" "*object_hook* is also defined, the *object_pairs_hook* takes priority." msgstr "" -#: library/json.rst:397 +#: library/json.rst:408 msgid "Added support for *object_pairs_hook*." msgstr "" -#: library/json.rst:400 +#: library/json.rst:411 msgid "" "*parse_float* is an optional function that will be called with the string of " "every JSON float to be decoded. By default, this is equivalent to " @@ -547,7 +564,7 @@ msgid "" "JSON floats (e.g. :class:`decimal.Decimal`)." msgstr "" -#: library/json.rst:405 +#: library/json.rst:416 msgid "" "*parse_int* is an optional function that will be called with the string of " "every JSON int to be decoded. By default, this is equivalent to " @@ -555,14 +572,14 @@ msgid "" "JSON integers (e.g. :class:`float`)." msgstr "" -#: library/json.rst:410 +#: library/json.rst:421 msgid "" "*parse_constant* is an optional function that will be called with one of the " "following strings: ``'-Infinity'``, ``'Infinity'``, ``'NaN'``. This can be " "used to raise an exception if invalid JSON numbers are encountered." msgstr "" -#: library/json.rst:414 +#: library/json.rst:425 msgid "" "If *strict* is false (``True`` is the default), then control characters will " "be allowed inside strings. Control characters in this context are those " @@ -570,66 +587,66 @@ msgid "" "``'\\n'``, ``'\\r'`` and ``'\\0'``." msgstr "" -#: library/json.rst:419 +#: library/json.rst:430 msgid "" "If the data being deserialized is not a valid JSON document, a :exc:" "`JSONDecodeError` will be raised." msgstr "" -#: library/json.rst:523 +#: library/json.rst:534 msgid "All parameters are now :ref:`keyword-only `." msgstr "" -#: library/json.rst:427 +#: library/json.rst:438 msgid "" "Return the Python representation of *s* (a :class:`str` instance containing " "a JSON document)." msgstr "" -#: library/json.rst:430 +#: library/json.rst:441 msgid "" ":exc:`JSONDecodeError` will be raised if the given JSON document is not " "valid." msgstr "" -#: library/json.rst:435 +#: library/json.rst:446 msgid "" "Decode a JSON document from *s* (a :class:`str` beginning with a JSON " "document) and return a 2-tuple of the Python representation and the index in " "*s* where the document ended." msgstr "" -#: library/json.rst:439 +#: library/json.rst:450 msgid "" "This can be used to decode a JSON document from a string that may have " "extraneous data at the end." msgstr "" -#: library/json.rst:445 +#: library/json.rst:456 msgid "Extensible JSON encoder for Python data structures." msgstr "" -#: library/json.rst:447 +#: library/json.rst:458 msgid "Supports the following objects and types by default:" msgstr "" -#: library/json.rst:456 +#: library/json.rst:467 msgid "list, tuple" msgstr "" -#: library/json.rst:460 +#: library/json.rst:471 msgid "int, float, int- & float-derived Enums" msgstr "" -#: library/json.rst:460 +#: library/json.rst:471 msgid "number" msgstr "" -#: library/json.rst:469 +#: library/json.rst:480 msgid "Added support for int- and float-derived Enum classes." msgstr "" -#: library/json.rst:472 +#: library/json.rst:483 msgid "" "To extend this to recognize other objects, subclass and implement a :meth:" "`~JSONEncoder.default` method with another method that returns a " @@ -637,7 +654,7 @@ msgid "" "superclass implementation (to raise :exc:`TypeError`)." msgstr "" -#: library/json.rst:477 +#: library/json.rst:488 msgid "" "If *skipkeys* is false (the default), a :exc:`TypeError` will be raised when " "trying to encode keys that are not :class:`str`, :class:`int`, :class:" @@ -645,14 +662,14 @@ msgid "" "simply skipped." msgstr "" -#: library/json.rst:481 +#: library/json.rst:492 msgid "" "If *ensure_ascii* is true (the default), the output is guaranteed to have " "all incoming non-ASCII characters escaped. If *ensure_ascii* is false, " "these characters will be output as-is." msgstr "" -#: library/json.rst:485 +#: library/json.rst:496 msgid "" "If *check_circular* is true (the default), then lists, dicts, and custom " "encoded objects will be checked for circular references during encoding to " @@ -660,7 +677,7 @@ msgid "" "Otherwise, no such check takes place." msgstr "" -#: library/json.rst:490 +#: library/json.rst:501 msgid "" "If *allow_nan* is true (the default), then ``NaN``, ``Infinity``, and ``-" "Infinity`` will be encoded as such. This behavior is not JSON specification " @@ -668,14 +685,14 @@ msgid "" "decoders. Otherwise, it will be a :exc:`ValueError` to encode such floats." msgstr "" -#: library/json.rst:496 +#: library/json.rst:507 msgid "" "If *sort_keys* is true (default: ``False``), then the output of dictionaries " "will be sorted by key; this is useful for regression tests to ensure that " "JSON serializations can be compared on a day-to-day basis." msgstr "" -#: library/json.rst:500 +#: library/json.rst:511 msgid "" "If *indent* is a non-negative integer or string, then JSON array elements " "and object members will be pretty-printed with that indent level. An indent " @@ -685,7 +702,7 @@ msgid "" "``\"\\t\"``), that string is used to indent each level." msgstr "" -#: library/json.rst:510 +#: library/json.rst:521 msgid "" "If specified, *separators* should be an ``(item_separator, key_separator)`` " "tuple. The default is ``(', ', ': ')`` if *indent* is ``None`` and ``(',', " @@ -693,7 +710,7 @@ msgid "" "specify ``(',', ':')`` to eliminate whitespace." msgstr "" -#: library/json.rst:518 +#: library/json.rst:529 msgid "" "If specified, *default* should be a function that gets called for objects " "that can't otherwise be serialized. It should return a JSON encodable " @@ -701,20 +718,20 @@ msgid "" "`TypeError` is raised." msgstr "" -#: library/json.rst:529 +#: library/json.rst:540 msgid "" "Implement this method in a subclass such that it returns a serializable " "object for *o*, or calls the base implementation (to raise a :exc:" "`TypeError`)." msgstr "" -#: library/json.rst:533 +#: library/json.rst:544 msgid "" "For example, to support arbitrary iterators, you could implement :meth:" "`~JSONEncoder.default` like this::" msgstr "" -#: library/json.rst:536 +#: library/json.rst:547 msgid "" "def default(self, o):\n" " try:\n" @@ -727,63 +744,63 @@ msgid "" " return super().default(o)" msgstr "" -#: library/json.rst:549 +#: library/json.rst:560 msgid "" "Return a JSON string representation of a Python data structure, *o*. For " "example::" msgstr "" -#: library/json.rst:552 +#: library/json.rst:563 msgid "" ">>> json.JSONEncoder().encode({\"foo\": [\"bar\", \"baz\"]})\n" "'{\"foo\": [\"bar\", \"baz\"]}'" msgstr "" -#: library/json.rst:558 +#: library/json.rst:569 msgid "" "Encode the given object, *o*, and yield each string representation as " "available. For example::" msgstr "" -#: library/json.rst:561 +#: library/json.rst:572 msgid "" "for chunk in json.JSONEncoder().iterencode(bigobject):\n" " mysocket.write(chunk)" msgstr "" -#: library/json.rst:566 +#: library/json.rst:577 msgid "Exceptions" msgstr "" -#: library/json.rst:570 +#: library/json.rst:581 msgid "Subclass of :exc:`ValueError` with the following additional attributes:" msgstr "" -#: library/json.rst:574 +#: library/json.rst:585 msgid "The unformatted error message." msgstr "" -#: library/json.rst:578 +#: library/json.rst:589 msgid "The JSON document being parsed." msgstr "" -#: library/json.rst:582 +#: library/json.rst:593 msgid "The start index of *doc* where parsing failed." msgstr "" -#: library/json.rst:586 +#: library/json.rst:597 msgid "The line corresponding to *pos*." msgstr "" -#: library/json.rst:590 +#: library/json.rst:601 msgid "The column corresponding to *pos*." msgstr "" -#: library/json.rst:596 +#: library/json.rst:607 msgid "Standard Compliance and Interoperability" msgstr "" -#: library/json.rst:598 +#: library/json.rst:609 msgid "" "The JSON format is specified by :rfc:`7159` and by `ECMA-404 `_. This " @@ -792,48 +809,48 @@ msgid "" "parameters other than those explicitly mentioned, are not considered." msgstr "" -#: library/json.rst:604 +#: library/json.rst:615 msgid "" "This module does not comply with the RFC in a strict fashion, implementing " "some extensions that are valid JavaScript but not valid JSON. In particular:" msgstr "" -#: library/json.rst:607 +#: library/json.rst:618 msgid "Infinite and NaN number values are accepted and output;" msgstr "" -#: library/json.rst:608 +#: library/json.rst:619 msgid "" "Repeated names within an object are accepted, and only the value of the last " "name-value pair is used." msgstr "" -#: library/json.rst:611 +#: library/json.rst:622 msgid "" "Since the RFC permits RFC-compliant parsers to accept input texts that are " "not RFC-compliant, this module's deserializer is technically RFC-compliant " "under default settings." msgstr "" -#: library/json.rst:616 +#: library/json.rst:627 msgid "Character Encodings" msgstr "" -#: library/json.rst:618 +#: library/json.rst:629 msgid "" "The RFC requires that JSON be represented using either UTF-8, UTF-16, or " "UTF-32, with UTF-8 being the recommended default for maximum " "interoperability." msgstr "" -#: library/json.rst:621 +#: library/json.rst:632 msgid "" "As permitted, though not required, by the RFC, this module's serializer sets " "*ensure_ascii=True* by default, thus escaping the output so that the " "resulting strings only contain ASCII characters." msgstr "" -#: library/json.rst:625 +#: library/json.rst:636 msgid "" "Other than the *ensure_ascii* parameter, this module is defined strictly in " "terms of conversion between Python objects and :class:`Unicode strings " @@ -841,7 +858,7 @@ msgid "" "encodings." msgstr "" -#: library/json.rst:630 +#: library/json.rst:641 msgid "" "The RFC prohibits adding a byte order mark (BOM) to the start of a JSON " "text, and this module's serializer does not add a BOM to its output. The RFC " @@ -850,7 +867,7 @@ msgid "" "an initial BOM is present." msgstr "" -#: library/json.rst:636 +#: library/json.rst:647 msgid "" "The RFC does not explicitly forbid JSON strings which contain byte sequences " "that don't correspond to valid Unicode characters (e.g. unpaired UTF-16 " @@ -859,18 +876,18 @@ msgid "" "class:`str`) code points for such sequences." msgstr "" -#: library/json.rst:644 +#: library/json.rst:655 msgid "Infinite and NaN Number Values" msgstr "" -#: library/json.rst:646 +#: library/json.rst:657 msgid "" "The RFC does not permit the representation of infinite or NaN number values. " "Despite that, by default, this module accepts and outputs ``Infinity``, ``-" "Infinity``, and ``NaN`` as if they were valid JSON number literal values::" msgstr "" -#: library/json.rst:650 +#: library/json.rst:661 msgid "" ">>> # Neither of these calls raises an exception, but the results are not " "valid JSON\n" @@ -885,18 +902,18 @@ msgid "" "nan" msgstr "" -#: library/json.rst:661 +#: library/json.rst:672 msgid "" "In the serializer, the *allow_nan* parameter can be used to alter this " "behavior. In the deserializer, the *parse_constant* parameter can be used " "to alter this behavior." msgstr "" -#: library/json.rst:667 +#: library/json.rst:678 msgid "Repeated Names Within an Object" msgstr "" -#: library/json.rst:669 +#: library/json.rst:680 msgid "" "The RFC specifies that the names within a JSON object should be unique, but " "does not mandate how repeated names in JSON objects should be handled. By " @@ -904,22 +921,22 @@ msgid "" "but the last name-value pair for a given name::" msgstr "" -#: library/json.rst:674 +#: library/json.rst:685 msgid "" ">>> weird_json = '{\"x\": 1, \"x\": 2, \"x\": 3}'\n" ">>> json.loads(weird_json)\n" "{'x': 3}" msgstr "" -#: library/json.rst:678 +#: library/json.rst:689 msgid "The *object_pairs_hook* parameter can be used to alter this behavior." msgstr "" -#: library/json.rst:682 +#: library/json.rst:693 msgid "Top-level Non-Object, Non-Array Values" msgstr "" -#: library/json.rst:684 +#: library/json.rst:695 msgid "" "The old version of JSON specified by the obsolete :rfc:`4627` required that " "the top-level value of a JSON text must be either a JSON object or array " @@ -929,43 +946,43 @@ msgid "" "its serializer or its deserializer." msgstr "" -#: library/json.rst:691 +#: library/json.rst:702 msgid "" "Regardless, for maximum interoperability, you may wish to voluntarily adhere " "to the restriction yourself." msgstr "" -#: library/json.rst:696 +#: library/json.rst:707 msgid "Implementation Limitations" msgstr "" -#: library/json.rst:698 +#: library/json.rst:709 msgid "Some JSON deserializer implementations may set limits on:" msgstr "" -#: library/json.rst:700 +#: library/json.rst:711 msgid "the size of accepted JSON texts" msgstr "" -#: library/json.rst:701 +#: library/json.rst:712 msgid "the maximum level of nesting of JSON objects and arrays" msgstr "" -#: library/json.rst:702 +#: library/json.rst:713 msgid "the range and precision of JSON numbers" msgstr "" -#: library/json.rst:703 +#: library/json.rst:714 msgid "the content and maximum length of JSON strings" msgstr "" -#: library/json.rst:705 +#: library/json.rst:716 msgid "" "This module does not impose any such limits beyond those of the relevant " "Python datatypes themselves or the Python interpreter itself." msgstr "" -#: library/json.rst:708 +#: library/json.rst:719 msgid "" "When serializing to JSON, beware any such limitations in applications that " "may consume your JSON. In particular, it is common for JSON numbers to be " @@ -976,27 +993,27 @@ msgid "" "as :class:`decimal.Decimal`." msgstr "" -#: library/json.rst:721 +#: library/json.rst:732 msgid "Command Line Interface" msgstr "" -#: library/json.rst:726 +#: library/json.rst:737 msgid "**Source code:** :source:`Lib/json/tool.py`" msgstr "" -#: library/json.rst:730 +#: library/json.rst:741 msgid "" "The :mod:`json.tool` module provides a simple command line interface to " "validate and pretty-print JSON objects." msgstr "" -#: library/json.rst:733 +#: library/json.rst:744 msgid "" "If the optional ``infile`` and ``outfile`` arguments are not specified, :" "data:`sys.stdin` and :data:`sys.stdout` will be used respectively:" msgstr "" -#: library/json.rst:736 +#: library/json.rst:747 msgid "" "$ echo '{\"json\": \"obj\"}' | python -m json.tool\n" "{\n" @@ -1006,21 +1023,21 @@ msgid "" "Expecting property name enclosed in double quotes: line 1 column 2 (char 1)" msgstr "" -#: library/json.rst:745 +#: library/json.rst:756 msgid "" "The output is now in the same order as the input. Use the :option:`--sort-" "keys` option to sort the output of dictionaries alphabetically by key." msgstr "" -#: library/json.rst:752 +#: library/json.rst:763 msgid "Command line options" msgstr "" -#: library/json.rst:756 +#: library/json.rst:767 msgid "The JSON file to be validated or pretty-printed:" msgstr "" -#: library/json.rst:758 +#: library/json.rst:769 msgid "" "$ python -m json.tool mp_films.json\n" "[\n" @@ -1035,43 +1052,43 @@ msgid "" "]" msgstr "" -#: library/json.rst:772 +#: library/json.rst:783 msgid "If *infile* is not specified, read from :data:`sys.stdin`." msgstr "" -#: library/json.rst:776 +#: library/json.rst:787 msgid "" "Write the output of the *infile* to the given *outfile*. Otherwise, write it " "to :data:`sys.stdout`." msgstr "" -#: library/json.rst:781 +#: library/json.rst:792 msgid "Sort the output of dictionaries alphabetically by key." msgstr "" -#: library/json.rst:787 +#: library/json.rst:798 msgid "" "Disable escaping of non-ascii characters, see :func:`json.dumps` for more " "information." msgstr "" -#: library/json.rst:793 +#: library/json.rst:804 msgid "Parse every input line as separate JSON object." msgstr "" -#: library/json.rst:799 +#: library/json.rst:810 msgid "Mutually exclusive options for whitespace control." msgstr "" -#: library/json.rst:805 +#: library/json.rst:816 msgid "Show the help message." msgstr "" -#: library/json.rst:809 +#: library/json.rst:820 msgid "Footnotes" msgstr "" -#: library/json.rst:810 +#: library/json.rst:821 msgid "" "As noted in `the errata for RFC 7159 `_, JSON permits literal U+2028 (LINE SEPARATOR) " diff --git a/library/keyword.po b/library/keyword.po index 1f822c48..40da9e9a 100644 --- a/library/keyword.po +++ b/library/keyword.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" diff --git a/library/language.po b/library/language.po index 86f4319f..129e13e5 100644 --- a/library/language.po +++ b/library/language.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" diff --git a/library/linecache.po b/library/linecache.po index 4939e233..fa65a0ae 100644 --- a/library/linecache.po +++ b/library/linecache.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" diff --git a/library/locale.po b/library/locale.po index 12d48ced..22530048 100644 --- a/library/locale.po +++ b/library/locale.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -589,16 +589,6 @@ msgid "" msgstr "" #: library/locale.rst:412 -msgid "Sets the locale for *category* to the default setting." -msgstr "" - -#: library/locale.rst:414 -msgid "" -"The default setting is determined by calling :func:`getdefaultlocale`. " -"*category* defaults to :const:`LC_ALL`." -msgstr "" - -#: library/locale.rst:422 msgid "" "Compares two strings according to the current :const:`LC_COLLATE` setting. " "As any other compare function, returns a negative, or a positive value, or " @@ -606,7 +596,7 @@ msgid "" "is equal to it." msgstr "" -#: library/locale.rst:430 +#: library/locale.rst:420 msgid "" "Transforms a string to one that can be used in locale-aware comparisons. " "For example, ``strxfrm(s1) < strxfrm(s2)`` is equivalent to ``strcoll(s1, " @@ -614,7 +604,7 @@ msgid "" "repeatedly, e.g. when collating a sequence of strings." msgstr "" -#: library/locale.rst:439 +#: library/locale.rst:429 msgid "" "Formats a number *val* according to the current :const:`LC_NUMERIC` setting. " "The format follows the conventions of the ``%`` operator. For floating-" @@ -622,29 +612,29 @@ msgid "" "is ``True``, also takes the grouping into account." msgstr "" -#: library/locale.rst:444 +#: library/locale.rst:434 msgid "" "If *monetary* is true, the conversion uses monetary thousands separator and " "grouping strings." msgstr "" -#: library/locale.rst:447 +#: library/locale.rst:437 msgid "" "Processes formatting specifiers as in ``format % val``, but takes the " "current locale settings into account." msgstr "" -#: library/locale.rst:450 +#: library/locale.rst:440 msgid "The *monetary* keyword parameter was added." msgstr "" -#: library/locale.rst:456 +#: library/locale.rst:446 msgid "" "Formats a number *val* according to the current :const:`LC_MONETARY` " "settings." msgstr "" -#: library/locale.rst:458 +#: library/locale.rst:448 msgid "" "The returned string includes the currency symbol if *symbol* is true, which " "is the default. If *grouping* is ``True`` (which is not the default), " @@ -652,43 +642,43 @@ msgid "" "not the default), the international currency symbol is used." msgstr "" -#: library/locale.rst:465 +#: library/locale.rst:455 msgid "" "This function will not work with the 'C' locale, so you have to set a locale " "via :func:`setlocale` first." msgstr "" -#: library/locale.rst:471 +#: library/locale.rst:461 msgid "" "Formats a floating-point number using the same format as the built-in " "function ``str(float)``, but takes the decimal point into account." msgstr "" -#: library/locale.rst:477 +#: library/locale.rst:467 msgid "" "Converts a string into a normalized number string, following the :const:" "`LC_NUMERIC` settings." msgstr "" -#: library/locale.rst:485 +#: library/locale.rst:475 msgid "" "Converts a normalized number string into a formatted string following the :" "const:`LC_NUMERIC` settings." msgstr "" -#: library/locale.rst:493 +#: library/locale.rst:483 msgid "" "Converts a string to a number, following the :const:`LC_NUMERIC` settings, " "by calling *func* on the result of calling :func:`delocalize` on *string*." msgstr "" -#: library/locale.rst:499 +#: library/locale.rst:489 msgid "" "Converts a string to an integer, following the :const:`LC_NUMERIC` " "conventions." msgstr "" -#: library/locale.rst:504 +#: library/locale.rst:494 msgid "" "Locale category for the character type functions. Most importantly, this " "category defines the text encoding, i.e. how bytes are interpreted as " @@ -698,32 +688,32 @@ msgid "" "SSH connections." msgstr "" -#: library/locale.rst:511 +#: library/locale.rst:501 msgid "" "Python doesn't internally use locale-dependent character transformation " "functions from ``ctype.h``. Instead, an internal ``pyctype.h`` provides " "locale-independent equivalents like :c:macro:`!Py_TOLOWER`." msgstr "" -#: library/locale.rst:518 +#: library/locale.rst:508 msgid "" "Locale category for sorting strings. The functions :func:`strcoll` and :" "func:`strxfrm` of the :mod:`locale` module are affected." msgstr "" -#: library/locale.rst:524 +#: library/locale.rst:514 msgid "" "Locale category for the formatting of time. The function :func:`time." "strftime` follows these conventions." msgstr "" -#: library/locale.rst:530 +#: library/locale.rst:520 msgid "" "Locale category for formatting of monetary values. The available options " "are available from the :func:`localeconv` function." msgstr "" -#: library/locale.rst:536 +#: library/locale.rst:526 msgid "" "Locale category for message display. Python currently does not support " "application specific locale-aware messages. Messages displayed by the " @@ -731,13 +721,13 @@ msgid "" "affected by this category." msgstr "" -#: library/locale.rst:541 +#: library/locale.rst:531 msgid "" "This value may not be available on operating systems not conforming to the " "POSIX standard, most notably Windows." msgstr "" -#: library/locale.rst:547 +#: library/locale.rst:537 msgid "" "Locale category for formatting numbers. The functions :func:" "`format_string`, :func:`atoi`, :func:`atof` and :func:`.str` of the :mod:" @@ -745,7 +735,7 @@ msgid "" "operations are not affected." msgstr "" -#: library/locale.rst:555 +#: library/locale.rst:545 msgid "" "Combination of all locale settings. If this flag is used when the locale is " "changed, setting the locale for all categories is attempted. If that fails " @@ -755,17 +745,17 @@ msgid "" "settings." msgstr "" -#: library/locale.rst:564 +#: library/locale.rst:554 msgid "" "This is a symbolic constant used for different values returned by :func:" "`localeconv`." msgstr "" -#: library/locale.rst:568 +#: library/locale.rst:558 msgid "Example::" msgstr "" -#: library/locale.rst:570 +#: library/locale.rst:560 msgid "" ">>> import locale\n" ">>> loc = locale.getlocale() # get current locale\n" @@ -778,11 +768,11 @@ msgid "" ">>> locale.setlocale(locale.LC_ALL, loc) # restore saved locale" msgstr "" -#: library/locale.rst:581 +#: library/locale.rst:571 msgid "Background, details, hints, tips and caveats" msgstr "" -#: library/locale.rst:583 +#: library/locale.rst:573 msgid "" "The C standard defines the locale as a program-wide property that may be " "relatively expensive to change. On top of that, some implementations are " @@ -790,7 +780,7 @@ msgid "" "This makes the locale somewhat painful to use correctly." msgstr "" -#: library/locale.rst:588 +#: library/locale.rst:578 msgid "" "Initially, when a program is started, the locale is the ``C`` locale, no " "matter what the user's preferred locale is. There is one exception: the :" @@ -800,7 +790,7 @@ msgid "" "categories by calling ``setlocale(LC_ALL, '')``." msgstr "" -#: library/locale.rst:595 +#: library/locale.rst:585 msgid "" "It is generally a bad idea to call :func:`setlocale` in some library " "routine, since as a side effect it affects the entire program. Saving and " @@ -808,7 +798,7 @@ msgid "" "that happen to run before the settings have been restored." msgstr "" -#: library/locale.rst:600 +#: library/locale.rst:590 msgid "" "If, when coding a module for general use, you need a locale independent " "version of an operation that is affected by the locale (such as certain " @@ -819,14 +809,14 @@ msgid "" "settings." msgstr "" -#: library/locale.rst:607 +#: library/locale.rst:597 msgid "" "The only way to perform numeric operations according to the locale is to use " "the special functions defined by this module: :func:`atof`, :func:`atoi`, :" "func:`format_string`, :func:`.str`." msgstr "" -#: library/locale.rst:611 +#: library/locale.rst:601 msgid "" "There is no way to perform case conversions and character classifications " "according to the locale. For (Unicode) text strings these are done " @@ -837,11 +827,11 @@ msgid "" "whitespace." msgstr "" -#: library/locale.rst:622 +#: library/locale.rst:612 msgid "For extension writers and programs that embed Python" msgstr "" -#: library/locale.rst:624 +#: library/locale.rst:614 msgid "" "Extension modules should never call :func:`setlocale`, except to find out " "what the current locale is. But since the return value can only be used " @@ -849,7 +839,7 @@ msgid "" "whether or not the locale is ``C``)." msgstr "" -#: library/locale.rst:629 +#: library/locale.rst:619 msgid "" "When Python code uses the :mod:`locale` module to change the locale, this " "also affects the embedding application. If the embedding application " @@ -859,11 +849,11 @@ msgid "" "accessible as a shared library." msgstr "" -#: library/locale.rst:640 +#: library/locale.rst:630 msgid "Access to message catalogs" msgstr "" -#: library/locale.rst:649 +#: library/locale.rst:639 msgid "" "The locale module exposes the C library's gettext interface on systems that " "provide this interface. It consists of the functions :func:`gettext`, :func:" @@ -874,7 +864,7 @@ msgid "" "locating message catalogs." msgstr "" -#: library/locale.rst:656 +#: library/locale.rst:646 msgid "" "Python applications should normally find no need to invoke these functions, " "and should use :mod:`gettext` instead. A known exception to this rule are " diff --git a/library/logging.config.po b/library/logging.config.po index 12c050fd..513ef0f5 100644 --- a/library/logging.config.po +++ b/library/logging.config.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -926,12 +926,13 @@ msgid "" "``subject`` value could be accessed using either ``'cfg://handlers.email." "subject'`` or, equivalently, ``'cfg://handlers.email[subject]'``. The " "latter form only needs to be used if the key contains spaces or non-" -"alphanumeric characters. If an index value consists only of decimal digits, " +"alphanumeric characters. Please note that the characters ``[`` and ``]`` are " +"not allowed in the keys. If an index value consists only of decimal digits, " "access will be attempted using the corresponding integer value, falling back " "to the string value if needed." msgstr "" -#: library/logging.config.rst:693 +#: library/logging.config.rst:694 msgid "" "Given a string ``cfg://handlers.myhandler.mykey.123``, this will resolve to " "``config_dict['handlers']['myhandler']['mykey']['123']``. If the string is " @@ -941,11 +942,11 @@ msgid "" "['mykey']['123']`` if that fails." msgstr "" -#: library/logging.config.rst:705 +#: library/logging.config.rst:706 msgid "Import resolution and custom importers" msgstr "" -#: library/logging.config.rst:707 +#: library/logging.config.rst:708 msgid "" "Import resolution, by default, uses the builtin :func:`__import__` function " "to do its importing. You may want to replace this with your own importing " @@ -957,7 +958,7 @@ msgid "" "instance level, you need to wrap it with :func:`staticmethod`. For example::" msgstr "" -#: library/logging.config.rst:717 +#: library/logging.config.rst:718 msgid "" "from importlib import import_module\n" "from logging.config import BaseConfigurator\n" @@ -965,17 +966,17 @@ msgid "" "BaseConfigurator.importer = staticmethod(import_module)" msgstr "" -#: library/logging.config.rst:722 +#: library/logging.config.rst:723 msgid "" "You don't need to wrap with :func:`staticmethod` if you're setting the " "import callable on a configurator *instance*." msgstr "" -#: library/logging.config.rst:728 +#: library/logging.config.rst:729 msgid "Configuring QueueHandler and QueueListener" msgstr "" -#: library/logging.config.rst:730 +#: library/logging.config.rst:731 msgid "" "If you want to configure a :class:`~logging.handlers.QueueHandler`, noting " "that this is normally used in conjunction with a :class:`~logging.handlers." @@ -988,7 +989,7 @@ msgid "" "the example YAML snippet below." msgstr "" -#: library/logging.config.rst:739 +#: library/logging.config.rst:740 msgid "" "handlers:\n" " qhand:\n" @@ -1001,17 +1002,17 @@ msgid "" " ..." msgstr "" -#: library/logging.config.rst:751 +#: library/logging.config.rst:752 msgid "The ``queue`` and ``listener`` keys are optional." msgstr "" -#: library/logging.config.rst:753 +#: library/logging.config.rst:754 msgid "" "If the ``queue`` key is present, the corresponding value can be one of the " "following:" msgstr "" -#: library/logging.config.rst:755 +#: library/logging.config.rst:756 msgid "" "An object implementing the :meth:`Queue.put_nowait ` " "and :meth:`Queue.get ` public API. For instance, this may " @@ -1019,13 +1020,13 @@ msgid "" "proxy obtained by :meth:`multiprocessing.managers.SyncManager.Queue`." msgstr "" -#: library/logging.config.rst:760 +#: library/logging.config.rst:761 msgid "" "This is of course only possible if you are constructing or modifying the " "configuration dictionary in code." msgstr "" -#: library/logging.config.rst:763 +#: library/logging.config.rst:764 msgid "" "A string that resolves to a callable which, when called with no arguments, " "returns the queue instance to use. That callable could be a :class:`queue." @@ -1033,39 +1034,39 @@ msgid "" "as ``my.module.queue_factory()``." msgstr "" -#: library/logging.config.rst:768 +#: library/logging.config.rst:769 msgid "" "A dict with a ``'()'`` key which is constructed in the usual way as " "discussed in :ref:`logging-config-dict-userdef`. The result of this " "construction should be a :class:`queue.Queue` instance." msgstr "" -#: library/logging.config.rst:772 +#: library/logging.config.rst:773 msgid "" "If the ``queue`` key is absent, a standard unbounded :class:`queue.Queue` " "instance is created and used." msgstr "" -#: library/logging.config.rst:775 +#: library/logging.config.rst:776 msgid "" "If the ``listener`` key is present, the corresponding value can be one of " "the following:" msgstr "" -#: library/logging.config.rst:777 +#: library/logging.config.rst:778 msgid "" "A subclass of :class:`logging.handlers.QueueListener`. This is of course " "only possible if you are constructing or modifying the configuration " "dictionary in code." msgstr "" -#: library/logging.config.rst:781 +#: library/logging.config.rst:782 msgid "" "A string which resolves to a class which is a subclass of ``QueueListener``, " "such as ``'my.package.CustomListener'``." msgstr "" -#: library/logging.config.rst:784 +#: library/logging.config.rst:785 msgid "" "A dict with a ``'()'`` key which is constructed in the usual way as " "discussed in :ref:`logging-config-dict-userdef`. The result of this " @@ -1073,31 +1074,31 @@ msgid "" "``QueueListener`` initializer." msgstr "" -#: library/logging.config.rst:788 +#: library/logging.config.rst:789 msgid "" "If the ``listener`` key is absent, :class:`logging.handlers.QueueListener` " "is used." msgstr "" -#: library/logging.config.rst:790 +#: library/logging.config.rst:791 msgid "" "The values under the ``handlers`` key are the names of other handlers in the " "configuration (not shown in the above snippet) which will be passed to the " "queue listener." msgstr "" -#: library/logging.config.rst:794 +#: library/logging.config.rst:795 msgid "" "Any custom queue handler and listener classes will need to be defined with " "the same initialization signatures as :class:`~logging.handlers." "QueueHandler` and :class:`~logging.handlers.QueueListener`." msgstr "" -#: library/logging.config.rst:803 +#: library/logging.config.rst:804 msgid "Configuration file format" msgstr "" -#: library/logging.config.rst:805 +#: library/logging.config.rst:806 msgid "" "The configuration file format understood by :func:`fileConfig` is based on :" "mod:`configparser` functionality. The file must contain sections called " @@ -1114,7 +1115,7 @@ msgid "" "specified in a section called ``[logger_root]``." msgstr "" -#: library/logging.config.rst:820 +#: library/logging.config.rst:821 msgid "" "The :func:`fileConfig` API is older than the :func:`dictConfig` API and does " "not provide functionality to cover certain aspects of logging. For example, " @@ -1127,11 +1128,11 @@ msgid "" "when it's convenient to do so." msgstr "" -#: library/logging.config.rst:830 +#: library/logging.config.rst:831 msgid "Examples of these sections in the file are given below." msgstr "" -#: library/logging.config.rst:832 +#: library/logging.config.rst:833 msgid "" "[loggers]\n" "keys=root,log02,log03,log04,log05,log06,log07\n" @@ -1143,20 +1144,20 @@ msgid "" "keys=form01,form02,form03,form04,form05,form06,form07,form08,form09" msgstr "" -#: library/logging.config.rst:843 +#: library/logging.config.rst:844 msgid "" "The root logger must specify a level and a list of handlers. An example of a " "root logger section is given below." msgstr "" -#: library/logging.config.rst:846 +#: library/logging.config.rst:847 msgid "" "[logger_root]\n" "level=NOTSET\n" "handlers=hand01" msgstr "" -#: library/logging.config.rst:852 +#: library/logging.config.rst:853 msgid "" "The ``level`` entry can be one of ``DEBUG, INFO, WARNING, ERROR, CRITICAL`` " "or ``NOTSET``. For the root logger only, ``NOTSET`` means that all messages " @@ -1164,7 +1165,7 @@ msgid "" "of the ``logging`` package's namespace." msgstr "" -#: library/logging.config.rst:857 +#: library/logging.config.rst:858 msgid "" "The ``handlers`` entry is a comma-separated list of handler names, which " "must appear in the ``[handlers]`` section. These names must appear in the " @@ -1172,13 +1173,13 @@ msgid "" "file." msgstr "" -#: library/logging.config.rst:862 +#: library/logging.config.rst:863 msgid "" "For loggers other than the root logger, some additional information is " "required. This is illustrated by the following example." msgstr "" -#: library/logging.config.rst:865 +#: library/logging.config.rst:866 msgid "" "[logger_parser]\n" "level=DEBUG\n" @@ -1187,7 +1188,7 @@ msgid "" "qualname=compiler.parser" msgstr "" -#: library/logging.config.rst:873 +#: library/logging.config.rst:874 msgid "" "The ``level`` and ``handlers`` entries are interpreted as for the root " "logger, except that if a non-root logger's level is specified as ``NOTSET``, " @@ -1200,13 +1201,13 @@ msgid "" "application to get the logger." msgstr "" -#: library/logging.config.rst:882 +#: library/logging.config.rst:883 msgid "" "Sections which specify handler configuration are exemplified by the " "following." msgstr "" -#: library/logging.config.rst:884 +#: library/logging.config.rst:885 msgid "" "[handler_hand01]\n" "class=StreamHandler\n" @@ -1215,14 +1216,14 @@ msgid "" "args=(sys.stdout,)" msgstr "" -#: library/logging.config.rst:892 +#: library/logging.config.rst:893 msgid "" "The ``class`` entry indicates the handler's class (as determined by :func:" "`eval` in the ``logging`` package's namespace). The ``level`` is interpreted " "as for loggers, and ``NOTSET`` is taken to mean 'log everything'." msgstr "" -#: library/logging.config.rst:896 +#: library/logging.config.rst:897 msgid "" "The ``formatter`` entry indicates the key name of the formatter for this " "handler. If blank, a default formatter (``logging._defaultFormatter``) is " @@ -1230,7 +1231,7 @@ msgid "" "and have a corresponding section in the configuration file." msgstr "" -#: library/logging.config.rst:901 +#: library/logging.config.rst:902 msgid "" "The ``args`` entry, when :ref:`evaluated ` in the context of the " "``logging`` package's namespace, is the list of arguments to the constructor " @@ -1239,7 +1240,7 @@ msgid "" "provided, it defaults to ``()``." msgstr "" -#: library/logging.config.rst:907 +#: library/logging.config.rst:908 msgid "" "The optional ``kwargs`` entry, when :ref:`evaluated ` in the " "context of the ``logging`` package's namespace, is the keyword argument dict " @@ -1247,7 +1248,7 @@ msgid "" "``{}``." msgstr "" -#: library/logging.config.rst:911 +#: library/logging.config.rst:912 msgid "" "[handler_hand02]\n" "class=FileHandler\n" @@ -1303,12 +1304,12 @@ msgid "" "kwargs={'secure': True}" msgstr "" -#: library/logging.config.rst:964 +#: library/logging.config.rst:965 msgid "" "Sections which specify formatter configuration are typified by the following." msgstr "" -#: library/logging.config.rst:966 +#: library/logging.config.rst:967 msgid "" "[formatter_form01]\n" "format=F1 %(asctime)s %(levelname)s %(message)s %(customfield)s\n" @@ -1319,21 +1320,21 @@ msgid "" "class=logging.Formatter" msgstr "" -#: library/logging.config.rst:976 +#: library/logging.config.rst:977 msgid "" "The arguments for the formatter configuration are the same as the keys in " "the dictionary schema :ref:`formatters section `." msgstr "" -#: library/logging.config.rst:980 +#: library/logging.config.rst:981 msgid "" "The ``defaults`` entry, when :ref:`evaluated ` in the context of " "the ``logging`` package's namespace, is a dictionary of default values for " "custom formatting fields. If not provided, it defaults to ``None``." msgstr "" -#: library/logging.config.rst:987 +#: library/logging.config.rst:988 msgid "" "Due to the use of :func:`eval` as described above, there are potential " "security risks which result from using the :func:`listen` to send and " @@ -1342,18 +1343,18 @@ msgid "" "`listen` documentation for more information." msgstr "" -#: library/logging.config.rst:995 +#: library/logging.config.rst:996 msgid "Module :mod:`logging`" msgstr "" -#: library/logging.config.rst:996 +#: library/logging.config.rst:997 msgid "API reference for the logging module." msgstr "" -#: library/logging.config.rst:998 +#: library/logging.config.rst:999 msgid "Module :mod:`logging.handlers`" msgstr "" -#: library/logging.config.rst:999 +#: library/logging.config.rst:1000 msgid "Useful handlers included with the logging module." msgstr "" diff --git a/library/logging.handlers.po b/library/logging.handlers.po index 699eae8f..251775ab 100644 --- a/library/logging.handlers.po +++ b/library/logging.handlers.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -1593,36 +1593,41 @@ msgid "" "process." msgstr "" -#: library/logging.handlers.rst:1177 +#: library/logging.handlers.rst:1175 +msgid "" +"Raises :exc:`RuntimeError` if called and the listener is already running." +msgstr "" + +#: library/logging.handlers.rst:1181 msgid "Stops the listener." msgstr "" -#: library/logging.handlers.rst:1179 +#: library/logging.handlers.rst:1183 msgid "" "This asks the thread to terminate, and then waits for it to do so. Note that " "if you don't call this before your application exits, there may be some " "records still left on the queue, which won't be processed." msgstr "" -#: library/logging.handlers.rst:1185 +#: library/logging.handlers.rst:1189 msgid "" "Writes a sentinel to the queue to tell the listener to quit. This " "implementation uses ``put_nowait()``. You may want to override this method " "if you want to use timeouts or work with custom queue implementations." msgstr "" -#: library/logging.handlers.rst:1195 +#: library/logging.handlers.rst:1199 msgid "Module :mod:`logging`" msgstr "" -#: library/logging.handlers.rst:1196 +#: library/logging.handlers.rst:1200 msgid "API reference for the logging module." msgstr "" -#: library/logging.handlers.rst:1198 +#: library/logging.handlers.rst:1202 msgid "Module :mod:`logging.config`" msgstr "" -#: library/logging.handlers.rst:1199 +#: library/logging.handlers.rst:1203 msgid "Configuration API for the logging module." msgstr "" diff --git a/library/logging.po b/library/logging.po index 7f6f125d..5cd86af7 100644 --- a/library/logging.po +++ b/library/logging.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -1263,11 +1263,11 @@ msgstr "" msgid "Attribute name" msgstr "" -#: library/logging.rst:1358 +#: library/logging.rst:1366 msgid "Format" msgstr "" -#: library/logging.rst:1358 +#: library/logging.rst:1366 msgid "Description" msgstr "" @@ -1312,7 +1312,7 @@ msgstr "" #: library/logging.rst:1009 msgid "" "Time when the :class:`LogRecord` was created (as returned by :func:`time." -"time`)." +"time_ns` / 1e9)." msgstr "" #: library/logging.rst:1012 @@ -1572,10 +1572,14 @@ msgstr "" #: library/logging.rst:1088 msgid "" "Returns an instance of :class:`LoggerAdapter` initialized with an " -"underlying :class:`Logger` instance and a dict-like object." +"underlying :class:`Logger` instance, a dict-like object (*extra*), and a " +"boolean (*merge_extra*) indicating whether or not the *extra* argument of " +"individual log calls should be merged with the :class:`LoggerAdapter` extra. " +"The default behavior is to ignore the *extra* argument of individual log " +"calls and only use the one of the :class:`LoggerAdapter` instance" msgstr "" -#: library/logging.rst:1093 +#: library/logging.rst:1097 msgid "" "Modifies the message and/or keyword arguments passed to a logging call in " "order to insert contextual information. This implementation takes the object " @@ -1584,15 +1588,15 @@ msgid "" "(possibly modified) versions of the arguments passed in." msgstr "" -#: library/logging.rst:1101 +#: library/logging.rst:1105 msgid "Delegates to the underlying :attr:`!manager` on *logger*." msgstr "" -#: library/logging.rst:1105 +#: library/logging.rst:1109 msgid "Delegates to the underlying :meth:`!_log` method on *logger*." msgstr "" -#: library/logging.rst:1107 +#: library/logging.rst:1111 msgid "" "In addition to the above, :class:`LoggerAdapter` supports the following " "methods of :class:`Logger`: :meth:`~Logger.debug`, :meth:`~Logger.info`, :" @@ -1604,24 +1608,28 @@ msgid "" "interchangeably." msgstr "" -#: library/logging.rst:1118 +#: library/logging.rst:1122 msgid "" "The :meth:`~Logger.isEnabledFor`, :meth:`~Logger.getEffectiveLevel`, :meth:" "`~Logger.setLevel` and :meth:`~Logger.hasHandlers` methods were added to :" "class:`LoggerAdapter`. These methods delegate to the underlying logger." msgstr "" -#: library/logging.rst:1124 +#: library/logging.rst:1128 msgid "" "Attribute :attr:`!manager` and method :meth:`!_log` were added, which " "delegate to the underlying logger and allow adapters to be nested." msgstr "" -#: library/logging.rst:1129 +#: library/logging.rst:1133 +msgid "The *merge_extra* argument was added." +msgstr "" + +#: library/logging.rst:1137 msgid "Thread Safety" msgstr "" -#: library/logging.rst:1131 +#: library/logging.rst:1139 msgid "" "The logging module is intended to be thread-safe without any special work " "needing to be done by its clients. It achieves this though using threading " @@ -1630,7 +1638,7 @@ msgid "" "O." msgstr "" -#: library/logging.rst:1136 +#: library/logging.rst:1144 msgid "" "If you are implementing asynchronous signal handlers using the :mod:`signal` " "module, you may not be able to use logging from within such handlers. This " @@ -1638,17 +1646,17 @@ msgid "" "always re-entrant, and so cannot be invoked from such signal handlers." msgstr "" -#: library/logging.rst:1143 +#: library/logging.rst:1151 msgid "Module-Level Functions" msgstr "" -#: library/logging.rst:1145 +#: library/logging.rst:1153 msgid "" "In addition to the classes described above, there are a number of module-" "level functions." msgstr "" -#: library/logging.rst:1151 +#: library/logging.rst:1159 msgid "" "Return a logger with the specified name or, if name is ``None``, return the " "root logger of the hierarchy. If specified, the name is typically a dot-" @@ -1658,14 +1666,14 @@ msgid "" "for not doing that, as mentioned in :ref:`logger`." msgstr "" -#: library/logging.rst:1158 +#: library/logging.rst:1166 msgid "" "All calls to this function with a given name return the same logger " "instance. This means that logger instances never need to be passed between " "different parts of an application." msgstr "" -#: library/logging.rst:1165 +#: library/logging.rst:1173 msgid "" "Return either the standard :class:`Logger` class, or the last class passed " "to :func:`setLoggerClass`. This function may be called from within a new " @@ -1674,43 +1682,43 @@ msgid "" "example::" msgstr "" -#: library/logging.rst:1170 +#: library/logging.rst:1178 msgid "" "class MyLogger(logging.getLoggerClass()):\n" " # ... override behaviour here" msgstr "" -#: library/logging.rst:1176 +#: library/logging.rst:1184 msgid "Return a callable which is used to create a :class:`LogRecord`." msgstr "" -#: library/logging.rst:1178 +#: library/logging.rst:1186 msgid "" "This function has been provided, along with :func:`setLogRecordFactory`, to " "allow developers more control over how the :class:`LogRecord` representing a " "logging event is constructed." msgstr "" -#: library/logging.rst:1183 +#: library/logging.rst:1191 msgid "" "See :func:`setLogRecordFactory` for more information about the how the " "factory is called." msgstr "" -#: library/logging.rst:1188 +#: library/logging.rst:1196 msgid "" "This is a convenience function that calls :meth:`Logger.debug`, on the root " "logger. The handling of the arguments is in every way identical to what is " "described in that method." msgstr "" -#: library/logging.rst:1192 +#: library/logging.rst:1200 msgid "" "The only difference is that if the root logger has no handlers, then :func:" "`basicConfig` is called, prior to calling ``debug`` on the root logger." msgstr "" -#: library/logging.rst:1195 +#: library/logging.rst:1203 msgid "" "For very short scripts or quick demonstrations of ``logging`` facilities, " "``debug`` and the other module-level functions may be convenient. However, " @@ -1720,38 +1728,38 @@ msgid "" "described at the beginnning of this documentation." msgstr "" -#: library/logging.rst:1205 +#: library/logging.rst:1213 msgid "" "Logs a message with level :const:`INFO` on the root logger. The arguments " "and behavior are otherwise the same as for :func:`debug`." msgstr "" -#: library/logging.rst:1211 +#: library/logging.rst:1219 msgid "" "Logs a message with level :const:`WARNING` on the root logger. The arguments " "and behavior are otherwise the same as for :func:`debug`." msgstr "" -#: library/logging.rst:1214 +#: library/logging.rst:1222 msgid "" "There is an obsolete function ``warn`` which is functionally identical to " "``warning``. As ``warn`` is deprecated, please do not use it - use " "``warning`` instead." msgstr "" -#: library/logging.rst:1221 +#: library/logging.rst:1229 msgid "" "Logs a message with level :const:`ERROR` on the root logger. The arguments " "and behavior are otherwise the same as for :func:`debug`." msgstr "" -#: library/logging.rst:1227 +#: library/logging.rst:1235 msgid "" "Logs a message with level :const:`CRITICAL` on the root logger. The " "arguments and behavior are otherwise the same as for :func:`debug`." msgstr "" -#: library/logging.rst:1233 +#: library/logging.rst:1241 msgid "" "Logs a message with level :const:`ERROR` on the root logger. The arguments " "and behavior are otherwise the same as for :func:`debug`. Exception info is " @@ -1759,13 +1767,13 @@ msgid "" "exception handler." msgstr "" -#: library/logging.rst:1239 +#: library/logging.rst:1247 msgid "" "Logs a message with level *level* on the root logger. The arguments and " "behavior are otherwise the same as for :func:`debug`." msgstr "" -#: library/logging.rst:1244 +#: library/logging.rst:1252 msgid "" "Provides an overriding level *level* for all loggers which takes precedence " "over the logger's own level. When the need arises to temporarily throttle " @@ -1779,7 +1787,7 @@ msgid "" "individual loggers." msgstr "" -#: library/logging.rst:1255 +#: library/logging.rst:1263 msgid "" "Note that if you have defined any custom logging level higher than " "``CRITICAL`` (this is not recommended), you won't be able to rely on the " @@ -1787,13 +1795,13 @@ msgid "" "a suitable value." msgstr "" -#: library/logging.rst:1260 +#: library/logging.rst:1268 msgid "" "The *level* parameter was defaulted to level ``CRITICAL``. See :issue:" "`28524` for more information about this change." msgstr "" -#: library/logging.rst:1266 +#: library/logging.rst:1274 msgid "" "Associates level *level* with text *levelName* in an internal dictionary, " "which is used to map numeric levels to a textual representation, for example " @@ -1803,24 +1811,24 @@ msgid "" "and they should increase in increasing order of severity." msgstr "" -#: library/logging.rst:1273 +#: library/logging.rst:1281 msgid "" "If you are thinking of defining your own levels, please see the section on :" "ref:`custom-levels`." msgstr "" -#: library/logging.rst:1278 +#: library/logging.rst:1286 msgid "" "Returns a mapping from level names to their corresponding logging levels. " "For example, the string \"CRITICAL\" maps to :const:`CRITICAL`. The returned " "mapping is copied from an internal mapping on each call to this function." msgstr "" -#: library/logging.rst:1286 +#: library/logging.rst:1294 msgid "Returns the textual or numeric representation of logging level *level*." msgstr "" -#: library/logging.rst:1288 +#: library/logging.rst:1296 msgid "" "If *level* is one of the predefined levels :const:`CRITICAL`, :const:" "`ERROR`, :const:`WARNING`, :const:`INFO` or :const:`DEBUG` then you get the " @@ -1830,20 +1838,20 @@ msgid "" "the corresponding string representation is returned." msgstr "" -#: library/logging.rst:1295 +#: library/logging.rst:1303 msgid "" "The *level* parameter also accepts a string representation of the level such " "as 'INFO'. In such cases, this functions returns the corresponding numeric " "value of the level." msgstr "" -#: library/logging.rst:1299 +#: library/logging.rst:1307 msgid "" "If no matching numeric or string value is passed in, the string 'Level %s' % " "level is returned." msgstr "" -#: library/logging.rst:1302 +#: library/logging.rst:1310 msgid "" "Levels are internally integers (as they need to be compared in the logging " "logic). This function is used to convert between an integer level and the " @@ -1852,7 +1860,7 @@ msgid "" "vice versa." msgstr "" -#: library/logging.rst:1308 +#: library/logging.rst:1316 msgid "" "In Python versions earlier than 3.4, this function could also be passed a " "text level, and would return the corresponding numeric value of the level. " @@ -1860,17 +1868,17 @@ msgid "" "Python 3.4, but reinstated in 3.4.2 due to retain backward compatibility." msgstr "" -#: library/logging.rst:1316 +#: library/logging.rst:1324 msgid "" "Returns a handler with the specified *name*, or ``None`` if there is no " "handler with that name." msgstr "" -#: library/logging.rst:1323 +#: library/logging.rst:1331 msgid "Returns an immutable set of all known handler names." msgstr "" -#: library/logging.rst:1329 +#: library/logging.rst:1337 msgid "" "Creates and returns a new :class:`LogRecord` instance whose attributes are " "defined by *attrdict*. This function is useful for taking a pickled :class:" @@ -1878,7 +1886,7 @@ msgid "" "as a :class:`LogRecord` instance at the receiving end." msgstr "" -#: library/logging.rst:1337 +#: library/logging.rst:1345 msgid "" "Does basic configuration for the logging system by creating a :class:" "`StreamHandler` with a default :class:`Formatter` and adding it to the root " @@ -1887,13 +1895,13 @@ msgid "" "no handlers are defined for the root logger." msgstr "" -#: library/logging.rst:1343 +#: library/logging.rst:1351 msgid "" "This function does nothing if the root logger already has handlers " "configured, unless the keyword argument *force* is set to ``True``." msgstr "" -#: library/logging.rst:1346 +#: library/logging.rst:1354 msgid "" "This function should be called from the main thread before other threads are " "started. In versions of Python prior to 2.7.1 and 3.2, if this function is " @@ -1902,54 +1910,54 @@ msgid "" "unexpected results such as messages being duplicated in the log." msgstr "" -#: library/logging.rst:1353 +#: library/logging.rst:1361 msgid "The following keyword arguments are supported." msgstr "" -#: library/logging.rst:1360 +#: library/logging.rst:1368 msgid "*filename*" msgstr "" -#: library/logging.rst:1360 +#: library/logging.rst:1368 msgid "" "Specifies that a :class:`FileHandler` be created, using the specified " "filename, rather than a :class:`StreamHandler`." msgstr "" -#: library/logging.rst:1364 +#: library/logging.rst:1372 msgid "*filemode*" msgstr "" -#: library/logging.rst:1364 +#: library/logging.rst:1372 msgid "" "If *filename* is specified, open the file in this :ref:`mode `. " "Defaults to ``'a'``." msgstr "" -#: library/logging.rst:1368 +#: library/logging.rst:1376 msgid "*format*" msgstr "" -#: library/logging.rst:1368 +#: library/logging.rst:1376 msgid "" "Use the specified format string for the handler. Defaults to attributes " "``levelname``, ``name`` and ``message`` separated by colons." msgstr "" -#: library/logging.rst:1373 +#: library/logging.rst:1381 msgid "*datefmt*" msgstr "" -#: library/logging.rst:1373 +#: library/logging.rst:1381 msgid "" "Use the specified date/time format, as accepted by :func:`time.strftime`." msgstr "" -#: library/logging.rst:1376 +#: library/logging.rst:1384 msgid "*style*" msgstr "" -#: library/logging.rst:1376 +#: library/logging.rst:1384 msgid "" "If *format* is specified, use this style for the format string. One of " "``'%'``, ``'{'`` or ``'$'`` for :ref:`printf-style `." msgstr "" -#: library/logging.rst:1387 +#: library/logging.rst:1395 msgid "*stream*" msgstr "" -#: library/logging.rst:1387 +#: library/logging.rst:1395 msgid "" "Use the specified stream to initialize the :class:`StreamHandler`. Note that " "this argument is incompatible with *filename* - if both are present, a " "``ValueError`` is raised." msgstr "" -#: library/logging.rst:1393 +#: library/logging.rst:1401 msgid "*handlers*" msgstr "" -#: library/logging.rst:1393 +#: library/logging.rst:1401 msgid "" "If specified, this should be an iterable of already created handlers to add " "to the root logger. Any handlers which don't already have a formatter set " @@ -1989,33 +1997,33 @@ msgid "" "present, a ``ValueError`` is raised." msgstr "" -#: library/logging.rst:1402 +#: library/logging.rst:1410 msgid "*force*" msgstr "" -#: library/logging.rst:1402 +#: library/logging.rst:1410 msgid "" "If this keyword argument is specified as true, any existing handlers " "attached to the root logger are removed and closed, before carrying out the " "configuration as specified by the other arguments." msgstr "" -#: library/logging.rst:1408 +#: library/logging.rst:1416 msgid "*encoding*" msgstr "" -#: library/logging.rst:1408 +#: library/logging.rst:1416 msgid "" "If this keyword argument is specified along with *filename*, its value is " "used when the :class:`FileHandler` is created, and thus used when opening " "the output file." msgstr "" -#: library/logging.rst:1413 +#: library/logging.rst:1421 msgid "*errors*" msgstr "" -#: library/logging.rst:1413 +#: library/logging.rst:1421 msgid "" "If this keyword argument is specified along with *filename*, its value is " "used when the :class:`FileHandler` is created, and thus used when opening " @@ -2024,39 +2032,39 @@ msgid "" "`open`, which means that it will be treated the same as passing 'errors'." msgstr "" -#: library/logging.rst:1424 +#: library/logging.rst:1432 msgid "The *style* argument was added." msgstr "" -#: library/logging.rst:1427 +#: library/logging.rst:1435 msgid "" "The *handlers* argument was added. Additional checks were added to catch " "situations where incompatible arguments are specified (e.g. *handlers* " "together with *stream* or *filename*, or *stream* together with *filename*)." msgstr "" -#: library/logging.rst:1433 +#: library/logging.rst:1441 msgid "The *force* argument was added." msgstr "" -#: library/logging.rst:1436 +#: library/logging.rst:1444 msgid "The *encoding* and *errors* arguments were added." msgstr "" -#: library/logging.rst:1441 +#: library/logging.rst:1449 msgid "" "Informs the logging system to perform an orderly shutdown by flushing and " "closing all handlers. This should be called at application exit and no " "further use of the logging system should be made after this call." msgstr "" -#: library/logging.rst:1445 +#: library/logging.rst:1453 msgid "" "When the logging module is imported, it registers this function as an exit " "handler (see :mod:`atexit`), so normally there's no need to do that manually." msgstr "" -#: library/logging.rst:1452 +#: library/logging.rst:1460 msgid "" "Tells the logging system to use the class *klass* when instantiating a " "logger. The class should define :meth:`!__init__` such that only a name " @@ -2068,32 +2076,32 @@ msgid "" "loggers." msgstr "" -#: library/logging.rst:1463 +#: library/logging.rst:1471 msgid "Set a callable which is used to create a :class:`LogRecord`." msgstr "" -#: library/logging.rst:1465 +#: library/logging.rst:1473 msgid "The factory callable to be used to instantiate a log record." msgstr "" -#: library/logging.rst:1467 +#: library/logging.rst:1475 msgid "" "This function has been provided, along with :func:`getLogRecordFactory`, to " "allow developers more control over how the :class:`LogRecord` representing a " "logging event is constructed." msgstr "" -#: library/logging.rst:1472 +#: library/logging.rst:1480 msgid "The factory has the following signature:" msgstr "" -#: library/logging.rst:1474 +#: library/logging.rst:1482 msgid "" "``factory(name, level, fn, lno, msg, args, exc_info, func=None, sinfo=None, " "**kwargs)``" msgstr "" -#: library/logging.rst:1476 +#: library/logging.rst:1484 msgid "The logger name." msgstr "" @@ -2101,7 +2109,7 @@ msgstr "" msgid "level" msgstr "" -#: library/logging.rst:1477 +#: library/logging.rst:1485 msgid "The logging level (numeric)." msgstr "" @@ -2109,7 +2117,7 @@ msgstr "" msgid "fn" msgstr "" -#: library/logging.rst:1478 +#: library/logging.rst:1486 msgid "The full pathname of the file where the logging call was made." msgstr "" @@ -2117,19 +2125,19 @@ msgstr "" msgid "lno" msgstr "" -#: library/logging.rst:1479 +#: library/logging.rst:1487 msgid "The line number in the file where the logging call was made." msgstr "" -#: library/logging.rst:1480 +#: library/logging.rst:1488 msgid "The logging message." msgstr "" -#: library/logging.rst:1481 +#: library/logging.rst:1489 msgid "The arguments for the logging message." msgstr "" -#: library/logging.rst:1482 +#: library/logging.rst:1490 msgid "An exception tuple, or ``None``." msgstr "" @@ -2137,7 +2145,7 @@ msgstr "" msgid "func" msgstr "" -#: library/logging.rst:1483 +#: library/logging.rst:1491 msgid "The name of the function or method which invoked the logging call." msgstr "" @@ -2145,7 +2153,7 @@ msgstr "" msgid "sinfo" msgstr "" -#: library/logging.rst:1485 +#: library/logging.rst:1493 msgid "" "A stack traceback such as is provided by :func:`traceback.print_stack`, " "showing the call hierarchy." @@ -2155,15 +2163,15 @@ msgstr "" msgid "kwargs" msgstr "" -#: library/logging.rst:1487 +#: library/logging.rst:1495 msgid "Additional keyword arguments." msgstr "" -#: library/logging.rst:1491 +#: library/logging.rst:1499 msgid "Module-Level Attributes" msgstr "" -#: library/logging.rst:1495 +#: library/logging.rst:1503 msgid "" "A \"handler of last resort\" is available through this attribute. This is a :" "class:`StreamHandler` writing to ``sys.stderr`` with a level of ``WARNING``, " @@ -2174,15 +2182,15 @@ msgid "" "reason, ``lastResort`` can be set to ``None``." msgstr "" -#: library/logging.rst:1507 +#: library/logging.rst:1515 msgid "Used to see if exceptions during handling should be propagated." msgstr "" -#: library/logging.rst:1509 +#: library/logging.rst:1517 msgid "Default: ``True``." msgstr "" -#: library/logging.rst:1511 +#: library/logging.rst:1519 msgid "" "If :data:`raiseExceptions` is ``False``, exceptions get silently ignored. " "This is what is mostly wanted for a logging system - most users will not " @@ -2190,22 +2198,22 @@ msgid "" "application errors." msgstr "" -#: library/logging.rst:1518 +#: library/logging.rst:1526 msgid "Integration with the warnings module" msgstr "" -#: library/logging.rst:1520 +#: library/logging.rst:1528 msgid "" "The :func:`captureWarnings` function can be used to integrate :mod:`logging` " "with the :mod:`warnings` module." msgstr "" -#: library/logging.rst:1525 +#: library/logging.rst:1533 msgid "" "This function is used to turn the capture of warnings by logging on and off." msgstr "" -#: library/logging.rst:1528 +#: library/logging.rst:1536 msgid "" "If *capture* is ``True``, warnings issued by the :mod:`warnings` module will " "be redirected to the logging system. Specifically, a warning will be " @@ -2214,46 +2222,46 @@ msgid "" "`WARNING`." msgstr "" -#: library/logging.rst:1533 +#: library/logging.rst:1541 msgid "" "If *capture* is ``False``, the redirection of warnings to the logging system " "will stop, and warnings will be redirected to their original destinations (i." "e. those in effect before ``captureWarnings(True)`` was called)." msgstr "" -#: library/logging.rst:1540 +#: library/logging.rst:1548 msgid "Module :mod:`logging.config`" msgstr "" -#: library/logging.rst:1541 +#: library/logging.rst:1549 msgid "Configuration API for the logging module." msgstr "" -#: library/logging.rst:1543 +#: library/logging.rst:1551 msgid "Module :mod:`logging.handlers`" msgstr "" -#: library/logging.rst:1544 +#: library/logging.rst:1552 msgid "Useful handlers included with the logging module." msgstr "" -#: library/logging.rst:1546 +#: library/logging.rst:1554 msgid ":pep:`282` - A Logging System" msgstr "" -#: library/logging.rst:1547 +#: library/logging.rst:1555 msgid "" "The proposal which described this feature for inclusion in the Python " "standard library." msgstr "" -#: library/logging.rst:1550 +#: library/logging.rst:1558 msgid "" "`Original Python logging package `_" msgstr "" -#: library/logging.rst:1551 +#: library/logging.rst:1559 msgid "" "This is the original source for the :mod:`logging` package. The version of " "the package available from this site is suitable for use with Python 1.5.2, " diff --git a/library/lzma.po b/library/lzma.po index 7ac028e6..86a82bb1 100644 --- a/library/lzma.po +++ b/library/lzma.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -104,7 +104,7 @@ msgstr "" msgid "Added support for the ``\"x\"``, ``\"xb\"`` and ``\"xt\"`` modes." msgstr "" -#: library/lzma.rst:127 +#: library/lzma.rst:141 msgid "Accepts a :term:`path-like object`." msgstr "" @@ -151,7 +151,7 @@ msgid "" msgstr "" #: library/lzma.rst:107 -msgid "The following method is also provided:" +msgid "The following method and attributes are also provided:" msgstr "" #: library/lzma.rst:111 @@ -169,60 +169,70 @@ msgid "" "*filename*)." msgstr "" -#: library/lzma.rst:120 +#: library/lzma.rst:122 +msgid "``'rb'`` for reading and ``'wb'`` for writing." +msgstr "" + +#: library/lzma.rst:128 +msgid "" +"The lzma file name. Equivalent to the :attr:`~io.FileIO.name` attribute of " +"the underlying :term:`file object`." +msgstr "" + +#: library/lzma.rst:134 msgid "Added support for the ``\"x\"`` and ``\"xb\"`` modes." msgstr "" -#: library/lzma.rst:123 +#: library/lzma.rst:137 msgid "" "The :meth:`~io.BufferedIOBase.read` method now accepts an argument of " "``None``." msgstr "" -#: library/lzma.rst:132 +#: library/lzma.rst:146 msgid "Compressing and decompressing data in memory" msgstr "" -#: library/lzma.rst:136 +#: library/lzma.rst:150 msgid "" "Create a compressor object, which can be used to compress data incrementally." msgstr "" -#: library/lzma.rst:138 +#: library/lzma.rst:152 msgid "" "For a more convenient way of compressing a single chunk of data, see :func:" "`compress`." msgstr "" -#: library/lzma.rst:141 +#: library/lzma.rst:155 msgid "" "The *format* argument specifies what container format should be used. " "Possible values are:" msgstr "" -#: library/lzma.rst:144 +#: library/lzma.rst:158 msgid ":const:`FORMAT_XZ`: The ``.xz`` container format." msgstr "" -#: library/lzma.rst:145 +#: library/lzma.rst:159 msgid "This is the default format." msgstr "" -#: library/lzma.rst:147 +#: library/lzma.rst:161 msgid ":const:`FORMAT_ALONE`: The legacy ``.lzma`` container format." msgstr "" -#: library/lzma.rst:148 +#: library/lzma.rst:162 msgid "" "This format is more limited than ``.xz`` -- it does not support integrity " "checks or multiple filters." msgstr "" -#: library/lzma.rst:151 +#: library/lzma.rst:165 msgid ":const:`FORMAT_RAW`: A raw data stream, not using any container format." msgstr "" -#: library/lzma.rst:152 +#: library/lzma.rst:166 msgid "" "This format specifier does not support integrity checks, and requires that " "you always specify a custom filter chain (for both compression and " @@ -230,46 +240,46 @@ msgid "" "decompressed using :const:`FORMAT_AUTO` (see :class:`LZMADecompressor`)." msgstr "" -#: library/lzma.rst:157 +#: library/lzma.rst:171 msgid "" "The *check* argument specifies the type of integrity check to include in the " "compressed data. This check is used when decompressing, to ensure that the " "data has not been corrupted. Possible values are:" msgstr "" -#: library/lzma.rst:161 +#: library/lzma.rst:175 msgid "" ":const:`CHECK_NONE`: No integrity check. This is the default (and the only " "acceptable value) for :const:`FORMAT_ALONE` and :const:`FORMAT_RAW`." msgstr "" -#: library/lzma.rst:165 +#: library/lzma.rst:179 msgid ":const:`CHECK_CRC32`: 32-bit Cyclic Redundancy Check." msgstr "" -#: library/lzma.rst:167 +#: library/lzma.rst:181 msgid "" ":const:`CHECK_CRC64`: 64-bit Cyclic Redundancy Check. This is the default " "for :const:`FORMAT_XZ`." msgstr "" -#: library/lzma.rst:170 +#: library/lzma.rst:184 msgid ":const:`CHECK_SHA256`: 256-bit Secure Hash Algorithm." msgstr "" -#: library/lzma.rst:172 +#: library/lzma.rst:186 msgid "" "If the specified check is not supported, an :class:`LZMAError` is raised." msgstr "" -#: library/lzma.rst:174 +#: library/lzma.rst:188 msgid "" "The compression settings can be specified either as a preset compression " "level (with the *preset* argument), or in detail as a custom filter chain " "(with the *filters* argument)." msgstr "" -#: library/lzma.rst:178 +#: library/lzma.rst:192 msgid "" "The *preset* argument (if provided) should be an integer between ``0`` and " "``9`` (inclusive), optionally OR-ed with the constant :const:" @@ -278,7 +288,7 @@ msgid "" "presets produce smaller output, but make the compression process slower." msgstr "" -#: library/lzma.rst:187 +#: library/lzma.rst:201 msgid "" "In addition to being more CPU-intensive, compression with higher presets " "also requires much more memory (and produces output that needs more memory " @@ -287,13 +297,13 @@ msgid "" "generally best to stick with the default preset." msgstr "" -#: library/lzma.rst:193 +#: library/lzma.rst:207 msgid "" "The *filters* argument (if provided) should be a filter chain specifier. " "See :ref:`filter-chain-specs` for details." msgstr "" -#: library/lzma.rst:198 +#: library/lzma.rst:212 msgid "" "Compress *data* (a :class:`bytes` object), returning a :class:`bytes` object " "containing compressed data for at least part of the input. Some of *data* " @@ -302,29 +312,29 @@ msgid "" "any previous calls to :meth:`compress`." msgstr "" -#: library/lzma.rst:206 +#: library/lzma.rst:220 msgid "" "Finish the compression process, returning a :class:`bytes` object containing " "any data stored in the compressor's internal buffers." msgstr "" -#: library/lzma.rst:209 +#: library/lzma.rst:223 msgid "The compressor cannot be used after this method has been called." msgstr "" -#: library/lzma.rst:214 +#: library/lzma.rst:228 msgid "" "Create a decompressor object, which can be used to decompress data " "incrementally." msgstr "" -#: library/lzma.rst:217 +#: library/lzma.rst:231 msgid "" "For a more convenient way of decompressing an entire compressed stream at " "once, see :func:`decompress`." msgstr "" -#: library/lzma.rst:220 +#: library/lzma.rst:234 msgid "" "The *format* argument specifies the container format that should be used. " "The default is :const:`FORMAT_AUTO`, which can decompress both ``.xz`` and " @@ -332,7 +342,7 @@ msgid "" "`FORMAT_ALONE`, and :const:`FORMAT_RAW`." msgstr "" -#: library/lzma.rst:225 +#: library/lzma.rst:239 msgid "" "The *memlimit* argument specifies a limit (in bytes) on the amount of memory " "that the decompressor can use. When this argument is used, decompression " @@ -340,7 +350,7 @@ msgid "" "input within the given memory limit." msgstr "" -#: library/lzma.rst:230 +#: library/lzma.rst:244 msgid "" "The *filters* argument specifies the filter chain that was used to create " "the stream being decompressed. This argument is required if *format* is :" @@ -348,7 +358,7 @@ msgid "" "`filter-chain-specs` for more information about filter chains." msgstr "" -#: library/lzma.rst:236 +#: library/lzma.rst:250 msgid "" "This class does not transparently handle inputs containing multiple " "compressed streams, unlike :func:`decompress` and :class:`LZMAFile`. To " @@ -356,7 +366,7 @@ msgid "" "create a new decompressor for each stream." msgstr "" -#: library/lzma.rst:243 +#: library/lzma.rst:257 msgid "" "Decompress *data* (a :term:`bytes-like object`), returning uncompressed data " "as bytes. Some of *data* may be buffered internally, for use in later calls " @@ -364,7 +374,7 @@ msgid "" "output of any previous calls to :meth:`decompress`." msgstr "" -#: library/lzma.rst:249 +#: library/lzma.rst:263 msgid "" "If *max_length* is nonnegative, returns at most *max_length* bytes of " "decompressed data. If this limit is reached and further output can be " @@ -373,100 +383,100 @@ msgid "" "``b''`` to obtain more of the output." msgstr "" -#: library/lzma.rst:256 +#: library/lzma.rst:270 msgid "" "If all of the input data was decompressed and returned (either because this " "was less than *max_length* bytes, or because *max_length* was negative), " "the :attr:`~.needs_input` attribute will be set to ``True``." msgstr "" -#: library/lzma.rst:261 +#: library/lzma.rst:275 msgid "" "Attempting to decompress data after the end of stream is reached raises an :" "exc:`EOFError`. Any data found after the end of the stream is ignored and " "saved in the :attr:`~.unused_data` attribute." msgstr "" -#: library/lzma.rst:265 +#: library/lzma.rst:279 msgid "Added the *max_length* parameter." msgstr "" -#: library/lzma.rst:270 +#: library/lzma.rst:284 msgid "" "The ID of the integrity check used by the input stream. This may be :const:" "`CHECK_UNKNOWN` until enough of the input has been decoded to determine what " "integrity check it uses." msgstr "" -#: library/lzma.rst:276 +#: library/lzma.rst:290 msgid "``True`` if the end-of-stream marker has been reached." msgstr "" -#: library/lzma.rst:280 +#: library/lzma.rst:294 msgid "Data found after the end of the compressed stream." msgstr "" -#: library/lzma.rst:282 +#: library/lzma.rst:296 msgid "Before the end of the stream is reached, this will be ``b\"\"``." msgstr "" -#: library/lzma.rst:286 +#: library/lzma.rst:300 msgid "" "``False`` if the :meth:`.decompress` method can provide more decompressed " "data before requiring new uncompressed input." msgstr "" -#: library/lzma.rst:293 +#: library/lzma.rst:307 msgid "" "Compress *data* (a :class:`bytes` object), returning the compressed data as " "a :class:`bytes` object." msgstr "" -#: library/lzma.rst:296 +#: library/lzma.rst:310 msgid "" "See :class:`LZMACompressor` above for a description of the *format*, " "*check*, *preset* and *filters* arguments." msgstr "" -#: library/lzma.rst:302 +#: library/lzma.rst:316 msgid "" "Decompress *data* (a :class:`bytes` object), returning the uncompressed data " "as a :class:`bytes` object." msgstr "" -#: library/lzma.rst:305 +#: library/lzma.rst:319 msgid "" "If *data* is the concatenation of multiple distinct compressed streams, " "decompress all of these streams, and return the concatenation of the results." msgstr "" -#: library/lzma.rst:308 +#: library/lzma.rst:322 msgid "" "See :class:`LZMADecompressor` above for a description of the *format*, " "*memlimit* and *filters* arguments." msgstr "" -#: library/lzma.rst:313 +#: library/lzma.rst:327 msgid "Miscellaneous" msgstr "" -#: library/lzma.rst:317 +#: library/lzma.rst:331 msgid "" "Return ``True`` if the given integrity check is supported on this system." msgstr "" -#: library/lzma.rst:319 +#: library/lzma.rst:333 msgid "" ":const:`CHECK_NONE` and :const:`CHECK_CRC32` are always supported. :const:" "`CHECK_CRC64` and :const:`CHECK_SHA256` may be unavailable if you are using " "a version of :program:`liblzma` that was compiled with a limited feature set." msgstr "" -#: library/lzma.rst:328 +#: library/lzma.rst:342 msgid "Specifying custom filter chains" msgstr "" -#: library/lzma.rst:330 +#: library/lzma.rst:344 msgid "" "A filter chain specifier is a sequence of dictionaries, where each " "dictionary contains the ID and options for a single filter. Each dictionary " @@ -474,118 +484,118 @@ msgid "" "filter-dependent options. Valid filter IDs are as follows:" msgstr "" -#: library/lzma.rst:335 +#: library/lzma.rst:349 msgid "Compression filters:" msgstr "" -#: library/lzma.rst:337 +#: library/lzma.rst:351 msgid ":const:`FILTER_LZMA1` (for use with :const:`FORMAT_ALONE`)" msgstr "" -#: library/lzma.rst:338 +#: library/lzma.rst:352 msgid "" ":const:`FILTER_LZMA2` (for use with :const:`FORMAT_XZ` and :const:" "`FORMAT_RAW`)" msgstr "" -#: library/lzma.rst:340 +#: library/lzma.rst:354 msgid "Delta filter:" msgstr "" -#: library/lzma.rst:342 +#: library/lzma.rst:356 msgid ":const:`FILTER_DELTA`" msgstr "" -#: library/lzma.rst:344 +#: library/lzma.rst:358 msgid "Branch-Call-Jump (BCJ) filters:" msgstr "" -#: library/lzma.rst:346 +#: library/lzma.rst:360 msgid ":const:`FILTER_X86`" msgstr "" -#: library/lzma.rst:347 +#: library/lzma.rst:361 msgid ":const:`FILTER_IA64`" msgstr "" -#: library/lzma.rst:348 +#: library/lzma.rst:362 msgid ":const:`FILTER_ARM`" msgstr "" -#: library/lzma.rst:349 +#: library/lzma.rst:363 msgid ":const:`FILTER_ARMTHUMB`" msgstr "" -#: library/lzma.rst:350 +#: library/lzma.rst:364 msgid ":const:`FILTER_POWERPC`" msgstr "" -#: library/lzma.rst:351 +#: library/lzma.rst:365 msgid ":const:`FILTER_SPARC`" msgstr "" -#: library/lzma.rst:353 +#: library/lzma.rst:367 msgid "" "A filter chain can consist of up to 4 filters, and cannot be empty. The last " "filter in the chain must be a compression filter, and any other filters must " "be delta or BCJ filters." msgstr "" -#: library/lzma.rst:357 +#: library/lzma.rst:371 msgid "" "Compression filters support the following options (specified as additional " "entries in the dictionary representing the filter):" msgstr "" -#: library/lzma.rst:360 +#: library/lzma.rst:374 msgid "" "``preset``: A compression preset to use as a source of default values for " "options that are not specified explicitly." msgstr "" -#: library/lzma.rst:362 +#: library/lzma.rst:376 msgid "" "``dict_size``: Dictionary size in bytes. This should be between 4 KiB and " "1.5 GiB (inclusive)." msgstr "" -#: library/lzma.rst:364 +#: library/lzma.rst:378 msgid "``lc``: Number of literal context bits." msgstr "" -#: library/lzma.rst:365 +#: library/lzma.rst:379 msgid "" "``lp``: Number of literal position bits. The sum ``lc + lp`` must be at most " "4." msgstr "" -#: library/lzma.rst:367 +#: library/lzma.rst:381 msgid "``pb``: Number of position bits; must be at most 4." msgstr "" -#: library/lzma.rst:368 +#: library/lzma.rst:382 msgid "``mode``: :const:`MODE_FAST` or :const:`MODE_NORMAL`." msgstr "" -#: library/lzma.rst:369 +#: library/lzma.rst:383 msgid "" "``nice_len``: What should be considered a \"nice length\" for a match. This " "should be 273 or less." msgstr "" -#: library/lzma.rst:371 +#: library/lzma.rst:385 msgid "" "``mf``: What match finder to use -- :const:`MF_HC3`, :const:`MF_HC4`, :const:" "`MF_BT2`, :const:`MF_BT3`, or :const:`MF_BT4`." msgstr "" -#: library/lzma.rst:373 +#: library/lzma.rst:387 msgid "" "``depth``: Maximum search depth used by match finder. 0 (default) means to " "select automatically based on other filter options." msgstr "" -#: library/lzma.rst:376 +#: library/lzma.rst:390 msgid "" "The delta filter stores the differences between bytes, producing more " "repetitive input for the compressor in certain circumstances. It supports " @@ -594,7 +604,7 @@ msgid "" "bytes." msgstr "" -#: library/lzma.rst:381 +#: library/lzma.rst:395 msgid "" "The BCJ filters are intended to be applied to machine code. They convert " "relative branches, calls and jumps in the code to use absolute addressing, " @@ -604,26 +614,26 @@ msgid "" "data. The default is 0." msgstr "" -#: library/lzma.rst:389 +#: library/lzma.rst:403 msgid "Examples" msgstr "" -#: library/lzma.rst:391 +#: library/lzma.rst:405 msgid "Reading in a compressed file::" msgstr "" -#: library/lzma.rst:393 +#: library/lzma.rst:407 msgid "" "import lzma\n" "with lzma.open(\"file.xz\") as f:\n" " file_content = f.read()" msgstr "" -#: library/lzma.rst:397 +#: library/lzma.rst:411 msgid "Creating a compressed file::" msgstr "" -#: library/lzma.rst:399 +#: library/lzma.rst:413 msgid "" "import lzma\n" "data = b\"Insert Data Here\"\n" @@ -631,22 +641,22 @@ msgid "" " f.write(data)" msgstr "" -#: library/lzma.rst:404 +#: library/lzma.rst:418 msgid "Compressing data in memory::" msgstr "" -#: library/lzma.rst:406 +#: library/lzma.rst:420 msgid "" "import lzma\n" "data_in = b\"Insert Data Here\"\n" "data_out = lzma.compress(data_in)" msgstr "" -#: library/lzma.rst:410 +#: library/lzma.rst:424 msgid "Incremental compression::" msgstr "" -#: library/lzma.rst:412 +#: library/lzma.rst:426 msgid "" "import lzma\n" "lzc = lzma.LZMACompressor()\n" @@ -658,11 +668,11 @@ msgid "" "result = b\"\".join([out1, out2, out3, out4])" msgstr "" -#: library/lzma.rst:421 +#: library/lzma.rst:435 msgid "Writing compressed data to an already-open file::" msgstr "" -#: library/lzma.rst:423 +#: library/lzma.rst:437 msgid "" "import lzma\n" "with open(\"file.xz\", \"wb\") as f:\n" @@ -672,11 +682,11 @@ msgid "" " f.write(b\"Not compressed\\n\")" msgstr "" -#: library/lzma.rst:430 +#: library/lzma.rst:444 msgid "Creating a compressed file using a custom filter chain::" msgstr "" -#: library/lzma.rst:432 +#: library/lzma.rst:446 msgid "" "import lzma\n" "my_filters = [\n" diff --git a/library/mailbox.po b/library/mailbox.po index ee60eb19..43f3b78a 100644 --- a/library/mailbox.po +++ b/library/mailbox.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -415,49 +415,161 @@ msgid "The :attr:`!colon` attribute may also be set on a per-instance basis." msgstr "" #: library/mailbox.rst:367 +msgid ":class:`Maildir` now ignores files with a leading dot." +msgstr "" + +#: library/mailbox.rst:370 msgid "" ":class:`!Maildir` instances have all of the methods of :class:`Mailbox` in " "addition to the following:" msgstr "" -#: library/mailbox.rst:560 +#: library/mailbox.rst:669 msgid "Return a list of the names of all folders." msgstr "" -#: library/mailbox.rst:378 +#: library/mailbox.rst:381 msgid "" "Return a :class:`!Maildir` instance representing the folder whose name is " "*folder*. A :exc:`NoSuchMailboxError` exception is raised if the folder does " "not exist." msgstr "" -#: library/mailbox.rst:385 +#: library/mailbox.rst:388 msgid "" "Create a folder whose name is *folder* and return a :class:`!Maildir` " "instance representing it." msgstr "" -#: library/mailbox.rst:578 +#: library/mailbox.rst:687 msgid "" "Delete the folder whose name is *folder*. If the folder contains any " "messages, a :exc:`NotEmptyError` exception will be raised and the folder " "will not be deleted." msgstr "" -#: library/mailbox.rst:398 +#: library/mailbox.rst:401 msgid "" "Delete temporary files from the mailbox that have not been accessed in the " "last 36 hours. The Maildir specification says that mail-reading programs " "should do this occasionally." msgstr "" -#: library/mailbox.rst:402 +#: library/mailbox.rst:408 +msgid "" +"Return as a string the flags that are set on the message corresponding to " +"*key*. This is the same as ``get_message(key).get_flags()`` but much faster, " +"because it does not open the message file. Use this method when iterating " +"over the keys to determine which messages are interesting to get." +msgstr "" + +#: library/mailbox.rst:415 +msgid "" +"If you do have a :class:`MaildirMessage` object, use its :meth:" +"`~MaildirMessage.get_flags` method instead, because changes made by the " +"message's :meth:`~MaildirMessage.set_flags`, :meth:`~MaildirMessage." +"add_flag` and :meth:`~MaildirMessage.remove_flag` methods are not reflected " +"here until the mailbox's :meth:`__setitem__` method is called." +msgstr "" + +#: library/mailbox.rst:427 +msgid "" +"On the message corresponding to *key*, set the flags specified by *flags* " +"and unset all others. Calling ``some_mailbox.set_flags(key, flags)`` is " +"similar to ::" +msgstr "" + +#: library/mailbox.rst:431 +msgid "" +"one_message = some_mailbox.get_message(key)\n" +"one_message.set_flags(flags)\n" +"some_mailbox[key] = one_message" +msgstr "" + +#: library/mailbox.rst:498 +msgid "but faster, because it does not open the message file." +msgstr "" + +#: library/mailbox.rst:437 +msgid "" +"If you do have a :class:`MaildirMessage` object, use its :meth:" +"`~MaildirMessage.set_flags` method instead, because changes made with this " +"mailbox method will not be visible to the message object's method, :meth:" +"`~MaildirMessage.get_flags`." +msgstr "" + +#: library/mailbox.rst:447 +msgid "" +"On the message corresponding to *key*, set the flags specified by *flag* " +"without changing other flags. To add more than one flag at a time, *flag* " +"may be a string of more than one character." +msgstr "" + +#: library/mailbox.rst:451 +msgid "" +"Considerations for using this method versus the message object's :meth:" +"`~MaildirMessage.add_flag` method are similar to those for :meth:" +"`set_flags`; see the discussion there." +msgstr "" + +#: library/mailbox.rst:460 +msgid "" +"On the message corresponding to *key*, unset the flags specified by *flag* " +"without changing other flags. To remove more than one flag at a time, *flag* " +"may be a string of more than one character." +msgstr "" + +#: library/mailbox.rst:464 +msgid "" +"Considerations for using this method versus the message object's :meth:" +"`~MaildirMessage.remove_flag` method are similar to those for :meth:" +"`set_flags`; see the discussion there." +msgstr "" + +#: library/mailbox.rst:473 +msgid "" +"Return a string containing the info for the message corresponding to *key*. " +"This is the same as ``get_message(key).get_info()`` but much faster, because " +"it does not open the message file. Use this method when iterating over the " +"keys to determine which messages are interesting to get." +msgstr "" + +#: library/mailbox.rst:480 +msgid "" +"If you do have a :class:`MaildirMessage` object, use its :meth:" +"`~MaildirMessage.get_info` method instead, because changes made by the " +"message's :meth:`~MaildirMessage.set_info` method are not reflected here " +"until the mailbox's :meth:`__setitem__` method is called." +msgstr "" + +#: library/mailbox.rst:491 +msgid "" +"Set the info of the message corresponding to *key* to *info*. Calling " +"``some_mailbox.set_info(key, flags)`` is similar to ::" +msgstr "" + +#: library/mailbox.rst:494 +msgid "" +"one_message = some_mailbox.get_message(key)\n" +"one_message.set_info(info)\n" +"some_mailbox[key] = one_message" +msgstr "" + +#: library/mailbox.rst:500 +msgid "" +"If you do have a :class:`MaildirMessage` object, use its :meth:" +"`~MaildirMessage.set_info` method instead, because changes made with this " +"mailbox method will not be visible to the message object's method, :meth:" +"`~MaildirMessage.get_info`." +msgstr "" + +#: library/mailbox.rst:507 msgid "" "Some :class:`Mailbox` methods implemented by :class:`!Maildir` deserve " "special remarks:" msgstr "" -#: library/mailbox.rst:412 +#: library/mailbox.rst:517 msgid "" "These methods generate unique file names based upon the current process ID. " "When using multiple threads, undetected name clashes may occur and cause " @@ -465,56 +577,56 @@ msgid "" "these methods to manipulate the same mailbox simultaneously." msgstr "" -#: library/mailbox.rst:420 +#: library/mailbox.rst:525 msgid "" "All changes to Maildir mailboxes are immediately applied, so this method " "does nothing." msgstr "" -#: library/mailbox.rst:427 +#: library/mailbox.rst:532 msgid "" "Maildir mailboxes do not support (or require) locking, so these methods do " "nothing." msgstr "" -#: library/mailbox.rst:433 +#: library/mailbox.rst:538 msgid "" ":class:`!Maildir` instances do not keep any open files and the underlying " "mailboxes do not support locking, so this method does nothing." msgstr "" -#: library/mailbox.rst:439 +#: library/mailbox.rst:544 msgid "" "Depending upon the host platform, it may not be possible to modify or remove " "the underlying message while the returned file remains open." msgstr "" -#: library/mailbox.rst:445 +#: library/mailbox.rst:550 msgid "" "`maildir man page from Courier `_" msgstr "" -#: library/mailbox.rst:446 +#: library/mailbox.rst:551 msgid "" "A specification of the format. Describes a common extension for supporting " "folders." msgstr "" -#: library/mailbox.rst:449 +#: library/mailbox.rst:554 msgid "`Using maildir format `_" msgstr "" -#: library/mailbox.rst:450 +#: library/mailbox.rst:555 msgid "" "Notes on Maildir by its inventor. Includes an updated name-creation scheme " "and details on \"info\" semantics." msgstr "" -#: library/mailbox.rst:457 +#: library/mailbox.rst:562 msgid ":class:`!mbox` objects" msgstr "" -#: library/mailbox.rst:462 +#: library/mailbox.rst:567 msgid "" "A subclass of :class:`Mailbox` for mailboxes in mbox format. Parameter " "*factory* is a callable object that accepts a file-like message " @@ -524,7 +636,7 @@ msgid "" "mailbox is created if it does not exist." msgstr "" -#: library/mailbox.rst:469 +#: library/mailbox.rst:574 msgid "" "The mbox format is the classic format for storing mail on Unix systems. All " "messages in an mbox mailbox are stored in a single file with the beginning " @@ -532,7 +644,7 @@ msgid "" "\"." msgstr "" -#: library/mailbox.rst:473 +#: library/mailbox.rst:578 msgid "" "Several variations of the mbox format exist to address perceived " "shortcomings in the original. In the interest of compatibility, :class:`!" @@ -544,67 +656,67 @@ msgid "" "when reading the message." msgstr "" -#: library/mailbox.rst:481 +#: library/mailbox.rst:586 msgid "" "Some :class:`Mailbox` methods implemented by :class:`!mbox` deserve special " "remarks:" msgstr "" -#: library/mailbox.rst:497 library/mailbox.rst:762 library/mailbox.rst:772 +#: library/mailbox.rst:602 library/mailbox.rst:871 library/mailbox.rst:881 msgid "" "Note: This method has an extra parameter (*from_*) compared with other " "classes. The first line of an mbox file entry is the Unix \"From \" line. If " "*from_* is False, the first line of the file is dropped." msgstr "" -#: library/mailbox.rst:493 +#: library/mailbox.rst:598 msgid "" "Using the file after calling :meth:`~Mailbox.flush` or :meth:`~Mailbox." "close` on the :class:`!mbox` instance may yield unpredictable results or " "raise an exception." msgstr "" -#: library/mailbox.rst:719 library/mailbox.rst:780 +#: library/mailbox.rst:828 library/mailbox.rst:889 msgid "" "Three locking mechanisms are used---dot locking and, if available, the :c:" "func:`!flock` and :c:func:`!lockf` system calls." msgstr "" -#: library/mailbox.rst:516 +#: library/mailbox.rst:621 msgid "" "`mbox man page from tin `_" msgstr "" -#: library/mailbox.rst:517 +#: library/mailbox.rst:622 msgid "A specification of the format, with details on locking." msgstr "" -#: library/mailbox.rst:519 +#: library/mailbox.rst:624 msgid "" "`Configuring Netscape Mail on Unix: Why The Content-Length Format is Bad " "`_" msgstr "" -#: library/mailbox.rst:520 +#: library/mailbox.rst:625 msgid "An argument for using the original mbox format rather than a variation." msgstr "" -#: library/mailbox.rst:522 +#: library/mailbox.rst:627 msgid "" "`\"mbox\" is a family of several mutually incompatible mailbox formats " "`_" msgstr "" -#: library/mailbox.rst:523 +#: library/mailbox.rst:628 msgid "A history of mbox variations." msgstr "" -#: library/mailbox.rst:529 +#: library/mailbox.rst:634 msgid ":class:`!MH` objects" msgstr "" -#: library/mailbox.rst:534 +#: library/mailbox.rst:639 msgid "" "A subclass of :class:`Mailbox` for mailboxes in MH format. Parameter " "*factory* is a callable object that accepts a file-like message " @@ -614,7 +726,7 @@ msgid "" "is created if it does not exist." msgstr "" -#: library/mailbox.rst:541 +#: library/mailbox.rst:646 msgid "" "MH is a directory-based mailbox format invented for the MH Message Handling " "System, a mail user agent. Each message in an MH mailbox resides in its own " @@ -625,7 +737,7 @@ msgid "" "called :file:`.mh_sequences` in each folder." msgstr "" -#: library/mailbox.rst:549 +#: library/mailbox.rst:654 msgid "" "The :class:`!MH` class manipulates MH mailboxes, but it does not attempt to " "emulate all of :program:`mh`'s behaviors. In particular, it does not modify " @@ -633,63 +745,67 @@ msgid "" "are used by :program:`mh` to store its state and configuration." msgstr "" -#: library/mailbox.rst:554 +#: library/mailbox.rst:659 msgid "" ":class:`!MH` instances have all of the methods of :class:`Mailbox` in " "addition to the following:" msgstr "" -#: library/mailbox.rst:565 +#: library/mailbox.rst:664 +msgid "Supported folders that don't contain a :file:`.mh_sequences` file." +msgstr "" + +#: library/mailbox.rst:674 msgid "" "Return an :class:`!MH` instance representing the folder whose name is " "*folder*. A :exc:`NoSuchMailboxError` exception is raised if the folder does " "not exist." msgstr "" -#: library/mailbox.rst:572 +#: library/mailbox.rst:681 msgid "" "Create a folder whose name is *folder* and return an :class:`!MH` instance " "representing it." msgstr "" -#: library/mailbox.rst:585 +#: library/mailbox.rst:694 msgid "" "Return a dictionary of sequence names mapped to key lists. If there are no " "sequences, the empty dictionary is returned." msgstr "" -#: library/mailbox.rst:591 +#: library/mailbox.rst:700 msgid "" "Re-define the sequences that exist in the mailbox based upon *sequences*, a " "dictionary of names mapped to key lists, like returned by :meth:" "`get_sequences`." msgstr "" -#: library/mailbox.rst:598 +#: library/mailbox.rst:707 msgid "" "Rename messages in the mailbox as necessary to eliminate gaps in numbering. " "Entries in the sequences list are updated correspondingly." msgstr "" -#: library/mailbox.rst:603 +#: library/mailbox.rst:712 msgid "" "Already-issued keys are invalidated by this operation and should not be " "subsequently used." msgstr "" -#: library/mailbox.rst:606 +#: library/mailbox.rst:715 msgid "" "Some :class:`Mailbox` methods implemented by :class:`!MH` deserve special " "remarks:" msgstr "" -#: library/mailbox.rst:614 +#: library/mailbox.rst:723 msgid "" "These methods immediately delete the message. The MH convention of marking a " "message for deletion by prepending a comma to its name is not used." msgstr "" -#: library/mailbox.rst:621 +#: library/mailbox.rst:730 msgid "" "Three locking mechanisms are used---dot locking and, if available, the :c:" "func:`!flock` and :c:func:`!lockf` system calls. For MH mailboxes, locking " @@ -698,51 +814,51 @@ msgid "" "files." msgstr "" -#: library/mailbox.rst:630 +#: library/mailbox.rst:739 msgid "" "Depending upon the host platform, it may not be possible to remove the " "underlying message while the returned file remains open." msgstr "" -#: library/mailbox.rst:636 +#: library/mailbox.rst:745 msgid "" "All changes to MH mailboxes are immediately applied, so this method does " "nothing." msgstr "" -#: library/mailbox.rst:642 +#: library/mailbox.rst:751 msgid "" ":class:`!MH` instances do not keep any open files, so this method is " "equivalent to :meth:`unlock`." msgstr "" -#: library/mailbox.rst:648 +#: library/mailbox.rst:757 msgid "`nmh - Message Handling System `_" msgstr "" -#: library/mailbox.rst:649 +#: library/mailbox.rst:758 msgid "" "Home page of :program:`nmh`, an updated version of the original :program:" "`mh`." msgstr "" -#: library/mailbox.rst:651 +#: library/mailbox.rst:760 msgid "" "`MH & nmh: Email for Users & Programmers `_" msgstr "" -#: library/mailbox.rst:652 +#: library/mailbox.rst:761 msgid "" "A GPL-licensed book on :program:`mh` and :program:`nmh`, with some " "information on the mailbox format." msgstr "" -#: library/mailbox.rst:659 +#: library/mailbox.rst:768 msgid ":class:`!Babyl` objects" msgstr "" -#: library/mailbox.rst:664 +#: library/mailbox.rst:773 msgid "" "A subclass of :class:`Mailbox` for mailboxes in Babyl format. Parameter " "*factory* is a callable object that accepts a file-like message " @@ -752,7 +868,7 @@ msgid "" "mailbox is created if it does not exist." msgstr "" -#: library/mailbox.rst:671 +#: library/mailbox.rst:780 msgid "" "Babyl is a single-file mailbox format used by the Rmail mail user agent " "included with Emacs. The beginning of a message is indicated by a line " @@ -762,7 +878,7 @@ msgid "" "Underscore (``'\\037'``) character." msgstr "" -#: library/mailbox.rst:678 +#: library/mailbox.rst:787 msgid "" "Messages in a Babyl mailbox have two sets of headers, original headers and " "so-called visible headers. Visible headers are typically a subset of the " @@ -773,31 +889,31 @@ msgid "" "in the Babyl options section." msgstr "" -#: library/mailbox.rst:686 +#: library/mailbox.rst:795 msgid "" ":class:`!Babyl` instances have all of the methods of :class:`Mailbox` in " "addition to the following:" msgstr "" -#: library/mailbox.rst:692 +#: library/mailbox.rst:801 msgid "" "Return a list of the names of all user-defined labels used in the mailbox." msgstr "" -#: library/mailbox.rst:696 +#: library/mailbox.rst:805 msgid "" "The actual messages are inspected to determine which labels exist in the " "mailbox rather than consulting the list of labels in the Babyl options " "section, but the Babyl section is updated whenever the mailbox is modified." msgstr "" -#: library/mailbox.rst:701 +#: library/mailbox.rst:810 msgid "" "Some :class:`Mailbox` methods implemented by :class:`!Babyl` deserve special " "remarks:" msgstr "" -#: library/mailbox.rst:707 +#: library/mailbox.rst:816 msgid "" "In Babyl mailboxes, the headers of a message are not stored contiguously " "with the body of the message. To generate a file-like representation, the " @@ -807,30 +923,30 @@ msgid "" "memory compared to a string representation." msgstr "" -#: library/mailbox.rst:725 +#: library/mailbox.rst:834 msgid "" "`Format of Version 5 Babyl Files `_" msgstr "" -#: library/mailbox.rst:726 +#: library/mailbox.rst:835 msgid "A specification of the Babyl format." msgstr "" -#: library/mailbox.rst:728 +#: library/mailbox.rst:837 msgid "" "`Reading Mail with Rmail `_" msgstr "" -#: library/mailbox.rst:729 +#: library/mailbox.rst:838 msgid "The Rmail manual, with some information on Babyl semantics." msgstr "" -#: library/mailbox.rst:735 +#: library/mailbox.rst:844 msgid ":class:`!MMDF` objects" msgstr "" -#: library/mailbox.rst:740 +#: library/mailbox.rst:849 msgid "" "A subclass of :class:`Mailbox` for mailboxes in MMDF format. Parameter " "*factory* is a callable object that accepts a file-like message " @@ -840,7 +956,7 @@ msgid "" "mailbox is created if it does not exist." msgstr "" -#: library/mailbox.rst:747 +#: library/mailbox.rst:856 msgid "" "MMDF is a single-file mailbox format invented for the Multichannel " "Memorandum Distribution Facility, a mail transfer agent. Each message is in " @@ -853,52 +969,52 @@ msgid "" "subsequent messages." msgstr "" -#: library/mailbox.rst:756 +#: library/mailbox.rst:865 msgid "" "Some :class:`Mailbox` methods implemented by :class:`!MMDF` deserve special " "remarks:" msgstr "" -#: library/mailbox.rst:768 +#: library/mailbox.rst:877 msgid "" "Using the file after calling :meth:`~Mailbox.flush` or :meth:`~Mailbox." "close` on the :class:`!MMDF` instance may yield unpredictable results or " "raise an exception." msgstr "" -#: library/mailbox.rst:786 +#: library/mailbox.rst:895 msgid "" "`mmdf man page from tin `_" msgstr "" -#: library/mailbox.rst:787 +#: library/mailbox.rst:896 msgid "" "A specification of MMDF format from the documentation of tin, a newsreader." msgstr "" -#: library/mailbox.rst:789 +#: library/mailbox.rst:898 msgid "`MMDF `_" msgstr "" -#: library/mailbox.rst:790 +#: library/mailbox.rst:899 msgid "" "A Wikipedia article describing the Multichannel Memorandum Distribution " "Facility." msgstr "" -#: library/mailbox.rst:797 +#: library/mailbox.rst:906 msgid ":class:`!Message` objects" msgstr "" -#: library/mailbox.rst:802 +#: library/mailbox.rst:911 msgid "" "A subclass of the :mod:`email.message` module's :class:`~email.message." "Message`. Subclasses of :class:`!mailbox.Message` add mailbox-format-" "specific state and behavior." msgstr "" -#: library/mailbox.rst:806 +#: library/mailbox.rst:915 msgid "" "If *message* is omitted, the new instance is created in a default, empty " "state. If *message* is an :class:`email.message.Message` instance, its " @@ -910,7 +1026,7 @@ msgid "" "compatibility." msgstr "" -#: library/mailbox.rst:815 +#: library/mailbox.rst:924 msgid "" "The format-specific state and behaviors offered by subclasses vary, but in " "general it is only the properties that are not specific to a particular " @@ -922,7 +1038,7 @@ msgid "" "important is retained, because it applies to the message itself." msgstr "" -#: library/mailbox.rst:824 +#: library/mailbox.rst:933 msgid "" "There is no requirement that :class:`!Message` instances be used to " "represent messages retrieved using :class:`Mailbox` instances. In some " @@ -933,17 +1049,17 @@ msgid "" "initialized." msgstr "" -#: library/mailbox.rst:835 +#: library/mailbox.rst:944 msgid ":class:`!MaildirMessage` objects" msgstr "" -#: library/mailbox.rst:840 +#: library/mailbox.rst:949 msgid "" "A message with Maildir-specific behaviors. Parameter *message* has the same " "meaning as with the :class:`Message` constructor." msgstr "" -#: library/mailbox.rst:843 +#: library/mailbox.rst:952 msgid "" "Typically, a mail user agent application moves all of the messages in the :" "file:`new` subdirectory to the :file:`cur` subdirectory after the first time " @@ -957,115 +1073,115 @@ msgid "" "flags for Maildir messages are as follows:" msgstr "" -#: library/mailbox.rst:1022 library/mailbox.rst:1393 +#: library/mailbox.rst:1131 library/mailbox.rst:1502 msgid "Flag" msgstr "" -#: library/mailbox.rst:1022 library/mailbox.rst:1393 +#: library/mailbox.rst:1131 library/mailbox.rst:1502 msgid "Meaning" msgstr "" -#: library/mailbox.rst:1022 library/mailbox.rst:1260 library/mailbox.rst:1393 +#: library/mailbox.rst:1131 library/mailbox.rst:1369 library/mailbox.rst:1502 msgid "Explanation" msgstr "" -#: library/mailbox.rst:1028 library/mailbox.rst:1399 +#: library/mailbox.rst:1137 library/mailbox.rst:1508 msgid "D" msgstr "" -#: library/mailbox.rst:857 +#: library/mailbox.rst:966 msgid "Draft" msgstr "" -#: library/mailbox.rst:857 +#: library/mailbox.rst:966 msgid "Under composition" msgstr "" -#: library/mailbox.rst:1030 library/mailbox.rst:1401 +#: library/mailbox.rst:1139 library/mailbox.rst:1510 msgid "F" msgstr "" -#: library/mailbox.rst:1030 library/mailbox.rst:1401 +#: library/mailbox.rst:1139 library/mailbox.rst:1510 msgid "Flagged" msgstr "" -#: library/mailbox.rst:1030 library/mailbox.rst:1401 +#: library/mailbox.rst:1139 library/mailbox.rst:1510 msgid "Marked as important" msgstr "" -#: library/mailbox.rst:861 +#: library/mailbox.rst:970 msgid "P" msgstr "" -#: library/mailbox.rst:861 +#: library/mailbox.rst:970 msgid "Passed" msgstr "" -#: library/mailbox.rst:861 +#: library/mailbox.rst:970 msgid "Forwarded, resent, or bounced" msgstr "" -#: library/mailbox.rst:1024 library/mailbox.rst:1395 +#: library/mailbox.rst:1133 library/mailbox.rst:1504 msgid "R" msgstr "" -#: library/mailbox.rst:863 +#: library/mailbox.rst:972 msgid "Replied" msgstr "" -#: library/mailbox.rst:1032 library/mailbox.rst:1268 library/mailbox.rst:1403 +#: library/mailbox.rst:1141 library/mailbox.rst:1377 library/mailbox.rst:1512 msgid "Replied to" msgstr "" -#: library/mailbox.rst:865 +#: library/mailbox.rst:974 msgid "S" msgstr "" -#: library/mailbox.rst:865 +#: library/mailbox.rst:974 msgid "Seen" msgstr "" -#: library/mailbox.rst:1024 library/mailbox.rst:1395 +#: library/mailbox.rst:1133 library/mailbox.rst:1504 msgid "Read" msgstr "" -#: library/mailbox.rst:867 +#: library/mailbox.rst:976 msgid "T" msgstr "" -#: library/mailbox.rst:867 +#: library/mailbox.rst:976 msgid "Trashed" msgstr "" -#: library/mailbox.rst:1028 library/mailbox.rst:1399 +#: library/mailbox.rst:1137 library/mailbox.rst:1508 msgid "Marked for subsequent deletion" msgstr "" -#: library/mailbox.rst:870 +#: library/mailbox.rst:979 msgid ":class:`!MaildirMessage` instances offer the following methods:" msgstr "" -#: library/mailbox.rst:875 +#: library/mailbox.rst:984 msgid "" "Return either \"new\" (if the message should be stored in the :file:`new` " "subdirectory) or \"cur\" (if the message should be stored in the :file:`cur` " "subdirectory)." msgstr "" -#: library/mailbox.rst:881 +#: library/mailbox.rst:990 msgid "" "A message is typically moved from :file:`new` to :file:`cur` after its " -"mailbox has been accessed, whether or not the message is has been read. A " +"mailbox has been accessed, whether or not the message has been read. A " "message ``msg`` has been read if ``\"S\" in msg.get_flags()`` is ``True``." msgstr "" -#: library/mailbox.rst:889 +#: library/mailbox.rst:998 msgid "" "Set the subdirectory the message should be stored in. Parameter *subdir* " "must be either \"new\" or \"cur\"." msgstr "" -#: library/mailbox.rst:895 +#: library/mailbox.rst:1004 msgid "" "Return a string specifying the flags that are currently set. If the message " "complies with the standard Maildir format, the result is the concatenation " @@ -1074,11 +1190,11 @@ msgid "" "flags are set or if \"info\" contains experimental semantics." msgstr "" -#: library/mailbox.rst:905 +#: library/mailbox.rst:1014 msgid "Set the flags specified by *flags* and unset all others." msgstr "" -#: library/mailbox.rst:910 +#: library/mailbox.rst:1019 msgid "" "Set the flag(s) specified by *flag* without changing other flags. To add " "more than one flag at a time, *flag* may be a string of more than one " @@ -1086,7 +1202,7 @@ msgid "" "experimental information rather than flags." msgstr "" -#: library/mailbox.rst:918 +#: library/mailbox.rst:1027 msgid "" "Unset the flag(s) specified by *flag* without changing other flags. To " "remove more than one flag at a time, *flag* maybe a string of more than one " @@ -1094,30 +1210,30 @@ msgid "" "the current \"info\" is not modified." msgstr "" -#: library/mailbox.rst:926 +#: library/mailbox.rst:1035 msgid "" "Return the delivery date of the message as a floating-point number " "representing seconds since the epoch." msgstr "" -#: library/mailbox.rst:932 +#: library/mailbox.rst:1041 msgid "" "Set the delivery date of the message to *date*, a floating-point number " "representing seconds since the epoch." msgstr "" -#: library/mailbox.rst:938 +#: library/mailbox.rst:1047 msgid "" "Return a string containing the \"info\" for a message. This is useful for " "accessing and modifying \"info\" that is experimental (i.e., not a list of " "flags)." msgstr "" -#: library/mailbox.rst:945 +#: library/mailbox.rst:1054 msgid "Set \"info\" to *info*, which should be a string." msgstr "" -#: library/mailbox.rst:947 +#: library/mailbox.rst:1056 msgid "" "When a :class:`!MaildirMessage` instance is created based upon an :class:" "`mboxMessage` or :class:`MMDFMessage` instance, the :mailheader:`Status` " @@ -1125,132 +1241,132 @@ msgid "" "take place:" msgstr "" -#: library/mailbox.rst:971 library/mailbox.rst:1093 library/mailbox.rst:1125 -#: library/mailbox.rst:1208 library/mailbox.rst:1237 library/mailbox.rst:1351 -#: library/mailbox.rst:1465 library/mailbox.rst:1497 library/mailbox.rst:1513 +#: library/mailbox.rst:1080 library/mailbox.rst:1202 library/mailbox.rst:1234 +#: library/mailbox.rst:1317 library/mailbox.rst:1346 library/mailbox.rst:1460 +#: library/mailbox.rst:1574 library/mailbox.rst:1606 library/mailbox.rst:1622 msgid "Resulting state" msgstr "" -#: library/mailbox.rst:1223 library/mailbox.rst:1351 +#: library/mailbox.rst:1332 library/mailbox.rst:1460 msgid ":class:`mboxMessage` or :class:`MMDFMessage` state" msgstr "" -#: library/mailbox.rst:973 library/mailbox.rst:1097 library/mailbox.rst:1469 +#: library/mailbox.rst:1082 library/mailbox.rst:1206 library/mailbox.rst:1578 msgid "\"cur\" subdirectory" msgstr "" -#: library/mailbox.rst:1097 library/mailbox.rst:1129 library/mailbox.rst:1469 -#: library/mailbox.rst:1501 library/mailbox.rst:1517 +#: library/mailbox.rst:1206 library/mailbox.rst:1238 library/mailbox.rst:1578 +#: library/mailbox.rst:1610 library/mailbox.rst:1626 msgid "O flag" msgstr "" -#: library/mailbox.rst:977 library/mailbox.rst:1116 library/mailbox.rst:1214 -#: library/mailbox.rst:1473 library/mailbox.rst:1521 +#: library/mailbox.rst:1086 library/mailbox.rst:1225 library/mailbox.rst:1323 +#: library/mailbox.rst:1582 library/mailbox.rst:1630 msgid "F flag" msgstr "" -#: library/mailbox.rst:962 library/mailbox.rst:994 library/mailbox.rst:1103 -#: library/mailbox.rst:1212 library/mailbox.rst:1467 library/mailbox.rst:1515 +#: library/mailbox.rst:1071 library/mailbox.rst:1103 library/mailbox.rst:1212 +#: library/mailbox.rst:1321 library/mailbox.rst:1576 library/mailbox.rst:1624 msgid "R flag" msgstr "" -#: library/mailbox.rst:1103 library/mailbox.rst:1133 library/mailbox.rst:1228 -#: library/mailbox.rst:1475 library/mailbox.rst:1505 library/mailbox.rst:1523 +#: library/mailbox.rst:1212 library/mailbox.rst:1242 library/mailbox.rst:1337 +#: library/mailbox.rst:1584 library/mailbox.rst:1614 library/mailbox.rst:1632 msgid "A flag" msgstr "" -#: library/mailbox.rst:1095 library/mailbox.rst:1467 +#: library/mailbox.rst:1204 library/mailbox.rst:1576 msgid "S flag" msgstr "" -#: library/mailbox.rst:996 library/mailbox.rst:1338 library/mailbox.rst:1471 +#: library/mailbox.rst:1105 library/mailbox.rst:1447 library/mailbox.rst:1580 msgid "T flag" msgstr "" -#: library/mailbox.rst:1099 library/mailbox.rst:1147 library/mailbox.rst:1471 -#: library/mailbox.rst:1519 +#: library/mailbox.rst:1208 library/mailbox.rst:1256 library/mailbox.rst:1580 +#: library/mailbox.rst:1628 msgid "D flag" msgstr "" -#: library/mailbox.rst:967 +#: library/mailbox.rst:1076 msgid "" "When a :class:`!MaildirMessage` instance is created based upon an :class:" "`MHMessage` instance, the following conversions take place:" msgstr "" -#: library/mailbox.rst:1110 library/mailbox.rst:1482 +#: library/mailbox.rst:1219 library/mailbox.rst:1591 msgid ":class:`MHMessage` state" msgstr "" -#: library/mailbox.rst:1114 library/mailbox.rst:1226 library/mailbox.rst:1367 -#: library/mailbox.rst:1486 +#: library/mailbox.rst:1223 library/mailbox.rst:1335 library/mailbox.rst:1476 +#: library/mailbox.rst:1595 msgid "\"unseen\" sequence" msgstr "" -#: library/mailbox.rst:990 +#: library/mailbox.rst:1099 msgid "\"cur\" subdirectory and S flag" msgstr "" -#: library/mailbox.rst:1112 library/mailbox.rst:1484 +#: library/mailbox.rst:1221 library/mailbox.rst:1593 msgid "no \"unseen\" sequence" msgstr "" -#: library/mailbox.rst:1116 library/mailbox.rst:1230 library/mailbox.rst:1488 +#: library/mailbox.rst:1225 library/mailbox.rst:1339 library/mailbox.rst:1597 msgid "\"flagged\" sequence" msgstr "" -#: library/mailbox.rst:1118 library/mailbox.rst:1228 library/mailbox.rst:1369 -#: library/mailbox.rst:1490 +#: library/mailbox.rst:1227 library/mailbox.rst:1337 library/mailbox.rst:1478 +#: library/mailbox.rst:1599 msgid "\"replied\" sequence" msgstr "" -#: library/mailbox.rst:982 +#: library/mailbox.rst:1091 msgid "" "When a :class:`!MaildirMessage` instance is created based upon a :class:" "`BabylMessage` instance, the following conversions take place:" msgstr "" -#: library/mailbox.rst:1125 library/mailbox.rst:1497 +#: library/mailbox.rst:1234 library/mailbox.rst:1606 msgid ":class:`BabylMessage` state" msgstr "" -#: library/mailbox.rst:1129 library/mailbox.rst:1336 library/mailbox.rst:1367 -#: library/mailbox.rst:1501 +#: library/mailbox.rst:1238 library/mailbox.rst:1445 library/mailbox.rst:1476 +#: library/mailbox.rst:1610 msgid "\"unseen\" label" msgstr "" -#: library/mailbox.rst:1127 library/mailbox.rst:1499 +#: library/mailbox.rst:1236 library/mailbox.rst:1608 msgid "no \"unseen\" label" msgstr "" -#: library/mailbox.rst:1342 +#: library/mailbox.rst:1451 msgid "P flag" msgstr "" -#: library/mailbox.rst:992 +#: library/mailbox.rst:1101 msgid "\"forwarded\" or \"resent\" label" msgstr "" -#: library/mailbox.rst:1133 library/mailbox.rst:1340 library/mailbox.rst:1369 -#: library/mailbox.rst:1505 +#: library/mailbox.rst:1242 library/mailbox.rst:1449 library/mailbox.rst:1478 +#: library/mailbox.rst:1614 msgid "\"answered\" label" msgstr "" -#: library/mailbox.rst:1131 library/mailbox.rst:1356 library/mailbox.rst:1503 +#: library/mailbox.rst:1240 library/mailbox.rst:1465 library/mailbox.rst:1612 msgid "\"deleted\" label" msgstr "" -#: library/mailbox.rst:1003 +#: library/mailbox.rst:1112 msgid ":class:`!mboxMessage` objects" msgstr "" -#: library/mailbox.rst:1008 +#: library/mailbox.rst:1117 msgid "" "A message with mbox-specific behaviors. Parameter *message* has the same " "meaning as with the :class:`Message` constructor." msgstr "" -#: library/mailbox.rst:1011 +#: library/mailbox.rst:1120 msgid "" "Messages in an mbox mailbox are stored together in a single file. The " "sender's envelope address and the time of delivery are typically stored in a " @@ -1261,53 +1377,53 @@ msgid "" "typically stored in :mailheader:`Status` and :mailheader:`X-Status` headers." msgstr "" -#: library/mailbox.rst:1019 +#: library/mailbox.rst:1128 msgid "Conventional flags for mbox messages are as follows:" msgstr "" -#: library/mailbox.rst:1397 +#: library/mailbox.rst:1506 msgid "O" msgstr "" -#: library/mailbox.rst:1397 +#: library/mailbox.rst:1506 msgid "Old" msgstr "" -#: library/mailbox.rst:1397 +#: library/mailbox.rst:1506 msgid "Previously detected by MUA" msgstr "" -#: library/mailbox.rst:1399 +#: library/mailbox.rst:1508 msgid "Deleted" msgstr "" -#: library/mailbox.rst:1403 +#: library/mailbox.rst:1512 msgid "A" msgstr "" -#: library/mailbox.rst:1403 +#: library/mailbox.rst:1512 msgid "Answered" msgstr "" -#: library/mailbox.rst:1406 +#: library/mailbox.rst:1515 msgid "" "The \"R\" and \"O\" flags are stored in the :mailheader:`Status` header, and " "the \"D\", \"F\", and \"A\" flags are stored in the :mailheader:`X-Status` " "header. The flags and headers typically appear in the order mentioned." msgstr "" -#: library/mailbox.rst:1039 +#: library/mailbox.rst:1148 msgid ":class:`!mboxMessage` instances offer the following methods:" msgstr "" -#: library/mailbox.rst:1416 +#: library/mailbox.rst:1525 msgid "" "Return a string representing the \"From \" line that marks the start of the " "message in an mbox mailbox. The leading \"From \" and the trailing newline " "are excluded." msgstr "" -#: library/mailbox.rst:1423 +#: library/mailbox.rst:1532 msgid "" "Set the \"From \" line to *from_*, which should be specified without a " "leading \"From \" or trailing newline. For convenience, *time_* may be " @@ -1317,7 +1433,7 @@ msgid "" "func:`time.gmtime`)." msgstr "" -#: library/mailbox.rst:1433 +#: library/mailbox.rst:1542 msgid "" "Return a string specifying the flags that are currently set. If the message " "complies with the conventional format, the result is the concatenation in " @@ -1325,28 +1441,28 @@ msgid "" "``'D'``, ``'F'``, and ``'A'``." msgstr "" -#: library/mailbox.rst:1441 +#: library/mailbox.rst:1550 msgid "" "Set the flags specified by *flags* and unset all others. Parameter *flags* " "should be the concatenation in any order of zero or more occurrences of each " "of ``'R'``, ``'O'``, ``'D'``, ``'F'``, and ``'A'``." msgstr "" -#: library/mailbox.rst:1448 +#: library/mailbox.rst:1557 msgid "" "Set the flag(s) specified by *flag* without changing other flags. To add " "more than one flag at a time, *flag* may be a string of more than one " "character." msgstr "" -#: library/mailbox.rst:1455 +#: library/mailbox.rst:1564 msgid "" "Unset the flag(s) specified by *flag* without changing other flags. To " "remove more than one flag at a time, *flag* maybe a string of more than one " "character." msgstr "" -#: library/mailbox.rst:1087 +#: library/mailbox.rst:1196 msgid "" "When an :class:`!mboxMessage` instance is created based upon a :class:" "`MaildirMessage` instance, a \"From \" line is generated based upon the :" @@ -1354,48 +1470,48 @@ msgid "" "conversions take place:" msgstr "" -#: library/mailbox.rst:1208 library/mailbox.rst:1465 +#: library/mailbox.rst:1317 library/mailbox.rst:1574 msgid ":class:`MaildirMessage` state" msgstr "" -#: library/mailbox.rst:1106 +#: library/mailbox.rst:1215 msgid "" "When an :class:`!mboxMessage` instance is created based upon an :class:" "`MHMessage` instance, the following conversions take place:" msgstr "" -#: library/mailbox.rst:1127 library/mailbox.rst:1499 +#: library/mailbox.rst:1236 library/mailbox.rst:1608 msgid "R flag and O flag" msgstr "" -#: library/mailbox.rst:1121 +#: library/mailbox.rst:1230 msgid "" "When an :class:`!mboxMessage` instance is created based upon a :class:" "`BabylMessage` instance, the following conversions take place:" msgstr "" -#: library/mailbox.rst:1136 +#: library/mailbox.rst:1245 msgid "" "When a :class:`!mboxMessage` instance is created based upon an :class:" "`MMDFMessage` instance, the \"From \" line is copied and all flags directly " "correspond:" msgstr "" -#: library/mailbox.rst:1141 +#: library/mailbox.rst:1250 msgid ":class:`MMDFMessage` state" msgstr "" -#: library/mailbox.rst:1158 +#: library/mailbox.rst:1267 msgid ":class:`!MHMessage` objects" msgstr "" -#: library/mailbox.rst:1163 +#: library/mailbox.rst:1272 msgid "" "A message with MH-specific behaviors. Parameter *message* has the same " "meaning as with the :class:`Message` constructor." msgstr "" -#: library/mailbox.rst:1166 +#: library/mailbox.rst:1275 msgid "" "MH messages do not support marks or flags in the traditional sense, but they " "do support sequences, which are logical groupings of arbitrary messages. " @@ -1404,57 +1520,57 @@ msgid "" "formats, as follows:" msgstr "" -#: library/mailbox.rst:1173 +#: library/mailbox.rst:1282 msgid "Sequence" msgstr "" -#: library/mailbox.rst:1262 +#: library/mailbox.rst:1371 msgid "unseen" msgstr "" -#: library/mailbox.rst:1262 +#: library/mailbox.rst:1371 msgid "Not read, but previously detected by MUA" msgstr "" -#: library/mailbox.rst:1177 +#: library/mailbox.rst:1286 msgid "replied" msgstr "" -#: library/mailbox.rst:1179 +#: library/mailbox.rst:1288 msgid "flagged" msgstr "" -#: library/mailbox.rst:1182 +#: library/mailbox.rst:1291 msgid ":class:`!MHMessage` instances offer the following methods:" msgstr "" -#: library/mailbox.rst:1187 +#: library/mailbox.rst:1296 msgid "Return a list of the names of sequences that include this message." msgstr "" -#: library/mailbox.rst:1192 +#: library/mailbox.rst:1301 msgid "Set the list of sequences that include this message." msgstr "" -#: library/mailbox.rst:1197 +#: library/mailbox.rst:1306 msgid "Add *sequence* to the list of sequences that include this message." msgstr "" -#: library/mailbox.rst:1202 +#: library/mailbox.rst:1311 msgid "Remove *sequence* from the list of sequences that include this message." msgstr "" -#: library/mailbox.rst:1204 +#: library/mailbox.rst:1313 msgid "" "When an :class:`!MHMessage` instance is created based upon a :class:" "`MaildirMessage` instance, the following conversions take place:" msgstr "" -#: library/mailbox.rst:1336 +#: library/mailbox.rst:1445 msgid "no S flag" msgstr "" -#: library/mailbox.rst:1217 +#: library/mailbox.rst:1326 msgid "" "When an :class:`!MHMessage` instance is created based upon an :class:" "`mboxMessage` or :class:`MMDFMessage` instance, the :mailheader:`Status` " @@ -1462,110 +1578,110 @@ msgid "" "take place:" msgstr "" -#: library/mailbox.rst:1354 +#: library/mailbox.rst:1463 msgid "no R flag" msgstr "" -#: library/mailbox.rst:1233 +#: library/mailbox.rst:1342 msgid "" "When an :class:`!MHMessage` instance is created based upon a :class:" "`BabylMessage` instance, the following conversions take place:" msgstr "" -#: library/mailbox.rst:1248 +#: library/mailbox.rst:1357 msgid ":class:`!BabylMessage` objects" msgstr "" -#: library/mailbox.rst:1253 +#: library/mailbox.rst:1362 msgid "" "A message with Babyl-specific behaviors. Parameter *message* has the same " "meaning as with the :class:`Message` constructor." msgstr "" -#: library/mailbox.rst:1256 +#: library/mailbox.rst:1365 msgid "" "Certain message labels, called :dfn:`attributes`, are defined by convention " "to have special meanings. The attributes are as follows:" msgstr "" -#: library/mailbox.rst:1260 +#: library/mailbox.rst:1369 msgid "Label" msgstr "" -#: library/mailbox.rst:1264 +#: library/mailbox.rst:1373 msgid "deleted" msgstr "" -#: library/mailbox.rst:1266 +#: library/mailbox.rst:1375 msgid "filed" msgstr "" -#: library/mailbox.rst:1266 +#: library/mailbox.rst:1375 msgid "Copied to another file or mailbox" msgstr "" -#: library/mailbox.rst:1268 +#: library/mailbox.rst:1377 msgid "answered" msgstr "" -#: library/mailbox.rst:1270 +#: library/mailbox.rst:1379 msgid "forwarded" msgstr "" -#: library/mailbox.rst:1270 +#: library/mailbox.rst:1379 msgid "Forwarded" msgstr "" -#: library/mailbox.rst:1272 +#: library/mailbox.rst:1381 msgid "edited" msgstr "" -#: library/mailbox.rst:1272 +#: library/mailbox.rst:1381 msgid "Modified by the user" msgstr "" -#: library/mailbox.rst:1274 +#: library/mailbox.rst:1383 msgid "resent" msgstr "" -#: library/mailbox.rst:1274 +#: library/mailbox.rst:1383 msgid "Resent" msgstr "" -#: library/mailbox.rst:1277 +#: library/mailbox.rst:1386 msgid "" "By default, Rmail displays only visible headers. The :class:`!BabylMessage` " "class, though, uses the original headers because they are more complete. " "Visible headers may be accessed explicitly if desired." msgstr "" -#: library/mailbox.rst:1281 +#: library/mailbox.rst:1390 msgid ":class:`!BabylMessage` instances offer the following methods:" msgstr "" -#: library/mailbox.rst:1286 +#: library/mailbox.rst:1395 msgid "Return a list of labels on the message." msgstr "" -#: library/mailbox.rst:1291 +#: library/mailbox.rst:1400 msgid "Set the list of labels on the message to *labels*." msgstr "" -#: library/mailbox.rst:1296 +#: library/mailbox.rst:1405 msgid "Add *label* to the list of labels on the message." msgstr "" -#: library/mailbox.rst:1301 +#: library/mailbox.rst:1410 msgid "Remove *label* from the list of labels on the message." msgstr "" -#: library/mailbox.rst:1306 +#: library/mailbox.rst:1415 msgid "" "Return a :class:`Message` instance whose headers are the message's visible " "headers and whose body is empty." msgstr "" -#: library/mailbox.rst:1312 +#: library/mailbox.rst:1421 msgid "" "Set the message's visible headers to be the same as the headers in " "*message*. Parameter *visible* should be a :class:`Message` instance, an :" @@ -1573,7 +1689,7 @@ msgid "" "(which should be open in text mode)." msgstr "" -#: library/mailbox.rst:1320 +#: library/mailbox.rst:1429 msgid "" "When a :class:`!BabylMessage` instance's original headers are modified, the " "visible headers are not automatically modified to correspond. This method " @@ -1586,17 +1702,17 @@ msgid "" "visible headers." msgstr "" -#: library/mailbox.rst:1330 +#: library/mailbox.rst:1439 msgid "" "When a :class:`!BabylMessage` instance is created based upon a :class:" "`MaildirMessage` instance, the following conversions take place:" msgstr "" -#: library/mailbox.rst:1342 +#: library/mailbox.rst:1451 msgid "\"forwarded\" label" msgstr "" -#: library/mailbox.rst:1345 +#: library/mailbox.rst:1454 msgid "" "When a :class:`!BabylMessage` instance is created based upon an :class:" "`mboxMessage` or :class:`MMDFMessage` instance, the :mailheader:`Status` " @@ -1604,23 +1720,23 @@ msgid "" "take place:" msgstr "" -#: library/mailbox.rst:1361 +#: library/mailbox.rst:1470 msgid "" "When a :class:`!BabylMessage` instance is created based upon an :class:" "`MHMessage` instance, the following conversions take place:" msgstr "" -#: library/mailbox.rst:1376 +#: library/mailbox.rst:1485 msgid ":class:`!MMDFMessage` objects" msgstr "" -#: library/mailbox.rst:1381 +#: library/mailbox.rst:1490 msgid "" "A message with MMDF-specific behaviors. Parameter *message* has the same " "meaning as with the :class:`Message` constructor." msgstr "" -#: library/mailbox.rst:1384 +#: library/mailbox.rst:1493 msgid "" "As with message in an mbox mailbox, MMDF messages are stored with the " "sender's address and the delivery date in an initial line beginning with " @@ -1628,19 +1744,19 @@ msgid "" "typically stored in :mailheader:`Status` and :mailheader:`X-Status` headers." msgstr "" -#: library/mailbox.rst:1389 +#: library/mailbox.rst:1498 msgid "" "Conventional flags for MMDF messages are identical to those of mbox message " "and are as follows:" msgstr "" -#: library/mailbox.rst:1410 +#: library/mailbox.rst:1519 msgid "" ":class:`!MMDFMessage` instances offer the following methods, which are " "identical to those offered by :class:`mboxMessage`:" msgstr "" -#: library/mailbox.rst:1459 +#: library/mailbox.rst:1568 msgid "" "When an :class:`!MMDFMessage` instance is created based upon a :class:" "`MaildirMessage` instance, a \"From \" line is generated based upon the :" @@ -1648,43 +1764,43 @@ msgid "" "conversions take place:" msgstr "" -#: library/mailbox.rst:1478 +#: library/mailbox.rst:1587 msgid "" "When an :class:`!MMDFMessage` instance is created based upon an :class:" "`MHMessage` instance, the following conversions take place:" msgstr "" -#: library/mailbox.rst:1493 +#: library/mailbox.rst:1602 msgid "" "When an :class:`!MMDFMessage` instance is created based upon a :class:" "`BabylMessage` instance, the following conversions take place:" msgstr "" -#: library/mailbox.rst:1508 +#: library/mailbox.rst:1617 msgid "" "When an :class:`!MMDFMessage` instance is created based upon an :class:" "`mboxMessage` instance, the \"From \" line is copied and all flags directly " "correspond:" msgstr "" -#: library/mailbox.rst:1513 +#: library/mailbox.rst:1622 msgid ":class:`mboxMessage` state" msgstr "" -#: library/mailbox.rst:1528 +#: library/mailbox.rst:1637 msgid "Exceptions" msgstr "" -#: library/mailbox.rst:1530 +#: library/mailbox.rst:1639 msgid "" "The following exception classes are defined in the :mod:`!mailbox` module:" msgstr "" -#: library/mailbox.rst:1535 +#: library/mailbox.rst:1644 msgid "The based class for all other module-specific exceptions." msgstr "" -#: library/mailbox.rst:1540 +#: library/mailbox.rst:1649 msgid "" "Raised when a mailbox is expected but is not found, such as when " "instantiating a :class:`Mailbox` subclass with a path that does not exist " @@ -1692,13 +1808,13 @@ msgid "" "that does not exist." msgstr "" -#: library/mailbox.rst:1547 +#: library/mailbox.rst:1656 msgid "" "Raised when a mailbox is not empty but is expected to be, such as when " "deleting a folder that contains messages." msgstr "" -#: library/mailbox.rst:1553 +#: library/mailbox.rst:1662 msgid "" "Raised when some mailbox-related condition beyond the control of the program " "causes it to be unable to proceed, such as when failing to acquire a lock " @@ -1706,23 +1822,23 @@ msgid "" "name already exists." msgstr "" -#: library/mailbox.rst:1561 +#: library/mailbox.rst:1670 msgid "" "Raised when the data in a file cannot be parsed, such as when an :class:`MH` " "instance attempts to read a corrupted :file:`.mh_sequences` file." msgstr "" -#: library/mailbox.rst:1568 +#: library/mailbox.rst:1677 msgid "Examples" msgstr "" -#: library/mailbox.rst:1570 +#: library/mailbox.rst:1679 msgid "" "A simple example of printing the subjects of all messages in a mailbox that " "seem interesting::" msgstr "" -#: library/mailbox.rst:1573 +#: library/mailbox.rst:1682 msgid "" "import mailbox\n" "for message in mailbox.mbox('~/mbox'):\n" @@ -1731,13 +1847,13 @@ msgid "" " print(subject)" msgstr "" -#: library/mailbox.rst:1579 +#: library/mailbox.rst:1688 msgid "" "To copy all mail from a Babyl mailbox to an MH mailbox, converting all of " "the format-specific information that can be converted::" msgstr "" -#: library/mailbox.rst:1582 +#: library/mailbox.rst:1691 msgid "" "import mailbox\n" "destination = mailbox.MH('~/Mail')\n" @@ -1748,7 +1864,7 @@ msgid "" "destination.unlock()" msgstr "" -#: library/mailbox.rst:1590 +#: library/mailbox.rst:1699 msgid "" "This example sorts mail from several mailing lists into different mailboxes, " "being careful to avoid mail corruption due to concurrent modification by " @@ -1756,7 +1872,7 @@ msgid "" "termination due to malformed messages in the mailbox::" msgstr "" -#: library/mailbox.rst:1595 +#: library/mailbox.rst:1704 msgid "" "import mailbox\n" "import email.errors\n" diff --git a/library/mailcap.po b/library/mailcap.po index 5f75badb..b04e1522 100644 --- a/library/mailcap.po +++ b/library/mailcap.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -18,126 +18,18 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" #: library/mailcap.rst:2 -msgid ":mod:`mailcap` --- Mailcap file handling" -msgstr "" - -#: library/mailcap.rst:8 -msgid "**Source code:** :source:`Lib/mailcap.py`" +msgid ":mod:`!mailcap` --- Mailcap file handling" msgstr "" #: library/mailcap.rst:10 msgid "" -"The :mod:`mailcap` module is deprecated (see :pep:`PEP 594 <594#mailcap>` " -"for details). The :mod:`mimetypes` module provides an alternative." -msgstr "" - -#: library/mailcap.rst:17 -msgid "" -"Mailcap files are used to configure how MIME-aware applications such as mail " -"readers and web browsers react to files with different MIME types. (The name " -"\"mailcap\" is derived from the phrase \"mail capability\".) For example, a " -"mailcap file might contain a line like ``video/mpeg; xmpeg %s``. Then, if " -"the user encounters an email message or web document with the MIME type :" -"mimetype:`video/mpeg`, ``%s`` will be replaced by a filename (usually one " -"belonging to a temporary file) and the :program:`xmpeg` program can be " -"automatically started to view the file." -msgstr "" - -#: library/mailcap.rst:26 -msgid "" -"The mailcap format is documented in :rfc:`1524`, \"A User Agent " -"Configuration Mechanism For Multimedia Mail Format Information\", but is not " -"an internet standard. However, mailcap files are supported on most Unix " -"systems." -msgstr "" - -#: library/mailcap.rst:33 -msgid "" -"Return a 2-tuple; the first element is a string containing the command line " -"to be executed (which can be passed to :func:`os.system`), and the second " -"element is the mailcap entry for a given MIME type. If no matching MIME " -"type can be found, ``(None, None)`` is returned." -msgstr "" - -#: library/mailcap.rst:38 -msgid "" -"*key* is the name of the field desired, which represents the type of " -"activity to be performed; the default value is 'view', since in the most " -"common case you simply want to view the body of the MIME-typed data. Other " -"possible values might be 'compose' and 'edit', if you wanted to create a new " -"body of the given MIME type or alter the existing body data. See :rfc:" -"`1524` for a complete list of these fields." -msgstr "" - -#: library/mailcap.rst:45 -msgid "" -"*filename* is the filename to be substituted for ``%s`` in the command line; " -"the default value is ``'/dev/null'`` which is almost certainly not what you " -"want, so usually you'll override it by specifying a filename." -msgstr "" - -#: library/mailcap.rst:49 -msgid "" -"*plist* can be a list containing named parameters; the default value is " -"simply an empty list. Each entry in the list must be a string containing " -"the parameter name, an equals sign (``'='``), and the parameter's value. " -"Mailcap entries can contain named parameters like ``%{foo}``, which will be " -"replaced by the value of the parameter named 'foo'. For example, if the " -"command line ``showpartial %{id} %{number} %{total}`` was in a mailcap file, " -"and *plist* was set to ``['id=1', 'number=2', 'total=3']``, the resulting " -"command line would be ``'showpartial 1 2 3'``." -msgstr "" - -#: library/mailcap.rst:58 -msgid "" -"In a mailcap file, the \"test\" field can optionally be specified to test " -"some external condition (such as the machine architecture, or the window " -"system in use) to determine whether or not the mailcap line applies. :func:" -"`findmatch` will automatically check such conditions and skip the entry if " -"the check fails." -msgstr "" - -#: library/mailcap.rst:65 -msgid "" -"To prevent security issues with shell metacharacters (symbols that have " -"special effects in a shell command line), ``findmatch`` will refuse to " -"inject ASCII characters other than alphanumerics and ``@+=:,./-_`` into the " -"returned command line." -msgstr "" - -#: library/mailcap.rst:70 -msgid "" -"If a disallowed character appears in *filename*, ``findmatch`` will always " -"return ``(None, None)`` as if no entry was found. If such a character " -"appears elsewhere (a value in *plist* or in *MIMEtype*), ``findmatch`` will " -"ignore all mailcap entries which use that value. A :mod:`warning ` " -"will be raised in either case." -msgstr "" - -#: library/mailcap.rst:78 -msgid "" -"Returns a dictionary mapping MIME types to a list of mailcap file entries. " -"This dictionary must be passed to the :func:`findmatch` function. An entry " -"is stored as a list of dictionaries, but it shouldn't be necessary to know " -"the details of this representation." -msgstr "" - -#: library/mailcap.rst:83 -msgid "" -"The information is derived from all of the mailcap files found on the " -"system. Settings in the user's mailcap file :file:`$HOME/.mailcap` will " -"override settings in the system mailcap files :file:`/etc/mailcap`, :file:`/" -"usr/etc/mailcap`, and :file:`/usr/local/etc/mailcap`." -msgstr "" - -#: library/mailcap.rst:88 -msgid "An example usage::" +"This module is no longer part of the Python standard library. It was :ref:" +"`removed in Python 3.13 ` after being deprecated in " +"Python 3.11. The removal was decided in :pep:`594`." msgstr "" -#: library/mailcap.rst:90 +#: library/mailcap.rst:14 msgid "" -">>> import mailcap\n" -">>> d = mailcap.getcaps()\n" -">>> mailcap.findmatch(d, 'video/mpeg', filename='tmp1223')\n" -"('xmpeg tmp1223', {'view': 'xmpeg %s'})" +"The last version of Python that provided the :mod:`!mailcap` module was " +"`Python 3.12 `_." msgstr "" diff --git a/library/markup.po b/library/markup.po index 6b9b7f1a..64b4905f 100644 --- a/library/markup.po +++ b/library/markup.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" diff --git a/library/marshal.po b/library/marshal.po index 8fdd650f..e6d91d5e 100644 --- a/library/marshal.po +++ b/library/marshal.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -38,134 +38,145 @@ msgid "" "and :mod:`shelve`. The :mod:`marshal` module exists mainly to support " "reading and writing the \"pseudo-compiled\" code for Python modules of :file:" "`.pyc` files. Therefore, the Python maintainers reserve the right to modify " -"the marshal format in backward incompatible ways should the need arise. If " -"you're serializing and de-serializing Python objects, use the :mod:`pickle` " -"module instead -- the performance is comparable, version independence is " -"guaranteed, and pickle supports a substantially wider range of objects than " -"marshal." +"the marshal format in backward incompatible ways should the need arise. The " +"format of code objects is not compatible between Python versions, even if " +"the version of the format is the same. De-serializing a code object in the " +"incorrect Python version has undefined behavior. If you're serializing and " +"de-serializing Python objects, use the :mod:`pickle` module instead -- the " +"performance is comparable, version independence is guaranteed, and pickle " +"supports a substantially wider range of objects than marshal." msgstr "" -#: library/marshal.rst:33 +#: library/marshal.rst:37 msgid "" "The :mod:`marshal` module is not intended to be secure against erroneous or " "maliciously constructed data. Never unmarshal data received from an " "untrusted or unauthenticated source." msgstr "" -#: library/marshal.rst:39 +#: library/marshal.rst:43 msgid "" "Not all Python object types are supported; in general, only objects whose " "value is independent from a particular invocation of Python can be written " "and read by this module. The following types are supported: booleans, " "integers, floating-point numbers, complex numbers, strings, bytes, " -"bytearrays, tuples, lists, sets, frozensets, dictionaries, and code objects, " -"where it should be understood that tuples, lists, sets, frozensets and " -"dictionaries are only supported as long as the values contained therein are " -"themselves supported. The singletons :const:`None`, :const:`Ellipsis` and :" -"exc:`StopIteration` can also be marshalled and unmarshalled. For format " -"*version* lower than 3, recursive lists, sets and dictionaries cannot be " -"written (see below)." +"bytearrays, tuples, lists, sets, frozensets, dictionaries, and code objects " +"(if *allow_code* is true), where it should be understood that tuples, lists, " +"sets, frozensets and dictionaries are only supported as long as the values " +"contained therein are themselves supported. The singletons :const:`None`, :" +"const:`Ellipsis` and :exc:`StopIteration` can also be marshalled and " +"unmarshalled. For format *version* lower than 3, recursive lists, sets and " +"dictionaries cannot be written (see below)." msgstr "" -#: library/marshal.rst:51 +#: library/marshal.rst:56 msgid "" "There are functions that read/write files as well as functions operating on " "bytes-like objects." msgstr "" -#: library/marshal.rst:54 +#: library/marshal.rst:59 msgid "The module defines these functions:" msgstr "" -#: library/marshal.rst:59 +#: library/marshal.rst:64 msgid "" "Write the value on the open file. The value must be a supported type. The " "file must be a writeable :term:`binary file`." msgstr "" -#: library/marshal.rst:62 +#: library/marshal.rst:67 msgid "" "If the value has (or contains an object that has) an unsupported type, a :" "exc:`ValueError` exception is raised --- but garbage data will also be " "written to the file. The object will not be properly read back by :func:" -"`load`." +"`load`. :ref:`Code objects ` are only supported if " +"*allow_code* is true." msgstr "" -#: library/marshal.rst:66 +#: library/marshal.rst:72 msgid "" "The *version* argument indicates the data format that ``dump`` should use " "(see below)." msgstr "" -#: library/marshal.rst:101 +#: library/marshal.rst:115 msgid "" "Raises an :ref:`auditing event ` ``marshal.dumps`` with arguments " "``value``, ``version``." msgstr "" -#: library/marshal.rst:74 +#: library/marshal.rst:101 library/marshal.rst:135 +msgid "Added the *allow_code* parameter." +msgstr "" + +#: library/marshal.rst:83 msgid "" "Read one value from the open file and return it. If no valid value is read " "(e.g. because the data has a different Python version's incompatible marshal " -"format), raise :exc:`EOFError`, :exc:`ValueError` or :exc:`TypeError`. The " -"file must be a readable :term:`binary file`." +"format), raise :exc:`EOFError`, :exc:`ValueError` or :exc:`TypeError`. :ref:" +"`Code objects ` are only supported if *allow_code* is true. " +"The file must be a readable :term:`binary file`." msgstr "" -#: library/marshal.rst:79 +#: library/marshal.rst:89 msgid "" "Raises an :ref:`auditing event ` ``marshal.load`` with no " "arguments." msgstr "" -#: library/marshal.rst:83 +#: library/marshal.rst:93 msgid "" "If an object containing an unsupported type was marshalled with :func:" "`dump`, :func:`load` will substitute ``None`` for the unmarshallable type." msgstr "" -#: library/marshal.rst:88 +#: library/marshal.rst:98 msgid "" "This call used to raise a ``code.__new__`` audit event for each code object. " "Now it raises a single ``marshal.load`` event for the entire load operation." msgstr "" -#: library/marshal.rst:94 +#: library/marshal.rst:107 msgid "" "Return the bytes object that would be written to a file by ``dump(value, " "file)``. The value must be a supported type. Raise a :exc:`ValueError` " -"exception if value has (or contains an object that has) an unsupported type." +"exception if value has (or contains an object that has) an unsupported " +"type. :ref:`Code objects ` are only supported if *allow_code* " +"is true." msgstr "" -#: library/marshal.rst:98 +#: library/marshal.rst:112 msgid "" "The *version* argument indicates the data format that ``dumps`` should use " "(see below)." msgstr "" -#: library/marshal.rst:106 +#: library/marshal.rst:123 msgid "" "Convert the :term:`bytes-like object` to a value. If no valid value is " -"found, raise :exc:`EOFError`, :exc:`ValueError` or :exc:`TypeError`. Extra " -"bytes in the input are ignored." +"found, raise :exc:`EOFError`, :exc:`ValueError` or :exc:`TypeError`. :ref:" +"`Code objects ` are only supported if *allow_code* is true. " +"Extra bytes in the input are ignored." msgstr "" -#: library/marshal.rst:110 +#: library/marshal.rst:128 msgid "" "Raises an :ref:`auditing event ` ``marshal.loads`` with argument " "``bytes``." msgstr "" -#: library/marshal.rst:114 +#: library/marshal.rst:132 msgid "" "This call used to raise a ``code.__new__`` audit event for each code object. " "Now it raises a single ``marshal.loads`` event for the entire load operation." msgstr "" -#: library/marshal.rst:118 +#: library/marshal.rst:139 msgid "In addition, the following constants are defined:" msgstr "" -#: library/marshal.rst:122 +#: library/marshal.rst:143 msgid "" "Indicates the format that the module uses. Version 0 is the historical " "format, version 1 shares interned strings and version 2 uses a binary format " @@ -173,11 +184,11 @@ msgid "" "recursion. The current version is 4." msgstr "" -#: library/marshal.rst:130 +#: library/marshal.rst:151 msgid "Footnotes" msgstr "" -#: library/marshal.rst:131 +#: library/marshal.rst:152 msgid "" "The name of this module stems from a bit of terminology used by the " "designers of Modula-3 (amongst others), who use the term \"marshalling\" for " @@ -198,14 +209,14 @@ msgstr "" msgid "shelve" msgstr "" -#: library/marshal.rst:37 +#: library/marshal.rst:41 msgid "object" msgstr "" -#: library/marshal.rst:37 +#: library/marshal.rst:41 msgid "code" msgstr "" -#: library/marshal.rst:37 +#: library/marshal.rst:41 msgid "code object" msgstr "" diff --git a/library/math.po b/library/math.po index 327ed307..6316ef0b 100644 --- a/library/math.po +++ b/library/math.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -46,69 +46,686 @@ msgid "" msgstr "" #: library/math.rst:30 -msgid "Number-theoretic and representation functions" +msgid "**Number-theoretic functions**" +msgstr "" + +#: library/math.rst:32 +msgid ":func:`comb(n, k) `" +msgstr "" + +#: library/math.rst:32 +msgid "" +"Number of ways to choose *k* items from *n* items without repetition and " +"without order" +msgstr "" + +#: library/math.rst:33 +msgid ":func:`factorial(n) `" +msgstr "" + +#: library/math.rst:33 +msgid "*n* factorial" msgstr "" #: library/math.rst:34 +msgid ":func:`gcd(*integers) `" +msgstr "" + +#: library/math.rst:34 +msgid "Greatest common divisor of the integer arguments" +msgstr "" + +#: library/math.rst:35 +msgid ":func:`isqrt(n) `" +msgstr "" + +#: library/math.rst:35 +msgid "Integer square root of a nonnegative integer *n*" +msgstr "" + +#: library/math.rst:36 +msgid ":func:`lcm(*integers) `" +msgstr "" + +#: library/math.rst:36 +msgid "Least common multiple of the integer arguments" +msgstr "" + +#: library/math.rst:37 +msgid ":func:`perm(n, k) `" +msgstr "" + +#: library/math.rst:37 msgid "" -"Return the ceiling of *x*, the smallest integer greater than or equal to " -"*x*. If *x* is not a float, delegates to :meth:`x.__ceil__ `, which should return an :class:`~numbers.Integral` value." +"Number of ways to choose *k* items from *n* items without repetition and " +"with order" +msgstr "" + +#: library/math.rst:39 +msgid "**Floating point arithmetic**" msgstr "" #: library/math.rst:41 +msgid ":func:`ceil(x) `" +msgstr "" + +#: library/math.rst:41 +msgid "Ceiling of *x*, the smallest integer greater than or equal to *x*" +msgstr "" + +#: library/math.rst:42 +msgid ":func:`fabs(x) `" +msgstr "" + +#: library/math.rst:42 +msgid "Absolute value of *x*" +msgstr "" + +#: library/math.rst:43 +msgid ":func:`floor(x) `" +msgstr "" + +#: library/math.rst:43 +msgid "Floor of *x*, the largest integer less than or equal to *x*" +msgstr "" + +#: library/math.rst:44 +msgid ":func:`fma(x, y, z) `" +msgstr "" + +#: library/math.rst:44 +msgid "Fused multiply-add operation: ``(x * y) + z``" +msgstr "" + +#: library/math.rst:45 +msgid ":func:`fmod(x, y) `" +msgstr "" + +#: library/math.rst:45 +msgid "Remainder of division ``x / y``" +msgstr "" + +#: library/math.rst:46 +msgid ":func:`modf(x) `" +msgstr "" + +#: library/math.rst:46 +msgid "Fractional and integer parts of *x*" +msgstr "" + +#: library/math.rst:47 +msgid ":func:`remainder(x, y) `" +msgstr "" + +#: library/math.rst:47 +msgid "Remainder of *x* with respect to *y*" +msgstr "" + +#: library/math.rst:48 +msgid ":func:`trunc(x) `" +msgstr "" + +#: library/math.rst:48 +msgid "Integer part of *x*" +msgstr "" + +#: library/math.rst:50 +msgid "**Floating point manipulation functions**" +msgstr "" + +#: library/math.rst:52 +msgid ":func:`copysign(x, y) `" +msgstr "" + +#: library/math.rst:52 +msgid "Magnitude (absolute value) of *x* with the sign of *y*" +msgstr "" + +#: library/math.rst:53 +msgid ":func:`frexp(x) `" +msgstr "" + +#: library/math.rst:53 +msgid "Mantissa and exponent of *x*" +msgstr "" + +#: library/math.rst:54 +msgid ":func:`isclose(a, b, rel_tol, abs_tol) `" +msgstr "" + +#: library/math.rst:54 +msgid "Check if the values *a* and *b* are close to each other" +msgstr "" + +#: library/math.rst:55 +msgid ":func:`isfinite(x) `" +msgstr "" + +#: library/math.rst:55 +msgid "Check if *x* is neither an infinity nor a NaN" +msgstr "" + +#: library/math.rst:56 +msgid ":func:`isinf(x) `" +msgstr "" + +#: library/math.rst:56 +msgid "Check if *x* is a positive or negative infinity" +msgstr "" + +#: library/math.rst:57 +msgid ":func:`isnan(x) `" +msgstr "" + +#: library/math.rst:57 +msgid "Check if *x* is a NaN (not a number)" +msgstr "" + +#: library/math.rst:58 +msgid ":func:`ldexp(x, i) `" +msgstr "" + +#: library/math.rst:58 +msgid "``x * (2**i)``, inverse of function :func:`frexp`" +msgstr "" + +#: library/math.rst:59 +msgid ":func:`nextafter(x, y, steps) `" +msgstr "" + +#: library/math.rst:59 +msgid "Floating-point value *steps* steps after *x* towards *y*" +msgstr "" + +#: library/math.rst:60 +msgid ":func:`ulp(x) `" +msgstr "" + +#: library/math.rst:60 +msgid "Value of the least significant bit of *x*" +msgstr "" + +#: library/math.rst:62 +msgid "**Power, exponential and logarithmic functions**" +msgstr "" + +#: library/math.rst:64 +msgid ":func:`cbrt(x) `" +msgstr "" + +#: library/math.rst:64 +msgid "Cube root of *x*" +msgstr "" + +#: library/math.rst:65 +msgid ":func:`exp(x) `" +msgstr "" + +#: library/math.rst:65 +msgid "*e* raised to the power *x*" +msgstr "" + +#: library/math.rst:66 +msgid ":func:`exp2(x) `" +msgstr "" + +#: library/math.rst:66 +msgid "*2* raised to the power *x*" +msgstr "" + +#: library/math.rst:67 +msgid ":func:`expm1(x) `" +msgstr "" + +#: library/math.rst:67 +msgid "*e* raised to the power *x*, minus 1" +msgstr "" + +#: library/math.rst:68 +msgid ":func:`log(x, base) `" +msgstr "" + +#: library/math.rst:68 +msgid "Logarithm of *x* to the given base (*e* by default)" +msgstr "" + +#: library/math.rst:69 +msgid ":func:`log1p(x) `" +msgstr "" + +#: library/math.rst:69 +msgid "Natural logarithm of *1+x* (base *e*)" +msgstr "" + +#: library/math.rst:70 +msgid ":func:`log2(x) `" +msgstr "" + +#: library/math.rst:70 +msgid "Base-2 logarithm of *x*" +msgstr "" + +#: library/math.rst:71 +msgid ":func:`log10(x) `" +msgstr "" + +#: library/math.rst:71 +msgid "Base-10 logarithm of *x*" +msgstr "" + +#: library/math.rst:72 +msgid ":func:`pow(x, y) `" +msgstr "" + +#: library/math.rst:72 +msgid "*x* raised to the power *y*" +msgstr "" + +#: library/math.rst:73 +msgid ":func:`sqrt(x) `" +msgstr "" + +#: library/math.rst:73 +msgid "Square root of *x*" +msgstr "" + +#: library/math.rst:75 +msgid "**Summation and product functions**" +msgstr "" + +#: library/math.rst:77 +msgid ":func:`dist(p, q) `" +msgstr "" + +#: library/math.rst:77 +msgid "" +"Euclidean distance between two points *p* and *q* given as an iterable of " +"coordinates" +msgstr "" + +#: library/math.rst:78 +msgid ":func:`fsum(iterable) `" +msgstr "" + +#: library/math.rst:78 +msgid "Sum of values in the input *iterable*" +msgstr "" + +#: library/math.rst:79 +msgid ":func:`hypot(*coordinates) `" +msgstr "" + +#: library/math.rst:79 +msgid "Euclidean norm of an iterable of coordinates" +msgstr "" + +#: library/math.rst:80 +msgid ":func:`prod(iterable, start) `" +msgstr "" + +#: library/math.rst:80 +msgid "Product of elements in the input *iterable* with a *start* value" +msgstr "" + +#: library/math.rst:81 +msgid ":func:`sumprod(p, q) `" +msgstr "" + +#: library/math.rst:81 +msgid "Sum of products from two iterables *p* and *q*" +msgstr "" + +#: library/math.rst:83 +msgid "**Angular conversion**" +msgstr "" + +#: library/math.rst:85 +msgid ":func:`degrees(x) `" +msgstr "" + +#: library/math.rst:85 +msgid "Convert angle *x* from radians to degrees" +msgstr "" + +#: library/math.rst:86 +msgid ":func:`radians(x) `" +msgstr "" + +#: library/math.rst:86 +msgid "Convert angle *x* from degrees to radians" +msgstr "" + +#: library/math.rst:88 +msgid "**Trigonometric functions**" +msgstr "" + +#: library/math.rst:90 +msgid ":func:`acos(x) `" +msgstr "" + +#: library/math.rst:90 +msgid "Arc cosine of *x*" +msgstr "" + +#: library/math.rst:91 +msgid ":func:`asin(x) `" +msgstr "" + +#: library/math.rst:91 +msgid "Arc sine of *x*" +msgstr "" + +#: library/math.rst:92 +msgid ":func:`atan(x) `" +msgstr "" + +#: library/math.rst:92 +msgid "Arc tangent of *x*" +msgstr "" + +#: library/math.rst:93 +msgid ":func:`atan2(y, x) `" +msgstr "" + +#: library/math.rst:93 +msgid "``atan(y / x)``" +msgstr "" + +#: library/math.rst:94 +msgid ":func:`cos(x) `" +msgstr "" + +#: library/math.rst:94 +msgid "Cosine of *x*" +msgstr "" + +#: library/math.rst:95 +msgid ":func:`sin(x) `" +msgstr "" + +#: library/math.rst:95 +msgid "Sine of *x*" +msgstr "" + +#: library/math.rst:96 +msgid ":func:`tan(x) `" +msgstr "" + +#: library/math.rst:96 +msgid "Tangent of *x*" +msgstr "" + +#: library/math.rst:98 +msgid "**Hyperbolic functions**" +msgstr "" + +#: library/math.rst:100 +msgid ":func:`acosh(x) `" +msgstr "" + +#: library/math.rst:100 +msgid "Inverse hyperbolic cosine of *x*" +msgstr "" + +#: library/math.rst:101 +msgid ":func:`asinh(x) `" +msgstr "" + +#: library/math.rst:101 +msgid "Inverse hyperbolic sine of *x*" +msgstr "" + +#: library/math.rst:102 +msgid ":func:`atanh(x) `" +msgstr "" + +#: library/math.rst:102 +msgid "Inverse hyperbolic tangent of *x*" +msgstr "" + +#: library/math.rst:103 +msgid ":func:`cosh(x) `" +msgstr "" + +#: library/math.rst:103 +msgid "Hyperbolic cosine of *x*" +msgstr "" + +#: library/math.rst:104 +msgid ":func:`sinh(x) `" +msgstr "" + +#: library/math.rst:104 +msgid "Hyperbolic sine of *x*" +msgstr "" + +#: library/math.rst:105 +msgid ":func:`tanh(x) `" +msgstr "" + +#: library/math.rst:105 +msgid "Hyperbolic tangent of *x*" +msgstr "" + +#: library/math.rst:107 +msgid "**Special functions**" +msgstr "" + +#: library/math.rst:109 +msgid ":func:`erf(x) `" +msgstr "" + +#: library/math.rst:109 +msgid "`Error function `_ at *x*" +msgstr "" + +#: library/math.rst:110 +msgid ":func:`erfc(x) `" +msgstr "" + +#: library/math.rst:110 +msgid "" +"`Complementary error function `_ at *x*" +msgstr "" + +#: library/math.rst:111 +msgid ":func:`gamma(x) `" +msgstr "" + +#: library/math.rst:111 +msgid "`Gamma function `_ at *x*" +msgstr "" + +#: library/math.rst:112 +msgid ":func:`lgamma(x) `" +msgstr "" + +#: library/math.rst:112 +msgid "" +"Natural logarithm of the absolute value of the `Gamma function `_ at *x*" +msgstr "" + +#: library/math.rst:114 +msgid "**Constants**" +msgstr "" + +#: library/math.rst:116 +msgid ":data:`pi`" +msgstr "" + +#: library/math.rst:116 +msgid "*π* = 3.141592..." +msgstr "" + +#: library/math.rst:117 +msgid ":data:`e`" +msgstr "" + +#: library/math.rst:117 +msgid "*e* = 2.718281..." +msgstr "" + +#: library/math.rst:118 +msgid ":data:`tau`" +msgstr "" + +#: library/math.rst:118 +msgid "*τ* = 2\\ *π* = 6.283185..." +msgstr "" + +#: library/math.rst:119 +msgid ":data:`inf`" +msgstr "" + +#: library/math.rst:119 +msgid "Positive infinity" +msgstr "" + +#: library/math.rst:120 +msgid ":data:`nan`" +msgstr "" + +#: library/math.rst:120 +msgid "\"Not a number\" (NaN)" +msgstr "" + +#: library/math.rst:125 +msgid "Number-theoretic functions" +msgstr "" + +#: library/math.rst:129 msgid "" "Return the number of ways to choose *k* items from *n* items without " "repetition and without order." msgstr "" -#: library/math.rst:44 +#: library/math.rst:132 msgid "" "Evaluates to ``n! / (k! * (n - k)!)`` when ``k <= n`` and evaluates to zero " "when ``k > n``." msgstr "" -#: library/math.rst:47 +#: library/math.rst:135 msgid "" "Also called the binomial coefficient because it is equivalent to the " "coefficient of k-th term in polynomial expansion of ``(1 + x)ⁿ``." msgstr "" -#: library/math.rst:261 +#: library/math.rst:205 msgid "" "Raises :exc:`TypeError` if either of the arguments are not integers. Raises :" "exc:`ValueError` if either of the arguments are negative." msgstr "" -#: library/math.rst:59 +#: library/math.rst:147 msgid "" -"Return a float with the magnitude (absolute value) of *x* but the sign of " -"*y*. On platforms that support signed zeros, ``copysign(1.0, -0.0)`` " -"returns *-1.0*." +"Return *n* factorial as an integer. Raises :exc:`ValueError` if *n* is not " +"integral or is negative." msgstr "" -#: library/math.rst:66 -msgid "Return the absolute value of *x*." +#: library/math.rst:150 +msgid "Floats with integral values (like ``5.0``) are no longer accepted." msgstr "" -#: library/math.rst:71 +#: library/math.rst:156 msgid "" -"Return *n* factorial as an integer. Raises :exc:`ValueError` if *n* is not " -"integral or is negative." +"Return the greatest common divisor of the specified integer arguments. If " +"any of the arguments is nonzero, then the returned value is the largest " +"positive integer that is a divisor of all arguments. If all arguments are " +"zero, then the returned value is ``0``. ``gcd()`` without arguments returns " +"``0``." msgstr "" -#: library/math.rst:74 -msgid "Accepting floats with integral values (like ``5.0``) is deprecated." +#: library/math.rst:164 +msgid "" +"Added support for an arbitrary number of arguments. Formerly, only two " +"arguments were supported." msgstr "" -#: library/math.rst:80 +#: library/math.rst:171 +msgid "" +"Return the integer square root of the nonnegative integer *n*. This is the " +"floor of the exact square root of *n*, or equivalently the greatest integer " +"*a* such that *a*\\ ² |nbsp| ≤ |nbsp| *n*." +msgstr "" + +#: library/math.rst:175 +msgid "" +"For some applications, it may be more convenient to have the least integer " +"*a* such that *n* |nbsp| ≤ |nbsp| *a*\\ ², or in other words the ceiling of " +"the exact square root of *n*. For positive *n*, this can be computed using " +"``a = 1 + isqrt(n - 1)``." +msgstr "" + +#: library/math.rst:185 +msgid "" +"Return the least common multiple of the specified integer arguments. If all " +"arguments are nonzero, then the returned value is the smallest positive " +"integer that is a multiple of all arguments. If any of the arguments is " +"zero, then the returned value is ``0``. ``lcm()`` without arguments returns " +"``1``." +msgstr "" + +#: library/math.rst:196 +msgid "" +"Return the number of ways to choose *k* items from *n* items without " +"repetition and with order." +msgstr "" + +#: library/math.rst:199 +msgid "" +"Evaluates to ``n! / (n - k)!`` when ``k <= n`` and evaluates to zero when " +"``k > n``." +msgstr "" + +#: library/math.rst:202 +msgid "" +"If *k* is not specified or is ``None``, then *k* defaults to *n* and the " +"function returns ``n!``." +msgstr "" + +#: library/math.rst:212 +msgid "Floating point arithmetic" +msgstr "" + +#: library/math.rst:216 +msgid "" +"Return the ceiling of *x*, the smallest integer greater than or equal to " +"*x*. If *x* is not a float, delegates to :meth:`x.__ceil__ `, which should return an :class:`~numbers.Integral` value." +msgstr "" + +#: library/math.rst:223 +msgid "Return the absolute value of *x*." +msgstr "" + +#: library/math.rst:228 msgid "" "Return the floor of *x*, the largest integer less than or equal to *x*. If " "*x* is not a float, delegates to :meth:`x.__floor__ `, " "which should return an :class:`~numbers.Integral` value." msgstr "" -#: library/math.rst:87 +#: library/math.rst:235 +msgid "" +"Fused multiply-add operation. Return ``(x * y) + z``, computed as though " +"with infinite precision and range followed by a single round to the " +"``float`` format. This operation often provides better accuracy than the " +"direct expression ``(x * y) + z``." +msgstr "" + +#: library/math.rst:240 +msgid "" +"This function follows the specification of the fusedMultiplyAdd operation " +"described in the IEEE 754 standard. The standard leaves one case " +"implementation-defined, namely the result of ``fma(0, inf, nan)`` and " +"``fma(inf, 0, nan)``. In these cases, ``math.fma`` returns a NaN, and does " +"not raise any exception." +msgstr "" + +#: library/math.rst:251 msgid "" "Return the floating-point remainder of ``x / y``, as defined by the platform " "C library function ``fmod(x, y)``. Note that the Python expression ``x % y`` " @@ -124,66 +741,103 @@ msgid "" "floats, while Python's ``x % y`` is preferred when working with integers." msgstr "" -#: library/math.rst:103 +#: library/math.rst:267 msgid "" -"Return the mantissa and exponent of *x* as the pair ``(m, e)``. *m* is a " -"float and *e* is an integer such that ``x == m * 2**e`` exactly. If *x* is " -"zero, returns ``(0.0, 0)``, otherwise ``0.5 <= abs(m) < 1``. This is used " -"to \"pick apart\" the internal representation of a float in a portable way." +"Return the fractional and integer parts of *x*. Both results carry the sign " +"of *x* and are floats." msgstr "" -#: library/math.rst:111 +#: library/math.rst:270 msgid "" -"Return an accurate floating-point sum of values in the iterable. Avoids " -"loss of precision by tracking multiple intermediate partial sums." +"Note that :func:`modf` has a different call/return pattern than its C " +"equivalents: it takes a single argument and return a pair of values, rather " +"than returning its second return value through an 'output parameter' (there " +"is no such thing in Python)." msgstr "" -#: library/math.rst:114 +#: library/math.rst:278 msgid "" -"The algorithm's accuracy depends on IEEE-754 arithmetic guarantees and the " -"typical case where the rounding mode is half-even. On some non-Windows " -"builds, the underlying C library uses extended precision addition and may " -"occasionally double-round an intermediate sum causing it to be off in its " -"least significant bit." +"Return the IEEE 754-style remainder of *x* with respect to *y*. For finite " +"*x* and finite nonzero *y*, this is the difference ``x - n*y``, where ``n`` " +"is the closest integer to the exact value of the quotient ``x / y``. If " +"``x / y`` is exactly halfway between two consecutive integers, the nearest " +"*even* integer is used for ``n``. The remainder ``r = remainder(x, y)`` " +"thus always satisfies ``abs(r) <= 0.5 * abs(y)``." msgstr "" -#: library/math.rst:120 +#: library/math.rst:285 msgid "" -"For further discussion and two alternative approaches, see the `ASPN " -"cookbook recipes for accurate floating-point summation `_\\." +"Special cases follow IEEE 754: in particular, ``remainder(x, math.inf)`` is " +"*x* for any finite *x*, and ``remainder(x, 0)`` and ``remainder(math.inf, " +"x)`` raise :exc:`ValueError` for any non-NaN *x*. If the result of the " +"remainder operation is zero, that zero will have the same sign as *x*." +msgstr "" + +#: library/math.rst:291 +msgid "" +"On platforms using IEEE 754 binary floating point, the result of this " +"operation is always exactly representable: no rounding error is introduced." +msgstr "" + +#: library/math.rst:299 +msgid "" +"Return *x* with the fractional part removed, leaving the integer part. This " +"rounds toward 0: ``trunc()`` is equivalent to :func:`floor` for positive " +"*x*, and equivalent to :func:`ceil` for negative *x*. If *x* is not a float, " +"delegates to :meth:`x.__trunc__ `, which should return an :" +"class:`~numbers.Integral` value." +msgstr "" + +#: library/math.rst:306 +msgid "" +"For the :func:`ceil`, :func:`floor`, and :func:`modf` functions, note that " +"*all* floating-point numbers of sufficiently large magnitude are exact " +"integers. Python floats typically carry no more than 53 bits of precision " +"(the same as the platform C double type), in which case any float *x* with " +"``abs(x) >= 2**52`` necessarily has no fractional bits." +msgstr "" + +#: library/math.rst:314 +msgid "Floating point manipulation functions" +msgstr "" + +#: library/math.rst:318 +msgid "" +"Return a float with the magnitude (absolute value) of *x* but the sign of " +"*y*. On platforms that support signed zeros, ``copysign(1.0, -0.0)`` " +"returns *-1.0*." msgstr "" -#: library/math.rst:127 +#: library/math.rst:325 msgid "" -"Return the greatest common divisor of the specified integer arguments. If " -"any of the arguments is nonzero, then the returned value is the largest " -"positive integer that is a divisor of all arguments. If all arguments are " -"zero, then the returned value is ``0``. ``gcd()`` without arguments returns " -"``0``." +"Return the mantissa and exponent of *x* as the pair ``(m, e)``. *m* is a " +"float and *e* is an integer such that ``x == m * 2**e`` exactly. If *x* is " +"zero, returns ``(0.0, 0)``, otherwise ``0.5 <= abs(m) < 1``. This is used " +"to \"pick apart\" the internal representation of a float in a portable way." msgstr "" -#: library/math.rst:135 +#: library/math.rst:330 msgid "" -"Added support for an arbitrary number of arguments. Formerly, only two " -"arguments were supported." +"Note that :func:`frexp` has a different call/return pattern than its C " +"equivalents: it takes a single argument and return a pair of values, rather " +"than returning its second return value through an 'output parameter' (there " +"is no such thing in Python)." msgstr "" -#: library/math.rst:142 +#: library/math.rst:337 msgid "" "Return ``True`` if the values *a* and *b* are close to each other and " "``False`` otherwise." msgstr "" -#: library/math.rst:145 +#: library/math.rst:340 msgid "" "Whether or not two values are considered close is determined according to " "given absolute and relative tolerances. If no errors occur, the result will " "be: ``abs(a-b) <= max(rel_tol * max(abs(a), abs(b)), abs_tol)``." msgstr "" -#: library/math.rst:149 +#: library/math.rst:344 msgid "" "*rel_tol* is the relative tolerance -- it is the maximum allowed difference " "between *a* and *b*, relative to the larger absolute value of *a* or *b*. " @@ -193,7 +847,7 @@ msgid "" "``1.0``." msgstr "" -#: library/math.rst:156 +#: library/math.rst:351 msgid "" "*abs_tol* is the absolute tolerance; it defaults to ``0.0`` and it must be " "nonnegative. When comparing ``x`` to ``0.0``, ``isclose(x, 0)`` is computed " @@ -202,7 +856,7 @@ msgid "" "argument to the call." msgstr "" -#: library/math.rst:162 +#: library/math.rst:357 msgid "" "The IEEE 754 special values of ``NaN``, ``inf``, and ``-inf`` will be " "handled according to IEEE rules. Specifically, ``NaN`` is not considered " @@ -210,269 +864,136 @@ msgid "" "considered close to themselves." msgstr "" -#: library/math.rst:171 +#: library/math.rst:366 msgid ":pep:`485` -- A function for testing approximate equality" msgstr "" -#: library/math.rst:176 +#: library/math.rst:371 msgid "" "Return ``True`` if *x* is neither an infinity nor a NaN, and ``False`` " "otherwise. (Note that ``0.0`` *is* considered finite.)" msgstr "" -#: library/math.rst:184 +#: library/math.rst:379 msgid "" "Return ``True`` if *x* is a positive or negative infinity, and ``False`` " "otherwise." msgstr "" -#: library/math.rst:190 +#: library/math.rst:385 msgid "" "Return ``True`` if *x* is a NaN (not a number), and ``False`` otherwise." msgstr "" -#: library/math.rst:195 -msgid "" -"Return the integer square root of the nonnegative integer *n*. This is the " -"floor of the exact square root of *n*, or equivalently the greatest integer " -"*a* such that *a*\\ ² |nbsp| ≤ |nbsp| *n*." -msgstr "" - -#: library/math.rst:199 -msgid "" -"For some applications, it may be more convenient to have the least integer " -"*a* such that *n* |nbsp| ≤ |nbsp| *a*\\ ², or in other words the ceiling of " -"the exact square root of *n*. For positive *n*, this can be computed using " -"``a = 1 + isqrt(n - 1)``." -msgstr "" - -#: library/math.rst:209 -msgid "" -"Return the least common multiple of the specified integer arguments. If all " -"arguments are nonzero, then the returned value is the smallest positive " -"integer that is a multiple of all arguments. If any of the arguments is " -"zero, then the returned value is ``0``. ``lcm()`` without arguments returns " -"``1``." -msgstr "" - -#: library/math.rst:220 +#: library/math.rst:390 msgid "" "Return ``x * (2**i)``. This is essentially the inverse of function :func:" "`frexp`." msgstr "" -#: library/math.rst:226 -msgid "" -"Return the fractional and integer parts of *x*. Both results carry the sign " -"of *x* and are floats." -msgstr "" - -#: library/math.rst:232 +#: library/math.rst:396 msgid "Return the floating-point value *steps* steps after *x* towards *y*." msgstr "" -#: library/math.rst:234 +#: library/math.rst:398 msgid "If *x* is equal to *y*, return *y*, unless *steps* is zero." msgstr "" -#: library/math.rst:236 +#: library/math.rst:400 msgid "Examples:" msgstr "" -#: library/math.rst:238 +#: library/math.rst:402 msgid "``math.nextafter(x, math.inf)`` goes up: towards positive infinity." msgstr "" -#: library/math.rst:239 +#: library/math.rst:403 msgid "``math.nextafter(x, -math.inf)`` goes down: towards minus infinity." msgstr "" -#: library/math.rst:240 +#: library/math.rst:404 msgid "``math.nextafter(x, 0.0)`` goes towards zero." msgstr "" -#: library/math.rst:241 +#: library/math.rst:405 msgid "``math.nextafter(x, math.copysign(math.inf, x))`` goes away from zero." msgstr "" -#: library/math.rst:243 +#: library/math.rst:407 msgid "See also :func:`math.ulp`." msgstr "" -#: library/math.rst:247 +#: library/math.rst:411 msgid "Added the *steps* argument." msgstr "" -#: library/math.rst:252 -msgid "" -"Return the number of ways to choose *k* items from *n* items without " -"repetition and with order." -msgstr "" - -#: library/math.rst:255 -msgid "" -"Evaluates to ``n! / (n - k)!`` when ``k <= n`` and evaluates to zero when " -"``k > n``." -msgstr "" - -#: library/math.rst:258 -msgid "" -"If *k* is not specified or is ``None``, then *k* defaults to *n* and the " -"function returns ``n!``." -msgstr "" - -#: library/math.rst:269 -msgid "" -"Calculate the product of all the elements in the input *iterable*. The " -"default *start* value for the product is ``1``." -msgstr "" - -#: library/math.rst:272 -msgid "" -"When the iterable is empty, return the start value. This function is " -"intended specifically for use with numeric values and may reject non-numeric " -"types." -msgstr "" - -#: library/math.rst:281 -msgid "" -"Return the IEEE 754-style remainder of *x* with respect to *y*. For finite " -"*x* and finite nonzero *y*, this is the difference ``x - n*y``, where ``n`` " -"is the closest integer to the exact value of the quotient ``x / y``. If " -"``x / y`` is exactly halfway between two consecutive integers, the nearest " -"*even* integer is used for ``n``. The remainder ``r = remainder(x, y)`` " -"thus always satisfies ``abs(r) <= 0.5 * abs(y)``." -msgstr "" - -#: library/math.rst:288 -msgid "" -"Special cases follow IEEE 754: in particular, ``remainder(x, math.inf)`` is " -"*x* for any finite *x*, and ``remainder(x, 0)`` and ``remainder(math.inf, " -"x)`` raise :exc:`ValueError` for any non-NaN *x*. If the result of the " -"remainder operation is zero, that zero will have the same sign as *x*." -msgstr "" - -#: library/math.rst:294 -msgid "" -"On platforms using IEEE 754 binary floating point, the result of this " -"operation is always exactly representable: no rounding error is introduced." -msgstr "" - -#: library/math.rst:302 -msgid "Return the sum of products of values from two iterables *p* and *q*." -msgstr "" - -#: library/math.rst:304 -msgid "Raises :exc:`ValueError` if the inputs do not have the same length." -msgstr "" - -#: library/math.rst:501 -msgid "Roughly equivalent to::" -msgstr "" - -#: library/math.rst:308 -msgid "sum(itertools.starmap(operator.mul, zip(p, q, strict=True)))" -msgstr "" - -#: library/math.rst:310 -msgid "" -"For float and mixed int/float inputs, the intermediate products and sums are " -"computed with extended precision." -msgstr "" - -#: library/math.rst:318 -msgid "" -"Return *x* with the fractional part removed, leaving the integer part. This " -"rounds toward 0: ``trunc()`` is equivalent to :func:`floor` for positive " -"*x*, and equivalent to :func:`ceil` for negative *x*. If *x* is not a float, " -"delegates to :meth:`x.__trunc__ `, which should return an :" -"class:`~numbers.Integral` value." -msgstr "" - -#: library/math.rst:326 +#: library/math.rst:417 msgid "Return the value of the least significant bit of the float *x*:" msgstr "" -#: library/math.rst:328 +#: library/math.rst:419 msgid "If *x* is a NaN (not a number), return *x*." msgstr "" -#: library/math.rst:329 +#: library/math.rst:420 msgid "If *x* is negative, return ``ulp(-x)``." msgstr "" -#: library/math.rst:330 +#: library/math.rst:421 msgid "If *x* is a positive infinity, return *x*." msgstr "" -#: library/math.rst:331 +#: library/math.rst:422 msgid "" "If *x* is equal to zero, return the smallest positive *denormalized* " "representable float (smaller than the minimum positive *normalized* float, :" "data:`sys.float_info.min `)." msgstr "" -#: library/math.rst:334 +#: library/math.rst:425 msgid "" "If *x* is equal to the largest positive representable float, return the " "value of the least significant bit of *x*, such that the first float smaller " "than *x* is ``x - ulp(x)``." msgstr "" -#: library/math.rst:337 +#: library/math.rst:428 msgid "" "Otherwise (*x* is a positive finite number), return the value of the least " "significant bit of *x*, such that the first float bigger than *x* is ``x + " "ulp(x)``." msgstr "" -#: library/math.rst:341 +#: library/math.rst:432 msgid "ULP stands for \"Unit in the Last Place\"." msgstr "" -#: library/math.rst:343 +#: library/math.rst:434 msgid "" "See also :func:`math.nextafter` and :data:`sys.float_info.epsilon `." msgstr "" -#: library/math.rst:349 -msgid "" -"Note that :func:`frexp` and :func:`modf` have a different call/return " -"pattern than their C equivalents: they take a single argument and return a " -"pair of values, rather than returning their second return value through an " -"'output parameter' (there is no such thing in Python)." -msgstr "" - -#: library/math.rst:354 -msgid "" -"For the :func:`ceil`, :func:`floor`, and :func:`modf` functions, note that " -"*all* floating-point numbers of sufficiently large magnitude are exact " -"integers. Python floats typically carry no more than 53 bits of precision " -"(the same as the platform C double type), in which case any float *x* with " -"``abs(x) >= 2**52`` necessarily has no fractional bits." -msgstr "" - -#: library/math.rst:362 -msgid "Power and logarithmic functions" +#: library/math.rst:441 +msgid "Power, exponential and logarithmic functions" msgstr "" -#: library/math.rst:366 +#: library/math.rst:445 msgid "Return the cube root of *x*." msgstr "" -#: library/math.rst:373 +#: library/math.rst:452 msgid "" "Return *e* raised to the power *x*, where *e* = 2.718281... is the base of " "natural logarithms. This is usually more accurate than ``math.e ** x`` or " "``pow(math.e, x)``." msgstr "" -#: library/math.rst:380 +#: library/math.rst:459 msgid "Return *2* raised to the power *x*." msgstr "" -#: library/math.rst:387 +#: library/math.rst:466 msgid "" "Return *e* raised to the power *x*, minus 1. Here *e* is the base of " "natural logarithms. For small floats *x*, the subtraction in ``exp(x) - 1`` " @@ -481,221 +1002,283 @@ msgid "" "compute this quantity to full precision:" msgstr "" -#: library/math.rst:404 +#: library/math.rst:483 msgid "With one argument, return the natural logarithm of *x* (to base *e*)." msgstr "" -#: library/math.rst:406 +#: library/math.rst:485 msgid "" "With two arguments, return the logarithm of *x* to the given *base*, " "calculated as ``log(x)/log(base)``." msgstr "" -#: library/math.rst:412 +#: library/math.rst:491 msgid "" "Return the natural logarithm of *1+x* (base *e*). The result is calculated " "in a way which is accurate for *x* near zero." msgstr "" -#: library/math.rst:418 +#: library/math.rst:497 msgid "" "Return the base-2 logarithm of *x*. This is usually more accurate than " "``log(x, 2)``." msgstr "" -#: library/math.rst:425 +#: library/math.rst:504 msgid "" ":meth:`int.bit_length` returns the number of bits necessary to represent an " "integer in binary, excluding the sign and leading zeros." msgstr "" -#: library/math.rst:431 +#: library/math.rst:510 msgid "" "Return the base-10 logarithm of *x*. This is usually more accurate than " "``log(x, 10)``." msgstr "" -#: library/math.rst:437 +#: library/math.rst:516 msgid "" -"Return ``x`` raised to the power ``y``. Exceptional cases follow the IEEE " -"754 standard as far as possible. In particular, ``pow(1.0, x)`` and " -"``pow(x, 0.0)`` always return ``1.0``, even when ``x`` is a zero or a NaN. " -"If both ``x`` and ``y`` are finite, ``x`` is negative, and ``y`` is not an " -"integer then ``pow(x, y)`` is undefined, and raises :exc:`ValueError`." +"Return *x* raised to the power *y*. Exceptional cases follow the IEEE 754 " +"standard as far as possible. In particular, ``pow(1.0, x)`` and ``pow(x, " +"0.0)`` always return ``1.0``, even when *x* is a zero or a NaN. If both *x* " +"and *y* are finite, *x* is negative, and *y* is not an integer then ``pow(x, " +"y)`` is undefined, and raises :exc:`ValueError`." msgstr "" -#: library/math.rst:444 +#: library/math.rst:523 msgid "" "Unlike the built-in ``**`` operator, :func:`math.pow` converts both its " "arguments to type :class:`float`. Use ``**`` or the built-in :func:`pow` " "function for computing exact integer powers." msgstr "" -#: library/math.rst:448 +#: library/math.rst:527 msgid "" "The special cases ``pow(0.0, -inf)`` and ``pow(-0.0, -inf)`` were changed to " "return ``inf`` instead of raising :exc:`ValueError`, for consistency with " "IEEE 754." msgstr "" -#: library/math.rst:456 +#: library/math.rst:535 msgid "Return the square root of *x*." msgstr "" -#: library/math.rst:460 -msgid "Trigonometric functions" +#: library/math.rst:539 +msgid "Summation and product functions" msgstr "" -#: library/math.rst:464 +#: library/math.rst:543 msgid "" -"Return the arc cosine of *x*, in radians. The result is between ``0`` and " -"``pi``." +"Return the Euclidean distance between two points *p* and *q*, each given as " +"a sequence (or iterable) of coordinates. The two points must have the same " +"dimension." msgstr "" -#: library/math.rst:470 -msgid "" -"Return the arc sine of *x*, in radians. The result is between ``-pi/2`` and " -"``pi/2``." +#: library/math.rst:608 +msgid "Roughly equivalent to::" msgstr "" -#: library/math.rst:476 -msgid "" -"Return the arc tangent of *x*, in radians. The result is between ``-pi/2`` " -"and ``pi/2``." +#: library/math.rst:549 +msgid "sqrt(sum((px - qx) ** 2.0 for px, qx in zip(p, q)))" msgstr "" -#: library/math.rst:482 +#: library/math.rst:556 msgid "" -"Return ``atan(y / x)``, in radians. The result is between ``-pi`` and " -"``pi``. The vector in the plane from the origin to point ``(x, y)`` makes " -"this angle with the positive X axis. The point of :func:`atan2` is that the " -"signs of both inputs are known to it, so it can compute the correct quadrant " -"for the angle. For example, ``atan(1)`` and ``atan2(1, 1)`` are both " -"``pi/4``, but ``atan2(-1, -1)`` is ``-3*pi/4``." -msgstr "" - -#: library/math.rst:492 -msgid "Return the cosine of *x* radians." +"Return an accurate floating-point sum of values in the iterable. Avoids " +"loss of precision by tracking multiple intermediate partial sums." msgstr "" -#: library/math.rst:497 +#: library/math.rst:559 msgid "" -"Return the Euclidean distance between two points *p* and *q*, each given as " -"a sequence (or iterable) of coordinates. The two points must have the same " -"dimension." +"The algorithm's accuracy depends on IEEE-754 arithmetic guarantees and the " +"typical case where the rounding mode is half-even. On some non-Windows " +"builds, the underlying C library uses extended precision addition and may " +"occasionally double-round an intermediate sum causing it to be off in its " +"least significant bit." msgstr "" -#: library/math.rst:503 -msgid "sqrt(sum((px - qx) ** 2.0 for px, qx in zip(p, q)))" +#: library/math.rst:565 +msgid "" +"For further discussion and two alternative approaches, see the `ASPN " +"cookbook recipes for accurate floating-point summation `_\\." msgstr "" -#: library/math.rst:510 +#: library/math.rst:572 msgid "" "Return the Euclidean norm, ``sqrt(sum(x**2 for x in coordinates))``. This is " "the length of the vector from the origin to the point given by the " "coordinates." msgstr "" -#: library/math.rst:514 +#: library/math.rst:576 msgid "" "For a two dimensional point ``(x, y)``, this is equivalent to computing the " "hypotenuse of a right triangle using the Pythagorean theorem, ``sqrt(x*x + " "y*y)``." msgstr "" -#: library/math.rst:518 +#: library/math.rst:580 msgid "" "Added support for n-dimensional points. Formerly, only the two dimensional " "case was supported." msgstr "" -#: library/math.rst:522 +#: library/math.rst:584 msgid "" "Improved the algorithm's accuracy so that the maximum error is under 1 ulp " "(unit in the last place). More typically, the result is almost always " "correctly rounded to within 1/2 ulp." msgstr "" -#: library/math.rst:530 -msgid "Return the sine of *x* radians." +#: library/math.rst:592 +msgid "" +"Calculate the product of all the elements in the input *iterable*. The " +"default *start* value for the product is ``1``." msgstr "" -#: library/math.rst:535 -msgid "Return the tangent of *x* radians." +#: library/math.rst:595 +msgid "" +"When the iterable is empty, return the start value. This function is " +"intended specifically for use with numeric values and may reject non-numeric " +"types." msgstr "" -#: library/math.rst:539 +#: library/math.rst:604 +msgid "Return the sum of products of values from two iterables *p* and *q*." +msgstr "" + +#: library/math.rst:606 +msgid "Raises :exc:`ValueError` if the inputs do not have the same length." +msgstr "" + +#: library/math.rst:610 +msgid "sum(itertools.starmap(operator.mul, zip(p, q, strict=True)))" +msgstr "" + +#: library/math.rst:612 +msgid "" +"For float and mixed int/float inputs, the intermediate products and sums are " +"computed with extended precision." +msgstr "" + +#: library/math.rst:619 msgid "Angular conversion" msgstr "" -#: library/math.rst:543 +#: library/math.rst:623 msgid "Convert angle *x* from radians to degrees." msgstr "" -#: library/math.rst:548 +#: library/math.rst:628 msgid "Convert angle *x* from degrees to radians." msgstr "" -#: library/math.rst:552 +#: library/math.rst:632 +msgid "Trigonometric functions" +msgstr "" + +#: library/math.rst:636 +msgid "" +"Return the arc cosine of *x*, in radians. The result is between ``0`` and " +"``pi``." +msgstr "" + +#: library/math.rst:642 +msgid "" +"Return the arc sine of *x*, in radians. The result is between ``-pi/2`` and " +"``pi/2``." +msgstr "" + +#: library/math.rst:648 +msgid "" +"Return the arc tangent of *x*, in radians. The result is between ``-pi/2`` " +"and ``pi/2``." +msgstr "" + +#: library/math.rst:654 +msgid "" +"Return ``atan(y / x)``, in radians. The result is between ``-pi`` and " +"``pi``. The vector in the plane from the origin to point ``(x, y)`` makes " +"this angle with the positive X axis. The point of :func:`atan2` is that the " +"signs of both inputs are known to it, so it can compute the correct quadrant " +"for the angle. For example, ``atan(1)`` and ``atan2(1, 1)`` are both " +"``pi/4``, but ``atan2(-1, -1)`` is ``-3*pi/4``." +msgstr "" + +#: library/math.rst:664 +msgid "Return the cosine of *x* radians." +msgstr "" + +#: library/math.rst:669 +msgid "Return the sine of *x* radians." +msgstr "" + +#: library/math.rst:674 +msgid "Return the tangent of *x* radians." +msgstr "" + +#: library/math.rst:678 msgid "Hyperbolic functions" msgstr "" -#: library/math.rst:554 +#: library/math.rst:680 msgid "" "`Hyperbolic functions `_ " "are analogs of trigonometric functions that are based on hyperbolas instead " "of circles." msgstr "" -#: library/math.rst:560 +#: library/math.rst:686 msgid "Return the inverse hyperbolic cosine of *x*." msgstr "" -#: library/math.rst:565 +#: library/math.rst:691 msgid "Return the inverse hyperbolic sine of *x*." msgstr "" -#: library/math.rst:570 +#: library/math.rst:696 msgid "Return the inverse hyperbolic tangent of *x*." msgstr "" -#: library/math.rst:575 +#: library/math.rst:701 msgid "Return the hyperbolic cosine of *x*." msgstr "" -#: library/math.rst:580 +#: library/math.rst:706 msgid "Return the hyperbolic sine of *x*." msgstr "" -#: library/math.rst:585 +#: library/math.rst:711 msgid "Return the hyperbolic tangent of *x*." msgstr "" -#: library/math.rst:589 +#: library/math.rst:715 msgid "Special functions" msgstr "" -#: library/math.rst:593 +#: library/math.rst:719 msgid "" "Return the `error function `_ " "at *x*." msgstr "" -#: library/math.rst:596 +#: library/math.rst:722 msgid "" "The :func:`erf` function can be used to compute traditional statistical " "functions such as the `cumulative standard normal distribution `_::" msgstr "" -#: library/math.rst:600 +#: library/math.rst:726 msgid "" "def phi(x):\n" " 'Cumulative distribution function for the standard normal distribution'\n" " return (1.0 + erf(x / sqrt(2.0))) / 2.0" msgstr "" -#: library/math.rst:609 +#: library/math.rst:735 msgid "" "Return the complementary error function at *x*. The `complementary error " "function `_ is defined as " @@ -704,31 +1287,31 @@ msgid "" "Loss_of_significance>`_\\." msgstr "" -#: library/math.rst:620 +#: library/math.rst:746 msgid "" "Return the `Gamma function `_ " "at *x*." msgstr "" -#: library/math.rst:628 +#: library/math.rst:754 msgid "" "Return the natural logarithm of the absolute value of the Gamma function at " "*x*." msgstr "" -#: library/math.rst:635 +#: library/math.rst:761 msgid "Constants" msgstr "" -#: library/math.rst:639 +#: library/math.rst:765 msgid "The mathematical constant *π* = 3.141592..., to available precision." msgstr "" -#: library/math.rst:644 +#: library/math.rst:770 msgid "The mathematical constant *e* = 2.718281..., to available precision." msgstr "" -#: library/math.rst:649 +#: library/math.rst:775 msgid "" "The mathematical constant *τ* = 6.283185..., to available precision. Tau is " "a circle constant equal to 2\\ *π*, the ratio of a circle's circumference to " @@ -737,13 +1320,13 @@ msgid "" "celebrating `Tau day `_ by eating twice as much pie!" msgstr "" -#: library/math.rst:660 +#: library/math.rst:786 msgid "" "A floating-point positive infinity. (For negative infinity, use ``-math." "inf``.) Equivalent to the output of ``float('inf')``." msgstr "" -#: library/math.rst:668 +#: library/math.rst:794 msgid "" "A floating-point \"not a number\" (NaN) value. Equivalent to the output of " "``float('nan')``. Due to the requirements of the `IEEE-754 standard \n" "Language-Team: LANGUAGE \n" @@ -81,41 +81,54 @@ msgid "" msgstr "" #: library/mimetypes.rst:54 -msgid "Added support for url being a :term:`path-like object`." +msgid "Added support for *url* being a :term:`path-like object`." msgstr "" -#: library/mimetypes.rst:60 +#: library/mimetypes.rst:57 +msgid "" +"Passing a file path instead of URL is :term:`soft deprecated`. Use :func:" +"`guess_file_type` for this." +msgstr "" + +#: library/mimetypes.rst:66 +msgid "" +"Guess the type of a file based on its path, given by *path*. Similar to the :" +"func:`guess_type` function, but accepts a path instead of URL. Path can be a " +"string, a bytes object or a :term:`path-like object`." +msgstr "" + +#: library/mimetypes.rst:75 msgid "" "Guess the extensions for a file based on its MIME type, given by *type*. The " "return value is a list of strings giving all possible filename extensions, " "including the leading dot (``'.'``). The extensions are not guaranteed to " "have been associated with any particular data stream, but would be mapped to " -"the MIME type *type* by :func:`guess_type`." +"the MIME type *type* by :func:`guess_type` and :func:`guess_file_type`." msgstr "" -#: library/mimetypes.rst:78 +#: library/mimetypes.rst:93 msgid "" "The optional *strict* argument has the same meaning as with the :func:" "`guess_type` function." msgstr "" -#: library/mimetypes.rst:71 +#: library/mimetypes.rst:86 msgid "" "Guess the extension for a file based on its MIME type, given by *type*. The " "return value is a string giving a filename extension, including the leading " "dot (``'.'``). The extension is not guaranteed to have been associated with " "any particular data stream, but would be mapped to the MIME type *type* by :" -"func:`guess_type`. If no extension can be guessed for *type*, ``None`` is " -"returned." +"func:`guess_type` and :func:`guess_file_type`. If no extension can be " +"guessed for *type*, ``None`` is returned." msgstr "" -#: library/mimetypes.rst:80 +#: library/mimetypes.rst:95 msgid "" "Some additional functions and data items are available for controlling the " "behavior of the module." msgstr "" -#: library/mimetypes.rst:86 +#: library/mimetypes.rst:101 msgid "" "Initialize the internal data structures. If given, *files* must be a " "sequence of file names which should be used to augment the default type " @@ -125,25 +138,25 @@ msgid "" "Calling :func:`init` repeatedly is allowed." msgstr "" -#: library/mimetypes.rst:93 +#: library/mimetypes.rst:108 msgid "" "Specifying an empty list for *files* will prevent the system defaults from " "being applied: only the well-known values will be present from a built-in " "list." msgstr "" -#: library/mimetypes.rst:96 +#: library/mimetypes.rst:111 msgid "" "If *files* is ``None`` the internal data structure is completely rebuilt to " "its initial default value. This is a stable operation and will produce the " "same results when called multiple times." msgstr "" -#: library/mimetypes.rst:100 +#: library/mimetypes.rst:115 msgid "Previously, Windows registry settings were ignored." msgstr "" -#: library/mimetypes.rst:106 +#: library/mimetypes.rst:121 msgid "" "Load the type map given in the file *filename*, if it exists. The type map " "is returned as a dictionary mapping filename extensions, including the " @@ -151,7 +164,7 @@ msgid "" "file *filename* does not exist or cannot be read, ``None`` is returned." msgstr "" -#: library/mimetypes.rst:279 +#: library/mimetypes.rst:302 msgid "" "Add a mapping from the MIME type *type* to the extension *ext*. When the " "extension is already known, the new type will replace the old one. When the " @@ -159,26 +172,26 @@ msgid "" "extensions." msgstr "" -#: library/mimetypes.rst:283 +#: library/mimetypes.rst:306 msgid "" "When *strict* is ``True`` (the default), the mapping will be added to the " "official MIME types, otherwise to the non-standard ones." msgstr "" -#: library/mimetypes.rst:124 +#: library/mimetypes.rst:139 msgid "" "Flag indicating whether or not the global data structures have been " "initialized. This is set to ``True`` by :func:`init`." msgstr "" -#: library/mimetypes.rst:132 +#: library/mimetypes.rst:147 msgid "" "List of type map file names commonly installed. These files are typically " "named :file:`mime.types` and are installed in different locations by " "different packages." msgstr "" -#: library/mimetypes.rst:139 +#: library/mimetypes.rst:154 msgid "" "Dictionary mapping suffixes to suffixes. This is used to allow recognition " "of encoded files for which the encoding and the type are indicated by the " @@ -186,25 +199,25 @@ msgid "" "`.tar.gz` to allow the encoding and type to be recognized separately." msgstr "" -#: library/mimetypes.rst:147 +#: library/mimetypes.rst:162 msgid "Dictionary mapping filename extensions to encoding types." msgstr "" -#: library/mimetypes.rst:152 +#: library/mimetypes.rst:167 msgid "Dictionary mapping filename extensions to MIME types." msgstr "" -#: library/mimetypes.rst:157 +#: library/mimetypes.rst:172 msgid "" "Dictionary mapping filename extensions to non-standard, but commonly found " "MIME types." msgstr "" -#: library/mimetypes.rst:161 +#: library/mimetypes.rst:176 msgid "An example usage of the module::" msgstr "" -#: library/mimetypes.rst:163 +#: library/mimetypes.rst:178 msgid "" ">>> import mimetypes\n" ">>> mimetypes.init()\n" @@ -218,18 +231,18 @@ msgid "" "'application/x-tar-gz'" msgstr "" -#: library/mimetypes.rst:178 +#: library/mimetypes.rst:193 msgid "MimeTypes Objects" msgstr "" -#: library/mimetypes.rst:180 +#: library/mimetypes.rst:195 msgid "" "The :class:`MimeTypes` class may be useful for applications which may want " "more than one MIME-type database; it provides an interface similar to the " "one of the :mod:`mimetypes` module." msgstr "" -#: library/mimetypes.rst:187 +#: library/mimetypes.rst:202 msgid "" "This class represents a MIME-types database. By default, it provides access " "to the same database as the rest of this module. The initial database is a " @@ -239,13 +252,13 @@ msgid "" "cleared before loading additional data if the default data is not desired." msgstr "" -#: library/mimetypes.rst:194 +#: library/mimetypes.rst:209 msgid "" "The optional *filenames* parameter can be used to cause additional files to " "be loaded \"on top\" of the default database." msgstr "" -#: library/mimetypes.rst:200 +#: library/mimetypes.rst:215 msgid "" "Dictionary mapping suffixes to suffixes. This is used to allow recognition " "of encoded files for which the encoding and the type are indicated by the " @@ -254,13 +267,13 @@ msgid "" "is initially a copy of the global :data:`suffix_map` defined in the module." msgstr "" -#: library/mimetypes.rst:209 +#: library/mimetypes.rst:224 msgid "" "Dictionary mapping filename extensions to encoding types. This is initially " "a copy of the global :data:`encodings_map` defined in the module." msgstr "" -#: library/mimetypes.rst:215 +#: library/mimetypes.rst:230 msgid "" "Tuple containing two dictionaries, mapping filename extensions to MIME " "types: the first dictionary is for the non-standards types and the second " @@ -268,7 +281,7 @@ msgid "" "and :data:`types_map`." msgstr "" -#: library/mimetypes.rst:223 +#: library/mimetypes.rst:238 msgid "" "Tuple containing two dictionaries, mapping MIME types to a list of filename " "extensions: the first dictionary is for the non-standards types and the " @@ -276,57 +289,63 @@ msgid "" "`common_types` and :data:`types_map`." msgstr "" -#: library/mimetypes.rst:231 +#: library/mimetypes.rst:246 msgid "" "Similar to the :func:`guess_extension` function, using the tables stored as " "part of the object." msgstr "" -#: library/mimetypes.rst:237 +#: library/mimetypes.rst:252 msgid "" "Similar to the :func:`guess_type` function, using the tables stored as part " "of the object." msgstr "" -#: library/mimetypes.rst:243 +#: library/mimetypes.rst:258 +msgid "" +"Similar to the :func:`guess_file_type` function, using the tables stored as " +"part of the object." +msgstr "" + +#: library/mimetypes.rst:266 msgid "" "Similar to the :func:`guess_all_extensions` function, using the tables " "stored as part of the object." msgstr "" -#: library/mimetypes.rst:249 +#: library/mimetypes.rst:272 msgid "" "Load MIME information from a file named *filename*. This uses :meth:" "`readfp` to parse the file." msgstr "" -#: library/mimetypes.rst:252 +#: library/mimetypes.rst:275 msgid "" "If *strict* is ``True``, information will be added to list of standard " "types, else to the list of non-standard types." msgstr "" -#: library/mimetypes.rst:258 +#: library/mimetypes.rst:281 msgid "" "Load MIME type information from an open file *fp*. The file must have the " "format of the standard :file:`mime.types` files." msgstr "" -#: library/mimetypes.rst:271 +#: library/mimetypes.rst:294 msgid "" "If *strict* is ``True``, information will be added to the list of standard " "types, else to the list of non-standard types." msgstr "" -#: library/mimetypes.rst:267 +#: library/mimetypes.rst:290 msgid "Load MIME type information from the Windows registry." msgstr "" -#: library/mimetypes.rst:269 +#: library/mimetypes.rst:292 msgid "Availability" msgstr "" -#: library/mimetypes.rst:31 +#: library/mimetypes.rst:31 library/mimetypes.rst:64 msgid "MIME" msgstr "" @@ -334,14 +353,14 @@ msgstr "" msgid "content type" msgstr "" -#: library/mimetypes.rst:31 +#: library/mimetypes.rst:64 msgid "headers" msgstr "" -#: library/mimetypes.rst:130 +#: library/mimetypes.rst:145 msgid "file" msgstr "" -#: library/mimetypes.rst:130 +#: library/mimetypes.rst:145 msgid "mime.types" msgstr "" diff --git a/library/mm.po b/library/mm.po index c5e680a8..07bf63a7 100644 --- a/library/mm.po +++ b/library/mm.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" diff --git a/library/mmap.po b/library/mmap.po index afe680b2..1624a875 100644 --- a/library/mmap.po +++ b/library/mmap.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -27,9 +27,8 @@ msgstr "" #: includes/wasm-notavail.rst:5 msgid "" -"This module does not work or is not available on WebAssembly platforms " -"``wasm32-emscripten`` and ``wasm32-wasi``. See :ref:`wasm-availability` for " -"more information." +"This module does not work or is not available on WebAssembly. See :ref:`wasm-" +"availability` for more information." msgstr "" #: library/mmap.rst:11 @@ -118,13 +117,13 @@ msgid "" "`ALLOCATIONGRANULARITY`." msgstr "" -#: library/mmap.rst:163 +#: library/mmap.rst:174 msgid "" "Raises an :ref:`auditing event ` ``mmap.__new__`` with arguments " "``fileno``, ``length``, ``access``, ``offset``." msgstr "" -#: library/mmap.rst:77 +#: library/mmap.rst:78 msgid "" "**(Unix version)** Maps *length* bytes from the file specified by the file " "descriptor *fileno*, and returns a mmap object. If *length* is ``0``, the " @@ -132,7 +131,7 @@ msgid "" "`~mmap.mmap` is called." msgstr "" -#: library/mmap.rst:82 +#: library/mmap.rst:83 msgid "" "*flags* specifies the nature of the mapping. :const:`MAP_PRIVATE` creates a " "private copy-on-write mapping, so changes to the contents of the mmap object " @@ -143,7 +142,7 @@ msgid "" "constants>`." msgstr "" -#: library/mmap.rst:90 +#: library/mmap.rst:91 msgid "" "*prot*, if specified, gives the desired memory protection; the two most " "useful values are :const:`PROT_READ` and :const:`PROT_WRITE`, to specify " @@ -151,7 +150,7 @@ msgid "" "\\| PROT_WRITE`." msgstr "" -#: library/mmap.rst:95 +#: library/mmap.rst:96 msgid "" "*access* may be specified in lieu of *flags* and *prot* as an optional " "keyword parameter. It is an error to specify both *flags*, *prot* and " @@ -159,7 +158,7 @@ msgid "" "use this parameter." msgstr "" -#: library/mmap.rst:100 +#: library/mmap.rst:101 msgid "" "*offset* may be specified as a non-negative integer offset. mmap references " "will be relative to the offset from the beginning of the file. *offset* " @@ -167,18 +166,31 @@ msgid "" "which is equal to :const:`PAGESIZE` on Unix systems." msgstr "" -#: library/mmap.rst:105 +#: library/mmap.rst:106 +msgid "" +"If *trackfd* is ``False``, the file descriptor specified by *fileno* will " +"not be duplicated, and the resulting :class:`!mmap` object will not be " +"associated with the map's underlying file. This means that the :meth:`~mmap." +"mmap.size` and :meth:`~mmap.mmap.resize` methods will fail. This mode is " +"useful to limit the number of open file descriptors." +msgstr "" + +#: library/mmap.rst:113 msgid "" "To ensure validity of the created memory mapping the file specified by the " "descriptor *fileno* is internally automatically synchronized with the " "physical backing store on macOS." msgstr "" -#: library/mmap.rst:109 +#: library/mmap.rst:117 +msgid "The *trackfd* parameter was added." +msgstr "" + +#: library/mmap.rst:120 msgid "This example shows a simple way of using :class:`~mmap.mmap`::" msgstr "" -#: library/mmap.rst:111 +#: library/mmap.rst:122 msgid "" "import mmap\n" "\n" @@ -203,13 +215,13 @@ msgid "" " mm.close()" msgstr "" -#: library/mmap.rst:134 +#: library/mmap.rst:145 msgid "" ":class:`~mmap.mmap` can also be used as a context manager in a :keyword:" "`with` statement::" msgstr "" -#: library/mmap.rst:137 +#: library/mmap.rst:148 msgid "" "import mmap\n" "\n" @@ -217,17 +229,17 @@ msgid "" " mm.write(b\"Hello world!\")" msgstr "" -#: library/mmap.rst:142 +#: library/mmap.rst:153 msgid "Context manager support." msgstr "" -#: library/mmap.rst:146 +#: library/mmap.rst:157 msgid "" "The next example demonstrates how to create an anonymous map and exchange " "data between the parent and child processes::" msgstr "" -#: library/mmap.rst:149 +#: library/mmap.rst:160 msgid "" "import mmap\n" "import os\n" @@ -244,21 +256,21 @@ msgid "" " mm.close()" msgstr "" -#: library/mmap.rst:165 +#: library/mmap.rst:176 msgid "Memory-mapped file objects support the following methods:" msgstr "" -#: library/mmap.rst:169 +#: library/mmap.rst:180 msgid "" "Closes the mmap. Subsequent calls to other methods of the object will result " "in a ValueError exception being raised. This will not close the open file." msgstr "" -#: library/mmap.rst:176 +#: library/mmap.rst:187 msgid "``True`` if the file is closed." msgstr "" -#: library/mmap.rst:183 +#: library/mmap.rst:194 msgid "" "Returns the lowest index in the object where the subsequence *sub* is found, " "such that *sub* is contained in the range [*start*, *end*]. Optional " @@ -266,11 +278,11 @@ msgid "" "``-1`` on failure." msgstr "" -#: library/mmap.rst:277 library/mmap.rst:309 +#: library/mmap.rst:291 library/mmap.rst:331 msgid "Writable :term:`bytes-like object` is now accepted." msgstr "" -#: library/mmap.rst:194 +#: library/mmap.rst:205 msgid "" "Flushes changes made to the in-memory copy of a file back to disk. Without " "use of this call there is no guarantee that changes are written back before " @@ -280,20 +292,20 @@ msgid "" "`PAGESIZE` or :const:`ALLOCATIONGRANULARITY`." msgstr "" -#: library/mmap.rst:201 +#: library/mmap.rst:212 msgid "" "``None`` is returned to indicate success. An exception is raised when the " "call failed." msgstr "" -#: library/mmap.rst:204 +#: library/mmap.rst:215 msgid "" "Previously, a nonzero value was returned on success; zero was returned on " "error under Windows. A zero value was returned on success; an exception was " "raised on error under Unix." msgstr "" -#: library/mmap.rst:212 +#: library/mmap.rst:223 msgid "" "Send advice *option* to the kernel about the memory region beginning at " "*start* and extending *length* bytes. *option* must be one of the :ref:" @@ -302,18 +314,18 @@ msgid "" "(including Linux), *start* must be a multiple of the :const:`PAGESIZE`." msgstr "" -#: library/mmap.rst:219 +#: library/mmap.rst:230 msgid "Availability: Systems with the ``madvise()`` system call." msgstr "" -#: library/mmap.rst:226 +#: library/mmap.rst:237 msgid "" "Copy the *count* bytes starting at offset *src* to the destination index " "*dest*. If the mmap was created with :const:`ACCESS_READ`, then calls to " "move will raise a :exc:`TypeError` exception." msgstr "" -#: library/mmap.rst:233 +#: library/mmap.rst:244 msgid "" "Return a :class:`bytes` containing up to *n* bytes starting from the current " "file position. If the argument is omitted, ``None`` or negative, return all " @@ -321,31 +333,36 @@ msgid "" "position is updated to point after the bytes that were returned." msgstr "" -#: library/mmap.rst:239 +#: library/mmap.rst:250 msgid "Argument can be omitted or ``None``." msgstr "" -#: library/mmap.rst:244 +#: library/mmap.rst:255 msgid "" "Returns a byte at the current file position as an integer, and advances the " "file position by 1." msgstr "" -#: library/mmap.rst:250 +#: library/mmap.rst:261 msgid "" "Returns a single line, starting at the current file position and up to the " "next newline. The file position is updated to point after the bytes that " "were returned." msgstr "" -#: library/mmap.rst:257 +#: library/mmap.rst:268 +msgid "Resizes the map and the underlying file, if any." +msgstr "" + +#: library/mmap.rst:270 msgid "" -"Resizes the map and the underlying file, if any. If the mmap was created " -"with :const:`ACCESS_READ` or :const:`ACCESS_COPY`, resizing the map will " -"raise a :exc:`TypeError` exception." +"Resizing a map created with *access* of :const:`ACCESS_READ` or :const:" +"`ACCESS_COPY`, will raise a :exc:`TypeError` exception. Resizing a map " +"created with with *trackfd* set to ``False``, will raise a :exc:`ValueError` " +"exception." msgstr "" -#: library/mmap.rst:261 +#: library/mmap.rst:275 msgid "" "**On Windows**: Resizing the map will raise an :exc:`OSError` if there are " "other maps against the same named file. Resizing an anonymous map (ie " @@ -353,13 +370,13 @@ msgid "" "copied over up to the length of the new size." msgstr "" -#: library/mmap.rst:266 +#: library/mmap.rst:280 msgid "" "Correctly fails if attempting to resize when another map is held Allows " "resize against an anonymous map on Windows" msgstr "" -#: library/mmap.rst:272 +#: library/mmap.rst:286 msgid "" "Returns the highest index in the object where the subsequence *sub* is " "found, such that *sub* is contained in the range [*start*, *end*]. Optional " @@ -367,7 +384,7 @@ msgid "" "``-1`` on failure." msgstr "" -#: library/mmap.rst:283 +#: library/mmap.rst:297 msgid "" "Set the file's current position. *whence* argument is optional and defaults " "to ``os.SEEK_SET`` or ``0`` (absolute file positioning); other values are " @@ -375,17 +392,27 @@ msgid "" "SEEK_END`` or ``2`` (seek relative to the file's end)." msgstr "" -#: library/mmap.rst:291 +#: library/mmap.rst:302 +msgid "Return the new absolute position instead of ``None``." +msgstr "" + +#: library/mmap.rst:307 +msgid "" +"Return whether the file supports seeking, and the return value is always " +"``True``." +msgstr "" + +#: library/mmap.rst:313 msgid "" "Return the length of the file, which can be larger than the size of the " "memory-mapped area." msgstr "" -#: library/mmap.rst:297 +#: library/mmap.rst:319 msgid "Returns the current position of the file pointer." msgstr "" -#: library/mmap.rst:302 +#: library/mmap.rst:324 msgid "" "Write the bytes in *bytes* into memory at the current position of the file " "pointer and return the number of bytes written (never less than " @@ -395,11 +422,11 @@ msgid "" "it will raise a :exc:`TypeError` exception." msgstr "" -#: library/mmap.rst:312 +#: library/mmap.rst:334 msgid "The number of bytes written is now returned." msgstr "" -#: library/mmap.rst:318 +#: library/mmap.rst:340 msgid "" "Write the integer *byte* into memory at the current position of the file " "pointer; the file position is advanced by ``1``. If the mmap was created " @@ -407,25 +434,25 @@ msgid "" "exception." msgstr "" -#: library/mmap.rst:326 +#: library/mmap.rst:348 msgid "MADV_* Constants" msgstr "" -#: library/mmap.rst:353 +#: library/mmap.rst:375 msgid "" "These options can be passed to :meth:`mmap.madvise`. Not every option will " "be present on every system." msgstr "" -#: library/mmap.rst:356 +#: library/mmap.rst:378 msgid "Availability: Systems with the madvise() system call." msgstr "" -#: library/mmap.rst:363 +#: library/mmap.rst:385 msgid "MAP_* Constants" msgstr "" -#: library/mmap.rst:376 +#: library/mmap.rst:409 msgid "" "These are the various flags that can be passed to :meth:`mmap.mmap`. :data:" "`MAP_ALIGNED_SUPER` is only available at FreeBSD and :data:`MAP_CONCEAL` is " @@ -433,15 +460,22 @@ msgid "" "some systems." msgstr "" -#: library/mmap.rst:380 +#: library/mmap.rst:413 msgid "Added :data:`MAP_POPULATE` constant." msgstr "" -#: library/mmap.rst:383 +#: library/mmap.rst:416 msgid "Added :data:`MAP_STACK` constant." msgstr "" -#: library/mmap.rst:386 +#: library/mmap.rst:419 +msgid "Added :data:`MAP_ALIGNED_SUPER` and :data:`MAP_CONCEAL` constants." +msgstr "" + +#: library/mmap.rst:422 msgid "" -"Added :data:`MAP_ALIGNED_SUPER` constant. Added :data:`MAP_CONCEAL` constant." +"Added :data:`MAP_32BIT`, :data:`MAP_HASSEMAPHORE`, :data:`MAP_JIT`, :data:" +"`MAP_NOCACHE`, :data:`MAP_NOEXTEND`, :data:`MAP_NORESERVE`, :data:" +"`MAP_RESILIENT_CODESIGN`, :data:`MAP_RESILIENT_MEDIA`, :data:`MAP_TPRO`, :" +"data:`MAP_TRANSLATED_ALLOW_EXECUTE`, and :data:`MAP_UNIX03` constants." msgstr "" diff --git a/library/modulefinder.po b/library/modulefinder.po index aee5f0fa..4de41580 100644 --- a/library/modulefinder.po +++ b/library/modulefinder.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" diff --git a/library/modules.po b/library/modules.po index 0f70fdd1..b34f775c 100644 --- a/library/modules.po +++ b/library/modules.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" diff --git a/library/msilib.po b/library/msilib.po index 15479267..48f50d94 100644 --- a/library/msilib.po +++ b/library/msilib.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -18,603 +18,18 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" #: library/msilib.rst:2 -msgid ":mod:`msilib` --- Read and write Microsoft Installer files" +msgid ":mod:`!msilib` --- Read and write Microsoft Installer files" msgstr "" -#: library/msilib.rst:12 -msgid "**Source code:** :source:`Lib/msilib/__init__.py`" -msgstr "" - -#: library/msilib.rst:16 -msgid "" -"The :mod:`msilib` module is deprecated (see :pep:`PEP 594 <594#msilib>` for " -"details)." -msgstr "" - -#: library/msilib.rst:22 -msgid "" -"The :mod:`msilib` supports the creation of Microsoft Installer (``.msi``) " -"files. Because these files often contain an embedded \"cabinet\" file (``." -"cab``), it also exposes an API to create CAB files. Support for reading ``." -"cab`` files is currently not implemented; read support for the ``.msi`` " -"database is possible." -msgstr "" - -#: library/msilib.rst:27 -msgid "" -"This package aims to provide complete access to all tables in an ``.msi`` " -"file, therefore, it is a fairly low-level API. One primary application of " -"this package is the creation of Python installer package itself (although " -"that currently uses a different version of ``msilib``)." -msgstr "" - -#: library/msilib.rst:32 -msgid "" -"The package contents can be roughly split into four parts: low-level CAB " -"routines, low-level MSI routines, higher-level MSI routines, and standard " -"table structures." -msgstr "" - -#: library/msilib.rst:39 -msgid "" -"Create a new CAB file named *cabname*. *files* must be a list of tuples, " -"each containing the name of the file on disk, and the name of the file " -"inside the CAB file." -msgstr "" - -#: library/msilib.rst:43 -msgid "" -"The files are added to the CAB file in the order they appear in the list. " -"All files are added into a single CAB file, using the MSZIP compression " -"algorithm." -msgstr "" - -#: library/msilib.rst:46 -msgid "" -"Callbacks to Python for the various steps of MSI creation are currently not " -"exposed." -msgstr "" - -#: library/msilib.rst:52 -msgid "" -"Return the string representation of a new unique identifier. This wraps the " -"Windows API functions :c:func:`UuidCreate` and :c:func:`UuidToString`." -msgstr "" - -#: library/msilib.rst:58 -msgid "" -"Return a new database object by calling MsiOpenDatabase. *path* is the " -"file name of the MSI file; *persist* can be one of the constants " -"``MSIDBOPEN_CREATEDIRECT``, ``MSIDBOPEN_CREATE``, ``MSIDBOPEN_DIRECT``, " -"``MSIDBOPEN_READONLY``, or ``MSIDBOPEN_TRANSACT``, and may include the flag " -"``MSIDBOPEN_PATCHFILE``. See the Microsoft documentation for the meaning of " -"these flags; depending on the flags, an existing database is opened, or a " -"new one created." -msgstr "" - -#: library/msilib.rst:69 -msgid "" -"Return a new record object by calling :c:func:`MSICreateRecord`. *count* is " -"the number of fields of the record." -msgstr "" - -#: library/msilib.rst:75 -msgid "" -"Create and return a new database *name*, initialize it with *schema*, and " -"set the properties *ProductName*, *ProductCode*, *ProductVersion*, and " -"*Manufacturer*." -msgstr "" - -#: library/msilib.rst:79 -msgid "" -"*schema* must be a module object containing ``tables`` and " -"``_Validation_records`` attributes; typically, :mod:`msilib.schema` should " -"be used." -msgstr "" - -#: library/msilib.rst:83 -msgid "" -"The database will contain just the schema and the validation records when " -"this function returns." -msgstr "" - -#: library/msilib.rst:89 -msgid "Add all *records* to the table named *table* in *database*." -msgstr "" - -#: library/msilib.rst:91 -msgid "" -"The *table* argument must be one of the predefined tables in the MSI schema, " -"e.g. ``'Feature'``, ``'File'``, ``'Component'``, ``'Dialog'``, " -"``'Control'``, etc." -msgstr "" - -#: library/msilib.rst:95 -msgid "" -"*records* should be a list of tuples, each one containing all fields of a " -"record according to the schema of the table. For optional fields, ``None`` " -"can be passed." -msgstr "" - -#: library/msilib.rst:99 -msgid "Field values can be ints, strings, or instances of the Binary class." -msgstr "" - -#: library/msilib.rst:104 -msgid "" -"Represents entries in the Binary table; inserting such an object using :func:" -"`add_data` reads the file named *filename* into the table." -msgstr "" - -#: library/msilib.rst:110 -msgid "" -"Add all table content from *module* to *database*. *module* must contain an " -"attribute *tables* listing all tables for which content should be added, and " -"one attribute per table that has the actual content." -msgstr "" - -#: library/msilib.rst:114 -msgid "This is typically used to install the sequence tables." -msgstr "" - -#: library/msilib.rst:119 -msgid "" -"Add the file *path* into the ``_Stream`` table of *database*, with the " -"stream name *name*." -msgstr "" - -#: library/msilib.rst:125 -msgid "" -"Return a new UUID, in the format that MSI typically requires (i.e. in curly " -"braces, and with all hexdigits in uppercase)." -msgstr "" - -#: library/msilib.rst:131 -msgid "" -"`FCICreate `_ " -"`UuidCreate `_ `UuidToString `_" -msgstr "" - -#: library/msilib.rst:138 -msgid "Database Objects" -msgstr "" - -#: library/msilib.rst:143 -msgid "" -"Return a view object, by calling :c:func:`MSIDatabaseOpenView`. *sql* is the " -"SQL statement to execute." -msgstr "" - -#: library/msilib.rst:149 -msgid "" -"Commit the changes pending in the current transaction, by calling :c:func:" -"`MSIDatabaseCommit`." -msgstr "" - -#: library/msilib.rst:155 -msgid "" -"Return a new summary information object, by calling :c:func:" -"`MsiGetSummaryInformation`. *count* is the maximum number of updated values." -msgstr "" - -#: library/msilib.rst:161 -msgid "Close the database object, through :c:func:`MsiCloseHandle`." -msgstr "" - -#: library/msilib.rst:167 -msgid "" -"`MSIDatabaseOpenView `_ `MSIDatabaseCommit `_ `MSIGetSummaryInformation " -"`_ " -"`MsiCloseHandle `_" -msgstr "" - -#: library/msilib.rst:175 -msgid "View Objects" -msgstr "" - -#: library/msilib.rst:180 -msgid "" -"Execute the SQL query of the view, through :c:func:`MSIViewExecute`. If " -"*params* is not ``None``, it is a record describing actual values of the " -"parameter tokens in the query." -msgstr "" - -#: library/msilib.rst:187 -msgid "" -"Return a record describing the columns of the view, through calling :c:func:" -"`MsiViewGetColumnInfo`. *kind* can be either ``MSICOLINFO_NAMES`` or " -"``MSICOLINFO_TYPES``." -msgstr "" - -#: library/msilib.rst:194 -msgid "" -"Return a result record of the query, through calling :c:func:`MsiViewFetch`." -msgstr "" - -#: library/msilib.rst:199 -msgid "" -"Modify the view, by calling :c:func:`MsiViewModify`. *kind* can be one of " -"``MSIMODIFY_SEEK``, ``MSIMODIFY_REFRESH``, ``MSIMODIFY_INSERT``, " -"``MSIMODIFY_UPDATE``, ``MSIMODIFY_ASSIGN``, ``MSIMODIFY_REPLACE``, " -"``MSIMODIFY_MERGE``, ``MSIMODIFY_DELETE``, ``MSIMODIFY_INSERT_TEMPORARY``, " -"``MSIMODIFY_VALIDATE``, ``MSIMODIFY_VALIDATE_NEW``, " -"``MSIMODIFY_VALIDATE_FIELD``, or ``MSIMODIFY_VALIDATE_DELETE``." -msgstr "" - -#: library/msilib.rst:206 -msgid "*data* must be a record describing the new data." -msgstr "" - -#: library/msilib.rst:211 -msgid "Close the view, through :c:func:`MsiViewClose`." -msgstr "" - -#: library/msilib.rst:216 -msgid "" -"`MsiViewExecute `_ `MSIViewGetColumnInfo `_ `MsiViewFetch `_ `MsiViewModify " -"`_ " -"`MsiViewClose `_" -msgstr "" - -#: library/msilib.rst:225 -msgid "Summary Information Objects" -msgstr "" - -#: library/msilib.rst:230 -msgid "" -"Return a property of the summary, through :c:func:" -"`MsiSummaryInfoGetProperty`. *field* is the name of the property, and can be " -"one of the constants ``PID_CODEPAGE``, ``PID_TITLE``, ``PID_SUBJECT``, " -"``PID_AUTHOR``, ``PID_KEYWORDS``, ``PID_COMMENTS``, ``PID_TEMPLATE``, " -"``PID_LASTAUTHOR``, ``PID_REVNUMBER``, ``PID_LASTPRINTED``, " -"``PID_CREATE_DTM``, ``PID_LASTSAVE_DTM``, ``PID_PAGECOUNT``, " -"``PID_WORDCOUNT``, ``PID_CHARCOUNT``, ``PID_APPNAME``, or ``PID_SECURITY``." -msgstr "" - -#: library/msilib.rst:241 -msgid "" -"Return the number of summary properties, through :c:func:" -"`MsiSummaryInfoGetPropertyCount`." -msgstr "" - -#: library/msilib.rst:247 -msgid "" -"Set a property through :c:func:`MsiSummaryInfoSetProperty`. *field* can have " -"the same values as in :meth:`GetProperty`, *value* is the new value of the " -"property. Possible value types are integer and string." -msgstr "" - -#: library/msilib.rst:254 -msgid "" -"Write the modified properties to the summary information stream, using :c:" -"func:`MsiSummaryInfoPersist`." -msgstr "" - -#: library/msilib.rst:260 -msgid "" -"`MsiSummaryInfoGetProperty `_ `MsiSummaryInfoGetPropertyCount `_ " -"`MsiSummaryInfoSetProperty `_ `MsiSummaryInfoPersist `_" -msgstr "" - -#: library/msilib.rst:268 -msgid "Record Objects" -msgstr "" - -#: library/msilib.rst:273 +#: library/msilib.rst:10 msgid "" -"Return the number of fields of the record, through :c:func:" -"`MsiRecordGetFieldCount`." -msgstr "" - -#: library/msilib.rst:279 -msgid "" -"Return the value of *field* as an integer where possible. *field* must be " -"an integer." -msgstr "" - -#: library/msilib.rst:285 -msgid "" -"Return the value of *field* as a string where possible. *field* must be an " -"integer." -msgstr "" - -#: library/msilib.rst:291 -msgid "" -"Set *field* to *value* through :c:func:`MsiRecordSetString`. *field* must be " -"an integer; *value* a string." -msgstr "" - -#: library/msilib.rst:297 -msgid "" -"Set *field* to the contents of the file named *value*, through :c:func:" -"`MsiRecordSetStream`. *field* must be an integer; *value* a string." -msgstr "" - -#: library/msilib.rst:303 -msgid "" -"Set *field* to *value* through :c:func:`MsiRecordSetInteger`. Both *field* " -"and *value* must be an integer." -msgstr "" - -#: library/msilib.rst:309 -msgid "" -"Set all fields of the record to 0, through :c:func:`MsiRecordClearData`." -msgstr "" - -#: library/msilib.rst:314 -msgid "" -"`MsiRecordGetFieldCount `_ `MsiRecordSetString `_ `MsiRecordSetStream `_ " -"`MsiRecordSetInteger `_ `MsiRecordClearData `_" -msgstr "" - -#: library/msilib.rst:323 -msgid "Errors" -msgstr "" - -#: library/msilib.rst:325 -msgid "" -"All wrappers around MSI functions raise :exc:`MSIError`; the string inside " -"the exception will contain more detail." -msgstr "" - -#: library/msilib.rst:332 -msgid "CAB Objects" -msgstr "" - -#: library/msilib.rst:337 -msgid "" -"The class :class:`CAB` represents a CAB file. During MSI construction, files " -"will be added simultaneously to the ``Files`` table, and to a CAB file. " -"Then, when all files have been added, the CAB file can be written, then " -"added to the MSI file." -msgstr "" - -#: library/msilib.rst:342 -msgid "*name* is the name of the CAB file in the MSI file." -msgstr "" - -#: library/msilib.rst:347 -msgid "" -"Add the file with the pathname *full* to the CAB file, under the name " -"*logical*. If there is already a file named *logical*, a new file name is " -"created." -msgstr "" - -#: library/msilib.rst:351 -msgid "" -"Return the index of the file in the CAB file, and the new name of the file " -"inside the CAB file." -msgstr "" - -#: library/msilib.rst:357 -msgid "" -"Generate a CAB file, add it as a stream to the MSI file, put it into the " -"``Media`` table, and remove the generated file from the disk." -msgstr "" - -#: library/msilib.rst:364 -msgid "Directory Objects" -msgstr "" - -#: library/msilib.rst:369 -msgid "" -"Create a new directory in the Directory table. There is a current component " -"at each point in time for the directory, which is either explicitly created " -"through :meth:`start_component`, or implicitly when files are added for the " -"first time. Files are added into the current component, and into the cab " -"file. To create a directory, a base directory object needs to be specified " -"(can be ``None``), the path to the physical directory, and a logical " -"directory name. *default* specifies the DefaultDir slot in the directory " -"table. *componentflags* specifies the default flags that new components get." -msgstr "" - -#: library/msilib.rst:381 -msgid "" -"Add an entry to the Component table, and make this component the current " -"component for this directory. If no component name is given, the directory " -"name is used. If no *feature* is given, the current feature is used. If no " -"*flags* are given, the directory's default flags are used. If no *keyfile* " -"is given, the KeyPath is left null in the Component table." -msgstr "" - -#: library/msilib.rst:390 -msgid "" -"Add a file to the current component of the directory, starting a new one if " -"there is no current component. By default, the file name in the source and " -"the file table will be identical. If the *src* file is specified, it is " -"interpreted relative to the current directory. Optionally, a *version* and a " -"*language* can be specified for the entry in the File table." -msgstr "" - -#: library/msilib.rst:399 -msgid "" -"Add a list of files to the current component as specified in the glob " -"pattern. Individual files can be excluded in the *exclude* list." -msgstr "" - -#: library/msilib.rst:405 -msgid "Remove ``.pyc`` files on uninstall." -msgstr "" - -#: library/msilib.rst:410 -msgid "" -"`Directory Table `_ `File Table `_ `Component Table `_ `FeatureComponents Table " -"`_" -msgstr "" - -#: library/msilib.rst:418 -msgid "Features" -msgstr "" - -#: library/msilib.rst:423 -msgid "" -"Add a new record to the ``Feature`` table, using the values *id*, *parent." -"id*, *title*, *desc*, *display*, *level*, *directory*, and *attributes*. The " -"resulting feature object can be passed to the :meth:`start_component` method " -"of :class:`Directory`." -msgstr "" - -#: library/msilib.rst:431 -msgid "" -"Make this feature the current feature of :mod:`msilib`. New components are " -"automatically added to the default feature, unless a feature is explicitly " -"specified." -msgstr "" - -#: library/msilib.rst:438 -msgid "" -"`Feature Table `_" -msgstr "" - -#: library/msilib.rst:443 -msgid "GUI classes" -msgstr "" - -#: library/msilib.rst:445 -msgid "" -":mod:`msilib` provides several classes that wrap the GUI tables in an MSI " -"database. However, no standard user interface is provided." -msgstr "" - -#: library/msilib.rst:451 -msgid "" -"Base class of the dialog controls. *dlg* is the dialog object the control " -"belongs to, and *name* is the control's name." -msgstr "" - -#: library/msilib.rst:457 -msgid "Make an entry into the ``ControlEvent`` table for this control." -msgstr "" - -#: library/msilib.rst:462 -msgid "Make an entry into the ``EventMapping`` table for this control." -msgstr "" - -#: library/msilib.rst:467 -msgid "Make an entry into the ``ControlCondition`` table for this control." -msgstr "" - -#: library/msilib.rst:472 -msgid "" -"Create a radio button control named *name*. *property* is the installer " -"property that gets set when a radio button is selected." -msgstr "" - -#: library/msilib.rst:478 -msgid "" -"Add a radio button named *name* to the group, at the coordinates *x*, *y*, " -"*width*, *height*, and with the label *text*. If *value* is ``None``, it " -"defaults to *name*." -msgstr "" - -#: library/msilib.rst:485 -msgid "" -"Return a new :class:`Dialog` object. An entry in the ``Dialog`` table is " -"made, with the specified coordinates, dialog attributes, title, name of the " -"first, default, and cancel controls." -msgstr "" - -#: library/msilib.rst:492 -msgid "" -"Return a new :class:`Control` object. An entry in the ``Control`` table is " -"made with the specified parameters." -msgstr "" - -#: library/msilib.rst:495 -msgid "" -"This is a generic method; for specific types, specialized methods are " -"provided." -msgstr "" - -#: library/msilib.rst:501 -msgid "Add and return a ``Text`` control." -msgstr "" - -#: library/msilib.rst:506 -msgid "Add and return a ``Bitmap`` control." -msgstr "" - -#: library/msilib.rst:511 -msgid "Add and return a ``Line`` control." -msgstr "" - -#: library/msilib.rst:516 -msgid "Add and return a ``PushButton`` control." -msgstr "" - -#: library/msilib.rst:521 -msgid "Add and return a ``RadioButtonGroup`` control." -msgstr "" - -#: library/msilib.rst:526 -msgid "Add and return a ``CheckBox`` control." -msgstr "" - -#: library/msilib.rst:531 -msgid "" -"`Dialog Table `_ `Control Table `_ `Control Types `_ `ControlCondition Table " -"`_ " -"`ControlEvent Table `_ `EventMapping Table `_ `RadioButton Table `_" -msgstr "" - -#: library/msilib.rst:542 -msgid "Precomputed tables" -msgstr "" - -#: library/msilib.rst:544 -msgid "" -":mod:`msilib` provides a few subpackages that contain only schema and table " -"definitions. Currently, these definitions are based on MSI version 2.0." -msgstr "" - -#: library/msilib.rst:550 -msgid "" -"This is the standard MSI schema for MSI 2.0, with the *tables* variable " -"providing a list of table definitions, and *_Validation_records* providing " -"the data for MSI validation." -msgstr "" - -#: library/msilib.rst:557 -msgid "" -"This module contains table contents for the standard sequence tables: " -"*AdminExecuteSequence*, *AdminUISequence*, *AdvtExecuteSequence*, " -"*InstallExecuteSequence*, and *InstallUISequence*." -msgstr "" - -#: library/msilib.rst:564 -msgid "" -"This module contains definitions for the UIText and ActionText tables, for " -"the standard installer actions." +"This module is no longer part of the Python standard library. It was :ref:" +"`removed in Python 3.13 ` after being deprecated in " +"Python 3.11. The removal was decided in :pep:`594`." msgstr "" #: library/msilib.rst:14 -msgid "msi" +msgid "" +"The last version of Python that provided the :mod:`!msilib` module was " +"`Python 3.12 `_." msgstr "" diff --git a/library/msvcrt.po b/library/msvcrt.po index 3ff7c7b3..178d00c3 100644 --- a/library/msvcrt.po +++ b/library/msvcrt.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -24,8 +24,8 @@ msgstr "" #: library/msvcrt.rst:12 msgid "" "These functions provide access to some useful capabilities on Windows " -"platforms. Some higher-level modules use these functions to build the " -"Windows implementations of their services. For example, the :mod:`getpass` " +"platforms. Some higher-level modules use these functions to build the " +"Windows implementations of their services. For example, the :mod:`getpass` " "module uses this in the implementation of the :func:`getpass` function." msgstr "" @@ -55,12 +55,12 @@ msgstr "" #: library/msvcrt.rst:38 msgid "" -"Lock part of a file based on file descriptor *fd* from the C runtime. " -"Raises :exc:`OSError` on failure. The locked region of the file extends " -"from the current file position for *nbytes* bytes, and may continue beyond " -"the end of the file. *mode* must be one of the :const:`!LK_\\*` constants " -"listed below. Multiple regions in a file may be locked at the same time, but " -"may not overlap. Adjacent regions are not merged; they must be unlocked " +"Lock part of a file based on file descriptor *fd* from the C runtime. " +"Raises :exc:`OSError` on failure. The locked region of the file extends from " +"the current file position for *nbytes* bytes, and may continue beyond the " +"end of the file. *mode* must be one of the :const:`!LK_\\*` constants listed " +"below. Multiple regions in a file may be locked at the same time, but may " +"not overlap. Adjacent regions are not merged; they must be unlocked " "individually." msgstr "" @@ -73,7 +73,7 @@ msgstr "" #: library/msvcrt.rst:51 msgid "" "Locks the specified bytes. If the bytes cannot be locked, the program " -"immediately tries again after 1 second. If, after 10 attempts, the bytes " +"immediately tries again after 1 second. If, after 10 attempts, the bytes " "cannot be locked, :exc:`OSError` is raised." msgstr "" @@ -96,100 +96,195 @@ msgstr "" #: library/msvcrt.rst:77 msgid "" -"Create a C runtime file descriptor from the file handle *handle*. The " +"Create a C runtime file descriptor from the file handle *handle*. The " "*flags* parameter should be a bitwise OR of :const:`os.O_APPEND`, :const:`os." -"O_RDONLY`, and :const:`os.O_TEXT`. The returned file descriptor may be used " -"as a parameter to :func:`os.fdopen` to create a file object." +"O_RDONLY`, :const:`os.O_TEXT` and :const:`os.O_NOINHERIT`. The returned file " +"descriptor may be used as a parameter to :func:`os.fdopen` to create a file " +"object." msgstr "" -#: library/msvcrt.rst:82 +#: library/msvcrt.rst:83 +msgid "" +"The file descriptor is inheritable by default. Pass :const:`os.O_NOINHERIT` " +"flag to make it non inheritable." +msgstr "" + +#: library/msvcrt.rst:86 msgid "" "Raises an :ref:`auditing event ` ``msvcrt.open_osfhandle`` with " "arguments ``handle``, ``flags``." msgstr "" -#: library/msvcrt.rst:87 +#: library/msvcrt.rst:91 msgid "" -"Return the file handle for the file descriptor *fd*. Raises :exc:`OSError` " +"Return the file handle for the file descriptor *fd*. Raises :exc:`OSError` " "if *fd* is not recognized." msgstr "" -#: library/msvcrt.rst:90 +#: library/msvcrt.rst:94 msgid "" "Raises an :ref:`auditing event ` ``msvcrt.get_osfhandle`` with " "argument ``fd``." msgstr "" -#: library/msvcrt.rst:96 +#: library/msvcrt.rst:100 msgid "Console I/O" msgstr "" -#: library/msvcrt.rst:101 -msgid "Return ``True`` if a keypress is waiting to be read." +#: library/msvcrt.rst:105 +msgid "" +"Returns a nonzero value if a keypress is waiting to be read. Otherwise, " +"return 0." msgstr "" -#: library/msvcrt.rst:106 +#: library/msvcrt.rst:111 msgid "" "Read a keypress and return the resulting character as a byte string. Nothing " -"is echoed to the console. This call will block if a keypress is not already " +"is echoed to the console. This call will block if a keypress is not already " "available, but will not wait for :kbd:`Enter` to be pressed. If the pressed " "key was a special function key, this will return ``'\\000'`` or ``'\\xe0'``; " "the next call will return the keycode. The :kbd:`Control-C` keypress cannot " "be read with this function." msgstr "" -#: library/msvcrt.rst:116 +#: library/msvcrt.rst:121 msgid "Wide char variant of :func:`getch`, returning a Unicode value." msgstr "" -#: library/msvcrt.rst:121 +#: library/msvcrt.rst:126 msgid "" -"Similar to :func:`getch`, but the keypress will be echoed if it represents " -"a printable character." +"Similar to :func:`getch`, but the keypress will be echoed if it represents a " +"printable character." msgstr "" -#: library/msvcrt.rst:127 +#: library/msvcrt.rst:132 msgid "Wide char variant of :func:`getche`, returning a Unicode value." msgstr "" -#: library/msvcrt.rst:132 +#: library/msvcrt.rst:137 msgid "Print the byte string *char* to the console without buffering." msgstr "" -#: library/msvcrt.rst:137 +#: library/msvcrt.rst:142 msgid "Wide char variant of :func:`putch`, accepting a Unicode value." msgstr "" -#: library/msvcrt.rst:142 +#: library/msvcrt.rst:147 msgid "" "Cause the byte string *char* to be \"pushed back\" into the console buffer; " "it will be the next character read by :func:`getch` or :func:`getche`." msgstr "" -#: library/msvcrt.rst:148 +#: library/msvcrt.rst:153 msgid "Wide char variant of :func:`ungetch`, accepting a Unicode value." msgstr "" -#: library/msvcrt.rst:154 +#: library/msvcrt.rst:159 msgid "Other Functions" msgstr "" -#: library/msvcrt.rst:159 +#: library/msvcrt.rst:164 msgid "" "Force the :c:func:`malloc` heap to clean itself up and return unused blocks " "to the operating system. On failure, this raises :exc:`OSError`." msgstr "" -#: library/msvcrt.rst:164 +#: library/msvcrt.rst:170 +msgid "" +"Changes the location where the C runtime writes an error message for an " +"error that might end the program. *mode* must be one of the :const:`!" +"OUT_\\*` constants listed below or :const:`REPORT_ERRMODE`. Returns the old " +"setting or -1 if an error occurs. Only available in :ref:`debug build of " +"Python `." +msgstr "" + +#: library/msvcrt.rst:179 +msgid "" +"Error sink is determined by the app's type. Only available in :ref:`debug " +"build of Python `." +msgstr "" + +#: library/msvcrt.rst:185 +msgid "" +"Error sink is a standard error. Only available in :ref:`debug build of " +"Python `." +msgstr "" + +#: library/msvcrt.rst:191 +msgid "" +"Error sink is a message box. Only available in :ref:`debug build of Python " +"`." +msgstr "" + +#: library/msvcrt.rst:197 +msgid "" +"Report the current error mode value. Only available in :ref:`debug build of " +"Python `." +msgstr "" + +#: library/msvcrt.rst:203 +msgid "" +"Specifies the destination or destinations for a specific report type " +"generated by :c:func:`!_CrtDbgReport` in the MS VC++ runtime. *type* must be " +"one of the :const:`!CRT_\\*` constants listed below. *mode* must be one of " +"the :const:`!CRTDBG_\\*` constants listed below. Only available in :ref:" +"`debug build of Python `." +msgstr "" + +#: library/msvcrt.rst:212 +msgid "" +"After you use :func:`CrtSetReportMode` to specify :const:`CRTDBG_MODE_FILE`, " +"you can specify the file handle to receive the message text. *type* must be " +"one of the :const:`!CRT_\\*` constants listed below. *file* should be the " +"file handle your want specified. Only available in :ref:`debug build of " +"Python `." +msgstr "" + +#: library/msvcrt.rst:221 +msgid "" +"Warnings, messages, and information that doesn't need immediate attention." +msgstr "" + +#: library/msvcrt.rst:226 +msgid "" +"Errors, unrecoverable problems, and issues that require immediate attention." +msgstr "" + +#: library/msvcrt.rst:231 +msgid "Assertion failures." +msgstr "" + +#: library/msvcrt.rst:236 +msgid "Writes the message to the debugger's output window." +msgstr "" + +#: library/msvcrt.rst:241 +msgid "" +"Writes the message to a user-supplied file handle. :func:`CrtSetReportFile` " +"should be called to define the specific file or stream to use as the " +"destination." +msgstr "" + +#: library/msvcrt.rst:248 +msgid "" +"Creates a message box to display the message along with the ``Abort``, " +"``Retry``, and ``Ignore`` buttons." +msgstr "" + +#: library/msvcrt.rst:254 +msgid "Returns current *mode* for the specified *type*." +msgstr "" + +#: library/msvcrt.rst:259 msgid "The CRT Assembly version, from the :file:`crtassem.h` header file." msgstr "" -#: library/msvcrt.rst:169 +#: library/msvcrt.rst:264 msgid "" "The VC Assembly public key token, from the :file:`crtassem.h` header file." msgstr "" -#: library/msvcrt.rst:174 +#: library/msvcrt.rst:269 msgid "" "The Libraries Assembly name prefix, from the :file:`crtassem.h` header file." msgstr "" diff --git a/library/multiprocessing.po b/library/multiprocessing.po index 5dfdb731..9c131053 100644 --- a/library/multiprocessing.po +++ b/library/multiprocessing.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -25,15 +25,14 @@ msgstr "" msgid "**Source code:** :source:`Lib/multiprocessing/`" msgstr "" -#: includes/wasm-notavail.rst:3 +#: includes/wasm-mobile-notavail.rst:3 msgid "Availability" msgstr "" -#: includes/wasm-notavail.rst:5 +#: includes/wasm-mobile-notavail.rst:5 msgid "" -"This module does not work or is not available on WebAssembly platforms " -"``wasm32-emscripten`` and ``wasm32-wasi``. See :ref:`wasm-availability` for " -"more information." +"This module is not supported on :ref:`mobile platforms ` or :ref:`WebAssembly platforms `." msgstr "" #: library/multiprocessing.rst:14 @@ -1388,8 +1387,8 @@ msgstr "" #: library/multiprocessing.rst:1011 msgid "" "This number is not equivalent to the number of CPUs the current process can " -"use. The number of usable CPUs can be obtained with ``len(os." -"sched_getaffinity(0))``" +"use. The number of usable CPUs can be obtained with :func:`os." +"process_cpu_count` (or ``len(os.sched_getaffinity(0))``)." msgstr "" #: library/multiprocessing.rst:1015 @@ -1399,39 +1398,46 @@ msgid "" msgstr "" #: library/multiprocessing.rst:1019 -msgid ":func:`os.cpu_count`" +msgid ":func:`os.cpu_count` :func:`os.process_cpu_count`" msgstr "" -#: library/multiprocessing.rst:1023 +#: library/multiprocessing.rst:1024 +msgid "" +"The return value can also be overridden using the :option:`-X cpu_count <-" +"X>` flag or :envvar:`PYTHON_CPU_COUNT` as this is merely a wrapper around " +"the :mod:`os` cpu count APIs." +msgstr "" + +#: library/multiprocessing.rst:1030 msgid "" "Return the :class:`Process` object corresponding to the current process." msgstr "" -#: library/multiprocessing.rst:1025 +#: library/multiprocessing.rst:1032 msgid "An analogue of :func:`threading.current_thread`." msgstr "" -#: library/multiprocessing.rst:1029 +#: library/multiprocessing.rst:1036 msgid "" "Return the :class:`Process` object corresponding to the parent process of " "the :func:`current_process`. For the main process, ``parent_process`` will " "be ``None``." msgstr "" -#: library/multiprocessing.rst:1037 +#: library/multiprocessing.rst:1044 msgid "" "Add support for when a program which uses :mod:`multiprocessing` has been " "frozen to produce a Windows executable. (Has been tested with **py2exe**, " "**PyInstaller** and **cx_Freeze**.)" msgstr "" -#: library/multiprocessing.rst:1041 +#: library/multiprocessing.rst:1048 msgid "" "One needs to call this function straight after the ``if __name__ == " "'__main__'`` line of the main module. For example::" msgstr "" -#: library/multiprocessing.rst:1044 +#: library/multiprocessing.rst:1051 msgid "" "from multiprocessing import Process, freeze_support\n" "\n" @@ -1443,13 +1449,13 @@ msgid "" " Process(target=f).start()" msgstr "" -#: library/multiprocessing.rst:1053 +#: library/multiprocessing.rst:1060 msgid "" "If the ``freeze_support()`` line is omitted then trying to run the frozen " "executable will raise :exc:`RuntimeError`." msgstr "" -#: library/multiprocessing.rst:1056 +#: library/multiprocessing.rst:1063 msgid "" "Calling ``freeze_support()`` has no effect when invoked on any operating " "system other than Windows. In addition, if the module is being run normally " @@ -1457,7 +1463,7 @@ msgid "" "``freeze_support()`` has no effect." msgstr "" -#: library/multiprocessing.rst:1063 +#: library/multiprocessing.rst:1070 msgid "" "Returns a list of the supported start methods, the first of which is the " "default. The possible start methods are ``'fork'``, ``'spawn'`` and " @@ -1465,13 +1471,13 @@ msgid "" "`multiprocessing-start-methods`." msgstr "" -#: library/multiprocessing.rst:1072 +#: library/multiprocessing.rst:1079 msgid "" "Return a context object which has the same attributes as the :mod:" "`multiprocessing` module." msgstr "" -#: library/multiprocessing.rst:1075 +#: library/multiprocessing.rst:1082 msgid "" "If *method* is ``None`` then the default context is returned. Otherwise " "*method* should be ``'fork'``, ``'spawn'``, ``'forkserver'``. :exc:" @@ -1479,54 +1485,54 @@ msgid "" "ref:`multiprocessing-start-methods`." msgstr "" -#: library/multiprocessing.rst:1084 +#: library/multiprocessing.rst:1091 msgid "Return the name of start method used for starting processes." msgstr "" -#: library/multiprocessing.rst:1086 +#: library/multiprocessing.rst:1093 msgid "" "If the start method has not been fixed and *allow_none* is false, then the " "start method is fixed to the default and the name is returned. If the start " "method has not been fixed and *allow_none* is true then ``None`` is returned." msgstr "" -#: library/multiprocessing.rst:1091 +#: library/multiprocessing.rst:1098 msgid "" "The return value can be ``'fork'``, ``'spawn'``, ``'forkserver'`` or " "``None``. See :ref:`multiprocessing-start-methods`." msgstr "" -#: library/multiprocessing.rst:1098 +#: library/multiprocessing.rst:1105 msgid "" "On macOS, the *spawn* start method is now the default. The *fork* start " "method should be considered unsafe as it can lead to crashes of the " "subprocess. See :issue:`33725`." msgstr "" -#: library/multiprocessing.rst:1104 +#: library/multiprocessing.rst:1111 msgid "" "Set the path of the Python interpreter to use when starting a child process. " "(By default :data:`sys.executable` is used). Embedders will probably need " "to do some thing like ::" msgstr "" -#: library/multiprocessing.rst:1108 +#: library/multiprocessing.rst:1115 msgid "set_executable(os.path.join(sys.exec_prefix, 'pythonw.exe'))" msgstr "" -#: library/multiprocessing.rst:1110 +#: library/multiprocessing.rst:1117 msgid "before they can create child processes." msgstr "" -#: library/multiprocessing.rst:1112 +#: library/multiprocessing.rst:1119 msgid "Now supported on POSIX when the ``'spawn'`` start method is used." msgstr "" -#: library/multiprocessing.rst:1115 +#: library/multiprocessing.rst:1122 msgid "Accepts a :term:`path-like object`." msgstr "" -#: library/multiprocessing.rst:1120 +#: library/multiprocessing.rst:1127 msgid "" "Set a list of module names for the forkserver main process to attempt to " "import so that their already imported state is inherited by forked " @@ -1535,19 +1541,19 @@ msgid "" "process." msgstr "" -#: library/multiprocessing.rst:1126 +#: library/multiprocessing.rst:1133 msgid "" "For this to work, it must be called before the forkserver process has been " "launched (before creating a :class:`Pool` or starting a :class:`Process`)." msgstr "" -#: library/multiprocessing.rst:1129 +#: library/multiprocessing.rst:1136 msgid "" "Only meaningful when using the ``'forkserver'`` start method. See :ref:" "`multiprocessing-start-methods`." msgstr "" -#: library/multiprocessing.rst:1136 +#: library/multiprocessing.rst:1143 msgid "" "Set the method which should be used to start child processes. The *method* " "argument can be ``'fork'``, ``'spawn'`` or ``'forkserver'``. Raises :exc:" @@ -1557,17 +1563,17 @@ msgid "" "then the context is set to the default context." msgstr "" -#: library/multiprocessing.rst:1143 +#: library/multiprocessing.rst:1150 msgid "" "Note that this should be called at most once, and it should be protected " "inside the ``if __name__ == '__main__'`` clause of the main module." msgstr "" -#: library/multiprocessing.rst:1147 +#: library/multiprocessing.rst:1154 msgid "See :ref:`multiprocessing-start-methods`." msgstr "" -#: library/multiprocessing.rst:1153 +#: library/multiprocessing.rst:1160 msgid "" ":mod:`multiprocessing` contains no analogues of :func:`threading." "active_count`, :func:`threading.enumerate`, :func:`threading.settrace`, :" @@ -1575,75 +1581,75 @@ msgid "" "local`." msgstr "" -#: library/multiprocessing.rst:1160 +#: library/multiprocessing.rst:1167 msgid "Connection Objects" msgstr "" -#: library/multiprocessing.rst:1164 +#: library/multiprocessing.rst:1171 msgid "" "Connection objects allow the sending and receiving of picklable objects or " "strings. They can be thought of as message oriented connected sockets." msgstr "" -#: library/multiprocessing.rst:1167 +#: library/multiprocessing.rst:1174 msgid "" "Connection objects are usually created using :func:`Pipe ` -- see also :ref:`multiprocessing-listeners-clients`." msgstr "" -#: library/multiprocessing.rst:1175 +#: library/multiprocessing.rst:1182 msgid "" "Send an object to the other end of the connection which should be read " "using :meth:`recv`." msgstr "" -#: library/multiprocessing.rst:1178 +#: library/multiprocessing.rst:1185 msgid "" "The object must be picklable. Very large pickles (approximately 32 MiB+, " "though it depends on the OS) may raise a :exc:`ValueError` exception." msgstr "" -#: library/multiprocessing.rst:1183 +#: library/multiprocessing.rst:1190 msgid "" "Return an object sent from the other end of the connection using :meth:" "`send`. Blocks until there is something to receive. Raises :exc:`EOFError` " "if there is nothing left to receive and the other end was closed." msgstr "" -#: library/multiprocessing.rst:1190 +#: library/multiprocessing.rst:1197 msgid "Return the file descriptor or handle used by the connection." msgstr "" -#: library/multiprocessing.rst:1194 +#: library/multiprocessing.rst:1201 msgid "Close the connection." msgstr "" -#: library/multiprocessing.rst:1196 +#: library/multiprocessing.rst:1203 msgid "This is called automatically when the connection is garbage collected." msgstr "" -#: library/multiprocessing.rst:1200 +#: library/multiprocessing.rst:1207 msgid "Return whether there is any data available to be read." msgstr "" -#: library/multiprocessing.rst:1202 +#: library/multiprocessing.rst:1209 msgid "" "If *timeout* is not specified then it will return immediately. If *timeout* " "is a number then this specifies the maximum time in seconds to block. If " "*timeout* is ``None`` then an infinite timeout is used." msgstr "" -#: library/multiprocessing.rst:1206 +#: library/multiprocessing.rst:1213 msgid "" "Note that multiple connection objects may be polled at once by using :func:" "`multiprocessing.connection.wait`." msgstr "" -#: library/multiprocessing.rst:1211 +#: library/multiprocessing.rst:1218 msgid "Send byte data from a :term:`bytes-like object` as a complete message." msgstr "" -#: library/multiprocessing.rst:1213 +#: library/multiprocessing.rst:1220 msgid "" "If *offset* is given then data is read from that position in *buffer*. If " "*size* is given then that many bytes will be read from buffer. Very large " @@ -1651,7 +1657,7 @@ msgid "" "exc:`ValueError` exception" msgstr "" -#: library/multiprocessing.rst:1220 +#: library/multiprocessing.rst:1227 msgid "" "Return a complete message of byte data sent from the other end of the " "connection as a string. Blocks until there is something to receive. Raises :" @@ -1659,19 +1665,19 @@ msgid "" "closed." msgstr "" -#: library/multiprocessing.rst:1225 +#: library/multiprocessing.rst:1232 msgid "" "If *maxlength* is specified and the message is longer than *maxlength* then :" "exc:`OSError` is raised and the connection will no longer be readable." msgstr "" -#: library/multiprocessing.rst:1229 +#: library/multiprocessing.rst:1236 msgid "" "This function used to raise :exc:`IOError`, which is now an alias of :exc:" "`OSError`." msgstr "" -#: library/multiprocessing.rst:1236 +#: library/multiprocessing.rst:1243 msgid "" "Read into *buffer* a complete message of byte data sent from the other end " "of the connection and return the number of bytes in the message. Blocks " @@ -1679,38 +1685,38 @@ msgid "" "nothing left to receive and the other end was closed." msgstr "" -#: library/multiprocessing.rst:1242 +#: library/multiprocessing.rst:1249 msgid "" "*buffer* must be a writable :term:`bytes-like object`. If *offset* is given " "then the message will be written into the buffer from that position. Offset " "must be a non-negative integer less than the length of *buffer* (in bytes)." msgstr "" -#: library/multiprocessing.rst:1247 +#: library/multiprocessing.rst:1254 msgid "" "If the buffer is too short then a :exc:`BufferTooShort` exception is raised " "and the complete message is available as ``e.args[0]`` where ``e`` is the " "exception instance." msgstr "" -#: library/multiprocessing.rst:1251 +#: library/multiprocessing.rst:1258 msgid "" "Connection objects themselves can now be transferred between processes " "using :meth:`Connection.send` and :meth:`Connection.recv`." msgstr "" -#: library/multiprocessing.rst:1255 +#: library/multiprocessing.rst:1262 msgid "" "Connection objects also now support the context management protocol -- see :" "ref:`typecontextmanager`. :meth:`~contextmanager.__enter__` returns the " "connection object, and :meth:`~contextmanager.__exit__` calls :meth:`close`." msgstr "" -#: library/multiprocessing.rst:1259 +#: library/multiprocessing.rst:1266 msgid "For example:" msgstr "" -#: library/multiprocessing.rst:1261 +#: library/multiprocessing.rst:1268 msgid "" ">>> from multiprocessing import Pipe\n" ">>> a, b = Pipe()\n" @@ -1730,14 +1736,14 @@ msgid "" "array('i', [0, 1, 2, 3, 4, 0, 0, 0, 0, 0])" msgstr "" -#: library/multiprocessing.rst:1284 +#: library/multiprocessing.rst:1291 msgid "" "The :meth:`Connection.recv` method automatically unpickles the data it " "receives, which can be a security risk unless you can trust the process " "which sent the message." msgstr "" -#: library/multiprocessing.rst:1288 +#: library/multiprocessing.rst:1295 msgid "" "Therefore, unless the connection object was produced using :func:`Pipe` you " "should only use the :meth:`~Connection.recv` and :meth:`~Connection.send` " @@ -1745,71 +1751,71 @@ msgid "" "`multiprocessing-auth-keys`." msgstr "" -#: library/multiprocessing.rst:1295 +#: library/multiprocessing.rst:1302 msgid "" "If a process is killed while it is trying to read or write to a pipe then " "the data in the pipe is likely to become corrupted, because it may become " "impossible to be sure where the message boundaries lie." msgstr "" -#: library/multiprocessing.rst:1301 +#: library/multiprocessing.rst:1308 msgid "Synchronization primitives" msgstr "" -#: library/multiprocessing.rst:1305 +#: library/multiprocessing.rst:1312 msgid "" "Generally synchronization primitives are not as necessary in a multiprocess " "program as they are in a multithreaded program. See the documentation for :" "mod:`threading` module." msgstr "" -#: library/multiprocessing.rst:1309 +#: library/multiprocessing.rst:1316 msgid "" "Note that one can also create synchronization primitives by using a manager " "object -- see :ref:`multiprocessing-managers`." msgstr "" -#: library/multiprocessing.rst:1314 +#: library/multiprocessing.rst:1321 msgid "A barrier object: a clone of :class:`threading.Barrier`." msgstr "" -#: library/multiprocessing.rst:1320 +#: library/multiprocessing.rst:1327 msgid "" "A bounded semaphore object: a close analog of :class:`threading." "BoundedSemaphore`." msgstr "" -#: library/multiprocessing.rst:1323 library/multiprocessing.rst:1461 +#: library/multiprocessing.rst:1330 library/multiprocessing.rst:1468 msgid "" "A solitary difference from its close analog exists: its ``acquire`` method's " "first argument is named *block*, as is consistent with :meth:`Lock.acquire`." msgstr "" -#: library/multiprocessing.rst:1327 +#: library/multiprocessing.rst:1334 msgid "" "On macOS, this is indistinguishable from :class:`Semaphore` because " "``sem_getvalue()`` is not implemented on that platform." msgstr "" -#: library/multiprocessing.rst:1332 +#: library/multiprocessing.rst:1339 msgid "A condition variable: an alias for :class:`threading.Condition`." msgstr "" -#: library/multiprocessing.rst:1334 +#: library/multiprocessing.rst:1341 msgid "" "If *lock* is specified then it should be a :class:`Lock` or :class:`RLock` " "object from :mod:`multiprocessing`." msgstr "" -#: library/multiprocessing.rst:1337 library/multiprocessing.rst:1875 +#: library/multiprocessing.rst:1344 library/multiprocessing.rst:1882 msgid "The :meth:`~threading.Condition.wait_for` method was added." msgstr "" -#: library/multiprocessing.rst:1342 +#: library/multiprocessing.rst:1349 msgid "A clone of :class:`threading.Event`." msgstr "" -#: library/multiprocessing.rst:1347 +#: library/multiprocessing.rst:1354 msgid "" "A non-recursive lock object: a close analog of :class:`threading.Lock`. Once " "a process or thread has acquired a lock, subsequent attempts to acquire it " @@ -1820,24 +1826,24 @@ msgid "" "as noted." msgstr "" -#: library/multiprocessing.rst:1355 +#: library/multiprocessing.rst:1362 msgid "" "Note that :class:`Lock` is actually a factory function which returns an " "instance of ``multiprocessing.synchronize.Lock`` initialized with a default " "context." msgstr "" -#: library/multiprocessing.rst:1359 +#: library/multiprocessing.rst:1366 msgid "" ":class:`Lock` supports the :term:`context manager` protocol and thus may be " "used in :keyword:`with` statements." msgstr "" -#: library/multiprocessing.rst:1364 library/multiprocessing.rst:1415 +#: library/multiprocessing.rst:1371 library/multiprocessing.rst:1422 msgid "Acquire a lock, blocking or non-blocking." msgstr "" -#: library/multiprocessing.rst:1366 +#: library/multiprocessing.rst:1373 msgid "" "With the *block* argument set to ``True`` (the default), the method call " "will block until the lock is in an unlocked state, then set it to locked and " @@ -1845,14 +1851,14 @@ msgid "" "that in :meth:`threading.Lock.acquire`." msgstr "" -#: library/multiprocessing.rst:1371 +#: library/multiprocessing.rst:1378 msgid "" "With the *block* argument set to ``False``, the method call does not block. " "If the lock is currently in a locked state, return ``False``; otherwise set " "the lock to a locked state and return ``True``." msgstr "" -#: library/multiprocessing.rst:1375 +#: library/multiprocessing.rst:1382 msgid "" "When invoked with a positive, floating-point value for *timeout*, block for " "at most the number of seconds specified by *timeout* as long as the lock can " @@ -1866,19 +1872,19 @@ msgid "" "acquired or ``False`` if the timeout period has elapsed." msgstr "" -#: library/multiprocessing.rst:1390 +#: library/multiprocessing.rst:1397 msgid "" "Release a lock. This can be called from any process or thread, not only the " "process or thread which originally acquired the lock." msgstr "" -#: library/multiprocessing.rst:1393 +#: library/multiprocessing.rst:1400 msgid "" "Behavior is the same as in :meth:`threading.Lock.release` except that when " "invoked on an unlocked lock, a :exc:`ValueError` is raised." msgstr "" -#: library/multiprocessing.rst:1399 +#: library/multiprocessing.rst:1406 msgid "" "A recursive lock object: a close analog of :class:`threading.RLock`. A " "recursive lock must be released by the process or thread that acquired it. " @@ -1887,20 +1893,20 @@ msgid "" "release it once for each time it has been acquired." msgstr "" -#: library/multiprocessing.rst:1405 +#: library/multiprocessing.rst:1412 msgid "" "Note that :class:`RLock` is actually a factory function which returns an " "instance of ``multiprocessing.synchronize.RLock`` initialized with a default " "context." msgstr "" -#: library/multiprocessing.rst:1409 +#: library/multiprocessing.rst:1416 msgid "" ":class:`RLock` supports the :term:`context manager` protocol and thus may be " "used in :keyword:`with` statements." msgstr "" -#: library/multiprocessing.rst:1417 +#: library/multiprocessing.rst:1424 msgid "" "When invoked with the *block* argument set to ``True``, block until the lock " "is in an unlocked state (not owned by any process or thread) unless the lock " @@ -1913,7 +1919,7 @@ msgid "" "itself." msgstr "" -#: library/multiprocessing.rst:1427 +#: library/multiprocessing.rst:1434 msgid "" "When invoked with the *block* argument set to ``False``, do not block. If " "the lock has already been acquired (and thus is owned) by another process or " @@ -1924,14 +1930,14 @@ msgid "" "a return value of ``True``." msgstr "" -#: library/multiprocessing.rst:1435 +#: library/multiprocessing.rst:1442 msgid "" "Use and behaviors of the *timeout* argument are the same as in :meth:`Lock." "acquire`. Note that some of these behaviors of *timeout* differ from the " "implemented behaviors in :meth:`threading.RLock.acquire`." msgstr "" -#: library/multiprocessing.rst:1442 +#: library/multiprocessing.rst:1449 msgid "" "Release a lock, decrementing the recursion level. If after the decrement " "the recursion level is zero, reset the lock to unlocked (not owned by any " @@ -1941,7 +1947,7 @@ msgid "" "locked and owned by the calling process or thread." msgstr "" -#: library/multiprocessing.rst:1450 +#: library/multiprocessing.rst:1457 msgid "" "Only call this method when the calling process or thread owns the lock. An :" "exc:`AssertionError` is raised if this method is called by a process or " @@ -1950,17 +1956,17 @@ msgid "" "from the implemented behavior in :meth:`threading.RLock.release`." msgstr "" -#: library/multiprocessing.rst:1459 +#: library/multiprocessing.rst:1466 msgid "A semaphore object: a close analog of :class:`threading.Semaphore`." msgstr "" -#: library/multiprocessing.rst:1466 +#: library/multiprocessing.rst:1473 msgid "" "On macOS, ``sem_timedwait`` is unsupported, so calling ``acquire()`` with a " "timeout will emulate that function's behavior using a sleeping loop." msgstr "" -#: library/multiprocessing.rst:1471 +#: library/multiprocessing.rst:1478 msgid "" "Some of this package's functionality requires a functioning shared semaphore " "implementation on the host operating system. Without one, the :mod:" @@ -1969,31 +1975,31 @@ msgid "" "additional information." msgstr "" -#: library/multiprocessing.rst:1479 +#: library/multiprocessing.rst:1486 msgid "Shared :mod:`ctypes` Objects" msgstr "" -#: library/multiprocessing.rst:1481 +#: library/multiprocessing.rst:1488 msgid "" "It is possible to create shared objects using shared memory which can be " "inherited by child processes." msgstr "" -#: library/multiprocessing.rst:1486 +#: library/multiprocessing.rst:1493 msgid "" "Return a :mod:`ctypes` object allocated from shared memory. By default the " "return value is actually a synchronized wrapper for the object. The object " "itself can be accessed via the *value* attribute of a :class:`Value`." msgstr "" -#: library/multiprocessing.rst:1490 library/multiprocessing.rst:1577 +#: library/multiprocessing.rst:1497 library/multiprocessing.rst:1584 msgid "" "*typecode_or_type* determines the type of the returned object: it is either " "a ctypes type or a one character typecode of the kind used by the :mod:" "`array` module. *\\*args* is passed on to the constructor for the type." msgstr "" -#: library/multiprocessing.rst:1494 +#: library/multiprocessing.rst:1501 msgid "" "If *lock* is ``True`` (the default) then a new recursive lock object is " "created to synchronize access to the value. If *lock* is a :class:`Lock` " @@ -2003,41 +2009,41 @@ msgid "" "\"process-safe\"." msgstr "" -#: library/multiprocessing.rst:1501 +#: library/multiprocessing.rst:1508 msgid "" "Operations like ``+=`` which involve a read and write are not atomic. So " "if, for instance, you want to atomically increment a shared value it is " "insufficient to just do ::" msgstr "" -#: library/multiprocessing.rst:1505 +#: library/multiprocessing.rst:1512 msgid "counter.value += 1" msgstr "" -#: library/multiprocessing.rst:1507 +#: library/multiprocessing.rst:1514 msgid "" "Assuming the associated lock is recursive (which it is by default) you can " "instead do ::" msgstr "" -#: library/multiprocessing.rst:1510 +#: library/multiprocessing.rst:1517 msgid "" "with counter.get_lock():\n" " counter.value += 1" msgstr "" -#: library/multiprocessing.rst:1513 library/multiprocessing.rst:1603 -#: library/multiprocessing.rst:1618 +#: library/multiprocessing.rst:1520 library/multiprocessing.rst:1610 +#: library/multiprocessing.rst:1625 msgid "Note that *lock* is a keyword-only argument." msgstr "" -#: library/multiprocessing.rst:1517 +#: library/multiprocessing.rst:1524 msgid "" "Return a ctypes array allocated from shared memory. By default the return " "value is actually a synchronized wrapper for the array." msgstr "" -#: library/multiprocessing.rst:1520 +#: library/multiprocessing.rst:1527 msgid "" "*typecode_or_type* determines the type of the elements of the returned " "array: it is either a ctypes type or a one character typecode of the kind " @@ -2047,7 +2053,7 @@ msgid "" "initialize the array and whose length determines the length of the array." msgstr "" -#: library/multiprocessing.rst:1527 +#: library/multiprocessing.rst:1534 msgid "" "If *lock* is ``True`` (the default) then a new lock object is created to " "synchronize access to the value. If *lock* is a :class:`Lock` or :class:" @@ -2057,28 +2063,28 @@ msgid "" "safe\"." msgstr "" -#: library/multiprocessing.rst:1534 +#: library/multiprocessing.rst:1541 msgid "Note that *lock* is a keyword only argument." msgstr "" -#: library/multiprocessing.rst:1536 +#: library/multiprocessing.rst:1543 msgid "" "Note that an array of :data:`ctypes.c_char` has *value* and *raw* attributes " "which allow one to use it to store and retrieve strings." msgstr "" -#: library/multiprocessing.rst:1541 +#: library/multiprocessing.rst:1548 msgid "The :mod:`multiprocessing.sharedctypes` module" msgstr "" -#: library/multiprocessing.rst:1546 +#: library/multiprocessing.rst:1553 msgid "" "The :mod:`multiprocessing.sharedctypes` module provides functions for " "allocating :mod:`ctypes` objects from shared memory which can be inherited " "by child processes." msgstr "" -#: library/multiprocessing.rst:1552 +#: library/multiprocessing.rst:1559 msgid "" "Although it is possible to store a pointer in shared memory remember that " "this will refer to a location in the address space of a specific process. " @@ -2087,11 +2093,11 @@ msgid "" "may cause a crash." msgstr "" -#: library/multiprocessing.rst:1560 +#: library/multiprocessing.rst:1567 msgid "Return a ctypes array allocated from shared memory." msgstr "" -#: library/multiprocessing.rst:1562 +#: library/multiprocessing.rst:1569 msgid "" "*typecode_or_type* determines the type of the elements of the returned " "array: it is either a ctypes type or a one character typecode of the kind " @@ -2101,39 +2107,39 @@ msgid "" "initialize the array and whose length determines the length of the array." msgstr "" -#: library/multiprocessing.rst:1569 +#: library/multiprocessing.rst:1576 msgid "" "Note that setting and getting an element is potentially non-atomic -- use :" "func:`Array` instead to make sure that access is automatically synchronized " "using a lock." msgstr "" -#: library/multiprocessing.rst:1575 +#: library/multiprocessing.rst:1582 msgid "Return a ctypes object allocated from shared memory." msgstr "" -#: library/multiprocessing.rst:1581 +#: library/multiprocessing.rst:1588 msgid "" "Note that setting and getting the value is potentially non-atomic -- use :" "func:`Value` instead to make sure that access is automatically synchronized " "using a lock." msgstr "" -#: library/multiprocessing.rst:1585 +#: library/multiprocessing.rst:1592 msgid "" "Note that an array of :data:`ctypes.c_char` has ``value`` and ``raw`` " "attributes which allow one to use it to store and retrieve strings -- see " "documentation for :mod:`ctypes`." msgstr "" -#: library/multiprocessing.rst:1591 +#: library/multiprocessing.rst:1598 msgid "" "The same as :func:`RawArray` except that depending on the value of *lock* a " "process-safe synchronization wrapper may be returned instead of a raw ctypes " "array." msgstr "" -#: library/multiprocessing.rst:1595 library/multiprocessing.rst:1611 +#: library/multiprocessing.rst:1602 library/multiprocessing.rst:1618 msgid "" "If *lock* is ``True`` (the default) then a new lock object is created to " "synchronize access to the value. If *lock* is a :class:`~multiprocessing." @@ -2143,113 +2149,113 @@ msgid "" "not necessarily be \"process-safe\"." msgstr "" -#: library/multiprocessing.rst:1607 +#: library/multiprocessing.rst:1614 msgid "" "The same as :func:`RawValue` except that depending on the value of *lock* a " "process-safe synchronization wrapper may be returned instead of a raw ctypes " "object." msgstr "" -#: library/multiprocessing.rst:1622 +#: library/multiprocessing.rst:1629 msgid "" "Return a ctypes object allocated from shared memory which is a copy of the " "ctypes object *obj*." msgstr "" -#: library/multiprocessing.rst:1627 +#: library/multiprocessing.rst:1634 msgid "" "Return a process-safe wrapper object for a ctypes object which uses *lock* " "to synchronize access. If *lock* is ``None`` (the default) then a :class:" "`multiprocessing.RLock` object is created automatically." msgstr "" -#: library/multiprocessing.rst:1631 +#: library/multiprocessing.rst:1638 msgid "" "A synchronized wrapper will have two methods in addition to those of the " "object it wraps: :meth:`get_obj` returns the wrapped object and :meth:" "`get_lock` returns the lock object used for synchronization." msgstr "" -#: library/multiprocessing.rst:1635 +#: library/multiprocessing.rst:1642 msgid "" "Note that accessing the ctypes object through the wrapper can be a lot " "slower than accessing the raw ctypes object." msgstr "" -#: library/multiprocessing.rst:1638 +#: library/multiprocessing.rst:1645 msgid "Synchronized objects support the :term:`context manager` protocol." msgstr "" -#: library/multiprocessing.rst:1642 +#: library/multiprocessing.rst:1649 msgid "" "The table below compares the syntax for creating shared ctypes objects from " "shared memory with the normal ctypes syntax. (In the table ``MyStruct`` is " "some subclass of :class:`ctypes.Structure`.)" msgstr "" -#: library/multiprocessing.rst:1647 +#: library/multiprocessing.rst:1654 msgid "ctypes" msgstr "" -#: library/multiprocessing.rst:1647 +#: library/multiprocessing.rst:1654 msgid "sharedctypes using type" msgstr "" -#: library/multiprocessing.rst:1647 +#: library/multiprocessing.rst:1654 msgid "sharedctypes using typecode" msgstr "" -#: library/multiprocessing.rst:1649 +#: library/multiprocessing.rst:1656 msgid "c_double(2.4)" msgstr "" -#: library/multiprocessing.rst:1649 +#: library/multiprocessing.rst:1656 msgid "RawValue(c_double, 2.4)" msgstr "" -#: library/multiprocessing.rst:1649 +#: library/multiprocessing.rst:1656 msgid "RawValue('d', 2.4)" msgstr "" -#: library/multiprocessing.rst:1650 +#: library/multiprocessing.rst:1657 msgid "MyStruct(4, 6)" msgstr "" -#: library/multiprocessing.rst:1650 +#: library/multiprocessing.rst:1657 msgid "RawValue(MyStruct, 4, 6)" msgstr "" -#: library/multiprocessing.rst:1651 +#: library/multiprocessing.rst:1658 msgid "(c_short * 7)()" msgstr "" -#: library/multiprocessing.rst:1651 +#: library/multiprocessing.rst:1658 msgid "RawArray(c_short, 7)" msgstr "" -#: library/multiprocessing.rst:1651 +#: library/multiprocessing.rst:1658 msgid "RawArray('h', 7)" msgstr "" -#: library/multiprocessing.rst:1652 +#: library/multiprocessing.rst:1659 msgid "(c_int * 3)(9, 2, 8)" msgstr "" -#: library/multiprocessing.rst:1652 +#: library/multiprocessing.rst:1659 msgid "RawArray(c_int, (9, 2, 8))" msgstr "" -#: library/multiprocessing.rst:1652 +#: library/multiprocessing.rst:1659 msgid "RawArray('i', (9, 2, 8))" msgstr "" -#: library/multiprocessing.rst:1656 +#: library/multiprocessing.rst:1663 msgid "" "Below is an example where a number of ctypes objects are modified by a child " "process::" msgstr "" -#: library/multiprocessing.rst:1659 +#: library/multiprocessing.rst:1666 msgid "" "from multiprocessing import Process, Lock\n" "from multiprocessing.sharedctypes import Value, Array\n" @@ -2284,11 +2290,11 @@ msgid "" " print([(a.x, a.y) for a in A])" msgstr "" -#: library/multiprocessing.rst:1694 +#: library/multiprocessing.rst:1701 msgid "The results printed are ::" msgstr "" -#: library/multiprocessing.rst:1696 +#: library/multiprocessing.rst:1703 msgid "" "49\n" "0.1111111111111111\n" @@ -2296,11 +2302,11 @@ msgid "" "[(3.515625, 39.0625), (33.0625, 4.0), (5.640625, 90.25)]" msgstr "" -#: library/multiprocessing.rst:1707 +#: library/multiprocessing.rst:1714 msgid "Managers" msgstr "" -#: library/multiprocessing.rst:1709 +#: library/multiprocessing.rst:1716 msgid "" "Managers provide a way to create data which can be shared between different " "processes, including sharing over a network between processes running on " @@ -2309,7 +2315,7 @@ msgid "" "proxies." msgstr "" -#: library/multiprocessing.rst:1718 +#: library/multiprocessing.rst:1725 msgid "" "Returns a started :class:`~multiprocessing.managers.SyncManager` object " "which can be used for sharing objects between processes. The returned " @@ -2317,31 +2323,31 @@ msgid "" "will create shared objects and return corresponding proxies." msgstr "" -#: library/multiprocessing.rst:1726 +#: library/multiprocessing.rst:1733 msgid "" "Manager processes will be shutdown as soon as they are garbage collected or " "their parent process exits. The manager classes are defined in the :mod:" "`multiprocessing.managers` module:" msgstr "" -#: library/multiprocessing.rst:1732 +#: library/multiprocessing.rst:1739 msgid "Create a BaseManager object." msgstr "" -#: library/multiprocessing.rst:1734 +#: library/multiprocessing.rst:1741 msgid "" "Once created one should call :meth:`start` or ``get_server()." "serve_forever()`` to ensure that the manager object refers to a started " "manager process." msgstr "" -#: library/multiprocessing.rst:1737 +#: library/multiprocessing.rst:1744 msgid "" "*address* is the address on which the manager process listens for new " "connections. If *address* is ``None`` then an arbitrary one is chosen." msgstr "" -#: library/multiprocessing.rst:1740 +#: library/multiprocessing.rst:1747 msgid "" "*authkey* is the authentication key which will be used to check the validity " "of incoming connections to the server process. If *authkey* is ``None`` " @@ -2349,19 +2355,19 @@ msgid "" "it must be a byte string." msgstr "" -#: library/multiprocessing.rst:1745 +#: library/multiprocessing.rst:1752 msgid "" "*serializer* must be ``'pickle'`` (use :mod:`pickle` serialization) or " "``'xmlrpclib'`` (use :mod:`xmlrpc.client` serialization)." msgstr "" -#: library/multiprocessing.rst:1748 +#: library/multiprocessing.rst:1755 msgid "" "*ctx* is a context object, or ``None`` (use the current context). See the :" "func:`get_context` function." msgstr "" -#: library/multiprocessing.rst:1751 +#: library/multiprocessing.rst:1758 msgid "" "*shutdown_timeout* is a timeout in seconds used to wait until the process " "used by the manager completes in the :meth:`shutdown` method. If the " @@ -2369,24 +2375,24 @@ msgid "" "also times out, the process is killed." msgstr "" -#: library/multiprocessing.rst:1756 +#: library/multiprocessing.rst:1763 msgid "Added the *shutdown_timeout* parameter." msgstr "" -#: library/multiprocessing.rst:1761 +#: library/multiprocessing.rst:1768 msgid "" "Start a subprocess to start the manager. If *initializer* is not ``None`` " "then the subprocess will call ``initializer(*initargs)`` when it starts." msgstr "" -#: library/multiprocessing.rst:1766 +#: library/multiprocessing.rst:1773 msgid "" "Returns a :class:`Server` object which represents the actual server under " "the control of the Manager. The :class:`Server` object supports the :meth:" "`serve_forever` method::" msgstr "" -#: library/multiprocessing.rst:1770 +#: library/multiprocessing.rst:1777 msgid "" ">>> from multiprocessing.managers import BaseManager\n" ">>> manager = BaseManager(address=('', 50000), authkey=b'abc')\n" @@ -2394,44 +2400,44 @@ msgid "" ">>> server.serve_forever()" msgstr "" -#: library/multiprocessing.rst:1775 +#: library/multiprocessing.rst:1782 msgid ":class:`Server` additionally has an :attr:`address` attribute." msgstr "" -#: library/multiprocessing.rst:1779 +#: library/multiprocessing.rst:1786 msgid "Connect a local manager object to a remote manager process::" msgstr "" -#: library/multiprocessing.rst:1781 +#: library/multiprocessing.rst:1788 msgid "" ">>> from multiprocessing.managers import BaseManager\n" ">>> m = BaseManager(address=('127.0.0.1', 50000), authkey=b'abc')\n" ">>> m.connect()" msgstr "" -#: library/multiprocessing.rst:1787 +#: library/multiprocessing.rst:1794 msgid "" "Stop the process used by the manager. This is only available if :meth:" "`start` has been used to start the server process." msgstr "" -#: library/multiprocessing.rst:1790 +#: library/multiprocessing.rst:1797 msgid "This can be called multiple times." msgstr "" -#: library/multiprocessing.rst:1794 +#: library/multiprocessing.rst:1801 msgid "" "A classmethod which can be used for registering a type or callable with the " "manager class." msgstr "" -#: library/multiprocessing.rst:1797 +#: library/multiprocessing.rst:1804 msgid "" "*typeid* is a \"type identifier\" which is used to identify a particular " "type of shared object. This must be a string." msgstr "" -#: library/multiprocessing.rst:1800 +#: library/multiprocessing.rst:1807 msgid "" "*callable* is a callable used for creating objects for this type " "identifier. If a manager instance will be connected to the server using " @@ -2439,14 +2445,14 @@ msgid "" "then this can be left as ``None``." msgstr "" -#: library/multiprocessing.rst:1806 +#: library/multiprocessing.rst:1813 msgid "" "*proxytype* is a subclass of :class:`BaseProxy` which is used to create " "proxies for shared objects with this *typeid*. If ``None`` then a proxy " "class is created automatically." msgstr "" -#: library/multiprocessing.rst:1810 +#: library/multiprocessing.rst:1817 msgid "" "*exposed* is used to specify a sequence of method names which proxies for " "this typeid should be allowed to access using :meth:`BaseProxy." @@ -2457,7 +2463,7 @@ msgid "" "method and whose name does not begin with ``'_'``.)" msgstr "" -#: library/multiprocessing.rst:1819 +#: library/multiprocessing.rst:1826 msgid "" "*method_to_typeid* is a mapping used to specify the return type of those " "exposed methods which should return a proxy. It maps method names to typeid " @@ -2467,22 +2473,22 @@ msgid "" "returned by the method will be copied by value." msgstr "" -#: library/multiprocessing.rst:1826 +#: library/multiprocessing.rst:1833 msgid "" "*create_method* determines whether a method should be created with name " "*typeid* which can be used to tell the server process to create a new shared " "object and return a proxy for it. By default it is ``True``." msgstr "" -#: library/multiprocessing.rst:1830 +#: library/multiprocessing.rst:1837 msgid ":class:`BaseManager` instances also have one read-only property:" msgstr "" -#: library/multiprocessing.rst:1834 +#: library/multiprocessing.rst:1841 msgid "The address used by the manager." msgstr "" -#: library/multiprocessing.rst:1836 +#: library/multiprocessing.rst:1843 msgid "" "Manager objects support the context management protocol -- see :ref:" "`typecontextmanager`. :meth:`~contextmanager.__enter__` starts the server " @@ -2490,121 +2496,121 @@ msgid "" "object. :meth:`~contextmanager.__exit__` calls :meth:`shutdown`." msgstr "" -#: library/multiprocessing.rst:1842 +#: library/multiprocessing.rst:1849 msgid "" "In previous versions :meth:`~contextmanager.__enter__` did not start the " "manager's server process if it was not already started." msgstr "" -#: library/multiprocessing.rst:1847 +#: library/multiprocessing.rst:1854 msgid "" "A subclass of :class:`BaseManager` which can be used for the synchronization " "of processes. Objects of this type are returned by :func:`multiprocessing." "Manager`." msgstr "" -#: library/multiprocessing.rst:1851 +#: library/multiprocessing.rst:1858 msgid "" "Its methods create and return :ref:`multiprocessing-proxy_objects` for a " "number of commonly used data types to be synchronized across processes. This " "notably includes shared lists and dictionaries." msgstr "" -#: library/multiprocessing.rst:1857 +#: library/multiprocessing.rst:1864 msgid "" "Create a shared :class:`threading.Barrier` object and return a proxy for it." msgstr "" -#: library/multiprocessing.rst:1864 +#: library/multiprocessing.rst:1871 msgid "" "Create a shared :class:`threading.BoundedSemaphore` object and return a " "proxy for it." msgstr "" -#: library/multiprocessing.rst:1869 +#: library/multiprocessing.rst:1876 msgid "" "Create a shared :class:`threading.Condition` object and return a proxy for " "it." msgstr "" -#: library/multiprocessing.rst:1872 +#: library/multiprocessing.rst:1879 msgid "" "If *lock* is supplied then it should be a proxy for a :class:`threading." "Lock` or :class:`threading.RLock` object." msgstr "" -#: library/multiprocessing.rst:1880 +#: library/multiprocessing.rst:1887 msgid "" "Create a shared :class:`threading.Event` object and return a proxy for it." msgstr "" -#: library/multiprocessing.rst:1884 +#: library/multiprocessing.rst:1891 msgid "" "Create a shared :class:`threading.Lock` object and return a proxy for it." msgstr "" -#: library/multiprocessing.rst:1888 +#: library/multiprocessing.rst:1895 msgid "Create a shared :class:`Namespace` object and return a proxy for it." msgstr "" -#: library/multiprocessing.rst:1892 +#: library/multiprocessing.rst:1899 msgid "Create a shared :class:`queue.Queue` object and return a proxy for it." msgstr "" -#: library/multiprocessing.rst:1896 +#: library/multiprocessing.rst:1903 msgid "" "Create a shared :class:`threading.RLock` object and return a proxy for it." msgstr "" -#: library/multiprocessing.rst:1900 +#: library/multiprocessing.rst:1907 msgid "" "Create a shared :class:`threading.Semaphore` object and return a proxy for " "it." msgstr "" -#: library/multiprocessing.rst:1905 +#: library/multiprocessing.rst:1912 msgid "Create an array and return a proxy for it." msgstr "" -#: library/multiprocessing.rst:1909 +#: library/multiprocessing.rst:1916 msgid "" "Create an object with a writable ``value`` attribute and return a proxy for " "it." msgstr "" -#: library/multiprocessing.rst:1916 +#: library/multiprocessing.rst:1923 msgid "Create a shared :class:`dict` object and return a proxy for it." msgstr "" -#: library/multiprocessing.rst:1921 +#: library/multiprocessing.rst:1928 msgid "Create a shared :class:`list` object and return a proxy for it." msgstr "" -#: library/multiprocessing.rst:1923 +#: library/multiprocessing.rst:1930 msgid "" "Shared objects are capable of being nested. For example, a shared container " "object such as a shared list can contain other shared objects which will all " "be managed and synchronized by the :class:`SyncManager`." msgstr "" -#: library/multiprocessing.rst:1930 +#: library/multiprocessing.rst:1937 msgid "A type that can register with :class:`SyncManager`." msgstr "" -#: library/multiprocessing.rst:1932 +#: library/multiprocessing.rst:1939 msgid "" "A namespace object has no public methods, but does have writable attributes. " "Its representation shows the values of its attributes." msgstr "" -#: library/multiprocessing.rst:1935 +#: library/multiprocessing.rst:1942 msgid "" "However, when using a proxy for a namespace object, an attribute beginning " "with ``'_'`` will be an attribute of the proxy and not an attribute of the " "referent:" msgstr "" -#: library/multiprocessing.rst:1939 +#: library/multiprocessing.rst:1946 msgid "" ">>> mp_context = multiprocessing.get_context('spawn')\n" ">>> manager = mp_context.Manager()\n" @@ -2616,18 +2622,18 @@ msgid "" "Namespace(x=10, y='hello')" msgstr "" -#: library/multiprocessing.rst:1952 +#: library/multiprocessing.rst:1959 msgid "Customized managers" msgstr "" -#: library/multiprocessing.rst:1954 +#: library/multiprocessing.rst:1961 msgid "" "To create one's own manager, one creates a subclass of :class:`BaseManager` " "and uses the :meth:`~BaseManager.register` classmethod to register new types " "or callables with the manager class. For example::" msgstr "" -#: library/multiprocessing.rst:1958 +#: library/multiprocessing.rst:1965 msgid "" "from multiprocessing.managers import BaseManager\n" "\n" @@ -2649,23 +2655,23 @@ msgid "" " print(maths.mul(7, 8)) # prints 56" msgstr "" -#: library/multiprocessing.rst:1979 +#: library/multiprocessing.rst:1986 msgid "Using a remote manager" msgstr "" -#: library/multiprocessing.rst:1981 +#: library/multiprocessing.rst:1988 msgid "" "It is possible to run a manager server on one machine and have clients use " "it from other machines (assuming that the firewalls involved allow it)." msgstr "" -#: library/multiprocessing.rst:1984 +#: library/multiprocessing.rst:1991 msgid "" "Running the following commands creates a server for a single shared queue " "which remote clients can access::" msgstr "" -#: library/multiprocessing.rst:1987 +#: library/multiprocessing.rst:1994 msgid "" ">>> from multiprocessing.managers import BaseManager\n" ">>> from queue import Queue\n" @@ -2677,11 +2683,11 @@ msgid "" ">>> s.serve_forever()" msgstr "" -#: library/multiprocessing.rst:1996 +#: library/multiprocessing.rst:2003 msgid "One client can access the server as follows::" msgstr "" -#: library/multiprocessing.rst:1998 +#: library/multiprocessing.rst:2005 msgid "" ">>> from multiprocessing.managers import BaseManager\n" ">>> class QueueManager(BaseManager): pass\n" @@ -2693,11 +2699,11 @@ msgid "" ">>> queue.put('hello')" msgstr "" -#: library/multiprocessing.rst:2006 +#: library/multiprocessing.rst:2013 msgid "Another client can also use it::" msgstr "" -#: library/multiprocessing.rst:2008 +#: library/multiprocessing.rst:2015 msgid "" ">>> from multiprocessing.managers import BaseManager\n" ">>> class QueueManager(BaseManager): pass\n" @@ -2710,13 +2716,13 @@ msgid "" "'hello'" msgstr "" -#: library/multiprocessing.rst:2017 +#: library/multiprocessing.rst:2024 msgid "" "Local processes can also access that queue, using the code from above on the " "client to access it remotely::" msgstr "" -#: library/multiprocessing.rst:2020 +#: library/multiprocessing.rst:2027 msgid "" ">>> from multiprocessing import Process, Queue\n" ">>> from multiprocessing.managers import BaseManager\n" @@ -2738,18 +2744,18 @@ msgid "" ">>> s.serve_forever()" msgstr "" -#: library/multiprocessing.rst:2042 +#: library/multiprocessing.rst:2049 msgid "Proxy Objects" msgstr "" -#: library/multiprocessing.rst:2044 +#: library/multiprocessing.rst:2051 msgid "" "A proxy is an object which *refers* to a shared object which lives " "(presumably) in a different process. The shared object is said to be the " "*referent* of the proxy. Multiple proxy objects may have the same referent." msgstr "" -#: library/multiprocessing.rst:2048 +#: library/multiprocessing.rst:2055 msgid "" "A proxy object has methods which invoke corresponding methods of its " "referent (although not every method of the referent will necessarily be " @@ -2757,7 +2763,7 @@ msgid "" "its referent can:" msgstr "" -#: library/multiprocessing.rst:2052 +#: library/multiprocessing.rst:2059 msgid "" ">>> mp_context = multiprocessing.get_context('spawn')\n" ">>> manager = mp_context.Manager()\n" @@ -2772,14 +2778,14 @@ msgid "" "[4, 9, 16]" msgstr "" -#: library/multiprocessing.rst:2066 +#: library/multiprocessing.rst:2073 msgid "" "Notice that applying :func:`str` to a proxy will return the representation " "of the referent, whereas applying :func:`repr` will return the " "representation of the proxy." msgstr "" -#: library/multiprocessing.rst:2070 +#: library/multiprocessing.rst:2077 msgid "" "An important feature of proxy objects is that they are picklable so they can " "be passed between processes. As such, a referent can contain :ref:" @@ -2787,7 +2793,7 @@ msgid "" "lists, dicts, and other :ref:`multiprocessing-proxy_objects`:" msgstr "" -#: library/multiprocessing.rst:2075 +#: library/multiprocessing.rst:2082 msgid "" ">>> a = manager.list()\n" ">>> b = manager.list()\n" @@ -2799,11 +2805,11 @@ msgid "" "['hello'] ['hello']" msgstr "" -#: library/multiprocessing.rst:2086 +#: library/multiprocessing.rst:2093 msgid "Similarly, dict and list proxies may be nested inside one another::" msgstr "" -#: library/multiprocessing.rst:2088 +#: library/multiprocessing.rst:2095 msgid "" ">>> l_outer = manager.list([ manager.dict() for i in range(2) ])\n" ">>> d_first_inner = l_outer[0]\n" @@ -2817,7 +2823,7 @@ msgid "" "{'c': 3, 'z': 26}" msgstr "" -#: library/multiprocessing.rst:2099 +#: library/multiprocessing.rst:2106 msgid "" "If standard (non-proxy) :class:`list` or :class:`dict` objects are contained " "in a referent, modifications to those mutable values will not be propagated " @@ -2828,7 +2834,7 @@ msgid "" "assign the modified value to the container proxy::" msgstr "" -#: library/multiprocessing.rst:2107 +#: library/multiprocessing.rst:2114 msgid "" "# create a list proxy and append a mutable object (a dictionary)\n" "lproxy = manager.list()\n" @@ -2842,67 +2848,67 @@ msgid "" "lproxy[0] = d" msgstr "" -#: library/multiprocessing.rst:2118 +#: library/multiprocessing.rst:2125 msgid "" "This approach is perhaps less convenient than employing nested :ref:" "`multiprocessing-proxy_objects` for most use cases but also demonstrates a " "level of control over the synchronization." msgstr "" -#: library/multiprocessing.rst:2124 +#: library/multiprocessing.rst:2131 msgid "" "The proxy types in :mod:`multiprocessing` do nothing to support comparisons " "by value. So, for instance, we have:" msgstr "" -#: library/multiprocessing.rst:2127 +#: library/multiprocessing.rst:2134 msgid "" ">>> manager.list([1,2,3]) == [1,2,3]\n" "False" msgstr "" -#: library/multiprocessing.rst:2132 +#: library/multiprocessing.rst:2139 msgid "" "One should just use a copy of the referent instead when making comparisons." msgstr "" -#: library/multiprocessing.rst:2136 +#: library/multiprocessing.rst:2143 msgid "Proxy objects are instances of subclasses of :class:`BaseProxy`." msgstr "" -#: library/multiprocessing.rst:2140 +#: library/multiprocessing.rst:2147 msgid "Call and return the result of a method of the proxy's referent." msgstr "" -#: library/multiprocessing.rst:2142 +#: library/multiprocessing.rst:2149 msgid "" "If ``proxy`` is a proxy whose referent is ``obj`` then the expression ::" msgstr "" -#: library/multiprocessing.rst:2144 +#: library/multiprocessing.rst:2151 msgid "proxy._callmethod(methodname, args, kwds)" msgstr "" -#: library/multiprocessing.rst:2146 +#: library/multiprocessing.rst:2153 msgid "will evaluate the expression ::" msgstr "" -#: library/multiprocessing.rst:2148 +#: library/multiprocessing.rst:2155 msgid "getattr(obj, methodname)(*args, **kwds)" msgstr "" -#: library/multiprocessing.rst:2150 +#: library/multiprocessing.rst:2157 msgid "in the manager's process." msgstr "" -#: library/multiprocessing.rst:2152 +#: library/multiprocessing.rst:2159 msgid "" "The returned value will be a copy of the result of the call or a proxy to a " "new shared object -- see documentation for the *method_to_typeid* argument " "of :meth:`BaseManager.register`." msgstr "" -#: library/multiprocessing.rst:2156 +#: library/multiprocessing.rst:2163 msgid "" "If an exception is raised by the call, then is re-raised by :meth:" "`_callmethod`. If some other exception is raised in the manager's process " @@ -2910,17 +2916,17 @@ msgid "" "meth:`_callmethod`." msgstr "" -#: library/multiprocessing.rst:2161 +#: library/multiprocessing.rst:2168 msgid "" "Note in particular that an exception will be raised if *methodname* has not " "been *exposed*." msgstr "" -#: library/multiprocessing.rst:2164 +#: library/multiprocessing.rst:2171 msgid "An example of the usage of :meth:`_callmethod`:" msgstr "" -#: library/multiprocessing.rst:2166 +#: library/multiprocessing.rst:2173 msgid "" ">>> l = manager.list(range(10))\n" ">>> l._callmethod('__len__')\n" @@ -2933,68 +2939,68 @@ msgid "" "IndexError: list index out of range" msgstr "" -#: library/multiprocessing.rst:2180 +#: library/multiprocessing.rst:2187 msgid "Return a copy of the referent." msgstr "" -#: library/multiprocessing.rst:2182 +#: library/multiprocessing.rst:2189 msgid "If the referent is unpicklable then this will raise an exception." msgstr "" -#: library/multiprocessing.rst:2186 +#: library/multiprocessing.rst:2193 msgid "Return a representation of the proxy object." msgstr "" -#: library/multiprocessing.rst:2190 +#: library/multiprocessing.rst:2197 msgid "Return the representation of the referent." msgstr "" -#: library/multiprocessing.rst:2194 +#: library/multiprocessing.rst:2201 msgid "Cleanup" msgstr "" -#: library/multiprocessing.rst:2196 +#: library/multiprocessing.rst:2203 msgid "" "A proxy object uses a weakref callback so that when it gets garbage " "collected it deregisters itself from the manager which owns its referent." msgstr "" -#: library/multiprocessing.rst:2199 +#: library/multiprocessing.rst:2206 msgid "" "A shared object gets deleted from the manager process when there are no " "longer any proxies referring to it." msgstr "" -#: library/multiprocessing.rst:2204 +#: library/multiprocessing.rst:2211 msgid "Process Pools" msgstr "" -#: library/multiprocessing.rst:2209 +#: library/multiprocessing.rst:2216 msgid "" "One can create a pool of processes which will carry out tasks submitted to " "it with the :class:`Pool` class." msgstr "" -#: library/multiprocessing.rst:2214 +#: library/multiprocessing.rst:2221 msgid "" "A process pool object which controls a pool of worker processes to which " "jobs can be submitted. It supports asynchronous results with timeouts and " "callbacks and has a parallel map implementation." msgstr "" -#: library/multiprocessing.rst:2218 +#: library/multiprocessing.rst:2225 msgid "" "*processes* is the number of worker processes to use. If *processes* is " -"``None`` then the number returned by :func:`os.cpu_count` is used." +"``None`` then the number returned by :func:`os.process_cpu_count` is used." msgstr "" -#: library/multiprocessing.rst:2221 library/multiprocessing.rst:2782 +#: library/multiprocessing.rst:2228 library/multiprocessing.rst:2792 msgid "" "If *initializer* is not ``None`` then each worker process will call " "``initializer(*initargs)`` when it starts." msgstr "" -#: library/multiprocessing.rst:2224 +#: library/multiprocessing.rst:2231 msgid "" "*maxtasksperchild* is the number of tasks a worker process can complete " "before it will exit and be replaced with a fresh worker process, to enable " @@ -3002,7 +3008,7 @@ msgid "" "which means worker processes will live as long as the pool." msgstr "" -#: library/multiprocessing.rst:2229 +#: library/multiprocessing.rst:2236 msgid "" "*context* can be used to specify the context used for starting the worker " "processes. Usually a pool is created using the function :func:" @@ -3010,13 +3016,13 @@ msgid "" "both cases *context* is set appropriately." msgstr "" -#: library/multiprocessing.rst:2235 +#: library/multiprocessing.rst:2242 msgid "" "Note that the methods of the pool object should only be called by the " "process which created the pool." msgstr "" -#: library/multiprocessing.rst:2239 +#: library/multiprocessing.rst:2246 msgid "" ":class:`multiprocessing.pool` objects have internal resources that need to " "be properly managed (like any other resource) by using the pool as a context " @@ -3024,22 +3030,28 @@ msgid "" "to do this can lead to the process hanging on finalization." msgstr "" -#: library/multiprocessing.rst:2244 +#: library/multiprocessing.rst:2251 msgid "" "Note that it is **not correct** to rely on the garbage collector to destroy " "the pool as CPython does not assure that the finalizer of the pool will be " "called (see :meth:`object.__del__` for more information)." msgstr "" -#: library/multiprocessing.rst:2248 +#: library/multiprocessing.rst:2255 msgid "Added the *maxtasksperchild* parameter." msgstr "" -#: library/multiprocessing.rst:2251 +#: library/multiprocessing.rst:2258 msgid "Added the *context* parameter." msgstr "" -#: library/multiprocessing.rst:2256 +#: library/multiprocessing.rst:2261 +msgid "" +"*processes* uses :func:`os.process_cpu_count` by default, instead of :func:" +"`os.cpu_count`." +msgstr "" + +#: library/multiprocessing.rst:2267 msgid "" "Worker processes within a :class:`Pool` typically live for the complete " "duration of the Pool's work queue. A frequent pattern found in other systems " @@ -3050,7 +3062,7 @@ msgid "" "ability to the end user." msgstr "" -#: library/multiprocessing.rst:2266 +#: library/multiprocessing.rst:2277 msgid "" "Call *func* with arguments *args* and keyword arguments *kwds*. It blocks " "until the result is ready. Given this blocks, :meth:`apply_async` is better " @@ -3058,13 +3070,13 @@ msgid "" "executed in one of the workers of the pool." msgstr "" -#: library/multiprocessing.rst:2273 +#: library/multiprocessing.rst:2284 msgid "" "A variant of the :meth:`apply` method which returns a :class:" "`~multiprocessing.pool.AsyncResult` object." msgstr "" -#: library/multiprocessing.rst:2276 library/multiprocessing.rst:2307 +#: library/multiprocessing.rst:2287 library/multiprocessing.rst:2318 msgid "" "If *callback* is specified then it should be a callable which accepts a " "single argument. When the result becomes ready *callback* is applied to it, " @@ -3072,58 +3084,58 @@ msgid "" "applied instead." msgstr "" -#: library/multiprocessing.rst:2281 library/multiprocessing.rst:2312 +#: library/multiprocessing.rst:2292 library/multiprocessing.rst:2323 msgid "" "If *error_callback* is specified then it should be a callable which accepts " "a single argument. If the target function fails, then the *error_callback* " "is called with the exception instance." msgstr "" -#: library/multiprocessing.rst:2285 library/multiprocessing.rst:2316 +#: library/multiprocessing.rst:2296 library/multiprocessing.rst:2327 msgid "" "Callbacks should complete immediately since otherwise the thread which " "handles the results will get blocked." msgstr "" -#: library/multiprocessing.rst:2290 +#: library/multiprocessing.rst:2301 msgid "" "A parallel equivalent of the :func:`map` built-in function (it supports only " "one *iterable* argument though, for multiple iterables see :meth:`starmap`). " "It blocks until the result is ready." msgstr "" -#: library/multiprocessing.rst:2294 +#: library/multiprocessing.rst:2305 msgid "" "This method chops the iterable into a number of chunks which it submits to " "the process pool as separate tasks. The (approximate) size of these chunks " "can be specified by setting *chunksize* to a positive integer." msgstr "" -#: library/multiprocessing.rst:2298 +#: library/multiprocessing.rst:2309 msgid "" "Note that it may cause high memory usage for very long iterables. Consider " "using :meth:`imap` or :meth:`imap_unordered` with explicit *chunksize* " "option for better efficiency." msgstr "" -#: library/multiprocessing.rst:2304 +#: library/multiprocessing.rst:2315 msgid "" "A variant of the :meth:`.map` method which returns a :class:" "`~multiprocessing.pool.AsyncResult` object." msgstr "" -#: library/multiprocessing.rst:2321 +#: library/multiprocessing.rst:2332 msgid "A lazier version of :meth:`.map`." msgstr "" -#: library/multiprocessing.rst:2323 +#: library/multiprocessing.rst:2334 msgid "" "The *chunksize* argument is the same as the one used by the :meth:`.map` " "method. For very long iterables using a large value for *chunksize* can " "make the job complete **much** faster than using the default value of ``1``." msgstr "" -#: library/multiprocessing.rst:2328 +#: library/multiprocessing.rst:2339 msgid "" "Also if *chunksize* is ``1`` then the :meth:`!next` method of the iterator " "returned by the :meth:`imap` method has an optional *timeout* parameter: " @@ -3131,65 +3143,65 @@ msgid "" "result cannot be returned within *timeout* seconds." msgstr "" -#: library/multiprocessing.rst:2335 +#: library/multiprocessing.rst:2346 msgid "" "The same as :meth:`imap` except that the ordering of the results from the " "returned iterator should be considered arbitrary. (Only when there is only " "one worker process is the order guaranteed to be \"correct\".)" msgstr "" -#: library/multiprocessing.rst:2341 +#: library/multiprocessing.rst:2352 msgid "" "Like :meth:`~multiprocessing.pool.Pool.map` except that the elements of the " "*iterable* are expected to be iterables that are unpacked as arguments." msgstr "" -#: library/multiprocessing.rst:2345 +#: library/multiprocessing.rst:2356 msgid "" "Hence an *iterable* of ``[(1,2), (3, 4)]`` results in ``[func(1,2), " "func(3,4)]``." msgstr "" -#: library/multiprocessing.rst:2352 +#: library/multiprocessing.rst:2363 msgid "" "A combination of :meth:`starmap` and :meth:`map_async` that iterates over " "*iterable* of iterables and calls *func* with the iterables unpacked. " "Returns a result object." msgstr "" -#: library/multiprocessing.rst:2360 +#: library/multiprocessing.rst:2371 msgid "" "Prevents any more tasks from being submitted to the pool. Once all the " "tasks have been completed the worker processes will exit." msgstr "" -#: library/multiprocessing.rst:2365 +#: library/multiprocessing.rst:2376 msgid "" "Stops the worker processes immediately without completing outstanding work. " "When the pool object is garbage collected :meth:`terminate` will be called " "immediately." msgstr "" -#: library/multiprocessing.rst:2371 +#: library/multiprocessing.rst:2382 msgid "" "Wait for the worker processes to exit. One must call :meth:`close` or :meth:" "`terminate` before using :meth:`join`." msgstr "" -#: library/multiprocessing.rst:2374 +#: library/multiprocessing.rst:2385 msgid "" "Pool objects now support the context management protocol -- see :ref:" "`typecontextmanager`. :meth:`~contextmanager.__enter__` returns the pool " "object, and :meth:`~contextmanager.__exit__` calls :meth:`terminate`." msgstr "" -#: library/multiprocessing.rst:2382 +#: library/multiprocessing.rst:2393 msgid "" "The class of the result returned by :meth:`Pool.apply_async` and :meth:`Pool." "map_async`." msgstr "" -#: library/multiprocessing.rst:2387 +#: library/multiprocessing.rst:2398 msgid "" "Return the result when it arrives. If *timeout* is not ``None`` and the " "result does not arrive within *timeout* seconds then :exc:`multiprocessing." @@ -3197,31 +3209,31 @@ msgid "" "exception will be reraised by :meth:`get`." msgstr "" -#: library/multiprocessing.rst:2394 +#: library/multiprocessing.rst:2405 msgid "Wait until the result is available or until *timeout* seconds pass." msgstr "" -#: library/multiprocessing.rst:2398 +#: library/multiprocessing.rst:2409 msgid "Return whether the call has completed." msgstr "" -#: library/multiprocessing.rst:2402 +#: library/multiprocessing.rst:2413 msgid "" "Return whether the call completed without raising an exception. Will raise :" "exc:`ValueError` if the result is not ready." msgstr "" -#: library/multiprocessing.rst:2405 +#: library/multiprocessing.rst:2416 msgid "" "If the result is not ready, :exc:`ValueError` is raised instead of :exc:" "`AssertionError`." msgstr "" -#: library/multiprocessing.rst:2409 +#: library/multiprocessing.rst:2420 msgid "The following example demonstrates the use of a pool::" msgstr "" -#: library/multiprocessing.rst:2411 +#: library/multiprocessing.rst:2422 msgid "" "from multiprocessing import Pool\n" "import time\n" @@ -3249,17 +3261,17 @@ msgid "" "TimeoutError" msgstr "" -#: library/multiprocessing.rst:2436 +#: library/multiprocessing.rst:2447 msgid "Listeners and Clients" msgstr "" -#: library/multiprocessing.rst:2441 +#: library/multiprocessing.rst:2452 msgid "" "Usually message passing between processes is done using queues or by using :" "class:`~Connection` objects returned by :func:`~multiprocessing.Pipe`." msgstr "" -#: library/multiprocessing.rst:2445 +#: library/multiprocessing.rst:2456 msgid "" "However, the :mod:`multiprocessing.connection` module allows some extra " "flexibility. It basically gives a high level message oriented API for " @@ -3268,45 +3280,45 @@ msgid "" "multiple connections at the same time." msgstr "" -#: library/multiprocessing.rst:2454 +#: library/multiprocessing.rst:2465 msgid "" "Send a randomly generated message to the other end of the connection and " "wait for a reply." msgstr "" -#: library/multiprocessing.rst:2457 +#: library/multiprocessing.rst:2468 msgid "" "If the reply matches the digest of the message using *authkey* as the key " "then a welcome message is sent to the other end of the connection. " "Otherwise :exc:`~multiprocessing.AuthenticationError` is raised." msgstr "" -#: library/multiprocessing.rst:2463 +#: library/multiprocessing.rst:2474 msgid "" "Receive a message, calculate the digest of the message using *authkey* as " "the key, and then send the digest back." msgstr "" -#: library/multiprocessing.rst:2466 +#: library/multiprocessing.rst:2477 msgid "" "If a welcome message is not received, then :exc:`~multiprocessing." "AuthenticationError` is raised." msgstr "" -#: library/multiprocessing.rst:2471 +#: library/multiprocessing.rst:2482 msgid "" "Attempt to set up a connection to the listener which is using address " "*address*, returning a :class:`~Connection`." msgstr "" -#: library/multiprocessing.rst:2474 +#: library/multiprocessing.rst:2485 msgid "" "The type of the connection is determined by *family* argument, but this can " "generally be omitted since it can usually be inferred from the format of " "*address*. (See :ref:`multiprocessing-address-formats`)" msgstr "" -#: library/multiprocessing.rst:2478 library/multiprocessing.rst:2513 +#: library/multiprocessing.rst:2489 library/multiprocessing.rst:2524 msgid "" "If *authkey* is given and not ``None``, it should be a byte string and will " "be used as the secret key for an HMAC-based authentication challenge. No " @@ -3315,26 +3327,26 @@ msgid "" "`multiprocessing-auth-keys`." msgstr "" -#: library/multiprocessing.rst:2486 +#: library/multiprocessing.rst:2497 msgid "" "A wrapper for a bound socket or Windows named pipe which is 'listening' for " "connections." msgstr "" -#: library/multiprocessing.rst:2489 +#: library/multiprocessing.rst:2500 msgid "" "*address* is the address to be used by the bound socket or named pipe of the " "listener object." msgstr "" -#: library/multiprocessing.rst:2494 +#: library/multiprocessing.rst:2505 msgid "" "If an address of '0.0.0.0' is used, the address will not be a connectable " "end point on Windows. If you require a connectable end-point, you should use " "'127.0.0.1'." msgstr "" -#: library/multiprocessing.rst:2498 +#: library/multiprocessing.rst:2509 msgid "" "*family* is the type of socket (or named pipe) to use. This can be one of " "the strings ``'AF_INET'`` (for a TCP socket), ``'AF_UNIX'`` (for a Unix " @@ -3348,49 +3360,49 @@ msgid "" "using :func:`tempfile.mkstemp`." msgstr "" -#: library/multiprocessing.rst:2509 +#: library/multiprocessing.rst:2520 msgid "" "If the listener object uses a socket then *backlog* (1 by default) is passed " "to the :meth:`~socket.socket.listen` method of the socket once it has been " "bound." msgstr "" -#: library/multiprocessing.rst:2521 +#: library/multiprocessing.rst:2532 msgid "" "Accept a connection on the bound socket or named pipe of the listener object " "and return a :class:`~Connection` object. If authentication is attempted and " "fails, then :exc:`~multiprocessing.AuthenticationError` is raised." msgstr "" -#: library/multiprocessing.rst:2528 +#: library/multiprocessing.rst:2539 msgid "" "Close the bound socket or named pipe of the listener object. This is called " "automatically when the listener is garbage collected. However it is " "advisable to call it explicitly." msgstr "" -#: library/multiprocessing.rst:2532 +#: library/multiprocessing.rst:2543 msgid "Listener objects have the following read-only properties:" msgstr "" -#: library/multiprocessing.rst:2536 +#: library/multiprocessing.rst:2547 msgid "The address which is being used by the Listener object." msgstr "" -#: library/multiprocessing.rst:2540 +#: library/multiprocessing.rst:2551 msgid "" "The address from which the last accepted connection came. If this is " "unavailable then it is ``None``." msgstr "" -#: library/multiprocessing.rst:2543 +#: library/multiprocessing.rst:2554 msgid "" "Listener objects now support the context management protocol -- see :ref:" "`typecontextmanager`. :meth:`~contextmanager.__enter__` returns the " "listener object, and :meth:`~contextmanager.__exit__` calls :meth:`close`." msgstr "" -#: library/multiprocessing.rst:2550 +#: library/multiprocessing.rst:2561 msgid "" "Wait till an object in *object_list* is ready. Returns the list of those " "objects in *object_list* which are ready. If *timeout* is a float then the " @@ -3399,32 +3411,32 @@ msgid "" "zero timeout." msgstr "" -#: library/multiprocessing.rst:2556 +#: library/multiprocessing.rst:2567 msgid "" "For both POSIX and Windows, an object can appear in *object_list* if it is" msgstr "" -#: library/multiprocessing.rst:2559 +#: library/multiprocessing.rst:2570 msgid "a readable :class:`~multiprocessing.connection.Connection` object;" msgstr "" -#: library/multiprocessing.rst:2560 +#: library/multiprocessing.rst:2571 msgid "a connected and readable :class:`socket.socket` object; or" msgstr "" -#: library/multiprocessing.rst:2561 +#: library/multiprocessing.rst:2572 msgid "" "the :attr:`~multiprocessing.Process.sentinel` attribute of a :class:" "`~multiprocessing.Process` object." msgstr "" -#: library/multiprocessing.rst:2564 +#: library/multiprocessing.rst:2575 msgid "" "A connection or socket object is ready when there is data available to be " "read from it, or the other end has been closed." msgstr "" -#: library/multiprocessing.rst:2567 +#: library/multiprocessing.rst:2578 msgid "" "**POSIX**: ``wait(object_list, timeout)`` almost equivalent ``select." "select(object_list, [], [], timeout)``. The difference is that, if :func:" @@ -3432,7 +3444,7 @@ msgid "" "an error number of ``EINTR``, whereas :func:`wait` will not." msgstr "" -#: library/multiprocessing.rst:2573 +#: library/multiprocessing.rst:2584 msgid "" "**Windows**: An item in *object_list* must either be an integer handle which " "is waitable (according to the definition used by the documentation of the " @@ -3442,18 +3454,18 @@ msgid "" "handles.)" msgstr "" -#: library/multiprocessing.rst:2583 +#: library/multiprocessing.rst:2594 msgid "**Examples**" msgstr "" -#: library/multiprocessing.rst:2585 +#: library/multiprocessing.rst:2596 msgid "" "The following server code creates a listener which uses ``'secret " "password'`` as an authentication key. It then waits for a connection and " "sends some data to the client::" msgstr "" -#: library/multiprocessing.rst:2589 +#: library/multiprocessing.rst:2600 msgid "" "from multiprocessing.connection import Listener\n" "from array import array\n" @@ -3471,13 +3483,13 @@ msgid "" " conn.send_bytes(array('i', [42, 1729]))" msgstr "" -#: library/multiprocessing.rst:2604 +#: library/multiprocessing.rst:2615 msgid "" "The following code connects to the server and receives some data from the " "server::" msgstr "" -#: library/multiprocessing.rst:2607 +#: library/multiprocessing.rst:2618 msgid "" "from multiprocessing.connection import Client\n" "from array import array\n" @@ -3494,15 +3506,14 @@ msgid "" " print(arr) # => array('i', [42, 1729, 0, 0, 0])" msgstr "" -#: library/multiprocessing.rst:2621 +#: library/multiprocessing.rst:2632 msgid "" "The following code uses :func:`~multiprocessing.connection.wait` to wait for " "messages from multiple processes at once::" msgstr "" -#: library/multiprocessing.rst:2624 +#: library/multiprocessing.rst:2635 msgid "" -"import time, random\n" "from multiprocessing import Process, Pipe, current_process\n" "from multiprocessing.connection import wait\n" "\n" @@ -3535,23 +3546,23 @@ msgid "" " print(msg)" msgstr "" -#: library/multiprocessing.rst:2660 +#: library/multiprocessing.rst:2670 msgid "Address Formats" msgstr "" -#: library/multiprocessing.rst:2662 +#: library/multiprocessing.rst:2672 msgid "" "An ``'AF_INET'`` address is a tuple of the form ``(hostname, port)`` where " "*hostname* is a string and *port* is an integer." msgstr "" -#: library/multiprocessing.rst:2665 +#: library/multiprocessing.rst:2675 msgid "" "An ``'AF_UNIX'`` address is a string representing a filename on the " "filesystem." msgstr "" -#: library/multiprocessing.rst:2668 +#: library/multiprocessing.rst:2678 msgid "" "An ``'AF_PIPE'`` address is a string of the form :samp:`r'\\\\\\\\\\\\.\\" "\\pipe\\\\\\\\{PipeName}'`. To use :func:`Client` to connect to a named " @@ -3560,17 +3571,17 @@ msgid "" "instead." msgstr "" -#: library/multiprocessing.rst:2673 +#: library/multiprocessing.rst:2683 msgid "" "Note that any string beginning with two backslashes is assumed by default to " "be an ``'AF_PIPE'`` address rather than an ``'AF_UNIX'`` address." msgstr "" -#: library/multiprocessing.rst:2680 +#: library/multiprocessing.rst:2690 msgid "Authentication keys" msgstr "" -#: library/multiprocessing.rst:2682 +#: library/multiprocessing.rst:2692 msgid "" "When one uses :meth:`Connection.recv `, the data received " "is automatically unpickled. Unfortunately unpickling data from an untrusted " @@ -3578,7 +3589,7 @@ msgid "" "use the :mod:`hmac` module to provide digest authentication." msgstr "" -#: library/multiprocessing.rst:2688 +#: library/multiprocessing.rst:2698 msgid "" "An authentication key is a byte string which can be thought of as a " "password: once a connection is established both ends will demand proof that " @@ -3586,7 +3597,7 @@ msgid "" "using the same key does **not** involve sending the key over the connection.)" msgstr "" -#: library/multiprocessing.rst:2694 +#: library/multiprocessing.rst:2704 msgid "" "If authentication is requested but no authentication key is specified then " "the return value of ``current_process().authkey`` is used (see :class:" @@ -3597,17 +3608,17 @@ msgid "" "setting up connections between themselves." msgstr "" -#: library/multiprocessing.rst:2702 +#: library/multiprocessing.rst:2712 msgid "" "Suitable authentication keys can also be generated by using :func:`os." "urandom`." msgstr "" -#: library/multiprocessing.rst:2706 +#: library/multiprocessing.rst:2716 msgid "Logging" msgstr "" -#: library/multiprocessing.rst:2708 +#: library/multiprocessing.rst:2718 msgid "" "Some support for logging is available. Note, however, that the :mod:" "`logging` package does not use process shared locks so it is possible " @@ -3615,27 +3626,27 @@ msgid "" "mixed up." msgstr "" -#: library/multiprocessing.rst:2715 +#: library/multiprocessing.rst:2725 msgid "" "Returns the logger used by :mod:`multiprocessing`. If necessary, a new one " "will be created." msgstr "" -#: library/multiprocessing.rst:2718 +#: library/multiprocessing.rst:2728 msgid "" "When first created the logger has level :const:`logging.NOTSET` and no " "default handler. Messages sent to this logger will not by default propagate " "to the root logger." msgstr "" -#: library/multiprocessing.rst:2722 +#: library/multiprocessing.rst:2732 msgid "" "Note that on Windows child processes will only inherit the level of the " "parent process's logger -- any other customization of the logger will not be " "inherited." msgstr "" -#: library/multiprocessing.rst:2729 +#: library/multiprocessing.rst:2739 msgid "" "This function performs a call to :func:`get_logger` but in addition to " "returning the logger created by get_logger, it adds a handler which sends " @@ -3644,11 +3655,11 @@ msgid "" "``level`` argument." msgstr "" -#: library/multiprocessing.rst:2735 +#: library/multiprocessing.rst:2745 msgid "Below is an example session with logging turned on::" msgstr "" -#: library/multiprocessing.rst:2737 +#: library/multiprocessing.rst:2747 msgid "" ">>> import multiprocessing, logging\n" ">>> logger = multiprocessing.log_to_stderr()\n" @@ -3664,21 +3675,21 @@ msgid "" "[INFO/SyncManager-...] manager exiting with exitcode 0" msgstr "" -#: library/multiprocessing.rst:2750 +#: library/multiprocessing.rst:2760 msgid "For a full table of logging levels, see the :mod:`logging` module." msgstr "" -#: library/multiprocessing.rst:2754 +#: library/multiprocessing.rst:2764 msgid "The :mod:`multiprocessing.dummy` module" msgstr "" -#: library/multiprocessing.rst:2759 +#: library/multiprocessing.rst:2769 msgid "" ":mod:`multiprocessing.dummy` replicates the API of :mod:`multiprocessing` " "but is no more than a wrapper around the :mod:`threading` module." msgstr "" -#: library/multiprocessing.rst:2764 +#: library/multiprocessing.rst:2774 msgid "" "In particular, the ``Pool`` function provided by :mod:`multiprocessing." "dummy` returns an instance of :class:`ThreadPool`, which is a subclass of :" @@ -3686,7 +3697,7 @@ msgid "" "worker threads rather than worker processes." msgstr "" -#: library/multiprocessing.rst:2772 +#: library/multiprocessing.rst:2782 msgid "" "A thread pool object which controls a pool of worker threads to which jobs " "can be submitted. :class:`ThreadPool` instances are fully interface " @@ -3696,18 +3707,18 @@ msgid "" "pool.Pool.terminate` manually." msgstr "" -#: library/multiprocessing.rst:2779 +#: library/multiprocessing.rst:2789 msgid "" "*processes* is the number of worker threads to use. If *processes* is " -"``None`` then the number returned by :func:`os.cpu_count` is used." +"``None`` then the number returned by :func:`os.process_cpu_count` is used." msgstr "" -#: library/multiprocessing.rst:2785 +#: library/multiprocessing.rst:2795 msgid "" "Unlike :class:`Pool`, *maxtasksperchild* and *context* cannot be provided." msgstr "" -#: library/multiprocessing.rst:2789 +#: library/multiprocessing.rst:2799 msgid "" "A :class:`ThreadPool` shares the same interface as :class:`Pool`, which is " "designed around a pool of processes and predates the introduction of the :" @@ -3717,7 +3728,7 @@ msgid "" "is not understood by any other libraries." msgstr "" -#: library/multiprocessing.rst:2796 +#: library/multiprocessing.rst:2806 msgid "" "Users should generally prefer to use :class:`concurrent.futures." "ThreadPoolExecutor`, which has a simpler interface that was designed around " @@ -3726,69 +3737,69 @@ msgid "" "`asyncio`." msgstr "" -#: library/multiprocessing.rst:2806 +#: library/multiprocessing.rst:2816 msgid "Programming guidelines" msgstr "" -#: library/multiprocessing.rst:2808 +#: library/multiprocessing.rst:2818 msgid "" "There are certain guidelines and idioms which should be adhered to when " "using :mod:`multiprocessing`." msgstr "" -#: library/multiprocessing.rst:2813 +#: library/multiprocessing.rst:2823 msgid "All start methods" msgstr "" -#: library/multiprocessing.rst:2815 +#: library/multiprocessing.rst:2825 msgid "The following applies to all start methods." msgstr "" -#: library/multiprocessing.rst:2817 +#: library/multiprocessing.rst:2827 msgid "Avoid shared state" msgstr "" -#: library/multiprocessing.rst:2819 +#: library/multiprocessing.rst:2829 msgid "" "As far as possible one should try to avoid shifting large amounts of data " "between processes." msgstr "" -#: library/multiprocessing.rst:2822 +#: library/multiprocessing.rst:2832 msgid "" "It is probably best to stick to using queues or pipes for communication " "between processes rather than using the lower level synchronization " "primitives." msgstr "" -#: library/multiprocessing.rst:2826 +#: library/multiprocessing.rst:2836 msgid "Picklability" msgstr "" -#: library/multiprocessing.rst:2828 +#: library/multiprocessing.rst:2838 msgid "Ensure that the arguments to the methods of proxies are picklable." msgstr "" -#: library/multiprocessing.rst:2830 +#: library/multiprocessing.rst:2840 msgid "Thread safety of proxies" msgstr "" -#: library/multiprocessing.rst:2832 +#: library/multiprocessing.rst:2842 msgid "" "Do not use a proxy object from more than one thread unless you protect it " "with a lock." msgstr "" -#: library/multiprocessing.rst:2835 +#: library/multiprocessing.rst:2845 msgid "" "(There is never a problem with different processes using the *same* proxy.)" msgstr "" -#: library/multiprocessing.rst:2837 +#: library/multiprocessing.rst:2847 msgid "Joining zombie processes" msgstr "" -#: library/multiprocessing.rst:2839 +#: library/multiprocessing.rst:2849 msgid "" "On POSIX when a process finishes but has not been joined it becomes a " "zombie. There should never be very many because each time a new process " @@ -3799,11 +3810,11 @@ msgid "" "explicitly join all the processes that you start." msgstr "" -#: library/multiprocessing.rst:2847 +#: library/multiprocessing.rst:2857 msgid "Better to inherit than pickle/unpickle" msgstr "" -#: library/multiprocessing.rst:2849 +#: library/multiprocessing.rst:2859 msgid "" "When using the *spawn* or *forkserver* start methods many types from :mod:" "`multiprocessing` need to be picklable so that child processes can use " @@ -3813,11 +3824,11 @@ msgid "" "inherit it from an ancestor process." msgstr "" -#: library/multiprocessing.rst:2857 +#: library/multiprocessing.rst:2867 msgid "Avoid terminating processes" msgstr "" -#: library/multiprocessing.rst:2859 +#: library/multiprocessing.rst:2869 msgid "" "Using the :meth:`Process.terminate ` " "method to stop a process is liable to cause any shared resources (such as " @@ -3825,18 +3836,18 @@ msgid "" "become broken or unavailable to other processes." msgstr "" -#: library/multiprocessing.rst:2865 +#: library/multiprocessing.rst:2875 msgid "" "Therefore it is probably best to only consider using :meth:`Process." "terminate ` on processes which never use " "any shared resources." msgstr "" -#: library/multiprocessing.rst:2869 +#: library/multiprocessing.rst:2879 msgid "Joining processes that use queues" msgstr "" -#: library/multiprocessing.rst:2871 +#: library/multiprocessing.rst:2881 msgid "" "Bear in mind that a process that has put items in a queue will wait before " "terminating until all the buffered items are fed by the \"feeder\" thread to " @@ -3845,7 +3856,7 @@ msgid "" "queue to avoid this behaviour.)" msgstr "" -#: library/multiprocessing.rst:2877 +#: library/multiprocessing.rst:2887 msgid "" "This means that whenever you use a queue you need to make sure that all " "items which have been put on the queue will eventually be removed before the " @@ -3854,11 +3865,11 @@ msgid "" "processes will be joined automatically." msgstr "" -#: library/multiprocessing.rst:2883 +#: library/multiprocessing.rst:2893 msgid "An example which will deadlock is the following::" msgstr "" -#: library/multiprocessing.rst:2885 +#: library/multiprocessing.rst:2895 msgid "" "from multiprocessing import Process, Queue\n" "\n" @@ -3873,17 +3884,17 @@ msgid "" " obj = queue.get()" msgstr "" -#: library/multiprocessing.rst:2897 +#: library/multiprocessing.rst:2907 msgid "" "A fix here would be to swap the last two lines (or simply remove the ``p." "join()`` line)." msgstr "" -#: library/multiprocessing.rst:2900 +#: library/multiprocessing.rst:2910 msgid "Explicitly pass resources to child processes" msgstr "" -#: library/multiprocessing.rst:2902 +#: library/multiprocessing.rst:2912 msgid "" "On POSIX using the *fork* start method, a child process can make use of a " "shared resource created in a parent process using a global resource. " @@ -3891,7 +3902,7 @@ msgid "" "for the child process." msgstr "" -#: library/multiprocessing.rst:2907 +#: library/multiprocessing.rst:2917 msgid "" "Apart from making the code (potentially) compatible with Windows and the " "other start methods this also ensures that as long as the child process is " @@ -3900,11 +3911,11 @@ msgid "" "collected in the parent process." msgstr "" -#: library/multiprocessing.rst:2914 +#: library/multiprocessing.rst:2924 msgid "So for instance ::" msgstr "" -#: library/multiprocessing.rst:2916 +#: library/multiprocessing.rst:2926 msgid "" "from multiprocessing import Process, Lock\n" "\n" @@ -3917,11 +3928,11 @@ msgid "" " Process(target=f).start()" msgstr "" -#: library/multiprocessing.rst:2926 +#: library/multiprocessing.rst:2936 msgid "should be rewritten as ::" msgstr "" -#: library/multiprocessing.rst:2928 +#: library/multiprocessing.rst:2938 msgid "" "from multiprocessing import Process, Lock\n" "\n" @@ -3934,31 +3945,31 @@ msgid "" " Process(target=f, args=(lock,)).start()" msgstr "" -#: library/multiprocessing.rst:2938 +#: library/multiprocessing.rst:2948 msgid "Beware of replacing :data:`sys.stdin` with a \"file like object\"" msgstr "" -#: library/multiprocessing.rst:2940 +#: library/multiprocessing.rst:2950 msgid ":mod:`multiprocessing` originally unconditionally called::" msgstr "" -#: library/multiprocessing.rst:2942 +#: library/multiprocessing.rst:2952 msgid "os.close(sys.stdin.fileno())" msgstr "" -#: library/multiprocessing.rst:2944 +#: library/multiprocessing.rst:2954 msgid "" "in the :meth:`multiprocessing.Process._bootstrap` method --- this resulted " "in issues with processes-in-processes. This has been changed to::" msgstr "" -#: library/multiprocessing.rst:2947 +#: library/multiprocessing.rst:2957 msgid "" "sys.stdin.close()\n" "sys.stdin = open(os.open(os.devnull, os.O_RDONLY), closefd=False)" msgstr "" -#: library/multiprocessing.rst:2950 +#: library/multiprocessing.rst:2960 msgid "" "Which solves the fundamental issue of processes colliding with each other " "resulting in a bad file descriptor error, but introduces a potential danger " @@ -3968,14 +3979,14 @@ msgid "" "data being flushed to the object multiple times, resulting in corruption." msgstr "" -#: library/multiprocessing.rst:2957 +#: library/multiprocessing.rst:2967 msgid "" "If you write a file-like object and implement your own caching, you can make " "it fork-safe by storing the pid whenever you append to the cache, and " "discarding the cache when the pid changes. For example::" msgstr "" -#: library/multiprocessing.rst:2961 +#: library/multiprocessing.rst:2971 msgid "" "@property\n" "def cache(self):\n" @@ -3986,26 +3997,26 @@ msgid "" " return self._cache" msgstr "" -#: library/multiprocessing.rst:2969 +#: library/multiprocessing.rst:2979 msgid "" "For more information, see :issue:`5155`, :issue:`5313` and :issue:`5331`" msgstr "" -#: library/multiprocessing.rst:2972 +#: library/multiprocessing.rst:2982 msgid "The *spawn* and *forkserver* start methods" msgstr "" -#: library/multiprocessing.rst:2974 +#: library/multiprocessing.rst:2984 msgid "" "There are a few extra restrictions which don't apply to the *fork* start " "method." msgstr "" -#: library/multiprocessing.rst:2977 +#: library/multiprocessing.rst:2987 msgid "More picklability" msgstr "" -#: library/multiprocessing.rst:2979 +#: library/multiprocessing.rst:2989 msgid "" "Ensure that all arguments to :meth:`Process.__init__` are picklable. Also, " "if you subclass :class:`~multiprocessing.Process` then make sure that " @@ -4013,11 +4024,11 @@ msgid "" "Process.start>` method is called." msgstr "" -#: library/multiprocessing.rst:2984 +#: library/multiprocessing.rst:2994 msgid "Global variables" msgstr "" -#: library/multiprocessing.rst:2986 +#: library/multiprocessing.rst:2996 msgid "" "Bear in mind that if code run in a child process tries to access a global " "variable, then the value it sees (if any) may not be the same as the value " @@ -4025,30 +4036,30 @@ msgid "" "Process.start>` was called." msgstr "" -#: library/multiprocessing.rst:2991 +#: library/multiprocessing.rst:3001 msgid "" "However, global variables which are just module level constants cause no " "problems." msgstr "" -#: library/multiprocessing.rst:2996 +#: library/multiprocessing.rst:3006 msgid "Safe importing of main module" msgstr "" -#: library/multiprocessing.rst:2998 +#: library/multiprocessing.rst:3008 msgid "" "Make sure that the main module can be safely imported by a new Python " "interpreter without causing unintended side effects (such as starting a new " "process)." msgstr "" -#: library/multiprocessing.rst:3002 +#: library/multiprocessing.rst:3012 msgid "" "For example, using the *spawn* or *forkserver* start method running the " "following module would fail with a :exc:`RuntimeError`::" msgstr "" -#: library/multiprocessing.rst:3006 +#: library/multiprocessing.rst:3016 msgid "" "from multiprocessing import Process\n" "\n" @@ -4059,13 +4070,13 @@ msgid "" "p.start()" msgstr "" -#: library/multiprocessing.rst:3014 +#: library/multiprocessing.rst:3024 msgid "" "Instead one should protect the \"entry point\" of the program by using ``if " "__name__ == '__main__':`` as follows::" msgstr "" -#: library/multiprocessing.rst:3017 +#: library/multiprocessing.rst:3027 msgid "" "from multiprocessing import Process, freeze_support, set_start_method\n" "\n" @@ -4079,33 +4090,33 @@ msgid "" " p.start()" msgstr "" -#: library/multiprocessing.rst:3028 +#: library/multiprocessing.rst:3038 msgid "" "(The ``freeze_support()`` line can be omitted if the program will be run " "normally instead of frozen.)" msgstr "" -#: library/multiprocessing.rst:3031 +#: library/multiprocessing.rst:3041 msgid "" "This allows the newly spawned Python interpreter to safely import the module " "and then run the module's ``foo()`` function." msgstr "" -#: library/multiprocessing.rst:3034 +#: library/multiprocessing.rst:3044 msgid "" "Similar restrictions apply if a pool or manager is created in the main " "module." msgstr "" -#: library/multiprocessing.rst:3041 +#: library/multiprocessing.rst:3051 msgid "Examples" msgstr "" -#: library/multiprocessing.rst:3043 +#: library/multiprocessing.rst:3053 msgid "Demonstration of how to create and use customized managers and proxies:" msgstr "" -#: library/multiprocessing.rst:3045 +#: library/multiprocessing.rst:3055 msgid "" "from multiprocessing import freeze_support\n" "from multiprocessing.managers import BaseManager, BaseProxy\n" @@ -4199,11 +4210,11 @@ msgid "" " test()\n" msgstr "" -#: library/multiprocessing.rst:3049 +#: library/multiprocessing.rst:3059 msgid "Using :class:`~multiprocessing.pool.Pool`:" msgstr "" -#: library/multiprocessing.rst:3051 +#: library/multiprocessing.rst:3061 msgid "" "import multiprocessing\n" "import time\n" @@ -4363,13 +4374,13 @@ msgid "" " test()\n" msgstr "" -#: library/multiprocessing.rst:3055 +#: library/multiprocessing.rst:3065 msgid "" "An example showing how to use queues to feed tasks to a collection of worker " "processes and collect the results:" msgstr "" -#: library/multiprocessing.rst:3058 +#: library/multiprocessing.rst:3068 msgid "" "import time\n" "import random\n" diff --git a/library/multiprocessing.shared_memory.po b/library/multiprocessing.shared_memory.po index 2f4d93f7..8f02a4ca 100644 --- a/library/multiprocessing.shared_memory.po +++ b/library/multiprocessing.shared_memory.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -98,46 +98,72 @@ msgid "" "shared memory block, the *size* parameter is ignored." msgstr "" -#: library/multiprocessing.shared_memory.rst:75 +#: library/multiprocessing.shared_memory.rst:73 msgid "" -"Close access to the shared memory from this instance. In order to ensure " -"proper cleanup of resources, all instances should call :meth:`close` once " -"the instance is no longer needed. Note that calling :meth:`!close` does not " -"cause the shared memory block itself to be destroyed." +"When ``True``, register the shared memory block with a resource tracker " +"process on platforms where the OS does not do this automatically. The " +"resource tracker ensures proper cleanup of the shared memory even if all " +"other processes with access to the memory exit without doing so. Python " +"processes created from a common ancestor using :mod:`multiprocessing` " +"facilities share a single resource tracker process, and the lifetime of " +"shared memory segments is handled automatically among these processes. " +"Python processes created in any other way will receive their own resource " +"tracker when accessing shared memory with *track* enabled. This will cause " +"the shared memory to be deleted by the resource tracker of the first process " +"that terminates. To avoid this issue, users of :mod:`subprocess` or " +"standalone Python processes should set *track* to ``False`` when there is " +"already another process in place that does the bookkeeping. *track* is " +"ignored on Windows, which has its own tracking and automatically deletes " +"shared memory when all handles to it have been closed." msgstr "" -#: library/multiprocessing.shared_memory.rst:83 -msgid "" -"Request that the underlying shared memory block be destroyed. In order to " -"ensure proper cleanup of resources, :meth:`unlink` should be called once " -"(and only once) across all processes which have need for the shared memory " -"block. After requesting its destruction, a shared memory block may or may " -"not be immediately destroyed and this behavior may differ across platforms. " -"Attempts to access data inside the shared memory block after :meth:`!unlink` " -"has been called may result in memory access errors. Note: the last process " -"relinquishing its hold on a shared memory block may call :meth:`!unlink` " -"and :meth:`close` in either order." +#: library/multiprocessing.shared_memory.rst:91 +msgid "Added the *track* parameter." msgstr "" #: library/multiprocessing.shared_memory.rst:96 +msgid "" +"Close the file descriptor/handle to the shared memory from this instance. :" +"meth:`close` should be called once access to the shared memory block from " +"this instance is no longer needed. Depending on operating system, the " +"underlying memory may or may not be freed even if all handles to it have " +"been closed. To ensure proper cleanup, use the :meth:`unlink` method." +msgstr "" + +#: library/multiprocessing.shared_memory.rst:105 +msgid "" +"Delete the underlying shared memory block. This should be called only once " +"per shared memory block regardless of the number of handles to it, even in " +"other processes. :meth:`unlink` and :meth:`close` can be called in any " +"order, but trying to access data inside a shared memory block after :meth:" +"`unlink` may result in memory access errors, depending on platform." +msgstr "" + +#: library/multiprocessing.shared_memory.rst:112 +msgid "" +"This method has no effect on Windows, where the only way to delete a shared " +"memory block is to close all handles." +msgstr "" + +#: library/multiprocessing.shared_memory.rst:117 msgid "A memoryview of contents of the shared memory block." msgstr "" -#: library/multiprocessing.shared_memory.rst:100 +#: library/multiprocessing.shared_memory.rst:121 msgid "Read-only access to the unique name of the shared memory block." msgstr "" -#: library/multiprocessing.shared_memory.rst:104 +#: library/multiprocessing.shared_memory.rst:125 msgid "Read-only access to size in bytes of the shared memory block." msgstr "" -#: library/multiprocessing.shared_memory.rst:107 +#: library/multiprocessing.shared_memory.rst:128 msgid "" "The following example demonstrates low-level use of :class:`SharedMemory` " "instances::" msgstr "" -#: library/multiprocessing.shared_memory.rst:110 +#: library/multiprocessing.shared_memory.rst:131 msgid "" ">>> from multiprocessing import shared_memory\n" ">>> shm_a = shared_memory.SharedMemory(create=True, size=10)\n" @@ -162,14 +188,14 @@ msgid "" ">>> shm_a.unlink() # Call unlink only once to release the shared memory" msgstr "" -#: library/multiprocessing.shared_memory.rst:133 +#: library/multiprocessing.shared_memory.rst:154 msgid "" "The following example demonstrates a practical use of the :class:" "`SharedMemory` class with `NumPy arrays `_, accessing " "the same :class:`!numpy.ndarray` from two distinct Python shells:" msgstr "" -#: library/multiprocessing.shared_memory.rst:137 +#: library/multiprocessing.shared_memory.rst:158 msgid "" ">>> # In the first Python interactive shell\n" ">>> import numpy as np\n" @@ -215,13 +241,13 @@ msgid "" ">>> shm.unlink() # Free and release the shared memory block at the very end" msgstr "" -#: library/multiprocessing.shared_memory.rst:187 +#: library/multiprocessing.shared_memory.rst:208 msgid "" "A subclass of :class:`multiprocessing.managers.BaseManager` which can be " "used for the management of shared memory blocks across processes." msgstr "" -#: library/multiprocessing.shared_memory.rst:190 +#: library/multiprocessing.shared_memory.rst:211 msgid "" "A call to :meth:`~multiprocessing.managers.BaseManager.start` on a :class:`!" "SharedMemoryManager` instance causes a new process to be started. This new " @@ -236,14 +262,14 @@ msgid "" "trigger the freeing of shared memory resources." msgstr "" -#: library/multiprocessing.shared_memory.rst:202 +#: library/multiprocessing.shared_memory.rst:223 msgid "" "This class provides methods for creating and returning :class:`SharedMemory` " "instances and for creating a list-like object (:class:`ShareableList`) " "backed by shared memory." msgstr "" -#: library/multiprocessing.shared_memory.rst:206 +#: library/multiprocessing.shared_memory.rst:227 msgid "" "Refer to :class:`~multiprocessing.managers.BaseManager` for a description of " "the inherited *address* and *authkey* optional input arguments and how they " @@ -251,25 +277,25 @@ msgid "" "from other processes." msgstr "" -#: library/multiprocessing.shared_memory.rst:213 +#: library/multiprocessing.shared_memory.rst:234 msgid "" "Create and return a new :class:`SharedMemory` object with the specified " "*size* in bytes." msgstr "" -#: library/multiprocessing.shared_memory.rst:218 +#: library/multiprocessing.shared_memory.rst:239 msgid "" "Create and return a new :class:`ShareableList` object, initialized by the " "values from the input *sequence*." msgstr "" -#: library/multiprocessing.shared_memory.rst:222 +#: library/multiprocessing.shared_memory.rst:243 msgid "" "The following example demonstrates the basic mechanisms of a :class:" "`~multiprocessing.managers.SharedMemoryManager`:" msgstr "" -#: library/multiprocessing.shared_memory.rst:225 +#: library/multiprocessing.shared_memory.rst:246 msgid "" ">>> from multiprocessing.managers import SharedMemoryManager\n" ">>> smm = SharedMemoryManager()\n" @@ -284,7 +310,7 @@ msgid "" ">>> smm.shutdown() # Calls unlink() on sl, raw_shm, and another_sl" msgstr "" -#: library/multiprocessing.shared_memory.rst:240 +#: library/multiprocessing.shared_memory.rst:261 msgid "" "The following example depicts a potentially more convenient pattern for " "using :class:`~multiprocessing.managers.SharedMemoryManager` objects via " @@ -292,7 +318,7 @@ msgid "" "released after they are no longer needed:" msgstr "" -#: library/multiprocessing.shared_memory.rst:245 +#: library/multiprocessing.shared_memory.rst:266 msgid "" ">>> with SharedMemoryManager() as smm:\n" "... sl = smm.ShareableList(range(2000))\n" @@ -307,7 +333,7 @@ msgid "" "... total_result = sum(sl) # Consolidate the partial results now in sl" msgstr "" -#: library/multiprocessing.shared_memory.rst:259 +#: library/multiprocessing.shared_memory.rst:280 msgid "" "When using a :class:`~multiprocessing.managers.SharedMemoryManager` in a :" "keyword:`with` statement, the shared memory blocks created using that " @@ -315,38 +341,38 @@ msgid "" "finishes execution." msgstr "" -#: library/multiprocessing.shared_memory.rst:267 +#: library/multiprocessing.shared_memory.rst:288 msgid "" "Provide a mutable list-like object where all values stored within are stored " "in a shared memory block. This constrains storable values to the following " "built-in data types:" msgstr "" -#: library/multiprocessing.shared_memory.rst:271 +#: library/multiprocessing.shared_memory.rst:292 msgid ":class:`int` (signed 64-bit)" msgstr "" -#: library/multiprocessing.shared_memory.rst:272 +#: library/multiprocessing.shared_memory.rst:293 msgid ":class:`float`" msgstr "" -#: library/multiprocessing.shared_memory.rst:273 +#: library/multiprocessing.shared_memory.rst:294 msgid ":class:`bool`" msgstr "" -#: library/multiprocessing.shared_memory.rst:274 +#: library/multiprocessing.shared_memory.rst:295 msgid ":class:`str` (less than 10M bytes each when encoded as UTF-8)" msgstr "" -#: library/multiprocessing.shared_memory.rst:275 +#: library/multiprocessing.shared_memory.rst:296 msgid ":class:`bytes` (less than 10M bytes each)" msgstr "" -#: library/multiprocessing.shared_memory.rst:276 +#: library/multiprocessing.shared_memory.rst:297 msgid "``None``" msgstr "" -#: library/multiprocessing.shared_memory.rst:278 +#: library/multiprocessing.shared_memory.rst:299 msgid "" "It also notably differs from the built-in :class:`list` type in that these " "lists can not change their overall length (i.e. no :meth:`!append`, :meth:`!" @@ -354,14 +380,14 @@ msgid "" "ShareableList` instances via slicing." msgstr "" -#: library/multiprocessing.shared_memory.rst:284 +#: library/multiprocessing.shared_memory.rst:305 msgid "" "*sequence* is used in populating a new :class:`!ShareableList` full of " "values. Set to ``None`` to instead attach to an already existing :class:`!" "ShareableList` by its unique shared memory name." msgstr "" -#: library/multiprocessing.shared_memory.rst:288 +#: library/multiprocessing.shared_memory.rst:309 msgid "" "*name* is the unique name for the requested shared memory, as described in " "the definition for :class:`SharedMemory`. When attaching to an existing :" @@ -369,7 +395,7 @@ msgid "" "leaving *sequence* set to ``None``." msgstr "" -#: library/multiprocessing.shared_memory.rst:295 +#: library/multiprocessing.shared_memory.rst:316 msgid "" "A known issue exists for :class:`bytes` and :class:`str` values. If they end " "with ``\\x00`` nul bytes or characters, those may be *silently stripped* " @@ -378,14 +404,14 @@ msgid "" "future. See :gh:`106939`." msgstr "" -#: library/multiprocessing.shared_memory.rst:301 +#: library/multiprocessing.shared_memory.rst:322 msgid "" "For applications where rstripping of trailing nulls is a problem, work " "around it by always unconditionally appending an extra non-0 byte to the end " "of such values when storing and unconditionally removing it when fetching:" msgstr "" -#: library/multiprocessing.shared_memory.rst:306 +#: library/multiprocessing.shared_memory.rst:327 msgid "" ">>> from multiprocessing import shared_memory\n" ">>> nul_bug_demo = shared_memory.ShareableList(['?\\x00', " @@ -404,40 +430,40 @@ msgid "" ">>> padded.shm.unlink()" msgstr "" -#: library/multiprocessing.shared_memory.rst:324 +#: library/multiprocessing.shared_memory.rst:345 msgid "Return the number of occurrences of *value*." msgstr "" -#: library/multiprocessing.shared_memory.rst:328 +#: library/multiprocessing.shared_memory.rst:349 msgid "" "Return first index position of *value*. Raise :exc:`ValueError` if *value* " "is not present." msgstr "" -#: library/multiprocessing.shared_memory.rst:333 +#: library/multiprocessing.shared_memory.rst:354 msgid "" "Read-only attribute containing the :mod:`struct` packing format used by all " "currently stored values." msgstr "" -#: library/multiprocessing.shared_memory.rst:338 +#: library/multiprocessing.shared_memory.rst:359 msgid "The :class:`SharedMemory` instance where the values are stored." msgstr "" -#: library/multiprocessing.shared_memory.rst:341 +#: library/multiprocessing.shared_memory.rst:362 msgid "" "The following example demonstrates basic use of a :class:`ShareableList` " "instance:" msgstr "" -#: library/multiprocessing.shared_memory.rst:374 +#: library/multiprocessing.shared_memory.rst:395 msgid "" "The following example depicts how one, two, or many processes may access the " "same :class:`ShareableList` by supplying the name of the shared memory block " "behind it:" msgstr "" -#: library/multiprocessing.shared_memory.rst:389 +#: library/multiprocessing.shared_memory.rst:410 msgid "" "The following examples demonstrates that :class:`ShareableList` (and " "underlying :class:`SharedMemory`) objects can be pickled and unpickled if " diff --git a/library/netdata.po b/library/netdata.po index b7c38a6f..fdcb2d70 100644 --- a/library/netdata.po +++ b/library/netdata.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" diff --git a/library/netrc.po b/library/netrc.po index eb776615..b33012dd 100644 --- a/library/netrc.po +++ b/library/netrc.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" diff --git a/library/nis.po b/library/nis.po index cb66a94e..d0130762 100644 --- a/library/nis.po +++ b/library/nis.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -17,80 +17,19 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -#: library/nis.rst:3 -msgid ":mod:`nis` --- Interface to Sun's NIS (Yellow Pages)" +#: library/nis.rst:2 +msgid ":mod:`!nis` --- Interface to Sun’s NIS (Yellow Pages)" msgstr "" -#: library/nis.rst:13 +#: library/nis.rst:10 msgid "" -"The :mod:`nis` module is deprecated (see :pep:`PEP 594 <594#nis>` for " -"details)." +"This module is no longer part of the Python standard library. It was :ref:" +"`removed in Python 3.13 ` after being deprecated in " +"Python 3.11. The removal was decided in :pep:`594`." msgstr "" -#: library/nis.rst:19 +#: library/nis.rst:14 msgid "" -"The :mod:`nis` module gives a thin wrapper around the NIS library, useful " -"for central administration of several hosts." -msgstr "" - -#: library/nis.rst:22 -msgid "" -"Because NIS exists only on Unix systems, this module is only available for " -"Unix." -msgstr "" - -#: includes/wasm-notavail.rst:3 -msgid "Availability" -msgstr "" - -#: includes/wasm-notavail.rst:5 -msgid "" -"This module does not work or is not available on WebAssembly platforms " -"``wasm32-emscripten`` and ``wasm32-wasi``. See :ref:`wasm-availability` for " -"more information." -msgstr "" - -#: library/nis.rst:26 -msgid "The :mod:`nis` module defines the following functions:" -msgstr "" - -#: library/nis.rst:31 -msgid "" -"Return the match for *key* in map *mapname*, or raise an error (:exc:`nis." -"error`) if there is none. Both should be strings, *key* is 8-bit clean. " -"Return value is an arbitrary array of bytes (may contain ``NULL`` and other " -"joys)." -msgstr "" - -#: library/nis.rst:48 -msgid "Note that *mapname* is first checked if it is an alias to another name." -msgstr "" - -#: library/nis.rst:50 library/nis.rst:58 -msgid "" -"The *domain* argument allows overriding the NIS domain used for the lookup. " -"If unspecified, lookup is in the default NIS domain." -msgstr "" - -#: library/nis.rst:44 -msgid "" -"Return a dictionary mapping *key* to *value* such that ``match(key, " -"mapname)==value``. Note that both keys and values of the dictionary are " -"arbitrary arrays of bytes." -msgstr "" - -#: library/nis.rst:56 -msgid "Return a list of all valid maps." -msgstr "" - -#: library/nis.rst:64 -msgid "Return the system default NIS domain." -msgstr "" - -#: library/nis.rst:67 -msgid "The :mod:`nis` module defines the following exception:" -msgstr "" - -#: library/nis.rst:71 -msgid "An error raised when a NIS function returns an error code." +"The last version of Python that provided the :mod:`!nis` module was `Python " +"3.12 `_." msgstr "" diff --git a/library/nntplib.po b/library/nntplib.po index 9033b118..5baee752 100644 --- a/library/nntplib.po +++ b/library/nntplib.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -18,620 +18,18 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" #: library/nntplib.rst:2 -msgid ":mod:`nntplib` --- NNTP protocol client" +msgid ":mod:`!nntplib` --- NNTP protocol client" msgstr "" -#: library/nntplib.rst:8 -msgid "**Source code:** :source:`Lib/nntplib.py`" -msgstr "" - -#: library/nntplib.rst:14 -msgid "The :mod:`nntplib` module is deprecated (see :pep:`594` for details)." -msgstr "" - -#: library/nntplib.rst:36 -msgid "" -"This module defines the class :class:`NNTP` which implements the client side " -"of the Network News Transfer Protocol. It can be used to implement a news " -"reader or poster, or automated news processors. It is compatible with :rfc:" -"`3977` as well as the older :rfc:`977` and :rfc:`2980`." -msgstr "" - -#: includes/wasm-notavail.rst:3 -msgid "Availability" -msgstr "" - -#: includes/wasm-notavail.rst:5 -msgid "" -"This module does not work or is not available on WebAssembly platforms " -"``wasm32-emscripten`` and ``wasm32-wasi``. See :ref:`wasm-availability` for " -"more information." -msgstr "" - -#: library/nntplib.rst:43 -msgid "" -"Here are two small examples of how it can be used. To list some statistics " -"about a newsgroup and print the subjects of the last 10 articles::" -msgstr "" - -#: library/nntplib.rst:46 -msgid "" -">>> s = nntplib.NNTP('news.gmane.io')\n" -">>> resp, count, first, last, name = s.group('gmane.comp.python." -"committers')\n" -">>> print('Group', name, 'has', count, 'articles, range', first, 'to', " -"last)\n" -"Group gmane.comp.python.committers has 1096 articles, range 1 to 1096\n" -">>> resp, overviews = s.over((last - 9, last))\n" -">>> for id, over in overviews:\n" -"... print(id, nntplib.decode_header(over['subject']))\n" -"...\n" -"1087 Re: Commit privileges for Łukasz Langa\n" -"1088 Re: 3.2 alpha 2 freeze\n" -"1089 Re: 3.2 alpha 2 freeze\n" -"1090 Re: Commit privileges for Łukasz Langa\n" -"1091 Re: Commit privileges for Łukasz Langa\n" -"1092 Updated ssh key\n" -"1093 Re: Updated ssh key\n" -"1094 Re: Updated ssh key\n" -"1095 Hello fellow committers!\n" -"1096 Re: Hello fellow committers!\n" -">>> s.quit()\n" -"'205 Bye!'" -msgstr "" - -#: library/nntplib.rst:67 -msgid "" -"To post an article from a binary file (this assumes that the article has " -"valid headers, and that you have right to post on the particular newsgroup)::" -msgstr "" - -#: library/nntplib.rst:70 -msgid "" -">>> s = nntplib.NNTP('news.gmane.io')\n" -">>> f = open('article.txt', 'rb')\n" -">>> s.post(f)\n" -"'240 Article posted successfully.'\n" -">>> s.quit()\n" -"'205 Bye!'" -msgstr "" - -#: library/nntplib.rst:77 -msgid "The module itself defines the following classes:" -msgstr "" - -#: library/nntplib.rst:82 -msgid "" -"Return a new :class:`NNTP` object, representing a connection to the NNTP " -"server running on host *host*, listening at port *port*. An optional " -"*timeout* can be specified for the socket connection. If the optional *user* " -"and *password* are provided, or if suitable credentials are present in :file:" -"`/.netrc` and the optional flag *usenetrc* is true, the ``AUTHINFO USER`` " -"and ``AUTHINFO PASS`` commands are used to identify and authenticate the " -"user to the server. If the optional flag *readermode* is true, then a " -"``mode reader`` command is sent before authentication is performed. Reader " -"mode is sometimes necessary if you are connecting to an NNTP server on the " -"local machine and intend to call reader-specific commands, such as " -"``group``. If you get unexpected :exc:`NNTPPermanentError`\\ s, you might " -"need to set *readermode*. The :class:`NNTP` class supports the :keyword:" -"`with` statement to unconditionally consume :exc:`OSError` exceptions and to " -"close the NNTP connection when done, e.g.:" -msgstr "" - -#: library/nntplib.rst:137 -msgid "" -"Raises an :ref:`auditing event ` ``nntplib.connect`` with " -"arguments ``self``, ``host``, ``port``." -msgstr "" - -#: library/nntplib.rst:109 library/nntplib.rst:141 -msgid "" -"All commands will raise an :ref:`auditing event ` ``nntplib." -"putline`` with arguments ``self`` and ``line``, where ``line`` is the bytes " -"about to be sent to the remote host." -msgstr "" - -#: library/nntplib.rst:113 -msgid "*usenetrc* is now ``False`` by default." -msgstr "" - -#: library/nntplib.rst:116 -msgid "Support for the :keyword:`with` statement was added." -msgstr "" - -#: library/nntplib.rst:152 -msgid "" -"If the *timeout* parameter is set to be zero, it will raise a :class:" -"`ValueError` to prevent the creation of a non-blocking socket." -msgstr "" - -#: library/nntplib.rst:125 -msgid "" -"Return a new :class:`NNTP_SSL` object, representing an encrypted connection " -"to the NNTP server running on host *host*, listening at port *port*. :class:" -"`NNTP_SSL` objects have the same methods as :class:`NNTP` objects. If " -"*port* is omitted, port 563 (NNTPS) is used. *ssl_context* is also optional, " -"and is a :class:`~ssl.SSLContext` object. Please read :ref:`ssl-security` " -"for best practices. All other parameters behave the same as for :class:" -"`NNTP`." -msgstr "" - -#: library/nntplib.rst:133 -msgid "" -"Note that SSL-on-563 is discouraged per :rfc:`4642`, in favor of STARTTLS as " -"described below. However, some servers only support the former." -msgstr "" - -#: library/nntplib.rst:147 -msgid "" -"The class now supports hostname check with :attr:`ssl.SSLContext." -"check_hostname` and *Server Name Indication* (see :data:`ssl.HAS_SNI`)." -msgstr "" - -#: library/nntplib.rst:158 -msgid "" -"Derived from the standard exception :exc:`Exception`, this is the base class " -"for all exceptions raised by the :mod:`nntplib` module. Instances of this " -"class have the following attribute:" -msgstr "" - -#: library/nntplib.rst:164 -msgid "The response of the server if available, as a :class:`str` object." -msgstr "" - -#: library/nntplib.rst:169 -msgid "Exception raised when an unexpected reply is received from the server." -msgstr "" - -#: library/nntplib.rst:174 -msgid "" -"Exception raised when a response code in the range 400--499 is received." -msgstr "" - -#: library/nntplib.rst:179 -msgid "" -"Exception raised when a response code in the range 500--599 is received." -msgstr "" - -#: library/nntplib.rst:184 -msgid "" -"Exception raised when a reply is received from the server that does not " -"begin with a digit in the range 1--5." -msgstr "" - -#: library/nntplib.rst:190 -msgid "Exception raised when there is some error in the response data." -msgstr "" - -#: library/nntplib.rst:196 -msgid "NNTP Objects" -msgstr "" - -#: library/nntplib.rst:198 -msgid "" -"When connected, :class:`NNTP` and :class:`NNTP_SSL` objects support the " -"following methods and attributes." -msgstr "" - -#: library/nntplib.rst:202 -msgid "Attributes" -msgstr "" - -#: library/nntplib.rst:206 -msgid "" -"An integer representing the version of the NNTP protocol supported by the " -"server. In practice, this should be ``2`` for servers advertising :rfc:" -"`3977` compliance and ``1`` for others." -msgstr "" - -#: library/nntplib.rst:214 -msgid "" -"A string describing the software name and version of the NNTP server, or :" -"const:`None` if not advertised by the server." -msgstr "" - -#: library/nntplib.rst:220 -msgid "Methods" -msgstr "" - -#: library/nntplib.rst:222 -msgid "" -"The *response* that is returned as the first item in the return tuple of " -"almost all methods is the server's response: a string beginning with a three-" -"digit code. If the server's response indicates an error, the method raises " -"one of the above exceptions." -msgstr "" - -#: library/nntplib.rst:227 -msgid "" -"Many of the following methods take an optional keyword-only argument *file*. " -"When the *file* argument is supplied, it must be either a :term:`file " -"object` opened for binary writing, or the name of an on-disk file to be " -"written to. The method will then write any data returned by the server " -"(except for the response line and the terminating dot) to the file; any list " -"of lines, tuples or objects that the method normally returns will be empty." -msgstr "" - -#: library/nntplib.rst:234 -msgid "" -"Many of the following methods have been reworked and fixed, which makes them " -"incompatible with their 3.1 counterparts." -msgstr "" - -#: library/nntplib.rst:241 -msgid "" -"Send a ``QUIT`` command and close the connection. Once this method has been " -"called, no other methods of the NNTP object should be called." -msgstr "" - -#: library/nntplib.rst:247 -msgid "" -"Return the welcome message sent by the server in reply to the initial " -"connection. (This message sometimes contains disclaimers or help " -"information that may be relevant to the user.)" -msgstr "" - -#: library/nntplib.rst:254 -msgid "" -"Return the :rfc:`3977` capabilities advertised by the server, as a :class:" -"`dict` instance mapping capability names to (possibly empty) lists of " -"values. On legacy servers which don't understand the ``CAPABILITIES`` " -"command, an empty dictionary is returned instead." -msgstr "" - -#: library/nntplib.rst:268 -msgid "" -"Send ``AUTHINFO`` commands with the user name and password. If *user* and " -"*password* are ``None`` and *usenetrc* is true, credentials from ``~/." -"netrc`` will be used if possible." -msgstr "" - -#: library/nntplib.rst:272 -msgid "" -"Unless intentionally delayed, login is normally performed during the :class:" -"`NNTP` object initialization and separately calling this function is " -"unnecessary. To force authentication to be delayed, you must not set *user* " -"or *password* when creating the object, and must set *usenetrc* to False." -msgstr "" - -#: library/nntplib.rst:283 -msgid "" -"Send a ``STARTTLS`` command. This will enable encryption on the NNTP " -"connection. The *context* argument is optional and should be a :class:`ssl." -"SSLContext` object. Please read :ref:`ssl-security` for best practices." -msgstr "" - -#: library/nntplib.rst:288 -msgid "" -"Note that this may not be done after authentication information has been " -"transmitted, and authentication occurs by default if possible during a :" -"class:`NNTP` object initialization. See :meth:`NNTP.login` for information " -"on suppressing this behavior." -msgstr "" - -#: library/nntplib.rst:295 -msgid "" -"The method now supports hostname check with :attr:`ssl.SSLContext." -"check_hostname` and *Server Name Indication* (see :data:`ssl.HAS_SNI`)." -msgstr "" - -#: library/nntplib.rst:302 -msgid "" -"Send a ``NEWGROUPS`` command. The *date* argument should be a :class:" -"`datetime.date` or :class:`datetime.datetime` object. Return a pair " -"``(response, groups)`` where *groups* is a list representing the groups that " -"are new since the given *date*. If *file* is supplied, though, then *groups* " -"will be empty." -msgstr "" - -#: library/nntplib.rst:318 -msgid "" -"Send a ``NEWNEWS`` command. Here, *group* is a group name or ``'*'``, and " -"*date* has the same meaning as for :meth:`newgroups`. Return a pair " -"``(response, articles)`` where *articles* is a list of message ids." -msgstr "" - -#: library/nntplib.rst:322 -msgid "This command is frequently disabled by NNTP server administrators." -msgstr "" - -#: library/nntplib.rst:327 -msgid "" -"Send a ``LIST`` or ``LIST ACTIVE`` command. Return a pair ``(response, " -"list)`` where *list* is a list of tuples representing all the groups " -"available from this NNTP server, optionally matching the pattern string " -"*group_pattern*. Each tuple has the form ``(group, last, first, flag)``, " -"where *group* is a group name, *last* and *first* are the last and first " -"article numbers, and *flag* usually takes one of these values:" -msgstr "" - -#: library/nntplib.rst:335 -msgid "``y``: Local postings and articles from peers are allowed." -msgstr "" - -#: library/nntplib.rst:336 -msgid "``m``: The group is moderated and all postings must be approved." -msgstr "" - -#: library/nntplib.rst:337 -msgid "``n``: No local postings are allowed, only articles from peers." -msgstr "" - -#: library/nntplib.rst:338 -msgid "``j``: Articles from peers are filed in the junk group instead." -msgstr "" - -#: library/nntplib.rst:339 -msgid "``x``: No local postings, and articles from peers are ignored." -msgstr "" - -#: library/nntplib.rst:340 -msgid "``=foo.bar``: Articles are filed in the ``foo.bar`` group instead." -msgstr "" - -#: library/nntplib.rst:342 -msgid "" -"If *flag* has another value, then the status of the newsgroup should be " -"considered unknown." -msgstr "" - -#: library/nntplib.rst:345 -msgid "" -"This command can return very large results, especially if *group_pattern* is " -"not specified. It is best to cache the results offline unless you really " -"need to refresh them." -msgstr "" - -#: library/nntplib.rst:349 -msgid "*group_pattern* was added." -msgstr "" - -#: library/nntplib.rst:355 -msgid "" -"Send a ``LIST NEWSGROUPS`` command, where *grouppattern* is a wildmat string " -"as specified in :rfc:`3977` (it's essentially the same as DOS or UNIX shell " -"wildcard strings). Return a pair ``(response, descriptions)``, where " -"*descriptions* is a dictionary mapping group names to textual descriptions." -msgstr "" - -#: library/nntplib.rst:369 -msgid "" -"Get a description for a single group *group*. If more than one group " -"matches (if 'group' is a real wildmat string), return the first match. If " -"no group matches, return an empty string." -msgstr "" - -#: library/nntplib.rst:373 -msgid "" -"This elides the response code from the server. If the response code is " -"needed, use :meth:`descriptions`." -msgstr "" - -#: library/nntplib.rst:379 -msgid "" -"Send a ``GROUP`` command, where *name* is the group name. The group is " -"selected as the current group, if it exists. Return a tuple ``(response, " -"count, first, last, name)`` where *count* is the (estimated) number of " -"articles in the group, *first* is the first article number in the group, " -"*last* is the last article number in the group, and *name* is the group name." -msgstr "" - -#: library/nntplib.rst:389 -msgid "" -"Send an ``OVER`` command, or an ``XOVER`` command on legacy servers. " -"*message_spec* can be either a string representing a message id, or a " -"``(first, last)`` tuple of numbers indicating a range of articles in the " -"current group, or a ``(first, None)`` tuple indicating a range of articles " -"starting from *first* to the last article in the current group, or :const:" -"`None` to select the current article in the current group." -msgstr "" - -#: library/nntplib.rst:396 -msgid "" -"Return a pair ``(response, overviews)``. *overviews* is a list of " -"``(article_number, overview)`` tuples, one for each article selected by " -"*message_spec*. Each *overview* is a dictionary with the same number of " -"items, but this number depends on the server. These items are either " -"message headers (the key is then the lower-cased header name) or metadata " -"items (the key is then the metadata name prepended with ``\":\"``). The " -"following items are guaranteed to be present by the NNTP specification:" -msgstr "" - -#: library/nntplib.rst:404 -msgid "" -"the ``subject``, ``from``, ``date``, ``message-id`` and ``references`` " -"headers" -msgstr "" - -#: library/nntplib.rst:406 -msgid "" -"the ``:bytes`` metadata: the number of bytes in the entire raw article " -"(including headers and body)" -msgstr "" - -#: library/nntplib.rst:408 -msgid "the ``:lines`` metadata: the number of lines in the article body" -msgstr "" - -#: library/nntplib.rst:410 -msgid "" -"The value of each item is either a string, or :const:`None` if not present." -msgstr "" - -#: library/nntplib.rst:412 -msgid "" -"It is advisable to use the :func:`decode_header` function on header values " -"when they may contain non-ASCII characters::" -msgstr "" - -#: library/nntplib.rst:415 -msgid "" -">>> _, _, first, last, _ = s.group('gmane.comp.python.devel')\n" -">>> resp, overviews = s.over((last, last))\n" -">>> art_num, over = overviews[0]\n" -">>> art_num\n" -"117216\n" -">>> list(over.keys())\n" -"['xref', 'from', ':lines', ':bytes', 'references', 'date', 'message-id', " -"'subject']\n" -">>> over['from']\n" -"'=?UTF-8?B?Ik1hcnRpbiB2LiBMw7Z3aXMi?= '\n" -">>> nntplib.decode_header(over['from'])\n" -"'\"Martin v. Löwis\" '" -msgstr "" - -#: library/nntplib.rst:432 -msgid "" -"Send a ``HELP`` command. Return a pair ``(response, list)`` where *list* is " -"a list of help strings." -msgstr "" - -#: library/nntplib.rst:438 -msgid "" -"Send a ``STAT`` command, where *message_spec* is either a message id " -"(enclosed in ``'<'`` and ``'>'``) or an article number in the current group. " -"If *message_spec* is omitted or :const:`None`, the current article in the " -"current group is considered. Return a triple ``(response, number, id)`` " -"where *number* is the article number and *id* is the message id." -msgstr "" - -#: library/nntplib.rst:452 -msgid "Send a ``NEXT`` command. Return as for :meth:`.stat`." -msgstr "" - -#: library/nntplib.rst:457 -msgid "Send a ``LAST`` command. Return as for :meth:`.stat`." -msgstr "" - -#: library/nntplib.rst:462 -msgid "" -"Send an ``ARTICLE`` command, where *message_spec* has the same meaning as " -"for :meth:`.stat`. Return a tuple ``(response, info)`` where *info* is a :" -"class:`~collections.namedtuple` with three attributes *number*, *message_id* " -"and *lines* (in that order). *number* is the article number in the group " -"(or 0 if the information is not available), *message_id* the message id as a " -"string, and *lines* a list of lines (without terminating newlines) " -"comprising the raw message including headers and body." -msgstr "" - -#: library/nntplib.rst:487 -msgid "" -"Same as :meth:`article`, but sends a ``HEAD`` command. The *lines* returned " -"(or written to *file*) will only contain the message headers, not the body." -msgstr "" - -#: library/nntplib.rst:494 -msgid "" -"Same as :meth:`article`, but sends a ``BODY`` command. The *lines* returned " -"(or written to *file*) will only contain the message body, not the headers." -msgstr "" - -#: library/nntplib.rst:501 -msgid "" -"Post an article using the ``POST`` command. The *data* argument is either " -"a :term:`file object` opened for binary reading, or any iterable of bytes " -"objects (representing raw lines of the article to be posted). It should " -"represent a well-formed news article, including the required headers. The :" -"meth:`post` method automatically escapes lines beginning with ``.`` and " -"appends the termination line." -msgstr "" - -#: library/nntplib.rst:508 -msgid "" -"If the method succeeds, the server's response is returned. If the server " -"refuses posting, a :class:`NNTPReplyError` is raised." -msgstr "" - -#: library/nntplib.rst:514 -msgid "" -"Send an ``IHAVE`` command. *message_id* is the id of the message to send to " -"the server (enclosed in ``'<'`` and ``'>'``). The *data* parameter and the " -"return value are the same as for :meth:`post`." -msgstr "" - -#: library/nntplib.rst:521 -msgid "" -"Return a pair ``(response, date)``. *date* is a :class:`~datetime.datetime` " -"object containing the current date and time of the server." -msgstr "" - -#: library/nntplib.rst:527 -msgid "Send a ``SLAVE`` command. Return the server's *response*." -msgstr "" - -#: library/nntplib.rst:532 -msgid "" -"Set the instance's debugging level. This controls the amount of debugging " -"output printed. The default, ``0``, produces no debugging output. A value " -"of ``1`` produces a moderate amount of debugging output, generally a single " -"line per request or response. A value of ``2`` or higher produces the " -"maximum amount of debugging output, logging each line sent and received on " -"the connection (including message text)." -msgstr "" - -#: library/nntplib.rst:540 -msgid "" -"The following are optional NNTP extensions defined in :rfc:`2980`. Some of " -"them have been superseded by newer commands in :rfc:`3977`." -msgstr "" - -#: library/nntplib.rst:546 -msgid "" -"Send an ``XHDR`` command. The *hdr* argument is a header keyword, e.g. " -"``'subject'``. The *str* argument should have the form ``'first-last'`` " -"where *first* and *last* are the first and last article numbers to search. " -"Return a pair ``(response, list)``, where *list* is a list of pairs ``(id, " -"text)``, where *id* is an article number (as a string) and *text* is the " -"text of the requested header for that article. If the *file* parameter is " -"supplied, then the output of the ``XHDR`` command is stored in a file. If " -"*file* is a string, then the method will open a file with that name, write " -"to it then close it. If *file* is a :term:`file object`, then it will start " -"calling :meth:`write` on it to store the lines of the command output. If " -"*file* is supplied, then the returned *list* is an empty list." -msgstr "" - -#: library/nntplib.rst:561 -msgid "" -"Send an ``XOVER`` command. *start* and *end* are article numbers delimiting " -"the range of articles to select. The return value is the same of for :meth:" -"`over`. It is recommended to use :meth:`over` instead, since it will " -"automatically use the newer ``OVER`` command if available." -msgstr "" - -#: library/nntplib.rst:569 -msgid "Utility functions" -msgstr "" - -#: library/nntplib.rst:571 -msgid "The module also defines the following utility function:" -msgstr "" - -#: library/nntplib.rst:576 +#: library/nntplib.rst:10 msgid "" -"Decode a header value, un-escaping any escaped non-ASCII characters. " -"*header_str* must be a :class:`str` object. The unescaped value is " -"returned. Using this function is recommended to display some headers in a " -"human readable form::" +"This module is no longer part of the Python standard library. It was :ref:" +"`removed in Python 3.13 ` after being deprecated in " +"Python 3.11. The removal was decided in :pep:`594`." msgstr "" -#: library/nntplib.rst:581 +#: library/nntplib.rst:14 msgid "" -">>> decode_header(\"Some subject\")\n" -"'Some subject'\n" -">>> decode_header(\"=?ISO-8859-15?Q?D=E9buter_en_Python?=\")\n" -"'Débuter en Python'\n" -">>> decode_header(\"Re: =?UTF-8?B?cHJvYmzDqG1lIGRlIG1hdHJpY2U=?=\")\n" -"'Re: problème de matrice'" -msgstr "" - -#: library/nntplib.rst:10 -msgid "NNTP" -msgstr "" - -#: library/nntplib.rst:10 -msgid "protocol" -msgstr "" - -#: library/nntplib.rst:10 -msgid "Network News Transfer Protocol" +"The last version of Python that provided the :mod:`!nntplib` module was " +"`Python 3.12 `_." msgstr "" diff --git a/library/numbers.po b/library/numbers.po index 00f10ed5..fb52c46d 100644 --- a/library/numbers.po +++ b/library/numbers.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" diff --git a/library/numeric.po b/library/numeric.po index f6276b69..f45a9996 100644 --- a/library/numeric.po +++ b/library/numeric.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: Loukas Sakellaridis \n" "Language-Team: PyGreece \n" diff --git a/library/operator.po b/library/operator.po index a3a92c3c..1b9d90eb 100644 --- a/library/operator.po +++ b/library/operator.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" diff --git a/library/optparse.po b/library/optparse.po index 16f3e68b..2ea6b67f 100644 --- a/library/optparse.po +++ b/library/optparse.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -21,20 +21,205 @@ msgstr "" msgid ":mod:`!optparse` --- Parser for command line options" msgstr "" -#: library/optparse.rst:11 +#: library/optparse.rst:10 msgid "**Source code:** :source:`Lib/optparse.py`" msgstr "" -#: library/optparse.rst:13 -msgid "" -"The :mod:`optparse` module is deprecated and will not be developed further; " -"development will continue with the :mod:`argparse` module." +#: library/optparse.rst:17 +msgid "Choosing an argument parsing library" msgstr "" #: library/optparse.rst:19 +msgid "The standard library includes three argument parsing libraries:" +msgstr "" + +#: library/optparse.rst:21 +msgid "" +":mod:`getopt`: a module that closely mirrors the procedural C ``getopt`` " +"API. Included in the standard library since before the initial Python 1.0 " +"release." +msgstr "" + +#: library/optparse.rst:23 +msgid "" +":mod:`optparse`: a declarative replacement for ``getopt`` that provides " +"equivalent functionality without requiring each application to implement its " +"own procedural option parsing logic. Included in the standard library since " +"the Python 2.3 release." +msgstr "" + +#: library/optparse.rst:27 +msgid "" +":mod:`argparse`: a more opinionated alternative to ``optparse`` that " +"provides more functionality by default, at the expense of reduced " +"application flexibility in controlling exactly how arguments are processed. " +"Included in the standard library since the Python 2.7 and Python 3.2 " +"releases." +msgstr "" + +#: library/optparse.rst:32 +msgid "" +"In the absence of more specific argument parsing design constraints, :mod:" +"`argparse` is the recommended choice for implementing command line " +"applications, as it offers the highest level of baseline functionality with " +"the least application level code." +msgstr "" + +#: library/optparse.rst:36 +msgid "" +":mod:`getopt` is retained almost entirely for backwards compatibility " +"reasons. However, it also serves a niche use case as a tool for prototyping " +"and testing command line argument handling in ``getopt``-based C " +"applications." +msgstr "" + +#: library/optparse.rst:40 +msgid "" +":mod:`optparse` should be considered as an alternative to :mod:`argparse` in " +"the following cases:" +msgstr "" + +#: library/optparse.rst:43 +msgid "" +"an application is already using :mod:`optparse` and doesn't want to risk the " +"subtle behavioural changes that may arise when migrating to :mod:`argparse`" +msgstr "" + +#: library/optparse.rst:45 +msgid "" +"the application requires additional control over the way options and " +"positional parameters are interleaved on the command line (including the " +"ability to disable the interleaving feature completely)" +msgstr "" + +#: library/optparse.rst:48 +msgid "" +"the application requires additional control over the incremental parsing of " +"command line elements (while ``argparse`` does support this, the exact way " +"it works in practice is undesirable for some use cases)" +msgstr "" + +#: library/optparse.rst:51 +msgid "" +"the application requires additional control over the handling of options " +"which accept parameter values that may start with ``-`` (such as delegated " +"options to be passed to invoked subprocesses)" +msgstr "" + +#: library/optparse.rst:54 +msgid "" +"the application requires some other command line parameter processing " +"behavior which ``argparse`` does not support, but which can be implemented " +"in terms of the lower level interface offered by ``optparse``" +msgstr "" + +#: library/optparse.rst:58 +msgid "" +"These considerations also mean that :mod:`optparse` is likely to provide a " +"better foundation for library authors writing third party command line " +"argument processing libraries." +msgstr "" + +#: library/optparse.rst:62 +msgid "" +"As a concrete example, consider the following two command line argument " +"parsing configurations, the first using ``optparse``, and the second using " +"``argparse``:" +msgstr "" + +#: library/optparse.rst:66 +msgid "" +"import optparse\n" +"\n" +"if __name__ == '__main__':\n" +" parser = optparse.OptionParser()\n" +" parser.add_option('-o', '--output')\n" +" parser.add_option('-v', dest='verbose', action='store_true')\n" +" opts, args = parser.parse_args()\n" +" process(args, output=opts.output, verbose=opts.verbose)" +msgstr "" + +#: library/optparse.rst:77 +msgid "" +"import argparse\n" +"\n" +"if __name__ == '__main__':\n" +" parser = argparse.ArgumentParser()\n" +" parser.add_argument('-o', '--output')\n" +" parser.add_argument('-v', dest='verbose', action='store_true')\n" +" parser.add_argument('rest', nargs='*')\n" +" args = parser.parse_args()\n" +" process(args.rest, output=args.output, verbose=args.verbose)" +msgstr "" + +#: library/optparse.rst:89 +msgid "" +"The most obvious difference is that in the ``optparse`` version, the non-" +"option arguments are processed separately by the application after the " +"option processing is complete. In the ``argparse`` version, positional " +"arguments are declared and processed in the same way as the named options." +msgstr "" + +#: library/optparse.rst:94 +msgid "" +"However, the ``argparse`` version will also handle some parameter " +"combination differently from the way the ``optparse`` version would handle " +"them. For example (amongst other differences):" +msgstr "" + +#: library/optparse.rst:98 +msgid "" +"supplying ``-o -v`` gives ``output=\"-v\"`` and ``verbose=False`` when using " +"``optparse``, but a usage error with ``argparse`` (complaining that no value " +"has been supplied for ``-o/--output``, since ``-v`` is interpreted as " +"meaning the verbosity flag)" +msgstr "" + +#: library/optparse.rst:102 +msgid "" +"similarly, supplying ``-o --`` gives ``output=\"--\"`` and ``args=()`` when " +"using ``optparse``, but a usage error with ``argparse`` (also complaining " +"that no value has been supplied for ``-o/--output``, since ``--`` is " +"interpreted as terminating the option processing and treating all remaining " +"values as positional arguments)" +msgstr "" + +#: library/optparse.rst:107 +msgid "" +"supplying ``-o=foo`` gives ``output=\"=foo\"`` when using ``optparse``, but " +"gives ``output=\"foo\"`` with ``argparse`` (since ``=`` is special cased as " +"an alternative separator for option parameter values)" +msgstr "" + +#: library/optparse.rst:111 +msgid "" +"Whether these differing behaviors in the ``argparse`` version are considered " +"desirable or a problem will depend on the specific command line application " +"use case." +msgstr "" + +#: library/optparse.rst:117 +msgid "" +":pypi:`click` is a third party argument processing library (originally based " +"on ``optparse``), which allows command line applications to be developed as " +"a set of decorated command implementation functions." +msgstr "" + +#: library/optparse.rst:121 +msgid "" +"Other third party libraries, such as :pypi:`typer` or :pypi:`msgspec-click`, " +"allow command line interfaces to be specified in ways that more effectively " +"integrate with static checking of Python type annotations." +msgstr "" + +#: library/optparse.rst:127 +msgid "Introduction" +msgstr "" + +#: library/optparse.rst:129 msgid "" ":mod:`optparse` is a more convenient, flexible, and powerful library for " -"parsing command-line options than the old :mod:`getopt` module. :mod:" +"parsing command-line options than the minimalist :mod:`getopt` module. :mod:" "`optparse` uses a more declarative style of command-line parsing: you create " "an instance of :class:`OptionParser`, populate it with options, and parse " "the command line. :mod:`optparse` allows users to specify options in the " @@ -42,11 +227,11 @@ msgid "" "messages for you." msgstr "" -#: library/optparse.rst:26 +#: library/optparse.rst:137 msgid "Here's an example of using :mod:`optparse` in a simple script::" msgstr "" -#: library/optparse.rst:28 +#: library/optparse.rst:139 msgid "" "from optparse import OptionParser\n" "...\n" @@ -60,17 +245,17 @@ msgid "" "(options, args) = parser.parse_args()" msgstr "" -#: library/optparse.rst:39 +#: library/optparse.rst:150 msgid "" "With these few lines of code, users of your script can now do the \"usual " "thing\" on the command-line, for example::" msgstr "" -#: library/optparse.rst:42 +#: library/optparse.rst:153 msgid " --file=outfile -q" msgstr "" -#: library/optparse.rst:44 +#: library/optparse.rst:155 msgid "" "As it parses the command line, :mod:`optparse` sets attributes of the " "``options`` object returned by :meth:`~OptionParser.parse_args` based on " @@ -83,7 +268,7 @@ msgid "" "the above example::" msgstr "" -#: library/optparse.rst:53 +#: library/optparse.rst:164 msgid "" " -f outfile --quiet\n" " --quiet --file outfile\n" @@ -91,22 +276,22 @@ msgid "" " -qfoutfile" msgstr "" -#: library/optparse.rst:58 +#: library/optparse.rst:169 msgid "Additionally, users can run one of the following ::" msgstr "" -#: library/optparse.rst:60 +#: library/optparse.rst:171 msgid "" " -h\n" " --help" msgstr "" -#: library/optparse.rst:63 +#: library/optparse.rst:174 msgid "" "and :mod:`optparse` will print out a brief summary of your script's options:" msgstr "" -#: library/optparse.rst:65 +#: library/optparse.rst:176 msgid "" "Usage: [options]\n" "\n" @@ -116,34 +301,36 @@ msgid "" " -q, --quiet don't print status messages to stdout" msgstr "" -#: library/optparse.rst:74 +#: library/optparse.rst:185 msgid "" "where the value of *yourscript* is determined at runtime (normally from " "``sys.argv[0]``)." msgstr "" -#: library/optparse.rst:81 +#: library/optparse.rst:192 msgid "Background" msgstr "" -#: library/optparse.rst:83 +#: library/optparse.rst:194 msgid "" ":mod:`optparse` was explicitly designed to encourage the creation of " -"programs with straightforward, conventional command-line interfaces. To " -"that end, it supports only the most common command-line syntax and semantics " -"conventionally used under Unix. If you are unfamiliar with these " -"conventions, read this section to acquaint yourself with them." +"programs with straightforward command-line interfaces that follow the " +"conventions established by the :c:func:`!getopt` family of functions " +"available to C developers. To that end, it supports only the most common " +"command-line syntax and semantics conventionally used under Unix. If you " +"are unfamiliar with these conventions, reading this section will allow you " +"to acquaint yourself with them." msgstr "" -#: library/optparse.rst:93 +#: library/optparse.rst:205 msgid "Terminology" msgstr "" -#: library/optparse.rst:95 +#: library/optparse.rst:207 msgid "argument" msgstr "" -#: library/optparse.rst:96 +#: library/optparse.rst:208 msgid "" "a string entered on the command-line, and passed by the shell to ``execl()`` " "or ``execv()``. In Python, arguments are elements of ``sys.argv[1:]`` " @@ -151,7 +338,7 @@ msgid "" "also use the term \"word\"." msgstr "" -#: library/optparse.rst:101 +#: library/optparse.rst:213 msgid "" "It is occasionally desirable to substitute an argument list other than ``sys." "argv[1:]``, so you should read \"argument\" as \"an element of ``sys." @@ -159,11 +346,11 @@ msgid "" "argv[1:]``\"." msgstr "" -#: library/optparse.rst:106 +#: library/optparse.rst:218 msgid "option" msgstr "" -#: library/optparse.rst:107 +#: library/optparse.rst:219 msgid "" "an argument used to supply extra information to guide or customize the " "execution of a program. There are many different syntaxes for options; the " @@ -175,36 +362,36 @@ msgid "" "option syntaxes provided by :mod:`optparse`." msgstr "" -#: library/optparse.rst:116 +#: library/optparse.rst:228 msgid "Some other option syntaxes that the world has seen include:" msgstr "" -#: library/optparse.rst:118 +#: library/optparse.rst:230 msgid "" "a hyphen followed by a few letters, e.g. ``-pf`` (this is *not* the same as " "multiple options merged into a single argument)" msgstr "" -#: library/optparse.rst:121 +#: library/optparse.rst:233 msgid "" "a hyphen followed by a whole word, e.g. ``-file`` (this is technically " "equivalent to the previous syntax, but they aren't usually seen in the same " "program)" msgstr "" -#: library/optparse.rst:125 +#: library/optparse.rst:237 msgid "" "a plus sign followed by a single letter, or a few letters, or a word, e.g. " "``+f``, ``+rgb``" msgstr "" -#: library/optparse.rst:128 +#: library/optparse.rst:240 msgid "" "a slash followed by a letter, or a few letters, or a word, e.g. ``/f``, ``/" "file``" msgstr "" -#: library/optparse.rst:131 +#: library/optparse.rst:243 msgid "" "These option syntaxes are not supported by :mod:`optparse`, and they never " "will be. This is deliberate: the first three are non-standard on any " @@ -212,11 +399,11 @@ msgid "" "Windows or certain legacy platforms (e.g. VMS, MS-DOS)." msgstr "" -#: library/optparse.rst:136 +#: library/optparse.rst:248 msgid "option argument" msgstr "" -#: library/optparse.rst:137 +#: library/optparse.rst:249 msgid "" "an argument that follows an option, is closely associated with that option, " "and is consumed from the argument list when that option is. With :mod:" @@ -224,23 +411,23 @@ msgid "" "option:" msgstr "" -#: library/optparse.rst:142 +#: library/optparse.rst:254 msgid "" "-f foo\n" "--file foo" msgstr "" -#: library/optparse.rst:147 +#: library/optparse.rst:259 msgid "or included in the same argument:" msgstr "" -#: library/optparse.rst:149 +#: library/optparse.rst:261 msgid "" "-ffoo\n" "--file=foo" msgstr "" -#: library/optparse.rst:154 +#: library/optparse.rst:266 msgid "" "Typically, a given option either takes an argument or it doesn't. Lots of " "people want an \"optional option arguments\" feature, meaning that some " @@ -251,22 +438,22 @@ msgid "" "support this feature." msgstr "" -#: library/optparse.rst:162 +#: library/optparse.rst:274 msgid "positional argument" msgstr "" -#: library/optparse.rst:163 +#: library/optparse.rst:275 msgid "" "something leftover in the argument list after options have been parsed, i.e. " "after options and their arguments have been parsed and removed from the " "argument list." msgstr "" -#: library/optparse.rst:167 +#: library/optparse.rst:279 msgid "required option" msgstr "" -#: library/optparse.rst:168 +#: library/optparse.rst:280 msgid "" "an option that must be supplied on the command-line; note that the phrase " "\"required option\" is self-contradictory in English. :mod:`optparse` " @@ -274,26 +461,26 @@ msgid "" "much help at it either." msgstr "" -#: library/optparse.rst:173 +#: library/optparse.rst:285 msgid "For example, consider this hypothetical command-line::" msgstr "" -#: library/optparse.rst:175 +#: library/optparse.rst:287 msgid "prog -v --report report.txt foo bar" msgstr "" -#: library/optparse.rst:177 +#: library/optparse.rst:289 msgid "" "``-v`` and ``--report`` are both options. Assuming that ``--report`` takes " "one argument, ``report.txt`` is an option argument. ``foo`` and ``bar`` are " "positional arguments." msgstr "" -#: library/optparse.rst:185 +#: library/optparse.rst:297 msgid "What are options for?" msgstr "" -#: library/optparse.rst:187 +#: library/optparse.rst:299 msgid "" "Options are used to provide extra information to tune or customize the " "execution of a program. In case it wasn't clear, options are usually " @@ -305,7 +492,7 @@ msgid "" "interfaces.)" msgstr "" -#: library/optparse.rst:195 +#: library/optparse.rst:307 msgid "" "Lots of people want their programs to have \"required options\". Think " "about it. If it's required, then it's *not optional*! If there is a piece " @@ -313,7 +500,7 @@ msgid "" "successfully, that's what positional arguments are for." msgstr "" -#: library/optparse.rst:200 +#: library/optparse.rst:312 msgid "" "As an example of good command-line interface design, consider the humble " "``cp`` utility, for copying files. It doesn't make much sense to try to " @@ -322,13 +509,13 @@ msgid "" "useful syntax that does not require any options at all::" msgstr "" -#: library/optparse.rst:206 +#: library/optparse.rst:318 msgid "" "cp SOURCE DEST\n" "cp SOURCE ... DEST-DIR" msgstr "" -#: library/optparse.rst:209 +#: library/optparse.rst:321 msgid "" "You can get pretty far with just that. Most ``cp`` implementations provide " "a bunch of options to tweak exactly how the files are copied: you can " @@ -338,17 +525,17 @@ msgid "" "files to another directory." msgstr "" -#: library/optparse.rst:220 +#: library/optparse.rst:332 msgid "What are positional arguments for?" msgstr "" -#: library/optparse.rst:222 +#: library/optparse.rst:334 msgid "" "Positional arguments are for those pieces of information that your program " "absolutely, positively requires to run." msgstr "" -#: library/optparse.rst:225 +#: library/optparse.rst:337 msgid "" "A good user interface should have as few absolute requirements as possible. " "If your program requires 17 distinct pieces of information in order to run " @@ -359,7 +546,7 @@ msgid "" "most of them will simply give up." msgstr "" -#: library/optparse.rst:233 +#: library/optparse.rst:345 msgid "" "In short, try to minimize the amount of information that users are " "absolutely required to supply---use sensible defaults whenever possible. Of " @@ -372,65 +559,65 @@ msgid "" "make your code much harder to maintain." msgstr "" -#: library/optparse.rst:246 +#: library/optparse.rst:358 msgid "Tutorial" msgstr "" -#: library/optparse.rst:248 +#: library/optparse.rst:360 msgid "" "While :mod:`optparse` is quite flexible and powerful, it's also " "straightforward to use in most cases. This section covers the code patterns " "that are common to any :mod:`optparse`\\ -based program." msgstr "" -#: library/optparse.rst:252 +#: library/optparse.rst:364 msgid "" "First, you need to import the OptionParser class; then, early in the main " "program, create an OptionParser instance::" msgstr "" -#: library/optparse.rst:255 +#: library/optparse.rst:367 msgid "" "from optparse import OptionParser\n" "...\n" "parser = OptionParser()" msgstr "" -#: library/optparse.rst:259 +#: library/optparse.rst:371 msgid "Then you can start defining options. The basic syntax is::" msgstr "" -#: library/optparse.rst:261 +#: library/optparse.rst:373 msgid "" "parser.add_option(opt_str, ...,\n" " attr=value, ...)" msgstr "" -#: library/optparse.rst:264 +#: library/optparse.rst:376 msgid "" "Each option has one or more option strings, such as ``-f`` or ``--file``, " "and several option attributes that tell :mod:`optparse` what to expect and " "what to do when it encounters that option on the command line." msgstr "" -#: library/optparse.rst:268 +#: library/optparse.rst:380 msgid "" "Typically, each option will have one short option string and one long option " "string, e.g.::" msgstr "" -#: library/optparse.rst:271 +#: library/optparse.rst:383 msgid "parser.add_option(\"-f\", \"--file\", ...)" msgstr "" -#: library/optparse.rst:273 +#: library/optparse.rst:385 msgid "" "You're free to define as many short option strings and as many long option " "strings as you like (including zero), as long as there is at least one " "option string overall." msgstr "" -#: library/optparse.rst:277 +#: library/optparse.rst:389 msgid "" "The option strings passed to :meth:`OptionParser.add_option` are effectively " "labels for the option defined by that call. For brevity, we will frequently " @@ -438,28 +625,28 @@ msgid "" "`optparse` encounters *option strings* and looks up options from them." msgstr "" -#: library/optparse.rst:283 +#: library/optparse.rst:395 msgid "" "Once all of your options are defined, instruct :mod:`optparse` to parse your " "program's command line::" msgstr "" -#: library/optparse.rst:286 +#: library/optparse.rst:398 msgid "(options, args) = parser.parse_args()" msgstr "" -#: library/optparse.rst:288 +#: library/optparse.rst:400 msgid "" "(If you like, you can pass a custom argument list to :meth:`~OptionParser." "parse_args`, but that's rarely necessary: by default it uses ``sys." "argv[1:]``.)" msgstr "" -#: library/optparse.rst:291 +#: library/optparse.rst:403 msgid ":meth:`~OptionParser.parse_args` returns two values:" msgstr "" -#: library/optparse.rst:293 +#: library/optparse.rst:405 msgid "" "``options``, an object containing values for all of your options---e.g. if " "``--file`` takes a single string argument, then ``options.file`` will be the " @@ -467,12 +654,12 @@ msgid "" "option" msgstr "" -#: library/optparse.rst:298 +#: library/optparse.rst:410 msgid "" "``args``, the list of positional arguments leftover after parsing options" msgstr "" -#: library/optparse.rst:300 +#: library/optparse.rst:412 msgid "" "This tutorial section only covers the four most important option " "attributes: :attr:`~Option.action`, :attr:`~Option.type`, :attr:`~Option." @@ -480,11 +667,11 @@ msgid "" "action` is the most fundamental." msgstr "" -#: library/optparse.rst:309 +#: library/optparse.rst:421 msgid "Understanding option actions" msgstr "" -#: library/optparse.rst:311 +#: library/optparse.rst:423 msgid "" "Actions tell :mod:`optparse` what to do when it encounters an option on the " "command line. There is a fixed set of actions hard-coded into :mod:" @@ -494,44 +681,44 @@ msgid "" "and store it in an attribute of ``options``." msgstr "" -#: library/optparse.rst:318 +#: library/optparse.rst:430 msgid "" "If you don't specify an option action, :mod:`optparse` defaults to ``store``." msgstr "" -#: library/optparse.rst:324 +#: library/optparse.rst:436 msgid "The store action" msgstr "" -#: library/optparse.rst:326 +#: library/optparse.rst:438 msgid "" "The most common option action is ``store``, which tells :mod:`optparse` to " "take the next argument (or the remainder of the current argument), ensure " "that it is of the correct type, and store it to your chosen destination." msgstr "" -#: library/optparse.rst:330 +#: library/optparse.rst:442 msgid "For example::" msgstr "" -#: library/optparse.rst:332 +#: library/optparse.rst:444 msgid "" "parser.add_option(\"-f\", \"--file\",\n" " action=\"store\", type=\"string\", dest=\"filename\")" msgstr "" -#: library/optparse.rst:335 +#: library/optparse.rst:447 msgid "" "Now let's make up a fake command line and ask :mod:`optparse` to parse it::" msgstr "" -#: library/optparse.rst:337 +#: library/optparse.rst:449 msgid "" "args = [\"-f\", \"foo.txt\"]\n" "(options, args) = parser.parse_args(args)" msgstr "" -#: library/optparse.rst:340 +#: library/optparse.rst:452 msgid "" "When :mod:`optparse` sees the option string ``-f``, it consumes the next " "argument, ``foo.txt``, and stores it in ``options.filename``. So, after " @@ -539,51 +726,51 @@ msgid "" "``\"foo.txt\"``." msgstr "" -#: library/optparse.rst:344 +#: library/optparse.rst:456 msgid "" "Some other option types supported by :mod:`optparse` are ``int`` and " "``float``. Here's an option that expects an integer argument::" msgstr "" -#: library/optparse.rst:347 +#: library/optparse.rst:459 msgid "parser.add_option(\"-n\", type=\"int\", dest=\"num\")" msgstr "" -#: library/optparse.rst:349 +#: library/optparse.rst:461 msgid "" "Note that this option has no long option string, which is perfectly " "acceptable. Also, there's no explicit action, since the default is ``store``." msgstr "" -#: library/optparse.rst:352 +#: library/optparse.rst:464 msgid "" "Let's parse another fake command-line. This time, we'll jam the option " "argument right up against the option: since ``-n42`` (one argument) is " "equivalent to ``-n 42`` (two arguments), the code ::" msgstr "" -#: library/optparse.rst:356 +#: library/optparse.rst:468 msgid "" "(options, args) = parser.parse_args([\"-n42\"])\n" "print(options.num)" msgstr "" -#: library/optparse.rst:359 +#: library/optparse.rst:471 msgid "will print ``42``." msgstr "" -#: library/optparse.rst:361 +#: library/optparse.rst:473 msgid "" "If you don't specify a type, :mod:`optparse` assumes ``string``. Combined " "with the fact that the default action is ``store``, that means our first " "example can be a lot shorter::" msgstr "" -#: library/optparse.rst:365 +#: library/optparse.rst:477 msgid "parser.add_option(\"-f\", \"--file\", dest=\"filename\")" msgstr "" -#: library/optparse.rst:367 +#: library/optparse.rst:479 msgid "" "If you don't supply a destination, :mod:`optparse` figures out a sensible " "default from the option strings: if the first long option string is ``--foo-" @@ -592,17 +779,17 @@ msgid "" "default destination for ``-f`` is ``f``." msgstr "" -#: library/optparse.rst:373 +#: library/optparse.rst:485 msgid "" ":mod:`optparse` also includes the built-in ``complex`` type. Adding types " "is covered in section :ref:`optparse-extending-optparse`." msgstr "" -#: library/optparse.rst:380 +#: library/optparse.rst:492 msgid "Handling boolean (flag) options" msgstr "" -#: library/optparse.rst:382 +#: library/optparse.rst:494 msgid "" "Flag options---set a variable to true or false when a particular option is " "seen---are quite common. :mod:`optparse` supports them with two separate " @@ -610,77 +797,77 @@ msgid "" "``verbose`` flag that is turned on with ``-v`` and off with ``-q``::" msgstr "" -#: library/optparse.rst:387 +#: library/optparse.rst:499 msgid "" "parser.add_option(\"-v\", action=\"store_true\", dest=\"verbose\")\n" "parser.add_option(\"-q\", action=\"store_false\", dest=\"verbose\")" msgstr "" -#: library/optparse.rst:390 +#: library/optparse.rst:502 msgid "" "Here we have two different options with the same destination, which is " "perfectly OK. (It just means you have to be a bit careful when setting " "default values---see below.)" msgstr "" -#: library/optparse.rst:394 +#: library/optparse.rst:506 msgid "" "When :mod:`optparse` encounters ``-v`` on the command line, it sets " "``options.verbose`` to ``True``; when it encounters ``-q``, ``options." "verbose`` is set to ``False``." msgstr "" -#: library/optparse.rst:402 +#: library/optparse.rst:514 msgid "Other actions" msgstr "" -#: library/optparse.rst:404 +#: library/optparse.rst:516 msgid "Some other actions supported by :mod:`optparse` are:" msgstr "" -#: library/optparse.rst:928 +#: library/optparse.rst:1040 msgid "``\"store_const\"``" msgstr "" -#: library/optparse.rst:929 +#: library/optparse.rst:1041 msgid "store a constant value, pre-set via :attr:`Option.const`" msgstr "" -#: library/optparse.rst:937 +#: library/optparse.rst:1049 msgid "``\"append\"``" msgstr "" -#: library/optparse.rst:938 +#: library/optparse.rst:1050 msgid "append this option's argument to a list" msgstr "" -#: library/optparse.rst:943 +#: library/optparse.rst:1055 msgid "``\"count\"``" msgstr "" -#: library/optparse.rst:944 +#: library/optparse.rst:1056 msgid "increment a counter by one" msgstr "" -#: library/optparse.rst:946 +#: library/optparse.rst:1058 msgid "``\"callback\"``" msgstr "" -#: library/optparse.rst:947 +#: library/optparse.rst:1059 msgid "call a specified function" msgstr "" -#: library/optparse.rst:418 +#: library/optparse.rst:530 msgid "" "These are covered in section :ref:`optparse-reference-guide`, and section :" "ref:`optparse-option-callbacks`." msgstr "" -#: library/optparse.rst:425 +#: library/optparse.rst:537 msgid "Default values" msgstr "" -#: library/optparse.rst:427 +#: library/optparse.rst:539 msgid "" "All of the above examples involve setting some variable (the " "\"destination\") when certain command-line options are seen. What happens " @@ -690,38 +877,38 @@ msgid "" "destination, which is assigned before the command line is parsed." msgstr "" -#: library/optparse.rst:434 +#: library/optparse.rst:546 msgid "" "First, consider the verbose/quiet example. If we want :mod:`optparse` to " "set ``verbose`` to ``True`` unless ``-q`` is seen, then we can do this::" msgstr "" -#: library/optparse.rst:437 +#: library/optparse.rst:549 msgid "" "parser.add_option(\"-v\", action=\"store_true\", dest=\"verbose\", " "default=True)\n" "parser.add_option(\"-q\", action=\"store_false\", dest=\"verbose\")" msgstr "" -#: library/optparse.rst:440 +#: library/optparse.rst:552 msgid "" "Since default values apply to the *destination* rather than to any " "particular option, and these two options happen to have the same " "destination, this is exactly equivalent::" msgstr "" -#: library/optparse.rst:444 +#: library/optparse.rst:556 msgid "" "parser.add_option(\"-v\", action=\"store_true\", dest=\"verbose\")\n" "parser.add_option(\"-q\", action=\"store_false\", dest=\"verbose\", " "default=True)" msgstr "" -#: library/optparse.rst:447 +#: library/optparse.rst:559 msgid "Consider this::" msgstr "" -#: library/optparse.rst:449 +#: library/optparse.rst:561 msgid "" "parser.add_option(\"-v\", action=\"store_true\", dest=\"verbose\", " "default=False)\n" @@ -729,38 +916,38 @@ msgid "" "default=True)" msgstr "" -#: library/optparse.rst:452 +#: library/optparse.rst:564 msgid "" "Again, the default value for ``verbose`` will be ``True``: the last default " "value supplied for any particular destination is the one that counts." msgstr "" -#: library/optparse.rst:455 +#: library/optparse.rst:567 msgid "" "A clearer way to specify default values is the :meth:`set_defaults` method " "of OptionParser, which you can call at any time before calling :meth:" "`~OptionParser.parse_args`::" msgstr "" -#: library/optparse.rst:459 +#: library/optparse.rst:571 msgid "" "parser.set_defaults(verbose=True)\n" "parser.add_option(...)\n" "(options, args) = parser.parse_args()" msgstr "" -#: library/optparse.rst:463 +#: library/optparse.rst:575 msgid "" "As before, the last value specified for a given option destination is the " "one that counts. For clarity, try to use one method or the other of setting " "default values, not both." msgstr "" -#: library/optparse.rst:471 +#: library/optparse.rst:583 msgid "Generating help" msgstr "" -#: library/optparse.rst:473 +#: library/optparse.rst:585 msgid "" ":mod:`optparse`'s ability to generate help and usage text automatically is " "useful for creating user-friendly command-line interfaces. All you have to " @@ -769,7 +956,7 @@ msgid "" "populated with user-friendly (documented) options::" msgstr "" -#: library/optparse.rst:479 +#: library/optparse.rst:591 msgid "" "usage = \"usage: %prog [options] arg1 arg2\"\n" "parser = OptionParser(usage=usage)\n" @@ -787,14 +974,14 @@ msgid "" " \"or expert [default: %default]\")" msgstr "" -#: library/optparse.rst:494 +#: library/optparse.rst:606 msgid "" "If :mod:`optparse` encounters either ``-h`` or ``--help`` on the command-" "line, or if you just call :meth:`parser.print_help`, it prints the following " "to standard output:" msgstr "" -#: library/optparse.rst:498 +#: library/optparse.rst:610 msgid "" "Usage: [options] arg1 arg2\n" "\n" @@ -808,58 +995,58 @@ msgid "" " expert [default: intermediate]" msgstr "" -#: library/optparse.rst:511 +#: library/optparse.rst:623 msgid "" "(If the help output is triggered by a help option, :mod:`optparse` exits " "after printing the help text.)" msgstr "" -#: library/optparse.rst:514 +#: library/optparse.rst:626 msgid "" "There's a lot going on here to help :mod:`optparse` generate the best " "possible help message:" msgstr "" -#: library/optparse.rst:517 +#: library/optparse.rst:629 msgid "the script defines its own usage message::" msgstr "" -#: library/optparse.rst:519 +#: library/optparse.rst:631 msgid "usage = \"usage: %prog [options] arg1 arg2\"" msgstr "" -#: library/optparse.rst:521 +#: library/optparse.rst:633 msgid "" ":mod:`optparse` expands ``%prog`` in the usage string to the name of the " "current program, i.e. ``os.path.basename(sys.argv[0])``. The expanded " "string is then printed before the detailed option help." msgstr "" -#: library/optparse.rst:525 +#: library/optparse.rst:637 msgid "" "If you don't supply a usage string, :mod:`optparse` uses a bland but " "sensible default: ``\"Usage: %prog [options]\"``, which is fine if your " "script doesn't take any positional arguments." msgstr "" -#: library/optparse.rst:529 +#: library/optparse.rst:641 msgid "" "every option defines a help string, and doesn't worry about line-wrapping---" "\\ :mod:`optparse` takes care of wrapping lines and making the help output " "look good." msgstr "" -#: library/optparse.rst:533 +#: library/optparse.rst:645 msgid "" "options that take a value indicate this fact in their automatically " "generated help message, e.g. for the \"mode\" option::" msgstr "" -#: library/optparse.rst:536 +#: library/optparse.rst:648 msgid "-m MODE, --mode=MODE" msgstr "" -#: library/optparse.rst:538 +#: library/optparse.rst:650 msgid "" "Here, \"MODE\" is called the meta-variable: it stands for the argument that " "the user is expected to supply to ``-m``/``--mode``. By default, :mod:" @@ -869,11 +1056,11 @@ msgid "" "this automatically generated option description::" msgstr "" -#: library/optparse.rst:545 +#: library/optparse.rst:657 msgid "-f FILE, --filename=FILE" msgstr "" -#: library/optparse.rst:547 +#: library/optparse.rst:659 msgid "" "This is important for more than just saving space, though: the manually " "written help text uses the meta-variable ``FILE`` to clue the user in that " @@ -883,7 +1070,7 @@ msgid "" "users." msgstr "" -#: library/optparse.rst:553 +#: library/optparse.rst:665 msgid "" "options that have a default value can include ``%default`` in the help " "string---\\ :mod:`optparse` will replace it with :func:`str` of the option's " @@ -891,58 +1078,58 @@ msgid "" "``None``), ``%default`` expands to ``none``." msgstr "" -#: library/optparse.rst:559 +#: library/optparse.rst:671 msgid "Grouping Options" msgstr "" -#: library/optparse.rst:561 +#: library/optparse.rst:673 msgid "" "When dealing with many options, it is convenient to group these options for " "better help output. An :class:`OptionParser` can contain several option " "groups, each of which can contain several options." msgstr "" -#: library/optparse.rst:565 +#: library/optparse.rst:677 msgid "An option group is obtained using the class :class:`OptionGroup`:" msgstr "" -#: library/optparse.rst:1640 +#: library/optparse.rst:1752 msgid "where" msgstr "" -#: library/optparse.rst:571 +#: library/optparse.rst:683 msgid "" "parser is the :class:`OptionParser` instance the group will be inserted in to" msgstr "" -#: library/optparse.rst:573 +#: library/optparse.rst:685 msgid "title is the group title" msgstr "" -#: library/optparse.rst:574 +#: library/optparse.rst:686 msgid "description, optional, is a long description of the group" msgstr "" -#: library/optparse.rst:576 +#: library/optparse.rst:688 msgid "" ":class:`OptionGroup` inherits from :class:`OptionContainer` (like :class:" "`OptionParser`) and so the :meth:`add_option` method can be used to add an " "option to the group." msgstr "" -#: library/optparse.rst:580 +#: library/optparse.rst:692 msgid "" "Once all the options are declared, using the :class:`OptionParser` method :" "meth:`add_option_group` the group is added to the previously defined parser." msgstr "" -#: library/optparse.rst:583 +#: library/optparse.rst:695 msgid "" "Continuing with the parser defined in the previous section, adding an :class:" "`OptionGroup` to a parser is easy::" msgstr "" -#: library/optparse.rst:586 +#: library/optparse.rst:698 msgid "" "group = OptionGroup(parser, \"Dangerous Options\",\n" " \"Caution: use these options at your own risk. \"\n" @@ -951,11 +1138,11 @@ msgid "" "parser.add_option_group(group)" msgstr "" -#: library/optparse.rst:592 +#: library/optparse.rst:704 msgid "This would result in the following help output:" msgstr "" -#: library/optparse.rst:594 +#: library/optparse.rst:706 msgid "" "Usage: [options] arg1 arg2\n" "\n" @@ -975,13 +1162,13 @@ msgid "" " -g Group option." msgstr "" -#: library/optparse.rst:613 +#: library/optparse.rst:725 msgid "" "A bit more complete example might involve using more than one group: still " "extending the previous example::" msgstr "" -#: library/optparse.rst:616 +#: library/optparse.rst:728 msgid "" "group = OptionGroup(parser, \"Dangerous Options\",\n" " \"Caution: use these options at your own risk. \"\n" @@ -999,11 +1186,11 @@ msgid "" "parser.add_option_group(group)" msgstr "" -#: library/optparse.rst:630 +#: library/optparse.rst:742 msgid "that results in the following output:" msgstr "" -#: library/optparse.rst:632 +#: library/optparse.rst:744 msgid "" "Usage: [options] arg1 arg2\n" "\n" @@ -1028,35 +1215,35 @@ msgid "" " -e Print every action done" msgstr "" -#: library/optparse.rst:656 +#: library/optparse.rst:768 msgid "" "Another interesting method, in particular when working programmatically with " "option groups is:" msgstr "" -#: library/optparse.rst:661 +#: library/optparse.rst:773 msgid "" "Return the :class:`OptionGroup` to which the short or long option string " "*opt_str* (e.g. ``'-o'`` or ``'--option'``) belongs. If there's no such :" "class:`OptionGroup`, return ``None``." msgstr "" -#: library/optparse.rst:668 +#: library/optparse.rst:780 msgid "Printing a version string" msgstr "" -#: library/optparse.rst:670 +#: library/optparse.rst:782 msgid "" "Similar to the brief usage string, :mod:`optparse` can also print a version " "string for your program. You have to supply the string as the ``version`` " "argument to OptionParser::" msgstr "" -#: library/optparse.rst:674 +#: library/optparse.rst:786 msgid "parser = OptionParser(usage=\"%prog [-f] [-q]\", version=\"%prog 1.0\")" msgstr "" -#: library/optparse.rst:676 +#: library/optparse.rst:788 msgid "" "``%prog`` is expanded just like it is in ``usage``. Apart from that, " "``version`` can contain anything you like. When you supply it, :mod:" @@ -1065,23 +1252,23 @@ msgid "" "string (by replacing ``%prog``), prints it to stdout, and exits." msgstr "" -#: library/optparse.rst:682 +#: library/optparse.rst:794 msgid "For example, if your script is called ``/usr/bin/foo``:" msgstr "" -#: library/optparse.rst:684 +#: library/optparse.rst:796 msgid "" "$ /usr/bin/foo --version\n" "foo 1.0" msgstr "" -#: library/optparse.rst:689 +#: library/optparse.rst:801 msgid "" "The following two methods can be used to print and get the ``version`` " "string:" msgstr "" -#: library/optparse.rst:693 +#: library/optparse.rst:805 msgid "" "Print the version message for the current program (``self.version``) to " "*file* (default stdout). As with :meth:`print_usage`, any occurrence of " @@ -1089,17 +1276,17 @@ msgid "" "program. Does nothing if ``self.version`` is empty or undefined." msgstr "" -#: library/optparse.rst:700 +#: library/optparse.rst:812 msgid "" "Same as :meth:`print_version` but returns the version string instead of " "printing it." msgstr "" -#: library/optparse.rst:707 +#: library/optparse.rst:819 msgid "How :mod:`optparse` handles errors" msgstr "" -#: library/optparse.rst:709 +#: library/optparse.rst:821 msgid "" "There are two broad classes of errors that :mod:`optparse` has to worry " "about: programmer errors and user errors. Programmer errors are usually " @@ -1109,7 +1296,7 @@ msgid "" "OptionError` or :exc:`TypeError`) and let the program crash." msgstr "" -#: library/optparse.rst:716 +#: library/optparse.rst:828 msgid "" "Handling user errors is much more important, since they are guaranteed to " "happen no matter how stable your code is. :mod:`optparse` can automatically " @@ -1120,7 +1307,7 @@ msgid "" "error condition::" msgstr "" -#: library/optparse.rst:724 +#: library/optparse.rst:836 msgid "" "(options, args) = parser.parse_args()\n" "...\n" @@ -1128,20 +1315,20 @@ msgid "" " parser.error(\"options -a and -b are mutually exclusive\")" msgstr "" -#: library/optparse.rst:729 +#: library/optparse.rst:841 msgid "" "In either case, :mod:`optparse` handles the error the same way: it prints " "the program's usage message and an error message to standard error and exits " "with error status 2." msgstr "" -#: library/optparse.rst:733 +#: library/optparse.rst:845 msgid "" "Consider the first example above, where the user passes ``4x`` to an option " "that takes an integer:" msgstr "" -#: library/optparse.rst:736 +#: library/optparse.rst:848 msgid "" "$ /usr/bin/foo -n 4x\n" "Usage: foo [options]\n" @@ -1149,11 +1336,11 @@ msgid "" "foo: error: option -n: invalid integer value: '4x'" msgstr "" -#: library/optparse.rst:743 +#: library/optparse.rst:855 msgid "Or, where the user fails to pass a value at all:" msgstr "" -#: library/optparse.rst:745 +#: library/optparse.rst:857 msgid "" "$ /usr/bin/foo -n\n" "Usage: foo [options]\n" @@ -1161,29 +1348,29 @@ msgid "" "foo: error: -n option requires an argument" msgstr "" -#: library/optparse.rst:752 +#: library/optparse.rst:864 msgid "" ":mod:`optparse`\\ -generated error messages take care always to mention the " "option involved in the error; be sure to do the same when calling :func:" "`OptionParser.error` from your application code." msgstr "" -#: library/optparse.rst:756 +#: library/optparse.rst:868 msgid "" "If :mod:`optparse`'s default error-handling behaviour does not suit your " "needs, you'll need to subclass OptionParser and override its :meth:" "`~OptionParser.exit` and/or :meth:`~OptionParser.error` methods." msgstr "" -#: library/optparse.rst:764 +#: library/optparse.rst:876 msgid "Putting it all together" msgstr "" -#: library/optparse.rst:766 +#: library/optparse.rst:878 msgid "Here's what :mod:`optparse`\\ -based scripts usually look like::" msgstr "" -#: library/optparse.rst:768 +#: library/optparse.rst:880 msgid "" "from optparse import OptionParser\n" "...\n" @@ -1208,32 +1395,32 @@ msgid "" " main()" msgstr "" -#: library/optparse.rst:794 +#: library/optparse.rst:906 msgid "Reference Guide" msgstr "" -#: library/optparse.rst:800 +#: library/optparse.rst:912 msgid "Creating the parser" msgstr "" -#: library/optparse.rst:802 +#: library/optparse.rst:914 msgid "" "The first step in using :mod:`optparse` is to create an OptionParser " "instance." msgstr "" -#: library/optparse.rst:806 +#: library/optparse.rst:918 msgid "" "The OptionParser constructor has no required arguments, but a number of " "optional keyword arguments. You should always pass them as keyword " "arguments, i.e. do not rely on the order in which the arguments are declared." msgstr "" -#: library/optparse.rst:810 +#: library/optparse.rst:922 msgid "``usage`` (default: ``\"%prog [options]\"``)" msgstr "" -#: library/optparse.rst:811 +#: library/optparse.rst:923 msgid "" "The usage summary to print when your program is run incorrectly or with a " "help option. When :mod:`optparse` prints the usage string, it expands " @@ -1242,11 +1429,11 @@ msgid "" "value :const:`optparse.SUPPRESS_USAGE`." msgstr "" -#: library/optparse.rst:817 +#: library/optparse.rst:929 msgid "``option_list`` (default: ``[]``)" msgstr "" -#: library/optparse.rst:818 +#: library/optparse.rst:930 msgid "" "A list of Option objects to populate the parser with. The options in " "``option_list`` are added after any options in ``standard_option_list`` (a " @@ -1255,19 +1442,19 @@ msgid "" "the parser instead." msgstr "" -#: library/optparse.rst:824 +#: library/optparse.rst:936 msgid "``option_class`` (default: optparse.Option)" msgstr "" -#: library/optparse.rst:825 +#: library/optparse.rst:937 msgid "Class to use when adding options to the parser in :meth:`add_option`." msgstr "" -#: library/optparse.rst:827 +#: library/optparse.rst:939 msgid "``version`` (default: ``None``)" msgstr "" -#: library/optparse.rst:828 +#: library/optparse.rst:940 msgid "" "A version string to print when the user supplies a version option. If you " "supply a true value for ``version``, :mod:`optparse` automatically adds a " @@ -1275,21 +1462,21 @@ msgid "" "``%prog`` is expanded the same as for ``usage``." msgstr "" -#: library/optparse.rst:833 +#: library/optparse.rst:945 msgid "``conflict_handler`` (default: ``\"error\"``)" msgstr "" -#: library/optparse.rst:834 +#: library/optparse.rst:946 msgid "" "Specifies what to do when options with conflicting option strings are added " "to the parser; see section :ref:`optparse-conflicts-between-options`." msgstr "" -#: library/optparse.rst:838 +#: library/optparse.rst:950 msgid "``description`` (default: ``None``)" msgstr "" -#: library/optparse.rst:839 +#: library/optparse.rst:951 msgid "" "A paragraph of text giving a brief overview of your program. :mod:`optparse` " "reformats this paragraph to fit the current terminal width and prints it " @@ -1297,74 +1484,74 @@ msgid "" "options)." msgstr "" -#: library/optparse.rst:844 +#: library/optparse.rst:956 msgid "``formatter`` (default: a new :class:`IndentedHelpFormatter`)" msgstr "" -#: library/optparse.rst:845 +#: library/optparse.rst:957 msgid "" "An instance of optparse.HelpFormatter that will be used for printing help " "text. :mod:`optparse` provides two concrete classes for this purpose: " "IndentedHelpFormatter and TitledHelpFormatter." msgstr "" -#: library/optparse.rst:849 +#: library/optparse.rst:961 msgid "``add_help_option`` (default: ``True``)" msgstr "" -#: library/optparse.rst:850 +#: library/optparse.rst:962 msgid "" "If true, :mod:`optparse` will add a help option (with option strings ``-h`` " "and ``--help``) to the parser." msgstr "" -#: library/optparse.rst:853 +#: library/optparse.rst:965 msgid "``prog``" msgstr "" -#: library/optparse.rst:854 +#: library/optparse.rst:966 msgid "" "The string to use when expanding ``%prog`` in ``usage`` and ``version`` " "instead of ``os.path.basename(sys.argv[0])``." msgstr "" -#: library/optparse.rst:857 +#: library/optparse.rst:969 msgid "``epilog`` (default: ``None``)" msgstr "" -#: library/optparse.rst:858 +#: library/optparse.rst:970 msgid "A paragraph of help text to print after the option help." msgstr "" -#: library/optparse.rst:863 +#: library/optparse.rst:975 msgid "Populating the parser" msgstr "" -#: library/optparse.rst:865 +#: library/optparse.rst:977 msgid "" "There are several ways to populate the parser with options. The preferred " "way is by using :meth:`OptionParser.add_option`, as shown in section :ref:" "`optparse-tutorial`. :meth:`add_option` can be called in one of two ways:" msgstr "" -#: library/optparse.rst:869 +#: library/optparse.rst:981 msgid "pass it an Option instance (as returned by :func:`make_option`)" msgstr "" -#: library/optparse.rst:871 +#: library/optparse.rst:983 msgid "" "pass it any combination of positional and keyword arguments that are " "acceptable to :func:`make_option` (i.e., to the Option constructor), and it " "will create the Option instance for you" msgstr "" -#: library/optparse.rst:875 +#: library/optparse.rst:987 msgid "" "The other alternative is to pass a list of pre-constructed Option instances " "to the OptionParser constructor, as in::" msgstr "" -#: library/optparse.rst:878 +#: library/optparse.rst:990 msgid "" "option_list = [\n" " make_option(\"-f\", \"--filename\",\n" @@ -1375,7 +1562,7 @@ msgid "" "parser = OptionParser(option_list=option_list)" msgstr "" -#: library/optparse.rst:886 +#: library/optparse.rst:998 msgid "" "(:func:`make_option` is a factory function for creating Option instances; " "currently it is an alias for the Option constructor. A future version of :" @@ -1384,40 +1571,40 @@ msgid "" "Option directly.)" msgstr "" -#: library/optparse.rst:895 +#: library/optparse.rst:1007 msgid "Defining options" msgstr "" -#: library/optparse.rst:897 +#: library/optparse.rst:1009 msgid "" "Each Option instance represents a set of synonymous command-line option " "strings, e.g. ``-f`` and ``--file``. You can specify any number of short or " "long option strings, but you must specify at least one overall option string." msgstr "" -#: library/optparse.rst:901 +#: library/optparse.rst:1013 msgid "" "The canonical way to create an :class:`Option` instance is with the :meth:" "`add_option` method of :class:`OptionParser`." msgstr "" -#: library/optparse.rst:907 +#: library/optparse.rst:1019 msgid "To define an option with only a short option string::" msgstr "" -#: library/optparse.rst:909 +#: library/optparse.rst:1021 msgid "parser.add_option(\"-f\", attr=value, ...)" msgstr "" -#: library/optparse.rst:911 +#: library/optparse.rst:1023 msgid "And to define an option with only a long option string::" msgstr "" -#: library/optparse.rst:913 +#: library/optparse.rst:1025 msgid "parser.add_option(\"--foo\", attr=value, ...)" msgstr "" -#: library/optparse.rst:915 +#: library/optparse.rst:1027 msgid "" "The keyword arguments define attributes of the new Option object. The most " "important option attribute is :attr:`~Option.action`, and it largely " @@ -1426,69 +1613,69 @@ msgid "" "raises an :exc:`OptionError` exception explaining your mistake." msgstr "" -#: library/optparse.rst:921 +#: library/optparse.rst:1033 msgid "" "An option's *action* determines what :mod:`optparse` does when it encounters " "this option on the command-line. The standard option actions hard-coded " "into :mod:`optparse` are:" msgstr "" -#: library/optparse.rst:925 +#: library/optparse.rst:1037 msgid "``\"store\"``" msgstr "" -#: library/optparse.rst:926 +#: library/optparse.rst:1038 msgid "store this option's argument (default)" msgstr "" -#: library/optparse.rst:931 +#: library/optparse.rst:1043 msgid "``\"store_true\"``" msgstr "" -#: library/optparse.rst:932 +#: library/optparse.rst:1044 msgid "store ``True``" msgstr "" -#: library/optparse.rst:934 +#: library/optparse.rst:1046 msgid "``\"store_false\"``" msgstr "" -#: library/optparse.rst:935 +#: library/optparse.rst:1047 msgid "store ``False``" msgstr "" -#: library/optparse.rst:940 +#: library/optparse.rst:1052 msgid "``\"append_const\"``" msgstr "" -#: library/optparse.rst:941 +#: library/optparse.rst:1053 msgid "append a constant value to a list, pre-set via :attr:`Option.const`" msgstr "" -#: library/optparse.rst:1244 +#: library/optparse.rst:1356 msgid "``\"help\"``" msgstr "" -#: library/optparse.rst:950 +#: library/optparse.rst:1062 msgid "" "print a usage message including all options and the documentation for them" msgstr "" -#: library/optparse.rst:952 +#: library/optparse.rst:1064 msgid "" "(If you don't supply an action, the default is ``\"store\"``. For this " "action, you may also supply :attr:`~Option.type` and :attr:`~Option.dest` " "option attributes; see :ref:`optparse-standard-option-actions`.)" msgstr "" -#: library/optparse.rst:956 +#: library/optparse.rst:1068 msgid "" "As you can see, most actions involve storing or updating a value somewhere. :" "mod:`optparse` always creates a special object for this, conventionally " "called ``options``, which is an instance of :class:`optparse.Values`." msgstr "" -#: library/optparse.rst:962 +#: library/optparse.rst:1074 msgid "" "An object holding parsed argument names and values as attributes. Normally " "created by calling when calling :meth:`OptionParser.parse_args`, and can be " @@ -1497,45 +1684,45 @@ msgid "" "arguments`)." msgstr "" -#: library/optparse.rst:967 +#: library/optparse.rst:1079 msgid "" "Option arguments (and various other values) are stored as attributes of this " "object, according to the :attr:`~Option.dest` (destination) option attribute." msgstr "" -#: library/optparse.rst:971 +#: library/optparse.rst:1083 msgid "For example, when you call ::" msgstr "" -#: library/optparse.rst:973 +#: library/optparse.rst:1085 msgid "parser.parse_args()" msgstr "" -#: library/optparse.rst:975 +#: library/optparse.rst:1087 msgid "" "one of the first things :mod:`optparse` does is create the ``options`` " "object::" msgstr "" -#: library/optparse.rst:977 +#: library/optparse.rst:1089 msgid "options = Values()" msgstr "" -#: library/optparse.rst:979 +#: library/optparse.rst:1091 msgid "If one of the options in this parser is defined with ::" msgstr "" -#: library/optparse.rst:981 +#: library/optparse.rst:1093 msgid "" "parser.add_option(\"-f\", \"--file\", action=\"store\", type=\"string\", " "dest=\"filename\")" msgstr "" -#: library/optparse.rst:983 +#: library/optparse.rst:1095 msgid "and the command-line being parsed includes any of the following::" msgstr "" -#: library/optparse.rst:985 +#: library/optparse.rst:1097 msgid "" "-ffoo\n" "-f foo\n" @@ -1543,27 +1730,27 @@ msgid "" "--file foo" msgstr "" -#: library/optparse.rst:990 +#: library/optparse.rst:1102 msgid "" "then :mod:`optparse`, on seeing this option, will do the equivalent of ::" msgstr "" -#: library/optparse.rst:992 +#: library/optparse.rst:1104 msgid "options.filename = \"foo\"" msgstr "" -#: library/optparse.rst:994 +#: library/optparse.rst:1106 msgid "" "The :attr:`~Option.type` and :attr:`~Option.dest` option attributes are " "almost as important as :attr:`~Option.action`, but :attr:`~Option.action` is " "the only one that makes sense for *all* options." msgstr "" -#: library/optparse.rst:1002 +#: library/optparse.rst:1114 msgid "Option attributes" msgstr "" -#: library/optparse.rst:1006 +#: library/optparse.rst:1118 msgid "" "A single command line argument, with various attributes passed by keyword to " "the constructor. Normally created with :meth:`OptionParser.add_option` " @@ -1571,7 +1758,7 @@ msgid "" "*option_class* argument to :class:`OptionParser`." msgstr "" -#: library/optparse.rst:1012 +#: library/optparse.rst:1124 msgid "" "The following option attributes may be passed as keyword arguments to :meth:" "`OptionParser.add_option`. If you pass an option attribute that is not " @@ -1579,33 +1766,33 @@ msgid "" "attribute, :mod:`optparse` raises :exc:`OptionError`." msgstr "" -#: library/optparse.rst:1019 +#: library/optparse.rst:1131 msgid "(default: ``\"store\"``)" msgstr "" -#: library/optparse.rst:1021 +#: library/optparse.rst:1133 msgid "" "Determines :mod:`optparse`'s behaviour when this option is seen on the " "command line; the available options are documented :ref:`here `." msgstr "" -#: library/optparse.rst:1027 +#: library/optparse.rst:1139 msgid "(default: ``\"string\"``)" msgstr "" -#: library/optparse.rst:1029 +#: library/optparse.rst:1141 msgid "" "The argument type expected by this option (e.g., ``\"string\"`` or " "``\"int\"``); the available option types are documented :ref:`here `." msgstr "" -#: library/optparse.rst:1085 +#: library/optparse.rst:1197 msgid "(default: derived from option strings)" msgstr "" -#: library/optparse.rst:1037 +#: library/optparse.rst:1149 msgid "" "If the option's action implies writing or modifying a value somewhere, this " "tells :mod:`optparse` where to write it: :attr:`~Option.dest` names an " @@ -1613,47 +1800,47 @@ msgid "" "the command line." msgstr "" -#: library/optparse.rst:1044 +#: library/optparse.rst:1156 msgid "" "The value to use for this option's destination if the option is not seen on " "the command line. See also :meth:`OptionParser.set_defaults`." msgstr "" -#: library/optparse.rst:1049 +#: library/optparse.rst:1161 msgid "(default: 1)" msgstr "" -#: library/optparse.rst:1051 +#: library/optparse.rst:1163 msgid "" "How many arguments of type :attr:`~Option.type` should be consumed when this " "option is seen. If > 1, :mod:`optparse` will store a tuple of values to :" "attr:`~Option.dest`." msgstr "" -#: library/optparse.rst:1057 +#: library/optparse.rst:1169 msgid "For actions that store a constant value, the constant value to store." msgstr "" -#: library/optparse.rst:1061 +#: library/optparse.rst:1173 msgid "" "For options of type ``\"choice\"``, the list of strings the user may choose " "from." msgstr "" -#: library/optparse.rst:1066 +#: library/optparse.rst:1178 msgid "" "For options with action ``\"callback\"``, the callable to call when this " "option is seen. See section :ref:`optparse-option-callbacks` for detail on " "the arguments passed to the callable." msgstr "" -#: library/optparse.rst:1073 +#: library/optparse.rst:1185 msgid "" "Additional positional and keyword arguments to pass to ``callback`` after " "the four standard callback arguments." msgstr "" -#: library/optparse.rst:1078 +#: library/optparse.rst:1190 msgid "" "Help text to print for this option when listing all available options after " "the user supplies a :attr:`~Option.help` option (such as ``--help``). If no " @@ -1661,17 +1848,17 @@ msgid "" "this option, use the special value :const:`optparse.SUPPRESS_HELP`." msgstr "" -#: library/optparse.rst:1087 +#: library/optparse.rst:1199 msgid "" "Stand-in for the option argument(s) to use when printing help text. See " "section :ref:`optparse-tutorial` for an example." msgstr "" -#: library/optparse.rst:1094 +#: library/optparse.rst:1206 msgid "Standard option actions" msgstr "" -#: library/optparse.rst:1096 +#: library/optparse.rst:1208 msgid "" "The various option actions all have slightly different requirements and " "effects. Most actions have several relevant option attributes which you may " @@ -1679,13 +1866,13 @@ msgid "" "attributes, which you must specify for any option using that action." msgstr "" -#: library/optparse.rst:1101 +#: library/optparse.rst:1213 msgid "" "``\"store\"`` [relevant: :attr:`~Option.type`, :attr:`~Option.dest`, :attr:" "`~Option.nargs`, :attr:`~Option.choices`]" msgstr "" -#: library/optparse.rst:1104 +#: library/optparse.rst:1216 msgid "" "The option must be followed by an argument, which is converted to a value " "according to :attr:`~Option.type` and stored in :attr:`~Option.dest`. If :" @@ -1695,17 +1882,17 @@ msgid "" "option-types` section." msgstr "" -#: library/optparse.rst:1111 +#: library/optparse.rst:1223 msgid "" "If :attr:`~Option.choices` is supplied (a list or tuple of strings), the " "type defaults to ``\"choice\"``." msgstr "" -#: library/optparse.rst:1114 +#: library/optparse.rst:1226 msgid "If :attr:`~Option.type` is not supplied, it defaults to ``\"string\"``." msgstr "" -#: library/optparse.rst:1116 +#: library/optparse.rst:1228 msgid "" "If :attr:`~Option.dest` is not supplied, :mod:`optparse` derives a " "destination from the first long option string (e.g., ``--foo-bar`` implies " @@ -1713,47 +1900,47 @@ msgid "" "destination from the first short option string (e.g., ``-f`` implies ``f``)." msgstr "" -#: library/optparse.rst:1141 library/optparse.rst:1181 -#: library/optparse.rst:1258 +#: library/optparse.rst:1253 library/optparse.rst:1293 +#: library/optparse.rst:1370 msgid "Example::" msgstr "" -#: library/optparse.rst:1123 +#: library/optparse.rst:1235 msgid "" "parser.add_option(\"-f\")\n" "parser.add_option(\"-p\", type=\"float\", nargs=3, dest=\"point\")" msgstr "" -#: library/optparse.rst:1126 +#: library/optparse.rst:1238 msgid "As it parses the command line ::" msgstr "" -#: library/optparse.rst:1128 +#: library/optparse.rst:1240 msgid "-f foo.txt -p 1 -3.5 4 -fbar.txt" msgstr "" -#: library/optparse.rst:1130 +#: library/optparse.rst:1242 msgid ":mod:`optparse` will set ::" msgstr "" -#: library/optparse.rst:1132 +#: library/optparse.rst:1244 msgid "" "options.f = \"foo.txt\"\n" "options.point = (1.0, -3.5, 4.0)\n" "options.f = \"bar.txt\"" msgstr "" -#: library/optparse.rst:1136 +#: library/optparse.rst:1248 msgid "" "``\"store_const\"`` [required: :attr:`~Option.const`; relevant: :attr:" "`~Option.dest`]" msgstr "" -#: library/optparse.rst:1139 +#: library/optparse.rst:1251 msgid "The value :attr:`~Option.const` is stored in :attr:`~Option.dest`." msgstr "" -#: library/optparse.rst:1143 +#: library/optparse.rst:1255 msgid "" "parser.add_option(\"-q\", \"--quiet\",\n" " action=\"store_const\", const=0, dest=\"verbose\")\n" @@ -1763,45 +1950,45 @@ msgid "" " action=\"store_const\", const=2, dest=\"verbose\")" msgstr "" -#: library/optparse.rst:1150 +#: library/optparse.rst:1262 msgid "If ``--noisy`` is seen, :mod:`optparse` will set ::" msgstr "" -#: library/optparse.rst:1152 +#: library/optparse.rst:1264 msgid "options.verbose = 2" msgstr "" -#: library/optparse.rst:1154 +#: library/optparse.rst:1266 msgid "``\"store_true\"`` [relevant: :attr:`~Option.dest`]" msgstr "" -#: library/optparse.rst:1156 +#: library/optparse.rst:1268 msgid "" "A special case of ``\"store_const\"`` that stores ``True`` to :attr:`~Option." "dest`." msgstr "" -#: library/optparse.rst:1159 +#: library/optparse.rst:1271 msgid "``\"store_false\"`` [relevant: :attr:`~Option.dest`]" msgstr "" -#: library/optparse.rst:1161 +#: library/optparse.rst:1273 msgid "Like ``\"store_true\"``, but stores ``False``." msgstr "" -#: library/optparse.rst:1165 +#: library/optparse.rst:1277 msgid "" "parser.add_option(\"--clobber\", action=\"store_true\", dest=\"clobber\")\n" "parser.add_option(\"--no-clobber\", action=\"store_false\", dest=\"clobber\")" msgstr "" -#: library/optparse.rst:1168 +#: library/optparse.rst:1280 msgid "" "``\"append\"`` [relevant: :attr:`~Option.type`, :attr:`~Option.dest`, :attr:" "`~Option.nargs`, :attr:`~Option.choices`]" msgstr "" -#: library/optparse.rst:1171 +#: library/optparse.rst:1283 msgid "" "The option must be followed by an argument, which is appended to the list " "in :attr:`~Option.dest`. If no default value for :attr:`~Option.dest` is " @@ -1811,38 +1998,38 @@ msgid "" "is appended to :attr:`~Option.dest`." msgstr "" -#: library/optparse.rst:1178 +#: library/optparse.rst:1290 msgid "" "The defaults for :attr:`~Option.type` and :attr:`~Option.dest` are the same " "as for the ``\"store\"`` action." msgstr "" -#: library/optparse.rst:1183 +#: library/optparse.rst:1295 msgid "" "parser.add_option(\"-t\", \"--tracks\", action=\"append\", type=\"int\")" msgstr "" -#: library/optparse.rst:1185 +#: library/optparse.rst:1297 msgid "" "If ``-t3`` is seen on the command-line, :mod:`optparse` does the equivalent " "of::" msgstr "" -#: library/optparse.rst:1188 +#: library/optparse.rst:1300 msgid "" "options.tracks = []\n" "options.tracks.append(int(\"3\"))" msgstr "" -#: library/optparse.rst:1191 +#: library/optparse.rst:1303 msgid "If, a little later on, ``--tracks=4`` is seen, it does::" msgstr "" -#: library/optparse.rst:1193 +#: library/optparse.rst:1305 msgid "options.tracks.append(int(\"4\"))" msgstr "" -#: library/optparse.rst:1195 +#: library/optparse.rst:1307 msgid "" "The ``append`` action calls the ``append`` method on the current value of " "the option. This means that any default value specified must have an " @@ -1851,7 +2038,7 @@ msgid "" "with any values from the command line appended after those default values::" msgstr "" -#: library/optparse.rst:1201 +#: library/optparse.rst:1313 msgid "" ">>> parser.add_option(\"--files\", action=\"append\", default=['~/.mypkg/" "defaults'])\n" @@ -1860,13 +2047,13 @@ msgid "" "['~/.mypkg/defaults', 'overrides.mypkg']" msgstr "" -#: library/optparse.rst:1206 +#: library/optparse.rst:1318 msgid "" "``\"append_const\"`` [required: :attr:`~Option.const`; relevant: :attr:" "`~Option.dest`]" msgstr "" -#: library/optparse.rst:1209 +#: library/optparse.rst:1321 msgid "" "Like ``\"store_const\"``, but the value :attr:`~Option.const` is appended " "to :attr:`~Option.dest`; as with ``\"append\"``, :attr:`~Option.dest` " @@ -1874,63 +2061,63 @@ msgid "" "time the option is encountered." msgstr "" -#: library/optparse.rst:1214 +#: library/optparse.rst:1326 msgid "``\"count\"`` [relevant: :attr:`~Option.dest`]" msgstr "" -#: library/optparse.rst:1216 +#: library/optparse.rst:1328 msgid "" "Increment the integer stored at :attr:`~Option.dest`. If no default value " "is supplied, :attr:`~Option.dest` is set to zero before being incremented " "the first time." msgstr "" -#: library/optparse.rst:1222 +#: library/optparse.rst:1334 msgid "parser.add_option(\"-v\", action=\"count\", dest=\"verbosity\")" msgstr "" -#: library/optparse.rst:1224 +#: library/optparse.rst:1336 msgid "" "The first time ``-v`` is seen on the command line, :mod:`optparse` does the " "equivalent of::" msgstr "" -#: library/optparse.rst:1227 +#: library/optparse.rst:1339 msgid "" "options.verbosity = 0\n" "options.verbosity += 1" msgstr "" -#: library/optparse.rst:1230 +#: library/optparse.rst:1342 msgid "Every subsequent occurrence of ``-v`` results in ::" msgstr "" -#: library/optparse.rst:1232 +#: library/optparse.rst:1344 msgid "options.verbosity += 1" msgstr "" -#: library/optparse.rst:1234 +#: library/optparse.rst:1346 msgid "" "``\"callback\"`` [required: :attr:`~Option.callback`; relevant: :attr:" "`~Option.type`, :attr:`~Option.nargs`, :attr:`~Option.callback_args`, :attr:" "`~Option.callback_kwargs`]" msgstr "" -#: library/optparse.rst:1238 +#: library/optparse.rst:1350 msgid "" "Call the function specified by :attr:`~Option.callback`, which is called " "as ::" msgstr "" -#: library/optparse.rst:1638 +#: library/optparse.rst:1750 msgid "func(option, opt_str, value, parser, *args, **kwargs)" msgstr "" -#: library/optparse.rst:1242 +#: library/optparse.rst:1354 msgid "See section :ref:`optparse-option-callbacks` for more detail." msgstr "" -#: library/optparse.rst:1246 +#: library/optparse.rst:1358 msgid "" "Prints a complete help message for all the options in the current option " "parser. The help message is constructed from the ``usage`` string passed to " @@ -1938,20 +2125,20 @@ msgid "" "every option." msgstr "" -#: library/optparse.rst:1251 +#: library/optparse.rst:1363 msgid "" "If no :attr:`~Option.help` string is supplied for an option, it will still " "be listed in the help message. To omit an option entirely, use the special " "value :const:`optparse.SUPPRESS_HELP`." msgstr "" -#: library/optparse.rst:1255 +#: library/optparse.rst:1367 msgid "" ":mod:`optparse` automatically adds a :attr:`~Option.help` option to all " "OptionParsers, so you do not normally need to create one." msgstr "" -#: library/optparse.rst:1260 +#: library/optparse.rst:1372 msgid "" "from optparse import OptionParser, SUPPRESS_HELP\n" "\n" @@ -1967,14 +2154,14 @@ msgid "" "parser.add_option(\"--secret\", help=SUPPRESS_HELP)" msgstr "" -#: library/optparse.rst:1273 +#: library/optparse.rst:1385 msgid "" "If :mod:`optparse` sees either ``-h`` or ``--help`` on the command line, it " "will print something like the following help message to stdout (assuming " "``sys.argv[0]`` is ``\"foo.py\"``):" msgstr "" -#: library/optparse.rst:1277 +#: library/optparse.rst:1389 msgid "" "Usage: foo.py [options]\n" "\n" @@ -1984,17 +2171,17 @@ msgid "" " --file=FILENAME Input file to read data from" msgstr "" -#: library/optparse.rst:1286 +#: library/optparse.rst:1398 msgid "" "After printing the help message, :mod:`optparse` terminates your process " "with ``sys.exit(0)``." msgstr "" -#: library/optparse.rst:1289 +#: library/optparse.rst:1401 msgid "``\"version\"``" msgstr "" -#: library/optparse.rst:1291 +#: library/optparse.rst:1403 msgid "" "Prints the version number supplied to the OptionParser to stdout and exits. " "The version number is actually formatted and printed by the " @@ -2004,58 +2191,58 @@ msgid "" "since :mod:`optparse` automatically adds them when needed." msgstr "" -#: library/optparse.rst:1302 +#: library/optparse.rst:1414 msgid "Standard option types" msgstr "" -#: library/optparse.rst:1304 +#: library/optparse.rst:1416 msgid "" ":mod:`optparse` has five built-in option types: ``\"string\"``, ``\"int\"``, " "``\"choice\"``, ``\"float\"`` and ``\"complex\"``. If you need to add new " "option types, see section :ref:`optparse-extending-optparse`." msgstr "" -#: library/optparse.rst:1308 +#: library/optparse.rst:1420 msgid "" "Arguments to string options are not checked or converted in any way: the " "text on the command line is stored in the destination (or passed to the " "callback) as-is." msgstr "" -#: library/optparse.rst:1311 +#: library/optparse.rst:1423 msgid "Integer arguments (type ``\"int\"``) are parsed as follows:" msgstr "" -#: library/optparse.rst:1313 +#: library/optparse.rst:1425 msgid "if the number starts with ``0x``, it is parsed as a hexadecimal number" msgstr "" -#: library/optparse.rst:1315 +#: library/optparse.rst:1427 msgid "if the number starts with ``0``, it is parsed as an octal number" msgstr "" -#: library/optparse.rst:1317 +#: library/optparse.rst:1429 msgid "if the number starts with ``0b``, it is parsed as a binary number" msgstr "" -#: library/optparse.rst:1319 +#: library/optparse.rst:1431 msgid "otherwise, the number is parsed as a decimal number" msgstr "" -#: library/optparse.rst:1322 +#: library/optparse.rst:1434 msgid "" "The conversion is done by calling :func:`int` with the appropriate base (2, " "8, 10, or 16). If this fails, so will :mod:`optparse`, although with a more " "useful error message." msgstr "" -#: library/optparse.rst:1326 +#: library/optparse.rst:1438 msgid "" "``\"float\"`` and ``\"complex\"`` option arguments are converted directly " "with :func:`float` and :func:`complex`, with similar error-handling." msgstr "" -#: library/optparse.rst:1329 +#: library/optparse.rst:1441 msgid "" "``\"choice\"`` options are a subtype of ``\"string\"`` options. The :attr:" "`~Option.choices` option attribute (a sequence of strings) defines the set " @@ -2064,62 +2251,62 @@ msgid "" "`OptionValueError` if an invalid string is given." msgstr "" -#: library/optparse.rst:1339 +#: library/optparse.rst:1451 msgid "Parsing arguments" msgstr "" -#: library/optparse.rst:1341 +#: library/optparse.rst:1453 msgid "" "The whole point of creating and populating an OptionParser is to call its :" "meth:`~OptionParser.parse_args` method." msgstr "" -#: library/optparse.rst:1346 +#: library/optparse.rst:1458 msgid "Parse the command-line options found in *args*." msgstr "" -#: library/optparse.rst:1348 +#: library/optparse.rst:1460 msgid "The input parameters are" msgstr "" -#: library/optparse.rst:1364 library/optparse.rst:1682 +#: library/optparse.rst:1476 library/optparse.rst:1794 msgid "``args``" msgstr "" -#: library/optparse.rst:1351 +#: library/optparse.rst:1463 msgid "the list of arguments to process (default: ``sys.argv[1:]``)" msgstr "" -#: library/optparse.rst:1353 +#: library/optparse.rst:1465 msgid "``values``" msgstr "" -#: library/optparse.rst:1354 +#: library/optparse.rst:1466 msgid "" "a :class:`Values` object to store option arguments in (default: a new " "instance of :class:`Values`) -- if you give an existing object, the option " "defaults will not be initialized on it" msgstr "" -#: library/optparse.rst:1358 +#: library/optparse.rst:1470 msgid "and the return value is a pair ``(options, args)`` where" msgstr "" -#: library/optparse.rst:1360 +#: library/optparse.rst:1472 msgid "``options``" msgstr "" -#: library/optparse.rst:1361 +#: library/optparse.rst:1473 msgid "" "the same object that was passed in as *values*, or the ``optparse.Values`` " "instance created by :mod:`optparse`" msgstr "" -#: library/optparse.rst:1365 +#: library/optparse.rst:1477 msgid "the leftover positional arguments after all options have been processed" msgstr "" -#: library/optparse.rst:1367 +#: library/optparse.rst:1479 msgid "" "The most common usage is to supply neither keyword argument. If you supply " "``values``, it will be modified with repeated :func:`setattr` calls (roughly " @@ -2127,7 +2314,7 @@ msgid "" "by :meth:`~OptionParser.parse_args`." msgstr "" -#: library/optparse.rst:1372 +#: library/optparse.rst:1484 msgid "" "If :meth:`~OptionParser.parse_args` encounters any errors in the argument " "list, it calls the OptionParser's :meth:`error` method with an appropriate " @@ -2135,69 +2322,69 @@ msgid "" "status of 2 (the traditional Unix exit status for command-line errors)." msgstr "" -#: library/optparse.rst:1381 +#: library/optparse.rst:1493 msgid "Querying and manipulating your option parser" msgstr "" -#: library/optparse.rst:1383 +#: library/optparse.rst:1495 msgid "" "The default behavior of the option parser can be customized slightly, and " "you can also poke around your option parser and see what's there. " "OptionParser provides several methods to help you out:" msgstr "" -#: library/optparse.rst:1389 +#: library/optparse.rst:1501 msgid "" "Set parsing to stop on the first non-option. For example, if ``-a`` and ``-" "b`` are both simple options that take no arguments, :mod:`optparse` normally " "accepts this syntax::" msgstr "" -#: library/optparse.rst:1393 +#: library/optparse.rst:1505 msgid "prog -a arg1 -b arg2" msgstr "" -#: library/optparse.rst:1395 +#: library/optparse.rst:1507 msgid "and treats it as equivalent to ::" msgstr "" -#: library/optparse.rst:1397 +#: library/optparse.rst:1509 msgid "prog -a -b arg1 arg2" msgstr "" -#: library/optparse.rst:1399 +#: library/optparse.rst:1511 msgid "" "To disable this feature, call :meth:`disable_interspersed_args`. This " "restores traditional Unix syntax, where option parsing stops with the first " "non-option argument." msgstr "" -#: library/optparse.rst:1403 +#: library/optparse.rst:1515 msgid "" "Use this if you have a command processor which runs another command which " "has options of its own and you want to make sure these options don't get " "confused. For example, each command might have a different set of options." msgstr "" -#: library/optparse.rst:1409 +#: library/optparse.rst:1521 msgid "" "Set parsing to not stop on the first non-option, allowing interspersing " "switches with command arguments. This is the default behavior." msgstr "" -#: library/optparse.rst:1414 +#: library/optparse.rst:1526 msgid "" "Returns the Option instance with the option string *opt_str*, or ``None`` if " "no options have that option string." msgstr "" -#: library/optparse.rst:1419 +#: library/optparse.rst:1531 msgid "" "Return ``True`` if the OptionParser has an option with option string " "*opt_str* (e.g., ``-q`` or ``--verbose``)." msgstr "" -#: library/optparse.rst:1424 +#: library/optparse.rst:1536 msgid "" "If the :class:`OptionParser` has an option corresponding to *opt_str*, that " "option is removed. If that option provided any other option strings, all of " @@ -2205,30 +2392,30 @@ msgid "" "option belonging to this :class:`OptionParser`, raises :exc:`ValueError`." msgstr "" -#: library/optparse.rst:1433 +#: library/optparse.rst:1545 msgid "Conflicts between options" msgstr "" -#: library/optparse.rst:1435 +#: library/optparse.rst:1547 msgid "" "If you're not careful, it's easy to define options with conflicting option " "strings::" msgstr "" -#: library/optparse.rst:1438 +#: library/optparse.rst:1550 msgid "" "parser.add_option(\"-n\", \"--dry-run\", ...)\n" "...\n" "parser.add_option(\"-n\", \"--noisy\", ...)" msgstr "" -#: library/optparse.rst:1442 +#: library/optparse.rst:1554 msgid "" "(This is particularly true if you've defined your own OptionParser subclass " "with some standard options.)" msgstr "" -#: library/optparse.rst:1445 +#: library/optparse.rst:1557 msgid "" "Every time you add an option, :mod:`optparse` checks for conflicts with " "existing options. If it finds any, it invokes the current conflict-handling " @@ -2236,54 +2423,54 @@ msgid "" "constructor::" msgstr "" -#: library/optparse.rst:1449 +#: library/optparse.rst:1561 msgid "parser = OptionParser(..., conflict_handler=handler)" msgstr "" -#: library/optparse.rst:1451 +#: library/optparse.rst:1563 msgid "or with a separate call::" msgstr "" -#: library/optparse.rst:1453 +#: library/optparse.rst:1565 msgid "parser.set_conflict_handler(handler)" msgstr "" -#: library/optparse.rst:1455 +#: library/optparse.rst:1567 msgid "The available conflict handlers are:" msgstr "" -#: library/optparse.rst:1457 +#: library/optparse.rst:1569 msgid "``\"error\"`` (default)" msgstr "" -#: library/optparse.rst:1458 +#: library/optparse.rst:1570 msgid "" "assume option conflicts are a programming error and raise :exc:" "`OptionConflictError`" msgstr "" -#: library/optparse.rst:1461 +#: library/optparse.rst:1573 msgid "``\"resolve\"``" msgstr "" -#: library/optparse.rst:1462 +#: library/optparse.rst:1574 msgid "resolve option conflicts intelligently (see below)" msgstr "" -#: library/optparse.rst:1465 +#: library/optparse.rst:1577 msgid "" "As an example, let's define an :class:`OptionParser` that resolves conflicts " "intelligently and add conflicting options to it::" msgstr "" -#: library/optparse.rst:1468 +#: library/optparse.rst:1580 msgid "" "parser = OptionParser(conflict_handler=\"resolve\")\n" "parser.add_option(\"-n\", \"--dry-run\", ..., help=\"do no harm\")\n" "parser.add_option(\"-n\", \"--noisy\", ..., help=\"be noisy\")" msgstr "" -#: library/optparse.rst:1472 +#: library/optparse.rst:1584 msgid "" "At this point, :mod:`optparse` detects that a previously added option is " "already using the ``-n`` option string. Since ``conflict_handler`` is " @@ -2293,7 +2480,7 @@ msgid "" "message will reflect that::" msgstr "" -#: library/optparse.rst:1478 +#: library/optparse.rst:1590 msgid "" "Options:\n" " --dry-run do no harm\n" @@ -2301,7 +2488,7 @@ msgid "" " -n, --noisy be noisy" msgstr "" -#: library/optparse.rst:1483 +#: library/optparse.rst:1595 msgid "" "It's possible to whittle away the option strings for a previously added " "option until there are none left, and the user has no way of invoking that " @@ -2310,17 +2497,17 @@ msgid "" "Carrying on with our existing OptionParser::" msgstr "" -#: library/optparse.rst:1489 +#: library/optparse.rst:1601 msgid "parser.add_option(\"--dry-run\", ..., help=\"new dry-run option\")" msgstr "" -#: library/optparse.rst:1491 +#: library/optparse.rst:1603 msgid "" "At this point, the original ``-n``/``--dry-run`` option is no longer " "accessible, so :mod:`optparse` removes it, leaving this help text::" msgstr "" -#: library/optparse.rst:1494 +#: library/optparse.rst:1606 msgid "" "Options:\n" " ...\n" @@ -2328,11 +2515,11 @@ msgid "" " --dry-run new dry-run option" msgstr "" -#: library/optparse.rst:1503 +#: library/optparse.rst:1615 msgid "Cleanup" msgstr "" -#: library/optparse.rst:1505 +#: library/optparse.rst:1617 msgid "" "OptionParser instances have several cyclic references. This should not be a " "problem for Python's garbage collector, but you may wish to break the cyclic " @@ -2342,15 +2529,15 @@ msgid "" "OptionParser." msgstr "" -#: library/optparse.rst:1516 +#: library/optparse.rst:1628 msgid "Other methods" msgstr "" -#: library/optparse.rst:1518 +#: library/optparse.rst:1630 msgid "OptionParser supports several other public methods:" msgstr "" -#: library/optparse.rst:1522 +#: library/optparse.rst:1634 msgid "" "Set the usage string according to the rules described above for the " "``usage`` constructor keyword argument. Passing ``None`` sets the default " @@ -2358,7 +2545,7 @@ msgid "" "message." msgstr "" -#: library/optparse.rst:1528 +#: library/optparse.rst:1640 msgid "" "Print the usage message for the current program (``self.usage``) to *file* " "(default stdout). Any occurrence of the string ``%prog`` in ``self.usage`` " @@ -2366,13 +2553,13 @@ msgid "" "usage`` is empty or not defined." msgstr "" -#: library/optparse.rst:1535 +#: library/optparse.rst:1647 msgid "" "Same as :meth:`print_usage` but returns the usage string instead of printing " "it." msgstr "" -#: library/optparse.rst:1540 +#: library/optparse.rst:1652 msgid "" "Set default values for several option destinations at once. Using :meth:" "`set_defaults` is the preferred way to set default values for options, since " @@ -2381,7 +2568,7 @@ msgid "" "default, and the last one wins::" msgstr "" -#: library/optparse.rst:1546 +#: library/optparse.rst:1658 msgid "" "parser.add_option(\"--advanced\", action=\"store_const\",\n" " dest=\"mode\", const=\"advanced\",\n" @@ -2391,11 +2578,11 @@ msgid "" " default=\"advanced\") # overrides above setting" msgstr "" -#: library/optparse.rst:1553 +#: library/optparse.rst:1665 msgid "To avoid this confusion, use :meth:`set_defaults`::" msgstr "" -#: library/optparse.rst:1555 +#: library/optparse.rst:1667 msgid "" "parser.set_defaults(mode=\"advanced\")\n" "parser.add_option(\"--advanced\", action=\"store_const\",\n" @@ -2404,11 +2591,11 @@ msgid "" " dest=\"mode\", const=\"novice\")" msgstr "" -#: library/optparse.rst:1565 +#: library/optparse.rst:1677 msgid "Option Callbacks" msgstr "" -#: library/optparse.rst:1567 +#: library/optparse.rst:1679 msgid "" "When :mod:`optparse`'s built-in actions and types aren't quite enough for " "your needs, you have two choices: extend :mod:`optparse` or define a " @@ -2416,25 +2603,25 @@ msgid "" "a lot of simple cases. Quite often a simple callback is all you need." msgstr "" -#: library/optparse.rst:1572 +#: library/optparse.rst:1684 msgid "There are two steps to defining a callback option:" msgstr "" -#: library/optparse.rst:1574 +#: library/optparse.rst:1686 msgid "define the option itself using the ``\"callback\"`` action" msgstr "" -#: library/optparse.rst:1576 +#: library/optparse.rst:1688 msgid "" "write the callback; this is a function (or method) that takes at least four " "arguments, as described below" msgstr "" -#: library/optparse.rst:1583 +#: library/optparse.rst:1695 msgid "Defining a callback option" msgstr "" -#: library/optparse.rst:1585 +#: library/optparse.rst:1697 msgid "" "As always, the easiest way to define a callback option is by using the :meth:" "`OptionParser.add_option` method. Apart from :attr:`~Option.action`, the " @@ -2442,11 +2629,11 @@ msgid "" "call::" msgstr "" -#: library/optparse.rst:1589 +#: library/optparse.rst:1701 msgid "parser.add_option(\"-c\", action=\"callback\", callback=my_callback)" msgstr "" -#: library/optparse.rst:1591 +#: library/optparse.rst:1703 msgid "" "``callback`` is a function (or other callable object), so you must have " "already defined ``my_callback()`` when you create this callback option. In " @@ -2458,7 +2645,7 @@ msgid "" "tricky; it's covered later in this section." msgstr "" -#: library/optparse.rst:1600 +#: library/optparse.rst:1712 msgid "" ":mod:`optparse` always passes four particular arguments to your callback, " "and it will only pass additional arguments if you specify them via :attr:" @@ -2466,25 +2653,25 @@ msgid "" "minimal callback function signature is::" msgstr "" -#: library/optparse.rst:1605 +#: library/optparse.rst:1717 msgid "def my_callback(option, opt, value, parser):" msgstr "" -#: library/optparse.rst:1607 +#: library/optparse.rst:1719 msgid "The four arguments to a callback are described below." msgstr "" -#: library/optparse.rst:1609 +#: library/optparse.rst:1721 msgid "" "There are several other option attributes that you can supply when you " "define a callback option:" msgstr "" -#: library/optparse.rst:1612 +#: library/optparse.rst:1724 msgid ":attr:`~Option.type`" msgstr "" -#: library/optparse.rst:1613 +#: library/optparse.rst:1725 msgid "" "has its usual meaning: as with the ``\"store\"`` or ``\"append\"`` actions, " "it instructs :mod:`optparse` to consume one argument and convert it to :attr:" @@ -2492,11 +2679,11 @@ msgid "" "though, :mod:`optparse` passes it to your callback function." msgstr "" -#: library/optparse.rst:1618 +#: library/optparse.rst:1730 msgid ":attr:`~Option.nargs`" msgstr "" -#: library/optparse.rst:1619 +#: library/optparse.rst:1731 msgid "" "also has its usual meaning: if it is supplied and > 1, :mod:`optparse` will " "consume :attr:`~Option.nargs` arguments, each of which must be convertible " @@ -2504,43 +2691,43 @@ msgid "" "callback." msgstr "" -#: library/optparse.rst:1624 +#: library/optparse.rst:1736 msgid ":attr:`~Option.callback_args`" msgstr "" -#: library/optparse.rst:1625 +#: library/optparse.rst:1737 msgid "a tuple of extra positional arguments to pass to the callback" msgstr "" -#: library/optparse.rst:1627 +#: library/optparse.rst:1739 msgid ":attr:`~Option.callback_kwargs`" msgstr "" -#: library/optparse.rst:1628 +#: library/optparse.rst:1740 msgid "a dictionary of extra keyword arguments to pass to the callback" msgstr "" -#: library/optparse.rst:1634 +#: library/optparse.rst:1746 msgid "How callbacks are called" msgstr "" -#: library/optparse.rst:1636 +#: library/optparse.rst:1748 msgid "All callbacks are called as follows::" msgstr "" -#: library/optparse.rst:1642 +#: library/optparse.rst:1754 msgid "``option``" msgstr "" -#: library/optparse.rst:1643 +#: library/optparse.rst:1755 msgid "is the Option instance that's calling the callback" msgstr "" -#: library/optparse.rst:1645 +#: library/optparse.rst:1757 msgid "``opt_str``" msgstr "" -#: library/optparse.rst:1646 +#: library/optparse.rst:1758 msgid "" "is the option string seen on the command-line that's triggering the " "callback. (If an abbreviated long option was used, ``opt_str`` will be the " @@ -2549,11 +2736,11 @@ msgid "" "``\"--foobar\"``.)" msgstr "" -#: library/optparse.rst:1652 +#: library/optparse.rst:1764 msgid "``value``" msgstr "" -#: library/optparse.rst:1653 +#: library/optparse.rst:1765 msgid "" "is the argument to this option seen on the command-line. :mod:`optparse` " "will only expect an argument if :attr:`~Option.type` is set; the type of " @@ -2563,21 +2750,21 @@ msgid "" "of values of the appropriate type." msgstr "" -#: library/optparse.rst:1659 +#: library/optparse.rst:1771 msgid "``parser``" msgstr "" -#: library/optparse.rst:1660 +#: library/optparse.rst:1772 msgid "" "is the OptionParser instance driving the whole thing, mainly useful because " "you can access some other interesting data through its instance attributes:" msgstr "" -#: library/optparse.rst:1663 +#: library/optparse.rst:1775 msgid "``parser.largs``" msgstr "" -#: library/optparse.rst:1664 +#: library/optparse.rst:1776 msgid "" "the current list of leftover arguments, ie. arguments that have been " "consumed but are neither options nor option arguments. Feel free to modify " @@ -2586,22 +2773,22 @@ msgid "" "parse_args`.)" msgstr "" -#: library/optparse.rst:1669 +#: library/optparse.rst:1781 msgid "``parser.rargs``" msgstr "" -#: library/optparse.rst:1670 +#: library/optparse.rst:1782 msgid "" "the current list of remaining arguments, ie. with ``opt_str`` and ``value`` " "(if applicable) removed, and only the arguments following them still there. " "Feel free to modify ``parser.rargs``, e.g. by consuming more arguments." msgstr "" -#: library/optparse.rst:1675 +#: library/optparse.rst:1787 msgid "``parser.values``" msgstr "" -#: library/optparse.rst:1676 +#: library/optparse.rst:1788 msgid "" "the object where option values are by default stored (an instance of " "optparse.OptionValues). This lets callbacks use the same mechanism as the " @@ -2610,27 +2797,27 @@ msgid "" "of any options already encountered on the command-line." msgstr "" -#: library/optparse.rst:1683 +#: library/optparse.rst:1795 msgid "" "is a tuple of arbitrary positional arguments supplied via the :attr:`~Option." "callback_args` option attribute." msgstr "" -#: library/optparse.rst:1686 +#: library/optparse.rst:1798 msgid "``kwargs``" msgstr "" -#: library/optparse.rst:1687 +#: library/optparse.rst:1799 msgid "" "is a dictionary of arbitrary keyword arguments supplied via :attr:`~Option." "callback_kwargs`." msgstr "" -#: library/optparse.rst:1694 +#: library/optparse.rst:1806 msgid "Raising errors in a callback" msgstr "" -#: library/optparse.rst:1696 +#: library/optparse.rst:1808 msgid "" "The callback function should raise :exc:`OptionValueError` if there are any " "problems with the option or its argument(s). :mod:`optparse` catches this " @@ -2640,17 +2827,17 @@ msgid "" "they did wrong." msgstr "" -#: library/optparse.rst:1706 +#: library/optparse.rst:1818 msgid "Callback example 1: trivial callback" msgstr "" -#: library/optparse.rst:1708 +#: library/optparse.rst:1820 msgid "" "Here's an example of a callback option that takes no arguments, and simply " "records that the option was seen::" msgstr "" -#: library/optparse.rst:1711 +#: library/optparse.rst:1823 msgid "" "def record_foo_seen(option, opt_str, value, parser):\n" " parser.values.saw_foo = True\n" @@ -2658,21 +2845,21 @@ msgid "" "parser.add_option(\"--foo\", action=\"callback\", callback=record_foo_seen)" msgstr "" -#: library/optparse.rst:1716 +#: library/optparse.rst:1828 msgid "Of course, you could do that with the ``\"store_true\"`` action." msgstr "" -#: library/optparse.rst:1722 +#: library/optparse.rst:1834 msgid "Callback example 2: check option order" msgstr "" -#: library/optparse.rst:1724 +#: library/optparse.rst:1836 msgid "" "Here's a slightly more interesting example: record the fact that ``-a`` is " "seen, but blow up if it comes after ``-b`` in the command-line. ::" msgstr "" -#: library/optparse.rst:1727 +#: library/optparse.rst:1839 msgid "" "def check_order(option, opt_str, value, parser):\n" " if parser.values.b:\n" @@ -2683,18 +2870,18 @@ msgid "" "parser.add_option(\"-b\", action=\"store_true\", dest=\"b\")" msgstr "" -#: library/optparse.rst:1739 +#: library/optparse.rst:1851 msgid "Callback example 3: check option order (generalized)" msgstr "" -#: library/optparse.rst:1741 +#: library/optparse.rst:1853 msgid "" "If you want to reuse this callback for several similar options (set a flag, " "but blow up if ``-b`` has already been seen), it needs a bit of work: the " "error message and the flag that it sets must be generalized. ::" msgstr "" -#: library/optparse.rst:1745 +#: library/optparse.rst:1857 msgid "" "def check_order(option, opt_str, value, parser):\n" " if parser.values.b:\n" @@ -2708,11 +2895,11 @@ msgid "" "dest='c')" msgstr "" -#: library/optparse.rst:1758 +#: library/optparse.rst:1870 msgid "Callback example 4: check arbitrary condition" msgstr "" -#: library/optparse.rst:1760 +#: library/optparse.rst:1872 msgid "" "Of course, you could put any condition in there---you're not limited to " "checking the values of already-defined options. For example, if you have " @@ -2720,7 +2907,7 @@ msgid "" "is this::" msgstr "" -#: library/optparse.rst:1764 +#: library/optparse.rst:1876 msgid "" "def check_moon(option, opt_str, value, parser):\n" " if is_moon_full():\n" @@ -2732,16 +2919,16 @@ msgid "" " action=\"callback\", callback=check_moon, dest=\"foo\")" msgstr "" -#: library/optparse.rst:1773 +#: library/optparse.rst:1885 msgid "" "(The definition of ``is_moon_full()`` is left as an exercise for the reader.)" msgstr "" -#: library/optparse.rst:1779 +#: library/optparse.rst:1891 msgid "Callback example 5: fixed arguments" msgstr "" -#: library/optparse.rst:1781 +#: library/optparse.rst:1893 msgid "" "Things get slightly more interesting when you define callback options that " "take a fixed number of arguments. Specifying that a callback option takes " @@ -2751,12 +2938,12 @@ msgid "" "nargs`, then the option takes :attr:`~Option.nargs` arguments." msgstr "" -#: library/optparse.rst:1788 +#: library/optparse.rst:1900 msgid "" "Here's an example that just emulates the standard ``\"store\"`` action::" msgstr "" -#: library/optparse.rst:1790 +#: library/optparse.rst:1902 msgid "" "def store_value(option, opt_str, value, parser):\n" " setattr(parser.values, option.dest, value)\n" @@ -2766,18 +2953,18 @@ msgid "" " type=\"int\", nargs=3, dest=\"foo\")" msgstr "" -#: library/optparse.rst:1797 +#: library/optparse.rst:1909 msgid "" "Note that :mod:`optparse` takes care of consuming 3 arguments and converting " "them to integers for you; all you have to do is store them. (Or whatever; " "obviously you don't need a callback for this example.)" msgstr "" -#: library/optparse.rst:1805 +#: library/optparse.rst:1917 msgid "Callback example 6: variable arguments" msgstr "" -#: library/optparse.rst:1807 +#: library/optparse.rst:1919 msgid "" "Things get hairy when you want an option to take a variable number of " "arguments. For this case, you must write a callback, as :mod:`optparse` " @@ -2787,23 +2974,23 @@ msgid "" "implement the conventional rules for bare ``--`` and ``-`` arguments:" msgstr "" -#: library/optparse.rst:1814 +#: library/optparse.rst:1926 msgid "either ``--`` or ``-`` can be option arguments" msgstr "" -#: library/optparse.rst:1816 +#: library/optparse.rst:1928 msgid "" "bare ``--`` (if not the argument to some option): halt command-line " "processing and discard the ``--``" msgstr "" -#: library/optparse.rst:1819 +#: library/optparse.rst:1931 msgid "" "bare ``-`` (if not the argument to some option): halt command-line " "processing but keep the ``-`` (append it to ``parser.largs``)" msgstr "" -#: library/optparse.rst:1822 +#: library/optparse.rst:1934 msgid "" "If you want an option that takes a variable number of arguments, there are " "several subtle, tricky issues to worry about. The exact implementation you " @@ -2812,13 +2999,13 @@ msgid "" "directly)." msgstr "" -#: library/optparse.rst:1828 +#: library/optparse.rst:1940 msgid "" "Nevertheless, here's a stab at a callback for an option with variable " "arguments::" msgstr "" -#: library/optparse.rst:1831 +#: library/optparse.rst:1943 msgid "" "def vararg_callback(option, opt_str, value, parser):\n" " assert value is None\n" @@ -2848,22 +3035,22 @@ msgid "" " action=\"callback\", callback=vararg_callback)" msgstr "" -#: library/optparse.rst:1862 +#: library/optparse.rst:1974 msgid "Extending :mod:`optparse`" msgstr "" -#: library/optparse.rst:1864 +#: library/optparse.rst:1976 msgid "" "Since the two major controlling factors in how :mod:`optparse` interprets " "command-line options are the action and type of each option, the most likely " "direction of extension is to add new actions and new types." msgstr "" -#: library/optparse.rst:1872 +#: library/optparse.rst:1984 msgid "Adding new types" msgstr "" -#: library/optparse.rst:1874 +#: library/optparse.rst:1986 msgid "" "To add new types, you need to define your own subclass of :mod:`optparse`'s :" "class:`Option` class. This class has a couple of attributes that define :" @@ -2871,23 +3058,23 @@ msgid "" "TYPE_CHECKER`." msgstr "" -#: library/optparse.rst:1880 +#: library/optparse.rst:1992 msgid "" "A tuple of type names; in your subclass, simply define a new tuple :attr:" "`TYPES` that builds on the standard one." msgstr "" -#: library/optparse.rst:1885 +#: library/optparse.rst:1997 msgid "" "A dictionary mapping type names to type-checking functions. A type-checking " "function has the following signature::" msgstr "" -#: library/optparse.rst:1888 +#: library/optparse.rst:2000 msgid "def check_mytype(option, opt, value)" msgstr "" -#: library/optparse.rst:1890 +#: library/optparse.rst:2002 msgid "" "where ``option`` is an :class:`Option` instance, ``opt`` is an option string " "(e.g., ``-f``), and ``value`` is the string from the command line that must " @@ -2898,7 +3085,7 @@ msgid "" "``value`` parameter." msgstr "" -#: library/optparse.rst:1898 +#: library/optparse.rst:2010 msgid "" "Your type-checking function should raise :exc:`OptionValueError` if it " "encounters any problems. :exc:`OptionValueError` takes a single string " @@ -2907,7 +3094,7 @@ msgid "" "\"`` and prints everything to stderr before terminating the process." msgstr "" -#: library/optparse.rst:1904 +#: library/optparse.rst:2016 msgid "" "Here's a silly example that demonstrates adding a ``\"complex\"`` option " "type to parse Python-style complex numbers on the command line. (This is " @@ -2915,23 +3102,23 @@ msgid "" "support for complex numbers, but never mind.)" msgstr "" -#: library/optparse.rst:1909 +#: library/optparse.rst:2021 msgid "First, the necessary imports::" msgstr "" -#: library/optparse.rst:1911 +#: library/optparse.rst:2023 msgid "" "from copy import copy\n" "from optparse import Option, OptionValueError" msgstr "" -#: library/optparse.rst:1914 +#: library/optparse.rst:2026 msgid "" "You need to define your type-checker first, since it's referred to later (in " "the :attr:`~Option.TYPE_CHECKER` class attribute of your Option subclass)::" msgstr "" -#: library/optparse.rst:1917 +#: library/optparse.rst:2029 msgid "" "def check_complex(option, opt, value):\n" " try:\n" @@ -2941,11 +3128,11 @@ msgid "" " \"option %s: invalid complex value: %r\" % (opt, value))" msgstr "" -#: library/optparse.rst:1924 +#: library/optparse.rst:2036 msgid "Finally, the Option subclass::" msgstr "" -#: library/optparse.rst:1926 +#: library/optparse.rst:2038 msgid "" "class MyOption (Option):\n" " TYPES = Option.TYPES + (\"complex\",)\n" @@ -2953,7 +3140,7 @@ msgid "" " TYPE_CHECKER[\"complex\"] = check_complex" msgstr "" -#: library/optparse.rst:1931 +#: library/optparse.rst:2043 msgid "" "(If we didn't make a :func:`copy` of :attr:`Option.TYPE_CHECKER`, we would " "end up modifying the :attr:`~Option.TYPE_CHECKER` attribute of :mod:" @@ -2961,59 +3148,59 @@ msgid "" "that except good manners and common sense.)" msgstr "" -#: library/optparse.rst:1936 +#: library/optparse.rst:2048 msgid "" "That's it! Now you can write a script that uses the new option type just " "like any other :mod:`optparse`\\ -based script, except you have to instruct " "your OptionParser to use MyOption instead of Option::" msgstr "" -#: library/optparse.rst:1940 +#: library/optparse.rst:2052 msgid "" "parser = OptionParser(option_class=MyOption)\n" "parser.add_option(\"-c\", type=\"complex\")" msgstr "" -#: library/optparse.rst:1943 +#: library/optparse.rst:2055 msgid "" "Alternately, you can build your own option list and pass it to OptionParser; " "if you don't use :meth:`add_option` in the above way, you don't need to tell " "OptionParser which option class to use::" msgstr "" -#: library/optparse.rst:1947 +#: library/optparse.rst:2059 msgid "" "option_list = [MyOption(\"-c\", action=\"store\", type=\"complex\", " "dest=\"c\")]\n" "parser = OptionParser(option_list=option_list)" msgstr "" -#: library/optparse.rst:1954 +#: library/optparse.rst:2066 msgid "Adding new actions" msgstr "" -#: library/optparse.rst:1956 +#: library/optparse.rst:2068 msgid "" "Adding new actions is a bit trickier, because you have to understand that :" "mod:`optparse` has a couple of classifications for actions:" msgstr "" -#: library/optparse.rst:1959 +#: library/optparse.rst:2071 msgid "\"store\" actions" msgstr "" -#: library/optparse.rst:1960 +#: library/optparse.rst:2072 msgid "" "actions that result in :mod:`optparse` storing a value to an attribute of " "the current OptionValues instance; these options require a :attr:`~Option." "dest` attribute to be supplied to the Option constructor." msgstr "" -#: library/optparse.rst:1964 +#: library/optparse.rst:2076 msgid "\"typed\" actions" msgstr "" -#: library/optparse.rst:1965 +#: library/optparse.rst:2077 msgid "" "actions that take a value from the command line and expect it to be of a " "certain type; or rather, a string that can be converted to a certain type. " @@ -3021,7 +3208,7 @@ msgid "" "constructor." msgstr "" -#: library/optparse.rst:1970 +#: library/optparse.rst:2082 msgid "" "These are overlapping sets: some default \"store\" actions are " "``\"store\"``, ``\"store_const\"``, ``\"append\"``, and ``\"count\"``, while " @@ -3029,25 +3216,25 @@ msgid "" "``\"callback\"``." msgstr "" -#: library/optparse.rst:1974 +#: library/optparse.rst:2086 msgid "" "When you add an action, you need to categorize it by listing it in at least " "one of the following class attributes of Option (all are lists of strings):" msgstr "" -#: library/optparse.rst:1979 +#: library/optparse.rst:2091 msgid "All actions must be listed in ACTIONS." msgstr "" -#: library/optparse.rst:1983 +#: library/optparse.rst:2095 msgid "\"store\" actions are additionally listed here." msgstr "" -#: library/optparse.rst:1987 +#: library/optparse.rst:2099 msgid "\"typed\" actions are additionally listed here." msgstr "" -#: library/optparse.rst:1991 +#: library/optparse.rst:2103 msgid "" "Actions that always take a type (i.e. whose options always take a value) are " "additionally listed here. The only effect of this is that :mod:`optparse` " @@ -3055,13 +3242,13 @@ msgid "" "whose action is listed in :attr:`ALWAYS_TYPED_ACTIONS`." msgstr "" -#: library/optparse.rst:1996 +#: library/optparse.rst:2108 msgid "" "In order to actually implement your new action, you must override Option's :" "meth:`take_action` method and add a case that recognizes your action." msgstr "" -#: library/optparse.rst:1999 +#: library/optparse.rst:2111 msgid "" "For example, let's add an ``\"extend\"`` action. This is similar to the " "standard ``\"append\"`` action, but instead of taking a single value from " @@ -3071,23 +3258,23 @@ msgid "" "option of type ``\"string\"``, the command line ::" msgstr "" -#: library/optparse.rst:2006 +#: library/optparse.rst:2118 msgid "--names=foo,bar --names blah --names ding,dong" msgstr "" -#: library/optparse.rst:2008 +#: library/optparse.rst:2120 msgid "would result in a list ::" msgstr "" -#: library/optparse.rst:2010 +#: library/optparse.rst:2122 msgid "[\"foo\", \"bar\", \"blah\", \"ding\", \"dong\"]" msgstr "" -#: library/optparse.rst:2012 +#: library/optparse.rst:2124 msgid "Again we define a subclass of Option::" msgstr "" -#: library/optparse.rst:2014 +#: library/optparse.rst:2126 msgid "" "class MyOption(Option):\n" "\n" @@ -3105,43 +3292,43 @@ msgid "" " self, action, dest, opt, value, values, parser)" msgstr "" -#: library/optparse.rst:2029 +#: library/optparse.rst:2141 msgid "Features of note:" msgstr "" -#: library/optparse.rst:2031 +#: library/optparse.rst:2143 msgid "" "``\"extend\"`` both expects a value on the command-line and stores that " "value somewhere, so it goes in both :attr:`~Option.STORE_ACTIONS` and :attr:" "`~Option.TYPED_ACTIONS`." msgstr "" -#: library/optparse.rst:2035 +#: library/optparse.rst:2147 msgid "" "to ensure that :mod:`optparse` assigns the default type of ``\"string\"`` to " "``\"extend\"`` actions, we put the ``\"extend\"`` action in :attr:`~Option." "ALWAYS_TYPED_ACTIONS` as well." msgstr "" -#: library/optparse.rst:2039 +#: library/optparse.rst:2151 msgid "" ":meth:`MyOption.take_action` implements just this one new action, and passes " "control back to :meth:`Option.take_action` for the standard :mod:`optparse` " "actions." msgstr "" -#: library/optparse.rst:2043 +#: library/optparse.rst:2155 msgid "" "``values`` is an instance of the optparse_parser.Values class, which " "provides the very useful :meth:`ensure_value` method. :meth:`ensure_value` " "is essentially :func:`getattr` with a safety valve; it is called as ::" msgstr "" -#: library/optparse.rst:2047 +#: library/optparse.rst:2159 msgid "values.ensure_value(attr, value)" msgstr "" -#: library/optparse.rst:2049 +#: library/optparse.rst:2161 msgid "" "If the ``attr`` attribute of ``values`` doesn't exist or is ``None``, then " "ensure_value() first sets it to ``value``, and then returns ``value``. This " @@ -3154,28 +3341,28 @@ msgid "" "meth:`ensure_value` will take care of getting it right when it's needed." msgstr "" -#: library/optparse.rst:2060 +#: library/optparse.rst:2172 msgid "Exceptions" msgstr "" -#: library/optparse.rst:2064 +#: library/optparse.rst:2176 msgid "" "Raised if an :class:`Option` instance is created with invalid or " "inconsistent arguments." msgstr "" -#: library/optparse.rst:2069 +#: library/optparse.rst:2181 msgid "Raised if conflicting options are added to an :class:`OptionParser`." msgstr "" -#: library/optparse.rst:2073 +#: library/optparse.rst:2185 msgid "Raised if an invalid option value is encountered on the command line." msgstr "" -#: library/optparse.rst:2077 +#: library/optparse.rst:2189 msgid "Raised if an invalid option is passed on the command line." msgstr "" -#: library/optparse.rst:2081 +#: library/optparse.rst:2193 msgid "Raised if an ambiguous option is passed on the command line." msgstr "" diff --git a/library/os.path.po b/library/os.path.po index 7696cdcc..3e9a4700 100644 --- a/library/os.path.po +++ b/library/os.path.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -88,11 +88,11 @@ msgid "" "follows: ``normpath(join(os.getcwd(), path))``." msgstr "" -#: library/os.path.rst:76 library/os.path.rst:123 library/os.path.rst:149 -#: library/os.path.rst:195 library/os.path.rst:224 library/os.path.rst:243 -#: library/os.path.rst:263 library/os.path.rst:301 library/os.path.rst:370 -#: library/os.path.rst:413 library/os.path.rst:440 library/os.path.rst:470 -#: library/os.path.rst:559 +#: library/os.path.rst:76 library/os.path.rst:126 library/os.path.rst:152 +#: library/os.path.rst:198 library/os.path.rst:227 library/os.path.rst:246 +#: library/os.path.rst:270 library/os.path.rst:308 library/os.path.rst:400 +#: library/os.path.rst:443 library/os.path.rst:470 library/os.path.rst:500 +#: library/os.path.rst:589 msgid "Accepts a :term:`path-like object`." msgstr "" @@ -107,7 +107,7 @@ msgstr "" #: library/os.path.rst:82 msgid "" -"Return the longest common sub-path of each pathname in the sequence " +"Return the longest common sub-path of each pathname in the iterable " "*paths*. Raise :exc:`ValueError` if *paths* contain both absolute and " "relative pathnames, if *paths* are on different drives, or if *paths* is " "empty. Unlike :func:`commonprefix`, this returns a valid path." @@ -117,20 +117,24 @@ msgstr "" msgid "Accepts a sequence of :term:`path-like objects `." msgstr "" -#: library/os.path.rst:96 +#: library/os.path.rst:93 +msgid "Any iterable can now be passed, rather than just sequences." +msgstr "" + +#: library/os.path.rst:99 msgid "" "Return the longest path prefix (taken character-by-character) that is a " "prefix of all paths in *list*. If *list* is empty, return the empty string " "(``''``)." msgstr "" -#: library/os.path.rst:102 +#: library/os.path.rst:105 msgid "" "This function may return invalid paths because it works a character at a " "time. To obtain a valid path, see :func:`commonpath`." msgstr "" -#: library/os.path.rst:108 +#: library/os.path.rst:111 msgid "" ">>> os.path.commonprefix(['/usr/lib', '/usr/local/lib'])\n" "'/usr/l'\n" @@ -139,13 +143,13 @@ msgid "" "'/usr'" msgstr "" -#: library/os.path.rst:120 +#: library/os.path.rst:123 msgid "" "Return the directory name of pathname *path*. This is the first element of " "the pair returned by passing *path* to the function :func:`split`." msgstr "" -#: library/os.path.rst:129 +#: library/os.path.rst:132 msgid "" "Return ``True`` if *path* refers to an existing path or an open file " "descriptor. Returns ``False`` for broken symbolic links. On some " @@ -154,26 +158,26 @@ msgid "" "physically exists." msgstr "" -#: library/os.path.rst:135 +#: library/os.path.rst:138 msgid "" "*path* can now be an integer: ``True`` is returned if it is an open file " "descriptor, ``False`` otherwise." msgstr "" -#: library/os.path.rst:145 +#: library/os.path.rst:148 msgid "" "Return ``True`` if *path* refers to an existing path, including broken " "symbolic links. Equivalent to :func:`exists` on platforms lacking :func:" "`os.lstat`." msgstr "" -#: library/os.path.rst:157 +#: library/os.path.rst:160 msgid "" "On Unix and Windows, return the argument with an initial component of ``~`` " "or ``~user`` replaced by that *user*'s home directory." msgstr "" -#: library/os.path.rst:162 +#: library/os.path.rst:165 msgid "" "On Unix, an initial ``~`` is replaced by the environment variable :envvar:" "`HOME` if it is set; otherwise the current user's home directory is looked " @@ -181,7 +185,7 @@ msgid "" "initial ``~user`` is looked up directly in the password directory." msgstr "" -#: library/os.path.rst:167 +#: library/os.path.rst:170 msgid "" "On Windows, :envvar:`USERPROFILE` will be used if set, otherwise a " "combination of :envvar:`HOMEPATH` and :envvar:`HOMEDRIVE` will be used. An " @@ -190,17 +194,17 @@ msgid "" "replacing it if so." msgstr "" -#: library/os.path.rst:172 +#: library/os.path.rst:175 msgid "" "If the expansion fails or if the path does not begin with a tilde, the path " "is returned unchanged." msgstr "" -#: library/os.path.rst:178 +#: library/os.path.rst:181 msgid "No longer uses :envvar:`HOME` on Windows." msgstr "" -#: library/os.path.rst:187 +#: library/os.path.rst:190 msgid "" "Return the argument with environment variables expanded. Substrings of the " "form ``$name`` or ``${name}`` are replaced by the value of environment " @@ -208,13 +212,13 @@ msgid "" "variables are left unchanged." msgstr "" -#: library/os.path.rst:192 +#: library/os.path.rst:195 msgid "" "On Windows, ``%name%`` expansions are supported in addition to ``$name`` and " "``${name}``." msgstr "" -#: library/os.path.rst:201 +#: library/os.path.rst:204 msgid "" "Return the time of last access of *path*. The return value is a floating-" "point number giving the number of seconds since the epoch (see the :mod:" @@ -222,7 +226,7 @@ msgid "" "inaccessible." msgstr "" -#: library/os.path.rst:208 +#: library/os.path.rst:211 msgid "" "Return the time of last modification of *path*. The return value is a " "floating-point number giving the number of seconds since the epoch (see " @@ -230,7 +234,7 @@ msgid "" "is inaccessible." msgstr "" -#: library/os.path.rst:218 +#: library/os.path.rst:221 msgid "" "Return the system's ctime which, on some systems (like Unix) is the time of " "the last metadata change, and, on others (like Windows), is the creation " @@ -239,48 +243,54 @@ msgid "" "file does not exist or is inaccessible." msgstr "" -#: library/os.path.rst:230 +#: library/os.path.rst:233 msgid "" "Return the size, in bytes, of *path*. Raise :exc:`OSError` if the file does " "not exist or is inaccessible." msgstr "" -#: library/os.path.rst:239 +#: library/os.path.rst:242 msgid "" "Return ``True`` if *path* is an absolute pathname. On Unix, that means it " -"begins with a slash, on Windows that it begins with a (back)slash after " -"chopping off a potential drive letter." +"begins with a slash, on Windows that it begins with two (back)slashes, or a " +"drive letter, colon, and (back)slash together." msgstr "" #: library/os.path.rst:249 msgid "" +"On Windows, returns ``False`` if the given path starts with exactly one " +"(back)slash." +msgstr "" + +#: library/os.path.rst:256 +msgid "" "Return ``True`` if *path* is an :func:`existing ` regular file. This " "follows symbolic links, so both :func:`islink` and :func:`isfile` can be " "true for the same path." msgstr "" -#: library/os.path.rst:259 +#: library/os.path.rst:266 msgid "" "Return ``True`` if *path* is an :func:`existing ` directory. This " "follows symbolic links, so both :func:`islink` and :func:`isdir` can be true " "for the same path." msgstr "" -#: library/os.path.rst:269 +#: library/os.path.rst:276 msgid "" "Return ``True`` if *path* refers to an :func:`existing ` directory " "entry that is a junction. Always return ``False`` if junctions are not " "supported on the current platform." msgstr "" -#: library/os.path.rst:278 +#: library/os.path.rst:285 msgid "" "Return ``True`` if *path* refers to an :func:`existing ` directory " "entry that is a symbolic link. Always ``False`` if symbolic links are not " "supported by the Python runtime." msgstr "" -#: library/os.path.rst:288 +#: library/os.path.rst:295 msgid "" "Return ``True`` if pathname *path* is a :dfn:`mount point`: a point in a " "file system where a different file system has been mounted. On POSIX, the " @@ -293,11 +303,11 @@ msgid "" "called to see if it is different from the input path." msgstr "" -#: library/os.path.rst:298 +#: library/os.path.rst:305 msgid "Added support for detecting non-root mount points on Windows." msgstr "" -#: library/os.path.rst:307 +#: library/os.path.rst:314 msgid "" "Return ``True`` if pathname *path* is located on a Windows Dev Drive. A Dev " "Drive is optimized for developer scenarios, and offers faster performance " @@ -306,7 +316,7 @@ msgid "" "operations." msgstr "" -#: library/os.path.rst:313 +#: library/os.path.rst:320 msgid "" "May raise an error for an invalid path, for example, one without a " "recognizable drive, but returns ``False`` on platforms that do not support " @@ -314,11 +324,38 @@ msgid "" "windows/dev-drive/>`_ for information on enabling and creating Dev Drives." msgstr "" -#: library/os.path.rst:318 +#: library/os.path.rst:327 +msgid "" +"The function is now available on all platforms, and will always return " +"``False`` on those that have no support for Dev Drives" +msgstr "" + +#: library/os.path.rst:333 +msgid "Return ``True`` if *path* is a reserved pathname on the current system." +msgstr "" + +#: library/os.path.rst:335 +msgid "" +"On Windows, reserved filenames include those that end with a space or dot; " +"those that contain colons (i.e. file streams such as \"name:stream\"), " +"wildcard characters (i.e. ``'*?\"<>'``), pipe, or ASCII control characters; " +"as well as DOS device names such as \"NUL\", \"CON\", \"CONIN$\", \"CONOUT$" +"\", \"AUX\", \"PRN\", \"COM1\", and \"LPT1\"." +msgstr "" + +#: library/os.path.rst:343 +msgid "" +"This function approximates rules for reserved paths on most Windows systems. " +"These rules change over time in various Windows releases. This function may " +"be updated in future Python releases as changes to the rules become broadly " +"available." +msgstr "" + +#: library/os.path.rst:348 msgid "Availability" msgstr "" -#: library/os.path.rst:325 +#: library/os.path.rst:355 msgid "" "Join one or more path segments intelligently. The return value is the " "concatenation of *path* and all members of *\\*paths*, with exactly one " @@ -329,7 +366,7 @@ msgid "" "and joining continues from the absolute path segment." msgstr "" -#: library/os.path.rst:333 +#: library/os.path.rst:363 msgid "" "On Windows, the drive is not reset when a rooted path segment (e.g., " "``r'\\foo'``) is encountered. If a segment is on a different drive or is an " @@ -339,18 +376,18 @@ msgid "" "on drive :file:`C:` (:file:`c:foo`), not :file:`c:\\\\foo`." msgstr "" -#: library/os.path.rst:340 +#: library/os.path.rst:370 msgid "Accepts a :term:`path-like object` for *path* and *paths*." msgstr "" -#: library/os.path.rst:346 +#: library/os.path.rst:376 msgid "" "Normalize the case of a pathname. On Windows, convert all characters in the " "pathname to lowercase, and also convert forward slashes to backward slashes. " "On other operating systems, return the path unchanged." msgstr "" -#: library/os.path.rst:356 +#: library/os.path.rst:386 msgid "" "Normalize a pathname by collapsing redundant separators and up-level " "references so that ``A//B``, ``A/B/``, ``A/./B`` and ``A/foo/../B`` all " @@ -359,7 +396,7 @@ msgid "" "backward slashes. To normalize case, use :func:`normcase`." msgstr "" -#: library/os.path.rst:363 +#: library/os.path.rst:393 msgid "" "On POSIX systems, in accordance with `IEEE Std 1003.1 2013 Edition; 4.13 " "Pathname Resolution >> splitdrive(\"c:/dir\")\n" "(\"c:\", \"/dir\")" msgstr "" -#: library/os.path.rst:489 +#: library/os.path.rst:519 msgid "" "If the path contains a UNC path, drive will contain the host name and share::" msgstr "" -#: library/os.path.rst:492 +#: library/os.path.rst:522 msgid "" ">>> splitdrive(\"//host/computer/dir\")\n" "(\"//host/computer\", \"/dir\")" msgstr "" -#: library/os.path.rst:501 +#: library/os.path.rst:531 msgid "" "Split the pathname *path* into a 3-item tuple ``(drive, root, tail)`` where " "*drive* is a device name or mount point, *root* is a string of separators " @@ -505,7 +543,7 @@ msgid "" "same as *path*." msgstr "" -#: library/os.path.rst:507 +#: library/os.path.rst:537 msgid "" "On POSIX systems, *drive* is always empty. The *root* may be empty (if " "*path* is relative), a single forward slash (if *path* is absolute), or two " @@ -514,7 +552,7 @@ msgid "" "basedefs/V1_chap04.html#tag_04_13>`_.) For example::" msgstr "" -#: library/os.path.rst:513 +#: library/os.path.rst:543 msgid "" ">>> splitroot('/home/sam')\n" "('', '/', 'home/sam')\n" @@ -524,14 +562,14 @@ msgid "" "('', '/', '//home/sam')" msgstr "" -#: library/os.path.rst:520 +#: library/os.path.rst:550 msgid "" "On Windows, *drive* may be empty, a drive-letter name, a UNC share, or a " "device name. The *root* may be empty, a forward slash, or a backward slash. " "For example::" msgstr "" -#: library/os.path.rst:524 +#: library/os.path.rst:554 msgid "" ">>> splitroot('C:/Users/Sam')\n" "('C:', '/', 'Users/Sam')\n" @@ -539,30 +577,30 @@ msgid "" "('//Server/Share', '/', 'Users/Sam')" msgstr "" -#: library/os.path.rst:534 +#: library/os.path.rst:564 msgid "" "Split the pathname *path* into a pair ``(root, ext)`` such that ``root + " "ext == path``, and the extension, *ext*, is empty or begins with a period " "and contains at most one period." msgstr "" -#: library/os.path.rst:538 +#: library/os.path.rst:568 msgid "If the path contains no extension, *ext* will be ``''``::" msgstr "" -#: library/os.path.rst:540 +#: library/os.path.rst:570 msgid "" ">>> splitext('bar')\n" "('bar', '')" msgstr "" -#: library/os.path.rst:543 +#: library/os.path.rst:573 msgid "" "If the path contains an extension, then *ext* will be set to this extension, " "including the leading period. Note that previous periods will be ignored::" msgstr "" -#: library/os.path.rst:546 +#: library/os.path.rst:576 msgid "" ">>> splitext('foo.bar.exe')\n" "('foo.bar', '.exe')\n" @@ -570,13 +608,13 @@ msgid "" "('/foo/bar', '.exe')" msgstr "" -#: library/os.path.rst:551 +#: library/os.path.rst:581 msgid "" "Leading periods of the last component of the path are considered to be part " "of the root::" msgstr "" -#: library/os.path.rst:554 +#: library/os.path.rst:584 msgid "" ">>> splitext('.cshrc')\n" "('.cshrc', '')\n" @@ -584,7 +622,7 @@ msgid "" "('/foo/....jpg', '')" msgstr "" -#: library/os.path.rst:565 +#: library/os.path.rst:595 msgid "" "``True`` if arbitrary Unicode strings can be used as file names (within " "limitations imposed by the file system)." @@ -598,34 +636,34 @@ msgstr "" msgid "operations" msgstr "" -#: library/os.path.rst:153 +#: library/os.path.rst:156 msgid "~ (tilde)" msgstr "" -#: library/os.path.rst:153 +#: library/os.path.rst:156 msgid "home directory expansion" msgstr "" -#: library/os.path.rst:160 +#: library/os.path.rst:163 msgid "module" msgstr "" -#: library/os.path.rst:160 +#: library/os.path.rst:163 msgid "pwd" msgstr "" -#: library/os.path.rst:181 +#: library/os.path.rst:184 msgid "$ (dollar)" msgstr "" -#: library/os.path.rst:181 +#: library/os.path.rst:184 msgid "environment variables expansion" msgstr "" -#: library/os.path.rst:181 +#: library/os.path.rst:184 msgid "% (percent)" msgstr "" -#: library/os.path.rst:181 +#: library/os.path.rst:184 msgid "environment variables expansion (Windows)" msgstr "" diff --git a/library/os.po b/library/os.po index fd783dd6..6975335e 100644 --- a/library/os.po +++ b/library/os.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -70,12 +70,12 @@ msgstr "" #: library/os.rst:37 msgid "" -"On WebAssembly platforms ``wasm32-emscripten`` and ``wasm32-wasi``, large " -"parts of the :mod:`os` module are not available or behave differently. API " -"related to processes (e.g. :func:`~os.fork`, :func:`~os.execve`), signals (e." -"g. :func:`~os.kill`, :func:`~os.wait`), and resources (e.g. :func:`~os." +"On WebAssembly platforms, Android and iOS, large parts of the :mod:`os` " +"module are not available or behave differently. APIs related to processes (e." +"g. :func:`~os.fork`, :func:`~os.execve`) and resources (e.g. :func:`~os." "nice`) are not available. Others like :func:`~os.getuid` and :func:`~os." -"getpid` are emulated or stubs." +"getpid` are emulated or stubs. WebAssembly platforms also lack support for " +"signals (e.g. :func:`~os.kill`, :func:`~os.wait`)." msgstr "" #: library/os.rst:47 @@ -287,30 +287,32 @@ msgstr "" #: library/os.rst:435 library/os.rst:463 library/os.rst:492 library/os.rst:513 #: library/os.rst:534 library/os.rst:580 library/os.rst:594 library/os.rst:640 #: library/os.rst:662 library/os.rst:688 library/os.rst:704 library/os.rst:720 -#: library/os.rst:736 library/os.rst:827 library/os.rst:975 library/os.rst:1005 -#: library/os.rst:1031 library/os.rst:1075 library/os.rst:1098 -#: library/os.rst:1139 library/os.rst:1162 library/os.rst:1346 -#: library/os.rst:1372 library/os.rst:1397 library/os.rst:1425 -#: library/os.rst:1468 library/os.rst:1494 library/os.rst:1533 -#: library/os.rst:1557 library/os.rst:1629 library/os.rst:1650 -#: library/os.rst:1709 library/os.rst:1727 library/os.rst:1771 -#: library/os.rst:1850 library/os.rst:2022 library/os.rst:2111 -#: library/os.rst:2151 library/os.rst:2182 library/os.rst:2261 -#: library/os.rst:2305 library/os.rst:2463 library/os.rst:2519 -#: library/os.rst:3249 library/os.rst:3406 library/os.rst:3640 -#: library/os.rst:3690 library/os.rst:3753 library/os.rst:3770 -#: library/os.rst:3788 library/os.rst:4002 library/os.rst:4045 -#: library/os.rst:4059 library/os.rst:4073 library/os.rst:4087 -#: library/os.rst:4103 library/os.rst:4117 library/os.rst:4134 -#: library/os.rst:4149 library/os.rst:4205 library/os.rst:4255 -#: library/os.rst:4278 library/os.rst:4299 library/os.rst:4340 -#: library/os.rst:4451 library/os.rst:4553 library/os.rst:4583 -#: library/os.rst:4640 library/os.rst:4700 library/os.rst:4755 -#: library/os.rst:4816 library/os.rst:4847 library/os.rst:4873 -#: library/os.rst:4898 library/os.rst:4917 library/os.rst:4965 -#: library/os.rst:4992 library/os.rst:5011 library/os.rst:5029 -#: library/os.rst:5047 library/os.rst:5206 library/os.rst:5237 -#: library/os.rst:5369 +#: library/os.rst:736 library/os.rst:832 library/os.rst:980 library/os.rst:1010 +#: library/os.rst:1039 library/os.rst:1083 library/os.rst:1106 +#: library/os.rst:1140 library/os.rst:1173 library/os.rst:1245 +#: library/os.rst:1380 library/os.rst:1404 library/os.rst:1434 +#: library/os.rst:1464 library/os.rst:1507 library/os.rst:1536 +#: library/os.rst:1575 library/os.rst:1597 library/os.rst:1663 +#: library/os.rst:1692 library/os.rst:1739 library/os.rst:1773 +#: library/os.rst:1790 library/os.rst:1838 library/os.rst:1916 +#: library/os.rst:2088 library/os.rst:2182 library/os.rst:2222 +#: library/os.rst:2256 library/os.rst:2335 library/os.rst:2379 +#: library/os.rst:2537 library/os.rst:2593 library/os.rst:3323 +#: library/os.rst:3480 library/os.rst:3714 library/os.rst:3764 +#: library/os.rst:3827 library/os.rst:3844 library/os.rst:3862 +#: library/os.rst:3997 library/os.rst:4025 library/os.rst:4044 +#: library/os.rst:4064 library/os.rst:4220 library/os.rst:4324 +#: library/os.rst:4339 library/os.rst:4353 library/os.rst:4367 +#: library/os.rst:4382 library/os.rst:4397 library/os.rst:4413 +#: library/os.rst:4429 library/os.rst:4443 library/os.rst:4519 +#: library/os.rst:4558 library/os.rst:4576 library/os.rst:4595 +#: library/os.rst:4735 library/os.rst:4784 library/os.rst:4872 +#: library/os.rst:4895 library/os.rst:4977 library/os.rst:5021 +#: library/os.rst:5096 library/os.rst:5130 library/os.rst:5162 +#: library/os.rst:5185 library/os.rst:5207 library/os.rst:5230 +#: library/os.rst:5281 library/os.rst:5304 library/os.rst:5320 +#: library/os.rst:5338 library/os.rst:5499 library/os.rst:5532 +#: library/os.rst:5568 library/os.rst:5691 msgid "Availability" msgstr "" @@ -504,8 +506,8 @@ msgstr "" #: library/os.rst:452 library/os.rst:759 msgid "" -"The function is a stub on Emscripten and WASI, see :ref:`wasm-availability` " -"for more information." +"The function is a stub on WASI, see :ref:`wasm-availability` for more " +"information." msgstr "" #: library/os.rst:385 @@ -837,20 +839,28 @@ msgid "" "or even ``socket.gethostbyaddr(socket.gethostname())``." msgstr "" -#: library/os.rst:4702 +#: library/os.rst:788 +msgid "" +"On macOS, iOS and Android, this returns the *kernel* name and version (i.e., " +"``'Darwin'`` on macOS and iOS; ``'Linux'`` on Android). :func:`platform." +"uname` can be used to get the user-facing operating system name and version " +"on iOS and Android." +msgstr "" + +#: library/os.rst:5002 msgid "" "Return type changed from a tuple to a tuple-like object with named " "attributes." msgstr "" -#: library/os.rst:799 +#: library/os.rst:804 msgid "" "Unset (delete) the environment variable named *key*. Such changes to the " "environment affect subprocesses started with :func:`os.system`, :func:" "`popen` or :func:`fork` and :func:`execv`." msgstr "" -#: library/os.rst:803 +#: library/os.rst:808 msgid "" "Deletion of items in :data:`os.environ` is automatically translated into a " "corresponding call to :func:`unsetenv`; however, calls to :func:`unsetenv` " @@ -858,17 +868,17 @@ msgid "" "items of :data:`os.environ`." msgstr "" -#: library/os.rst:808 +#: library/os.rst:813 msgid "" "Raises an :ref:`auditing event ` ``os.unsetenv`` with argument " "``key``." msgstr "" -#: library/os.rst:810 +#: library/os.rst:815 msgid "The function is now always available and is also available on Windows." msgstr "" -#: library/os.rst:816 +#: library/os.rst:821 msgid "" "Disassociate parts of the process execution context, and move them into a " "newly created namespace. See the :manpage:`unshare(2)` man page for more " @@ -879,28 +889,28 @@ msgid "" "are made to the calling process's execution context." msgstr "" -#: library/os.rst:833 +#: library/os.rst:838 msgid "The :func:`~os.setns` function." msgstr "" -#: library/os.rst:837 +#: library/os.rst:842 msgid "" "Flags to the :func:`unshare` function, if the implementation supports them. " "See :manpage:`unshare(2)` in the Linux manual for their exact effect and " "availability." msgstr "" -#: library/os.rst:860 +#: library/os.rst:865 msgid "File Object Creation" msgstr "" -#: library/os.rst:862 +#: library/os.rst:867 msgid "" "These functions create new :term:`file objects `. (See also :" "func:`~os.open` for opening file descriptors.)" msgstr "" -#: library/os.rst:868 +#: library/os.rst:873 msgid "" "Return an open file object connected to the file descriptor *fd*. This is " "an alias of the :func:`open` built-in function and accepts the same " @@ -908,16 +918,16 @@ msgid "" "must always be an integer." msgstr "" -#: library/os.rst:877 +#: library/os.rst:882 msgid "File Descriptor Operations" msgstr "" -#: library/os.rst:879 +#: library/os.rst:884 msgid "" "These functions operate on I/O streams referenced using file descriptors." msgstr "" -#: library/os.rst:881 +#: library/os.rst:886 msgid "" "File descriptors are small integers corresponding to a file that has been " "opened by the current process. For example, standard input is usually file " @@ -927,7 +937,7 @@ msgid "" "pipes are also referenced by file descriptors." msgstr "" -#: library/os.rst:888 +#: library/os.rst:893 msgid "" "The :meth:`~io.IOBase.fileno` method can be used to obtain the file " "descriptor associated with a :term:`file object` when required. Note that " @@ -935,11 +945,11 @@ msgid "" "ignoring aspects such as internal buffering of data." msgstr "" -#: library/os.rst:896 +#: library/os.rst:901 msgid "Close file descriptor *fd*." msgstr "" -#: library/os.rst:900 +#: library/os.rst:905 msgid "" "This function is intended for low-level I/O and must be applied to a file " "descriptor as returned by :func:`os.open` or :func:`pipe`. To close a " @@ -947,13 +957,13 @@ msgid "" "`popen` or :func:`fdopen`, use its :meth:`~io.IOBase.close` method." msgstr "" -#: library/os.rst:908 +#: library/os.rst:913 msgid "" "Close all file descriptors from *fd_low* (inclusive) to *fd_high* " "(exclusive), ignoring errors. Equivalent to (but much faster than)::" msgstr "" -#: library/os.rst:911 +#: library/os.rst:916 msgid "" "for fd in range(fd_low, fd_high):\n" " try:\n" @@ -962,7 +972,7 @@ msgid "" " pass" msgstr "" -#: library/os.rst:920 +#: library/os.rst:925 msgid "" "Copy *count* bytes from file descriptor *src*, starting from offset " "*offset_src*, to file descriptor *dst*, starting from offset *offset_dst*. " @@ -970,14 +980,14 @@ msgid "" "respectively for *offset_dst*." msgstr "" -#: library/os.rst:925 +#: library/os.rst:930 msgid "" "In Linux kernel older than 5.3, the files pointed to by *src* and *dst* must " "reside in the same filesystem, otherwise an :exc:`OSError` is raised with :" "attr:`~OSError.errno` set to :const:`errno.EXDEV`." msgstr "" -#: library/os.rst:929 +#: library/os.rst:934 msgid "" "This copy is done without the additional cost of transferring data from the " "kernel to user space and then back into the kernel. Additionally, some " @@ -987,19 +997,19 @@ msgid "" "(in the case of NFS)." msgstr "" -#: library/os.rst:936 +#: library/os.rst:941 msgid "" "The function copies bytes between two file descriptors. Text options, like " "the encoding and the line ending, are ignored." msgstr "" -#: library/os.rst:939 +#: library/os.rst:944 msgid "" "The return value is the amount of bytes copied. This could be less than the " "amount requested." msgstr "" -#: library/os.rst:944 +#: library/os.rst:949 msgid "" "On Linux, :func:`os.copy_file_range` should not be used for copying a range " "of a pseudo file from a special filesystem like procfs and sysfs. It will " @@ -1007,39 +1017,39 @@ msgid "" "known Linux kernel issue." msgstr "" -#: library/os.rst:956 +#: library/os.rst:961 msgid "" "Return a string describing the encoding of the device associated with *fd* " "if it is connected to a terminal; else return :const:`None`." msgstr "" -#: library/os.rst:959 +#: library/os.rst:964 msgid "" "On Unix, if the :ref:`Python UTF-8 Mode ` is enabled, return " "``'UTF-8'`` rather than the device encoding." msgstr "" -#: library/os.rst:962 +#: library/os.rst:967 msgid "On Unix, the function now implements the Python UTF-8 Mode." msgstr "" -#: library/os.rst:968 +#: library/os.rst:973 msgid "" "Return a duplicate of file descriptor *fd*. The new file descriptor is :ref:" "`non-inheritable `." msgstr "" -#: library/os.rst:971 +#: library/os.rst:976 msgid "" "On Windows, when duplicating a standard stream (0: stdin, 1: stdout, 2: " "stderr), the new file descriptor is :ref:`inheritable `." msgstr "" -#: library/os.rst:1245 +#: library/os.rst:1267 msgid "The new file descriptor is now non-inheritable." msgstr "" -#: library/os.rst:983 +#: library/os.rst:988 msgid "" "Duplicate file descriptor *fd* to *fd2*, closing the latter first if " "necessary. Return *fd2*. The new file descriptor is :ref:`inheritable " @@ -1047,58 +1057,62 @@ msgid "" "``False``." msgstr "" -#: library/os.rst:990 +#: library/os.rst:995 msgid "Add the optional *inheritable* parameter." msgstr "" -#: library/os.rst:993 +#: library/os.rst:998 msgid "Return *fd2* on success. Previously, ``None`` was always returned." msgstr "" -#: library/os.rst:999 +#: library/os.rst:1004 msgid "" "Change the mode of the file given by *fd* to the numeric *mode*. See the " "docs for :func:`chmod` for possible values of *mode*. As of Python 3.3, " "this is equivalent to ``os.chmod(fd, mode)``." msgstr "" -#: library/os.rst:2070 library/os.rst:2167 +#: library/os.rst:2137 library/os.rst:2238 msgid "" "Raises an :ref:`auditing event ` ``os.chmod`` with arguments " "``path``, ``mode``, ``dir_fd``." msgstr "" -#: library/os.rst:1022 library/os.rst:1652 library/os.rst:2096 -#: library/os.rst:3385 +#: library/os.rst:1030 library/os.rst:1706 library/os.rst:2167 +#: library/os.rst:3459 msgid "" -"The function is limited on Emscripten and WASI, see :ref:`wasm-availability` " -"for more information." +"The function is limited on WASI, see :ref:`wasm-availability` for more " +"information." +msgstr "" + +#: library/os.rst:2245 +msgid "Added support on Windows." msgstr "" -#: library/os.rst:1013 +#: library/os.rst:1021 msgid "" "Change the owner and group id of the file given by *fd* to the numeric *uid* " "and *gid*. To leave one of the ids unchanged, set it to -1. See :func:" "`chown`. As of Python 3.3, this is equivalent to ``os.chown(fd, uid, gid)``." msgstr "" -#: library/os.rst:2092 library/os.rst:2180 +#: library/os.rst:2163 library/os.rst:2254 msgid "" "Raises an :ref:`auditing event ` ``os.chown`` with arguments " "``path``, ``uid``, ``gid``, ``dir_fd``." msgstr "" -#: library/os.rst:1028 +#: library/os.rst:1036 msgid "" "Force write of file with filedescriptor *fd* to disk. Does not force update " "of metadata." msgstr "" -#: library/os.rst:1034 +#: library/os.rst:1042 msgid "This function is not available on MacOS." msgstr "" -#: library/os.rst:1039 +#: library/os.rst:1047 msgid "" "Return system configuration information relevant to an open file. *name* " "specifies the configuration value to retrieve; it may be a string which is " @@ -1109,7 +1123,7 @@ msgid "" "included in that mapping, passing an integer for *name* is also accepted." msgstr "" -#: library/os.rst:2499 +#: library/os.rst:2573 msgid "" "If *name* is a string and is not known, :exc:`ValueError` is raised. If a " "specific value for *name* is not supported by the host system, even if it is " @@ -1117,87 +1131,98 @@ msgid "" "`errno.EINVAL` for the error number." msgstr "" -#: library/os.rst:1052 +#: library/os.rst:1060 msgid "As of Python 3.3, this is equivalent to ``os.pathconf(fd, name)``." msgstr "" -#: library/os.rst:1059 +#: library/os.rst:1067 msgid "" "Get the status of the file descriptor *fd*. Return a :class:`stat_result` " "object." msgstr "" -#: library/os.rst:1062 +#: library/os.rst:1070 msgid "As of Python 3.3, this is equivalent to ``os.stat(fd)``." msgstr "" -#: library/os.rst:2327 +#: library/os.rst:2401 msgid "The :func:`.stat` function." msgstr "" -#: library/os.rst:1071 +#: library/os.rst:1079 msgid "" "Return information about the filesystem containing the file associated with " "file descriptor *fd*, like :func:`statvfs`. As of Python 3.3, this is " "equivalent to ``os.statvfs(fd)``." msgstr "" -#: library/os.rst:1080 +#: library/os.rst:1088 msgid "" "Force write of file with filedescriptor *fd* to disk. On Unix, this calls " "the native :c:func:`!fsync` function; on Windows, the MS :c:func:`!_commit` " "function." msgstr "" -#: library/os.rst:1083 +#: library/os.rst:1091 msgid "" "If you're starting with a buffered Python :term:`file object` *f*, first do " "``f.flush()``, and then do ``os.fsync(f.fileno())``, to ensure that all " "internal buffers associated with *f* are written to disk." msgstr "" -#: library/os.rst:1092 +#: library/os.rst:1100 msgid "" "Truncate the file corresponding to file descriptor *fd*, so that it is at " "most *length* bytes in size. As of Python 3.3, this is equivalent to ``os." "truncate(fd, length)``." msgstr "" -#: library/os.rst:1096 +#: library/os.rst:1104 msgid "" "Raises an :ref:`auditing event ` ``os.truncate`` with arguments " "``fd``, ``length``." msgstr "" -#: library/os.rst:3424 +#: library/os.rst:3498 msgid "Added support for Windows" msgstr "" -#: library/os.rst:1106 +#: library/os.rst:1114 msgid "" "Get the blocking mode of the file descriptor: ``False`` if the :data:" "`O_NONBLOCK` flag is set, ``True`` if the flag is cleared." msgstr "" -#: library/os.rst:1109 +#: library/os.rst:1117 msgid "See also :func:`set_blocking` and :meth:`socket.socket.setblocking`." msgstr "" -#: library/os.rst:1655 +#: library/os.rst:1709 msgid "On Windows, this function is limited to pipes." msgstr "" -#: library/os.rst:1659 +#: library/os.rst:1713 msgid "Added support for pipes on Windows." msgstr "" -#: library/os.rst:1125 +#: library/os.rst:1134 +msgid "" +"Grant access to the slave pseudo-terminal device associated with the master " +"pseudo-terminal device to which the file descriptor *fd* refers. The file " +"descriptor *fd* is not closed upon failure." +msgstr "" + +#: library/os.rst:1138 +msgid "Calls the C standard library function :c:func:`grantpt`." +msgstr "" + +#: library/os.rst:1147 msgid "" "Return ``True`` if the file descriptor *fd* is open and connected to a tty(-" "like) device, else ``False``." msgstr "" -#: library/os.rst:1131 +#: library/os.rst:1153 msgid "" "Apply, test or remove a POSIX lock on an open file descriptor. *fd* is an " "open file descriptor. *cmd* specifies the command to use - one of :data:" @@ -1205,125 +1230,125 @@ msgid "" "specifies the section of the file to lock." msgstr "" -#: library/os.rst:1137 +#: library/os.rst:1159 msgid "" "Raises an :ref:`auditing event ` ``os.lockf`` with arguments " "``fd``, ``cmd``, ``len``." msgstr "" -#: library/os.rst:1149 +#: library/os.rst:1171 msgid "Flags that specify what action :func:`lockf` will take." msgstr "" -#: library/os.rst:1158 +#: library/os.rst:1180 msgid "" "Prepare the tty of which fd is a file descriptor for a new login session. " "Make the calling process a session leader; make the tty the controlling tty, " "the stdin, the stdout, and the stderr of the calling process; close fd." msgstr "" -#: library/os.rst:1169 +#: library/os.rst:1191 msgid "" "Set the current position of file descriptor *fd* to position *pos*, modified " "by *whence*, and return the new position in bytes relative to the start of " "the file. Valid values for *whence* are:" msgstr "" -#: library/os.rst:1174 +#: library/os.rst:1196 msgid "" ":const:`SEEK_SET` or ``0`` -- set *pos* relative to the beginning of the file" msgstr "" -#: library/os.rst:1175 +#: library/os.rst:1197 msgid "" ":const:`SEEK_CUR` or ``1`` -- set *pos* relative to the current file position" msgstr "" -#: library/os.rst:1176 +#: library/os.rst:1198 msgid ":const:`SEEK_END` or ``2`` -- set *pos* relative to the end of the file" msgstr "" -#: library/os.rst:1177 +#: library/os.rst:1199 msgid "" ":const:`SEEK_HOLE` -- set *pos* to the next data location, relative to *pos*" msgstr "" -#: library/os.rst:1178 +#: library/os.rst:1200 msgid "" ":const:`SEEK_DATA` -- set *pos* to the next data hole, relative to *pos*" msgstr "" -#: library/os.rst:1182 +#: library/os.rst:1204 msgid "Add support for :const:`!SEEK_HOLE` and :const:`!SEEK_DATA`." msgstr "" -#: library/os.rst:1189 +#: library/os.rst:1211 msgid "" "Parameters to the :func:`lseek` function and the :meth:`~io.IOBase.seek` " "method on :term:`file-like objects `, for whence to adjust the " "file position indicator." msgstr "" -#: library/os.rst:1193 +#: library/os.rst:1215 msgid ":const:`SEEK_SET`" msgstr "" -#: library/os.rst:1194 +#: library/os.rst:1216 msgid "Adjust the file position relative to the beginning of the file." msgstr "" -#: library/os.rst:1195 +#: library/os.rst:1217 msgid ":const:`SEEK_CUR`" msgstr "" -#: library/os.rst:1196 +#: library/os.rst:1218 msgid "Adjust the file position relative to the current file position." msgstr "" -#: library/os.rst:1197 +#: library/os.rst:1219 msgid ":const:`SEEK_END`" msgstr "" -#: library/os.rst:1198 +#: library/os.rst:1220 msgid "Adjust the file position relative to the end of the file." msgstr "" -#: library/os.rst:1200 +#: library/os.rst:1222 msgid "Their values are 0, 1, and 2, respectively." msgstr "" -#: library/os.rst:1206 +#: library/os.rst:1228 msgid "" "Parameters to the :func:`lseek` function and the :meth:`~io.IOBase.seek` " "method on :term:`file-like objects `, for seeking file data and " "holes on sparsely allocated files." msgstr "" -#: library/os.rst:1210 +#: library/os.rst:1232 msgid ":data:`!SEEK_DATA`" msgstr "" -#: library/os.rst:1211 +#: library/os.rst:1233 msgid "" "Adjust the file offset to the next location containing data, relative to the " "seek position." msgstr "" -#: library/os.rst:1214 +#: library/os.rst:1236 msgid ":data:`!SEEK_HOLE`" msgstr "" -#: library/os.rst:1215 +#: library/os.rst:1237 msgid "" "Adjust the file offset to the next location containing a hole, relative to " "the seek position. A hole is defined as a sequence of zeros." msgstr "" -#: library/os.rst:1221 +#: library/os.rst:1243 msgid "These operations only make sense for filesystems that support them." msgstr "" -#: library/os.rst:1230 +#: library/os.rst:1252 msgid "" "Open the file *path* and set various flags according to *flags* and possibly " "its mode according to *mode*. When computing *mode*, the current umask " @@ -1331,7 +1356,7 @@ msgid "" "file. The new file descriptor is :ref:`non-inheritable `." msgstr "" -#: library/os.rst:1235 +#: library/os.rst:1257 msgid "" "For a description of the flag and mode values, see the C run-time " "documentation; flag constants (like :const:`O_RDONLY` and :const:`O_WRONLY`) " @@ -1339,19 +1364,19 @@ msgid "" "const:`O_BINARY` is needed to open files in binary mode." msgstr "" -#: library/os.rst:1240 +#: library/os.rst:1262 msgid "" "This function can support :ref:`paths relative to directory descriptors " "` with the *dir_fd* parameter." msgstr "" -#: library/os.rst:1243 +#: library/os.rst:1265 msgid "" "Raises an :ref:`auditing event ` ``open`` with arguments ``path``, " "``mode``, ``flags``." msgstr "" -#: library/os.rst:1250 +#: library/os.rst:1272 msgid "" "This function is intended for low-level I/O. For normal usage, use the " "built-in function :func:`open`, which returns a :term:`file object` with :" @@ -1359,27 +1384,27 @@ msgid "" "a file descriptor in a file object, use :func:`fdopen`." msgstr "" -#: library/os.rst:2332 library/os.rst:2443 library/os.rst:2546 -#: library/os.rst:2683 library/os.rst:3440 +#: library/os.rst:2406 library/os.rst:2517 library/os.rst:2620 +#: library/os.rst:2757 library/os.rst:3514 msgid "Added the *dir_fd* parameter." msgstr "" -#: library/os.rst:1577 library/os.rst:4798 +#: library/os.rst:1631 library/os.rst:5098 msgid "" "If the system call is interrupted and the signal handler does not raise an " "exception, the function now retries the system call instead of raising an :" "exc:`InterruptedError` exception (see :pep:`475` for the rationale)." msgstr "" -#: library/os.rst:1964 library/os.rst:2027 library/os.rst:2113 -#: library/os.rst:2171 library/os.rst:2243 library/os.rst:2375 -#: library/os.rst:2446 library/os.rst:2509 library/os.rst:2598 -#: library/os.rst:2976 library/os.rst:3427 library/os.rst:3483 -#: library/os.rst:3644 library/os.rst:4008 library/os.rst:4560 +#: library/os.rst:2030 library/os.rst:2093 library/os.rst:2184 +#: library/os.rst:2242 library/os.rst:2317 library/os.rst:2449 +#: library/os.rst:2520 library/os.rst:2583 library/os.rst:2672 +#: library/os.rst:3050 library/os.rst:3501 library/os.rst:3557 +#: library/os.rst:3718 library/os.rst:4295 library/os.rst:4860 msgid "Accepts a :term:`path-like object`." msgstr "" -#: library/os.rst:1266 +#: library/os.rst:1288 msgid "" "The following constants are options for the *flags* parameter to the :func:" "`~os.open` function. They can be combined using the bitwise OR operator ``|" @@ -1389,45 +1414,45 @@ msgid "" "on Windows." msgstr "" -#: library/os.rst:1281 +#: library/os.rst:1303 msgid "The above constants are available on Unix and Windows." msgstr "" -#: library/os.rst:1292 +#: library/os.rst:1314 msgid "The above constants are only available on Unix." msgstr "" -#: library/os.rst:1294 +#: library/os.rst:1316 msgid "Add :data:`O_CLOEXEC` constant." msgstr "" -#: library/os.rst:1305 +#: library/os.rst:1327 msgid "The above constants are only available on Windows." msgstr "" -#: library/os.rst:1312 +#: library/os.rst:1334 msgid "The above constants are only available on macOS." msgstr "" -#: library/os.rst:1314 +#: library/os.rst:1336 msgid "" "Add :data:`O_EVTONLY`, :data:`O_FSYNC`, :data:`O_SYMLINK` and :data:" "`O_NOFOLLOW_ANY` constants." msgstr "" -#: library/os.rst:1328 +#: library/os.rst:1350 msgid "" "The above constants are extensions and not present if they are not defined " "by the C library." msgstr "" -#: library/os.rst:1331 +#: library/os.rst:1353 msgid "" "Add :data:`O_PATH` on systems that support it. Add :data:`O_TMPFILE`, only " "available on Linux Kernel 3.11 or newer." msgstr "" -#: library/os.rst:1341 +#: library/os.rst:1363 msgid "" "Open a new pseudo-terminal pair. Return a pair of file descriptors " "``(master, slave)`` for the pty and the tty, respectively. The new file " @@ -1435,18 +1460,18 @@ msgid "" "more portable approach, use the :mod:`pty` module." msgstr "" -#: library/os.rst:1360 +#: library/os.rst:1382 msgid "The new file descriptors are now non-inheritable." msgstr "" -#: library/os.rst:1354 +#: library/os.rst:1376 msgid "" "Create a pipe. Return a pair of file descriptors ``(r, w)`` usable for " "reading and writing, respectively. The new file descriptor is :ref:`non-" "inheritable `." msgstr "" -#: library/os.rst:1366 +#: library/os.rst:1388 msgid "" "Create a pipe with *flags* set atomically. *flags* can be constructed by " "ORing together one or more of these values: :data:`O_NONBLOCK`, :data:" @@ -1454,13 +1479,13 @@ msgid "" "and writing, respectively." msgstr "" -#: library/os.rst:1379 +#: library/os.rst:1401 msgid "" "Ensures that enough disk space is allocated for the file specified by *fd* " "starting from *offset* and continuing for *len* bytes." msgstr "" -#: library/os.rst:1389 +#: library/os.rst:1411 msgid "" "Announces an intention to access data in a specific pattern thus allowing " "the kernel to make optimizations. The advice applies to the region of the " @@ -1471,25 +1496,43 @@ msgid "" "`POSIX_FADV_DONTNEED`." msgstr "" -#: library/os.rst:1409 +#: library/os.rst:1431 msgid "" "Flags that can be used in *advice* in :func:`posix_fadvise` that specify the " "access pattern that is likely to be used." msgstr "" -#: library/os.rst:1419 +#: library/os.rst:1441 msgid "" "Read at most *n* bytes from file descriptor *fd* at a position of *offset*, " "leaving the file offset unchanged." msgstr "" -#: library/os.rst:1566 +#: library/os.rst:1620 msgid "" "Return a bytestring containing the bytes read. If the end of the file " "referred to by *fd* has been reached, an empty bytes object is returned." msgstr "" -#: library/os.rst:1432 +#: library/os.rst:1454 +msgid "Open and return a file descriptor for a master pseudo-terminal device." +msgstr "" + +#: library/os.rst:1456 +msgid "" +"Calls the C standard library function :c:func:`posix_openpt`. The *oflag* " +"argument is used to set file status flags and file access modes as specified " +"in the manual page of :c:func:`posix_openpt` of your system." +msgstr "" + +#: library/os.rst:1460 +msgid "" +"The returned file descriptor is :ref:`non-inheritable `. If " +"the value :data:`O_CLOEXEC` is available on the system, it is added to " +"*oflag*." +msgstr "" + +#: library/os.rst:1471 msgid "" "Read from a file descriptor *fd* at a position of *offset* into mutable :" "term:`bytes-like objects ` *buffers*, leaving the file " @@ -1497,77 +1540,91 @@ msgid "" "move on to the next buffer in the sequence to hold the rest of the data." msgstr "" -#: library/os.rst:1507 +#: library/os.rst:1561 msgid "" "The flags argument contains a bitwise OR of zero or more of the following " "flags:" msgstr "" -#: library/os.rst:1440 +#: library/os.rst:1479 msgid ":data:`RWF_HIPRI`" msgstr "" -#: library/os.rst:1441 +#: library/os.rst:1480 msgid ":data:`RWF_NOWAIT`" msgstr "" -#: library/os.rst:1703 +#: library/os.rst:1757 msgid "" "Return the total number of bytes actually read which can be less than the " "total capacity of all the objects." msgstr "" -#: library/os.rst:1516 library/os.rst:1768 +#: library/os.rst:1570 library/os.rst:1835 msgid "" "The operating system may set a limit (:func:`sysconf` value " "``'SC_IOV_MAX'``) on the number of buffers that can be used." msgstr "" -#: library/os.rst:1449 +#: library/os.rst:1488 msgid "Combine the functionality of :func:`os.readv` and :func:`os.pread`." msgstr "" -#: library/os.rst:1523 +#: library/os.rst:1577 msgid "Using flags requires Linux >= 4.6." msgstr "" -#: library/os.rst:1460 +#: library/os.rst:1499 msgid "" "Do not wait for data which is not immediately available. If this flag is " "specified, the system call will return instantly if it would have to read " "data from the backing storage or wait for a lock." msgstr "" -#: library/os.rst:1464 +#: library/os.rst:1503 msgid "" "If some data was successfully read, it will return the number of bytes read. " "If no bytes were read, it will return ``-1`` and set errno to :const:`errno." "EAGAIN`." msgstr "" -#: library/os.rst:1475 +#: library/os.rst:1514 msgid "" "High priority read/write. Allows block-based filesystems to use polling of " "the device, which provides lower latency, but may use additional resources." msgstr "" -#: library/os.rst:1479 +#: library/os.rst:1518 msgid "" "Currently, on Linux, this feature is usable only on a file descriptor opened " "using the :data:`O_DIRECT` flag." msgstr "" -#: library/os.rst:1489 +#: library/os.rst:1528 +msgid "" +"Return the name of the slave pseudo-terminal device associated with the " +"master pseudo-terminal device to which the file descriptor *fd* refers. The " +"file descriptor *fd* is not closed upon failure." +msgstr "" + +#: library/os.rst:1532 +msgid "" +"Calls the reentrant C standard library function :c:func:`ptsname_r` if it is " +"available; otherwise, the C standard library function :c:func:`ptsname`, " +"which is not guaranteed to be thread-safe, is called." +msgstr "" + +#: library/os.rst:1543 msgid "" "Write the bytestring in *str* to file descriptor *fd* at position of " "*offset*, leaving the file offset unchanged." msgstr "" -#: library/os.rst:1743 +#: library/os.rst:1810 msgid "Return the number of bytes actually written." msgstr "" -#: library/os.rst:1501 +#: library/os.rst:1555 msgid "" "Write the *buffers* contents to file descriptor *fd* at an offset *offset*, " "leaving the file offset unchanged. *buffers* must be a sequence of :term:" @@ -1576,39 +1633,39 @@ msgid "" "the second, and so on." msgstr "" -#: library/os.rst:1510 +#: library/os.rst:1564 msgid ":data:`RWF_DSYNC`" msgstr "" -#: library/os.rst:1511 +#: library/os.rst:1565 msgid ":data:`RWF_SYNC`" msgstr "" -#: library/os.rst:1512 +#: library/os.rst:1566 msgid ":data:`RWF_APPEND`" msgstr "" -#: library/os.rst:1514 +#: library/os.rst:1568 msgid "Return the total number of bytes actually written." msgstr "" -#: library/os.rst:1519 +#: library/os.rst:1573 msgid "Combine the functionality of :func:`os.writev` and :func:`os.pwrite`." msgstr "" -#: library/os.rst:1530 +#: library/os.rst:1584 msgid "" "Provide a per-write equivalent of the :data:`O_DSYNC` :func:`os.open` flag. " "This flag effect applies only to the data range written by the system call." msgstr "" -#: library/os.rst:1540 +#: library/os.rst:1594 msgid "" "Provide a per-write equivalent of the :data:`O_SYNC` :func:`os.open` flag. " "This flag effect applies only to the data range written by the system call." msgstr "" -#: library/os.rst:1550 +#: library/os.rst:1604 msgid "" "Provide a per-write equivalent of the :data:`O_APPEND` :func:`os.open` flag. " "This flag is meaningful only for :func:`os.pwritev`, and its effect applies " @@ -1618,11 +1675,11 @@ msgid "" "*offset* is updated." msgstr "" -#: library/os.rst:1564 +#: library/os.rst:1618 msgid "Read at most *n* bytes from file descriptor *fd*." msgstr "" -#: library/os.rst:1571 +#: library/os.rst:1625 msgid "" "This function is intended for low-level I/O and must be applied to a file " "descriptor as returned by :func:`os.open` or :func:`pipe`. To read a \"file " @@ -1631,26 +1688,26 @@ msgid "" "`~file.readline` methods." msgstr "" -#: library/os.rst:1586 +#: library/os.rst:1640 msgid "" "Copy *count* bytes from file descriptor *in_fd* to file descriptor *out_fd* " "starting at *offset*. Return the number of bytes sent. When EOF is reached " "return ``0``." msgstr "" -#: library/os.rst:1590 +#: library/os.rst:1644 msgid "" "The first function notation is supported by all platforms that define :func:" "`sendfile`." msgstr "" -#: library/os.rst:1593 +#: library/os.rst:1647 msgid "" "On Linux, if *offset* is given as ``None``, the bytes are read from the " "current position of *in_fd* and the position of *in_fd* is updated." msgstr "" -#: library/os.rst:1596 +#: library/os.rst:1650 msgid "" "The second case may be used on macOS and FreeBSD where *headers* and " "*trailers* are arbitrary sequences of buffers that are written before and " @@ -1658,58 +1715,58 @@ msgid "" "case." msgstr "" -#: library/os.rst:1600 +#: library/os.rst:1654 msgid "" "On macOS and FreeBSD, a value of ``0`` for *count* specifies to send until " "the end of *in_fd* is reached." msgstr "" -#: library/os.rst:1603 +#: library/os.rst:1657 msgid "" "All platforms support sockets as *out_fd* file descriptor, and some " "platforms allow other types (e.g. regular file, pipe) as well." msgstr "" -#: library/os.rst:1606 +#: library/os.rst:1660 msgid "" "Cross-platform applications should not use *headers*, *trailers* and *flags* " "arguments." msgstr "" -#: library/os.rst:1613 +#: library/os.rst:1667 msgid "" "For a higher-level wrapper of :func:`sendfile`, see :meth:`socket.socket." "sendfile`." msgstr "" -#: library/os.rst:1618 +#: library/os.rst:1672 msgid "Parameters *out* and *in* was renamed to *out_fd* and *in_fd*." msgstr "" -#: library/os.rst:1626 +#: library/os.rst:1680 msgid "" "Parameters to the :func:`sendfile` function, if the implementation supports " "them." msgstr "" -#: library/os.rst:1635 +#: library/os.rst:1689 msgid "" "Parameter to the :func:`sendfile` function, if the implementation supports " "it. The data won't be cached in the virtual memory and will be freed " "afterwards." msgstr "" -#: library/os.rst:1645 +#: library/os.rst:1699 msgid "" "Set the blocking mode of the specified file descriptor. Set the :data:" "`O_NONBLOCK` flag if blocking is ``False``, clear the flag otherwise." msgstr "" -#: library/os.rst:1648 +#: library/os.rst:1702 msgid "See also :func:`get_blocking` and :meth:`socket.socket.setblocking`." msgstr "" -#: library/os.rst:1665 +#: library/os.rst:1719 msgid "" "Transfer *count* bytes from file descriptor *src*, starting from offset " "*offset_src*, to file descriptor *dst*, starting from offset *offset_dst*. " @@ -1721,7 +1778,7 @@ msgid "" "`~OSError.errno` set to :const:`errno.EXDEV`." msgstr "" -#: library/os.rst:1674 +#: library/os.rst:1728 msgid "" "This copy is done without the additional cost of transferring data from the " "kernel to user space and then back into the kernel. Additionally, some " @@ -1729,7 +1786,7 @@ msgid "" "files are opened as binary." msgstr "" -#: library/os.rst:1679 +#: library/os.rst:1733 msgid "" "Upon successful completion, returns the number of bytes spliced to or from " "the pipe. A return value of 0 means end of input. If *src* refers to a pipe, " @@ -1738,7 +1795,7 @@ msgid "" "the pipe." msgstr "" -#: library/os.rst:1698 +#: library/os.rst:1752 msgid "" "Read from a file descriptor *fd* into a number of mutable :term:`bytes-like " "objects ` *buffers*. Transfer data into each buffer until " @@ -1746,30 +1803,41 @@ msgid "" "rest of the data." msgstr "" -#: library/os.rst:1716 +#: library/os.rst:1770 msgid "" "Return the process group associated with the terminal given by *fd* (an open " "file descriptor as returned by :func:`os.open`)." msgstr "" -#: library/os.rst:1724 +#: library/os.rst:1778 msgid "" "Set the process group associated with the terminal given by *fd* (an open " "file descriptor as returned by :func:`os.open`) to *pg*." msgstr "" -#: library/os.rst:1732 +#: library/os.rst:1786 msgid "" "Return a string which specifies the terminal device associated with file " "descriptor *fd*. If *fd* is not associated with a terminal device, an " "exception is raised." msgstr "" -#: library/os.rst:1741 +#: library/os.rst:1795 +msgid "" +"Unlock the slave pseudo-terminal device associated with the master pseudo-" +"terminal device to which the file descriptor *fd* refers. The file " +"descriptor *fd* is not closed upon failure." +msgstr "" + +#: library/os.rst:1799 +msgid "Calls the C standard library function :c:func:`unlockpt`." +msgstr "" + +#: library/os.rst:1808 msgid "Write the bytestring in *str* to file descriptor *fd*." msgstr "" -#: library/os.rst:1747 +#: library/os.rst:1814 msgid "" "This function is intended for low-level I/O and must be applied to a file " "descriptor as returned by :func:`os.open` or :func:`pipe`. To write a " @@ -1778,7 +1846,7 @@ msgid "" "its :meth:`~file.write` method." msgstr "" -#: library/os.rst:1761 +#: library/os.rst:1828 msgid "" "Write the contents of *buffers* to file descriptor *fd*. *buffers* must be a " "sequence of :term:`bytes-like objects `. Buffers are " @@ -1786,70 +1854,70 @@ msgid "" "before proceeding to the second, and so on." msgstr "" -#: library/os.rst:1766 +#: library/os.rst:1833 msgid "Returns the total number of bytes actually written." msgstr "" -#: library/os.rst:1779 +#: library/os.rst:1846 msgid "Querying the size of a terminal" msgstr "" -#: library/os.rst:1785 +#: library/os.rst:1852 msgid "" "Return the size of the terminal window as ``(columns, lines)``, tuple of " "type :class:`terminal_size`." msgstr "" -#: library/os.rst:1788 +#: library/os.rst:1855 msgid "" "The optional argument ``fd`` (default ``STDOUT_FILENO``, or standard output) " "specifies which file descriptor should be queried." msgstr "" -#: library/os.rst:1791 +#: library/os.rst:1858 msgid "" "If the file descriptor is not connected to a terminal, an :exc:`OSError` is " "raised." msgstr "" -#: library/os.rst:1794 +#: library/os.rst:1861 msgid "" ":func:`shutil.get_terminal_size` is the high-level function which should " "normally be used, ``os.get_terminal_size`` is the low-level implementation." msgstr "" -#: library/os.rst:1802 +#: library/os.rst:1869 msgid "" "A subclass of tuple, holding ``(columns, lines)`` of the terminal window " "size." msgstr "" -#: library/os.rst:1806 +#: library/os.rst:1873 msgid "Width of the terminal window in characters." msgstr "" -#: library/os.rst:1810 +#: library/os.rst:1877 msgid "Height of the terminal window in characters." msgstr "" -#: library/os.rst:1816 +#: library/os.rst:1883 msgid "Inheritance of File Descriptors" msgstr "" -#: library/os.rst:1820 +#: library/os.rst:1887 msgid "" "A file descriptor has an \"inheritable\" flag which indicates if the file " "descriptor can be inherited by child processes. Since Python 3.4, file " "descriptors created by Python are non-inheritable by default." msgstr "" -#: library/os.rst:1824 +#: library/os.rst:1891 msgid "" "On UNIX, non-inheritable file descriptors are closed in child processes at " "the execution of a new program, other file descriptors are inherited." msgstr "" -#: library/os.rst:1827 +#: library/os.rst:1894 msgid "" "On Windows, non-inheritable handles and file descriptors are closed in child " "processes, except for standard streams (file descriptors 0, 1 and 2: stdin, " @@ -1860,40 +1928,38 @@ msgid "" "only inherited if the *close_fds* parameter is ``False``." msgstr "" -#: library/os.rst:1835 -msgid "" -"On WebAssembly platforms ``wasm32-emscripten`` and ``wasm32-wasi``, the file " -"descriptor cannot be modified." +#: library/os.rst:1902 +msgid "On WebAssembly platforms, the file descriptor cannot be modified." msgstr "" -#: library/os.rst:1840 +#: library/os.rst:1906 msgid "" "Get the \"inheritable\" flag of the specified file descriptor (a boolean)." msgstr "" -#: library/os.rst:1844 +#: library/os.rst:1910 msgid "Set the \"inheritable\" flag of the specified file descriptor." msgstr "" -#: library/os.rst:1848 +#: library/os.rst:1914 msgid "Get the \"inheritable\" flag of the specified handle (a boolean)." msgstr "" -#: library/os.rst:1854 +#: library/os.rst:1920 msgid "Set the \"inheritable\" flag of the specified handle." msgstr "" -#: library/os.rst:1862 +#: library/os.rst:1928 msgid "Files and Directories" msgstr "" -#: library/os.rst:1864 +#: library/os.rst:1930 msgid "" "On some Unix platforms, many of these functions support one or more of these " "features:" msgstr "" -#: library/os.rst:1869 +#: library/os.rst:1935 msgid "" "**specifying a file descriptor:** Normally the *path* argument provided to " "functions in the :mod:`os` module must be a string specifying a file path. " @@ -1904,7 +1970,7 @@ msgid "" "``chdir``).)" msgstr "" -#: library/os.rst:1877 +#: library/os.rst:1943 msgid "" "You can check whether or not *path* can be specified as a file descriptor " "for a particular function on your platform using :data:`os.supports_fd`. If " @@ -1912,13 +1978,13 @@ msgid "" "`NotImplementedError`." msgstr "" -#: library/os.rst:1882 +#: library/os.rst:1948 msgid "" "If the function also supports *dir_fd* or *follow_symlinks* arguments, it's " "an error to specify one of those when supplying *path* as a file descriptor." msgstr "" -#: library/os.rst:1887 +#: library/os.rst:1953 msgid "" "**paths relative to directory descriptors:** If *dir_fd* is not ``None``, it " "should be a file descriptor referring to a directory, and the path to " @@ -1929,14 +1995,14 @@ msgid "" "``access``)." msgstr "" -#: library/os.rst:1894 +#: library/os.rst:1960 msgid "" "You can check whether or not *dir_fd* is supported for a particular function " "on your platform using :data:`os.supports_dir_fd`. If it's unavailable, " "using it will raise a :exc:`NotImplementedError`." msgstr "" -#: library/os.rst:1900 +#: library/os.rst:1966 msgid "" "**not following symlinks:** If *follow_symlinks* is ``False``, and the last " "element of the path to operate on is a symbolic link, the function will " @@ -1945,14 +2011,14 @@ msgid "" "function.)" msgstr "" -#: library/os.rst:1906 +#: library/os.rst:1972 msgid "" "You can check whether or not *follow_symlinks* is supported for a particular " "function on your platform using :data:`os.supports_follow_symlinks`. If it's " "unavailable, using it will raise a :exc:`NotImplementedError`." msgstr "" -#: library/os.rst:1914 +#: library/os.rst:1980 msgid "" "Use the real uid/gid to test for access to *path*. Note that most " "operations will use the effective uid/gid, therefore this routine can be " @@ -1964,13 +2030,13 @@ msgid "" "manpage:`access(2)` for more information." msgstr "" -#: library/os.rst:1923 +#: library/os.rst:1989 msgid "" "This function can support specifying :ref:`paths relative to directory " "descriptors ` and :ref:`not following symlinks `." msgstr "" -#: library/os.rst:1926 +#: library/os.rst:1992 msgid "" "If *effective_ids* is ``True``, :func:`access` will perform its access " "checks using the effective uid/gid instead of the real uid/gid. " @@ -1979,7 +2045,7 @@ msgid "" "unavailable, using it will raise a :exc:`NotImplementedError`." msgstr "" -#: library/os.rst:1934 +#: library/os.rst:2000 msgid "" "Using :func:`access` to check if a user is authorized to e.g. open a file " "before actually doing so using :func:`open` creates a security hole, because " @@ -1988,7 +2054,7 @@ msgid "" "For example::" msgstr "" -#: library/os.rst:1940 +#: library/os.rst:2006 msgid "" "if os.access(\"myfile\", os.R_OK):\n" " with open(\"myfile\") as fp:\n" @@ -1996,11 +2062,11 @@ msgid "" "return \"some default data\"" msgstr "" -#: library/os.rst:1945 +#: library/os.rst:2011 msgid "is better written as::" msgstr "" -#: library/os.rst:1947 +#: library/os.rst:2013 msgid "" "try:\n" " fp = open(\"myfile\")\n" @@ -2011,274 +2077,281 @@ msgid "" " return fp.read()" msgstr "" -#: library/os.rst:1957 +#: library/os.rst:2023 msgid "" "I/O operations may fail even when :func:`access` indicates that they would " "succeed, particularly for operations on network filesystems which may have " "permissions semantics beyond the usual POSIX permission-bit model." msgstr "" -#: library/os.rst:1961 +#: library/os.rst:2027 msgid "Added the *dir_fd*, *effective_ids*, and *follow_symlinks* parameters." msgstr "" -#: library/os.rst:1973 +#: library/os.rst:2039 msgid "" "Values to pass as the *mode* parameter of :func:`access` to test the " "existence, readability, writability and executability of *path*, " "respectively." msgstr "" -#: library/os.rst:1982 +#: library/os.rst:2048 msgid "Change the current working directory to *path*." msgstr "" -#: library/os.rst:1984 +#: library/os.rst:2050 msgid "" "This function can support :ref:`specifying a file descriptor `. " "The descriptor must refer to an opened directory, not an open file." msgstr "" -#: library/os.rst:1987 +#: library/os.rst:2053 msgid "" "This function can raise :exc:`OSError` and subclasses such as :exc:" "`FileNotFoundError`, :exc:`PermissionError`, and :exc:`NotADirectoryError`." msgstr "" -#: library/os.rst:2123 +#: library/os.rst:2194 msgid "" "Raises an :ref:`auditing event ` ``os.chdir`` with argument " "``path``." msgstr "" -#: library/os.rst:1992 +#: library/os.rst:2058 msgid "" "Added support for specifying *path* as a file descriptor on some platforms." msgstr "" -#: library/os.rst:2002 +#: library/os.rst:2068 msgid "" "Set the flags of *path* to the numeric *flags*. *flags* may take a " "combination (bitwise OR) of the following values (as defined in the :mod:" "`stat` module):" msgstr "" -#: library/os.rst:2005 +#: library/os.rst:2071 msgid ":const:`stat.UF_NODUMP`" msgstr "" -#: library/os.rst:2006 +#: library/os.rst:2072 msgid ":const:`stat.UF_IMMUTABLE`" msgstr "" -#: library/os.rst:2007 +#: library/os.rst:2073 msgid ":const:`stat.UF_APPEND`" msgstr "" -#: library/os.rst:2008 +#: library/os.rst:2074 msgid ":const:`stat.UF_OPAQUE`" msgstr "" -#: library/os.rst:2009 +#: library/os.rst:2075 msgid ":const:`stat.UF_NOUNLINK`" msgstr "" -#: library/os.rst:2010 +#: library/os.rst:2076 msgid ":const:`stat.UF_COMPRESSED`" msgstr "" -#: library/os.rst:2011 +#: library/os.rst:2077 msgid ":const:`stat.UF_HIDDEN`" msgstr "" -#: library/os.rst:2012 +#: library/os.rst:2078 msgid ":const:`stat.SF_ARCHIVED`" msgstr "" -#: library/os.rst:2013 +#: library/os.rst:2079 msgid ":const:`stat.SF_IMMUTABLE`" msgstr "" -#: library/os.rst:2014 +#: library/os.rst:2080 msgid ":const:`stat.SF_APPEND`" msgstr "" -#: library/os.rst:2015 +#: library/os.rst:2081 msgid ":const:`stat.SF_NOUNLINK`" msgstr "" -#: library/os.rst:2016 +#: library/os.rst:2082 msgid ":const:`stat.SF_SNAPSHOT`" msgstr "" -#: library/os.rst:2018 +#: library/os.rst:2084 msgid "" "This function can support :ref:`not following symlinks `." msgstr "" -#: library/os.rst:2149 +#: library/os.rst:2220 msgid "" "Raises an :ref:`auditing event ` ``os.chflags`` with arguments " "``path``, ``flags``." msgstr "" -#: library/os.rst:2024 +#: library/os.rst:2090 msgid "Added the *follow_symlinks* parameter." msgstr "" -#: library/os.rst:2033 +#: library/os.rst:2099 msgid "" "Change the mode of *path* to the numeric *mode*. *mode* may take one of the " "following values (as defined in the :mod:`stat` module) or bitwise ORed " "combinations of them:" msgstr "" -#: library/os.rst:2037 +#: library/os.rst:2103 msgid ":const:`stat.S_ISUID`" msgstr "" -#: library/os.rst:2038 +#: library/os.rst:2104 msgid ":const:`stat.S_ISGID`" msgstr "" -#: library/os.rst:2039 +#: library/os.rst:2105 msgid ":const:`stat.S_ENFMT`" msgstr "" -#: library/os.rst:2040 +#: library/os.rst:2106 msgid ":const:`stat.S_ISVTX`" msgstr "" -#: library/os.rst:2041 +#: library/os.rst:2107 msgid ":const:`stat.S_IREAD`" msgstr "" -#: library/os.rst:2042 +#: library/os.rst:2108 msgid ":const:`stat.S_IWRITE`" msgstr "" -#: library/os.rst:2043 +#: library/os.rst:2109 msgid ":const:`stat.S_IEXEC`" msgstr "" -#: library/os.rst:2044 +#: library/os.rst:2110 msgid ":const:`stat.S_IRWXU`" msgstr "" -#: library/os.rst:2045 +#: library/os.rst:2111 msgid ":const:`stat.S_IRUSR`" msgstr "" -#: library/os.rst:2046 +#: library/os.rst:2112 msgid ":const:`stat.S_IWUSR`" msgstr "" -#: library/os.rst:2047 +#: library/os.rst:2113 msgid ":const:`stat.S_IXUSR`" msgstr "" -#: library/os.rst:2048 +#: library/os.rst:2114 msgid ":const:`stat.S_IRWXG`" msgstr "" -#: library/os.rst:2049 +#: library/os.rst:2115 msgid ":const:`stat.S_IRGRP`" msgstr "" -#: library/os.rst:2050 +#: library/os.rst:2116 msgid ":const:`stat.S_IWGRP`" msgstr "" -#: library/os.rst:2051 +#: library/os.rst:2117 msgid ":const:`stat.S_IXGRP`" msgstr "" -#: library/os.rst:2052 +#: library/os.rst:2118 msgid ":const:`stat.S_IRWXO`" msgstr "" -#: library/os.rst:2053 +#: library/os.rst:2119 msgid ":const:`stat.S_IROTH`" msgstr "" -#: library/os.rst:2054 +#: library/os.rst:2120 msgid ":const:`stat.S_IWOTH`" msgstr "" -#: library/os.rst:2055 +#: library/os.rst:2121 msgid ":const:`stat.S_IXOTH`" msgstr "" -#: library/os.rst:2085 library/os.rst:3473 +#: library/os.rst:2156 library/os.rst:3547 msgid "" "This function can support :ref:`specifying a file descriptor `, :" "ref:`paths relative to directory descriptors ` and :ref:`not " "following symlinks `." msgstr "" -#: library/os.rst:2063 +#: library/os.rst:2129 msgid "" "Although Windows supports :func:`chmod`, you can only set the file's read-" "only flag with it (via the ``stat.S_IWRITE`` and ``stat.S_IREAD`` constants " -"or a corresponding integer value). All other bits are ignored." +"or a corresponding integer value). All other bits are ignored. The default " +"value of *follow_symlinks* is ``False`` on Windows." msgstr "" -#: library/os.rst:2099 +#: library/os.rst:2170 msgid "" "Added support for specifying *path* as an open file descriptor, and the " "*dir_fd* and *follow_symlinks* arguments." msgstr "" -#: library/os.rst:2082 +#: library/os.rst:2146 +msgid "" +"Added support for a file descriptor and the *follow_symlinks* argument on " +"Windows." +msgstr "" + +#: library/os.rst:2153 msgid "" "Change the owner and group id of *path* to the numeric *uid* and *gid*. To " "leave one of the ids unchanged, set it to -1." msgstr "" -#: library/os.rst:2089 +#: library/os.rst:2160 msgid "" "See :func:`shutil.chown` for a higher-level function that accepts names in " "addition to numeric ids." msgstr "" -#: library/os.rst:2103 +#: library/os.rst:2174 msgid "Supports a :term:`path-like object`." msgstr "" -#: library/os.rst:2109 +#: library/os.rst:2180 msgid "Change the root directory of the current process to *path*." msgstr "" -#: library/os.rst:2119 +#: library/os.rst:2190 msgid "" "Change the current working directory to the directory represented by the " "file descriptor *fd*. The descriptor must refer to an opened directory, not " "an open file. As of Python 3.3, this is equivalent to ``os.chdir(fd)``." msgstr "" -#: library/os.rst:2130 +#: library/os.rst:2201 msgid "Return a string representing the current working directory." msgstr "" -#: library/os.rst:2135 +#: library/os.rst:2206 msgid "Return a bytestring representing the current working directory." msgstr "" -#: library/os.rst:2137 +#: library/os.rst:2208 msgid "" "The function now uses the UTF-8 encoding on Windows, rather than the ANSI " "code page: see :pep:`529` for the rationale. The function is no longer " "deprecated on Windows." msgstr "" -#: library/os.rst:2145 +#: library/os.rst:2216 msgid "" "Set the flags of *path* to the numeric *flags*, like :func:`chflags`, but do " "not follow symbolic links. As of Python 3.3, this is equivalent to ``os." "chflags(path, flags, follow_symlinks=False)``." msgstr "" -#: library/os.rst:2159 +#: library/os.rst:2230 msgid "" "Change the mode of *path* to the numeric *mode*. If path is a symlink, this " "affects the symlink rather than the target. See the docs for :func:`chmod` " @@ -2286,49 +2359,49 @@ msgid "" "chmod(path, mode, follow_symlinks=False)``." msgstr "" -#: library/os.rst:2164 +#: library/os.rst:2235 msgid "" "``lchmod()`` is not part of POSIX, but Unix implementations may have it if " "changing the mode of symbolic links is supported." msgstr "" -#: library/os.rst:2176 +#: library/os.rst:2250 msgid "" "Change the owner and group id of *path* to the numeric *uid* and *gid*. " "This function will not follow symbolic links. As of Python 3.3, this is " "equivalent to ``os.chown(path, uid, gid, follow_symlinks=False)``." msgstr "" -#: library/os.rst:2190 +#: library/os.rst:2264 msgid "Create a hard link pointing to *src* named *dst*." msgstr "" -#: library/os.rst:2192 +#: library/os.rst:2266 msgid "" "This function can support specifying *src_dir_fd* and/or *dst_dir_fd* to " "supply :ref:`paths relative to directory descriptors `, and :ref:" "`not following symlinks `." msgstr "" -#: library/os.rst:2196 +#: library/os.rst:2270 msgid "" "Raises an :ref:`auditing event ` ``os.link`` with arguments " "``src``, ``dst``, ``src_dir_fd``, ``dst_dir_fd``." msgstr "" -#: library/os.rst:4257 +#: library/os.rst:4544 msgid "Added Windows support." msgstr "" -#: library/os.rst:2203 +#: library/os.rst:2277 msgid "Added the *src_dir_fd*, *dst_dir_fd*, and *follow_symlinks* parameters." msgstr "" -#: library/os.rst:2630 library/os.rst:3395 +#: library/os.rst:2704 library/os.rst:3469 msgid "Accepts a :term:`path-like object` for *src* and *dst*." msgstr "" -#: library/os.rst:2212 +#: library/os.rst:2286 msgid "" "Return a list containing the names of the entries in the directory given by " "*path*. The list is in arbitrary order, and does not include the special " @@ -2337,7 +2410,7 @@ msgid "" "function, whether a name for that file be included is unspecified." msgstr "" -#: library/os.rst:2218 +#: library/os.rst:2292 msgid "" "*path* may be a :term:`path-like object`. If *path* is of type ``bytes`` " "(directly or indirectly through the :class:`PathLike` interface), the " @@ -2345,41 +2418,41 @@ msgid "" "circumstances, they will be of type ``str``." msgstr "" -#: library/os.rst:2715 +#: library/os.rst:2789 msgid "" "This function can also support :ref:`specifying a file descriptor " "`; the file descriptor must refer to a directory." msgstr "" -#: library/os.rst:2226 +#: library/os.rst:2300 msgid "" "Raises an :ref:`auditing event ` ``os.listdir`` with argument " "``path``." msgstr "" -#: library/os.rst:2229 +#: library/os.rst:2303 msgid "To encode ``str`` filenames to ``bytes``, use :func:`~os.fsencode`." msgstr "" -#: library/os.rst:2233 +#: library/os.rst:2307 msgid "" "The :func:`scandir` function returns directory entries along with file " "attribute information, giving better performance for many common use cases." msgstr "" -#: library/os.rst:2237 +#: library/os.rst:2311 msgid "The *path* parameter became optional." msgstr "" -#: library/os.rst:3254 +#: library/os.rst:3328 msgid "Added support for specifying *path* as an open file descriptor." msgstr "" -#: library/os.rst:2249 +#: library/os.rst:2323 msgid "Return a list containing the names of drives on a Windows system." msgstr "" -#: library/os.rst:2251 +#: library/os.rst:2325 msgid "" "A drive name typically looks like ``'C:\\\\'``. Not every drive name will be " "associated with a volume, and some may be inaccessible for a variety of " @@ -2387,22 +2460,22 @@ msgid "" "function does not test for access." msgstr "" -#: library/os.rst:2256 +#: library/os.rst:2330 msgid "May raise :exc:`OSError` if an error occurs collecting the drive names." msgstr "" -#: library/os.rst:2259 +#: library/os.rst:2333 msgid "" "Raises an :ref:`auditing event ` ``os.listdrives`` with no " "arguments." msgstr "" -#: library/os.rst:2268 +#: library/os.rst:2342 msgid "" "Return a list containing the mount points for a volume on a Windows system." msgstr "" -#: library/os.rst:2271 +#: library/os.rst:2345 msgid "" "*volume* must be represented as a GUID path, like those returned by :func:" "`os.listvolumes`. Volumes may be mounted in multiple locations or not at " @@ -2410,29 +2483,29 @@ msgid "" "associated with a volume will not be returned by this function." msgstr "" -#: library/os.rst:2277 +#: library/os.rst:2351 msgid "" "The mount points return by this function will be absolute paths, and may be " "longer than the drive name." msgstr "" -#: library/os.rst:2280 +#: library/os.rst:2354 msgid "" "Raises :exc:`OSError` if the volume is not recognized or if an error occurs " "collecting the paths." msgstr "" -#: library/os.rst:2283 +#: library/os.rst:2357 msgid "" "Raises an :ref:`auditing event ` ``os.listmounts`` with argument " "``volume``." msgstr "" -#: library/os.rst:2292 +#: library/os.rst:2366 msgid "Return a list containing the volumes in the system." msgstr "" -#: library/os.rst:2294 +#: library/os.rst:2368 msgid "" "Volumes are typically represented as a GUID path that looks like ``\\\\?" "\\Volume{xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx}\\``. Files can usually be " @@ -2441,46 +2514,46 @@ msgid "" "function is to retrieve mount points using :func:`os.listmounts`." msgstr "" -#: library/os.rst:2301 +#: library/os.rst:2375 msgid "May raise :exc:`OSError` if an error occurs collecting the volumes." msgstr "" -#: library/os.rst:2303 +#: library/os.rst:2377 msgid "" "Raises an :ref:`auditing event ` ``os.listvolumes`` with no " "arguments." msgstr "" -#: library/os.rst:2312 +#: library/os.rst:2386 msgid "" "Perform the equivalent of an :c:func:`!lstat` system call on the given path. " "Similar to :func:`~os.stat`, but does not follow symbolic links. Return a :" "class:`stat_result` object." msgstr "" -#: library/os.rst:2316 +#: library/os.rst:2390 msgid "" "On platforms that do not support symbolic links, this is an alias for :func:" "`~os.stat`." msgstr "" -#: library/os.rst:2319 +#: library/os.rst:2393 msgid "" "As of Python 3.3, this is equivalent to ``os.stat(path, dir_fd=dir_fd, " "follow_symlinks=False)``." msgstr "" -#: library/os.rst:2364 library/os.rst:2460 library/os.rst:2534 +#: library/os.rst:2438 library/os.rst:2534 library/os.rst:2608 msgid "" "This function can also support :ref:`paths relative to directory descriptors " "`." msgstr "" -#: library/os.rst:2543 library/os.rst:3388 +#: library/os.rst:2617 library/os.rst:3462 msgid "Added support for Windows 6.0 (Vista) symbolic links." msgstr "" -#: library/os.rst:2338 +#: library/os.rst:2412 msgid "" "On Windows, now opens reparse points that represent another path (name " "surrogates), including symbolic links and directory junctions. Other kinds " @@ -2488,18 +2561,18 @@ msgid "" "stat`." msgstr "" -#: library/os.rst:2347 +#: library/os.rst:2421 msgid "Create a directory named *path* with numeric mode *mode*." msgstr "" -#: library/os.rst:2349 +#: library/os.rst:2423 msgid "" "If the directory already exists, :exc:`FileExistsError` is raised. If a " "parent directory in the path does not exist, :exc:`FileNotFoundError` is " "raised." msgstr "" -#: library/os.rst:2354 +#: library/os.rst:2428 msgid "" "On some systems, *mode* is ignored. Where it is used, the current umask " "value is first masked out. If bits other than the last 9 (i.e. the last 3 " @@ -2508,36 +2581,36 @@ msgid "" "call :func:`chmod` explicitly to set them." msgstr "" -#: library/os.rst:2360 +#: library/os.rst:2434 msgid "" "On Windows, a *mode* of ``0o700`` is specifically handled to apply access " "control to the new directory such that only the current user and " "administrators have access. Other values of *mode* are ignored." msgstr "" -#: library/os.rst:2367 +#: library/os.rst:2441 msgid "" "It is also possible to create temporary directories; see the :mod:`tempfile` " "module's :func:`tempfile.mkdtemp` function." msgstr "" -#: library/os.rst:2407 +#: library/os.rst:2481 msgid "" "Raises an :ref:`auditing event ` ``os.mkdir`` with arguments " "``path``, ``mode``, ``dir_fd``." msgstr "" -#: library/os.rst:2378 +#: library/os.rst:2452 msgid "Windows now handles a *mode* of ``0o700``." msgstr "" -#: library/os.rst:2388 +#: library/os.rst:2462 msgid "" "Recursive directory creation function. Like :func:`mkdir`, but makes all " "intermediate-level directories needed to contain the leaf directory." msgstr "" -#: library/os.rst:2391 +#: library/os.rst:2465 msgid "" "The *mode* parameter is passed to :func:`mkdir` for creating the leaf " "directory; see :ref:`the mkdir() description ` for how it is " @@ -2546,27 +2619,27 @@ msgid "" "file permission bits of existing parent directories are not changed." msgstr "" -#: library/os.rst:2397 +#: library/os.rst:2471 msgid "" "If *exist_ok* is ``False`` (the default), a :exc:`FileExistsError` is raised " "if the target directory already exists." msgstr "" -#: library/os.rst:2402 +#: library/os.rst:2476 msgid "" ":func:`makedirs` will become confused if the path elements to create " "include :data:`pardir` (eg. \"..\" on UNIX systems)." msgstr "" -#: library/os.rst:2405 +#: library/os.rst:2479 msgid "This function handles UNC paths correctly." msgstr "" -#: library/os.rst:2409 +#: library/os.rst:2483 msgid "Added the *exist_ok* parameter." msgstr "" -#: library/os.rst:2414 +#: library/os.rst:2488 msgid "" "Before Python 3.4.1, if *exist_ok* was ``True`` and the directory existed, :" "func:`makedirs` would still raise an error if *mode* did not match the mode " @@ -2574,19 +2647,19 @@ msgid "" "safely, it was removed in Python 3.4.1. See :issue:`21082`." msgstr "" -#: library/os.rst:2422 +#: library/os.rst:2496 msgid "" "The *mode* argument no longer affects the file permission bits of newly " "created intermediate-level directories." msgstr "" -#: library/os.rst:2429 +#: library/os.rst:2503 msgid "" "Create a FIFO (a named pipe) named *path* with numeric mode *mode*. The " "current umask value is first masked out from the mode." msgstr "" -#: library/os.rst:2435 +#: library/os.rst:2509 msgid "" "FIFOs are pipes that can be accessed like regular files. FIFOs exist until " "they are deleted (for example with :func:`os.unlink`). Generally, FIFOs are " @@ -2596,7 +2669,7 @@ msgid "" "rendezvous point." msgstr "" -#: library/os.rst:2452 +#: library/os.rst:2526 msgid "" "Create a filesystem node (file, device special file or named pipe) named " "*path*. *mode* specifies both the permissions to use and the type of node to " @@ -2607,23 +2680,23 @@ msgid "" "`os.makedev`), otherwise it is ignored." msgstr "" -#: library/os.rst:2474 +#: library/os.rst:2548 msgid "" "Extract the device major number from a raw device number (usually the :attr:" "`st_dev` or :attr:`st_rdev` field from :c:struct:`stat`)." msgstr "" -#: library/os.rst:2480 +#: library/os.rst:2554 msgid "" "Extract the device minor number from a raw device number (usually the :attr:" "`st_dev` or :attr:`st_rdev` field from :c:struct:`stat`)." msgstr "" -#: library/os.rst:2486 +#: library/os.rst:2560 msgid "Compose a raw device number from the major and minor device numbers." msgstr "" -#: library/os.rst:2491 +#: library/os.rst:2565 msgid "" "Return system configuration information relevant to a named file. *name* " "specifies the configuration value to retrieve; it may be a string which is " @@ -2634,19 +2707,19 @@ msgid "" "included in that mapping, passing an integer for *name* is also accepted." msgstr "" -#: library/os.rst:3247 library/os.rst:3416 +#: library/os.rst:3321 library/os.rst:3490 msgid "" "This function can support :ref:`specifying a file descriptor `." msgstr "" -#: library/os.rst:2515 +#: library/os.rst:2589 msgid "" "Dictionary mapping names accepted by :func:`pathconf` and :func:`fpathconf` " "to the integer values defined for those names by the host operating system. " "This can be used to determine the set of names known to the system." msgstr "" -#: library/os.rst:2524 +#: library/os.rst:2598 msgid "" "Return a string representing the path to which the symbolic link points. " "The result may be either an absolute or relative pathname; if it is " @@ -2654,7 +2727,7 @@ msgid "" "join(os.path.dirname(path), result)``." msgstr "" -#: library/os.rst:2529 +#: library/os.rst:2603 msgid "" "If the *path* is a string object (directly or indirectly through a :class:" "`PathLike` interface), the result will also be a string object, and the call " @@ -2662,41 +2735,41 @@ msgid "" "indirectly), the result will be a bytes object." msgstr "" -#: library/os.rst:2537 +#: library/os.rst:2611 msgid "" "When trying to resolve a path that may contain links, use :func:`~os.path." "realpath` to properly handle recursion and platform differences." msgstr "" -#: library/os.rst:2549 +#: library/os.rst:2623 msgid "Accepts a :term:`path-like object` on Unix." msgstr "" -#: library/os.rst:2552 +#: library/os.rst:2626 msgid "Accepts a :term:`path-like object` and a bytes object on Windows." msgstr "" -#: library/os.rst:2555 +#: library/os.rst:2629 msgid "" "Added support for directory junctions, and changed to return the " "substitution path (which typically includes ``\\\\?\\`` prefix) rather than " "the optional \"print name\" field that was previously returned." msgstr "" -#: library/os.rst:2561 +#: library/os.rst:2635 msgid "" "Remove (delete) the file *path*. If *path* is a directory, an :exc:" "`OSError` is raised. Use :func:`rmdir` to remove directories. If the file " "does not exist, a :exc:`FileNotFoundError` is raised." msgstr "" -#: library/os.rst:2678 library/os.rst:3367 +#: library/os.rst:2752 library/os.rst:3441 msgid "" "This function can support :ref:`paths relative to directory descriptors " "`." msgstr "" -#: library/os.rst:2568 +#: library/os.rst:2642 msgid "" "On Windows, attempting to remove a file that is in use causes an exception " "to be raised; on Unix, the directory entry is removed but the storage " @@ -2704,17 +2777,17 @@ msgid "" "longer in use." msgstr "" -#: library/os.rst:2572 +#: library/os.rst:2646 msgid "This function is semantically identical to :func:`unlink`." msgstr "" -#: library/os.rst:2596 library/os.rst:3438 +#: library/os.rst:2670 library/os.rst:3512 msgid "" "Raises an :ref:`auditing event ` ``os.remove`` with arguments " "``path``, ``dir_fd``." msgstr "" -#: library/os.rst:2587 +#: library/os.rst:2661 msgid "" "Remove directories recursively. Works like :func:`rmdir` except that, if " "the leaf directory is successfully removed, :func:`removedirs` tries to " @@ -2726,20 +2799,20 @@ msgid "" "could not be successfully removed." msgstr "" -#: library/os.rst:2604 +#: library/os.rst:2678 msgid "" "Rename the file or directory *src* to *dst*. If *dst* exists, the operation " "will fail with an :exc:`OSError` subclass in a number of cases:" msgstr "" -#: library/os.rst:2607 +#: library/os.rst:2681 msgid "" "On Windows, if *dst* exists a :exc:`FileExistsError` is always raised. The " "operation may fail if *src* and *dst* are on different filesystems. Use :" "func:`shutil.move` to support moves to a different filesystem." msgstr "" -#: library/os.rst:2611 +#: library/os.rst:2685 msgid "" "On Unix, if *src* is a file and *dst* is a directory or vice-versa, an :exc:" "`IsADirectoryError` or a :exc:`NotADirectoryError` will be raised " @@ -2751,29 +2824,29 @@ msgid "" "operation (this is a POSIX requirement)." msgstr "" -#: library/os.rst:2660 +#: library/os.rst:2734 msgid "" "This function can support specifying *src_dir_fd* and/or *dst_dir_fd* to " "supply :ref:`paths relative to directory descriptors `." msgstr "" -#: library/os.rst:2623 +#: library/os.rst:2697 msgid "" "If you want cross-platform overwriting of the destination, use :func:" "`replace`." msgstr "" -#: library/os.rst:2646 library/os.rst:2663 +#: library/os.rst:2720 library/os.rst:2737 msgid "" "Raises an :ref:`auditing event ` ``os.rename`` with arguments " "``src``, ``dst``, ``src_dir_fd``, ``dst_dir_fd``." msgstr "" -#: library/os.rst:2627 +#: library/os.rst:2701 msgid "Added the *src_dir_fd* and *dst_dir_fd* parameters." msgstr "" -#: library/os.rst:2636 +#: library/os.rst:2710 msgid "" "Recursive directory or file renaming function. Works like :func:`rename`, " "except creation of any intermediate directories needed to make the new " @@ -2782,17 +2855,17 @@ msgid "" "using :func:`removedirs`." msgstr "" -#: library/os.rst:2643 +#: library/os.rst:2717 msgid "" "This function can fail with the new directory structure made if you lack " "permissions needed to remove the leaf directory or file." msgstr "" -#: library/os.rst:2648 +#: library/os.rst:2722 msgid "Accepts a :term:`path-like object` for *old* and *new*." msgstr "" -#: library/os.rst:2654 +#: library/os.rst:2728 msgid "" "Rename the file or directory *src* to *dst*. If *dst* is a non-empty " "directory, :exc:`OSError` will be raised. If *dst* exists and is a file, it " @@ -2801,7 +2874,7 @@ msgid "" "renaming will be an atomic operation (this is a POSIX requirement)." msgstr "" -#: library/os.rst:2673 +#: library/os.rst:2747 msgid "" "Remove (delete) the directory *path*. If the directory does not exist or is " "not empty, a :exc:`FileNotFoundError` or an :exc:`OSError` is raised " @@ -2809,13 +2882,13 @@ msgid "" "rmtree` can be used." msgstr "" -#: library/os.rst:2681 +#: library/os.rst:2755 msgid "" "Raises an :ref:`auditing event ` ``os.rmdir`` with arguments " "``path``, ``dir_fd``." msgstr "" -#: library/os.rst:2692 +#: library/os.rst:2766 msgid "" "Return an iterator of :class:`os.DirEntry` objects corresponding to the " "entries in the directory given by *path*. The entries are yielded in " @@ -2825,7 +2898,7 @@ msgid "" "unspecified." msgstr "" -#: library/os.rst:2699 +#: library/os.rst:2773 msgid "" "Using :func:`scandir` instead of :func:`listdir` can significantly increase " "the performance of code that also needs file type or file attribute " @@ -2837,7 +2910,7 @@ msgid "" "Unix but only requires one for symbolic links on Windows." msgstr "" -#: library/os.rst:2709 +#: library/os.rst:2783 msgid "" "*path* may be a :term:`path-like object`. If *path* is of type ``bytes`` " "(directly or indirectly through the :class:`PathLike` interface), the type " @@ -2846,30 +2919,30 @@ msgid "" "they will be of type ``str``." msgstr "" -#: library/os.rst:2718 +#: library/os.rst:2792 msgid "" "Raises an :ref:`auditing event ` ``os.scandir`` with argument " "``path``." msgstr "" -#: library/os.rst:2720 +#: library/os.rst:2794 msgid "" "The :func:`scandir` iterator supports the :term:`context manager` protocol " "and has the following method:" msgstr "" -#: library/os.rst:2725 +#: library/os.rst:2799 msgid "Close the iterator and free acquired resources." msgstr "" -#: library/os.rst:2727 +#: library/os.rst:2801 msgid "" "This is called automatically when the iterator is exhausted or garbage " "collected, or when an error happens during iterating. However it is " "advisable to call it explicitly or use the :keyword:`with` statement." msgstr "" -#: library/os.rst:2734 +#: library/os.rst:2808 msgid "" "The following example shows a simple use of :func:`scandir` to display all " "the files (excluding directories) in the given *path* that don't start with " @@ -2877,7 +2950,7 @@ msgid "" "system call::" msgstr "" -#: library/os.rst:2739 +#: library/os.rst:2813 msgid "" "with os.scandir(path) as it:\n" " for entry in it:\n" @@ -2885,7 +2958,7 @@ msgid "" " print(entry.name)" msgstr "" -#: library/os.rst:2746 +#: library/os.rst:2820 msgid "" "On Unix-based systems, :func:`scandir` uses the system's `opendir() `_ and " @@ -2896,7 +2969,7 @@ msgid "" "desktop/aa364428(v=vs.85).aspx>`_ functions." msgstr "" -#: library/os.rst:2758 +#: library/os.rst:2832 msgid "" "Added support for the :term:`context manager` protocol and the :func:" "`~scandir.close` method. If a :func:`scandir` iterator is neither exhausted " @@ -2904,28 +2977,28 @@ msgid "" "destructor." msgstr "" -#: library/os.rst:2764 +#: library/os.rst:2838 msgid "The function accepts a :term:`path-like object`." msgstr "" -#: library/os.rst:2766 +#: library/os.rst:2840 msgid "Added support for :ref:`file descriptors ` on Unix." msgstr "" -#: library/os.rst:2772 +#: library/os.rst:2846 msgid "" "Object yielded by :func:`scandir` to expose the file path and other file " "attributes of a directory entry." msgstr "" -#: library/os.rst:2775 +#: library/os.rst:2849 msgid "" ":func:`scandir` will provide as much of this information as possible without " "making additional system calls. When a ``stat()`` or ``lstat()`` system call " "is made, the ``os.DirEntry`` object will cache the result." msgstr "" -#: library/os.rst:2779 +#: library/os.rst:2853 msgid "" "``os.DirEntry`` instances are not intended to be stored in long-lived data " "structures; if you know the file metadata has changed or if a long time has " @@ -2933,7 +3006,7 @@ msgid "" "up-to-date information." msgstr "" -#: library/os.rst:2784 +#: library/os.rst:2858 msgid "" "Because the ``os.DirEntry`` methods can make operating system calls, they " "may also raise :exc:`OSError`. If you need very fine-grained control over " @@ -2941,29 +3014,29 @@ msgid "" "methods and handle as appropriate." msgstr "" -#: library/os.rst:2789 +#: library/os.rst:2863 msgid "" "To be directly usable as a :term:`path-like object`, ``os.DirEntry`` " "implements the :class:`PathLike` interface." msgstr "" -#: library/os.rst:2792 +#: library/os.rst:2866 msgid "Attributes and methods on a ``os.DirEntry`` instance are as follows:" msgstr "" -#: library/os.rst:2796 +#: library/os.rst:2870 msgid "" "The entry's base filename, relative to the :func:`scandir` *path* argument." msgstr "" -#: library/os.rst:2799 +#: library/os.rst:2873 msgid "" "The :attr:`name` attribute will be ``bytes`` if the :func:`scandir` *path* " "argument is of type ``bytes`` and ``str`` otherwise. Use :func:`~os." "fsdecode` to decode byte filenames." msgstr "" -#: library/os.rst:2805 +#: library/os.rst:2879 msgid "" "The entry's full path name: equivalent to ``os.path.join(scandir_path, entry." "name)`` where *scandir_path* is the :func:`scandir` *path* argument. The " @@ -2973,51 +3046,51 @@ msgid "" "attribute." msgstr "" -#: library/os.rst:2812 +#: library/os.rst:2886 msgid "" "The :attr:`path` attribute will be ``bytes`` if the :func:`scandir` *path* " "argument is of type ``bytes`` and ``str`` otherwise. Use :func:`~os." "fsdecode` to decode byte filenames." msgstr "" -#: library/os.rst:2818 +#: library/os.rst:2892 msgid "Return the inode number of the entry." msgstr "" -#: library/os.rst:2820 +#: library/os.rst:2894 msgid "" "The result is cached on the ``os.DirEntry`` object. Use ``os.stat(entry." "path, follow_symlinks=False).st_ino`` to fetch up-to-date information." msgstr "" -#: library/os.rst:2824 +#: library/os.rst:2898 msgid "" "On the first, uncached call, a system call is required on Windows but not on " "Unix." msgstr "" -#: library/os.rst:2829 +#: library/os.rst:2903 msgid "" "Return ``True`` if this entry is a directory or a symbolic link pointing to " "a directory; return ``False`` if the entry is or points to any other kind of " "file, or if it doesn't exist anymore." msgstr "" -#: library/os.rst:2833 +#: library/os.rst:2907 msgid "" "If *follow_symlinks* is ``False``, return ``True`` only if this entry is a " "directory (without following symlinks); return ``False`` if the entry is any " "other kind of file or if it doesn't exist anymore." msgstr "" -#: library/os.rst:2837 +#: library/os.rst:2911 msgid "" "The result is cached on the ``os.DirEntry`` object, with a separate cache " "for *follow_symlinks* ``True`` and ``False``. Call :func:`os.stat` along " "with :func:`stat.S_ISDIR` to fetch up-to-date information." msgstr "" -#: library/os.rst:2841 +#: library/os.rst:2915 msgid "" "On the first, uncached call, no system call is required in most cases. " "Specifically, for non-symlinks, neither Windows or Unix require a system " @@ -3027,46 +3100,46 @@ msgid "" "is ``False``." msgstr "" -#: library/os.rst:2878 +#: library/os.rst:2952 msgid "" "This method can raise :exc:`OSError`, such as :exc:`PermissionError`, but :" "exc:`FileNotFoundError` is caught and not raised." msgstr "" -#: library/os.rst:2853 +#: library/os.rst:2927 msgid "" "Return ``True`` if this entry is a file or a symbolic link pointing to a " "file; return ``False`` if the entry is or points to a directory or other non-" "file entry, or if it doesn't exist anymore." msgstr "" -#: library/os.rst:2857 +#: library/os.rst:2931 msgid "" "If *follow_symlinks* is ``False``, return ``True`` only if this entry is a " "file (without following symlinks); return ``False`` if the entry is a " "directory or other non-file entry, or if it doesn't exist anymore." msgstr "" -#: library/os.rst:2861 +#: library/os.rst:2935 msgid "" "The result is cached on the ``os.DirEntry`` object. Caching, system calls " "made, and exceptions raised are as per :func:`~os.DirEntry.is_dir`." msgstr "" -#: library/os.rst:2866 +#: library/os.rst:2940 msgid "" "Return ``True`` if this entry is a symbolic link (even if broken); return " "``False`` if the entry points to a directory or any kind of file, or if it " "doesn't exist anymore." msgstr "" -#: library/os.rst:2870 +#: library/os.rst:2944 msgid "" "The result is cached on the ``os.DirEntry`` object. Call :func:`os.path." "islink` to fetch up-to-date information." msgstr "" -#: library/os.rst:2873 +#: library/os.rst:2947 msgid "" "On the first, uncached call, no system call is required in most cases. " "Specifically, neither Windows or Unix require a system call, except on " @@ -3074,48 +3147,48 @@ msgid "" "``dirent.d_type == DT_UNKNOWN``." msgstr "" -#: library/os.rst:2883 +#: library/os.rst:2957 msgid "" "Return ``True`` if this entry is a junction (even if broken); return " "``False`` if the entry points to a regular directory, any kind of file, a " "symlink, or if it doesn't exist anymore." msgstr "" -#: library/os.rst:2887 +#: library/os.rst:2961 msgid "" "The result is cached on the ``os.DirEntry`` object. Call :func:`os.path." "isjunction` to fetch up-to-date information." msgstr "" -#: library/os.rst:2894 +#: library/os.rst:2968 msgid "" "Return a :class:`stat_result` object for this entry. This method follows " "symbolic links by default; to stat a symbolic link add the " "``follow_symlinks=False`` argument." msgstr "" -#: library/os.rst:2898 +#: library/os.rst:2972 msgid "" "On Unix, this method always requires a system call. On Windows, it only " "requires a system call if *follow_symlinks* is ``True`` and the entry is a " "reparse point (for example, a symbolic link or directory junction)." msgstr "" -#: library/os.rst:2903 +#: library/os.rst:2977 msgid "" "On Windows, the ``st_ino``, ``st_dev`` and ``st_nlink`` attributes of the :" "class:`stat_result` are always set to zero. Call :func:`os.stat` to get " "these attributes." msgstr "" -#: library/os.rst:2907 +#: library/os.rst:2981 msgid "" "The result is cached on the ``os.DirEntry`` object, with a separate cache " "for *follow_symlinks* ``True`` and ``False``. Call :func:`os.stat` to fetch " "up-to-date information." msgstr "" -#: library/os.rst:2911 +#: library/os.rst:2985 msgid "" "Note that there is a nice correspondence between several attributes and " "methods of ``os.DirEntry`` and of :class:`pathlib.Path`. In particular, the " @@ -3123,13 +3196,13 @@ msgid "" "``is_file()``, ``is_symlink()``, ``is_junction()``, and ``stat()`` methods." msgstr "" -#: library/os.rst:2919 +#: library/os.rst:2993 msgid "" "Added support for the :class:`~os.PathLike` interface. Added support for :" "class:`bytes` paths on Windows." msgstr "" -#: library/os.rst:2923 +#: library/os.rst:2997 msgid "" "The ``st_ctime`` attribute of a stat result is deprecated on Windows. The " "file creation time is properly available as ``st_birthtime``, and in the " @@ -3137,7 +3210,7 @@ msgid "" "time, if available." msgstr "" -#: library/os.rst:2932 +#: library/os.rst:3006 msgid "" "Get the status of a file or a file descriptor. Perform the equivalent of a :" "c:func:`stat` system call on the given path. *path* may be specified as " @@ -3146,19 +3219,19 @@ msgid "" "`stat_result` object." msgstr "" -#: library/os.rst:2938 +#: library/os.rst:3012 msgid "" "This function normally follows symlinks; to stat a symlink add the argument " "``follow_symlinks=False``, or use :func:`lstat`." msgstr "" -#: library/os.rst:3807 library/os.rst:3839 library/os.rst:3859 +#: library/os.rst:4094 library/os.rst:4126 library/os.rst:4146 msgid "" "This function can support :ref:`specifying a file descriptor ` and :" "ref:`not following symlinks `." msgstr "" -#: library/os.rst:2944 +#: library/os.rst:3018 msgid "" "On Windows, passing ``follow_symlinks=False`` will disable following all " "name-surrogate reparse points, which includes symlinks and directory " @@ -3172,11 +3245,11 @@ msgid "" "junction points, which will raise the usual exceptions." msgstr "" -#: library/os.rst:3727 +#: library/os.rst:3801 msgid "Example::" msgstr "" -#: library/os.rst:2959 +#: library/os.rst:3033 msgid "" ">>> import os\n" ">>> statinfo = os.stat('somefile.txt')\n" @@ -3188,17 +3261,17 @@ msgid "" "264" msgstr "" -#: library/os.rst:2970 +#: library/os.rst:3044 msgid ":func:`fstat` and :func:`lstat` functions." msgstr "" -#: library/os.rst:2972 +#: library/os.rst:3046 msgid "" "Added the *dir_fd* and *follow_symlinks* parameters, specifying a file " "descriptor instead of a path." msgstr "" -#: library/os.rst:2979 +#: library/os.rst:3053 msgid "" "On Windows, all reparse points that can be resolved by the operating system " "are now followed, and passing ``follow_symlinks=False`` disables following " @@ -3208,122 +3281,122 @@ msgid "" "of raising an error." msgstr "" -#: library/os.rst:2990 +#: library/os.rst:3064 msgid "" "Object whose attributes correspond roughly to the members of the :c:struct:" "`stat` structure. It is used for the result of :func:`os.stat`, :func:`os." "fstat` and :func:`os.lstat`." msgstr "" -#: library/os.rst:2994 +#: library/os.rst:3068 msgid "Attributes:" msgstr "" -#: library/os.rst:2998 +#: library/os.rst:3072 msgid "File mode: file type and file mode bits (permissions)." msgstr "" -#: library/os.rst:3002 +#: library/os.rst:3076 msgid "" "Platform dependent, but if non-zero, uniquely identifies the file for a " "given value of ``st_dev``. Typically:" msgstr "" -#: library/os.rst:3005 +#: library/os.rst:3079 msgid "the inode number on Unix," msgstr "" -#: library/os.rst:3006 +#: library/os.rst:3080 msgid "" "the `file index `_ on " "Windows" msgstr "" -#: library/os.rst:3012 +#: library/os.rst:3086 msgid "Identifier of the device on which this file resides." msgstr "" -#: library/os.rst:3016 +#: library/os.rst:3090 msgid "Number of hard links." msgstr "" -#: library/os.rst:3020 +#: library/os.rst:3094 msgid "User identifier of the file owner." msgstr "" -#: library/os.rst:3024 +#: library/os.rst:3098 msgid "Group identifier of the file owner." msgstr "" -#: library/os.rst:3028 +#: library/os.rst:3102 msgid "" "Size of the file in bytes, if it is a regular file or a symbolic link. The " "size of a symbolic link is the length of the pathname it contains, without a " "terminating null byte." msgstr "" -#: library/os.rst:3032 +#: library/os.rst:3106 msgid "Timestamps:" msgstr "" -#: library/os.rst:3036 +#: library/os.rst:3110 msgid "Time of most recent access expressed in seconds." msgstr "" -#: library/os.rst:3040 +#: library/os.rst:3114 msgid "Time of most recent content modification expressed in seconds." msgstr "" -#: library/os.rst:3044 +#: library/os.rst:3118 msgid "Time of most recent metadata change expressed in seconds." msgstr "" -#: library/os.rst:3046 +#: library/os.rst:3120 msgid "" "``st_ctime`` is deprecated on Windows. Use ``st_birthtime`` for the file " "creation time. In the future, ``st_ctime`` will contain the time of the most " "recent metadata change, as for other platforms." msgstr "" -#: library/os.rst:3053 +#: library/os.rst:3127 msgid "Time of most recent access expressed in nanoseconds as an integer." msgstr "" -#: library/os.rst:3059 +#: library/os.rst:3133 msgid "" "Time of most recent content modification expressed in nanoseconds as an " "integer." msgstr "" -#: library/os.rst:3066 +#: library/os.rst:3140 msgid "" "Time of most recent metadata change expressed in nanoseconds as an integer." msgstr "" -#: library/os.rst:3071 +#: library/os.rst:3145 msgid "" "``st_ctime_ns`` is deprecated on Windows. Use ``st_birthtime_ns`` for the " "file creation time. In the future, ``st_ctime`` will contain the time of the " "most recent metadata change, as for other platforms." msgstr "" -#: library/os.rst:3078 +#: library/os.rst:3152 msgid "" "Time of file creation expressed in seconds. This attribute is not always " "available, and may raise :exc:`AttributeError`." msgstr "" -#: library/os.rst:3081 +#: library/os.rst:3155 msgid "``st_birthtime`` is now available on Windows." msgstr "" -#: library/os.rst:3086 +#: library/os.rst:3160 msgid "" "Time of file creation expressed in nanoseconds as an integer. This attribute " "is not always available, and may raise :exc:`AttributeError`." msgstr "" -#: library/os.rst:3094 +#: library/os.rst:3168 msgid "" "The exact meaning and resolution of the :attr:`st_atime`, :attr:`st_mtime`, :" "attr:`st_ctime` and :attr:`st_birthtime` attributes depend on the operating " @@ -3333,7 +3406,7 @@ msgid "" "details." msgstr "" -#: library/os.rst:3101 +#: library/os.rst:3175 msgid "" "Similarly, although :attr:`st_atime_ns`, :attr:`st_mtime_ns`, :attr:" "`st_ctime_ns` and :attr:`st_birthtime_ns` are always expressed in " @@ -3346,74 +3419,74 @@ msgid "" "`st_birthtime_ns`." msgstr "" -#: library/os.rst:3111 +#: library/os.rst:3185 msgid "" "On some Unix systems (such as Linux), the following attributes may also be " "available:" msgstr "" -#: library/os.rst:3116 +#: library/os.rst:3190 msgid "" "Number of 512-byte blocks allocated for file. This may be smaller than :attr:" "`st_size`/512 when the file has holes." msgstr "" -#: library/os.rst:3121 +#: library/os.rst:3195 msgid "" "\"Preferred\" blocksize for efficient file system I/O. Writing to a file in " "smaller chunks may cause an inefficient read-modify-rewrite." msgstr "" -#: library/os.rst:3126 +#: library/os.rst:3200 msgid "Type of device if an inode device." msgstr "" -#: library/os.rst:3130 +#: library/os.rst:3204 msgid "User defined flags for file." msgstr "" -#: library/os.rst:3132 +#: library/os.rst:3206 msgid "" "On other Unix systems (such as FreeBSD), the following attributes may be " "available (but may be only filled out if root tries to use them):" msgstr "" -#: library/os.rst:3137 +#: library/os.rst:3211 msgid "File generation number." msgstr "" -#: library/os.rst:3139 +#: library/os.rst:3213 msgid "" "On Solaris and derivatives, the following attributes may also be available:" msgstr "" -#: library/os.rst:3144 +#: library/os.rst:3218 msgid "" "String that uniquely identifies the type of the filesystem that contains the " "file." msgstr "" -#: library/os.rst:3147 +#: library/os.rst:3221 msgid "On macOS systems, the following attributes may also be available:" msgstr "" -#: library/os.rst:3151 +#: library/os.rst:3225 msgid "Real size of the file." msgstr "" -#: library/os.rst:3155 +#: library/os.rst:3229 msgid "Creator of the file." msgstr "" -#: library/os.rst:3159 +#: library/os.rst:3233 msgid "File type." msgstr "" -#: library/os.rst:3161 +#: library/os.rst:3235 msgid "On Windows systems, the following attributes are also available:" msgstr "" -#: library/os.rst:3165 +#: library/os.rst:3239 msgid "" "Windows file attributes: ``dwFileAttributes`` member of the " "``BY_HANDLE_FILE_INFORMATION`` structure returned by :c:func:`!" @@ -3421,7 +3494,7 @@ msgid "" "FILE_ATTRIBUTE_ARCHIVE>` constants in the :mod:`stat` module." msgstr "" -#: library/os.rst:3175 +#: library/os.rst:3249 msgid "" "When :attr:`st_file_attributes` has the :const:`~stat." "FILE_ATTRIBUTE_REPARSE_POINT` set, this field contains the tag identifying " @@ -3429,14 +3502,14 @@ msgid "" "IO_REPARSE_TAG_SYMLINK>` constants in the :mod:`stat` module." msgstr "" -#: library/os.rst:3180 +#: library/os.rst:3254 msgid "" "The standard module :mod:`stat` defines functions and constants that are " "useful for extracting information from a :c:struct:`stat` structure. (On " "Windows, some items are filled with dummy values.)" msgstr "" -#: library/os.rst:3184 +#: library/os.rst:3258 msgid "" "For backward compatibility, a :class:`stat_result` instance is also " "accessible as a tuple of at least 10 integers giving the most important (and " @@ -3448,49 +3521,49 @@ msgid "" "class:`stat_result` as a tuple always returns integers." msgstr "" -#: library/os.rst:3193 +#: library/os.rst:3267 msgid "Windows now returns the file index as :attr:`st_ino` when available." msgstr "" -#: library/os.rst:3197 +#: library/os.rst:3271 msgid "Added the :attr:`st_fstype` member to Solaris/derivatives." msgstr "" -#: library/os.rst:3200 +#: library/os.rst:3274 msgid "Added the :attr:`st_reparse_tag` member on Windows." msgstr "" -#: library/os.rst:3203 +#: library/os.rst:3277 msgid "" "On Windows, the :attr:`st_mode` member now identifies special files as :" "const:`S_IFCHR`, :const:`S_IFIFO` or :const:`S_IFBLK` as appropriate." msgstr "" -#: library/os.rst:3208 +#: library/os.rst:3282 msgid "" "On Windows, :attr:`st_ctime` is deprecated. Eventually, it will contain the " "last metadata change time, for consistency with other platforms, but for now " "still contains creation time. Use :attr:`st_birthtime` for the creation time." msgstr "" -#: library/os.rst:3214 +#: library/os.rst:3288 msgid "" "On Windows, :attr:`st_ino` may now be up to 128 bits, depending on the file " "system. Previously it would not be above 64 bits, and larger file " "identifiers would be arbitrarily packed." msgstr "" -#: library/os.rst:3218 +#: library/os.rst:3292 msgid "" "On Windows, :attr:`st_rdev` no longer returns a value. Previously it would " "contain the same as :attr:`st_dev`, which was incorrect." msgstr "" -#: library/os.rst:3221 +#: library/os.rst:3295 msgid "Added the :attr:`st_birthtime` member on Windows." msgstr "" -#: library/os.rst:3226 +#: library/os.rst:3300 msgid "" "Perform a :c:func:`!statvfs` system call on the given path. The return " "value is an object whose attributes describe the filesystem on the given " @@ -3500,7 +3573,7 @@ msgid "" "`f_favail`, :attr:`f_flag`, :attr:`f_namemax`, :attr:`f_fsid`." msgstr "" -#: library/os.rst:3233 +#: library/os.rst:3307 msgid "" "Two module-level constants are defined for the :attr:`f_flag` attribute's " "bit-flags: if :const:`ST_RDONLY` is set, the filesystem is mounted read-" @@ -3508,7 +3581,7 @@ msgid "" "are disabled or not supported." msgstr "" -#: library/os.rst:3238 +#: library/os.rst:3312 msgid "" "Additional module-level constants are defined for GNU/glibc based systems. " "These are :const:`ST_NODEV` (disallow access to device special files), :" @@ -3521,11 +3594,11 @@ msgid "" "relative to mtime/ctime)." msgstr "" -#: library/os.rst:3251 +#: library/os.rst:3325 msgid "The :const:`ST_RDONLY` and :const:`ST_NOSUID` constants were added." msgstr "" -#: library/os.rst:3257 +#: library/os.rst:3331 msgid "" "The :const:`ST_NODEV`, :const:`ST_NOEXEC`, :const:`ST_SYNCHRONOUS`, :const:" "`ST_MANDLOCK`, :const:`ST_WRITE`, :const:`ST_APPEND`, :const:" @@ -3533,11 +3606,11 @@ msgid "" "`ST_RELATIME` constants were added." msgstr "" -#: library/os.rst:3266 +#: library/os.rst:3340 msgid "Added the :attr:`f_fsid` attribute." msgstr "" -#: library/os.rst:3272 +#: library/os.rst:3346 msgid "" "A :class:`set` object indicating which functions in the :mod:`os` module " "accept an open file descriptor for their *dir_fd* parameter. Different " @@ -3549,7 +3622,7 @@ msgid "" "(Specifying ``None`` for *dir_fd* is always supported on all platforms.)" msgstr "" -#: library/os.rst:3282 +#: library/os.rst:3356 msgid "" "To check whether a particular function accepts an open file descriptor for " "its *dir_fd* parameter, use the ``in`` operator on ``supports_dir_fd``. As " @@ -3557,17 +3630,17 @@ msgid "" "open file descriptors for *dir_fd* on the local platform::" msgstr "" -#: library/os.rst:3287 +#: library/os.rst:3361 msgid "os.stat in os.supports_dir_fd" msgstr "" -#: library/os.rst:3289 +#: library/os.rst:3363 msgid "" "Currently *dir_fd* parameters only work on Unix platforms; none of them work " "on Windows." msgstr "" -#: library/os.rst:3297 +#: library/os.rst:3371 msgid "" "A :class:`set` object indicating whether :func:`os.access` permits " "specifying ``True`` for its *effective_ids* parameter on the local platform. " @@ -3576,23 +3649,23 @@ msgid "" "func:`os.access`; otherwise it will be empty." msgstr "" -#: library/os.rst:3303 +#: library/os.rst:3377 msgid "" "This expression evaluates to ``True`` if :func:`os.access` supports " "``effective_ids=True`` on the local platform::" msgstr "" -#: library/os.rst:3306 +#: library/os.rst:3380 msgid "os.access in os.supports_effective_ids" msgstr "" -#: library/os.rst:3308 +#: library/os.rst:3382 msgid "" "Currently *effective_ids* is only supported on Unix platforms; it does not " "work on Windows." msgstr "" -#: library/os.rst:3316 +#: library/os.rst:3390 msgid "" "A :class:`set` object indicating which functions in the :mod:`os` module " "permit specifying their *path* parameter as an open file descriptor on the " @@ -3601,7 +3674,7 @@ msgid "" "*path* arguments is not available on all platforms Python supports." msgstr "" -#: library/os.rst:3323 +#: library/os.rst:3397 msgid "" "To determine whether a particular function permits specifying an open file " "descriptor for its *path* parameter, use the ``in`` operator on " @@ -3610,11 +3683,11 @@ msgid "" "platform::" msgstr "" -#: library/os.rst:3329 +#: library/os.rst:3403 msgid "os.chdir in os.supports_fd" msgstr "" -#: library/os.rst:3336 +#: library/os.rst:3410 msgid "" "A :class:`set` object indicating which functions in the :mod:`os` module " "accept ``False`` for their *follow_symlinks* parameter on the local " @@ -3627,7 +3700,7 @@ msgid "" "on all platforms.)" msgstr "" -#: library/os.rst:3346 +#: library/os.rst:3420 msgid "" "To check whether a particular function accepts ``False`` for its " "*follow_symlinks* parameter, use the ``in`` operator on " @@ -3636,15 +3709,15 @@ msgid "" "stat` on the local platform::" msgstr "" -#: library/os.rst:3352 +#: library/os.rst:3426 msgid "os.stat in os.supports_follow_symlinks" msgstr "" -#: library/os.rst:3359 +#: library/os.rst:3433 msgid "Create a symbolic link pointing to *src* named *dst*." msgstr "" -#: library/os.rst:3361 +#: library/os.rst:3435 msgid "" "On Windows, a symlink represents either a file or a directory, and does not " "morph to the target dynamically. If the target is present, the type of the " @@ -3654,7 +3727,7 @@ msgid "" "ignored." msgstr "" -#: library/os.rst:3372 +#: library/os.rst:3446 msgid "" "On newer versions of Windows 10, unprivileged accounts can create symlinks " "if Developer Mode is enabled. When Developer Mode is not available/enabled, " @@ -3662,83 +3735,83 @@ msgid "" "must be run as an administrator." msgstr "" -#: library/os.rst:3378 +#: library/os.rst:3452 msgid "" ":exc:`OSError` is raised when the function is called by an unprivileged user." msgstr "" -#: library/os.rst:3381 +#: library/os.rst:3455 msgid "" "Raises an :ref:`auditing event ` ``os.symlink`` with arguments " "``src``, ``dst``, ``dir_fd``." msgstr "" -#: library/os.rst:3391 +#: library/os.rst:3465 msgid "" "Added the *dir_fd* parameter, and now allow *target_is_directory* on non-" "Windows platforms." msgstr "" -#: library/os.rst:3398 +#: library/os.rst:3472 msgid "Added support for unelevated symlinks on Windows with Developer Mode." msgstr "" -#: library/os.rst:3404 +#: library/os.rst:3478 msgid "Force write of everything to disk." msgstr "" -#: library/os.rst:3413 +#: library/os.rst:3487 msgid "" "Truncate the file corresponding to *path*, so that it is at most *length* " "bytes in size." msgstr "" -#: library/os.rst:3418 +#: library/os.rst:3492 msgid "" "Raises an :ref:`auditing event ` ``os.truncate`` with arguments " "``path``, ``length``." msgstr "" -#: library/os.rst:3433 +#: library/os.rst:3507 msgid "" "Remove (delete) the file *path*. This function is semantically identical " "to :func:`remove`; the ``unlink`` name is its traditional Unix name. Please " "see the documentation for :func:`remove` for further information." msgstr "" -#: library/os.rst:3449 +#: library/os.rst:3523 msgid "Set the access and modified times of the file specified by *path*." msgstr "" -#: library/os.rst:3451 +#: library/os.rst:3525 msgid "" ":func:`utime` takes two optional parameters, *times* and *ns*. These specify " "the times set on *path* and are used as follows:" msgstr "" -#: library/os.rst:3454 +#: library/os.rst:3528 msgid "" "If *ns* is specified, it must be a 2-tuple of the form ``(atime_ns, " "mtime_ns)`` where each member is an int expressing nanoseconds." msgstr "" -#: library/os.rst:3457 +#: library/os.rst:3531 msgid "" "If *times* is not ``None``, it must be a 2-tuple of the form ``(atime, " "mtime)`` where each member is an int or float expressing seconds." msgstr "" -#: library/os.rst:3460 +#: library/os.rst:3534 msgid "" "If *times* is ``None`` and *ns* is unspecified, this is equivalent to " "specifying ``ns=(atime_ns, mtime_ns)`` where both times are the current time." msgstr "" -#: library/os.rst:3464 +#: library/os.rst:3538 msgid "It is an error to specify tuples for both *times* and *ns*." msgstr "" -#: library/os.rst:3466 +#: library/os.rst:3540 msgid "" "Note that the exact times you set here may not be returned by a subsequent :" "func:`~os.stat` call, depending on the resolution with which your operating " @@ -3748,19 +3821,19 @@ msgid "" "func:`utime`." msgstr "" -#: library/os.rst:3477 +#: library/os.rst:3551 msgid "" "Raises an :ref:`auditing event ` ``os.utime`` with arguments " "``path``, ``times``, ``ns``, ``dir_fd``." msgstr "" -#: library/os.rst:3479 +#: library/os.rst:3553 msgid "" "Added support for specifying *path* as an open file descriptor, and the " "*dir_fd*, *follow_symlinks*, and *ns* parameters." msgstr "" -#: library/os.rst:3493 +#: library/os.rst:3567 msgid "" "Generate the file names in a directory tree by walking the tree either top-" "down or bottom-up. For each directory in the tree rooted at directory *top* " @@ -3768,7 +3841,7 @@ msgid "" "filenames)``." msgstr "" -#: library/os.rst:3498 +#: library/os.rst:3572 msgid "" "*dirpath* is a string, the path to the directory. *dirnames* is a list of " "the names of the subdirectories in *dirpath* (including symlinks to " @@ -3782,7 +3855,7 @@ msgid "" "unspecified." msgstr "" -#: library/os.rst:3509 +#: library/os.rst:3583 msgid "" "If optional argument *topdown* is ``True`` or not specified, the triple for " "a directory is generated before the triples for any of its subdirectories " @@ -3793,7 +3866,7 @@ msgid "" "its subdirectories are generated." msgstr "" -#: library/os.rst:3517 +#: library/os.rst:3591 msgid "" "When *topdown* is ``True``, the caller can modify the *dirnames* list in-" "place (perhaps using :keyword:`del` or slice assignment), and :func:`walk` " @@ -3806,7 +3879,7 @@ msgid "" "itself is generated." msgstr "" -#: library/os.rst:3526 +#: library/os.rst:3600 msgid "" "By default, errors from the :func:`scandir` call are ignored. If optional " "argument *onerror* is specified, it should be a function; it will be called " @@ -3816,35 +3889,35 @@ msgid "" "object." msgstr "" -#: library/os.rst:3532 +#: library/os.rst:3606 msgid "" "By default, :func:`walk` will not walk down into symbolic links that resolve " "to directories. Set *followlinks* to ``True`` to visit directories pointed " "to by symlinks, on systems that support them." msgstr "" -#: library/os.rst:3538 +#: library/os.rst:3612 msgid "" "Be aware that setting *followlinks* to ``True`` can lead to infinite " "recursion if a link points to a parent directory of itself. :func:`walk` " "does not keep track of the directories it visited already." msgstr "" -#: library/os.rst:3544 +#: library/os.rst:3618 msgid "" "If you pass a relative pathname, don't change the current working directory " "between resumptions of :func:`walk`. :func:`walk` never changes the current " "directory, and assumes that its caller doesn't either." msgstr "" -#: library/os.rst:3610 +#: library/os.rst:3684 msgid "" "This example displays the number of bytes taken by non-directory files in " "each directory under the starting directory, except that it doesn't look " "under any ``__pycache__`` subdirectory::" msgstr "" -#: library/os.rst:3552 +#: library/os.rst:3626 msgid "" "import os\n" "from os.path import join, getsize\n" @@ -3856,14 +3929,14 @@ msgid "" " dirs.remove('__pycache__') # don't visit __pycache__ directories" msgstr "" -#: library/os.rst:3561 +#: library/os.rst:3635 msgid "" "In the next example (simple implementation of :func:`shutil.rmtree`), " "walking the tree bottom-up is essential, :func:`rmdir` doesn't allow " "deleting a directory before the directory is empty::" msgstr "" -#: library/os.rst:3565 +#: library/os.rst:3639 msgid "" "# Delete everything reachable from the directory named in \"top\",\n" "# assuming there are no symbolic links.\n" @@ -3878,31 +3951,31 @@ msgid "" "os.rmdir(top)" msgstr "" -#: library/os.rst:3577 +#: library/os.rst:3651 msgid "" "Raises an :ref:`auditing event ` ``os.walk`` with arguments " "``top``, ``topdown``, ``onerror``, ``followlinks``." msgstr "" -#: library/os.rst:3579 +#: library/os.rst:3653 msgid "" "This function now calls :func:`os.scandir` instead of :func:`os.listdir`, " "making it faster by reducing the number of calls to :func:`os.stat`." msgstr "" -#: library/os.rst:3593 +#: library/os.rst:3667 msgid "" "This behaves exactly like :func:`walk`, except that it yields a 4-tuple " "``(dirpath, dirnames, filenames, dirfd)``, and it supports ``dir_fd``." msgstr "" -#: library/os.rst:3596 +#: library/os.rst:3670 msgid "" "*dirpath*, *dirnames* and *filenames* are identical to :func:`walk` output, " "and *dirfd* is a file descriptor referring to the directory *dirpath*." msgstr "" -#: library/os.rst:3599 +#: library/os.rst:3673 msgid "" "This function always supports :ref:`paths relative to directory descriptors " "` and :ref:`not following symlinks `. Note however " @@ -3910,14 +3983,14 @@ msgid "" "*follow_symlinks* is ``False``." msgstr "" -#: library/os.rst:3606 +#: library/os.rst:3680 msgid "" "Since :func:`fwalk` yields file descriptors, those are only valid until the " "next iteration step, so you should duplicate them (e.g. with :func:`dup`) if " "you want to keep them longer." msgstr "" -#: library/os.rst:3614 +#: library/os.rst:3688 msgid "" "import os\n" "for root, dirs, files, rootfd in os.fwalk('python/Lib/xml'):\n" @@ -3929,13 +4002,13 @@ msgid "" " dirs.remove('__pycache__') # don't visit __pycache__ directories" msgstr "" -#: library/os.rst:3623 +#: library/os.rst:3697 msgid "" "In the next example, walking the tree bottom-up is essential: :func:`rmdir` " "doesn't allow deleting a directory before the directory is empty::" msgstr "" -#: library/os.rst:3627 +#: library/os.rst:3701 msgid "" "# Delete everything reachable from the directory named in \"top\",\n" "# assuming there are no symbolic links.\n" @@ -3949,17 +4022,17 @@ msgid "" " os.rmdir(name, dir_fd=rootfd)" msgstr "" -#: library/os.rst:3638 +#: library/os.rst:3712 msgid "" "Raises an :ref:`auditing event ` ``os.fwalk`` with arguments " "``top``, ``topdown``, ``onerror``, ``follow_symlinks``, ``dir_fd``." msgstr "" -#: library/os.rst:3647 +#: library/os.rst:3721 msgid "Added support for :class:`bytes` paths." msgstr "" -#: library/os.rst:3653 +#: library/os.rst:3727 msgid "" "Create an anonymous file and return a file descriptor that refers to it. " "*flags* must be one of the ``os.MFD_*`` constants available on the system " @@ -3967,7 +4040,7 @@ msgid "" "descriptor is :ref:`non-inheritable `." msgstr "" -#: library/os.rst:3658 +#: library/os.rst:3732 msgid "" "The name supplied in *name* is used as a filename and will be displayed as " "the target of the corresponding symbolic link in the directory ``/proc/self/" @@ -3977,15 +4050,15 @@ msgid "" "side effects." msgstr "" -#: library/os.rst:3688 +#: library/os.rst:3762 msgid "These flags can be passed to :func:`memfd_create`." msgstr "" -#: library/os.rst:3692 +#: library/os.rst:3766 msgid "The ``MFD_HUGE*`` flags are only available since Linux 4.14." msgstr "" -#: library/os.rst:3699 +#: library/os.rst:3773 msgid "" "Create and return an event file descriptor. The file descriptors supports " "raw :func:`read` and :func:`write` with a buffer size of 8, :func:`~select." @@ -3994,7 +4067,7 @@ msgid "" "ref:`non-inheritable `." msgstr "" -#: library/os.rst:3705 +#: library/os.rst:3779 msgid "" "*initval* is the initial value of the event counter. The initial value must " "be a 32 bit unsigned integer. Please note that the initial value is limited " @@ -4002,39 +4075,39 @@ msgid "" "integer with a maximum value of 2\\ :sup:`64`\\ -\\ 2." msgstr "" -#: library/os.rst:3710 +#: library/os.rst:3784 msgid "" "*flags* can be constructed from :const:`EFD_CLOEXEC`, :const:`EFD_NONBLOCK`, " "and :const:`EFD_SEMAPHORE`." msgstr "" -#: library/os.rst:3713 +#: library/os.rst:3787 msgid "" "If :const:`EFD_SEMAPHORE` is specified and the event counter is non-zero, :" "func:`eventfd_read` returns 1 and decrements the counter by one." msgstr "" -#: library/os.rst:3716 +#: library/os.rst:3790 msgid "" "If :const:`EFD_SEMAPHORE` is not specified and the event counter is non-" "zero, :func:`eventfd_read` returns the current event counter value and " "resets the counter to zero." msgstr "" -#: library/os.rst:3720 +#: library/os.rst:3794 msgid "" "If the event counter is zero and :const:`EFD_NONBLOCK` is not specified, :" "func:`eventfd_read` blocks." msgstr "" -#: library/os.rst:3723 +#: library/os.rst:3797 msgid "" ":func:`eventfd_write` increments the event counter. Write blocks if the " "write operation would increment the counter to a value larger than 2\\ :sup:" "`64`\\ -\\ 2." msgstr "" -#: library/os.rst:3729 +#: library/os.rst:3803 msgid "" "import os\n" "\n" @@ -4052,42 +4125,322 @@ msgid "" " os.close(fd)" msgstr "" -#: library/os.rst:3750 +#: library/os.rst:3824 msgid "" "Read value from an :func:`eventfd` file descriptor and return a 64 bit " "unsigned int. The function does not verify that *fd* is an :func:`eventfd`." msgstr "" -#: library/os.rst:3759 +#: library/os.rst:3833 msgid "" "Add value to an :func:`eventfd` file descriptor. *value* must be a 64 bit " "unsigned int. The function does not verify that *fd* is an :func:`eventfd`." msgstr "" -#: library/os.rst:3768 +#: library/os.rst:3842 msgid "Set close-on-exec flag for new :func:`eventfd` file descriptor." msgstr "" -#: library/os.rst:3776 +#: library/os.rst:3850 msgid "" "Set :const:`O_NONBLOCK` status flag for new :func:`eventfd` file descriptor." msgstr "" -#: library/os.rst:3785 +#: library/os.rst:3859 msgid "" "Provide semaphore-like semantics for reads from an :func:`eventfd` file " "descriptor. On read the internal counter is decremented by one." msgstr "" -#: library/os.rst:3794 +#: library/os.rst:3870 +msgid "Timer File Descriptors" +msgstr "" + +#: library/os.rst:3874 +msgid "" +"These functions provide support for Linux's *timer file descriptor* API. " +"Naturally, they are all only available on Linux." +msgstr "" + +#: library/os.rst:3879 +msgid "Create and return a timer file descriptor (*timerfd*)." +msgstr "" + +#: library/os.rst:3881 +msgid "The file descriptor returned by :func:`timerfd_create` supports:" +msgstr "" + +#: library/os.rst:3883 +msgid ":func:`read`" +msgstr "" + +#: library/os.rst:3884 +msgid ":func:`~select.select`" +msgstr "" + +#: library/os.rst:3885 +msgid ":func:`~select.poll`" +msgstr "" + +#: library/os.rst:3887 +msgid "" +"The file descriptor's :func:`read` method can be called with a buffer size " +"of 8. If the timer has already expired one or more times, :func:`read` " +"returns the number of expirations with the host's endianness, which may be " +"converted to an :class:`int` by ``int.from_bytes(x, byteorder=sys." +"byteorder)``." +msgstr "" + +#: library/os.rst:3892 +msgid "" +":func:`~select.select` and :func:`~select.poll` can be used to wait until " +"timer expires and the file descriptor is readable." +msgstr "" + +#: library/os.rst:3895 +msgid "" +"*clockid* must be a valid :ref:`clock ID `, as " +"defined in the :py:mod:`time` module:" +msgstr "" + +#: library/os.rst:3898 +msgid ":const:`time.CLOCK_REALTIME`" +msgstr "" + +#: library/os.rst:3899 +msgid ":const:`time.CLOCK_MONOTONIC`" +msgstr "" + +#: library/os.rst:3900 +msgid ":const:`time.CLOCK_BOOTTIME` (Since Linux 3.15 for timerfd_create)" +msgstr "" + +#: library/os.rst:3902 +msgid "" +"If *clockid* is :const:`time.CLOCK_REALTIME`, a settable system-wide real-" +"time clock is used. If system clock is changed, timer setting need to be " +"updated. To cancel timer when system clock is changed, see :const:" +"`TFD_TIMER_CANCEL_ON_SET`." +msgstr "" + +#: library/os.rst:3907 +msgid "" +"If *clockid* is :const:`time.CLOCK_MONOTONIC`, a non-settable monotonically " +"increasing clock is used. Even if the system clock is changed, the timer " +"setting will not be affected." +msgstr "" + +#: library/os.rst:3911 +msgid "" +"If *clockid* is :const:`time.CLOCK_BOOTTIME`, same as :const:`time." +"CLOCK_MONOTONIC` except it includes any time that the system is suspended." +msgstr "" + +#: library/os.rst:3914 +msgid "" +"The file descriptor's behaviour can be modified by specifying a *flags* " +"value. Any of the following variables may used, combined using bitwise OR " +"(the ``|`` operator):" +msgstr "" + +#: library/os.rst:3918 +msgid ":const:`TFD_NONBLOCK`" +msgstr "" + +#: library/os.rst:3919 +msgid ":const:`TFD_CLOEXEC`" +msgstr "" + +#: library/os.rst:3921 +msgid "" +"If :const:`TFD_NONBLOCK` is not set as a flag, :func:`read` blocks until the " +"timer expires. If it is set as a flag, :func:`read` doesn't block, but If " +"there hasn't been an expiration since the last call to read, :func:`read` " +"raises :class:`OSError` with ``errno`` is set to :const:`errno.EAGAIN`." +msgstr "" + +#: library/os.rst:3927 +msgid ":const:`TFD_CLOEXEC` is always set by Python automatically." +msgstr "" + +#: library/os.rst:3929 +msgid "" +"The file descriptor must be closed with :func:`os.close` when it is no " +"longer needed, or else the file descriptor will be leaked." +msgstr "" + +#: library/os.rst:3932 +msgid "The :manpage:`timerfd_create(2)` man page." +msgstr "" + +#: library/os.rst:3941 +msgid "" +"Alter a timer file descriptor's internal timer. This function operates the " +"same interval timer as :func:`timerfd_settime_ns`." +msgstr "" + +#: library/os.rst:3944 +msgid "*fd* must be a valid timer file descriptor." +msgstr "" + +#: library/os.rst:3946 +msgid "" +"The timer's behaviour can be modified by specifying a *flags* value. Any of " +"the following variables may used, combined using bitwise OR (the ``|`` " +"operator):" +msgstr "" + +#: library/os.rst:3950 +msgid ":const:`TFD_TIMER_ABSTIME`" +msgstr "" + +#: library/os.rst:3951 +msgid ":const:`TFD_TIMER_CANCEL_ON_SET`" +msgstr "" + +#: library/os.rst:3953 +msgid "" +"The timer is disabled by setting *initial* to zero (``0``). If *initial* is " +"equal to or greater than zero, the timer is enabled. If *initial* is less " +"than zero, it raises an :class:`OSError` exception with ``errno`` set to :" +"const:`errno.EINVAL`" +msgstr "" + +#: library/os.rst:3958 +msgid "" +"By default the timer will fire when *initial* seconds have elapsed. (If " +"*initial* is zero, timer will fire immediately.)" +msgstr "" + +#: library/os.rst:3961 +msgid "" +"However, if the :const:`TFD_TIMER_ABSTIME` flag is set, the timer will fire " +"when the timer's clock (set by *clockid* in :func:`timerfd_create`) reaches " +"*initial* seconds." +msgstr "" + +#: library/os.rst:3965 +msgid "" +"The timer's interval is set by the *interval* :py:class:`float`. If " +"*interval* is zero, the timer only fires once, on the initial expiration. If " +"*interval* is greater than zero, the timer fires every time *interval* " +"seconds have elapsed since the previous expiration. If *interval* is less " +"than zero, it raises :class:`OSError` with ``errno`` set to :const:`errno." +"EINVAL`" +msgstr "" + +#: library/os.rst:3972 +msgid "" +"If the :const:`TFD_TIMER_CANCEL_ON_SET` flag is set along with :const:" +"`TFD_TIMER_ABSTIME` and the clock for this timer is :const:`time." +"CLOCK_REALTIME`, the timer is marked as cancelable if the real-time clock is " +"changed discontinuously. Reading the descriptor is aborted with the error " +"ECANCELED." +msgstr "" + +#: library/os.rst:3978 +msgid "" +"Linux manages system clock as UTC. A daylight-savings time transition is " +"done by changing time offset only and doesn't cause discontinuous system " +"clock change." +msgstr "" + +#: library/os.rst:3982 +msgid "" +"Discontinuous system clock change will be caused by the following events:" +msgstr "" + +#: library/os.rst:3984 +msgid "``settimeofday``" +msgstr "" + +#: library/os.rst:3985 +msgid "``clock_settime``" +msgstr "" + +#: library/os.rst:3986 +msgid "set the system date and time by ``date`` command" +msgstr "" + +#: library/os.rst:3988 +msgid "" +"Return a two-item tuple of (``next_expiration``, ``interval``) from the " +"previous timer state, before this function executed." +msgstr "" + +#: library/os.rst:3993 +msgid "" +":manpage:`timerfd_create(2)`, :manpage:`timerfd_settime(2)`, :manpage:" +"`settimeofday(2)`, :manpage:`clock_settime(2)`, and :manpage:`date(1)`." +msgstr "" + +#: library/os.rst:4004 +msgid "" +"Similar to :func:`timerfd_settime`, but use time as nanoseconds. This " +"function operates the same interval timer as :func:`timerfd_settime`." +msgstr "" + +#: library/os.rst:4014 +msgid "Return a two-item tuple of floats (``next_expiration``, ``interval``)." +msgstr "" + +#: library/os.rst:4016 +msgid "" +"``next_expiration`` denotes the relative time until next the timer next " +"fires, regardless of if the :const:`TFD_TIMER_ABSTIME` flag is set." +msgstr "" + +#: library/os.rst:4019 +msgid "" +"``interval`` denotes the timer's interval. If zero, the timer will only fire " +"once, after ``next_expiration`` seconds have elapsed." +msgstr "" + +#: library/os.rst:4023 +msgid ":manpage:`timerfd_gettime(2)`" +msgstr "" + +#: library/os.rst:4032 +msgid "Similar to :func:`timerfd_gettime`, but return time as nanoseconds." +msgstr "" + +#: library/os.rst:4040 +msgid "" +"A flag for the :func:`timerfd_create` function, which sets the :const:" +"`O_NONBLOCK` status flag for the new timer file descriptor. If :const:" +"`TFD_NONBLOCK` is not set as a flag, :func:`read` blocks." +msgstr "" + +#: library/os.rst:4050 +msgid "" +"A flag for the :func:`timerfd_create` function, If :const:`TFD_CLOEXEC` is " +"set as a flag, set close-on-exec flag for new file descriptor." +msgstr "" + +#: library/os.rst:4060 +msgid "" +"A flag for the :func:`timerfd_settime` and :func:`timerfd_settime_ns` " +"functions. If this flag is set, *initial* is interpreted as an absolute " +"value on the timer's clock (in UTC seconds or nanoseconds since the Unix " +"Epoch)." +msgstr "" + +#: library/os.rst:4070 +msgid "" +"A flag for the :func:`timerfd_settime` and :func:`timerfd_settime_ns` " +"functions along with :const:`TFD_TIMER_ABSTIME`. The timer is cancelled when " +"the time of the underlying clock changes discontinuously." +msgstr "" + +#: library/os.rst:4081 msgid "Linux extended attributes" msgstr "" -#: library/os.rst:3798 +#: library/os.rst:4085 msgid "These functions are all available on Linux only." msgstr "" -#: library/os.rst:3802 +#: library/os.rst:4089 msgid "" "Return the value of the extended filesystem attribute *attribute* for " "*path*. *attribute* can be bytes or str (directly or indirectly through the :" @@ -4095,17 +4448,17 @@ msgid "" "encoding." msgstr "" -#: library/os.rst:3810 +#: library/os.rst:4097 msgid "" "Raises an :ref:`auditing event ` ``os.getxattr`` with arguments " "``path``, ``attribute``." msgstr "" -#: library/os.rst:3844 library/os.rst:3869 +#: library/os.rst:4131 library/os.rst:4156 msgid "Accepts a :term:`path-like object` for *path* and *attribute*." msgstr "" -#: library/os.rst:3818 +#: library/os.rst:4105 msgid "" "Return a list of the extended filesystem attributes on *path*. The " "attributes in the list are represented as strings decoded with the " @@ -4113,13 +4466,13 @@ msgid "" "the current directory." msgstr "" -#: library/os.rst:3826 +#: library/os.rst:4113 msgid "" "Raises an :ref:`auditing event ` ``os.listxattr`` with argument " "``path``." msgstr "" -#: library/os.rst:3834 +#: library/os.rst:4121 msgid "" "Removes the extended filesystem attribute *attribute* from *path*. " "*attribute* should be bytes or str (directly or indirectly through the :" @@ -4127,13 +4480,13 @@ msgid "" "`filesystem encoding and error handler`." msgstr "" -#: library/os.rst:3842 +#: library/os.rst:4129 msgid "" "Raises an :ref:`auditing event ` ``os.removexattr`` with arguments " "``path``, ``attribute``." msgstr "" -#: library/os.rst:3850 +#: library/os.rst:4137 msgid "" "Set the extended filesystem attribute *attribute* on *path* to *value*. " "*attribute* must be a bytes or str with no embedded NULs (directly or " @@ -4145,45 +4498,45 @@ msgid "" "will not be created and ``EEXISTS`` will be raised." msgstr "" -#: library/os.rst:3864 +#: library/os.rst:4151 msgid "" "A bug in Linux kernel versions less than 2.6.39 caused the flags argument to " "be ignored on some filesystems." msgstr "" -#: library/os.rst:3867 +#: library/os.rst:4154 msgid "" "Raises an :ref:`auditing event ` ``os.setxattr`` with arguments " "``path``, ``attribute``, ``value``, ``flags``." msgstr "" -#: library/os.rst:3875 +#: library/os.rst:4162 msgid "" "The maximum size the value of an extended attribute can be. Currently, this " "is 64 KiB on Linux." msgstr "" -#: library/os.rst:3881 +#: library/os.rst:4168 msgid "" "This is a possible value for the flags argument in :func:`setxattr`. It " "indicates the operation must create an attribute." msgstr "" -#: library/os.rst:3887 +#: library/os.rst:4174 msgid "" "This is a possible value for the flags argument in :func:`setxattr`. It " "indicates the operation must replace an existing attribute." msgstr "" -#: library/os.rst:3894 +#: library/os.rst:4181 msgid "Process Management" msgstr "" -#: library/os.rst:3896 +#: library/os.rst:4183 msgid "These functions may be used to create and manage processes." msgstr "" -#: library/os.rst:3898 +#: library/os.rst:4185 msgid "" "The various :func:`exec\\* ` functions take a list of arguments for " "the new program loaded into the process. In each case, the first of these " @@ -4194,7 +4547,7 @@ msgid "" "standard output; ``foo`` will seem to be ignored." msgstr "" -#: library/os.rst:3909 +#: library/os.rst:4196 msgid "" "Generate a :const:`SIGABRT` signal to the current process. On Unix, the " "default behavior is to produce a core dump; on Windows, the process " @@ -4203,37 +4556,37 @@ msgid "" "`SIGABRT` with :func:`signal.signal`." msgstr "" -#: library/os.rst:3918 +#: library/os.rst:4205 msgid "Add a path to the DLL search path." msgstr "" -#: library/os.rst:3920 +#: library/os.rst:4207 msgid "" "This search path is used when resolving dependencies for imported extension " "modules (the module itself is resolved through :data:`sys.path`), and also " "by :mod:`ctypes`." msgstr "" -#: library/os.rst:3924 +#: library/os.rst:4211 msgid "" "Remove the directory by calling **close()** on the returned object or using " "it in a :keyword:`with` statement." msgstr "" -#: library/os.rst:3927 +#: library/os.rst:4214 msgid "" "See the `Microsoft documentation `_ for more information about how " "DLLs are loaded." msgstr "" -#: library/os.rst:3931 +#: library/os.rst:4218 msgid "" "Raises an :ref:`auditing event ` ``os.add_dll_directory`` with " "argument ``path``." msgstr "" -#: library/os.rst:3935 +#: library/os.rst:4222 msgid "" "Previous versions of CPython would resolve DLLs using the default behavior " "for the current process. This led to inconsistencies, such as only sometimes " @@ -4241,14 +4594,14 @@ msgid "" "such as ``AddDllDirectory`` having no effect." msgstr "" -#: library/os.rst:3942 +#: library/os.rst:4229 msgid "" "In 3.8, the two primary ways DLLs are loaded now explicitly override the " "process-wide behavior to ensure consistency. See the :ref:`porting notes " "` for information on updating libraries." msgstr "" -#: library/os.rst:3957 +#: library/os.rst:4244 msgid "" "These functions all execute a new program, replacing the current process; " "they do not return. On Unix, the new executable is loaded into the current " @@ -4256,7 +4609,7 @@ msgid "" "reported as :exc:`OSError` exceptions." msgstr "" -#: library/os.rst:3962 +#: library/os.rst:4249 msgid "" "The current process is replaced immediately. Open file objects and " "descriptors are not flushed, so if there may be data buffered on these open " @@ -4264,7 +4617,7 @@ msgid "" "fsync` before calling an :func:`exec\\* ` function." msgstr "" -#: library/os.rst:3968 +#: library/os.rst:4255 msgid "" "The \"l\" and \"v\" variants of the :func:`exec\\* ` functions differ " "in how command-line arguments are passed. The \"l\" variants are perhaps " @@ -4277,7 +4630,7 @@ msgid "" "is not enforced." msgstr "" -#: library/os.rst:3977 +#: library/os.rst:4264 msgid "" "The variants which include a \"p\" near the end (:func:`execlp`, :func:" "`execlpe`, :func:`execvp`, and :func:`execvpe`) will use the :envvar:`PATH` " @@ -4291,7 +4644,7 @@ msgid "" "even on Windows, as plain names will not be resolved." msgstr "" -#: library/os.rst:3988 +#: library/os.rst:4275 msgid "" "For :func:`execle`, :func:`execlpe`, :func:`execve`, and :func:`execvpe` " "(note that these all end in \"e\"), the *env* parameter must be a mapping " @@ -4301,7 +4654,7 @@ msgid "" "process to inherit the environment of the current process." msgstr "" -#: library/os.rst:3995 +#: library/os.rst:4282 msgid "" "For :func:`execve` on some platforms, *path* may also be specified as an " "open file descriptor. This functionality may not be supported on your " @@ -4310,31 +4663,31 @@ msgid "" "`NotImplementedError`." msgstr "" -#: library/os.rst:4000 +#: library/os.rst:4287 msgid "" "Raises an :ref:`auditing event ` ``os.exec`` with arguments " "``path``, ``args``, ``env``." msgstr "" -#: library/os.rst:4004 +#: library/os.rst:4291 msgid "" "Added support for specifying *path* as an open file descriptor for :func:" "`execve`." msgstr "" -#: library/os.rst:4013 +#: library/os.rst:4300 msgid "" "Exit the process with status *n*, without calling cleanup handlers, flushing " "stdio buffers, etc." msgstr "" -#: library/os.rst:4018 +#: library/os.rst:4305 msgid "" "The standard way to exit is :func:`sys.exit(n) `. :func:`!_exit` " "should normally only be used in the child process after a :func:`fork`." msgstr "" -#: library/os.rst:4021 +#: library/os.rst:4308 msgid "" "The following exit codes are defined and can be used with :func:`_exit`, " "although they are not required. These are typically used for system " @@ -4342,139 +4695,139 @@ msgid "" "delivery program." msgstr "" -#: library/os.rst:4027 +#: library/os.rst:4314 msgid "" "Some of these may not be available on all Unix platforms, since there is " "some variation. These constants are defined where they are defined by the " "underlying platform." msgstr "" -#: library/os.rst:4034 +#: library/os.rst:4321 msgid "" "Exit code that means no error occurred. May be taken from the defined value " "of ``EXIT_SUCCESS`` on some platforms. Generally has a value of zero." msgstr "" -#: library/os.rst:4042 +#: library/os.rst:4329 msgid "" "Exit code that means the command was used incorrectly, such as when the " "wrong number of arguments are given." msgstr "" -#: library/os.rst:4050 +#: library/os.rst:4337 msgid "Exit code that means the input data was incorrect." msgstr "" -#: library/os.rst:4057 +#: library/os.rst:4344 msgid "Exit code that means an input file did not exist or was not readable." msgstr "" -#: library/os.rst:4064 +#: library/os.rst:4351 msgid "Exit code that means a specified user did not exist." msgstr "" -#: library/os.rst:4071 +#: library/os.rst:4358 msgid "Exit code that means a specified host did not exist." msgstr "" -#: library/os.rst:4078 +#: library/os.rst:4365 msgid "Exit code that means that a required service is unavailable." msgstr "" -#: library/os.rst:4085 +#: library/os.rst:4372 msgid "Exit code that means an internal software error was detected." msgstr "" -#: library/os.rst:4092 +#: library/os.rst:4379 msgid "" "Exit code that means an operating system error was detected, such as the " "inability to fork or create a pipe." msgstr "" -#: library/os.rst:4100 +#: library/os.rst:4387 msgid "" "Exit code that means some system file did not exist, could not be opened, or " "had some other kind of error." msgstr "" -#: library/os.rst:4108 +#: library/os.rst:4395 msgid "Exit code that means a user specified output file could not be created." msgstr "" -#: library/os.rst:4115 +#: library/os.rst:4402 msgid "" "Exit code that means that an error occurred while doing I/O on some file." msgstr "" -#: library/os.rst:4122 +#: library/os.rst:4409 msgid "" "Exit code that means a temporary failure occurred. This indicates something " "that may not really be an error, such as a network connection that couldn't " "be made during a retryable operation." msgstr "" -#: library/os.rst:4131 +#: library/os.rst:4418 msgid "" "Exit code that means that a protocol exchange was illegal, invalid, or not " "understood." msgstr "" -#: library/os.rst:4139 +#: library/os.rst:4426 msgid "" "Exit code that means that there were insufficient permissions to perform the " "operation (but not intended for file system problems)." msgstr "" -#: library/os.rst:4147 +#: library/os.rst:4434 msgid "Exit code that means that some kind of configuration error occurred." msgstr "" -#: library/os.rst:4154 +#: library/os.rst:4441 msgid "Exit code that means something like \"an entry was not found\"." msgstr "" -#: library/os.rst:4161 +#: library/os.rst:4448 msgid "" "Fork a child process. Return ``0`` in the child and the child's process id " "in the parent. If an error occurs :exc:`OSError` is raised." msgstr "" -#: library/os.rst:4164 +#: library/os.rst:4451 msgid "" "Note that some platforms including FreeBSD <= 6.3 and Cygwin have known " "issues when using ``fork()`` from a thread." msgstr "" -#: library/os.rst:4167 +#: library/os.rst:4454 msgid "" "Raises an :ref:`auditing event ` ``os.fork`` with no arguments." msgstr "" -#: library/os.rst:4171 +#: library/os.rst:4458 msgid "" "If you use TLS sockets in an application calling ``fork()``, see the warning " "in the :mod:`ssl` documentation." msgstr "" -#: library/os.rst:4220 +#: library/os.rst:4507 msgid "" "On macOS the use of this function is unsafe when mixed with using higher-" "level system APIs, and that includes using :mod:`urllib.request`." msgstr "" -#: library/os.rst:4179 +#: library/os.rst:4466 msgid "" "Calling ``fork()`` in a subinterpreter is no longer supported (:exc:" "`RuntimeError` is raised)." msgstr "" -#: library/os.rst:4183 +#: library/os.rst:4470 msgid "" "If Python is able to detect that your process has multiple threads, :func:" "`os.fork` now raises a :exc:`DeprecationWarning`." msgstr "" -#: library/os.rst:4187 +#: library/os.rst:4474 msgid "" "We chose to surface this as a warning, when detectable, to better inform " "developers of a design problem that the POSIX platform specifically notes as " @@ -4485,21 +4838,21 @@ msgid "" "``free``)." msgstr "" -#: library/os.rst:4196 +#: library/os.rst:4483 msgid "" "Users of macOS or users of libc or malloc implementations other than those " "typically found in glibc to date are among those already more likely to " "experience deadlocks running such code." msgstr "" -#: library/os.rst:4200 +#: library/os.rst:4487 msgid "" "See `this discussion on fork being incompatible with threads `_ for technical details of why we're surfacing " "this longstanding platform compatibility problem to developers." msgstr "" -#: library/os.rst:4210 +#: library/os.rst:4497 msgid "" "Fork a child process, using a new pseudo-terminal as the child's controlling " "terminal. Return a pair of ``(pid, fd)``, where *pid* is ``0`` in the child, " @@ -4508,31 +4861,31 @@ msgid "" "the :mod:`pty` module. If an error occurs :exc:`OSError` is raised." msgstr "" -#: library/os.rst:4216 +#: library/os.rst:4503 msgid "" "Raises an :ref:`auditing event ` ``os.forkpty`` with no arguments." msgstr "" -#: library/os.rst:4223 +#: library/os.rst:4510 msgid "" "Calling ``forkpty()`` in a subinterpreter is no longer supported (:exc:" "`RuntimeError` is raised)." msgstr "" -#: library/os.rst:4227 +#: library/os.rst:4514 msgid "" "If Python is able to detect that your process has multiple threads, this now " "raises a :exc:`DeprecationWarning`. See the longer explanation on :func:`os." "fork`." msgstr "" -#: library/os.rst:4241 +#: library/os.rst:4528 msgid "" "Send signal *sig* to the process *pid*. Constants for the specific signals " "available on the host platform are defined in the :mod:`signal` module." msgstr "" -#: library/os.rst:4244 +#: library/os.rst:4531 msgid "" "Windows: The :const:`signal.CTRL_C_EVENT` and :const:`signal." "CTRL_BREAK_EVENT` signals are special signals which can only be sent to " @@ -4542,43 +4895,43 @@ msgid "" "be set to *sig*." msgstr "" -#: library/os.rst:4251 +#: library/os.rst:4538 msgid "See also :func:`signal.pthread_kill`." msgstr "" -#: library/os.rst:4253 +#: library/os.rst:4540 msgid "" "Raises an :ref:`auditing event ` ``os.kill`` with arguments " "``pid``, ``sig``." msgstr "" -#: library/os.rst:4267 +#: library/os.rst:4554 msgid "Send the signal *sig* to the process group *pgid*." msgstr "" -#: library/os.rst:4269 +#: library/os.rst:4556 msgid "" "Raises an :ref:`auditing event ` ``os.killpg`` with arguments " "``pgid``, ``sig``." msgstr "" -#: library/os.rst:4276 +#: library/os.rst:4563 msgid "" "Add *increment* to the process's \"niceness\". Return the new niceness." msgstr "" -#: library/os.rst:4283 +#: library/os.rst:4570 msgid "" "Return a file descriptor referring to the process *pid* with *flags* set. " "This descriptor can be used to perform process management without races and " "signals." msgstr "" -#: library/os.rst:4287 +#: library/os.rst:4574 msgid "See the :manpage:`pidfd_open(2)` man page for more details." msgstr "" -#: library/os.rst:4294 +#: library/os.rst:4581 msgid "" "This flag indicates that the file descriptor will be non-blocking. If the " "process referred to by the file descriptor has not yet terminated, then an " @@ -4586,13 +4939,13 @@ msgid "" "immediately return the error :const:`~errno.EAGAIN` rather than blocking." msgstr "" -#: library/os.rst:4305 +#: library/os.rst:4592 msgid "" "Lock program segments into memory. The value of *op* (defined in ````) determines which segments are locked." msgstr "" -#: library/os.rst:4313 +#: library/os.rst:4600 msgid "" "Open a pipe to or from command *cmd*. The return value is an open file " "object connected to the pipe, which can be read or written depending on " @@ -4602,7 +4955,7 @@ msgid "" "rather than bytes." msgstr "" -#: library/os.rst:4321 +#: library/os.rst:4608 msgid "" "The ``close`` method returns :const:`None` if the subprocess exited " "successfully, or the subprocess's return code if there was an error. On " @@ -4614,56 +4967,57 @@ msgid "" "contains the signed integer return code from the child process." msgstr "" -#: library/os.rst:4331 +#: library/os.rst:4618 msgid "" "On Unix, :func:`waitstatus_to_exitcode` can be used to convert the ``close`` " "method result (exit status) into an exit code if it is not ``None``. On " "Windows, the ``close`` method result is directly the exit code (or ``None``)." msgstr "" -#: library/os.rst:4336 +#: library/os.rst:4623 msgid "" "This is implemented using :class:`subprocess.Popen`; see that class's " "documentation for more powerful ways to manage and communicate with " "subprocesses." msgstr "" -#: library/os.rst:4343 +#: library/os.rst:4630 msgid "" "The :ref:`Python UTF-8 Mode ` affects encodings used for *cmd* " "and pipe contents." msgstr "" -#: library/os.rst:4346 +#: library/os.rst:4633 msgid "" ":func:`popen` is a simple wrapper around :class:`subprocess.Popen`. Use :" "class:`subprocess.Popen` or :func:`subprocess.run` to control options like " "encodings." msgstr "" -#: library/os.rst:4355 +#: library/os.rst:4642 msgid "Wraps the :c:func:`!posix_spawn` C library API for use from Python." msgstr "" -#: library/os.rst:4357 +#: library/os.rst:4644 msgid "" "Most users should use :func:`subprocess.run` instead of :func:`posix_spawn`." msgstr "" -#: library/os.rst:4359 +#: library/os.rst:4646 msgid "" "The positional-only arguments *path*, *args*, and *env* are similar to :func:" -"`execve`." +"`execve`. *env* is allowed to be ``None``, in which case current process' " +"environment is used." msgstr "" -#: library/os.rst:4362 +#: library/os.rst:4650 msgid "" "The *path* parameter is the path to the executable file. The *path* should " "contain a directory. Use :func:`posix_spawnp` to pass an executable file " "without directory." msgstr "" -#: library/os.rst:4366 +#: library/os.rst:4654 msgid "" "The *file_actions* argument may be a sequence of tuples describing actions " "to take on specific file descriptors in the child process between the C " @@ -4672,40 +5026,49 @@ msgid "" "describing the remaining tuple elements:" msgstr "" -#: library/os.rst:4374 +#: library/os.rst:4662 msgid "(``os.POSIX_SPAWN_OPEN``, *fd*, *path*, *flags*, *mode*)" msgstr "" -#: library/os.rst:4376 +#: library/os.rst:4664 msgid "Performs ``os.dup2(os.open(path, flags, mode), fd)``." msgstr "" -#: library/os.rst:4380 +#: library/os.rst:4668 msgid "(``os.POSIX_SPAWN_CLOSE``, *fd*)" msgstr "" -#: library/os.rst:4382 +#: library/os.rst:4670 msgid "Performs ``os.close(fd)``." msgstr "" -#: library/os.rst:4386 +#: library/os.rst:4674 msgid "(``os.POSIX_SPAWN_DUP2``, *fd*, *new_fd*)" msgstr "" -#: library/os.rst:4388 +#: library/os.rst:4676 msgid "Performs ``os.dup2(fd, new_fd)``." msgstr "" -#: library/os.rst:4390 +#: library/os.rst:4680 +msgid "(``os.POSIX_SPAWN_CLOSEFROM``, *fd*)" +msgstr "" + +#: library/os.rst:4682 +msgid "Performs ``os.closerange(fd, INF)``." +msgstr "" + +#: library/os.rst:4684 msgid "" "These tuples correspond to the C library :c:func:`!" "posix_spawn_file_actions_addopen`, :c:func:`!" -"posix_spawn_file_actions_addclose`, and :c:func:`!" -"posix_spawn_file_actions_adddup2` API calls used to prepare for the :c:func:" -"`!posix_spawn` call itself." +"posix_spawn_file_actions_addclose`, :c:func:`!" +"posix_spawn_file_actions_adddup2`, and :c:func:`!" +"posix_spawn_file_actions_addclosefrom_np` API calls used to prepare for the :" +"c:func:`!posix_spawn` call itself." msgstr "" -#: library/os.rst:4396 +#: library/os.rst:4691 msgid "" "The *setpgroup* argument will set the process group of the child to the " "value specified. If the value specified is 0, the child's process group ID " @@ -4714,7 +5077,7 @@ msgid "" "corresponds to the C library :c:macro:`!POSIX_SPAWN_SETPGROUP` flag." msgstr "" -#: library/os.rst:4402 +#: library/os.rst:4697 msgid "" "If the *resetids* argument is ``True`` it will reset the effective UID and " "GID of the child to the real UID and GID of the parent process. If the " @@ -4725,7 +5088,7 @@ msgid "" "library :c:macro:`!POSIX_SPAWN_RESETIDS` flag." msgstr "" -#: library/os.rst:4410 +#: library/os.rst:4705 msgid "" "If the *setsid* argument is ``True``, it will create a new session ID for " "``posix_spawn``. *setsid* requires :c:macro:`!POSIX_SPAWN_SETSID` or :c:" @@ -4733,7 +5096,7 @@ msgid "" "is raised." msgstr "" -#: library/os.rst:4415 +#: library/os.rst:4710 msgid "" "The *setsigmask* argument will set the signal mask to the signal set " "specified. If the parameter is not used, then the child inherits the " @@ -4741,14 +5104,14 @@ msgid "" "POSIX_SPAWN_SETSIGMASK` flag." msgstr "" -#: library/os.rst:4420 +#: library/os.rst:4715 msgid "" "The *sigdef* argument will reset the disposition of all signals in the set " "specified. This argument corresponds to the C library :c:macro:`!" "POSIX_SPAWN_SETSIGDEF` flag." msgstr "" -#: library/os.rst:4424 +#: library/os.rst:4719 msgid "" "The *scheduler* argument must be a tuple containing the (optional) scheduler " "policy and an instance of :class:`sched_param` with the scheduler " @@ -4758,78 +5121,85 @@ msgid "" "POSIX_SPAWN_SETSCHEDULER` flags." msgstr "" -#: library/os.rst:4447 +#: library/os.rst:4747 msgid "" "Raises an :ref:`auditing event ` ``os.posix_spawn`` with arguments " "``path``, ``argv``, ``env``." msgstr "" -#: library/os.rst:4441 +#: library/os.rst:4730 +msgid "" +"*env* parameter accepts ``None``. ``os.POSIX_SPAWN_CLOSEFROM`` is available " +"on platforms where :c:func:`!posix_spawn_file_actions_addclosefrom_np` " +"exists." +msgstr "" + +#: library/os.rst:4741 msgid "Wraps the :c:func:`!posix_spawnp` C library API for use from Python." msgstr "" -#: library/os.rst:4443 +#: library/os.rst:4743 msgid "" "Similar to :func:`posix_spawn` except that the system searches for the " "*executable* file in the list of directories specified by the :envvar:`PATH` " "environment variable (in the same way as for ``execvp(3)``)." msgstr "" -#: library/os.rst:4453 +#: library/os.rst:4753 msgid "See :func:`posix_spawn` documentation." msgstr "" -#: library/os.rst:4459 +#: library/os.rst:4759 msgid "" "Register callables to be executed when a new child process is forked using :" "func:`os.fork` or similar process cloning APIs. The parameters are optional " "and keyword-only. Each specifies a different call point." msgstr "" -#: library/os.rst:4464 +#: library/os.rst:4764 msgid "*before* is a function called before forking a child process." msgstr "" -#: library/os.rst:4465 +#: library/os.rst:4765 msgid "" "*after_in_parent* is a function called from the parent process after forking " "a child process." msgstr "" -#: library/os.rst:4467 +#: library/os.rst:4767 msgid "*after_in_child* is a function called from the child process." msgstr "" -#: library/os.rst:4469 +#: library/os.rst:4769 msgid "" "These calls are only made if control is expected to return to the Python " "interpreter. A typical :mod:`subprocess` launch will not trigger them as " "the child is not going to re-enter the interpreter." msgstr "" -#: library/os.rst:4473 +#: library/os.rst:4773 msgid "" "Functions registered for execution before forking are called in reverse " "registration order. Functions registered for execution after forking " "(either in the parent or in the child) are called in registration order." msgstr "" -#: library/os.rst:4478 +#: library/os.rst:4778 msgid "" "Note that :c:func:`fork` calls made by third-party C code may not call those " "functions, unless it explicitly calls :c:func:`PyOS_BeforeFork`, :c:func:" "`PyOS_AfterFork_Parent` and :c:func:`PyOS_AfterFork_Child`." msgstr "" -#: library/os.rst:4482 +#: library/os.rst:4782 msgid "There is no way to unregister a function." msgstr "" -#: library/os.rst:4498 +#: library/os.rst:4798 msgid "Execute the program *path* in a new process." msgstr "" -#: library/os.rst:4500 +#: library/os.rst:4800 msgid "" "(Note that the :mod:`subprocess` module provides more powerful facilities " "for spawning new processes and retrieving their results; using that module " @@ -4837,7 +5207,7 @@ msgid "" "`subprocess-replacements` section.)" msgstr "" -#: library/os.rst:4505 +#: library/os.rst:4805 msgid "" "If *mode* is :const:`P_NOWAIT`, this function returns the process id of the " "new process; if *mode* is :const:`P_WAIT`, returns the process's exit code " @@ -4846,13 +5216,13 @@ msgid "" "handle, so can be used with the :func:`waitpid` function." msgstr "" -#: library/os.rst:4511 +#: library/os.rst:4811 msgid "" "Note on VxWorks, this function doesn't return ``-signal`` when the new " "process is killed. Instead it raises OSError exception." msgstr "" -#: library/os.rst:4514 +#: library/os.rst:4814 msgid "" "The \"l\" and \"v\" variants of the :func:`spawn\\* ` functions " "differ in how command-line arguments are passed. The \"l\" variants are " @@ -4864,7 +5234,7 @@ msgid "" "to the child process must start with the name of the command being run." msgstr "" -#: library/os.rst:4523 +#: library/os.rst:4823 msgid "" "The variants which include a second \"p\" near the end (:func:`spawnlp`, :" "func:`spawnlpe`, :func:`spawnvp`, and :func:`spawnvpe`) will use the :envvar:" @@ -4877,7 +5247,7 @@ msgid "" "appropriate absolute or relative path." msgstr "" -#: library/os.rst:4533 +#: library/os.rst:4833 msgid "" "For :func:`spawnle`, :func:`spawnlpe`, :func:`spawnve`, and :func:`spawnvpe` " "(note that these all end in \"e\"), the *env* parameter must be a mapping " @@ -4889,13 +5259,13 @@ msgid "" "values will cause the function to fail, with a return value of ``127``." msgstr "" -#: library/os.rst:4542 +#: library/os.rst:4842 msgid "" "As an example, the following calls to :func:`spawnlp` and :func:`spawnvpe` " "are equivalent::" msgstr "" -#: library/os.rst:4545 +#: library/os.rst:4845 msgid "" "import os\n" "os.spawnlp(os.P_WAIT, 'cp', 'cp', 'index.html', '/dev/null')\n" @@ -4904,13 +5274,13 @@ msgid "" "os.spawnvpe(os.P_WAIT, 'cp', L, os.environ)" msgstr "" -#: library/os.rst:4551 +#: library/os.rst:4851 msgid "" "Raises an :ref:`auditing event ` ``os.spawn`` with arguments " "``mode``, ``path``, ``args``, ``env``." msgstr "" -#: library/os.rst:4555 +#: library/os.rst:4855 msgid "" ":func:`spawnlp`, :func:`spawnlpe`, :func:`spawnvp` and :func:`spawnvpe` are " "not available on Windows. :func:`spawnle` and :func:`spawnve` are not " @@ -4918,7 +5288,7 @@ msgid "" "instead." msgstr "" -#: library/os.rst:4567 +#: library/os.rst:4867 msgid "" "Possible values for the *mode* parameter to the :func:`spawn\\* ` " "family of functions. If either of these values is given, the :func:" @@ -4926,7 +5296,7 @@ msgid "" "been created, with the process id as the return value." msgstr "" -#: library/os.rst:4577 +#: library/os.rst:4877 msgid "" "Possible value for the *mode* parameter to the :func:`spawn\\* ` " "family of functions. If this is given as *mode*, the :func:`spawn\\* " @@ -4935,7 +5305,7 @@ msgid "" "successful, or ``-signal`` if a signal kills the process." msgstr "" -#: library/os.rst:4589 +#: library/os.rst:4889 msgid "" "Possible values for the *mode* parameter to the :func:`spawn\\* ` " "family of functions. These are less portable than those listed above. :" @@ -4945,11 +5315,11 @@ msgid "" "function will not return." msgstr "" -#: library/os.rst:4600 +#: library/os.rst:4900 msgid "Start a file with its associated application." msgstr "" -#: library/os.rst:4602 +#: library/os.rst:4902 msgid "" "When *operation* is not specified, this acts like double-clicking the file " "in Windows Explorer, or giving the file name as an argument to the :program:" @@ -4957,7 +5327,7 @@ msgid "" "whatever application (if any) its extension is associated." msgstr "" -#: library/os.rst:4607 +#: library/os.rst:4907 msgid "" "When another *operation* is given, it must be a \"command verb\" that " "specifies what should be done with the file. Common verbs documented by " @@ -4965,28 +5335,28 @@ msgid "" "as well as ``'explore'`` and ``'find'`` (to be used on directories)." msgstr "" -#: library/os.rst:4612 +#: library/os.rst:4912 msgid "" "When launching an application, specify *arguments* to be passed as a single " "string. This argument may have no effect when using this function to launch " "a document." msgstr "" -#: library/os.rst:4616 +#: library/os.rst:4916 msgid "" "The default working directory is inherited, but may be overridden by the " "*cwd* argument. This should be an absolute path. A relative *path* will be " "resolved against this argument." msgstr "" -#: library/os.rst:4620 +#: library/os.rst:4920 msgid "" "Use *show_cmd* to override the default window style. Whether this has any " "effect will depend on the application being launched. Values are integers as " "supported by the Win32 :c:func:`!ShellExecute` function." msgstr "" -#: library/os.rst:4624 +#: library/os.rst:4924 msgid "" ":func:`startfile` returns as soon as the associated application is launched. " "There is no option to wait for the application to close, and no way to " @@ -4997,32 +5367,32 @@ msgid "" "encoded for Win32." msgstr "" -#: library/os.rst:4632 +#: library/os.rst:4932 msgid "" "To reduce interpreter startup overhead, the Win32 :c:func:`!ShellExecute` " "function is not resolved until this function is first called. If the " "function cannot be resolved, :exc:`NotImplementedError` will be raised." msgstr "" -#: library/os.rst:4636 +#: library/os.rst:4936 msgid "" "Raises an :ref:`auditing event ` ``os.startfile`` with arguments " "``path``, ``operation``." msgstr "" -#: library/os.rst:4638 +#: library/os.rst:4938 msgid "" "Raises an :ref:`auditing event ` ``os.startfile/2`` with arguments " "``path``, ``operation``, ``arguments``, ``cwd``, ``show_cmd``." msgstr "" -#: library/os.rst:4642 +#: library/os.rst:4942 msgid "" "Added the *arguments*, *cwd* and *show_cmd* arguments, and the ``os." "startfile/2`` audit event." msgstr "" -#: library/os.rst:4649 +#: library/os.rst:4949 msgid "" "Execute the command (a string) in a subshell. This is implemented by " "calling the Standard C function :c:func:`system`, and has the same " @@ -5033,13 +5403,13 @@ msgid "" "value of the Python function is system-dependent." msgstr "" -#: library/os.rst:4657 +#: library/os.rst:4957 msgid "" "On Unix, the return value is the exit status of the process encoded in the " "format specified for :func:`wait`." msgstr "" -#: library/os.rst:4660 +#: library/os.rst:4960 msgid "" "On Windows, the return value is that returned by the system shell after " "running *command*. The shell is given by the Windows environment variable :" @@ -5048,7 +5418,7 @@ msgid "" "shell documentation." msgstr "" -#: library/os.rst:4666 +#: library/os.rst:4966 msgid "" "The :mod:`subprocess` module provides more powerful facilities for spawning " "new processes and retrieving their results; using that module is preferable " @@ -5056,53 +5426,53 @@ msgid "" "the :mod:`subprocess` documentation for some helpful recipes." msgstr "" -#: library/os.rst:4671 +#: library/os.rst:4971 msgid "" "On Unix, :func:`waitstatus_to_exitcode` can be used to convert the result " "(exit status) into an exit code. On Windows, the result is directly the exit " "code." msgstr "" -#: library/os.rst:4675 +#: library/os.rst:4975 msgid "" "Raises an :ref:`auditing event ` ``os.system`` with argument " "``command``." msgstr "" -#: library/os.rst:4682 +#: library/os.rst:4982 msgid "" "Returns the current global process times. The return value is an object with " "five attributes:" msgstr "" -#: library/os.rst:4685 +#: library/os.rst:4985 msgid ":attr:`!user` - user time" msgstr "" -#: library/os.rst:4686 +#: library/os.rst:4986 msgid ":attr:`!system` - system time" msgstr "" -#: library/os.rst:4687 +#: library/os.rst:4987 msgid ":attr:`!children_user` - user time of all child processes" msgstr "" -#: library/os.rst:4688 +#: library/os.rst:4988 msgid ":attr:`!children_system` - system time of all child processes" msgstr "" -#: library/os.rst:4689 +#: library/os.rst:4989 msgid ":attr:`!elapsed` - elapsed real time since a fixed point in the past" msgstr "" -#: library/os.rst:4691 +#: library/os.rst:4991 msgid "" "For backwards compatibility, this object also behaves like a five-tuple " "containing :attr:`!user`, :attr:`!system`, :attr:`!children_user`, :attr:`!" "children_system`, and :attr:`!elapsed` in that order." msgstr "" -#: library/os.rst:4695 +#: library/os.rst:4995 msgid "" "See the Unix manual page :manpage:`times(2)` and `times(3) `_ manual page on Unix or `the " @@ -5112,7 +5482,7 @@ msgid "" "attributes are zero." msgstr "" -#: library/os.rst:4709 +#: library/os.rst:5009 msgid "" "Wait for completion of a child process, and return a tuple containing its " "pid and exit status indication: a 16-bit number, whose low byte is the " @@ -5121,87 +5491,87 @@ msgid "" "if a core file was produced." msgstr "" -#: library/os.rst:4715 +#: library/os.rst:5015 msgid "" "If there are no children that could be waited for, :exc:`ChildProcessError` " "is raised." msgstr "" -#: library/os.rst:4793 +#: library/os.rst:5093 msgid "" ":func:`waitstatus_to_exitcode` can be used to convert the exit status into " "an exit code." msgstr "" -#: library/os.rst:4725 +#: library/os.rst:5025 msgid "" "The other :func:`!wait*` functions documented below can be used to wait for " "the completion of a specific child process and have more options. :func:" "`waitpid` is the only one also available on Windows." msgstr "" -#: library/os.rst:4732 +#: library/os.rst:5032 msgid "Wait for the completion of a child process." msgstr "" -#: library/os.rst:4734 +#: library/os.rst:5034 msgid "" "*idtype* can be :data:`P_PID`, :data:`P_PGID`, :data:`P_ALL`, or (on Linux) :" "data:`P_PIDFD`. The interpretation of *id* depends on it; see their " "individual descriptions." msgstr "" -#: library/os.rst:4737 +#: library/os.rst:5037 msgid "" "*options* is an OR combination of flags. At least one of :data:`WEXITED`, :" "data:`WSTOPPED` or :data:`WCONTINUED` is required; :data:`WNOHANG` and :data:" "`WNOWAIT` are additional optional flags." msgstr "" -#: library/os.rst:4741 +#: library/os.rst:5041 msgid "" "The return value is an object representing the data contained in the :c:type:" "`siginfo_t` structure with the following attributes:" msgstr "" -#: library/os.rst:4744 +#: library/os.rst:5044 msgid ":attr:`!si_pid` (process ID)" msgstr "" -#: library/os.rst:4745 +#: library/os.rst:5045 msgid ":attr:`!si_uid` (real user ID of the child)" msgstr "" -#: library/os.rst:4746 +#: library/os.rst:5046 msgid ":attr:`!si_signo` (always :const:`~signal.SIGCHLD`)" msgstr "" -#: library/os.rst:4747 +#: library/os.rst:5047 msgid "" ":attr:`!si_status` (the exit status or signal number, depending on :attr:`!" "si_code`)" msgstr "" -#: library/os.rst:4748 +#: library/os.rst:5048 msgid ":attr:`!si_code` (see :data:`CLD_EXITED` for possible values)" msgstr "" -#: library/os.rst:4750 +#: library/os.rst:5050 msgid "" "If :data:`WNOHANG` is specified and there are no matching children in the " "requested state, ``None`` is returned. Otherwise, if there are no matching " "children that could be waited for, :exc:`ChildProcessError` is raised." msgstr "" -#: library/os.rst:4758 -msgid "This function is not available on macOS." +#: library/os.rst:5059 +msgid "This function is now available on macOS as well." msgstr "" -#: library/os.rst:4765 +#: library/os.rst:5065 msgid "The details of this function differ on Unix and Windows." msgstr "" -#: library/os.rst:4767 +#: library/os.rst:5067 msgid "" "On Unix: Wait for completion of a child process given by process id *pid*, " "and return a tuple containing its process id and exit status indication " @@ -5210,7 +5580,7 @@ msgid "" "operation." msgstr "" -#: library/os.rst:4772 +#: library/os.rst:5072 msgid "" "If *pid* is greater than ``0``, :func:`waitpid` requests status information " "for that specific process. If *pid* is ``0``, the request is for the status " @@ -5220,7 +5590,7 @@ msgid "" "group ``-pid`` (the absolute value of *pid*)." msgstr "" -#: library/os.rst:4779 +#: library/os.rst:5079 msgid "" "*options* is an OR combination of flags. If it contains :data:`WNOHANG` and " "there are no matching children in the requested state, ``(0, 0)`` is " @@ -5229,7 +5599,7 @@ msgid "" "are :data:`WUNTRACED` and :data:`WCONTINUED`." msgstr "" -#: library/os.rst:4785 +#: library/os.rst:5085 msgid "" "On Windows: Wait for completion of a process given by process handle *pid*, " "and return a tuple containing *pid*, and its exit status shifted left by 8 " @@ -5241,7 +5611,7 @@ msgid "" "process handles." msgstr "" -#: library/os.rst:4806 +#: library/os.rst:5106 msgid "" "Similar to :func:`waitpid`, except no process id argument is given and a 3-" "element tuple containing the child's process id, exit status indication, and " @@ -5250,13 +5620,13 @@ msgid "" "same as that provided to :func:`waitpid` and :func:`wait4`." msgstr "" -#: library/os.rst:4827 +#: library/os.rst:5127 msgid "" ":func:`waitstatus_to_exitcode` can be used to convert the exit status into " "an exitcode." msgstr "" -#: library/os.rst:4821 +#: library/os.rst:5121 msgid "" "Similar to :func:`waitpid`, except a 3-element tuple, containing the child's " "process id, exit status indication, and resource usage information is " @@ -5265,118 +5635,118 @@ msgid "" "to :func:`waitpid`." msgstr "" -#: library/os.rst:4838 +#: library/os.rst:5138 msgid "" "These are the possible values for *idtype* in :func:`waitid`. They affect " "how *id* is interpreted:" msgstr "" -#: library/os.rst:4841 +#: library/os.rst:5141 msgid ":data:`!P_PID` - wait for the child whose PID is *id*." msgstr "" -#: library/os.rst:4842 +#: library/os.rst:5142 msgid ":data:`!P_PGID` - wait for any child whose progress group ID is *id*." msgstr "" -#: library/os.rst:4843 +#: library/os.rst:5143 msgid ":data:`!P_ALL` - wait for any child; *id* is ignored." msgstr "" -#: library/os.rst:4844 +#: library/os.rst:5144 msgid "" ":data:`!P_PIDFD` - wait for the child identified by the file descriptor *id* " "(a process file descriptor created with :func:`pidfd_open`)." msgstr "" -#: library/os.rst:4849 +#: library/os.rst:5149 msgid ":data:`!P_PIDFD` is only available on Linux >= 5.4." msgstr "" -#: library/os.rst:4852 +#: library/os.rst:5152 msgid "The :data:`!P_PIDFD` constant." msgstr "" -#: library/os.rst:4858 +#: library/os.rst:5158 msgid "" "This *options* flag for :func:`waitpid`, :func:`wait3`, :func:`wait4`, and :" "func:`waitid` causes child processes to be reported if they have been " "continued from a job control stop since they were last reported." msgstr "" -#: library/os.rst:4867 +#: library/os.rst:5167 msgid "" "This *options* flag for :func:`waitid` causes child processes that have " "terminated to be reported." msgstr "" -#: library/os.rst:4870 +#: library/os.rst:5170 msgid "" "The other ``wait*`` functions always report children that have terminated, " "so this option is not available for them." msgstr "" -#: library/os.rst:4880 +#: library/os.rst:5180 msgid "" "This *options* flag for :func:`waitid` causes child processes that have been " "stopped by the delivery of a signal to be reported." msgstr "" -#: library/os.rst:4915 +#: library/os.rst:5215 msgid "This option is not available for the other ``wait*`` functions." msgstr "" -#: library/os.rst:4892 +#: library/os.rst:5192 msgid "" "This *options* flag for :func:`waitpid`, :func:`wait3`, and :func:`wait4` " "causes child processes to also be reported if they have been stopped but " "their current state has not been reported since they were stopped." msgstr "" -#: library/os.rst:4896 +#: library/os.rst:5196 msgid "This option is not available for :func:`waitid`." msgstr "" -#: library/os.rst:4903 +#: library/os.rst:5203 msgid "" "This *options* flag causes :func:`waitpid`, :func:`wait3`, :func:`wait4`, " "and :func:`waitid` to return right away if no child process status is " "available immediately." msgstr "" -#: library/os.rst:4912 +#: library/os.rst:5212 msgid "" "This *options* flag causes :func:`waitid` to leave the child in a waitable " "state, so that a later :func:`!wait*` call can be used to retrieve the child " "status information again." msgstr "" -#: library/os.rst:4927 +#: library/os.rst:5227 msgid "" "These are the possible values for :attr:`!si_code` in the result returned " "by :func:`waitid`." msgstr "" -#: library/os.rst:4934 +#: library/os.rst:5234 msgid "Added :data:`CLD_KILLED` and :data:`CLD_STOPPED` values." msgstr "" -#: library/os.rst:4940 +#: library/os.rst:5240 msgid "Convert a wait status to an exit code." msgstr "" -#: library/os.rst:4942 +#: library/os.rst:5242 msgid "On Unix:" msgstr "" -#: library/os.rst:4944 +#: library/os.rst:5244 msgid "" "If the process exited normally (if ``WIFEXITED(status)`` is true), return " "the process exit status (return ``WEXITSTATUS(status)``): result greater " "than or equal to 0." msgstr "" -#: library/os.rst:4947 +#: library/os.rst:5247 msgid "" "If the process was terminated by a signal (if ``WIFSIGNALED(status)`` is " "true), return ``-signum`` where *signum* is the number of the signal that " @@ -5384,15 +5754,15 @@ msgid "" "than 0." msgstr "" -#: library/os.rst:4951 +#: library/os.rst:5251 msgid "Otherwise, raise a :exc:`ValueError`." msgstr "" -#: library/os.rst:4953 +#: library/os.rst:5253 msgid "On Windows, return *status* shifted right by 8 bits." msgstr "" -#: library/os.rst:4955 +#: library/os.rst:5255 msgid "" "On Unix, if the process is being traced or if :func:`waitpid` was called " "with :data:`WUNTRACED` option, the caller must first check if " @@ -5400,222 +5770,226 @@ msgid "" "``WIFSTOPPED(status)`` is true." msgstr "" -#: library/os.rst:4962 +#: library/os.rst:5262 msgid "" ":func:`WIFEXITED`, :func:`WEXITSTATUS`, :func:`WIFSIGNALED`, :func:" "`WTERMSIG`, :func:`WIFSTOPPED`, :func:`WSTOPSIG` functions." msgstr "" -#: library/os.rst:4970 +#: library/os.rst:5270 msgid "" "The following functions take a process status code as returned by :func:" "`system`, :func:`wait`, or :func:`waitpid` as a parameter. They may be used " "to determine the disposition of a process." msgstr "" -#: library/os.rst:4976 +#: library/os.rst:5276 msgid "" "Return ``True`` if a core dump was generated for the process, otherwise " "return ``False``." msgstr "" -#: library/os.rst:5045 +#: library/os.rst:5345 msgid "This function should be employed only if :func:`WIFSIGNALED` is true." msgstr "" -#: library/os.rst:4986 +#: library/os.rst:5286 msgid "" "Return ``True`` if a stopped child has been resumed by delivery of :const:" "`~signal.SIGCONT` (if the process has been continued from a job control " "stop), otherwise return ``False``." msgstr "" -#: library/os.rst:4990 +#: library/os.rst:5290 msgid "See :data:`WCONTINUED` option." msgstr "" -#: library/os.rst:4997 +#: library/os.rst:5297 msgid "" "Return ``True`` if the process was stopped by delivery of a signal, " "otherwise return ``False``." msgstr "" -#: library/os.rst:5000 +#: library/os.rst:5300 msgid "" ":func:`WIFSTOPPED` only returns ``True`` if the :func:`waitpid` call was " "done using :data:`WUNTRACED` option or when the process is being traced " "(see :manpage:`ptrace(2)`)." msgstr "" -#: library/os.rst:5008 +#: library/os.rst:5308 msgid "" "Return ``True`` if the process was terminated by a signal, otherwise return " "``False``." msgstr "" -#: library/os.rst:5016 +#: library/os.rst:5316 msgid "" "Return ``True`` if the process exited terminated normally, that is, by " "calling ``exit()`` or ``_exit()``, or by returning from ``main()``; " "otherwise return ``False``." msgstr "" -#: library/os.rst:5025 +#: library/os.rst:5325 msgid "Return the process exit status." msgstr "" -#: library/os.rst:5027 +#: library/os.rst:5327 msgid "This function should be employed only if :func:`WIFEXITED` is true." msgstr "" -#: library/os.rst:5034 +#: library/os.rst:5334 msgid "Return the signal which caused the process to stop." msgstr "" -#: library/os.rst:5036 +#: library/os.rst:5336 msgid "This function should be employed only if :func:`WIFSTOPPED` is true." msgstr "" -#: library/os.rst:5043 +#: library/os.rst:5343 msgid "Return the number of the signal that caused the process to terminate." msgstr "" -#: library/os.rst:5051 +#: library/os.rst:5351 msgid "Interface to the scheduler" msgstr "" -#: library/os.rst:5053 +#: library/os.rst:5353 msgid "" "These functions control how a process is allocated CPU time by the operating " "system. They are only available on some Unix platforms. For more detailed " "information, consult your Unix manpages." msgstr "" -#: library/os.rst:5059 +#: library/os.rst:5359 msgid "" "The following scheduling policies are exposed if they are supported by the " "operating system." msgstr "" -#: library/os.rst:5066 +#: library/os.rst:5366 msgid "The default scheduling policy." msgstr "" -#: library/os.rst:5070 +#: library/os.rst:5370 msgid "" "Scheduling policy for CPU-intensive processes that tries to preserve " "interactivity on the rest of the computer." msgstr "" -#: library/os.rst:5075 +#: library/os.rst:5375 msgid "Scheduling policy for extremely low priority background tasks." msgstr "" -#: library/os.rst:5079 +#: library/os.rst:5379 msgid "Scheduling policy for sporadic server programs." msgstr "" -#: library/os.rst:5083 +#: library/os.rst:5383 msgid "A First In First Out scheduling policy." msgstr "" -#: library/os.rst:5087 +#: library/os.rst:5387 msgid "A round-robin scheduling policy." msgstr "" -#: library/os.rst:5091 +#: library/os.rst:5391 msgid "" "This flag can be OR'ed with any other scheduling policy. When a process with " "this flag set forks, its child's scheduling policy and priority are reset to " "the default." msgstr "" -#: library/os.rst:5098 +#: library/os.rst:5398 msgid "" "This class represents tunable scheduling parameters used in :func:" "`sched_setparam`, :func:`sched_setscheduler`, and :func:`sched_getparam`. It " "is immutable." msgstr "" -#: library/os.rst:5102 +#: library/os.rst:5402 msgid "At the moment, there is only one possible parameter:" msgstr "" -#: library/os.rst:5106 +#: library/os.rst:5406 msgid "The scheduling priority for a scheduling policy." msgstr "" -#: library/os.rst:5111 +#: library/os.rst:5411 msgid "" "Get the minimum priority value for *policy*. *policy* is one of the " "scheduling policy constants above." msgstr "" -#: library/os.rst:5117 +#: library/os.rst:5417 msgid "" "Get the maximum priority value for *policy*. *policy* is one of the " "scheduling policy constants above." msgstr "" -#: library/os.rst:5123 +#: library/os.rst:5423 msgid "" "Set the scheduling policy for the process with PID *pid*. A *pid* of 0 means " "the calling process. *policy* is one of the scheduling policy constants " "above. *param* is a :class:`sched_param` instance." msgstr "" -#: library/os.rst:5130 +#: library/os.rst:5430 msgid "" "Return the scheduling policy for the process with PID *pid*. A *pid* of 0 " "means the calling process. The result is one of the scheduling policy " "constants above." msgstr "" -#: library/os.rst:5137 +#: library/os.rst:5437 msgid "" "Set the scheduling parameters for the process with PID *pid*. A *pid* of 0 " "means the calling process. *param* is a :class:`sched_param` instance." msgstr "" -#: library/os.rst:5143 +#: library/os.rst:5443 msgid "" "Return the scheduling parameters as a :class:`sched_param` instance for the " "process with PID *pid*. A *pid* of 0 means the calling process." msgstr "" -#: library/os.rst:5149 +#: library/os.rst:5449 msgid "" "Return the round-robin quantum in seconds for the process with PID *pid*. A " "*pid* of 0 means the calling process." msgstr "" -#: library/os.rst:5155 +#: library/os.rst:5455 msgid "" "Voluntarily relinquish the CPU. See :manpage:`sched_yield(2)` for details." msgstr "" -#: library/os.rst:5160 +#: library/os.rst:5460 msgid "" "Restrict the process with PID *pid* (or the current process if zero) to a " "set of CPUs. *mask* is an iterable of integers representing the set of CPUs " "to which the process should be restricted." msgstr "" -#: library/os.rst:5167 +#: library/os.rst:5467 msgid "Return the set of CPUs the process with PID *pid* is restricted to." msgstr "" -#: library/os.rst:5169 +#: library/os.rst:5469 msgid "" "If *pid* is zero, return the set of CPUs the calling thread of the current " "process is restricted to." msgstr "" -#: library/os.rst:5176 +#: library/os.rst:5472 +msgid "See also the :func:`process_cpu_count` function." +msgstr "" + +#: library/os.rst:5478 msgid "Miscellaneous System Information" msgstr "" -#: library/os.rst:5181 +#: library/os.rst:5483 msgid "" "Return string-valued system configuration values. *name* specifies the " "configuration value to retrieve; it may be a string which is the name of a " @@ -5626,13 +6000,13 @@ msgid "" "included in that mapping, passing an integer for *name* is also accepted." msgstr "" -#: library/os.rst:5189 +#: library/os.rst:5491 msgid "" "If the configuration value specified by *name* isn't defined, ``None`` is " "returned." msgstr "" -#: library/os.rst:5192 +#: library/os.rst:5494 msgid "" "If *name* is a string and is not known, :exc:`ValueError` is raised. If a " "specific value for *name* is not supported by the host system, even if it is " @@ -5640,34 +6014,62 @@ msgid "" "`errno.EINVAL` for the error number." msgstr "" -#: library/os.rst:5202 +#: library/os.rst:5504 msgid "" "Dictionary mapping names accepted by :func:`confstr` to the integer values " "defined for those names by the host operating system. This can be used to " "determine the set of names known to the system." msgstr "" -#: library/os.rst:5211 +#: library/os.rst:5513 msgid "" -"Return the number of logical CPUs in the system. Returns ``None`` if " +"Return the number of logical CPUs in the **system**. Returns ``None`` if " "undetermined." msgstr "" -#: library/os.rst:5214 +#: library/os.rst:5516 +msgid "" +"The :func:`process_cpu_count` function can be used to get the number of " +"logical CPUs usable by the calling thread of the **current process**." +msgstr "" + +#: library/os.rst:5521 msgid "" -"This number is not equivalent to the number of logical CPUs the current " -"process can use. ``len(os.sched_getaffinity(0))`` gets the number of logical " -"CPUs the calling thread of the current process is restricted to" +"If :option:`-X cpu_count <-X>` is given or :envvar:`PYTHON_CPU_COUNT` is " +"set, :func:`cpu_count` returns the overridden value *n*." msgstr "" -#: library/os.rst:5223 +#: library/os.rst:5528 msgid "" "Return the number of processes in the system run queue averaged over the " "last 1, 5, and 15 minutes or raises :exc:`OSError` if the load average was " "unobtainable." msgstr "" -#: library/os.rst:5232 +#: library/os.rst:5537 +msgid "" +"Get the number of logical CPUs usable by the calling thread of the **current " +"process**. Returns ``None`` if undetermined. It can be less than :func:" +"`cpu_count` depending on the CPU affinity." +msgstr "" + +#: library/os.rst:5541 +msgid "" +"The :func:`cpu_count` function can be used to get the number of logical CPUs " +"in the **system**." +msgstr "" + +#: library/os.rst:5544 +msgid "" +"If :option:`-X cpu_count <-X>` is given or :envvar:`PYTHON_CPU_COUNT` is " +"set, :func:`process_cpu_count` returns the overridden value *n*." +msgstr "" + +#: library/os.rst:5547 +msgid "See also the :func:`sched_getaffinity` function." +msgstr "" + +#: library/os.rst:5554 msgid "" "Return integer-valued system configuration values. If the configuration " "value specified by *name* isn't defined, ``-1`` is returned. The comments " @@ -5676,44 +6078,44 @@ msgid "" "``sysconf_names``." msgstr "" -#: library/os.rst:5242 +#: library/os.rst:5564 msgid "" "Dictionary mapping names accepted by :func:`sysconf` to the integer values " "defined for those names by the host operating system. This can be used to " "determine the set of names known to the system." msgstr "" -#: library/os.rst:5248 +#: library/os.rst:5570 msgid "Add ``'SC_MINSIGSTKSZ'`` name." msgstr "" -#: library/os.rst:5251 +#: library/os.rst:5573 msgid "" "The following data values are used to support path manipulation operations. " "These are defined for all platforms." msgstr "" -#: library/os.rst:5254 +#: library/os.rst:5576 msgid "" "Higher-level operations on pathnames are defined in the :mod:`os.path` " "module." msgstr "" -#: library/os.rst:5260 +#: library/os.rst:5582 msgid "" "The constant string used by the operating system to refer to the current " "directory. This is ``'.'`` for Windows and POSIX. Also available via :mod:" "`os.path`." msgstr "" -#: library/os.rst:5268 +#: library/os.rst:5590 msgid "" "The constant string used by the operating system to refer to the parent " "directory. This is ``'..'`` for Windows and POSIX. Also available via :mod:" "`os.path`." msgstr "" -#: library/os.rst:5277 +#: library/os.rst:5599 msgid "" "The character used by the operating system to separate pathname components. " "This is ``'/'`` for POSIX and ``'\\\\'`` for Windows. Note that knowing " @@ -5722,7 +6124,7 @@ msgid "" "useful. Also available via :mod:`os.path`." msgstr "" -#: library/os.rst:5287 +#: library/os.rst:5609 msgid "" "An alternative character used by the operating system to separate pathname " "components, or ``None`` if only one separator character exists. This is set " @@ -5730,27 +6132,27 @@ msgid "" "via :mod:`os.path`." msgstr "" -#: library/os.rst:5296 +#: library/os.rst:5618 msgid "" "The character which separates the base filename from the extension; for " "example, the ``'.'`` in :file:`os.py`. Also available via :mod:`os.path`." msgstr "" -#: library/os.rst:5304 +#: library/os.rst:5626 msgid "" "The character conventionally used by the operating system to separate search " "path components (as in :envvar:`PATH`), such as ``':'`` for POSIX or ``';'`` " "for Windows. Also available via :mod:`os.path`." msgstr "" -#: library/os.rst:5311 +#: library/os.rst:5633 msgid "" "The default search path used by :func:`exec\\*p\\* ` and :func:" "`spawn\\*p\\* ` if the environment doesn't have a ``'PATH'`` key. " "Also available via :mod:`os.path`." msgstr "" -#: library/os.rst:5318 +#: library/os.rst:5640 msgid "" "The string used to separate (or, rather, terminate) lines on the current " "platform. This may be a single character, such as ``'\\n'`` for POSIX, or " @@ -5759,36 +6161,36 @@ msgid "" "default); use a single ``'\\n'`` instead, on all platforms." msgstr "" -#: library/os.rst:5327 +#: library/os.rst:5649 msgid "" "The file path of the null device. For example: ``'/dev/null'`` for POSIX, " "``'nul'`` for Windows. Also available via :mod:`os.path`." msgstr "" -#: library/os.rst:5338 +#: library/os.rst:5660 msgid "" "Flags for use with the :func:`~sys.setdlopenflags` and :func:`~sys." "getdlopenflags` functions. See the Unix manual page :manpage:`dlopen(3)` " "for what the different flags mean." msgstr "" -#: library/os.rst:5346 +#: library/os.rst:5668 msgid "Random numbers" msgstr "" -#: library/os.rst:5351 +#: library/os.rst:5673 msgid "" "Get up to *size* random bytes. The function can return less bytes than " "requested." msgstr "" -#: library/os.rst:5354 +#: library/os.rst:5676 msgid "" "These bytes can be used to seed user-space random number generators or for " "cryptographic purposes." msgstr "" -#: library/os.rst:5357 +#: library/os.rst:5679 msgid "" "``getrandom()`` relies on entropy gathered from device drivers and other " "sources of environmental noise. Unnecessarily reading large quantities of " @@ -5796,32 +6198,32 @@ msgid "" "``/dev/urandom`` devices." msgstr "" -#: library/os.rst:5362 +#: library/os.rst:5684 msgid "" "The flags argument is a bit mask that can contain zero or more of the " "following values ORed together: :py:const:`os.GRND_RANDOM` and :py:data:" "`GRND_NONBLOCK`." msgstr "" -#: library/os.rst:5366 +#: library/os.rst:5688 msgid "" "See also the `Linux getrandom() manual page `_." msgstr "" -#: library/os.rst:5375 +#: library/os.rst:5697 msgid "" "Return a bytestring of *size* random bytes suitable for cryptographic use." msgstr "" -#: library/os.rst:5377 +#: library/os.rst:5699 msgid "" "This function returns random bytes from an OS-specific randomness source. " "The returned data should be unpredictable enough for cryptographic " "applications, though its exact quality depends on the OS implementation." msgstr "" -#: library/os.rst:5381 +#: library/os.rst:5703 msgid "" "On Linux, if the ``getrandom()`` syscall is available, it is used in " "blocking mode: block until the system urandom entropy pool is initialized " @@ -5831,63 +6233,63 @@ msgid "" "to poll until the system urandom entropy pool is initialized." msgstr "" -#: library/os.rst:5388 +#: library/os.rst:5710 msgid "" "On a Unix-like system, random bytes are read from the ``/dev/urandom`` " "device. If the ``/dev/urandom`` device is not available or not readable, " "the :exc:`NotImplementedError` exception is raised." msgstr "" -#: library/os.rst:5392 +#: library/os.rst:5714 msgid "On Windows, it will use ``BCryptGenRandom()``." msgstr "" -#: library/os.rst:5395 +#: library/os.rst:5717 msgid "" "The :mod:`secrets` module provides higher level functions. For an easy-to-" "use interface to the random number generator provided by your platform, " "please see :class:`random.SystemRandom`." msgstr "" -#: library/os.rst:5399 +#: library/os.rst:5721 msgid "" "On Linux 3.17 and newer, the ``getrandom()`` syscall is now used when " "available. On OpenBSD 5.6 and newer, the C ``getentropy()`` function is now " "used. These functions avoid the usage of an internal file descriptor." msgstr "" -#: library/os.rst:5405 +#: library/os.rst:5727 msgid "" "On Linux, if the ``getrandom()`` syscall blocks (the urandom entropy pool is " "not initialized yet), fall back on reading ``/dev/urandom``." msgstr "" -#: library/os.rst:5409 +#: library/os.rst:5731 msgid "" "On Linux, ``getrandom()`` is now used in blocking mode to increase the " "security." msgstr "" -#: library/os.rst:5413 +#: library/os.rst:5735 msgid "" "On Windows, ``BCryptGenRandom()`` is used instead of ``CryptGenRandom()`` " "which is deprecated." msgstr "" -#: library/os.rst:5419 +#: library/os.rst:5741 msgid "" "By default, when reading from ``/dev/random``, :func:`getrandom` blocks if " "no random bytes are available, and when reading from ``/dev/urandom``, it " "blocks if the entropy pool has not yet been initialized." msgstr "" -#: library/os.rst:5423 +#: library/os.rst:5745 msgid "" "If the :py:data:`GRND_NONBLOCK` flag is set, then :func:`getrandom` does not " "block in these cases, but instead immediately raises :exc:`BlockingIOError`." msgstr "" -#: library/os.rst:5430 +#: library/os.rst:5752 msgid "" "If this bit is set, then random bytes are drawn from the ``/dev/" "random`` pool instead of the ``/dev/urandom`` pool." @@ -5901,7 +6303,7 @@ msgstr "" msgid "effective id" msgstr "" -#: library/os.rst:439 library/os.rst:457 library/os.rst:667 library/os.rst:4263 +#: library/os.rst:439 library/os.rst:457 library/os.rst:667 library/os.rst:4550 msgid "process" msgstr "" @@ -5921,7 +6323,7 @@ msgstr "" msgid "scheduling priority" msgstr "" -#: library/os.rst:797 +#: library/os.rst:802 msgid "environment variables" msgstr "" @@ -5941,90 +6343,90 @@ msgstr "" msgid "gethostbyaddr() (in module socket)" msgstr "" -#: library/os.rst:2585 +#: library/os.rst:2659 msgid "deleting" msgstr "" -#: library/os.rst:2955 +#: library/os.rst:3029 msgid "module" msgstr "" -#: library/os.rst:1339 +#: library/os.rst:1361 msgid "pty" msgstr "" -#: library/os.rst:2384 library/os.rst:3489 library/os.rst:3589 +#: library/os.rst:2458 library/os.rst:3563 library/os.rst:3663 msgid "directory" msgstr "" -#: library/os.rst:1980 +#: library/os.rst:2046 msgid "changing" msgstr "" -#: library/os.rst:2384 +#: library/os.rst:2458 msgid "creating" msgstr "" -#: library/os.rst:2384 +#: library/os.rst:2458 msgid "UNC paths" msgstr "" -#: library/os.rst:2384 +#: library/os.rst:2458 msgid "and os.makedirs()" msgstr "" -#: library/os.rst:2955 +#: library/os.rst:3029 msgid "stat" msgstr "" -#: library/os.rst:3589 +#: library/os.rst:3663 msgid "walking" msgstr "" -#: library/os.rst:3589 +#: library/os.rst:3663 msgid "traversal" msgstr "" -#: library/os.rst:4263 +#: library/os.rst:4550 msgid "killing" msgstr "" -#: library/os.rst:4263 +#: library/os.rst:4550 msgid "signalling" msgstr "" -#: library/os.rst:5293 +#: library/os.rst:5615 msgid ". (dot)" msgstr "" -#: library/os.rst:5265 library/os.rst:5284 library/os.rst:5293 +#: library/os.rst:5587 library/os.rst:5606 library/os.rst:5615 msgid "in pathnames" msgstr "" -#: library/os.rst:5265 +#: library/os.rst:5587 msgid ".." msgstr "" -#: library/os.rst:5284 +#: library/os.rst:5606 msgid "/ (slash)" msgstr "" -#: library/os.rst:5274 +#: library/os.rst:5596 msgid "\\ (backslash)" msgstr "" -#: library/os.rst:5274 +#: library/os.rst:5596 msgid "in pathnames (Windows)" msgstr "" -#: library/os.rst:5300 +#: library/os.rst:5622 msgid ": (colon)" msgstr "" -#: library/os.rst:5300 +#: library/os.rst:5622 msgid "path separator (POSIX)" msgstr "" -#: library/os.rst:5300 +#: library/os.rst:5622 msgid "; (semicolon)" msgstr "" diff --git a/library/ossaudiodev.po b/library/ossaudiodev.po index dc3f888e..c181f8d2 100644 --- a/library/ossaudiodev.po +++ b/library/ossaudiodev.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -18,579 +18,18 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" #: library/ossaudiodev.rst:2 -msgid ":mod:`ossaudiodev` --- Access to OSS-compatible audio devices" +msgid ":mod:`!ossaudiodev` --- Access to OSS-compatible audio devices" msgstr "" -#: library/ossaudiodev.rst:9 +#: library/ossaudiodev.rst:10 msgid "" -"The :mod:`ossaudiodev` module is deprecated (see :pep:`PEP 594 " -"<594#ossaudiodev>` for details)." +"This module is no longer part of the Python standard library. It was :ref:" +"`removed in Python 3.13 ` after being deprecated in " +"Python 3.11. The removal was decided in :pep:`594`." msgstr "" -#: library/ossaudiodev.rst:15 +#: library/ossaudiodev.rst:14 msgid "" -"This module allows you to access the OSS (Open Sound System) audio " -"interface. OSS is available for a wide range of open-source and commercial " -"Unices, and is the standard audio interface for Linux and recent versions of " -"FreeBSD." -msgstr "" - -#: library/ossaudiodev.rst:47 -msgid "" -"Operations in this module now raise :exc:`OSError` where :exc:`IOError` was " -"raised." -msgstr "" - -#: library/ossaudiodev.rst:54 -msgid "" -"`Open Sound System Programmer's Guide `_" -msgstr "" - -#: library/ossaudiodev.rst:55 -msgid "the official documentation for the OSS C API" -msgstr "" - -#: library/ossaudiodev.rst:57 -msgid "" -"The module defines a large number of constants supplied by the OSS device " -"driver; see ```` on either Linux or FreeBSD for a listing." -msgstr "" - -#: library/ossaudiodev.rst:60 -msgid ":mod:`ossaudiodev` defines the following variables and functions:" -msgstr "" - -#: library/ossaudiodev.rst:65 -msgid "" -"This exception is raised on certain errors. The argument is a string " -"describing what went wrong." -msgstr "" - -#: library/ossaudiodev.rst:68 -msgid "" -"(If :mod:`ossaudiodev` receives an error from a system call such as :c:func:" -"`open`, :c:func:`write`, or :c:func:`ioctl`, it raises :exc:`OSError`. " -"Errors detected directly by :mod:`ossaudiodev` result in :exc:" -"`OSSAudioError`.)" -msgstr "" - -#: library/ossaudiodev.rst:72 -msgid "" -"(For backwards compatibility, the exception class is also available as " -"``ossaudiodev.error``.)" -msgstr "" - -#: library/ossaudiodev.rst:79 -msgid "" -"Open an audio device and return an OSS audio device object. This object " -"supports many file-like methods, such as :meth:`read`, :meth:`write`, and :" -"meth:`fileno` (although there are subtle differences between conventional " -"Unix read/write semantics and those of OSS audio devices). It also supports " -"a number of audio-specific methods; see below for the complete list of " -"methods." -msgstr "" - -#: library/ossaudiodev.rst:85 -msgid "" -"*device* is the audio device filename to use. If it is not specified, this " -"module first looks in the environment variable :envvar:`AUDIODEV` for a " -"device to use. If not found, it falls back to :file:`/dev/dsp`." -msgstr "" - -#: library/ossaudiodev.rst:89 -msgid "" -"*mode* is one of ``'r'`` for read-only (record) access, ``'w'`` for write-" -"only (playback) access and ``'rw'`` for both. Since many sound cards only " -"allow one process to have the recorder or player open at a time, it is a " -"good idea to open the device only for the activity needed. Further, some " -"sound cards are half-duplex: they can be opened for reading or writing, but " -"not both at once." -msgstr "" - -#: library/ossaudiodev.rst:96 -msgid "" -"Note the unusual calling syntax: the *first* argument is optional, and the " -"second is required. This is a historical artifact for compatibility with " -"the older :mod:`linuxaudiodev` module which :mod:`ossaudiodev` supersedes." -msgstr "" - -#: library/ossaudiodev.rst:107 -msgid "" -"Open a mixer device and return an OSS mixer device object. *device* is the " -"mixer device filename to use. If it is not specified, this module first " -"looks in the environment variable :envvar:`MIXERDEV` for a device to use. " -"If not found, it falls back to :file:`/dev/mixer`." -msgstr "" - -#: library/ossaudiodev.rst:116 -msgid "Audio Device Objects" -msgstr "" - -#: library/ossaudiodev.rst:118 -msgid "" -"Before you can write to or read from an audio device, you must call three " -"methods in the correct order:" -msgstr "" - -#: library/ossaudiodev.rst:121 -msgid ":meth:`setfmt` to set the output format" -msgstr "" - -#: library/ossaudiodev.rst:123 -msgid ":meth:`channels` to set the number of channels" -msgstr "" - -#: library/ossaudiodev.rst:125 -msgid ":meth:`speed` to set the sample rate" -msgstr "" - -#: library/ossaudiodev.rst:127 -msgid "" -"Alternately, you can use the :meth:`setparameters` method to set all three " -"audio parameters at once. This is more convenient, but may not be as " -"flexible in all cases." -msgstr "" - -#: library/ossaudiodev.rst:131 -msgid "" -"The audio device objects returned by :func:`.open` define the following " -"methods and (read-only) attributes:" -msgstr "" - -#: library/ossaudiodev.rst:137 -msgid "" -"Explicitly close the audio device. When you are done writing to or reading " -"from an audio device, you should explicitly close it. A closed device " -"cannot be used again." -msgstr "" - -#: library/ossaudiodev.rst:144 -msgid "Return the file descriptor associated with the device." -msgstr "" - -#: library/ossaudiodev.rst:149 -msgid "" -"Read *size* bytes from the audio input and return them as a Python string. " -"Unlike most Unix device drivers, OSS audio devices in blocking mode (the " -"default) will block :func:`read` until the entire requested amount of data " -"is available." -msgstr "" - -#: library/ossaudiodev.rst:157 -msgid "" -"Write a :term:`bytes-like object` *data* to the audio device and return the " -"number of bytes written. If the audio device is in blocking mode (the " -"default), the entire data is always written (again, this is different from " -"usual Unix device semantics). If the device is in non-blocking mode, some " -"data may not be written---see :meth:`writeall`." -msgstr "" - -#: library/ossaudiodev.rst:177 -msgid "Writable :term:`bytes-like object` is now accepted." -msgstr "" - -#: library/ossaudiodev.rst:169 -msgid "" -"Write a :term:`bytes-like object` *data* to the audio device: waits until " -"the audio device is able to accept data, writes as much data as it will " -"accept, and repeats until *data* has been completely written. If the device " -"is in blocking mode (the default), this has the same effect as :meth:" -"`write`; :meth:`writeall` is only useful in non-blocking mode. Has no " -"return value, since the amount of data written is always equal to the amount " -"of data supplied." -msgstr "" - -#: library/ossaudiodev.rst:181 -msgid "" -"Audio device objects also support the context management protocol, i.e. they " -"can be used in a :keyword:`with` statement." -msgstr "" - -#: library/ossaudiodev.rst:186 -msgid "" -"The following methods each map to exactly one :c:func:`ioctl` system call. " -"The correspondence is obvious: for example, :meth:`setfmt` corresponds to " -"the ``SNDCTL_DSP_SETFMT`` ioctl, and :meth:`sync` to ``SNDCTL_DSP_SYNC`` " -"(this can be useful when consulting the OSS documentation). If the " -"underlying :c:func:`ioctl` fails, they all raise :exc:`OSError`." -msgstr "" - -#: library/ossaudiodev.rst:195 -msgid "" -"Put the device into non-blocking mode. Once in non-blocking mode, there is " -"no way to return it to blocking mode." -msgstr "" - -#: library/ossaudiodev.rst:201 -msgid "" -"Return a bitmask of the audio output formats supported by the soundcard. " -"Some of the formats supported by OSS are:" -msgstr "" - -#: library/ossaudiodev.rst:205 -msgid "Format" -msgstr "" - -#: library/ossaudiodev.rst:259 -msgid "Description" -msgstr "" - -#: library/ossaudiodev.rst:207 -msgid ":const:`AFMT_MU_LAW`" -msgstr "" - -#: library/ossaudiodev.rst:207 -msgid "" -"a logarithmic encoding (used by Sun ``.au`` files and :file:`/dev/audio`)" -msgstr "" - -#: library/ossaudiodev.rst:210 -msgid ":const:`AFMT_A_LAW`" -msgstr "" - -#: library/ossaudiodev.rst:210 -msgid "a logarithmic encoding" -msgstr "" - -#: library/ossaudiodev.rst:212 -msgid ":const:`AFMT_IMA_ADPCM`" -msgstr "" - -#: library/ossaudiodev.rst:212 -msgid "" -"a 4:1 compressed format defined by the Interactive Multimedia Association" -msgstr "" - -#: library/ossaudiodev.rst:215 -msgid ":const:`AFMT_U8`" -msgstr "" - -#: library/ossaudiodev.rst:215 -msgid "Unsigned, 8-bit audio" -msgstr "" - -#: library/ossaudiodev.rst:217 -msgid ":const:`AFMT_S16_LE`" -msgstr "" - -#: library/ossaudiodev.rst:217 -msgid "" -"Signed, 16-bit audio, little-endian byte order (as used by Intel processors)" -msgstr "" - -#: library/ossaudiodev.rst:220 -msgid ":const:`AFMT_S16_BE`" -msgstr "" - -#: library/ossaudiodev.rst:220 -msgid "" -"Signed, 16-bit audio, big-endian byte order (as used by 68k, PowerPC, Sparc)" -msgstr "" - -#: library/ossaudiodev.rst:223 -msgid ":const:`AFMT_S8`" -msgstr "" - -#: library/ossaudiodev.rst:223 -msgid "Signed, 8 bit audio" -msgstr "" - -#: library/ossaudiodev.rst:225 -msgid ":const:`AFMT_U16_LE`" -msgstr "" - -#: library/ossaudiodev.rst:225 -msgid "Unsigned, 16-bit little-endian audio" -msgstr "" - -#: library/ossaudiodev.rst:227 -msgid ":const:`AFMT_U16_BE`" -msgstr "" - -#: library/ossaudiodev.rst:227 -msgid "Unsigned, 16-bit big-endian audio" -msgstr "" - -#: library/ossaudiodev.rst:230 -msgid "" -"Consult the OSS documentation for a full list of audio formats, and note " -"that most devices support only a subset of these formats. Some older " -"devices only support :const:`AFMT_U8`; the most common format used today is :" -"const:`AFMT_S16_LE`." -msgstr "" - -#: library/ossaudiodev.rst:238 -msgid "" -"Try to set the current audio format to *format*---see :meth:`getfmts` for a " -"list. Returns the audio format that the device was set to, which may not be " -"the requested format. May also be used to return the current audio format---" -"do this by passing an \"audio format\" of :const:`AFMT_QUERY`." -msgstr "" - -#: library/ossaudiodev.rst:246 -msgid "" -"Set the number of output channels to *nchannels*. A value of 1 indicates " -"monophonic sound, 2 stereophonic. Some devices may have more than 2 " -"channels, and some high-end devices may not support mono. Returns the number " -"of channels the device was set to." -msgstr "" - -#: library/ossaudiodev.rst:254 -msgid "" -"Try to set the audio sampling rate to *samplerate* samples per second. " -"Returns the rate actually set. Most sound devices don't support arbitrary " -"sampling rates. Common rates are:" -msgstr "" - -#: library/ossaudiodev.rst:259 -msgid "Rate" -msgstr "" - -#: library/ossaudiodev.rst:261 -msgid "8000" -msgstr "" - -#: library/ossaudiodev.rst:261 -msgid "default rate for :file:`/dev/audio`" -msgstr "" - -#: library/ossaudiodev.rst:263 -msgid "11025" -msgstr "" - -#: library/ossaudiodev.rst:263 -msgid "speech recording" -msgstr "" - -#: library/ossaudiodev.rst:265 -msgid "22050" -msgstr "" - -#: library/ossaudiodev.rst:267 -msgid "44100" -msgstr "" - -#: library/ossaudiodev.rst:267 -msgid "CD quality audio (at 16 bits/sample and 2 channels)" -msgstr "" - -#: library/ossaudiodev.rst:270 -msgid "96000" -msgstr "" - -#: library/ossaudiodev.rst:270 -msgid "DVD quality audio (at 24 bits/sample)" -msgstr "" - -#: library/ossaudiodev.rst:276 -msgid "" -"Wait until the sound device has played every byte in its buffer. (This " -"happens implicitly when the device is closed.) The OSS documentation " -"recommends closing and re-opening the device rather than using :meth:`sync`." -msgstr "" - -#: library/ossaudiodev.rst:283 -msgid "" -"Immediately stop playing or recording and return the device to a state where " -"it can accept commands. The OSS documentation recommends closing and re-" -"opening the device after calling :meth:`reset`." -msgstr "" - -#: library/ossaudiodev.rst:290 -msgid "" -"Tell the driver that there is likely to be a pause in the output, making it " -"possible for the device to handle the pause more intelligently. You might " -"use this after playing a spot sound effect, before waiting for user input, " -"or before doing disk I/O." -msgstr "" - -#: library/ossaudiodev.rst:295 -msgid "" -"The following convenience methods combine several ioctls, or one ioctl and " -"some simple calculations." -msgstr "" - -#: library/ossaudiodev.rst:301 -msgid "" -"Set the key audio sampling parameters---sample format, number of channels, " -"and sampling rate---in one method call. *format*, *nchannels*, and " -"*samplerate* should be as specified in the :meth:`setfmt`, :meth:`channels`, " -"and :meth:`speed` methods. If *strict* is true, :meth:`setparameters` " -"checks to see if each parameter was actually set to the requested value, and " -"raises :exc:`OSSAudioError` if not. Returns a tuple (*format*, *nchannels*, " -"*samplerate*) indicating the parameter values that were actually set by the " -"device driver (i.e., the same as the return values of :meth:`setfmt`, :meth:" -"`channels`, and :meth:`speed`)." -msgstr "" - -#: library/ossaudiodev.rst:311 -msgid "For example, ::" -msgstr "" - -#: library/ossaudiodev.rst:313 -msgid "(fmt, channels, rate) = dsp.setparameters(fmt, channels, rate)" -msgstr "" - -#: library/ossaudiodev.rst:315 -msgid "is equivalent to ::" -msgstr "" - -#: library/ossaudiodev.rst:317 -msgid "" -"fmt = dsp.setfmt(fmt)\n" -"channels = dsp.channels(channels)\n" -"rate = dsp.rate(rate)" -msgstr "" - -#: library/ossaudiodev.rst:324 -msgid "Returns the size of the hardware buffer, in samples." -msgstr "" - -#: library/ossaudiodev.rst:329 -msgid "" -"Returns the number of samples that are in the hardware buffer yet to be " -"played." -msgstr "" - -#: library/ossaudiodev.rst:334 -msgid "" -"Returns the number of samples that could be queued into the hardware buffer " -"to be played without blocking." -msgstr "" - -#: library/ossaudiodev.rst:337 -msgid "Audio device objects also support several read-only attributes:" -msgstr "" - -#: library/ossaudiodev.rst:342 -msgid "Boolean indicating whether the device has been closed." -msgstr "" - -#: library/ossaudiodev.rst:347 -msgid "String containing the name of the device file." -msgstr "" - -#: library/ossaudiodev.rst:352 -msgid "The I/O mode for the file, either ``\"r\"``, ``\"rw\"``, or ``\"w\"``." -msgstr "" - -#: library/ossaudiodev.rst:358 -msgid "Mixer Device Objects" -msgstr "" - -#: library/ossaudiodev.rst:360 -msgid "The mixer object provides two file-like methods:" -msgstr "" - -#: library/ossaudiodev.rst:365 -msgid "" -"This method closes the open mixer device file. Any further attempts to use " -"the mixer after this file is closed will raise an :exc:`OSError`." -msgstr "" - -#: library/ossaudiodev.rst:371 -msgid "Returns the file handle number of the open mixer device file." -msgstr "" - -#: library/ossaudiodev.rst:373 -msgid "Mixer objects also support the context management protocol." -msgstr "" - -#: library/ossaudiodev.rst:377 -msgid "The remaining methods are specific to audio mixing:" -msgstr "" - -#: library/ossaudiodev.rst:382 -msgid "" -"This method returns a bitmask specifying the available mixer controls " -"(\"Control\" being a specific mixable \"channel\", such as :const:" -"`SOUND_MIXER_PCM` or :const:`SOUND_MIXER_SYNTH`). This bitmask indicates a " -"subset of all available mixer controls---the :const:`SOUND_MIXER_\\*` " -"constants defined at module level. To determine if, for example, the current " -"mixer object supports a PCM mixer, use the following Python code::" -msgstr "" - -#: library/ossaudiodev.rst:389 -msgid "" -"mixer=ossaudiodev.openmixer()\n" -"if mixer.controls() & (1 << ossaudiodev.SOUND_MIXER_PCM):\n" -" # PCM is supported\n" -" ... code ..." -msgstr "" - -#: library/ossaudiodev.rst:394 -msgid "" -"For most purposes, the :const:`SOUND_MIXER_VOLUME` (master volume) and :" -"const:`SOUND_MIXER_PCM` controls should suffice---but code that uses the " -"mixer should be flexible when it comes to choosing mixer controls. On the " -"Gravis Ultrasound, for example, :const:`SOUND_MIXER_VOLUME` does not exist." -msgstr "" - -#: library/ossaudiodev.rst:402 -msgid "" -"Returns a bitmask indicating stereo mixer controls. If a bit is set, the " -"corresponding control is stereo; if it is unset, the control is either " -"monophonic or not supported by the mixer (use in combination with :meth:" -"`controls` to determine which)." -msgstr "" - -#: library/ossaudiodev.rst:407 -msgid "" -"See the code example for the :meth:`controls` function for an example of " -"getting data from a bitmask." -msgstr "" - -#: library/ossaudiodev.rst:413 -msgid "" -"Returns a bitmask specifying the mixer controls that may be used to record. " -"See the code example for :meth:`controls` for an example of reading from a " -"bitmask." -msgstr "" - -#: library/ossaudiodev.rst:419 -msgid "" -"Returns the volume of a given mixer control. The returned volume is a 2-" -"tuple ``(left_volume,right_volume)``. Volumes are specified as numbers from " -"0 (silent) to 100 (full volume). If the control is monophonic, a 2-tuple is " -"still returned, but both volumes are the same." -msgstr "" - -#: library/ossaudiodev.rst:424 -msgid "" -"Raises :exc:`OSSAudioError` if an invalid control is specified, or :exc:" -"`OSError` if an unsupported control is specified." -msgstr "" - -#: library/ossaudiodev.rst:430 -msgid "" -"Sets the volume for a given mixer control to ``(left,right)``. ``left`` and " -"``right`` must be ints and between 0 (silent) and 100 (full volume). On " -"success, the new volume is returned as a 2-tuple. Note that this may not be " -"exactly the same as the volume specified, because of the limited resolution " -"of some soundcard's mixers." -msgstr "" - -#: library/ossaudiodev.rst:436 -msgid "" -"Raises :exc:`OSSAudioError` if an invalid mixer control was specified, or if " -"the specified volumes were out-of-range." -msgstr "" - -#: library/ossaudiodev.rst:442 -msgid "" -"This method returns a bitmask indicating which control(s) are currently " -"being used as a recording source." -msgstr "" - -#: library/ossaudiodev.rst:448 -msgid "" -"Call this function to specify a recording source. Returns a bitmask " -"indicating the new recording source (or sources) if successful; raises :exc:" -"`OSError` if an invalid source was specified. To set the current recording " -"source to the microphone input::" -msgstr "" - -#: library/ossaudiodev.rst:453 -msgid "mixer.setrecsrc (1 << ossaudiodev.SOUND_MIXER_MIC)" +"The last version of Python that provided the :mod:`!ossaudiodev` module was " +"`Python 3.12 `_." msgstr "" diff --git a/library/pathlib.po b/library/pathlib.po index 92d15040..a397d587 100644 --- a/library/pathlib.po +++ b/library/pathlib.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -22,7 +22,7 @@ msgid ":mod:`!pathlib` --- Object-oriented filesystem paths" msgstr "" #: library/pathlib.rst:9 -msgid "**Source code:** :source:`Lib/pathlib.py`" +msgid "**Source code:** :source:`Lib/pathlib/`" msgstr "" #: library/pathlib.rst:15 @@ -153,30 +153,40 @@ msgid "" "'#!/bin/bash\\n'" msgstr "" -#: library/pathlib.rst:99 -msgid "Pure paths" +#: library/pathlib.rst:97 +msgid "Exceptions" msgstr "" #: library/pathlib.rst:101 msgid "" +"An exception inheriting :exc:`NotImplementedError` that is raised when an " +"unsupported operation is called on a path object." +msgstr "" + +#: library/pathlib.rst:110 +msgid "Pure paths" +msgstr "" + +#: library/pathlib.rst:112 +msgid "" "Pure path objects provide path-handling operations which don't actually " "access a filesystem. There are three ways to access these classes, which we " "also call *flavours*:" msgstr "" -#: library/pathlib.rst:107 +#: library/pathlib.rst:118 msgid "" "A generic class that represents the system's path flavour (instantiating it " "creates either a :class:`PurePosixPath` or a :class:`PureWindowsPath`)::" msgstr "" -#: library/pathlib.rst:110 +#: library/pathlib.rst:121 msgid "" ">>> PurePath('setup.py') # Running on a Unix machine\n" "PurePosixPath('setup.py')" msgstr "" -#: library/pathlib.rst:113 +#: library/pathlib.rst:124 msgid "" "Each element of *pathsegments* can be either a string representing a path " "segment, or an object implementing the :class:`os.PathLike` interface where " @@ -184,7 +194,7 @@ msgid "" "path object::" msgstr "" -#: library/pathlib.rst:118 +#: library/pathlib.rst:129 msgid "" ">>> PurePath('foo', 'some/path', 'bar')\n" "PurePosixPath('foo/some/path/bar')\n" @@ -192,23 +202,23 @@ msgid "" "PurePosixPath('foo/bar')" msgstr "" -#: library/pathlib.rst:123 +#: library/pathlib.rst:134 msgid "When *pathsegments* is empty, the current directory is assumed::" msgstr "" -#: library/pathlib.rst:125 +#: library/pathlib.rst:136 msgid "" ">>> PurePath()\n" "PurePosixPath('.')" msgstr "" -#: library/pathlib.rst:128 +#: library/pathlib.rst:139 msgid "" "If a segment is an absolute path, all previous segments are ignored (like :" "func:`os.path.join`)::" msgstr "" -#: library/pathlib.rst:131 +#: library/pathlib.rst:142 msgid "" ">>> PurePath('/etc', '/usr', 'lib64')\n" "PurePosixPath('/usr/lib64')\n" @@ -216,26 +226,26 @@ msgid "" "PureWindowsPath('d:bar')" msgstr "" -#: library/pathlib.rst:136 +#: library/pathlib.rst:147 msgid "" "On Windows, the drive is not reset when a rooted relative path segment (e." "g., ``r'\\foo'``) is encountered::" msgstr "" -#: library/pathlib.rst:139 +#: library/pathlib.rst:150 msgid "" ">>> PureWindowsPath('c:/Windows', '/Program Files')\n" "PureWindowsPath('c:/Program Files')" msgstr "" -#: library/pathlib.rst:142 +#: library/pathlib.rst:153 msgid "" "Spurious slashes and single dots are collapsed, but double dots (``'..'``) " "and leading double slashes (``'//'``) are not, since this would change the " "meaning of a path for various reasons (e.g. symbolic links, UNC paths)::" msgstr "" -#: library/pathlib.rst:146 +#: library/pathlib.rst:157 msgid "" ">>> PurePath('foo//bar')\n" "PurePosixPath('foo/bar')\n" @@ -247,46 +257,46 @@ msgid "" "PurePosixPath('foo/../bar')" msgstr "" -#: library/pathlib.rst:155 +#: library/pathlib.rst:166 msgid "" "(a naïve approach would make ``PurePosixPath('foo/../bar')`` equivalent to " "``PurePosixPath('bar')``, which is wrong if ``foo`` is a symbolic link to " "another directory)" msgstr "" -#: library/pathlib.rst:159 +#: library/pathlib.rst:170 msgid "" "Pure path objects implement the :class:`os.PathLike` interface, allowing " "them to be used anywhere the interface is accepted." msgstr "" -#: library/pathlib.rst:162 +#: library/pathlib.rst:173 msgid "Added support for the :class:`os.PathLike` interface." msgstr "" -#: library/pathlib.rst:167 +#: library/pathlib.rst:178 msgid "" "A subclass of :class:`PurePath`, this path flavour represents non-Windows " "filesystem paths::" msgstr "" -#: library/pathlib.rst:170 +#: library/pathlib.rst:181 msgid "" ">>> PurePosixPath('/etc/hosts')\n" "PurePosixPath('/etc/hosts')" msgstr "" -#: library/pathlib.rst:185 library/pathlib.rst:768 library/pathlib.rst:778 +#: library/pathlib.rst:196 library/pathlib.rst:776 library/pathlib.rst:791 msgid "*pathsegments* is specified similarly to :class:`PurePath`." msgstr "" -#: library/pathlib.rst:177 +#: library/pathlib.rst:188 msgid "" "A subclass of :class:`PurePath`, this path flavour represents Windows " "filesystem paths, including `UNC paths`_::" msgstr "" -#: library/pathlib.rst:180 +#: library/pathlib.rst:191 msgid "" ">>> PureWindowsPath('c:/', 'Users', 'Ximénez')\n" "PureWindowsPath('c:/Users/Ximénez')\n" @@ -294,24 +304,24 @@ msgid "" "PureWindowsPath('//server/share/file')" msgstr "" -#: library/pathlib.rst:189 +#: library/pathlib.rst:200 msgid "" "Regardless of the system you're running on, you can instantiate all of these " "classes, since they don't provide any operation that does system calls." msgstr "" -#: library/pathlib.rst:194 +#: library/pathlib.rst:205 msgid "General properties" msgstr "" -#: library/pathlib.rst:196 +#: library/pathlib.rst:207 msgid "" "Paths are immutable and :term:`hashable`. Paths of a same flavour are " "comparable and orderable. These properties respect the flavour's case-" "folding semantics::" msgstr "" -#: library/pathlib.rst:200 +#: library/pathlib.rst:211 msgid "" ">>> PurePosixPath('foo') == PurePosixPath('FOO')\n" "False\n" @@ -323,11 +333,11 @@ msgid "" "True" msgstr "" -#: library/pathlib.rst:209 +#: library/pathlib.rst:220 msgid "Paths of a different flavour compare unequal and cannot be ordered::" msgstr "" -#: library/pathlib.rst:211 +#: library/pathlib.rst:222 msgid "" ">>> PureWindowsPath('foo') == PurePosixPath('foo')\n" "False\n" @@ -338,11 +348,11 @@ msgid "" "'PurePosixPath'" msgstr "" -#: library/pathlib.rst:220 +#: library/pathlib.rst:231 msgid "Operators" msgstr "" -#: library/pathlib.rst:222 +#: library/pathlib.rst:233 msgid "" "The slash operator helps create child paths, like :func:`os.path.join`. If " "the argument is an absolute path, the previous path is ignored. On Windows, " @@ -350,7 +360,7 @@ msgid "" "``r'\\foo'``)::" msgstr "" -#: library/pathlib.rst:227 +#: library/pathlib.rst:238 msgid "" ">>> p = PurePath('/etc')\n" ">>> p\n" @@ -366,13 +376,13 @@ msgid "" "PureWindowsPath('c:/Program Files')" msgstr "" -#: library/pathlib.rst:240 +#: library/pathlib.rst:251 msgid "" "A path object can be used anywhere an object implementing :class:`os." "PathLike` is accepted::" msgstr "" -#: library/pathlib.rst:243 +#: library/pathlib.rst:254 msgid "" ">>> import os\n" ">>> p = PurePath('/etc')\n" @@ -380,14 +390,14 @@ msgid "" "'/etc'" msgstr "" -#: library/pathlib.rst:248 +#: library/pathlib.rst:259 msgid "" "The string representation of a path is the raw filesystem path itself (in " "native form, e.g. with backslashes under Windows), which you can pass to any " "function taking a file path as a string::" msgstr "" -#: library/pathlib.rst:252 +#: library/pathlib.rst:263 msgid "" ">>> p = PurePath('/etc')\n" ">>> str(p)\n" @@ -397,39 +407,39 @@ msgid "" "'c:\\\\Program Files'" msgstr "" -#: library/pathlib.rst:259 +#: library/pathlib.rst:270 msgid "" "Similarly, calling :class:`bytes` on a path gives the raw filesystem path as " "a bytes object, as encoded by :func:`os.fsencode`::" msgstr "" -#: library/pathlib.rst:262 +#: library/pathlib.rst:273 msgid "" ">>> bytes(p)\n" "b'/etc'" msgstr "" -#: library/pathlib.rst:266 +#: library/pathlib.rst:277 msgid "" "Calling :class:`bytes` is only recommended under Unix. Under Windows, the " "unicode form is the canonical representation of filesystem paths." msgstr "" -#: library/pathlib.rst:271 +#: library/pathlib.rst:282 msgid "Accessing individual parts" msgstr "" -#: library/pathlib.rst:273 +#: library/pathlib.rst:284 msgid "" "To access the individual \"parts\" (components) of a path, use the following " "property:" msgstr "" -#: library/pathlib.rst:278 +#: library/pathlib.rst:289 msgid "A tuple giving access to the path's various components::" msgstr "" -#: library/pathlib.rst:280 +#: library/pathlib.rst:291 msgid "" ">>> p = PurePath('/usr/bin/python3')\n" ">>> p.parts\n" @@ -440,23 +450,29 @@ msgid "" "('c:\\\\', 'Program Files', 'PSF')" msgstr "" -#: library/pathlib.rst:288 +#: library/pathlib.rst:299 msgid "(note how the drive and local root are regrouped in a single part)" msgstr "" -#: library/pathlib.rst:292 +#: library/pathlib.rst:303 msgid "Methods and properties" msgstr "" -#: library/pathlib.rst:298 +#: library/pathlib.rst:309 msgid "Pure paths provide the following methods and properties:" msgstr "" -#: library/pathlib.rst:302 +#: library/pathlib.rst:313 +msgid "" +"The implementation of the :mod:`os.path` module used for low-level path " +"parsing and joining: either :mod:`posixpath` or :mod:`ntpath`." +msgstr "" + +#: library/pathlib.rst:320 msgid "A string representing the drive letter or name, if any::" msgstr "" -#: library/pathlib.rst:304 +#: library/pathlib.rst:322 msgid "" ">>> PureWindowsPath('c:/Program Files/').drive\n" "'c:'\n" @@ -466,21 +482,21 @@ msgid "" "''" msgstr "" -#: library/pathlib.rst:311 +#: library/pathlib.rst:329 msgid "UNC shares are also considered drives::" msgstr "" -#: library/pathlib.rst:313 +#: library/pathlib.rst:331 msgid "" ">>> PureWindowsPath('//host/share/foo.txt').drive\n" "'\\\\\\\\host\\\\share'" msgstr "" -#: library/pathlib.rst:318 +#: library/pathlib.rst:336 msgid "A string representing the (local or global) root, if any::" msgstr "" -#: library/pathlib.rst:320 +#: library/pathlib.rst:338 msgid "" ">>> PureWindowsPath('c:/Program Files/').root\n" "'\\\\'\n" @@ -490,23 +506,23 @@ msgid "" "'/'" msgstr "" -#: library/pathlib.rst:327 +#: library/pathlib.rst:345 msgid "UNC shares always have a root::" msgstr "" -#: library/pathlib.rst:329 +#: library/pathlib.rst:347 msgid "" ">>> PureWindowsPath('//host/share').root\n" "'\\\\'" msgstr "" -#: library/pathlib.rst:332 +#: library/pathlib.rst:350 msgid "" "If the path starts with more than two successive slashes, :class:`~pathlib." "PurePosixPath` collapses them::" msgstr "" -#: library/pathlib.rst:335 +#: library/pathlib.rst:353 msgid "" ">>> PurePosixPath('//etc').root\n" "'//'\n" @@ -516,25 +532,25 @@ msgid "" "'/'" msgstr "" -#: library/pathlib.rst:344 +#: library/pathlib.rst:362 msgid "" "This behavior conforms to *The Open Group Base Specifications Issue 6*, " "paragraph `4.11 Pathname Resolution `_:" msgstr "" -#: library/pathlib.rst:348 +#: library/pathlib.rst:366 msgid "" "*\"A pathname that begins with two successive slashes may be interpreted in " "an implementation-defined manner, although more than two leading slashes " "shall be treated as a single slash.\"*" msgstr "" -#: library/pathlib.rst:354 +#: library/pathlib.rst:372 msgid "The concatenation of the drive and root::" msgstr "" -#: library/pathlib.rst:356 +#: library/pathlib.rst:374 msgid "" ">>> PureWindowsPath('c:/Program Files/').anchor\n" "'c:\\\\'\n" @@ -546,12 +562,12 @@ msgid "" "'\\\\\\\\host\\\\share\\\\'" msgstr "" -#: library/pathlib.rst:368 +#: library/pathlib.rst:386 msgid "" "An immutable sequence providing access to the logical ancestors of the path::" msgstr "" -#: library/pathlib.rst:371 +#: library/pathlib.rst:389 msgid "" ">>> p = PureWindowsPath('c:/foo/bar/setup.py')\n" ">>> p.parents[0]\n" @@ -562,28 +578,28 @@ msgid "" "PureWindowsPath('c:/')" msgstr "" -#: library/pathlib.rst:379 +#: library/pathlib.rst:397 msgid "" "The parents sequence now supports :term:`slices ` and negative index " "values." msgstr "" -#: library/pathlib.rst:384 +#: library/pathlib.rst:402 msgid "The logical parent of the path::" msgstr "" -#: library/pathlib.rst:386 +#: library/pathlib.rst:404 msgid "" ">>> p = PurePosixPath('/a/b/c/d')\n" ">>> p.parent\n" "PurePosixPath('/a/b/c')" msgstr "" -#: library/pathlib.rst:390 +#: library/pathlib.rst:408 msgid "You cannot go past an anchor, or empty path::" msgstr "" -#: library/pathlib.rst:392 +#: library/pathlib.rst:410 msgid "" ">>> p = PurePosixPath('/')\n" ">>> p.parent\n" @@ -593,41 +609,41 @@ msgid "" "PurePosixPath('.')" msgstr "" -#: library/pathlib.rst:400 +#: library/pathlib.rst:418 msgid "This is a purely lexical operation, hence the following behaviour::" msgstr "" -#: library/pathlib.rst:402 +#: library/pathlib.rst:420 msgid "" ">>> p = PurePosixPath('foo/..')\n" ">>> p.parent\n" "PurePosixPath('foo')" msgstr "" -#: library/pathlib.rst:406 +#: library/pathlib.rst:424 msgid "" "If you want to walk an arbitrary filesystem path upwards, it is recommended " "to first call :meth:`Path.resolve` so as to resolve symlinks and eliminate " "``\"..\"`` components." msgstr "" -#: library/pathlib.rst:413 +#: library/pathlib.rst:431 msgid "" "A string representing the final path component, excluding the drive and " "root, if any::" msgstr "" -#: library/pathlib.rst:416 +#: library/pathlib.rst:434 msgid "" ">>> PurePosixPath('my/library/setup.py').name\n" "'setup.py'" msgstr "" -#: library/pathlib.rst:419 +#: library/pathlib.rst:437 msgid "UNC drive names are not considered::" msgstr "" -#: library/pathlib.rst:421 +#: library/pathlib.rst:439 msgid "" ">>> PureWindowsPath('//some/share/setup.py').name\n" "'setup.py'\n" @@ -635,11 +651,11 @@ msgid "" "''" msgstr "" -#: library/pathlib.rst:429 -msgid "The file extension of the final component, if any::" +#: library/pathlib.rst:447 +msgid "The last dot-separated portion of the final component, if any::" msgstr "" -#: library/pathlib.rst:431 +#: library/pathlib.rst:449 msgid "" ">>> PurePosixPath('my/library/setup.py').suffix\n" "'.py'\n" @@ -649,11 +665,15 @@ msgid "" "''" msgstr "" -#: library/pathlib.rst:441 -msgid "A list of the path's file extensions::" +#: library/pathlib.rst:456 +msgid "This is commonly called the file extension." +msgstr "" + +#: library/pathlib.rst:460 +msgid "A list of the path's suffixes, often called file extensions::" msgstr "" -#: library/pathlib.rst:443 +#: library/pathlib.rst:462 msgid "" ">>> PurePosixPath('my/library.tar.gar').suffixes\n" "['.tar', '.gar']\n" @@ -663,11 +683,11 @@ msgid "" "[]" msgstr "" -#: library/pathlib.rst:453 +#: library/pathlib.rst:472 msgid "The final path component, without its suffix::" msgstr "" -#: library/pathlib.rst:455 +#: library/pathlib.rst:474 msgid "" ">>> PurePosixPath('my/library.tar.gz').stem\n" "'library.tar'\n" @@ -677,12 +697,12 @@ msgid "" "'library'" msgstr "" -#: library/pathlib.rst:465 +#: library/pathlib.rst:484 msgid "" "Return a string representation of the path with forward slashes (``/``)::" msgstr "" -#: library/pathlib.rst:467 +#: library/pathlib.rst:486 msgid "" ">>> p = PureWindowsPath('c:\\\\windows')\n" ">>> str(p)\n" @@ -691,19 +711,13 @@ msgid "" "'c:/windows'" msgstr "" -#: library/pathlib.rst:476 -msgid "" -"Represent the path as a ``file`` URI. :exc:`ValueError` is raised if the " -"path isn't absolute." -msgstr "" - -#: library/pathlib.rst:489 +#: library/pathlib.rst:495 msgid "" "Return whether the path is absolute or not. A path is considered absolute " "if it has both a root and (if the flavour allows) a drive::" msgstr "" -#: library/pathlib.rst:492 +#: library/pathlib.rst:498 msgid "" ">>> PurePosixPath('/a/b').is_absolute()\n" "True\n" @@ -720,42 +734,48 @@ msgid "" "True" msgstr "" -#: library/pathlib.rst:509 +#: library/pathlib.rst:515 msgid "Return whether or not this path is relative to the *other* path." msgstr "" -#: library/pathlib.rst:517 +#: library/pathlib.rst:523 msgid "" "This method is string-based; it neither accesses the filesystem nor treats " "\"``..``\" segments specially. The following code is equivalent:" msgstr "" -#: library/pathlib.rst:528 +#: library/pathlib.rst:534 msgid "" "Passing additional arguments is deprecated; if supplied, they are joined " "with *other*." msgstr "" -#: library/pathlib.rst:533 +#: library/pathlib.rst:539 msgid "" "With :class:`PureWindowsPath`, return ``True`` if the path is considered " "reserved under Windows, ``False`` otherwise. With :class:`PurePosixPath`, " "``False`` is always returned." msgstr "" -#: library/pathlib.rst:542 +#: library/pathlib.rst:543 msgid "" -"File system calls on reserved paths can fail mysteriously or have unintended " -"effects." +"Windows path names that contain a colon, or end with a dot or a space, are " +"considered reserved. UNC paths may be reserved." msgstr "" -#: library/pathlib.rst:548 +#: library/pathlib.rst:547 +msgid "" +"This method is deprecated; use :func:`os.path.isreserved` to detect reserved " +"paths on Windows." +msgstr "" + +#: library/pathlib.rst:553 msgid "" "Calling this method is equivalent to combining the path with each of the " "given *pathsegments* in turn::" msgstr "" -#: library/pathlib.rst:551 +#: library/pathlib.rst:556 msgid "" ">>> PurePosixPath('/etc').joinpath('passwd')\n" "PurePosixPath('/etc/passwd')\n" @@ -767,93 +787,84 @@ msgid "" "PureWindowsPath('c:/Program Files')" msgstr "" -#: library/pathlib.rst:563 +#: library/pathlib.rst:568 msgid "" "Match this path against the provided glob-style pattern. Return ``True`` if " -"matching is successful, ``False`` otherwise." -msgstr "" - -#: library/pathlib.rst:566 -msgid "" -"If *pattern* is relative, the path can be either relative or absolute, and " -"matching is done from the right::" +"matching is successful, ``False`` otherwise. For example::" msgstr "" -#: library/pathlib.rst:569 +#: library/pathlib.rst:571 msgid "" -">>> PurePath('a/b.py').match('*.py')\n" +">>> PurePath('a/b.py').full_match('a/*.py')\n" "True\n" -">>> PurePath('/a/b/c.py').match('b/*.py')\n" +">>> PurePath('a/b.py').full_match('*.py')\n" +"False\n" +">>> PurePath('/a/b/c.py').full_match('/a/**')\n" "True\n" -">>> PurePath('/a/b/c.py').match('a/*.py')\n" -"False" +">>> PurePath('/a/b/c.py').full_match('**/*.py')\n" +"True" msgstr "" -#: library/pathlib.rst:576 -msgid "" -"If *pattern* is absolute, the path must be absolute, and the whole path must " -"match::" +#: library/pathlib.rst:1291 +msgid ":ref:`pathlib-pattern-language` documentation." msgstr "" -#: library/pathlib.rst:579 -msgid "" -">>> PurePath('/a.py').match('/*.py')\n" -"True\n" -">>> PurePath('a/b.py').match('/*.py')\n" -"False" -msgstr "" - -#: library/pathlib.rst:584 -msgid "" -"The *pattern* may be another path object; this speeds up matching the same " -"pattern against multiple files::" +#: library/pathlib.rst:583 +msgid "As with other methods, case-sensitivity follows platform defaults::" msgstr "" -#: library/pathlib.rst:587 +#: library/pathlib.rst:585 msgid "" -">>> pattern = PurePath('*.py')\n" -">>> PurePath('a/b.py').match(pattern)\n" +">>> PurePosixPath('b.py').full_match('*.PY')\n" +"False\n" +">>> PureWindowsPath('b.py').full_match('*.PY')\n" "True" msgstr "" -#: library/pathlib.rst:592 +#: library/pathlib.rst:590 msgid "" -"The recursive wildcard \"``**``\" isn't supported by this method (it acts " -"like non-recursive \"``*``\".)" -msgstr "" - -#: library/pathlib.rst:595 -msgid "Accepts an object implementing the :class:`os.PathLike` interface." +"Set *case_sensitive* to ``True`` or ``False`` to override this behaviour." msgstr "" -#: library/pathlib.rst:598 -msgid "As with other methods, case-sensitivity follows platform defaults::" +#: library/pathlib.rst:597 +msgid "" +"Match this path against the provided non-recursive glob-style pattern. " +"Return ``True`` if matching is successful, ``False`` otherwise." msgstr "" #: library/pathlib.rst:600 msgid "" -">>> PurePosixPath('b.py').match('*.PY')\n" -"False\n" -">>> PureWindowsPath('b.py').match('*.PY')\n" -"True" +"This method is similar to :meth:`~PurePath.full_match`, but empty patterns " +"aren't allowed (:exc:`ValueError` is raised), the recursive wildcard " +"\"``**``\" isn't supported (it acts like non-recursive \"``*``\"), and if a " +"relative pattern is provided, then matching is done from the right::" msgstr "" #: library/pathlib.rst:605 msgid "" -"Set *case_sensitive* to ``True`` or ``False`` to override this behaviour." +">>> PurePath('a/b.py').match('*.py')\n" +"True\n" +">>> PurePath('/a/b/c.py').match('b/*.py')\n" +"True\n" +">>> PurePath('/a/b/c.py').match('a/*.py')\n" +"False" +msgstr "" + +#: library/pathlib.rst:1310 library/pathlib.rst:1335 +msgid "The *pattern* parameter accepts a :term:`path-like object`." msgstr "" -#: library/pathlib.rst:1212 library/pathlib.rst:1240 +#: library/pathlib.rst:1304 library/pathlib.rst:1329 msgid "The *case_sensitive* parameter was added." msgstr "" -#: library/pathlib.rst:613 +#: library/pathlib.rst:621 msgid "" "Compute a version of this path relative to the path represented by *other*. " "If it's impossible, :exc:`ValueError` is raised::" msgstr "" -#: library/pathlib.rst:616 +#: library/pathlib.rst:624 msgid "" ">>> p = PurePosixPath('/etc/passwd')\n" ">>> p.relative_to('/')\n" @@ -869,7 +880,7 @@ msgid "" "relative and the other is absolute." msgstr "" -#: library/pathlib.rst:628 +#: library/pathlib.rst:636 msgid "" "When *walk_up* is false (the default), the path must start with *other*. " "When the argument is true, ``..`` entries may be added to form the relative " @@ -877,7 +888,7 @@ msgid "" "exc:`ValueError` is raised.::" msgstr "" -#: library/pathlib.rst:633 +#: library/pathlib.rst:641 msgid "" ">>> p.relative_to('/usr', walk_up=True)\n" "PurePosixPath('../etc/passwd')\n" @@ -890,7 +901,7 @@ msgid "" "relative and the other is absolute." msgstr "" -#: library/pathlib.rst:643 +#: library/pathlib.rst:651 msgid "" "This function is part of :class:`PurePath` and works with strings. It does " "not check or access the underlying file structure. This can impact the " @@ -898,25 +909,25 @@ msgid "" "call :meth:`~Path.resolve` first if necessary to resolve symlinks." msgstr "" -#: library/pathlib.rst:649 +#: library/pathlib.rst:657 msgid "" "The *walk_up* parameter was added (old behavior is the same as " "``walk_up=False``)." msgstr "" -#: library/pathlib.rst:654 +#: library/pathlib.rst:662 msgid "" "Passing additional positional arguments is deprecated; if supplied, they are " "joined with *other*." msgstr "" -#: library/pathlib.rst:659 +#: library/pathlib.rst:667 msgid "" "Return a new path with the :attr:`name` changed. If the original path " "doesn't have a name, ValueError is raised::" msgstr "" -#: library/pathlib.rst:662 +#: library/pathlib.rst:670 msgid "" ">>> p = PureWindowsPath('c:/Downloads/pathlib.tar.gz')\n" ">>> p.with_name('setup.py')\n" @@ -931,13 +942,13 @@ msgid "" "ValueError: PureWindowsPath('c:/') has an empty name" msgstr "" -#: library/pathlib.rst:676 +#: library/pathlib.rst:684 msgid "" "Return a new path with the :attr:`stem` changed. If the original path " "doesn't have a name, ValueError is raised::" msgstr "" -#: library/pathlib.rst:679 +#: library/pathlib.rst:687 msgid "" ">>> p = PureWindowsPath('c:/Downloads/draft.txt')\n" ">>> p.with_stem('final')\n" @@ -958,14 +969,14 @@ msgid "" "ValueError: PureWindowsPath('c:/') has an empty name" msgstr "" -#: library/pathlib.rst:700 +#: library/pathlib.rst:708 msgid "" "Return a new path with the :attr:`suffix` changed. If the original path " "doesn't have a suffix, the new *suffix* is appended instead. If the " "*suffix* is an empty string, the original suffix is removed::" msgstr "" -#: library/pathlib.rst:704 +#: library/pathlib.rst:712 msgid "" ">>> p = PureWindowsPath('c:/Downloads/pathlib.tar.gz')\n" ">>> p.with_suffix('.bz2')\n" @@ -978,7 +989,7 @@ msgid "" "PureWindowsPath('README')" msgstr "" -#: library/pathlib.rst:717 +#: library/pathlib.rst:725 msgid "" "Create a new path object of the same type by combining the given " "*pathsegments*. This method is called whenever a derivative path is created, " @@ -986,7 +997,7 @@ msgid "" "this method to pass information to derivative paths, for example::" msgstr "" -#: library/pathlib.rst:722 +#: library/pathlib.rst:730 msgid "" "from pathlib import PurePosixPath\n" "\n" @@ -1003,62 +1014,74 @@ msgid "" "print(hosts.session_id) # 42" msgstr "" -#: library/pathlib.rst:743 +#: library/pathlib.rst:751 msgid "Concrete paths" msgstr "" -#: library/pathlib.rst:745 +#: library/pathlib.rst:753 msgid "" "Concrete paths are subclasses of the pure path classes. In addition to " "operations provided by the latter, they also provide methods to do system " "calls on path objects. There are three ways to instantiate concrete paths:" msgstr "" -#: library/pathlib.rst:751 +#: library/pathlib.rst:759 msgid "" "A subclass of :class:`PurePath`, this class represents concrete paths of the " "system's path flavour (instantiating it creates either a :class:`PosixPath` " "or a :class:`WindowsPath`)::" msgstr "" -#: library/pathlib.rst:755 +#: library/pathlib.rst:763 msgid "" ">>> Path('setup.py')\n" "PosixPath('setup.py')" msgstr "" -#: library/pathlib.rst:762 +#: library/pathlib.rst:770 msgid "" "A subclass of :class:`Path` and :class:`PurePosixPath`, this class " "represents concrete non-Windows filesystem paths::" msgstr "" -#: library/pathlib.rst:765 +#: library/pathlib.rst:773 msgid "" ">>> PosixPath('/etc/hosts')\n" "PosixPath('/etc/hosts')" msgstr "" -#: library/pathlib.rst:772 +#: library/pathlib.rst:778 +msgid "" +"Raises :exc:`UnsupportedOperation` on Windows. In previous versions, :exc:" +"`NotImplementedError` was raised instead." +msgstr "" + +#: library/pathlib.rst:785 msgid "" "A subclass of :class:`Path` and :class:`PureWindowsPath`, this class " "represents concrete Windows filesystem paths::" msgstr "" -#: library/pathlib.rst:775 +#: library/pathlib.rst:788 msgid "" ">>> WindowsPath('c:/', 'Users', 'Ximénez')\n" "WindowsPath('c:/Users/Ximénez')" msgstr "" -#: library/pathlib.rst:780 +#: library/pathlib.rst:793 +msgid "" +"Raises :exc:`UnsupportedOperation` on non-Windows platforms. In previous " +"versions, :exc:`NotImplementedError` was raised instead." +msgstr "" + +#: library/pathlib.rst:798 msgid "" "You can only instantiate the class flavour that corresponds to your system " "(allowing system calls on non-compatible path flavours could lead to bugs or " "failures in your application)::" msgstr "" -#: library/pathlib.rst:784 +#: library/pathlib.rst:802 msgid "" ">>> import os\n" ">>> os.name\n" @@ -1072,65 +1095,147 @@ msgid "" " File \"\", line 1, in \n" " File \"pathlib.py\", line 798, in __new__\n" " % (cls.__name__,))\n" -"NotImplementedError: cannot instantiate 'WindowsPath' on your system" +"UnsupportedOperation: cannot instantiate 'WindowsPath' on your system" msgstr "" -#: library/pathlib.rst:798 +#: library/pathlib.rst:816 msgid "" "Some concrete path methods can raise an :exc:`OSError` if a system call " "fails (for example because the path doesn't exist)." msgstr "" -#: library/pathlib.rst:803 +#: library/pathlib.rst:821 +msgid "Parsing and generating URIs" +msgstr "" + +#: library/pathlib.rst:823 +msgid "" +"Concrete path objects can be created from, and represented as, 'file' URIs " +"conforming to :rfc:`8089`." +msgstr "" + +#: library/pathlib.rst:828 +msgid "" +"File URIs are not portable across machines with different :ref:`filesystem " +"encodings `." +msgstr "" + +#: library/pathlib.rst:833 +msgid "Return a new path object from parsing a 'file' URI. For example::" +msgstr "" + +#: library/pathlib.rst:835 +msgid "" +">>> p = Path.from_uri('file:///etc/hosts')\n" +"PosixPath('/etc/hosts')" +msgstr "" + +#: library/pathlib.rst:838 +msgid "On Windows, DOS device and UNC paths may be parsed from URIs::" +msgstr "" + +#: library/pathlib.rst:840 +msgid "" +">>> p = Path.from_uri('file:///c:/windows')\n" +"WindowsPath('c:/windows')\n" +">>> p = Path.from_uri('file://server/share')\n" +"WindowsPath('//server/share')" +msgstr "" + +#: library/pathlib.rst:845 +msgid "Several variant forms are supported::" +msgstr "" + +#: library/pathlib.rst:847 +msgid "" +">>> p = Path.from_uri('file:////server/share')\n" +"WindowsPath('//server/share')\n" +">>> p = Path.from_uri('file://///server/share')\n" +"WindowsPath('//server/share')\n" +">>> p = Path.from_uri('file:c:/windows')\n" +"WindowsPath('c:/windows')\n" +">>> p = Path.from_uri('file:/c|/windows')\n" +"WindowsPath('c:/windows')" +msgstr "" + +#: library/pathlib.rst:856 +msgid "" +":exc:`ValueError` is raised if the URI does not start with ``file:``, or the " +"parsed path isn't absolute." +msgstr "" + +#: library/pathlib.rst:864 +msgid "" +"Represent the path as a 'file' URI. :exc:`ValueError` is raised if the path " +"isn't absolute." +msgstr "" + +#: library/pathlib.rst:867 +msgid "" +">>> p = PosixPath('/etc/passwd')\n" +">>> p.as_uri()\n" +"'file:///etc/passwd'\n" +">>> p = WindowsPath('c:/Windows')\n" +">>> p.as_uri()\n" +"'file:///c:/Windows'" +msgstr "" + +#: library/pathlib.rst:876 +msgid "" +"For historical reasons, this method is also available from :class:`PurePath` " +"objects. However, its use of :func:`os.fsencode` makes it strictly impure." +msgstr "" + +#: library/pathlib.rst:882 msgid "Expanding and resolving paths" msgstr "" -#: library/pathlib.rst:807 +#: library/pathlib.rst:886 msgid "" "Return a new path object representing the user's home directory (as returned " "by :func:`os.path.expanduser` with ``~`` construct). If the home directory " "can't be resolved, :exc:`RuntimeError` is raised." msgstr "" -#: library/pathlib.rst:813 +#: library/pathlib.rst:892 msgid "" ">>> Path.home()\n" "PosixPath('/home/antoine')" msgstr "" -#: library/pathlib.rst:821 +#: library/pathlib.rst:900 msgid "" "Return a new path with expanded ``~`` and ``~user`` constructs, as returned " "by :meth:`os.path.expanduser`. If a home directory can't be resolved, :exc:" "`RuntimeError` is raised." msgstr "" -#: library/pathlib.rst:827 +#: library/pathlib.rst:906 msgid "" ">>> p = PosixPath('~/films/Monty Python')\n" ">>> p.expanduser()\n" "PosixPath('/home/eric/films/Monty Python')" msgstr "" -#: library/pathlib.rst:836 +#: library/pathlib.rst:915 msgid "" "Return a new path object representing the current directory (as returned by :" "func:`os.getcwd`)::" msgstr "" -#: library/pathlib.rst:839 +#: library/pathlib.rst:918 msgid "" ">>> Path.cwd()\n" "PosixPath('/home/antoine/pathlib')" msgstr "" -#: library/pathlib.rst:845 +#: library/pathlib.rst:924 msgid "" "Make the path absolute, without normalization or resolving symlinks. Returns " "a new path object::" msgstr "" -#: library/pathlib.rst:848 +#: library/pathlib.rst:927 msgid "" ">>> p = Path('tests')\n" ">>> p\n" @@ -1139,13 +1244,13 @@ msgid "" "PosixPath('/home/antoine/pathlib/tests')" msgstr "" -#: library/pathlib.rst:857 +#: library/pathlib.rst:936 msgid "" "Make the path absolute, resolving any symlinks. A new path object is " "returned::" msgstr "" -#: library/pathlib.rst:860 +#: library/pathlib.rst:939 msgid "" ">>> p = Path()\n" ">>> p\n" @@ -1154,39 +1259,45 @@ msgid "" "PosixPath('/home/antoine/pathlib')" msgstr "" -#: library/pathlib.rst:866 +#: library/pathlib.rst:945 msgid "" "\"``..``\" components are also eliminated (this is the only method to do " "so)::" msgstr "" -#: library/pathlib.rst:868 +#: library/pathlib.rst:947 msgid "" ">>> p = Path('docs/../setup.py')\n" ">>> p.resolve()\n" "PosixPath('/home/antoine/pathlib/setup.py')" msgstr "" -#: library/pathlib.rst:872 +#: library/pathlib.rst:951 msgid "" -"If the path doesn't exist and *strict* is ``True``, :exc:`FileNotFoundError` " -"is raised. If *strict* is ``False``, the path is resolved as far as " -"possible and any remainder is appended without checking whether it exists. " -"If an infinite loop is encountered along the resolution path, :exc:" -"`RuntimeError` is raised." +"If a path doesn't exist or a symlink loop is encountered, and *strict* is " +"``True``, :exc:`OSError` is raised. If *strict* is ``False``, the path is " +"resolved as far as possible and any remainder is appended without checking " +"whether it exists." msgstr "" -#: library/pathlib.rst:878 +#: library/pathlib.rst:956 msgid "The *strict* parameter was added (pre-3.6 behavior is strict)." msgstr "" -#: library/pathlib.rst:884 +#: library/pathlib.rst:959 +msgid "" +"Symlink loops are treated like other errors: :exc:`OSError` is raised in " +"strict mode, and no exception is raised in non-strict mode. In previous " +"versions, :exc:`RuntimeError` is raised no matter the value of *strict*." +msgstr "" + +#: library/pathlib.rst:967 msgid "" "Return the path to which the symbolic link points (as returned by :func:`os." "readlink`)::" msgstr "" -#: library/pathlib.rst:887 +#: library/pathlib.rst:970 msgid "" ">>> p = Path('mylink')\n" ">>> p.symlink_to('setup.py')\n" @@ -1194,11 +1305,17 @@ msgid "" "PosixPath('setup.py')" msgstr "" -#: library/pathlib.rst:896 +#: library/pathlib.rst:977 +msgid "" +"Raises :exc:`UnsupportedOperation` if :func:`os.readlink` is not available. " +"In previous versions, :exc:`NotImplementedError` was raised." +msgstr "" + +#: library/pathlib.rst:983 msgid "Querying file type and status" msgstr "" -#: library/pathlib.rst:900 +#: library/pathlib.rst:987 msgid "" ":meth:`~Path.exists`, :meth:`~Path.is_dir`, :meth:`~Path.is_file`, :meth:" "`~Path.is_mount`, :meth:`~Path.is_symlink`, :meth:`~Path.is_block_device`, :" @@ -1207,20 +1324,20 @@ msgid "" "characters unrepresentable at the OS level." msgstr "" -#: library/pathlib.rst:910 +#: library/pathlib.rst:997 msgid "" "Return an :class:`os.stat_result` object containing information about this " "path, like :func:`os.stat`. The result is looked up at each call to this " "method." msgstr "" -#: library/pathlib.rst:913 +#: library/pathlib.rst:1000 msgid "" "This method normally follows symlinks; to stat a symlink add the argument " "``follow_symlinks=False``, or use :meth:`~Path.lstat`." msgstr "" -#: library/pathlib.rst:918 +#: library/pathlib.rst:1005 msgid "" ">>> p = Path('setup.py')\n" ">>> p.stat().st_size\n" @@ -1229,27 +1346,28 @@ msgid "" "1327883547.852554" msgstr "" -#: library/pathlib.rst:952 library/pathlib.rst:1514 +#: library/pathlib.rst:1039 library/pathlib.rst:1069 library/pathlib.rst:1616 +#: library/pathlib.rst:1637 msgid "The *follow_symlinks* parameter was added." msgstr "" -#: library/pathlib.rst:930 +#: library/pathlib.rst:1017 msgid "" "Like :meth:`Path.stat` but, if the path points to a symbolic link, return " "the symbolic link's information rather than its target's." msgstr "" -#: library/pathlib.rst:936 +#: library/pathlib.rst:1023 msgid "Return ``True`` if the path points to an existing file or directory." msgstr "" -#: library/pathlib.rst:938 +#: library/pathlib.rst:1025 msgid "" "This method normally follows symlinks; to check if a symlink exists, add the " "argument ``follow_symlinks=False``." msgstr "" -#: library/pathlib.rst:943 +#: library/pathlib.rst:1030 msgid "" ">>> Path('.').exists()\n" "True\n" @@ -1261,42 +1379,54 @@ msgid "" "False" msgstr "" -#: library/pathlib.rst:958 +#: library/pathlib.rst:1045 msgid "" -"Return ``True`` if the path points to a regular file (or a symbolic link " -"pointing to a regular file), ``False`` if it points to another kind of file." +"Return ``True`` if the path points to a regular file, ``False`` if it points " +"to another kind of file." msgstr "" -#: library/pathlib.rst:970 library/pathlib.rst:1021 library/pathlib.rst:1039 +#: library/pathlib.rst:1063 library/pathlib.rst:1120 library/pathlib.rst:1138 msgid "" "``False`` is also returned if the path doesn't exist or is a broken symlink; " "other errors (such as permission errors) are propagated." msgstr "" -#: library/pathlib.rst:967 +#: library/pathlib.rst:1051 +msgid "" +"This method normally follows symlinks; to exclude symlinks, add the argument " +"``follow_symlinks=False``." +msgstr "" + +#: library/pathlib.rst:1060 +msgid "" +"Return ``True`` if the path points to a directory, ``False`` if it points to " +"another kind of file." +msgstr "" + +#: library/pathlib.rst:1066 msgid "" -"Return ``True`` if the path points to a directory (or a symbolic link " -"pointing to a directory), ``False`` if it points to another kind of file." +"This method normally follows symlinks; to exclude symlinks to directories, " +"add the argument ``follow_symlinks=False``." msgstr "" -#: library/pathlib.rst:976 +#: library/pathlib.rst:1075 msgid "" "Return ``True`` if the path points to a symbolic link, ``False`` otherwise." msgstr "" -#: library/pathlib.rst:978 +#: library/pathlib.rst:1077 msgid "" "``False`` is also returned if the path doesn't exist; other errors (such as " "permission errors) are propagated." msgstr "" -#: library/pathlib.rst:984 +#: library/pathlib.rst:1083 msgid "" "Return ``True`` if the path points to a junction, and ``False`` for any " "other type of file. Currently only Windows supports junctions." msgstr "" -#: library/pathlib.rst:992 +#: library/pathlib.rst:1091 msgid "" "Return ``True`` if the path is a :dfn:`mount point`: a point in a file " "system where a different file system has been mounted. On POSIX, the " @@ -1308,49 +1438,49 @@ msgid "" "mounted filesystem directory." msgstr "" -#: library/pathlib.rst:1003 +#: library/pathlib.rst:1102 msgid "Windows support was added." msgstr "" -#: library/pathlib.rst:1009 +#: library/pathlib.rst:1108 msgid "" "Return ``True`` if the path points to a Unix socket (or a symbolic link " "pointing to a Unix socket), ``False`` if it points to another kind of file." msgstr "" -#: library/pathlib.rst:1018 +#: library/pathlib.rst:1117 msgid "" "Return ``True`` if the path points to a FIFO (or a symbolic link pointing to " "a FIFO), ``False`` if it points to another kind of file." msgstr "" -#: library/pathlib.rst:1027 +#: library/pathlib.rst:1126 msgid "" "Return ``True`` if the path points to a block device (or a symbolic link " "pointing to a block device), ``False`` if it points to another kind of file." msgstr "" -#: library/pathlib.rst:1036 +#: library/pathlib.rst:1135 msgid "" "Return ``True`` if the path points to a character device (or a symbolic link " "pointing to a character device), ``False`` if it points to another kind of " "file." msgstr "" -#: library/pathlib.rst:1045 +#: library/pathlib.rst:1144 msgid "" "Return whether this path points to the same file as *other_path*, which can " "be either a Path object, or a string. The semantics are similar to :func:" "`os.path.samefile` and :func:`os.path.samestat`." msgstr "" -#: library/pathlib.rst:1049 +#: library/pathlib.rst:1148 msgid "" "An :exc:`OSError` can be raised if either file cannot be accessed for some " "reason." msgstr "" -#: library/pathlib.rst:1054 +#: library/pathlib.rst:1153 msgid "" ">>> p = Path('spam')\n" ">>> q = Path('eggs')\n" @@ -1360,17 +1490,17 @@ msgid "" "True" msgstr "" -#: library/pathlib.rst:1065 +#: library/pathlib.rst:1164 msgid "Reading and writing files" msgstr "" -#: library/pathlib.rst:1070 +#: library/pathlib.rst:1169 msgid "" "Open the file pointed to by the path, like the built-in :func:`open` " "function does::" msgstr "" -#: library/pathlib.rst:1073 +#: library/pathlib.rst:1172 msgid "" ">>> p = Path('setup.py')\n" ">>> with p.open() as f:\n" @@ -1379,11 +1509,11 @@ msgid "" "'#!/usr/bin/env python3\\n'" msgstr "" -#: library/pathlib.rst:1082 +#: library/pathlib.rst:1181 msgid "Return the decoded contents of the pointed-to file as a string::" msgstr "" -#: library/pathlib.rst:1114 +#: library/pathlib.rst:1216 msgid "" ">>> p = Path('my_text_file')\n" ">>> p.write_text('Text file contents')\n" @@ -1392,17 +1522,21 @@ msgid "" "'Text file contents'" msgstr "" -#: library/pathlib.rst:1090 +#: library/pathlib.rst:1189 msgid "" "The file is opened and then closed. The optional parameters have the same " "meaning as in :func:`open`." msgstr "" -#: library/pathlib.rst:1098 +#: library/pathlib.rst:1227 +msgid "The *newline* parameter was added." +msgstr "" + +#: library/pathlib.rst:1200 msgid "Return the binary contents of the pointed-to file as a bytes object::" msgstr "" -#: library/pathlib.rst:1134 +#: library/pathlib.rst:1236 msgid "" ">>> p = Path('my_binary_file')\n" ">>> p.write_bytes(b'Binary file contents')\n" @@ -1411,43 +1545,39 @@ msgid "" "b'Binary file contents'" msgstr "" -#: library/pathlib.rst:1111 +#: library/pathlib.rst:1213 msgid "" "Open the file pointed to in text mode, write *data* to it, and close the " "file::" msgstr "" -#: library/pathlib.rst:1120 +#: library/pathlib.rst:1222 msgid "" "An existing file of the same name is overwritten. The optional parameters " "have the same meaning as in :func:`open`." msgstr "" -#: library/pathlib.rst:1125 -msgid "The *newline* parameter was added." -msgstr "" - -#: library/pathlib.rst:1131 +#: library/pathlib.rst:1233 msgid "" "Open the file pointed to in bytes mode, write *data* to it, and close the " "file::" msgstr "" -#: library/pathlib.rst:1140 +#: library/pathlib.rst:1242 msgid "An existing file of the same name is overwritten." msgstr "" -#: library/pathlib.rst:1146 +#: library/pathlib.rst:1248 msgid "Reading directories" msgstr "" -#: library/pathlib.rst:1150 +#: library/pathlib.rst:1252 msgid "" "When the path points to a directory, yield path objects of the directory " "contents::" msgstr "" -#: library/pathlib.rst:1153 +#: library/pathlib.rst:1255 msgid "" ">>> p = Path('docs')\n" ">>> for child in p.iterdir(): child\n" @@ -1461,7 +1591,7 @@ msgid "" "PosixPath('docs/Makefile')" msgstr "" -#: library/pathlib.rst:1164 +#: library/pathlib.rst:1266 msgid "" "The children are yielded in arbitrary order, and the special entries ``'.'`` " "and ``'..'`` are not included. If a file is removed from or added to the " @@ -1469,36 +1599,25 @@ msgid "" "object for that file is included." msgstr "" -#: library/pathlib.rst:1169 +#: library/pathlib.rst:1271 msgid "" "If the path is not a directory or otherwise inaccessible, :exc:`OSError` is " "raised." msgstr "" -#: library/pathlib.rst:1174 +#: library/pathlib.rst:1276 msgid "" "Glob the given relative *pattern* in the directory represented by this path, " "yielding all matching files (of any kind)::" msgstr "" -#: library/pathlib.rst:1177 +#: library/pathlib.rst:1279 msgid "" ">>> sorted(Path('.').glob('*.py'))\n" "[PosixPath('pathlib.py'), PosixPath('setup.py'), PosixPath('test_pathlib." "py')]\n" ">>> sorted(Path('.').glob('*/*.py'))\n" -"[PosixPath('docs/conf.py')]" -msgstr "" - -#: library/pathlib.rst:1182 -msgid "" -"Patterns are the same as for :mod:`fnmatch`, with the addition of \"``**``\" " -"which means \"this directory and all subdirectories, recursively\". In " -"other words, it enables recursive globbing::" -msgstr "" - -#: library/pathlib.rst:1186 -msgid "" +"[PosixPath('docs/conf.py')]\n" ">>> sorted(Path('.').glob('**/*.py'))\n" "[PosixPath('build/lib/pathlib.py'),\n" " PosixPath('docs/conf.py'),\n" @@ -1507,14 +1626,7 @@ msgid "" " PosixPath('test_pathlib.py')]" msgstr "" -#: library/pathlib.rst:1193 -msgid "" -"This method calls :meth:`Path.is_dir` on the top-level directory and " -"propagates any :exc:`OSError` exception that is raised. Subsequent :exc:" -"`OSError` exceptions from scanning directories are suppressed." -msgstr "" - -#: library/pathlib.rst:1229 +#: library/pathlib.rst:1293 msgid "" "By default, or when the *case_sensitive* keyword-only argument is set to " "``None``, this method matches paths using platform-specific casing rules: " @@ -1522,61 +1634,60 @@ msgid "" "*case_sensitive* to ``True`` or ``False`` to override this behaviour." msgstr "" -#: library/pathlib.rst:1203 +#: library/pathlib.rst:1298 msgid "" -"Using the \"``**``\" pattern in large directory trees may consume an " -"inordinate amount of time." +"By default, or when the *recurse_symlinks* keyword-only argument is set to " +"``False``, this method follows symlinks except when expanding \"``**``\" " +"wildcards. Set *recurse_symlinks* to ``True`` to always follow symlinks." msgstr "" -#: library/pathlib.rst:1206 +#: library/pathlib.rst:1302 msgid "" "Raises an :ref:`auditing event ` ``pathlib.Path.glob`` with " "arguments ``self``, ``pattern``." msgstr "" -#: library/pathlib.rst:1236 +#: library/pathlib.rst:1332 +msgid "The *recurse_symlinks* parameter was added." +msgstr "" + +#: library/pathlib.rst:1313 msgid "" -"Return only directories if *pattern* ends with a pathname components " -"separator (:data:`~os.sep` or :data:`~os.altsep`)." +"Any :exc:`OSError` exceptions raised from scanning the filesystem are " +"suppressed. In previous versions, such exceptions are suppressed in many " +"cases, but not all." msgstr "" -#: library/pathlib.rst:1218 +#: library/pathlib.rst:1321 msgid "" "Glob the given relative *pattern* recursively. This is like calling :func:" -"`Path.glob` with \"``**/``\" added in front of the *pattern*, where " -"*patterns* are the same as for :mod:`fnmatch`::" +"`Path.glob` with \"``**/``\" added in front of the *pattern*." msgstr "" -#: library/pathlib.rst:1222 -msgid "" -">>> sorted(Path().rglob(\"*.py\"))\n" -"[PosixPath('build/lib/pathlib.py'),\n" -" PosixPath('docs/conf.py'),\n" -" PosixPath('pathlib.py'),\n" -" PosixPath('setup.py'),\n" -" PosixPath('test_pathlib.py')]" +#: library/pathlib.rst:1325 +msgid ":ref:`pathlib-pattern-language` and :meth:`Path.glob` documentation." msgstr "" -#: library/pathlib.rst:1234 +#: library/pathlib.rst:1327 msgid "" "Raises an :ref:`auditing event ` ``pathlib.Path.rglob`` with " "arguments ``self``, ``pattern``." msgstr "" -#: library/pathlib.rst:1246 +#: library/pathlib.rst:1341 msgid "" "Generate the file names in a directory tree by walking the tree either top-" "down or bottom-up." msgstr "" -#: library/pathlib.rst:1249 +#: library/pathlib.rst:1344 msgid "" "For each directory in the directory tree rooted at *self* (including *self* " "but excluding '.' and '..'), the method yields a 3-tuple of ``(dirpath, " "dirnames, filenames)``." msgstr "" -#: library/pathlib.rst:1253 +#: library/pathlib.rst:1348 msgid "" "*dirpath* is a :class:`Path` to the directory currently being walked, " "*dirnames* is a list of strings for the names of subdirectories in *dirpath* " @@ -1586,7 +1697,7 @@ msgid "" "name``. Whether or not the lists are sorted is file system-dependent." msgstr "" -#: library/pathlib.rst:1261 +#: library/pathlib.rst:1356 msgid "" "If the optional argument *top_down* is true (which is the default), the " "triple for a directory is generated before the triples for any of its " @@ -1597,7 +1708,7 @@ msgid "" "the directory and its subdirectories are walked." msgstr "" -#: library/pathlib.rst:1269 +#: library/pathlib.rst:1364 msgid "" "When *top_down* is true, the caller can modify the *dirnames* list in-place " "(for example, using :keyword:`del` or slice assignment), and :meth:`Path." @@ -1610,7 +1721,7 @@ msgid "" "generated by the time *dirnames* is yielded to the caller." msgstr "" -#: library/pathlib.rst:1279 +#: library/pathlib.rst:1374 msgid "" "By default, errors from :func:`os.scandir` are ignored. If the optional " "argument *on_error* is specified, it should be a callable; it will be called " @@ -1619,7 +1730,7 @@ msgid "" "filename is available as the ``filename`` attribute of the exception object." msgstr "" -#: library/pathlib.rst:1285 +#: library/pathlib.rst:1380 msgid "" "By default, :meth:`Path.walk` does not follow symbolic links, and instead " "adds them to the *filenames* list. Set *follow_symlinks* to true to resolve " @@ -1628,14 +1739,14 @@ msgid "" "(where supported)." msgstr "" -#: library/pathlib.rst:1292 +#: library/pathlib.rst:1387 msgid "" "Be aware that setting *follow_symlinks* to true can lead to infinite " "recursion if a link points to a parent directory of itself. :meth:`Path." "walk` does not keep track of the directories it has already visited." msgstr "" -#: library/pathlib.rst:1297 +#: library/pathlib.rst:1392 msgid "" ":meth:`Path.walk` assumes the directories it walks are not modified during " "execution. For example, if a directory from *dirnames* has been replaced " @@ -1644,19 +1755,19 @@ msgid "" "*dirnames* as appropriate." msgstr "" -#: library/pathlib.rst:1305 +#: library/pathlib.rst:1400 msgid "" "Unlike :func:`os.walk`, :meth:`Path.walk` lists symlinks to directories in " "*filenames* if *follow_symlinks* is false." msgstr "" -#: library/pathlib.rst:1308 +#: library/pathlib.rst:1403 msgid "" "This example displays the number of bytes used by all files in each " "directory, while ignoring ``__pycache__`` directories::" msgstr "" -#: library/pathlib.rst:1311 +#: library/pathlib.rst:1406 msgid "" "from pathlib import Path\n" "for root, dirs, files in Path(\"cpython/Lib/concurrent\")." @@ -1673,14 +1784,14 @@ msgid "" " dirs.remove('__pycache__')" msgstr "" -#: library/pathlib.rst:1324 +#: library/pathlib.rst:1419 msgid "" "This next example is a simple implementation of :func:`shutil.rmtree`. " "Walking the tree bottom-up is essential as :func:`rmdir` doesn't allow " "deleting a directory before it is empty::" msgstr "" -#: library/pathlib.rst:1328 +#: library/pathlib.rst:1423 msgid "" "# Delete everything reachable from the directory \"top\".\n" "# CAUTION: This is dangerous! For example, if top == Path('/'),\n" @@ -1692,11 +1803,11 @@ msgid "" " (root / name).rmdir()" msgstr "" -#: library/pathlib.rst:1341 +#: library/pathlib.rst:1436 msgid "Creating files and directories" msgstr "" -#: library/pathlib.rst:1345 +#: library/pathlib.rst:1440 msgid "" "Create a file at this given path. If *mode* is given, it is combined with " "the process's ``umask`` value to determine the file mode and access flags. " @@ -1705,54 +1816,54 @@ msgid "" "`FileExistsError` is raised." msgstr "" -#: library/pathlib.rst:1352 +#: library/pathlib.rst:1447 msgid "" "The :meth:`~Path.open`, :meth:`~Path.write_text` and :meth:`~Path." "write_bytes` methods are often used to create files." msgstr "" -#: library/pathlib.rst:1358 +#: library/pathlib.rst:1453 msgid "" "Create a new directory at this given path. If *mode* is given, it is " "combined with the process's ``umask`` value to determine the file mode and " "access flags. If the path already exists, :exc:`FileExistsError` is raised." msgstr "" -#: library/pathlib.rst:1363 +#: library/pathlib.rst:1458 msgid "" "If *parents* is true, any missing parents of this path are created as " "needed; they are created with the default permissions without taking *mode* " "into account (mimicking the POSIX ``mkdir -p`` command)." msgstr "" -#: library/pathlib.rst:1367 +#: library/pathlib.rst:1462 msgid "" "If *parents* is false (the default), a missing parent raises :exc:" "`FileNotFoundError`." msgstr "" -#: library/pathlib.rst:1370 +#: library/pathlib.rst:1465 msgid "" "If *exist_ok* is false (the default), :exc:`FileExistsError` is raised if " "the target directory already exists." msgstr "" -#: library/pathlib.rst:1373 +#: library/pathlib.rst:1468 msgid "" "If *exist_ok* is true, :exc:`FileExistsError` will not be raised unless the " "given path already exists in the file system and is not a directory (same " "behavior as the POSIX ``mkdir -p`` command)." msgstr "" -#: library/pathlib.rst:1377 +#: library/pathlib.rst:1472 msgid "The *exist_ok* parameter was added." msgstr "" -#: library/pathlib.rst:1383 +#: library/pathlib.rst:1478 msgid "Make this path a symbolic link pointing to *target*." msgstr "" -#: library/pathlib.rst:1385 +#: library/pathlib.rst:1480 msgid "" "On Windows, a symlink represents either a file or a directory, and does not " "morph to the target dynamically. If the target is present, the type of the " @@ -1761,7 +1872,7 @@ msgid "" "otherwise. On non-Windows platforms, *target_is_directory* is ignored." msgstr "" -#: library/pathlib.rst:1393 +#: library/pathlib.rst:1488 msgid "" ">>> p = Path('mylink')\n" ">>> p.symlink_to('setup.py')\n" @@ -1773,25 +1884,37 @@ msgid "" "8" msgstr "" -#: library/pathlib.rst:1403 +#: library/pathlib.rst:1498 msgid "" "The order of arguments (link, target) is the reverse of :func:`os.symlink`'s." msgstr "" -#: library/pathlib.rst:1409 +#: library/pathlib.rst:1501 +msgid "" +"Raises :exc:`UnsupportedOperation` if :func:`os.symlink` is not available. " +"In previous versions, :exc:`NotImplementedError` was raised." +msgstr "" + +#: library/pathlib.rst:1508 msgid "Make this path a hard link to the same file as *target*." msgstr "" -#: library/pathlib.rst:1412 +#: library/pathlib.rst:1511 msgid "" "The order of arguments (link, target) is the reverse of :func:`os.link`'s." msgstr "" -#: library/pathlib.rst:1419 +#: library/pathlib.rst:1516 +msgid "" +"Raises :exc:`UnsupportedOperation` if :func:`os.link` is not available. In " +"previous versions, :exc:`NotImplementedError` was raised." +msgstr "" + +#: library/pathlib.rst:1522 msgid "Renaming and deleting" msgstr "" -#: library/pathlib.rst:1423 +#: library/pathlib.rst:1526 msgid "" "Rename this file or directory to the given *target*, and return a new :class:" "`!Path` instance pointing to *target*. On Unix, if *target* exists and is a " @@ -1800,7 +1923,7 @@ msgid "" "either a string or another path object::" msgstr "" -#: library/pathlib.rst:1429 +#: library/pathlib.rst:1532 msgid "" ">>> p = Path('foo')\n" ">>> p.open('w').write('some text')\n" @@ -1812,84 +1935,108 @@ msgid "" "'some text'" msgstr "" -#: library/pathlib.rst:1454 +#: library/pathlib.rst:1557 msgid "" "The target path may be absolute or relative. Relative paths are interpreted " "relative to the current working directory, *not* the directory of the :class:" "`!Path` object." msgstr "" -#: library/pathlib.rst:1442 +#: library/pathlib.rst:1545 msgid "" "It is implemented in terms of :func:`os.rename` and gives the same " "guarantees." msgstr "" -#: library/pathlib.rst:1458 +#: library/pathlib.rst:1561 msgid "Added return value, return the new :class:`!Path` instance." msgstr "" -#: library/pathlib.rst:1450 +#: library/pathlib.rst:1553 msgid "" "Rename this file or directory to the given *target*, and return a new :class:" "`!Path` instance pointing to *target*. If *target* points to an existing " "file or empty directory, it will be unconditionally replaced." msgstr "" -#: library/pathlib.rst:1464 +#: library/pathlib.rst:1567 msgid "" "Remove this file or symbolic link. If the path points to a directory, use :" "func:`Path.rmdir` instead." msgstr "" -#: library/pathlib.rst:1467 +#: library/pathlib.rst:1570 msgid "" "If *missing_ok* is false (the default), :exc:`FileNotFoundError` is raised " "if the path does not exist." msgstr "" -#: library/pathlib.rst:1470 +#: library/pathlib.rst:1573 msgid "" "If *missing_ok* is true, :exc:`FileNotFoundError` exceptions will be ignored " "(same behavior as the POSIX ``rm -f`` command)." msgstr "" -#: library/pathlib.rst:1473 +#: library/pathlib.rst:1576 msgid "The *missing_ok* parameter was added." msgstr "" -#: library/pathlib.rst:1479 +#: library/pathlib.rst:1582 msgid "Remove this directory. The directory must be empty." msgstr "" -#: library/pathlib.rst:1483 +#: library/pathlib.rst:1586 msgid "Permissions and ownership" msgstr "" -#: library/pathlib.rst:1487 +#: library/pathlib.rst:1590 msgid "" -"Return the name of the user owning the file. :exc:`KeyError` is raised if " +"Return the name of the user owning the file. :exc:`KeyError` is raised if " "the file's user identifier (UID) isn't found in the system database." msgstr "" -#: library/pathlib.rst:1493 +#: library/pathlib.rst:1593 +msgid "" +"This method normally follows symlinks; to get the owner of the symlink, add " +"the argument ``follow_symlinks=False``." +msgstr "" + +#: library/pathlib.rst:1596 +msgid "" +"Raises :exc:`UnsupportedOperation` if the :mod:`pwd` module is not " +"available. In earlier versions, :exc:`NotImplementedError` was raised." +msgstr "" + +#: library/pathlib.rst:1606 msgid "" -"Return the name of the group owning the file. :exc:`KeyError` is raised if " +"Return the name of the group owning the file. :exc:`KeyError` is raised if " "the file's group identifier (GID) isn't found in the system database." msgstr "" -#: library/pathlib.rst:1499 +#: library/pathlib.rst:1609 +msgid "" +"This method normally follows symlinks; to get the group of the symlink, add " +"the argument ``follow_symlinks=False``." +msgstr "" + +#: library/pathlib.rst:1612 +msgid "" +"Raises :exc:`UnsupportedOperation` if the :mod:`grp` module is not " +"available. In earlier versions, :exc:`NotImplementedError` was raised." +msgstr "" + +#: library/pathlib.rst:1622 msgid "Change the file mode and permissions, like :func:`os.chmod`." msgstr "" -#: library/pathlib.rst:1501 +#: library/pathlib.rst:1624 msgid "" "This method normally follows symlinks. Some Unix flavours support changing " "permissions on the symlink itself; on these platforms you may add the " "argument ``follow_symlinks=False``, or use :meth:`~Path.lchmod`." msgstr "" -#: library/pathlib.rst:1507 +#: library/pathlib.rst:1630 msgid "" ">>> p = Path('setup.py')\n" ">>> p.stat().st_mode\n" @@ -1899,283 +2046,531 @@ msgid "" "33060" msgstr "" -#: library/pathlib.rst:1520 +#: library/pathlib.rst:1643 msgid "" "Like :meth:`Path.chmod` but, if the path points to a symbolic link, the " "symbolic link's mode is changed rather than its target's." msgstr "" -#: library/pathlib.rst:1525 -msgid "Correspondence to tools in the :mod:`os` module" +#: library/pathlib.rst:1650 +msgid "Pattern language" msgstr "" -#: library/pathlib.rst:1527 +#: library/pathlib.rst:1652 +msgid "" +"The following wildcards are supported in patterns for :meth:`~PurePath." +"full_match`, :meth:`~Path.glob` and :meth:`~Path.rglob`:" +msgstr "" + +#: library/pathlib.rst:1655 +msgid "``**`` (entire segment)" +msgstr "" + +#: library/pathlib.rst:1656 +msgid "Matches any number of file or directory segments, including zero." +msgstr "" + +#: library/pathlib.rst:1657 +msgid "``*`` (entire segment)" +msgstr "" + +#: library/pathlib.rst:1658 +msgid "Matches one file or directory segment." +msgstr "" + +#: library/pathlib.rst:1659 +msgid "``*`` (part of a segment)" +msgstr "" + +#: library/pathlib.rst:1660 +msgid "Matches any number of non-separator characters, including zero." +msgstr "" + +#: library/pathlib.rst:1661 +msgid "``?``" +msgstr "" + +#: library/pathlib.rst:1662 +msgid "Matches one non-separator character." +msgstr "" + +#: library/pathlib.rst:1663 +msgid "``[seq]``" +msgstr "" + +#: library/pathlib.rst:1664 +msgid "Matches one character in *seq*." +msgstr "" + +#: library/pathlib.rst:1665 +msgid "``[!seq]``" +msgstr "" + +#: library/pathlib.rst:1666 +msgid "Matches one character not in *seq*." +msgstr "" + +#: library/pathlib.rst:1668 +msgid "" +"For a literal match, wrap the meta-characters in brackets. For example, " +"``\"[?]\"`` matches the character ``\"?\"``." +msgstr "" + +#: library/pathlib.rst:1671 +msgid "The \"``**``\" wildcard enables recursive globbing. A few examples:" +msgstr "" + +#: library/pathlib.rst:1674 +msgid "Pattern" +msgstr "" + +#: library/pathlib.rst:1674 +msgid "Meaning" +msgstr "" + +#: library/pathlib.rst:1676 +msgid "\"``**/*``\"" +msgstr "" + +#: library/pathlib.rst:1676 +msgid "Any path with at least one segment." +msgstr "" + +#: library/pathlib.rst:1677 +msgid "\"``**/*.py``\"" +msgstr "" + +#: library/pathlib.rst:1677 +msgid "Any path with a final segment ending \"``.py``\"." +msgstr "" + +#: library/pathlib.rst:1678 +msgid "\"``assets/**``\"" +msgstr "" + +#: library/pathlib.rst:1678 +msgid "Any path starting with \"``assets/``\"." +msgstr "" + +#: library/pathlib.rst:1679 +msgid "\"``assets/**/*``\"" +msgstr "" + +#: library/pathlib.rst:1679 +msgid "" +"Any path starting with \"``assets/``\", excluding \"``assets/``\" itself." +msgstr "" + +#: library/pathlib.rst:1683 +msgid "" +"Globbing with the \"``**``\" wildcard visits every directory in the tree. " +"Large directory trees may take a long time to search." +msgstr "" + +#: library/pathlib.rst:1686 +msgid "" +"Globbing with a pattern that ends with \"``**``\" returns both files and " +"directories. In previous versions, only directories were returned." +msgstr "" + +#: library/pathlib.rst:1690 +msgid "" +"In :meth:`Path.glob` and :meth:`~Path.rglob`, a trailing slash may be added " +"to the pattern to match only directories." +msgstr "" + +#: library/pathlib.rst:1693 +msgid "" +"Globbing with a pattern that ends with a pathname components separator (:" +"data:`~os.sep` or :data:`~os.altsep`) returns only directories." +msgstr "" + +#: library/pathlib.rst:1699 +msgid "Comparison to the :mod:`glob` module" +msgstr "" + +#: library/pathlib.rst:1701 +msgid "" +"The patterns accepted and results generated by :meth:`Path.glob` and :meth:" +"`Path.rglob` differ slightly from those by the :mod:`glob` module:" +msgstr "" + +#: library/pathlib.rst:1704 +msgid "" +"Files beginning with a dot are not special in pathlib. This is like passing " +"``include_hidden=True`` to :func:`glob.glob`." +msgstr "" + +#: library/pathlib.rst:1706 +msgid "" +"\"``**``\" pattern components are always recursive in pathlib. This is like " +"passing ``recursive=True`` to :func:`glob.glob`." +msgstr "" + +#: library/pathlib.rst:1708 +msgid "" +"\"``**``\" pattern components do not follow symlinks by default in pathlib. " +"This behaviour has no equivalent in :func:`glob.glob`, but you can pass " +"``recurse_symlinks=True`` to :meth:`Path.glob` for compatible behaviour." +msgstr "" + +#: library/pathlib.rst:1711 +msgid "" +"Like all :class:`PurePath` and :class:`Path` objects, the values returned " +"from :meth:`Path.glob` and :meth:`Path.rglob` don't include trailing slashes." +msgstr "" + +#: library/pathlib.rst:1714 +msgid "" +"The values returned from pathlib's ``path.glob()`` and ``path.rglob()`` " +"include the *path* as a prefix, unlike the results of ``glob." +"glob(root_dir=path)``." +msgstr "" + +#: library/pathlib.rst:1717 +msgid "" +"The values returned from pathlib's ``path.glob()`` and ``path.rglob()`` may " +"include *path* itself, for example when globbing \"``**``\", whereas the " +"results of ``glob.glob(root_dir=path)`` never include an empty string that " +"would correspond to *path*." +msgstr "" + +#: library/pathlib.rst:1724 +msgid "Comparison to the :mod:`os` and :mod:`os.path` modules" +msgstr "" + +#: library/pathlib.rst:1726 +msgid "" +"pathlib implements path operations using :class:`PurePath` and :class:`Path` " +"objects, and so it's said to be *object-oriented*. On the other hand, the :" +"mod:`os` and :mod:`os.path` modules supply functions that work with low-" +"level ``str`` and ``bytes`` objects, which is a more *procedural* approach. " +"Some users consider the object-oriented style to be more readable." +msgstr "" + +#: library/pathlib.rst:1732 +msgid "" +"Many functions in :mod:`os` and :mod:`os.path` support ``bytes`` paths and :" +"ref:`paths relative to directory descriptors `. These features " +"aren't available in pathlib." +msgstr "" + +#: library/pathlib.rst:1736 +msgid "" +"Python's ``str`` and ``bytes`` types, and portions of the :mod:`os` and :mod:" +"`os.path` modules, are written in C and are very speedy. pathlib is written " +"in pure Python and is often slower, but rarely slow enough to matter." +msgstr "" + +#: library/pathlib.rst:1740 +msgid "" +"pathlib's path normalization is slightly more opinionated and consistent " +"than :mod:`os.path`. For example, whereas :func:`os.path.abspath` eliminates " +"\"``..``\" segments from a path, which may change its meaning if symlinks " +"are involved, :meth:`Path.absolute` preserves these segments for greater " +"safety." +msgstr "" + +#: library/pathlib.rst:1745 +msgid "" +"pathlib's path normalization may render it unsuitable for some applications:" +msgstr "" + +#: library/pathlib.rst:1747 +msgid "" +"pathlib normalizes ``Path(\"my_folder/\")`` to ``Path(\"my_folder\")``, " +"which changes a path's meaning when supplied to various operating system " +"APIs and command-line utilities. Specifically, the absence of a trailing " +"separator may allow the path to be resolved as either a file or directory, " +"rather than a directory only." +msgstr "" + +#: library/pathlib.rst:1752 +msgid "" +"pathlib normalizes ``Path(\"./my_program\")`` to ``Path(\"my_program\")``, " +"which changes a path's meaning when used as an executable search path, such " +"as in a shell or when spawning a child process. Specifically, the absence of " +"a separator in the path may force it to be looked up in :envvar:`PATH` " +"rather than the current directory." +msgstr "" + +#: library/pathlib.rst:1758 +msgid "" +"As a consequence of these differences, pathlib is not a drop-in replacement " +"for :mod:`os.path`." +msgstr "" + +#: library/pathlib.rst:1763 +msgid "Corresponding tools" +msgstr "" + +#: library/pathlib.rst:1765 msgid "" "Below is a table mapping various :mod:`os` functions to their corresponding :" "class:`PurePath`/:class:`Path` equivalent." msgstr "" -#: library/pathlib.rst:1531 +#: library/pathlib.rst:1769 msgid ":mod:`os` and :mod:`os.path`" msgstr "" -#: library/pathlib.rst:1531 +#: library/pathlib.rst:1769 msgid ":mod:`pathlib`" msgstr "" -#: library/pathlib.rst:1533 +#: library/pathlib.rst:1771 msgid ":func:`os.path.dirname`" msgstr "" -#: library/pathlib.rst:1533 +#: library/pathlib.rst:1771 msgid ":attr:`PurePath.parent`" msgstr "" -#: library/pathlib.rst:1534 +#: library/pathlib.rst:1772 msgid ":func:`os.path.basename`" msgstr "" -#: library/pathlib.rst:1534 +#: library/pathlib.rst:1772 msgid ":attr:`PurePath.name`" msgstr "" -#: library/pathlib.rst:1535 +#: library/pathlib.rst:1773 msgid ":func:`os.path.splitext`" msgstr "" -#: library/pathlib.rst:1535 +#: library/pathlib.rst:1773 msgid ":attr:`PurePath.stem`, :attr:`PurePath.suffix`" msgstr "" -#: library/pathlib.rst:1536 +#: library/pathlib.rst:1774 msgid ":func:`os.path.join`" msgstr "" -#: library/pathlib.rst:1536 +#: library/pathlib.rst:1774 msgid ":meth:`PurePath.joinpath`" msgstr "" -#: library/pathlib.rst:1537 +#: library/pathlib.rst:1775 msgid ":func:`os.path.isabs`" msgstr "" -#: library/pathlib.rst:1537 +#: library/pathlib.rst:1775 msgid ":meth:`PurePath.is_absolute`" msgstr "" -#: library/pathlib.rst:1538 +#: library/pathlib.rst:1776 msgid ":func:`os.path.relpath`" msgstr "" -#: library/pathlib.rst:1538 +#: library/pathlib.rst:1776 msgid ":meth:`PurePath.relative_to` [1]_" msgstr "" -#: library/pathlib.rst:1539 +#: library/pathlib.rst:1777 msgid ":func:`os.path.expanduser`" msgstr "" -#: library/pathlib.rst:1539 +#: library/pathlib.rst:1777 msgid ":meth:`Path.expanduser` [2]_" msgstr "" -#: library/pathlib.rst:1540 +#: library/pathlib.rst:1778 msgid ":func:`os.path.realpath`" msgstr "" -#: library/pathlib.rst:1540 +#: library/pathlib.rst:1778 msgid ":meth:`Path.resolve`" msgstr "" -#: library/pathlib.rst:1541 +#: library/pathlib.rst:1779 msgid ":func:`os.path.abspath`" msgstr "" -#: library/pathlib.rst:1541 +#: library/pathlib.rst:1779 msgid ":meth:`Path.absolute` [3]_" msgstr "" -#: library/pathlib.rst:1542 +#: library/pathlib.rst:1780 msgid ":func:`os.path.exists`" msgstr "" -#: library/pathlib.rst:1542 +#: library/pathlib.rst:1780 msgid ":meth:`Path.exists`" msgstr "" -#: library/pathlib.rst:1543 +#: library/pathlib.rst:1781 msgid ":func:`os.path.isfile`" msgstr "" -#: library/pathlib.rst:1543 +#: library/pathlib.rst:1781 msgid ":meth:`Path.is_file`" msgstr "" -#: library/pathlib.rst:1544 +#: library/pathlib.rst:1782 msgid ":func:`os.path.isdir`" msgstr "" -#: library/pathlib.rst:1544 +#: library/pathlib.rst:1782 msgid ":meth:`Path.is_dir`" msgstr "" -#: library/pathlib.rst:1545 +#: library/pathlib.rst:1783 msgid ":func:`os.path.islink`" msgstr "" -#: library/pathlib.rst:1545 +#: library/pathlib.rst:1783 msgid ":meth:`Path.is_symlink`" msgstr "" -#: library/pathlib.rst:1546 +#: library/pathlib.rst:1784 msgid ":func:`os.path.isjunction`" msgstr "" -#: library/pathlib.rst:1546 +#: library/pathlib.rst:1784 msgid ":meth:`Path.is_junction`" msgstr "" -#: library/pathlib.rst:1547 +#: library/pathlib.rst:1785 msgid ":func:`os.path.ismount`" msgstr "" -#: library/pathlib.rst:1547 +#: library/pathlib.rst:1785 msgid ":meth:`Path.is_mount`" msgstr "" -#: library/pathlib.rst:1548 +#: library/pathlib.rst:1786 msgid ":func:`os.path.samefile`" msgstr "" -#: library/pathlib.rst:1548 +#: library/pathlib.rst:1786 msgid ":meth:`Path.samefile`" msgstr "" -#: library/pathlib.rst:1549 +#: library/pathlib.rst:1787 msgid ":func:`os.getcwd`" msgstr "" -#: library/pathlib.rst:1549 +#: library/pathlib.rst:1787 msgid ":meth:`Path.cwd`" msgstr "" -#: library/pathlib.rst:1550 +#: library/pathlib.rst:1788 msgid ":func:`os.stat`" msgstr "" -#: library/pathlib.rst:1550 +#: library/pathlib.rst:1788 msgid ":meth:`Path.stat`" msgstr "" -#: library/pathlib.rst:1551 +#: library/pathlib.rst:1789 msgid ":func:`os.lstat`" msgstr "" -#: library/pathlib.rst:1551 +#: library/pathlib.rst:1789 msgid ":meth:`Path.lstat`" msgstr "" -#: library/pathlib.rst:1552 +#: library/pathlib.rst:1790 msgid ":func:`os.listdir`" msgstr "" -#: library/pathlib.rst:1552 +#: library/pathlib.rst:1790 msgid ":meth:`Path.iterdir`" msgstr "" -#: library/pathlib.rst:1553 +#: library/pathlib.rst:1791 msgid ":func:`os.walk`" msgstr "" -#: library/pathlib.rst:1553 +#: library/pathlib.rst:1791 msgid ":meth:`Path.walk` [4]_" msgstr "" -#: library/pathlib.rst:1554 +#: library/pathlib.rst:1792 msgid ":func:`os.mkdir`, :func:`os.makedirs`" msgstr "" -#: library/pathlib.rst:1554 +#: library/pathlib.rst:1792 msgid ":meth:`Path.mkdir`" msgstr "" -#: library/pathlib.rst:1555 +#: library/pathlib.rst:1793 msgid ":func:`os.link`" msgstr "" -#: library/pathlib.rst:1555 +#: library/pathlib.rst:1793 msgid ":meth:`Path.hardlink_to`" msgstr "" -#: library/pathlib.rst:1556 +#: library/pathlib.rst:1794 msgid ":func:`os.symlink`" msgstr "" -#: library/pathlib.rst:1556 +#: library/pathlib.rst:1794 msgid ":meth:`Path.symlink_to`" msgstr "" -#: library/pathlib.rst:1557 +#: library/pathlib.rst:1795 msgid ":func:`os.readlink`" msgstr "" -#: library/pathlib.rst:1557 +#: library/pathlib.rst:1795 msgid ":meth:`Path.readlink`" msgstr "" -#: library/pathlib.rst:1558 +#: library/pathlib.rst:1796 msgid ":func:`os.rename`" msgstr "" -#: library/pathlib.rst:1558 +#: library/pathlib.rst:1796 msgid ":meth:`Path.rename`" msgstr "" -#: library/pathlib.rst:1559 +#: library/pathlib.rst:1797 msgid ":func:`os.replace`" msgstr "" -#: library/pathlib.rst:1559 +#: library/pathlib.rst:1797 msgid ":meth:`Path.replace`" msgstr "" -#: library/pathlib.rst:1560 +#: library/pathlib.rst:1798 msgid ":func:`os.remove`, :func:`os.unlink`" msgstr "" -#: library/pathlib.rst:1560 +#: library/pathlib.rst:1798 msgid ":meth:`Path.unlink`" msgstr "" -#: library/pathlib.rst:1561 +#: library/pathlib.rst:1799 msgid ":func:`os.rmdir`" msgstr "" -#: library/pathlib.rst:1561 +#: library/pathlib.rst:1799 msgid ":meth:`Path.rmdir`" msgstr "" -#: library/pathlib.rst:1562 +#: library/pathlib.rst:1800 msgid ":func:`os.chmod`" msgstr "" -#: library/pathlib.rst:1562 +#: library/pathlib.rst:1800 msgid ":meth:`Path.chmod`" msgstr "" -#: library/pathlib.rst:1563 +#: library/pathlib.rst:1801 msgid ":func:`os.lchmod`" msgstr "" -#: library/pathlib.rst:1563 +#: library/pathlib.rst:1801 msgid ":meth:`Path.lchmod`" msgstr "" -#: library/pathlib.rst:1567 +#: library/pathlib.rst:1805 msgid "Footnotes" msgstr "" -#: library/pathlib.rst:1568 +#: library/pathlib.rst:1806 msgid "" ":func:`os.path.relpath` calls :func:`~os.path.abspath` to make paths " "absolute and remove \"``..``\" parts, whereas :meth:`PurePath.relative_to` " @@ -2183,21 +2578,21 @@ msgid "" "anchors differ (e.g. if one path is absolute and the other relative.)" msgstr "" -#: library/pathlib.rst:1572 +#: library/pathlib.rst:1810 msgid "" ":func:`os.path.expanduser` returns the path unchanged if the home directory " "can't be resolved, whereas :meth:`Path.expanduser` raises :exc:" "`RuntimeError`." msgstr "" -#: library/pathlib.rst:1575 +#: library/pathlib.rst:1813 msgid "" ":func:`os.path.abspath` removes \"``..``\" components without resolving " "symlinks, which may change the meaning of the path, whereas :meth:`Path." "absolute` leaves any \"``..``\" components in the path." msgstr "" -#: library/pathlib.rst:1578 +#: library/pathlib.rst:1816 msgid "" ":func:`os.walk` always follows symlinks when categorizing paths into " "*dirnames* and *filenames*, whereas :meth:`Path.walk` categorizes all " diff --git a/library/pdb.po b/library/pdb.po index fb0dfbf1..7db36c19 100644 --- a/library/pdb.po +++ b/library/pdb.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -108,8 +108,8 @@ msgstr "" #: library/pdb.rst:65 msgid "" -"> ...(3)double()\n" -"-> return x * 2\n" +"> ...(2)double()\n" +"-> breakpoint()\n" "(Pdb) p x\n" "3\n" "(Pdb) continue\n" @@ -200,13 +200,20 @@ msgid "" "(Pdb)" msgstr "" -#: library/pdb.rst:136 +#: library/pdb.rst:135 +msgid "" +"The implementation of :pep:`667` means that name assignments made via " +"``pdb`` will immediately affect the active scope, even when running inside " +"an :term:`optimized scope`." +msgstr "" + +#: library/pdb.rst:141 msgid "" "The module defines the following functions; each enters the debugger in a " "slightly different way:" msgstr "" -#: library/pdb.rst:141 +#: library/pdb.rst:146 msgid "" "Execute the *statement* (given as a string or a code object) under debugger " "control. The debugger prompt appears before any code is executed; you can " @@ -218,14 +225,14 @@ msgid "" "`exec` or :func:`eval` functions.)" msgstr "" -#: library/pdb.rst:153 +#: library/pdb.rst:158 msgid "" "Evaluate the *expression* (given as a string or a code object) under " "debugger control. When :func:`runeval` returns, it returns the value of the " "*expression*. Otherwise this function is similar to :func:`run`." msgstr "" -#: library/pdb.rst:160 +#: library/pdb.rst:165 msgid "" "Call the *function* (a function or method object, not a string) with the " "given arguments. When :func:`runcall` returns, it returns whatever the " @@ -233,7 +240,7 @@ msgid "" "is entered." msgstr "" -#: library/pdb.rst:168 +#: library/pdb.rst:173 msgid "" "Enter the debugger at the calling stack frame. This is useful to hard-code " "a breakpoint at a given point in a program, even if the code is not " @@ -241,49 +248,57 @@ msgid "" "is printed to the console just before debugging begins." msgstr "" -#: library/pdb.rst:173 +#: library/pdb.rst:178 msgid "The keyword-only argument *header*." msgstr "" -#: library/pdb.rst:179 +#: library/pdb.rst:181 msgid "" -"Enter post-mortem debugging of the given *traceback* object. If no " -"*traceback* is given, it uses the one of the exception that is currently " -"being handled (an exception must be being handled if the default is to be " -"used)." +":func:`set_trace` will enter the debugger immediately, rather than on the " +"next line of code to be executed." msgstr "" #: library/pdb.rst:187 msgid "" -"Enter post-mortem debugging of the traceback found in :data:`sys." -"last_traceback`." +"Enter post-mortem debugging of the given exception or :ref:`traceback object " +"`. If no value is given, it uses the exception that is " +"currently being handled, or raises ``ValueError`` if there isn’t one." +msgstr "" + +#: library/pdb.rst:192 +msgid "Support for exception objects was added." +msgstr "" + +#: library/pdb.rst:197 +msgid "" +"Enter post-mortem debugging of the exception found in :data:`sys.last_exc`." msgstr "" -#: library/pdb.rst:191 +#: library/pdb.rst:201 msgid "" "The ``run*`` functions and :func:`set_trace` are aliases for instantiating " "the :class:`Pdb` class and calling the method of the same name. If you want " "to access further features, you have to do this yourself:" msgstr "" -#: library/pdb.rst:198 +#: library/pdb.rst:208 msgid ":class:`Pdb` is the debugger class." msgstr "" -#: library/pdb.rst:200 +#: library/pdb.rst:210 msgid "" "The *completekey*, *stdin* and *stdout* arguments are passed to the " "underlying :class:`cmd.Cmd` class; see the description there." msgstr "" -#: library/pdb.rst:203 +#: library/pdb.rst:213 msgid "" "The *skip* argument, if given, must be an iterable of glob-style module name " "patterns. The debugger will not step into frames that originate in a module " "that matches one of these patterns. [1]_" msgstr "" -#: library/pdb.rst:207 +#: library/pdb.rst:217 msgid "" "By default, Pdb sets a handler for the SIGINT signal (which is sent when the " "user presses :kbd:`Ctrl-C` on the console) when you give a :pdbcmd:" @@ -292,48 +307,48 @@ msgid "" "set *nosigint* to true." msgstr "" -#: library/pdb.rst:212 +#: library/pdb.rst:222 msgid "" "The *readrc* argument defaults to true and controls whether Pdb will load ." "pdbrc files from the filesystem." msgstr "" -#: library/pdb.rst:215 +#: library/pdb.rst:225 msgid "Example call to enable tracing with *skip*::" msgstr "" -#: library/pdb.rst:217 +#: library/pdb.rst:227 msgid "import pdb; pdb.Pdb(skip=['django.*']).set_trace()" msgstr "" -#: library/pdb.rst:219 +#: library/pdb.rst:229 msgid "" "Raises an :ref:`auditing event ` ``pdb.Pdb`` with no arguments." msgstr "" -#: library/pdb.rst:221 +#: library/pdb.rst:231 msgid "Added the *skip* parameter." msgstr "" -#: library/pdb.rst:224 +#: library/pdb.rst:234 msgid "" "Added the *nosigint* parameter. Previously, a SIGINT handler was never set " "by Pdb." msgstr "" -#: library/pdb.rst:228 +#: library/pdb.rst:238 msgid "The *readrc* argument." msgstr "" -#: library/pdb.rst:236 +#: library/pdb.rst:246 msgid "See the documentation for the functions explained above." msgstr "" -#: library/pdb.rst:242 +#: library/pdb.rst:252 msgid "Debugger Commands" msgstr "" -#: library/pdb.rst:244 +#: library/pdb.rst:254 msgid "" "The commands recognized by the debugger are listed below. Most commands can " "be abbreviated to one or two letters as indicated; e.g. ``h(elp)`` means " @@ -345,13 +360,13 @@ msgid "" "are separated by a vertical bar (``|``)." msgstr "" -#: library/pdb.rst:253 +#: library/pdb.rst:263 msgid "" "Entering a blank line repeats the last command entered. Exception: if the " "last command was a :pdbcmd:`list` command, the next 11 lines are listed." msgstr "" -#: library/pdb.rst:256 +#: library/pdb.rst:266 msgid "" "Commands that the debugger doesn't recognize are assumed to be Python " "statements and are executed in the context of the program being debugged. " @@ -362,14 +377,20 @@ msgid "" "is not changed." msgstr "" -#: library/pdb.rst:264 +#: library/pdb.rst:274 +msgid "" +"Expressions/Statements whose prefix is a pdb command are now correctly " +"identified and executed." +msgstr "" + +#: library/pdb.rst:278 msgid "" "The debugger supports :ref:`aliases `. Aliases can have " "parameters which allows one a certain level of adaptability to the context " "under examination." msgstr "" -#: library/pdb.rst:268 +#: library/pdb.rst:282 msgid "" "Multiple commands may be entered on a single line, separated by ``;;``. (A " "single ``;`` is not used as it is the separator for multiple commands in a " @@ -380,7 +401,7 @@ msgid "" "\"\";\"``." msgstr "" -#: library/pdb.rst:275 +#: library/pdb.rst:289 msgid "" "To set a temporary global variable, use a *convenience variable*. A " "*convenience variable* is a variable whose name starts with ``$``. For " @@ -390,27 +411,27 @@ msgid "" "compared to using normal variables like ``foo = 1``." msgstr "" -#: library/pdb.rst:282 +#: library/pdb.rst:296 msgid "There are three preset *convenience variables*:" msgstr "" -#: library/pdb.rst:284 +#: library/pdb.rst:298 msgid "``$_frame``: the current frame you are debugging" msgstr "" -#: library/pdb.rst:285 +#: library/pdb.rst:299 msgid "``$_retval``: the return value if the frame is returning" msgstr "" -#: library/pdb.rst:286 +#: library/pdb.rst:300 msgid "``$_exception``: the exception if the frame is raising an exception" msgstr "" -#: library/pdb.rst:290 +#: library/pdb.rst:304 msgid "Added the *convenience variable* feature." msgstr "" -#: library/pdb.rst:296 +#: library/pdb.rst:310 msgid "" "If a file :file:`.pdbrc` exists in the user's home directory or in the " "current directory, it is read with ``'utf-8'`` encoding and executed as if " @@ -420,20 +441,20 @@ msgid "" "read first and aliases defined there can be overridden by the local file." msgstr "" -#: library/pdb.rst:303 +#: library/pdb.rst:317 msgid "" ":file:`.pdbrc` can now contain commands that continue debugging, such as :" "pdbcmd:`continue` or :pdbcmd:`next`. Previously, these commands had no " "effect." msgstr "" -#: library/pdb.rst:308 +#: library/pdb.rst:322 msgid "" ":file:`.pdbrc` is now read with ``'utf-8'`` encoding. Previously, it was " "read with the system locale encoding." msgstr "" -#: library/pdb.rst:315 +#: library/pdb.rst:329 msgid "" "Without argument, print the list of available commands. With a *command* as " "argument, print help about that command. ``help pdb`` displays the full " @@ -442,63 +463,75 @@ msgid "" "the ``!`` command." msgstr "" -#: library/pdb.rst:323 +#: library/pdb.rst:337 msgid "" "Print a stack trace, with the most recent frame at the bottom. An arrow " "(``>``) indicates the current frame, which determines the context of most " "commands." msgstr "" -#: library/pdb.rst:328 +#: library/pdb.rst:342 msgid "" "Move the current frame *count* (default one) levels down in the stack trace " "(to a newer frame)." msgstr "" -#: library/pdb.rst:333 +#: library/pdb.rst:347 msgid "" "Move the current frame *count* (default one) levels up in the stack trace " "(to an older frame)." msgstr "" -#: library/pdb.rst:338 +#: library/pdb.rst:352 msgid "" -"With a *lineno* argument, set a break there in the current file. With a " -"*function* argument, set a break at the first executable statement within " -"that function. The line number may be prefixed with a filename and a colon, " -"to specify a breakpoint in another file (probably one that hasn't been " -"loaded yet). The file is searched on :data:`sys.path`. Note that each " -"breakpoint is assigned a number to which all the other breakpoint commands " -"refer." +"With a *lineno* argument, set a break at line *lineno* in the current file. " +"The line number may be prefixed with a *filename* and a colon, to specify a " +"breakpoint in another file (possibly one that hasn't been loaded yet). The " +"file is searched on :data:`sys.path`. Accepatable forms of *filename* are " +"``/abspath/to/file.py``, ``relpath/file.py``, ``module`` and ``package." +"module``." msgstr "" -#: library/pdb.rst:345 +#: library/pdb.rst:359 +msgid "" +"With a *function* argument, set a break at the first executable statement " +"within that function. *function* can be any expression that evaluates to a " +"function in the current namespace." +msgstr "" + +#: library/pdb.rst:363 msgid "" "If a second argument is present, it is an expression which must evaluate to " "true before the breakpoint is honored." msgstr "" -#: library/pdb.rst:348 +#: library/pdb.rst:366 msgid "" "Without argument, list all breaks, including for each breakpoint, the number " "of times that breakpoint has been hit, the current ignore count, and the " "associated condition if any." msgstr "" -#: library/pdb.rst:354 +#: library/pdb.rst:370 +msgid "" +"Each breakpoint is assigned a number to which all the other breakpoint " +"commands refer." +msgstr "" + +#: library/pdb.rst:375 msgid "" "Temporary breakpoint, which is removed automatically when it is first hit. " "The arguments are the same as for :pdbcmd:`break`." msgstr "" -#: library/pdb.rst:359 +#: library/pdb.rst:380 msgid "" "With a *filename:lineno* argument, clear all the breakpoints at this line. " "With a space separated list of breakpoint numbers, clear those breakpoints. " "Without argument, clear all breaks (but first ask confirmation)." msgstr "" -#: library/pdb.rst:365 +#: library/pdb.rst:386 msgid "" "Disable the breakpoints given as a space separated list of breakpoint " "numbers. Disabling a breakpoint means it cannot cause the program to stop " @@ -506,11 +539,11 @@ msgid "" "breakpoints and can be (re-)enabled." msgstr "" -#: library/pdb.rst:372 +#: library/pdb.rst:393 msgid "Enable the breakpoints specified." msgstr "" -#: library/pdb.rst:376 +#: library/pdb.rst:397 msgid "" "Set the ignore count for the given breakpoint number. If *count* is " "omitted, the ignore count is set to 0. A breakpoint becomes active when the " @@ -519,21 +552,21 @@ msgid "" "associated condition evaluates to true." msgstr "" -#: library/pdb.rst:384 +#: library/pdb.rst:405 msgid "" "Set a new *condition* for the breakpoint, an expression which must evaluate " "to true before the breakpoint is honored. If *condition* is absent, any " "existing condition is removed; i.e., the breakpoint is made unconditional." msgstr "" -#: library/pdb.rst:390 +#: library/pdb.rst:411 msgid "" "Specify a list of commands for breakpoint number *bpnumber*. The commands " "themselves appear on the following lines. Type a line containing just " "``end`` to terminate the commands. An example::" msgstr "" -#: library/pdb.rst:394 +#: library/pdb.rst:415 msgid "" "(Pdb) commands 1\n" "(com) p some_variable\n" @@ -541,25 +574,25 @@ msgid "" "(Pdb)" msgstr "" -#: library/pdb.rst:399 +#: library/pdb.rst:420 msgid "" "To remove all commands from a breakpoint, type ``commands`` and follow it " "immediately with ``end``; that is, give no commands." msgstr "" -#: library/pdb.rst:402 +#: library/pdb.rst:423 msgid "" "With no *bpnumber* argument, ``commands`` refers to the last breakpoint set." msgstr "" -#: library/pdb.rst:404 +#: library/pdb.rst:425 msgid "" "You can use breakpoint commands to start your program up again. Simply use " "the :pdbcmd:`continue` command, or :pdbcmd:`step`, or any other command that " "resumes execution." msgstr "" -#: library/pdb.rst:408 +#: library/pdb.rst:429 msgid "" "Specifying any command resuming execution (currently :pdbcmd:`continue`, :" "pdbcmd:`step`, :pdbcmd:`next`, :pdbcmd:`return`, :pdbcmd:`jump`, :pdbcmd:" @@ -570,7 +603,7 @@ msgid "" "ambiguities about which list to execute." msgstr "" -#: library/pdb.rst:417 +#: library/pdb.rst:438 msgid "" "If you use the ``silent`` command in the command list, the usual message " "about stopping at a breakpoint is not printed. This may be desirable for " @@ -579,13 +612,13 @@ msgid "" "was reached." msgstr "" -#: library/pdb.rst:424 +#: library/pdb.rst:445 msgid "" "Execute the current line, stop at the first possible occasion (either in a " "function that is called or on the next line in the current function)." msgstr "" -#: library/pdb.rst:429 +#: library/pdb.rst:450 msgid "" "Continue execution until the next line in the current function is reached or " "it returns. (The difference between :pdbcmd:`next` and :pdbcmd:`step` is " @@ -594,46 +627,46 @@ msgid "" "line in the current function.)" msgstr "" -#: library/pdb.rst:437 +#: library/pdb.rst:458 msgid "" "Without argument, continue execution until the line with a number greater " "than the current one is reached." msgstr "" -#: library/pdb.rst:440 +#: library/pdb.rst:461 msgid "" "With *lineno*, continue execution until a line with a number greater or " "equal to *lineno* is reached. In both cases, also stop when the current " "frame returns." msgstr "" -#: library/pdb.rst:444 +#: library/pdb.rst:465 msgid "Allow giving an explicit line number." msgstr "" -#: library/pdb.rst:449 +#: library/pdb.rst:470 msgid "Continue execution until the current function returns." msgstr "" -#: library/pdb.rst:453 +#: library/pdb.rst:474 msgid "Continue execution, only stop when a breakpoint is encountered." msgstr "" -#: library/pdb.rst:457 +#: library/pdb.rst:478 msgid "" "Set the next line that will be executed. Only available in the bottom-most " "frame. This lets you jump back and execute code again, or jump forward to " "skip code that you don't want to run." msgstr "" -#: library/pdb.rst:461 +#: library/pdb.rst:482 msgid "" "It should be noted that not all jumps are allowed -- for instance it is not " "possible to jump into the middle of a :keyword:`for` loop or out of a :" "keyword:`finally` clause." msgstr "" -#: library/pdb.rst:467 +#: library/pdb.rst:488 msgid "" "List source code for the current file. Without arguments, list 11 lines " "around the current line or continue the previous listing. With ``.`` as " @@ -642,7 +675,7 @@ msgid "" "second argument is less than the first, it is interpreted as a count." msgstr "" -#: library/pdb.rst:473 +#: library/pdb.rst:494 msgid "" "The current line in the current frame is indicated by ``->``. If an " "exception is being debugged, the line where the exception was originally " @@ -650,67 +683,67 @@ msgid "" "line." msgstr "" -#: library/pdb.rst:478 +#: library/pdb.rst:499 msgid "Added the ``>>`` marker." msgstr "" -#: library/pdb.rst:483 +#: library/pdb.rst:504 msgid "" "List all source code for the current function or frame. Interesting lines " "are marked as for :pdbcmd:`list`." msgstr "" -#: library/pdb.rst:490 +#: library/pdb.rst:511 msgid "Print the arguments of the current function and their current values." msgstr "" -#: library/pdb.rst:494 +#: library/pdb.rst:515 msgid "Evaluate *expression* in the current context and print its value." msgstr "" -#: library/pdb.rst:498 +#: library/pdb.rst:519 msgid "" "``print()`` can also be used, but is not a debugger command --- this " "executes the Python :func:`print` function." msgstr "" -#: library/pdb.rst:504 +#: library/pdb.rst:525 msgid "" "Like the :pdbcmd:`p` command, except the value of *expression* is pretty-" "printed using the :mod:`pprint` module." msgstr "" -#: library/pdb.rst:509 +#: library/pdb.rst:530 msgid "Print the type of *expression*." msgstr "" -#: library/pdb.rst:513 +#: library/pdb.rst:534 msgid "Try to get source code of *expression* and display it." msgstr "" -#: library/pdb.rst:519 +#: library/pdb.rst:540 msgid "" "Display the value of *expression* if it changed, each time execution stops " "in the current frame." msgstr "" -#: library/pdb.rst:522 +#: library/pdb.rst:543 msgid "" "Without *expression*, list all display expressions for the current frame." msgstr "" -#: library/pdb.rst:526 +#: library/pdb.rst:547 msgid "" "Display evaluates *expression* and compares to the result of the previous " "evaluation of *expression*, so when the result is mutable, display may not " "be able to pick up the changes." msgstr "" -#: library/pdb.rst:530 +#: library/pdb.rst:701 msgid "Example::" msgstr "" -#: library/pdb.rst:532 +#: library/pdb.rst:553 msgid "" "lst = []\n" "breakpoint()\n" @@ -719,13 +752,13 @@ msgid "" "print(lst)" msgstr "" -#: library/pdb.rst:538 +#: library/pdb.rst:559 msgid "" "Display won't realize ``lst`` has been changed because the result of " "evaluation is modified in place by ``lst.append(1)`` before being compared::" msgstr "" -#: library/pdb.rst:541 +#: library/pdb.rst:562 msgid "" "> example.py(3)()\n" "-> pass\n" @@ -740,11 +773,11 @@ msgid "" "(Pdb)" msgstr "" -#: library/pdb.rst:553 +#: library/pdb.rst:574 msgid "You can do some tricks with copy mechanism to make it work::" msgstr "" -#: library/pdb.rst:555 +#: library/pdb.rst:576 msgid "" "> example.py(3)()\n" "-> pass\n" @@ -760,29 +793,49 @@ msgid "" "(Pdb)" msgstr "" -#: library/pdb.rst:572 +#: library/pdb.rst:593 msgid "" "Do not display *expression* anymore in the current frame. Without " "*expression*, clear all display expressions for the current frame." msgstr "" -#: library/pdb.rst:579 +#: library/pdb.rst:600 +msgid "" +"Start an interactive interpreter (using the :mod:`code` module) in a new " +"global namespace initialised from the local and global namespaces for the " +"current scope. Use ``exit()`` or ``quit()`` to exit the interpreter and " +"return to the debugger." +msgstr "" + +#: library/pdb.rst:607 +msgid "" +"As ``interact`` creates a new dedicated namespace for code execution, " +"assignments to variables will not affect the original namespaces. However, " +"modifications to any referenced mutable objects will be reflected in the " +"original namespaces as usual." +msgstr "" + +#: library/pdb.rst:614 +msgid "" +"``exit()`` and ``quit()`` can be used to exit the :pdbcmd:`interact` command." +msgstr "" + +#: library/pdb.rst:618 msgid "" -"Start an interactive interpreter (using the :mod:`code` module) whose global " -"namespace contains all the (global and local) names found in the current " -"scope." +":pdbcmd:`interact` directs its output to the debugger's output channel " +"rather than :data:`sys.stderr`." msgstr "" -#: library/pdb.rst:589 +#: library/pdb.rst:626 msgid "" "Create an alias called *name* that executes *command*. The *command* must " "*not* be enclosed in quotes. Replaceable parameters can be indicated by " -"``%1``, ``%2``, and so on, while ``%*`` is replaced by all the parameters. " -"If *command* is omitted, the current alias for *name* is shown. If no " -"arguments are given, all aliases are listed." +"``%1``, ``%2``, ... and ``%9``, while ``%*`` is replaced by all the " +"parameters. If *command* is omitted, the current alias for *name* is shown. " +"If no arguments are given, all aliases are listed." msgstr "" -#: library/pdb.rst:595 +#: library/pdb.rst:632 msgid "" "Aliases may be nested and can contain anything that can be legally typed at " "the pdb prompt. Note that internal pdb commands *can* be overridden by " @@ -791,13 +844,13 @@ msgid "" "other words in the line are left alone." msgstr "" -#: library/pdb.rst:601 +#: library/pdb.rst:638 msgid "" "As an example, here are two useful aliases (especially when placed in the :" "file:`.pdbrc` file)::" msgstr "" -#: library/pdb.rst:604 +#: library/pdb.rst:641 msgid "" "# Print instance variables (usage \"pi classInst\")\n" "alias pi for k in %1.__dict__.keys(): print(f\"%1.{k} = {%1.__dict__[k]}\")\n" @@ -805,36 +858,36 @@ msgid "" "alias ps pi self" msgstr "" -#: library/pdb.rst:611 +#: library/pdb.rst:648 msgid "Delete the specified alias *name*." msgstr "" -#: library/pdb.rst:615 +#: library/pdb.rst:652 msgid "" "Execute the (one-line) *statement* in the context of the current stack " "frame. The exclamation point can be omitted unless the first word of the " "statement resembles a debugger command, e.g.:" msgstr "" -#: library/pdb.rst:619 +#: library/pdb.rst:656 msgid "" "(Pdb) ! n=42\n" "(Pdb)" msgstr "" -#: library/pdb.rst:624 +#: library/pdb.rst:661 msgid "" "To set a global variable, you can prefix the assignment command with a :" "keyword:`global` statement on the same line, e.g.:" msgstr "" -#: library/pdb.rst:627 +#: library/pdb.rst:664 msgid "" "(Pdb) global list_options; list_options = ['-l']\n" "(Pdb)" msgstr "" -#: library/pdb.rst:635 +#: library/pdb.rst:672 msgid "" "Restart the debugged Python program. If *args* is supplied, it is split " "with :mod:`shlex` and the result is used as the new :data:`sys.argv`. " @@ -842,25 +895,80 @@ msgid "" "`restart` is an alias for :pdbcmd:`run`." msgstr "" -#: library/pdb.rst:642 +#: library/pdb.rst:679 msgid "Quit from the debugger. The program being executed is aborted." msgstr "" -#: library/pdb.rst:646 +#: library/pdb.rst:683 msgid "" "Enter a recursive debugger that steps through *code* (which is an arbitrary " "expression or statement to be executed in the current environment)." msgstr "" -#: library/pdb.rst:652 +#: library/pdb.rst:689 msgid "Print the return value for the last return of the current function." msgstr "" -#: library/pdb.rst:655 +#: library/pdb.rst:693 +msgid "List or jump between chained exceptions." +msgstr "" + +#: library/pdb.rst:695 +msgid "" +"When using ``pdb.pm()`` or ``Pdb.post_mortem(...)`` with a chained " +"exception instead of a traceback, it allows the user to move between the " +"chained exceptions using ``exceptions`` command to list exceptions, and " +"``exceptions `` to switch to that exception." +msgstr "" + +#: library/pdb.rst:703 +msgid "" +"def out():\n" +" try:\n" +" middle()\n" +" except Exception as e:\n" +" raise ValueError(\"reraise middle() error\") from e\n" +"\n" +"def middle():\n" +" try:\n" +" return inner(0)\n" +" except Exception as e:\n" +" raise ValueError(\"Middle fail\")\n" +"\n" +"def inner(x):\n" +" 1 / x\n" +"\n" +" out()" +msgstr "" + +#: library/pdb.rst:720 +msgid "calling ``pdb.pm()`` will allow to move between exceptions::" +msgstr "" + +#: library/pdb.rst:722 +msgid "" +"> example.py(5)out()\n" +"-> raise ValueError(\"reraise middle() error\") from e\n" +"\n" +"(Pdb) exceptions\n" +" 0 ZeroDivisionError('division by zero')\n" +" 1 ValueError('Middle fail')\n" +"> 2 ValueError('reraise middle() error')\n" +"\n" +"(Pdb) exceptions 0\n" +"> example.py(16)inner()\n" +"-> 1 / x\n" +"\n" +"(Pdb) up\n" +"> example.py(10)middle()\n" +"-> return inner(0)" +msgstr "" + +#: library/pdb.rst:741 msgid "Footnotes" msgstr "" -#: library/pdb.rst:656 +#: library/pdb.rst:742 msgid "" "Whether a frame is considered to originate in a certain module is determined " "by the ``__name__`` in the frame globals." @@ -886,18 +994,18 @@ msgstr "" msgid "cmd" msgstr "" -#: library/pdb.rst:292 +#: library/pdb.rst:306 msgid ".pdbrc" msgstr "" -#: library/pdb.rst:292 +#: library/pdb.rst:306 msgid "file" msgstr "" -#: library/pdb.rst:292 +#: library/pdb.rst:306 msgid "debugger" msgstr "" -#: library/pdb.rst:292 +#: library/pdb.rst:306 msgid "configuration" msgstr "" diff --git a/library/persistence.po b/library/persistence.po index def760d5..a2690d26 100644 --- a/library/persistence.po +++ b/library/persistence.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" diff --git a/library/pickle.po b/library/pickle.po index e1d4ecb1..7e381be3 100644 --- a/library/pickle.po +++ b/library/pickle.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -179,9 +179,8 @@ msgstr "" msgid "" "The data format used by :mod:`pickle` is Python-specific. This has the " "advantage that there are no restrictions imposed by external standards such " -"as JSON or XDR (which can't represent pointer sharing); however it means " -"that non-Python programs may not be able to reconstruct pickled Python " -"objects." +"as JSON (which can't represent pointer sharing); however it means that non-" +"Python programs may not be able to reconstruct pickled Python objects." msgstr "" #: library/pickle.rst:131 @@ -354,7 +353,7 @@ msgid "" "*buffers* have the same meaning as in the :class:`Unpickler` constructor." msgstr "" -#: library/pickle.rst:267 library/pickle.rst:429 +#: library/pickle.rst:267 library/pickle.rst:433 msgid "The *buffers* argument was added." msgstr "" @@ -477,11 +476,17 @@ msgid "" "by :meth:`persistent_id` cannot itself have a persistent ID." msgstr "" -#: library/pickle.rst:447 +#: library/pickle.rst:451 msgid "See :ref:`pickle-persistent` for details and examples of uses." msgstr "" -#: library/pickle.rst:350 +#: library/pickle.rst:348 +msgid "" +"Add the default implementation of this method in the C implementation of :" +"class:`!Pickler`." +msgstr "" + +#: library/pickle.rst:354 msgid "" "A pickler object's dispatch table is a registry of *reduction functions* of " "the kind which can be declared using :func:`copyreg.pickle`. It is a " @@ -490,7 +495,7 @@ msgid "" "should conform to the same interface as a :meth:`~object.__reduce__` method." msgstr "" -#: library/pickle.rst:358 +#: library/pickle.rst:362 msgid "" "By default, a pickler object will not have a :attr:`dispatch_table` " "attribute, and it will instead use the global dispatch table managed by the :" @@ -501,11 +506,11 @@ msgid "" "table for instances of that class." msgstr "" -#: library/pickle.rst:367 +#: library/pickle.rst:371 msgid "See :ref:`pickle-dispatch` for usage examples." msgstr "" -#: library/pickle.rst:373 +#: library/pickle.rst:377 msgid "" "Special reducer that can be defined in :class:`Pickler` subclasses. This " "method has priority over any reducer in the :attr:`dispatch_table`. It " @@ -514,11 +519,11 @@ msgid "" "`dispatch_table`-registered reducers to pickle ``obj``." msgstr "" -#: library/pickle.rst:379 +#: library/pickle.rst:383 msgid "For a detailed example, see :ref:`reducer_override`." msgstr "" -#: library/pickle.rst:385 +#: library/pickle.rst:389 msgid "" "Deprecated. Enable fast mode if set to a true value. The fast mode disables " "the usage of memo, therefore speeding the pickling process by not generating " @@ -526,21 +531,21 @@ msgid "" "objects, doing otherwise will cause :class:`Pickler` to recurse infinitely." msgstr "" -#: library/pickle.rst:391 +#: library/pickle.rst:395 msgid "Use :func:`pickletools.optimize` if you need more compact pickles." msgstr "" -#: library/pickle.rst:396 +#: library/pickle.rst:400 msgid "This takes a binary file for reading a pickle data stream." msgstr "" -#: library/pickle.rst:398 +#: library/pickle.rst:402 msgid "" "The protocol version of the pickle is detected automatically, so no protocol " "argument is needed." msgstr "" -#: library/pickle.rst:401 +#: library/pickle.rst:405 msgid "" "The argument *file* must have three methods, a read() method that takes an " "integer argument, a readinto() method that takes a buffer argument and a " @@ -550,7 +555,7 @@ msgid "" "that meets this interface." msgstr "" -#: library/pickle.rst:408 +#: library/pickle.rst:412 msgid "" "The optional arguments *fix_imports*, *encoding* and *errors* are used to " "control compatibility support for pickle stream generated by Python 2. If " @@ -564,7 +569,7 @@ msgid "" "Python 2." msgstr "" -#: library/pickle.rst:419 +#: library/pickle.rst:423 msgid "" "If *buffers* is ``None`` (the default), then all data necessary for " "deserialization must be contained in the pickle stream. This means that the " @@ -572,7 +577,7 @@ msgid "" "instantiated (or when :func:`dump` or :func:`dumps` was called)." msgstr "" -#: library/pickle.rst:424 +#: library/pickle.rst:428 msgid "" "If *buffers* is not ``None``, it should be an iterable of buffer-enabled " "objects that is consumed each time the pickle stream references an :ref:`out-" @@ -580,25 +585,31 @@ msgid "" "the *buffer_callback* of a Pickler object." msgstr "" -#: library/pickle.rst:434 +#: library/pickle.rst:438 msgid "" "Read the pickled representation of an object from the open file object given " "in the constructor, and return the reconstituted object hierarchy specified " "therein. Bytes past the pickled representation of the object are ignored." msgstr "" -#: library/pickle.rst:441 +#: library/pickle.rst:445 msgid "Raise an :exc:`UnpicklingError` by default." msgstr "" -#: library/pickle.rst:443 +#: library/pickle.rst:447 msgid "" "If defined, :meth:`persistent_load` should return the object specified by " "the persistent ID *pid*. If an invalid persistent ID is encountered, an :" "exc:`UnpicklingError` should be raised." msgstr "" -#: library/pickle.rst:451 +#: library/pickle.rst:453 +msgid "" +"Add the default implementation of this method in the C implementation of :" +"class:`!Unpickler`." +msgstr "" + +#: library/pickle.rst:459 msgid "" "Import *module* if necessary and return the object called *name* from it, " "where the *module* and *name* arguments are :class:`str` objects. Note, " @@ -606,41 +617,41 @@ msgid "" "functions." msgstr "" -#: library/pickle.rst:456 +#: library/pickle.rst:464 msgid "" "Subclasses may override this to gain control over what type of objects and " "how they can be loaded, potentially reducing security risks. Refer to :ref:" "`pickle-restrict` for details." msgstr "" -#: library/pickle.rst:460 +#: library/pickle.rst:468 msgid "" "Raises an :ref:`auditing event ` ``pickle.find_class`` with " "arguments ``module``, ``name``." msgstr "" -#: library/pickle.rst:464 +#: library/pickle.rst:472 msgid "" "A wrapper for a buffer representing picklable data. *buffer* must be a :ref:" "`buffer-providing ` object, such as a :term:`bytes-like " "object` or a N-dimensional array." msgstr "" -#: library/pickle.rst:468 +#: library/pickle.rst:476 msgid "" ":class:`PickleBuffer` is itself a buffer provider, therefore it is possible " "to pass it to other APIs expecting a buffer-providing object, such as :class:" "`memoryview`." msgstr "" -#: library/pickle.rst:472 +#: library/pickle.rst:480 msgid "" ":class:`PickleBuffer` objects can only be serialized using pickle protocol 5 " "or higher. They are eligible for :ref:`out-of-band serialization `." msgstr "" -#: library/pickle.rst:480 +#: library/pickle.rst:488 msgid "" "Return a :class:`memoryview` of the memory area underlying this buffer. The " "returned object is a one-dimensional, C-contiguous memoryview with format " @@ -648,54 +659,54 @@ msgid "" "neither C- nor Fortran-contiguous." msgstr "" -#: library/pickle.rst:487 +#: library/pickle.rst:495 msgid "Release the underlying buffer exposed by the PickleBuffer object." msgstr "" -#: library/pickle.rst:493 +#: library/pickle.rst:501 msgid "What can be pickled and unpickled?" msgstr "" -#: library/pickle.rst:495 +#: library/pickle.rst:503 msgid "The following types can be pickled:" msgstr "" -#: library/pickle.rst:497 +#: library/pickle.rst:505 msgid "" "built-in constants (``None``, ``True``, ``False``, ``Ellipsis``, and :data:" "`NotImplemented`);" msgstr "" -#: library/pickle.rst:500 +#: library/pickle.rst:508 msgid "integers, floating-point numbers, complex numbers;" msgstr "" -#: library/pickle.rst:502 +#: library/pickle.rst:510 msgid "strings, bytes, bytearrays;" msgstr "" -#: library/pickle.rst:504 +#: library/pickle.rst:512 msgid "" "tuples, lists, sets, and dictionaries containing only picklable objects;" msgstr "" -#: library/pickle.rst:506 +#: library/pickle.rst:514 msgid "" "functions (built-in and user-defined) accessible from the top level of a " "module (using :keyword:`def`, not :keyword:`lambda`);" msgstr "" -#: library/pickle.rst:509 +#: library/pickle.rst:517 msgid "classes accessible from the top level of a module;" msgstr "" -#: library/pickle.rst:511 +#: library/pickle.rst:519 msgid "" "instances of such classes whose the result of calling :meth:`~object." "__getstate__` is picklable (see section :ref:`pickle-inst` for details)." msgstr "" -#: library/pickle.rst:514 +#: library/pickle.rst:522 msgid "" "Attempts to pickle unpicklable objects will raise the :exc:`PicklingError` " "exception; when this happens, an unspecified number of bytes may have " @@ -705,7 +716,7 @@ msgid "" "limit with :func:`sys.setrecursionlimit`." msgstr "" -#: library/pickle.rst:521 +#: library/pickle.rst:529 msgid "" "Note that functions (built-in and user-defined) are pickled by fully :term:" "`qualified name`, not by value. [#]_ This means that only the function name " @@ -716,7 +727,7 @@ msgid "" "exception will be raised. [#]_" msgstr "" -#: library/pickle.rst:528 +#: library/pickle.rst:536 msgid "" "Similarly, classes are pickled by fully qualified name, so the same " "restrictions in the unpickling environment apply. Note that none of the " @@ -724,7 +735,7 @@ msgid "" "attribute ``attr`` is not restored in the unpickling environment::" msgstr "" -#: library/pickle.rst:533 +#: library/pickle.rst:541 msgid "" "class Foo:\n" " attr = 'A class attribute'\n" @@ -732,13 +743,13 @@ msgid "" "picklestring = pickle.dumps(Foo)" msgstr "" -#: library/pickle.rst:538 +#: library/pickle.rst:546 msgid "" "These restrictions are why picklable functions and classes must be defined " "at the top level of a module." msgstr "" -#: library/pickle.rst:541 +#: library/pickle.rst:549 msgid "" "Similarly, when class instances are pickled, their class's code and data are " "not pickled along with them. Only the instance data are pickled. This is " @@ -750,17 +761,17 @@ msgid "" "__setstate__` method." msgstr "" -#: library/pickle.rst:553 +#: library/pickle.rst:561 msgid "Pickling Class Instances" msgstr "" -#: library/pickle.rst:557 +#: library/pickle.rst:565 msgid "" "In this section, we describe the general mechanisms available to you to " "define, customize, and control how class instances are pickled and unpickled." msgstr "" -#: library/pickle.rst:560 +#: library/pickle.rst:568 msgid "" "In most cases, no additional code is needed to make instances picklable. By " "default, pickle will retrieve the class and the attributes of an instance " @@ -770,7 +781,7 @@ msgid "" "The following code shows an implementation of this behaviour::" msgstr "" -#: library/pickle.rst:567 +#: library/pickle.rst:575 msgid "" "def save(obj):\n" " return (obj.__class__, obj.__dict__)\n" @@ -781,13 +792,13 @@ msgid "" " return obj" msgstr "" -#: library/pickle.rst:575 +#: library/pickle.rst:583 msgid "" "Classes can alter the default behaviour by providing one or several special " "methods:" msgstr "" -#: library/pickle.rst:580 +#: library/pickle.rst:588 msgid "" "In protocols 2 and newer, classes that implements the :meth:" "`__getnewargs_ex__` method can dictate the values passed to the :meth:" @@ -797,37 +808,37 @@ msgid "" "passed to the :meth:`__new__` method upon unpickling." msgstr "" -#: library/pickle.rst:588 +#: library/pickle.rst:596 msgid "" "You should implement this method if the :meth:`__new__` method of your class " "requires keyword-only arguments. Otherwise, it is recommended for " "compatibility to implement :meth:`__getnewargs__`." msgstr "" -#: library/pickle.rst:592 +#: library/pickle.rst:600 msgid ":meth:`__getnewargs_ex__` is now used in protocols 2 and 3." msgstr "" -#: library/pickle.rst:598 +#: library/pickle.rst:606 msgid "" "This method serves a similar purpose as :meth:`__getnewargs_ex__`, but " "supports only positional arguments. It must return a tuple of arguments " "``args`` which will be passed to the :meth:`__new__` method upon unpickling." msgstr "" -#: library/pickle.rst:602 +#: library/pickle.rst:610 msgid "" ":meth:`__getnewargs__` will not be called if :meth:`__getnewargs_ex__` is " "defined." msgstr "" -#: library/pickle.rst:605 +#: library/pickle.rst:613 msgid "" "Before Python 3.6, :meth:`__getnewargs__` was called instead of :meth:" "`__getnewargs_ex__` in protocols 2 and 3." msgstr "" -#: library/pickle.rst:612 +#: library/pickle.rst:620 msgid "" "Classes can further influence how their instances are pickled by overriding " "the method :meth:`__getstate__`. It is called and the returned object is " @@ -835,19 +846,19 @@ msgid "" "are several cases:" msgstr "" -#: library/pickle.rst:617 +#: library/pickle.rst:625 msgid "" "For a class that has no instance :attr:`~object.__dict__` and no :attr:" "`~object.__slots__`, the default state is ``None``." msgstr "" -#: library/pickle.rst:620 +#: library/pickle.rst:628 msgid "" "For a class that has an instance :attr:`~object.__dict__` and no :attr:" "`~object.__slots__`, the default state is ``self.__dict__``." msgstr "" -#: library/pickle.rst:623 +#: library/pickle.rst:631 msgid "" "For a class that has an instance :attr:`~object.__dict__` and :attr:`~object." "__slots__`, the default state is a tuple consisting of two dictionaries: " @@ -855,7 +866,7 @@ msgid "" "slots that have a value are included in the latter." msgstr "" -#: library/pickle.rst:629 +#: library/pickle.rst:637 msgid "" "For a class that has :attr:`~object.__slots__` and no instance :attr:" "`~object.__dict__`, the default state is a tuple whose first item is " @@ -863,13 +874,13 @@ msgid "" "values described in the previous bullet." msgstr "" -#: library/pickle.rst:634 +#: library/pickle.rst:642 msgid "" "Added the default implementation of the ``__getstate__()`` method in the :" "class:`object` class." msgstr "" -#: library/pickle.rst:641 +#: library/pickle.rst:649 msgid "" "Upon unpickling, if the class defines :meth:`__setstate__`, it is called " "with the unpickled state. In that case, there is no requirement for the " @@ -877,20 +888,20 @@ msgid "" "dictionary and its items are assigned to the new instance's dictionary." msgstr "" -#: library/pickle.rst:648 +#: library/pickle.rst:656 msgid "" "If :meth:`__reduce__` returns a state with value ``None`` at pickling, the :" "meth:`__setstate__` method will not be called upon unpickling." msgstr "" -#: library/pickle.rst:652 +#: library/pickle.rst:660 msgid "" "Refer to the section :ref:`pickle-state` for more information about how to " "use the methods :meth:`~object.__getstate__` and :meth:`~object." "__setstate__`." msgstr "" -#: library/pickle.rst:657 +#: library/pickle.rst:665 msgid "" "At unpickling time, some methods like :meth:`~object.__getattr__`, :meth:" "`~object.__getattribute__`, or :meth:`~object.__setattr__` may be called " @@ -900,7 +911,7 @@ msgid "" "an instance." msgstr "" -#: library/pickle.rst:666 +#: library/pickle.rst:674 msgid "" "As we shall see, pickle does not use directly the methods described above. " "In fact, these methods are part of the copy protocol which implements the :" @@ -909,7 +920,7 @@ msgid "" "objects. [#]_" msgstr "" -#: library/pickle.rst:672 +#: library/pickle.rst:680 msgid "" "Although powerful, implementing :meth:`~object.__reduce__` directly in your " "classes is error prone. For this reason, class designers should use the " @@ -919,14 +930,14 @@ msgid "" "option or leads to more efficient pickling or both." msgstr "" -#: library/pickle.rst:681 +#: library/pickle.rst:689 msgid "" "The interface is currently defined as follows. The :meth:`__reduce__` " "method takes no argument and shall return either a string or preferably a " "tuple (the returned object is often referred to as the \"reduce value\")." msgstr "" -#: library/pickle.rst:685 +#: library/pickle.rst:693 msgid "" "If a string is returned, the string should be interpreted as the name of a " "global variable. It should be the object's local name relative to its " @@ -934,26 +945,26 @@ msgid "" "object's module. This behaviour is typically useful for singletons." msgstr "" -#: library/pickle.rst:690 +#: library/pickle.rst:698 msgid "" "When a tuple is returned, it must be between two and six items long. " "Optional items can either be omitted, or ``None`` can be provided as their " "value. The semantics of each item are in order:" msgstr "" -#: library/pickle.rst:696 +#: library/pickle.rst:704 msgid "" "A callable object that will be called to create the initial version of the " "object." msgstr "" -#: library/pickle.rst:699 +#: library/pickle.rst:707 msgid "" "A tuple of arguments for the callable object. An empty tuple must be given " "if the callable does not accept any argument." msgstr "" -#: library/pickle.rst:702 +#: library/pickle.rst:710 msgid "" "Optionally, the object's state, which will be passed to the object's :meth:" "`__setstate__` method as previously described. If the object has no such " @@ -961,7 +972,7 @@ msgid "" "object's :attr:`~object.__dict__` attribute." msgstr "" -#: library/pickle.rst:707 +#: library/pickle.rst:715 msgid "" "Optionally, an iterator (and not a sequence) yielding successive items. " "These items will be appended to the object either using ``obj.append(item)`` " @@ -973,7 +984,7 @@ msgid "" "append, so both must be supported.)" msgstr "" -#: library/pickle.rst:717 +#: library/pickle.rst:725 msgid "" "Optionally, an iterator (not a sequence) yielding successive key-value " "pairs. These items will be stored to the object using ``obj[key] = " @@ -981,7 +992,7 @@ msgid "" "by other classes as long as they implement :meth:`__setitem__`." msgstr "" -#: library/pickle.rst:722 +#: library/pickle.rst:730 msgid "" "Optionally, a callable with a ``(obj, state)`` signature. This callable " "allows the user to programmatically control the state-updating behavior of a " @@ -990,11 +1001,11 @@ msgid "" "meth:`__setstate__`." msgstr "" -#: library/pickle.rst:728 +#: library/pickle.rst:736 msgid "The optional sixth tuple item, ``(obj, state)``, was added." msgstr "" -#: library/pickle.rst:734 +#: library/pickle.rst:742 msgid "" "Alternatively, a :meth:`__reduce_ex__` method may be defined. The only " "difference is this method should take a single integer argument, the " @@ -1004,11 +1015,11 @@ msgid "" "provide backwards-compatible reduce values for older Python releases." msgstr "" -#: library/pickle.rst:746 +#: library/pickle.rst:754 msgid "Persistence of External Objects" msgstr "" -#: library/pickle.rst:752 +#: library/pickle.rst:760 msgid "" "For the benefit of object persistence, the :mod:`pickle` module supports the " "notion of a reference to an object outside the pickled data stream. Such " @@ -1017,7 +1028,7 @@ msgid "" "(for any newer protocol)." msgstr "" -#: library/pickle.rst:758 +#: library/pickle.rst:766 msgid "" "The resolution of such persistent IDs is not defined by the :mod:`pickle` " "module; it will delegate this resolution to the user-defined methods on the " @@ -1025,7 +1036,7 @@ msgid "" "persistent_load` respectively." msgstr "" -#: library/pickle.rst:763 +#: library/pickle.rst:771 msgid "" "To pickle objects that have an external persistent ID, the pickler must have " "a custom :meth:`~Pickler.persistent_id` method that takes an object as an " @@ -1036,20 +1047,20 @@ msgid "" "persistent ID." msgstr "" -#: library/pickle.rst:770 +#: library/pickle.rst:778 msgid "" "To unpickle external objects, the unpickler must have a custom :meth:" "`~Unpickler.persistent_load` method that takes a persistent ID object and " "returns the referenced object." msgstr "" -#: library/pickle.rst:774 +#: library/pickle.rst:782 msgid "" "Here is a comprehensive example presenting how persistent ID can be used to " "pickle external objects by reference." msgstr "" -#: library/pickle.rst:777 +#: library/pickle.rst:785 msgid "" "# Simple example presenting how persistent ID can be used to pickle\n" "# external objects by reference.\n" @@ -1147,29 +1158,29 @@ msgid "" " main()\n" msgstr "" -#: library/pickle.rst:782 +#: library/pickle.rst:790 msgid "Dispatch Tables" msgstr "" -#: library/pickle.rst:784 +#: library/pickle.rst:792 msgid "" "If one wants to customize pickling of some classes without disturbing any " "other code which depends on pickling, then one can create a pickler with a " "private dispatch table." msgstr "" -#: library/pickle.rst:788 +#: library/pickle.rst:796 msgid "" "The global dispatch table managed by the :mod:`copyreg` module is available " "as :data:`!copyreg.dispatch_table`. Therefore, one may choose to use a " "modified copy of :data:`!copyreg.dispatch_table` as a private dispatch table." msgstr "" -#: library/pickle.rst:793 +#: library/pickle.rst:801 msgid "For example ::" msgstr "" -#: library/pickle.rst:795 +#: library/pickle.rst:803 msgid "" "f = io.BytesIO()\n" "p = pickle.Pickler(f)\n" @@ -1177,13 +1188,13 @@ msgid "" "p.dispatch_table[SomeClass] = reduce_SomeClass" msgstr "" -#: library/pickle.rst:800 +#: library/pickle.rst:808 msgid "" "creates an instance of :class:`pickle.Pickler` with a private dispatch table " "which handles the ``SomeClass`` class specially. Alternatively, the code ::" msgstr "" -#: library/pickle.rst:804 +#: library/pickle.rst:812 msgid "" "class MyPickler(pickle.Pickler):\n" " dispatch_table = copyreg.dispatch_table.copy()\n" @@ -1192,30 +1203,30 @@ msgid "" "p = MyPickler(f)" msgstr "" -#: library/pickle.rst:810 +#: library/pickle.rst:818 msgid "" "does the same but all instances of ``MyPickler`` will by default share the " "private dispatch table. On the other hand, the code ::" msgstr "" -#: library/pickle.rst:813 +#: library/pickle.rst:821 msgid "" "copyreg.pickle(SomeClass, reduce_SomeClass)\n" "f = io.BytesIO()\n" "p = pickle.Pickler(f)" msgstr "" -#: library/pickle.rst:817 +#: library/pickle.rst:825 msgid "" "modifies the global dispatch table shared by all users of the :mod:`copyreg` " "module." msgstr "" -#: library/pickle.rst:822 +#: library/pickle.rst:830 msgid "Handling Stateful Objects" msgstr "" -#: library/pickle.rst:828 +#: library/pickle.rst:836 msgid "" "Here's an example that shows how to modify pickling behavior for a class. " "The :class:`!TextReader` class below opens a text file, and returns the line " @@ -1227,7 +1238,7 @@ msgid "" "behavior. ::" msgstr "" -#: library/pickle.rst:836 +#: library/pickle.rst:844 msgid "" "class TextReader:\n" " \"\"\"Print and number lines in a text file.\"\"\"\n" @@ -1267,11 +1278,11 @@ msgid "" " self.file = file" msgstr "" -#: library/pickle.rst:874 +#: library/pickle.rst:882 msgid "A sample usage might be something like this::" msgstr "" -#: library/pickle.rst:876 +#: library/pickle.rst:884 msgid "" ">>> reader = TextReader(\"hello.txt\")\n" ">>> reader.readline()\n" @@ -1283,11 +1294,11 @@ msgid "" "'3: Goodbye!'" msgstr "" -#: library/pickle.rst:888 +#: library/pickle.rst:896 msgid "Custom Reduction for Types, Functions, and Other Objects" msgstr "" -#: library/pickle.rst:892 +#: library/pickle.rst:900 msgid "" "Sometimes, :attr:`~Pickler.dispatch_table` may not be flexible enough. In " "particular we may want to customize pickling based on another criterion than " @@ -1295,7 +1306,7 @@ msgid "" "classes." msgstr "" -#: library/pickle.rst:897 +#: library/pickle.rst:905 msgid "" "For those cases, it is possible to subclass from the :class:`Pickler` class " "and implement a :meth:`~Pickler.reducer_override` method. This method can " @@ -1304,14 +1315,14 @@ msgid "" "behavior." msgstr "" -#: library/pickle.rst:902 +#: library/pickle.rst:910 msgid "" "If both the :attr:`~Pickler.dispatch_table` and :meth:`~Pickler." "reducer_override` are defined, then :meth:`~Pickler.reducer_override` method " "takes priority." msgstr "" -#: library/pickle.rst:907 +#: library/pickle.rst:915 msgid "" "For performance reasons, :meth:`~Pickler.reducer_override` may not be called " "for the following objects: ``None``, ``True``, ``False``, and exact " @@ -1320,13 +1331,13 @@ msgid "" "`tuple`." msgstr "" -#: library/pickle.rst:913 +#: library/pickle.rst:921 msgid "" "Here is a simple example where we allow pickling and reconstructing a given " "class::" msgstr "" -#: library/pickle.rst:916 +#: library/pickle.rst:924 msgid "" "import io\n" "import pickle\n" @@ -1357,11 +1368,11 @@ msgid "" "assert unpickled_class.my_attribute == 1" msgstr "" -#: library/pickle.rst:948 +#: library/pickle.rst:956 msgid "Out-of-band Buffers" msgstr "" -#: library/pickle.rst:952 +#: library/pickle.rst:960 msgid "" "In some contexts, the :mod:`pickle` module is used to transfer massive " "amounts of data. Therefore, it can be important to minimize the number of " @@ -1371,7 +1382,7 @@ msgid "" "involves copying data to and from the pickle stream." msgstr "" -#: library/pickle.rst:959 +#: library/pickle.rst:967 msgid "" "This constraint can be eschewed if both the *provider* (the implementation " "of the object types to be transferred) and the *consumer* (the " @@ -1379,11 +1390,11 @@ msgid "" "transfer facilities provided by pickle protocol 5 and higher." msgstr "" -#: library/pickle.rst:965 +#: library/pickle.rst:973 msgid "Provider API" msgstr "" -#: library/pickle.rst:967 +#: library/pickle.rst:975 msgid "" "The large data objects to be pickled must implement a :meth:`~object." "__reduce_ex__` method specialized for protocol 5 and higher, which returns " @@ -1391,7 +1402,7 @@ msgid "" "for any large data." msgstr "" -#: library/pickle.rst:972 +#: library/pickle.rst:980 msgid "" "A :class:`PickleBuffer` object *signals* that the underlying buffer is " "eligible for out-of-band data transfer. Those objects remain compatible " @@ -1400,17 +1411,17 @@ msgid "" "themselves." msgstr "" -#: library/pickle.rst:979 +#: library/pickle.rst:987 msgid "Consumer API" msgstr "" -#: library/pickle.rst:981 +#: library/pickle.rst:989 msgid "" "A communications system can enable custom handling of the :class:" "`PickleBuffer` objects generated when serializing an object graph." msgstr "" -#: library/pickle.rst:984 +#: library/pickle.rst:992 msgid "" "On the sending side, it needs to pass a *buffer_callback* argument to :class:" "`Pickler` (or to the :func:`dump` or :func:`dumps` function), which will be " @@ -1419,7 +1430,7 @@ msgid "" "copied into the pickle stream, only a cheap marker will be inserted." msgstr "" -#: library/pickle.rst:991 +#: library/pickle.rst:999 msgid "" "On the receiving side, it needs to pass a *buffers* argument to :class:" "`Unpickler` (or to the :func:`load` or :func:`loads` function), which is an " @@ -1430,7 +1441,7 @@ msgid "" "`PickleBuffer` objects." msgstr "" -#: library/pickle.rst:999 +#: library/pickle.rst:1007 msgid "" "Between the sending side and the receiving side, the communications system " "is free to implement its own transfer mechanism for out-of-band buffers. " @@ -1438,17 +1449,17 @@ msgid "" "dependent compression." msgstr "" -#: library/pickle.rst:1005 +#: library/pickle.rst:1013 msgid "Example" msgstr "" -#: library/pickle.rst:1007 +#: library/pickle.rst:1015 msgid "" "Here is a trivial example where we implement a :class:`bytearray` subclass " "able to participate in out-of-band buffer pickling::" msgstr "" -#: library/pickle.rst:1010 +#: library/pickle.rst:1018 msgid "" "class ZeroCopyByteArray(bytearray):\n" "\n" @@ -1472,20 +1483,20 @@ msgid "" " return cls(obj)" msgstr "" -#: library/pickle.rst:1031 +#: library/pickle.rst:1039 msgid "" "The reconstructor (the ``_reconstruct`` class method) returns the buffer's " "providing object if it has the right type. This is an easy way to simulate " "zero-copy behaviour on this toy example." msgstr "" -#: library/pickle.rst:1035 +#: library/pickle.rst:1043 msgid "" "On the consumer side, we can pickle those objects the usual way, which when " "unserialized will give us a copy of the original object::" msgstr "" -#: library/pickle.rst:1038 +#: library/pickle.rst:1046 msgid "" "b = ZeroCopyByteArray(b\"abc\")\n" "data = pickle.dumps(b, protocol=5)\n" @@ -1494,13 +1505,13 @@ msgid "" "print(b is new_b) # False: a copy was made" msgstr "" -#: library/pickle.rst:1044 +#: library/pickle.rst:1052 msgid "" "But if we pass a *buffer_callback* and then give back the accumulated " "buffers when unserializing, we are able to get back the original object::" msgstr "" -#: library/pickle.rst:1047 +#: library/pickle.rst:1055 msgid "" "b = ZeroCopyByteArray(b\"abc\")\n" "buffers = []\n" @@ -1510,7 +1521,7 @@ msgid "" "print(b is new_b) # True: no copy was made" msgstr "" -#: library/pickle.rst:1054 +#: library/pickle.rst:1062 msgid "" "This example is limited by the fact that :class:`bytearray` allocates its " "own memory: you cannot create a :class:`bytearray` instance that is backed " @@ -1520,15 +1531,15 @@ msgid "" "processes or systems." msgstr "" -#: library/pickle.rst:1061 +#: library/pickle.rst:1069 msgid ":pep:`574` -- Pickle protocol 5 with out-of-band data" msgstr "" -#: library/pickle.rst:1067 +#: library/pickle.rst:1075 msgid "Restricting Globals" msgstr "" -#: library/pickle.rst:1072 +#: library/pickle.rst:1080 msgid "" "By default, unpickling will import any class or function that it finds in " "the pickle data. For many applications, this behaviour is unacceptable as " @@ -1536,7 +1547,7 @@ msgid "" "what this hand-crafted pickle data stream does when loaded::" msgstr "" -#: library/pickle.rst:1077 +#: library/pickle.rst:1085 msgid "" ">>> import pickle\n" ">>> pickle.loads(b\"cos\\nsystem\\n(S'echo hello world'\\ntR.\")\n" @@ -1544,7 +1555,7 @@ msgid "" "0" msgstr "" -#: library/pickle.rst:1082 +#: library/pickle.rst:1090 msgid "" "In this example, the unpickler imports the :func:`os.system` function and " "then apply the string argument \"echo hello world\". Although this example " @@ -1552,7 +1563,7 @@ msgid "" "system." msgstr "" -#: library/pickle.rst:1086 +#: library/pickle.rst:1094 msgid "" "For this reason, you may want to control what gets unpickled by customizing :" "meth:`Unpickler.find_class`. Unlike its name suggests, :meth:`Unpickler." @@ -1561,13 +1572,13 @@ msgid "" "restrict them to a safe subset." msgstr "" -#: library/pickle.rst:1092 +#: library/pickle.rst:1100 msgid "" "Here is an example of an unpickler allowing only few safe classes from the :" "mod:`builtins` module to be loaded::" msgstr "" -#: library/pickle.rst:1095 +#: library/pickle.rst:1103 msgid "" "import builtins\n" "import io\n" @@ -1596,11 +1607,11 @@ msgid "" " return RestrictedUnpickler(io.BytesIO(s)).load()" msgstr "" -#: library/pickle.rst:1121 +#: library/pickle.rst:1129 msgid "A sample usage of our unpickler working as intended::" msgstr "" -#: library/pickle.rst:1123 +#: library/pickle.rst:1131 msgid "" ">>> restricted_loads(pickle.dumps([1, 2, range(15)]))\n" "[1, 2, range(0, 15)]\n" @@ -1616,7 +1627,7 @@ msgid "" "pickle.UnpicklingError: global 'builtins.eval' is forbidden" msgstr "" -#: library/pickle.rst:1140 +#: library/pickle.rst:1148 msgid "" "As our examples shows, you have to be careful with what you allow to be " "unpickled. Therefore if security is a concern, you may want to consider " @@ -1624,27 +1635,27 @@ msgid "" "party solutions." msgstr "" -#: library/pickle.rst:1147 +#: library/pickle.rst:1155 msgid "Performance" msgstr "" -#: library/pickle.rst:1149 +#: library/pickle.rst:1157 msgid "" "Recent versions of the pickle protocol (from protocol 2 and upwards) feature " "efficient binary encodings for several common features and built-in types. " "Also, the :mod:`pickle` module has a transparent optimizer written in C." msgstr "" -#: library/pickle.rst:1157 +#: library/pickle.rst:1165 msgid "Examples" msgstr "" -#: library/pickle.rst:1159 +#: library/pickle.rst:1167 msgid "" "For the simplest code, use the :func:`dump` and :func:`load` functions. ::" msgstr "" -#: library/pickle.rst:1161 +#: library/pickle.rst:1169 msgid "" "import pickle\n" "\n" @@ -1660,11 +1671,11 @@ msgid "" " pickle.dump(data, f, pickle.HIGHEST_PROTOCOL)" msgstr "" -#: library/pickle.rst:1175 +#: library/pickle.rst:1183 msgid "The following example reads the resulting pickled data. ::" msgstr "" -#: library/pickle.rst:1177 +#: library/pickle.rst:1185 msgid "" "import pickle\n" "\n" @@ -1674,73 +1685,73 @@ msgid "" " data = pickle.load(f)" msgstr "" -#: library/pickle.rst:1191 +#: library/pickle.rst:1199 msgid "Module :mod:`copyreg`" msgstr "" -#: library/pickle.rst:1192 +#: library/pickle.rst:1200 msgid "Pickle interface constructor registration for extension types." msgstr "" -#: library/pickle.rst:1194 +#: library/pickle.rst:1202 msgid "Module :mod:`pickletools`" msgstr "" -#: library/pickle.rst:1195 +#: library/pickle.rst:1203 msgid "Tools for working with and analyzing pickled data." msgstr "" -#: library/pickle.rst:1197 +#: library/pickle.rst:1205 msgid "Module :mod:`shelve`" msgstr "" -#: library/pickle.rst:1198 +#: library/pickle.rst:1206 msgid "Indexed databases of objects; uses :mod:`pickle`." msgstr "" -#: library/pickle.rst:1200 +#: library/pickle.rst:1208 msgid "Module :mod:`copy`" msgstr "" -#: library/pickle.rst:1201 +#: library/pickle.rst:1209 msgid "Shallow and deep object copying." msgstr "" -#: library/pickle.rst:1203 +#: library/pickle.rst:1211 msgid "Module :mod:`marshal`" msgstr "" -#: library/pickle.rst:1204 +#: library/pickle.rst:1212 msgid "High-performance serialization of built-in types." msgstr "" -#: library/pickle.rst:1208 +#: library/pickle.rst:1216 msgid "Footnotes" msgstr "" -#: library/pickle.rst:1209 +#: library/pickle.rst:1217 msgid "Don't confuse this with the :mod:`marshal` module" msgstr "" -#: library/pickle.rst:1211 +#: library/pickle.rst:1219 msgid "" "This is why :keyword:`lambda` functions cannot be pickled: all :keyword:`!" "lambda` functions share the same name: ````." msgstr "" -#: library/pickle.rst:1214 +#: library/pickle.rst:1222 msgid "" "The exception raised will likely be an :exc:`ImportError` or an :exc:" "`AttributeError` but it could be something else." msgstr "" -#: library/pickle.rst:1217 +#: library/pickle.rst:1225 msgid "" "The :mod:`copy` module uses this protocol for shallow and deep copying " "operations." msgstr "" -#: library/pickle.rst:1220 +#: library/pickle.rst:1228 msgid "" "The limitation on alphanumeric characters is due to the fact that persistent " "IDs in protocol 0 are delimited by the newline character. Therefore if any " @@ -1780,30 +1791,30 @@ msgstr "" msgid "External Data Representation" msgstr "" -#: library/pickle.rst:664 +#: library/pickle.rst:672 msgid "copy" msgstr "" -#: library/pickle.rst:664 +#: library/pickle.rst:672 msgid "protocol" msgstr "" -#: library/pickle.rst:748 +#: library/pickle.rst:756 msgid "persistent_id (pickle protocol)" msgstr "" -#: library/pickle.rst:748 +#: library/pickle.rst:756 msgid "persistent_load (pickle protocol)" msgstr "" -#: library/pickle.rst:824 +#: library/pickle.rst:832 msgid "__getstate__() (copy protocol)" msgstr "" -#: library/pickle.rst:824 +#: library/pickle.rst:832 msgid "__setstate__() (copy protocol)" msgstr "" -#: library/pickle.rst:1069 +#: library/pickle.rst:1077 msgid "find_class() (pickle protocol)" msgstr "" diff --git a/library/pickletools.po b/library/pickletools.po index 79006506..76e71e0f 100644 --- a/library/pickletools.po +++ b/library/pickletools.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" diff --git a/library/pipes.po b/library/pipes.po index 4a3c894f..e587272f 100644 --- a/library/pipes.po +++ b/library/pipes.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -18,116 +18,22 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" #: library/pipes.rst:2 -msgid ":mod:`pipes` --- Interface to shell pipelines" +msgid ":mod:`!pipes` --- Interface to shell pipelines" msgstr "" -#: library/pipes.rst:11 -msgid "**Source code:** :source:`Lib/pipes.py`" -msgstr "" - -#: library/pipes.rst:13 -msgid "" -"The :mod:`pipes` module is deprecated (see :pep:`PEP 594 <594#pipes>` for " -"details). Please use the :mod:`subprocess` module instead." -msgstr "" - -#: library/pipes.rst:20 -msgid "" -"The :mod:`pipes` module defines a class to abstract the concept of a " -"*pipeline* --- a sequence of converters from one file to another." -msgstr "" - -#: library/pipes.rst:23 -msgid "" -"Because the module uses :program:`/bin/sh` command lines, a POSIX or " -"compatible shell for :func:`os.system` and :func:`os.popen` is required." -msgstr "" - -#: library/pipes.rst:26 -msgid "Availability" -msgstr "" - -#: library/pipes.rst:28 -msgid "The :mod:`pipes` module defines the following class:" -msgstr "" - -#: library/pipes.rst:33 -msgid "An abstraction of a pipeline." -msgstr "" - -#: library/pipes.rst:35 -msgid "Example::" -msgstr "" - -#: library/pipes.rst:37 -msgid "" -">>> import pipes\n" -">>> t = pipes.Template()\n" -">>> t.append('tr a-z A-Z', '--')\n" -">>> f = t.open('pipefile', 'w')\n" -">>> f.write('hello world')\n" -">>> f.close()\n" -">>> open('pipefile').read()\n" -"'HELLO WORLD'" -msgstr "" - -#: library/pipes.rst:50 -msgid "Template Objects" -msgstr "" - -#: library/pipes.rst:52 -msgid "Template objects following methods:" -msgstr "" - -#: library/pipes.rst:57 -msgid "Restore a pipeline template to its initial state." -msgstr "" - -#: library/pipes.rst:62 -msgid "Return a new, equivalent, pipeline template." -msgstr "" - -#: library/pipes.rst:67 +#: library/pipes.rst:10 msgid "" -"If *flag* is true, turn debugging on. Otherwise, turn debugging off. When " -"debugging is on, commands to be executed are printed, and the shell is given " -"``set -x`` command to be more verbose." +"This module is no longer part of the Python standard library. It was :ref:" +"`removed in Python 3.13 ` after being deprecated in " +"Python 3.11. The removal was decided in :pep:`594`." msgstr "" -#: library/pipes.rst:74 -msgid "" -"Append a new action at the end. The *cmd* variable must be a valid bourne " -"shell command. The *kind* variable consists of two letters." +#: library/pipes.rst:14 +msgid "Applications should use the :mod:`subprocess` module instead." msgstr "" -#: library/pipes.rst:77 +#: library/pipes.rst:16 msgid "" -"The first letter can be either of ``'-'`` (which means the command reads its " -"standard input), ``'f'`` (which means the commands reads a given file on the " -"command line) or ``'.'`` (which means the commands reads no input, and hence " -"must be first.)" -msgstr "" - -#: library/pipes.rst:82 -msgid "" -"Similarly, the second letter can be either of ``'-'`` (which means the " -"command writes to standard output), ``'f'`` (which means the command writes " -"a file on the command line) or ``'.'`` (which means the command does not " -"write anything, and hence must be last.)" -msgstr "" - -#: library/pipes.rst:90 -msgid "" -"Add a new action at the beginning. See :meth:`append` for explanations of " -"the arguments." -msgstr "" - -#: library/pipes.rst:96 -msgid "" -"Return a file-like object, open to *file*, but read from or written to by " -"the pipeline. Note that only one of ``'r'``, ``'w'`` may be given." -msgstr "" - -#: library/pipes.rst:102 -msgid "Copy *infile* to *outfile* through the pipe." +"The last version of Python that provided the :mod:`!pipes` module was " +"`Python 3.12 `_." msgstr "" diff --git a/library/pkgutil.po b/library/pkgutil.po index 170cdd75..db471e95 100644 --- a/library/pkgutil.po +++ b/library/pkgutil.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" diff --git a/library/platform.po b/library/platform.po index d8c4852f..764c8684 100644 --- a/library/platform.po +++ b/library/platform.po @@ -8,8 +8,8 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" -"PO-Revision-Date: 2025-02-14 17:10+0200\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" +"PO-Revision-Date: 2025-05-05 21:41+0200\n" "Last-Translator: Marios Giannopoulos \n" "Language-Team: PyGreece \n" "Language: \n" @@ -36,7 +36,7 @@ msgstr "" "περιλαμβάνεται στην ενότητα Unix." #: library/platform.rst:21 -msgid "Cross Platform" +msgid "Cross platform" msgstr "Cross Platform" #: library/platform.rst:26 @@ -264,7 +264,18 @@ msgstr "" "``'Darwin'``, ``'Java'``, ``'Windows'``. Επιστρέφεται μια κενή συμβολοσειρά " "αν η τιμή δεν μπορεί να καθοριστεί." -#: library/platform.rst:154 +#: library/platform.rst:151 +msgid "" +"On iOS and Android, this returns the user-facing OS name (i.e, ``'iOS``, " +"``'iPadOS'`` or ``'Android'``). To obtain the kernel name (``'Darwin'`` or " +"``'Linux'``), use :func:`os.uname`." +msgstr "" +"Στο iOS και το Android, αυτό επιστρέφει το όνομα του λειτουργικό συστήματος " +"που βλέπει ο χρήστης δηλαδή, ``'iOS``, ``'iPadOS'`` ή ``'Android'``). Για να " +"λάβετε το όνομα του πυρήνα (``'Darwin'`` ή ``'Linux'``), χρησιμοποιήστε τη :" +"func:`os.uname`." + +#: library/platform.rst:157 msgid "" "Returns ``(system, release, version)`` aliased to common marketing names " "used for some systems. It also does some reordering of the information in " @@ -274,7 +285,7 @@ msgstr "" "χρήσης που χρησιμοποιούνται για ορισμένα συστήματα. Επίσης, αναδιατάσσει " "ορισμένες πληροφορίες σε περιπτώσεις που διαφορετικά θα προκαλούσαν σύγχυση." -#: library/platform.rst:161 +#: library/platform.rst:164 msgid "" "Returns the system's release version, e.g. ``'#3 on degas'``. An empty " "string is returned if the value cannot be determined." @@ -284,6 +295,15 @@ msgstr "" #: library/platform.rst:167 msgid "" +"On iOS and Android, this is the user-facing OS version. To obtain the Darwin " +"or Linux kernel version, use :func:`os.uname`." +msgstr "" +"Στο iOS και το Android, αυτή είναι η έκδοση του λειτουργικό συστήματος που " +"βλέπει ο χρήστης. Για να λάβετε την έκδοση του πυρήνα Darwin ή Linux, " +"χρησιμοποιήστε τη :func:`os.uname`." + +#: library/platform.rst:172 +msgid "" "Fairly portable uname interface. Returns a :func:`~collections.namedtuple` " "containing six attributes: :attr:`system`, :attr:`node`, :attr:`release`, :" "attr:`version`, :attr:`machine`, and :attr:`processor`." @@ -292,11 +312,11 @@ msgstr "" "που περιέχει έξι ιδιότητες: :attr:`system`, :attr:`node`, :attr:`release`, :" "attr:`version`, :attr:`machine` και :attr:`processor`." -#: library/platform.rst:171 +#: library/platform.rst:176 msgid ":attr:`processor` is resolved late, on demand." msgstr "Το :attr:`processor` επιλύεται αργά, κατόπιν αιτήματος." -#: library/platform.rst:173 +#: library/platform.rst:178 msgid "" "Note: the first two attribute names differ from the names presented by :func:" "`os.uname`, where they are named :attr:`sysname` and :attr:`nodename`." @@ -305,28 +325,28 @@ msgstr "" "παρουσιάζονται από την συνάρτηση :func:`os.uname`, όπου ονομάζονται :attr:" "`sysname` και :attr:`nodename`." -#: library/platform.rst:177 +#: library/platform.rst:182 msgid "Entries which cannot be determined are set to ``''``." msgstr "Οι τιμές που δεν μπορούν να προσδιοριστούν ορίζονται σε ``''``." -#: library/platform.rst:179 +#: library/platform.rst:184 msgid "Result changed from a tuple to a :func:`~collections.namedtuple`." msgstr "" "Το αποτέλεσμα άλλαξε από μια πλειάδα σε :func:`~collections.namedtuple`." -#: library/platform.rst:182 +#: library/platform.rst:187 msgid ":attr:`processor` is resolved late instead of immediately." msgstr "Το :attr:`processor` αναλύεται καθυστερημένα αντί άμεσα." -#: library/platform.rst:187 -msgid "Java Platform" +#: library/platform.rst:192 +msgid "Java platform" msgstr "Πλατφόρμα Java" -#: library/platform.rst:192 +#: library/platform.rst:197 msgid "Version interface for Jython." msgstr "Διεπαφή έκδοσης για Jython." -#: library/platform.rst:194 +#: library/platform.rst:199 msgid "" "Returns a tuple ``(release, vendor, vminfo, osinfo)`` with *vminfo* being a " "tuple ``(vm_name, vm_release, vm_vendor)`` and *osinfo* being a tuple " @@ -339,11 +359,19 @@ msgstr "" "μπορούν να προσδιοριστούν ορίζονται στα προεπιλεγμένα που δίνονται ως " "παράμετροι (τα οποία προεπιλεγμένα είναι όλα ``''``)." -#: library/platform.rst:201 -msgid "Windows Platform" +#: library/platform.rst:204 +msgid "" +"It was largely untested, had a confusing API, and was only useful for Jython " +"support." +msgstr "" +"Ήταν σε μεγάλο βαθμό ακατάλληλο για δοκιμές, είχε μια μπερδεμένη διεπαφή API " +"και ήταν χρήσιμο μόνο για την υποστήριξη του Jython." + +#: library/platform.rst:210 +msgid "Windows platform" msgstr "Πλατφόρμα Windows" -#: library/platform.rst:206 +#: library/platform.rst:215 msgid "" "Get additional version information from the Windows Registry and return a " "tuple ``(release, version, csd, ptype)`` referring to OS release, version " @@ -359,7 +387,7 @@ msgstr "" "προεπιλεγμένα που δίνονται ως παράμετροι (όλα προεπιλέγονται σε κενές " "συμβολοσειρές)." -#: library/platform.rst:212 +#: library/platform.rst:221 msgid "" "As a hint: *ptype* is ``'Uniprocessor Free'`` on single processor NT " "machines and ``'Multiprocessor Free'`` on multi processor machines. The " @@ -375,7 +403,7 @@ msgstr "" "χρησιμοποιεί κώδικα αποσφαλμάτωσης, δηλαδή κώδικα που ελέγχει ορίσματα, εύρη " "κ.λπ." -#: library/platform.rst:220 +#: library/platform.rst:229 msgid "" "Returns a string representing the current Windows edition, or ``None`` if " "the value cannot be determined. Possible values include but are not limited " @@ -387,7 +415,7 @@ msgstr "" "αλλά δεν περιορίζονται σε ``'Enterprise'``, ``'IoTUAP'``, " "``'ServerStandard'`` και ``'nanoserver'``." -#: library/platform.rst:228 +#: library/platform.rst:237 msgid "" "Return ``True`` if the Windows edition returned by :func:`win32_edition` is " "recognized as an IoT edition." @@ -395,11 +423,11 @@ msgstr "" "Επιστρέφει ``True`` αν η έκδοση των Windows που επιστρέφεται από την :func:" "`win32_edition` αναγνωρίζεται ως έκδοση IoT." -#: library/platform.rst:235 -msgid "macOS Platform" +#: library/platform.rst:244 +msgid "macOS platform" msgstr "Πλατφόρμα macOS" -#: library/platform.rst:240 +#: library/platform.rst:248 msgid "" "Get macOS version information and return it as tuple ``(release, " "versioninfo, machine)`` with *versioninfo* being a tuple ``(version, " @@ -409,7 +437,7 @@ msgstr "" "versioninfo, machine)`` όπου το *versioninfo* είναι μια πλειάδα ``(version, " "dev_stage, non_release_version)``." -#: library/platform.rst:244 +#: library/platform.rst:252 msgid "" "Entries which cannot be determined are set to ``''``. All tuple entries are " "strings." @@ -417,11 +445,60 @@ msgstr "" "Οι τιμές που δεν μπορούν να προσδιοριστούν ορίζονται ως ``''``. Όλα τα " "στοιχεία της πλειάδας είναι συμβολοσειρές." -#: library/platform.rst:249 -msgid "Unix Platforms" +#: library/platform.rst:256 +msgid "iOS platform" +msgstr "Πλατφόρμα iOS" + +#: library/platform.rst:260 +msgid "" +"Get iOS version information and return it as a :func:`~collections." +"namedtuple` with the following attributes:" +msgstr "" +"Λάβετε πληροφορίες για την έκδοση του iOS και επιστρέψτε τις ως μια :func:" +"`~collections.namedtuple` με τα εξής χαρακτηριστικά:" + +#: library/platform.rst:263 +msgid "``system`` is the OS name; either ``'iOS'`` or ``'iPadOS'``." +msgstr "" +"``system`` είναι το όνομα του λειτουργικού συστήματος; είτε ``'iOS'`` ή " +"``'iPadOS'``." + +#: library/platform.rst:264 +msgid "``release`` is the iOS version number as a string (e.g., ``'17.2'``)." +msgstr "" +"``release`` είναι ο αριθμός έκδοσης iOS ως μια συμβολοσειρά (π.χ., " +"``'17.2'``)." + +#: library/platform.rst:265 +msgid "" +"``model`` is the device model identifier; this will be a string like " +"``'iPhone13,2'`` for a physical device, or ``'iPhone'`` on a simulator." +msgstr "" +"Το ``model`` είναι ο αναγνωριστικό αριθμός μοντέλου της συσκευής. Αυτό θα " +"είναι μια συμβολοσειρά όπως ``'iPhone13,2'`` για μια φυσική συσκευή, ή " +"``'iPhone'`` για έναν εξομοιωτή." + +#: library/platform.rst:267 +msgid "" +"``is_simulator`` is a boolean describing if the app is running on a " +"simulator or a physical device." +msgstr "" +"Το ``is_simulator`` είναι μια δυαδική τιμή που περιγράφει αν η εφαρμογή " +"εκτελείται σε εξομοιωτή ή σε φυσική συσκευή." + +#: library/platform.rst:270 +msgid "" +"Entries which cannot be determined are set to the defaults given as " +"parameters." +msgstr "" +"Οι καταχωρήσεις που δεν μπορούν να προσδιοριστούν ορίζονται στις " +"προεπιλεγμένες τιμές που δίνονται ως παράμετροι." + +#: library/platform.rst:275 +msgid "Unix platforms" msgstr "Πλατφόρμες Unix" -#: library/platform.rst:253 +#: library/platform.rst:279 msgid "" "Tries to determine the libc version against which the file executable " "(defaults to the Python interpreter) is linked. Returns a tuple of strings " @@ -433,7 +510,7 @@ msgstr "" "μια πλειάδα συμβολοσειρών ``(lib, version)``, η οποία ορίζεται στις δοθείσες " "παραμέτρους σε περίπτωση αποτυχίας της αναζήτησης." -#: library/platform.rst:257 +#: library/platform.rst:283 msgid "" "Note that this function has intimate knowledge of how different libc " "versions add symbols to the executable is probably only usable for " @@ -444,16 +521,16 @@ msgstr "" "μπορεί να χρησιμοποιηθεί μόνο για εκτελέσιμα που έχουν μεταγλωττιστεί με το :" "program:`gcc`." -#: library/platform.rst:261 +#: library/platform.rst:287 msgid "The file is read and scanned in chunks of *chunksize* bytes." msgstr "" "Το αρχείο διαβάζεται και σαρώνονται τμήματά του μεγέθους *chunksize* bytes." -#: library/platform.rst:265 -msgid "Linux Platforms" +#: library/platform.rst:291 +msgid "Linux platforms" msgstr "Πλατφόρμες Linux" -#: library/platform.rst:269 +#: library/platform.rst:295 msgid "" "Get operating system identification from ``os-release`` file and return it " "as a dict. The ``os-release`` file is a `freedesktop.org standard `__." +msgstr "" +"``manufacturer`` - `Το όνομα του κατασκευαστή `__." + +#: library/platform.rst:347 +msgid "" +"``model`` - `Model name `__ – typically the marketing name or model number." +msgstr "" +"``model`` - `Το όνομα του μοντέλου `__ – συνήθως το εμπορικό όνομα ή ο αριθμός μοντέλου." + +#: library/platform.rst:351 +msgid "" +"``device`` - `Device name `__ – typically the model number or a codename." +msgstr "" +"``device`` - `Το όνομα της συσκευής `__ – συνήθως ο αριθμός μοντέλου ή ένα κωδικό όνομα." + +#: library/platform.rst:355 +msgid "" +"``is_emulator`` - ``True`` if the device is an emulator; ``False`` if it's a " +"physical device." +msgstr "" +"``is_emulator`` - ``True`` αν η συσκευή είναι εξομοιωτής; ``False`` αν είναι " +"φυσική συσκευή." + +#: library/platform.rst:358 +msgid "" +"Google maintains a `list of known model and device names `__." +msgstr "" +"Η Google διατηρεί μια `λίστα με γνωστά ονόματα μοντέλων συσκευών `__." + +#: library/platform.rst:366 +msgid "Command-line usage" +msgstr "Χρήση από γραμμή εντολών" + +#: library/platform.rst:368 +msgid "" +":mod:`platform` can also be invoked directly using the :option:`-m` switch " +"of the interpreter::" +msgstr "" +"Το :mod:`platform` μπορεί επίσης να κληθεί απευθείας χρησιμοποιώντας την " +"επιλογή :option:`-m` του διερμηνέα::" + +#: library/platform.rst:371 +msgid "python -m platform [--terse] [--nonaliased] [{nonaliased,terse} ...]" +msgstr "python -m platform [--terse] [--nonaliased] [{nonaliased,terse} ...]" + +#: library/platform.rst:373 +msgid "The following options are accepted:" +msgstr "Οι εξής επιλογές γίνονται αποδεκτές:" + +#: library/platform.rst:379 +msgid "" +"Print terse information about the platform. This is equivalent to calling :" +"func:`platform.platform` with the *terse* argument set to ``True``." +msgstr "" +"Εκτυπώνει συνοπτικές πληροφορίες για την πλατφόρμα. Αυτό είναι ισοδύναμο με " +"την κλήση :func:`platform.platform` με το όρισμα *terse* ορισμένο σε " +"``True``." + +#: library/platform.rst:384 +msgid "" +"Print platform information without system/OS name aliasing. This is " +"equivalent to calling :func:`platform.platform` with the *aliased* argument " +"set to ``True``." +msgstr "" +"Εκτυπώνει πληροφορίες για την πλατφόρμα χωρίς την αντικατάσταση του ονόματος " +"του συστήματος/ λειτουργικού. Αυτό είναι ισοδύναμο με την κλήση της :func:" +"`platform.platform` με το όρισμα *aliased* ορισμένο σε ``True``." + +#: library/platform.rst:388 +msgid "" +"You can also pass one or more positional arguments (``terse``, " +"``nonaliased``) to explicitly control the output format. These behave " +"similarly to their corresponding options." +msgstr "" +"Μπορείτε επίσης να περάσετε ένα ή περισσότερα ορίσματα θέσης (``terse``, " +"``nonaliased``) για να ελέγξετε ρητά τη μορφή της εξόδου. Αυτά " +"συμπεριφέρονται όπως οι αντίστοιχες επιλογές τους." diff --git a/library/plistlib.po b/library/plistlib.po index 88253bd6..f5f62565 100644 --- a/library/plistlib.po +++ b/library/plistlib.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -47,8 +47,8 @@ msgstr "" #: library/plistlib.rst:30 msgid "" -"To work with plist data in bytes objects, use :func:`dumps` and :func:" -"`loads`." +"To work with plist data in bytes or string objects, use :func:`dumps` and :" +"func:`loads`." msgstr "" #: library/plistlib.rst:33 @@ -116,118 +116,138 @@ msgstr "" #: library/plistlib.rst:72 msgid "" +"When *aware_datetime* is true, fields with type ``datetime.datetime`` will " +"be created as :ref:`aware object `, with :attr:`!" +"tzinfo` as :const:`datetime.UTC`." +msgstr "" + +#: library/plistlib.rst:76 +msgid "" "XML data for the :data:`FMT_XML` format is parsed using the Expat parser " "from :mod:`xml.parsers.expat` -- see its documentation for possible " "exceptions on ill-formed XML. Unknown elements will simply be ignored by " "the plist parser." msgstr "" -#: library/plistlib.rst:77 +#: library/plistlib.rst:81 msgid "" "The parser raises :exc:`InvalidFileException` when the file cannot be parsed." msgstr "" -#: library/plistlib.rst:84 +#: library/plistlib.rst:130 +msgid "The keyword-only parameter *aware_datetime* has been added." +msgstr "" + +#: library/plistlib.rst:91 msgid "" -"Load a plist from a bytes object. See :func:`load` for an explanation of the " -"keyword arguments." +"Load a plist from a bytes or string object. See :func:`load` for an " +"explanation of the keyword arguments." +msgstr "" + +#: library/plistlib.rst:96 +msgid "*data* can be a string when *fmt* equals :data:`FMT_XML`." msgstr "" -#: library/plistlib.rst:92 +#: library/plistlib.rst:101 msgid "" "Write *value* to a plist file. *fp* should be a writable, binary file object." msgstr "" -#: library/plistlib.rst:95 +#: library/plistlib.rst:104 msgid "" "The *fmt* argument specifies the format of the plist file and can be one of " "the following values:" msgstr "" -#: library/plistlib.rst:98 +#: library/plistlib.rst:107 msgid ":data:`FMT_XML`: XML formatted plist file" msgstr "" -#: library/plistlib.rst:100 +#: library/plistlib.rst:109 msgid ":data:`FMT_BINARY`: Binary formatted plist file" msgstr "" -#: library/plistlib.rst:102 +#: library/plistlib.rst:111 msgid "" "When *sort_keys* is true (the default) the keys for dictionaries will be " "written to the plist in sorted order, otherwise they will be written in the " "iteration order of the dictionary." msgstr "" -#: library/plistlib.rst:106 +#: library/plistlib.rst:115 msgid "" "When *skipkeys* is false (the default) the function raises :exc:`TypeError` " "when a key of a dictionary is not a string, otherwise such keys are skipped." msgstr "" -#: library/plistlib.rst:109 +#: library/plistlib.rst:118 +msgid "" +"When *aware_datetime* is true and any field with type ``datetime.datetime`` " +"is set as an :ref:`aware object `, it will convert to " +"UTC timezone before writing it." +msgstr "" + +#: library/plistlib.rst:122 msgid "" "A :exc:`TypeError` will be raised if the object is of an unsupported type or " "a container that contains objects of unsupported types." msgstr "" -#: library/plistlib.rst:112 +#: library/plistlib.rst:125 msgid "" "An :exc:`OverflowError` will be raised for integer values that cannot be " "represented in (binary) plist files." msgstr "" -#: library/plistlib.rst:120 +#: library/plistlib.rst:136 msgid "" "Return *value* as a plist-formatted bytes object. See the documentation for :" "func:`dump` for an explanation of the keyword arguments of this function." msgstr "" -#: library/plistlib.rst:127 +#: library/plistlib.rst:143 msgid "The following classes are available:" msgstr "" -#: library/plistlib.rst:131 +#: library/plistlib.rst:147 msgid "" "Wraps an :class:`int`. This is used when reading or writing NSKeyedArchiver " "encoded data, which contains UID (see PList manual)." msgstr "" -#: library/plistlib.rst:134 -msgid "" -"It has one attribute, :attr:`data`, which can be used to retrieve the int " -"value of the UID. :attr:`data` must be in the range ``0 <= data < 2**64``." +#: library/plistlib.rst:152 +msgid "Int value of the UID. It must be in the range ``0 <= data < 2**64``." msgstr "" -#: library/plistlib.rst:140 +#: library/plistlib.rst:157 msgid "The following constants are available:" msgstr "" -#: library/plistlib.rst:144 +#: library/plistlib.rst:161 msgid "The XML format for plist files." msgstr "" -#: library/plistlib.rst:151 +#: library/plistlib.rst:168 msgid "The binary format for plist files" msgstr "" -#: library/plistlib.rst:156 +#: library/plistlib.rst:173 msgid "The module defines the following exceptions:" msgstr "" -#: library/plistlib.rst:160 +#: library/plistlib.rst:177 msgid "Raised when a file cannot be parsed." msgstr "" -#: library/plistlib.rst:166 +#: library/plistlib.rst:183 msgid "Examples" msgstr "" -#: library/plistlib.rst:168 +#: library/plistlib.rst:185 msgid "Generating a plist::" msgstr "" -#: library/plistlib.rst:170 +#: library/plistlib.rst:187 msgid "" "import datetime\n" "import plistlib\n" @@ -250,11 +270,11 @@ msgid "" "print(plistlib.dumps(pl).decode())" msgstr "" -#: library/plistlib.rst:190 +#: library/plistlib.rst:207 msgid "Parsing a plist::" msgstr "" -#: library/plistlib.rst:192 +#: library/plistlib.rst:209 msgid "" "import plistlib\n" "\n" diff --git a/library/poplib.po b/library/poplib.po index 2dcee308..5b17208b 100644 --- a/library/poplib.po +++ b/library/poplib.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -56,9 +56,8 @@ msgstr "" #: includes/wasm-notavail.rst:5 msgid "" -"This module does not work or is not available on WebAssembly platforms " -"``wasm32-emscripten`` and ``wasm32-wasi``. See :ref:`wasm-availability` for " -"more information." +"This module does not work or is not available on WebAssembly. See :ref:`wasm-" +"availability` for more information." msgstr "" #: library/poplib.rst:33 diff --git a/library/posix.po b/library/posix.po index 75cca98b..b33a3900 100644 --- a/library/posix.po +++ b/library/posix.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" diff --git a/library/pprint.po b/library/pprint.po index 379a9491..5cef49c5 100644 --- a/library/pprint.po +++ b/library/pprint.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" diff --git a/library/profile.po b/library/profile.po index 6be0cd30..853fbe93 100644 --- a/library/profile.po +++ b/library/profile.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -395,8 +395,7 @@ msgstr "" #: library/profile.rst:245 msgid "" "This function is similar to :func:`run`, with added arguments to supply the " -"globals and locals dictionaries for the *command* string. This routine " -"executes::" +"globals and locals mappings for the *command* string. This routine executes::" msgstr "" #: library/profile.rst:249 @@ -484,25 +483,36 @@ msgid "" "print the results to stdout." msgstr "" -#: library/profile.rst:313 +#: library/profile.rst:311 +msgid "" +"The *sort* parameter specifies the sorting order of the displayed " +"statistics. It accepts a single key or a tuple of keys to enable multi-level " +"sorting, as in :func:`Stats.sort_stats `." +msgstr "" + +#: library/profile.rst:315 +msgid ":meth:`~Profile.print_stats` now accepts a tuple of keys." +msgstr "" + +#: library/profile.rst:320 msgid "Write the results of the current profile to *filename*." msgstr "" -#: library/profile.rst:317 +#: library/profile.rst:324 msgid "Profile the cmd via :func:`exec`." msgstr "" -#: library/profile.rst:321 +#: library/profile.rst:328 msgid "" "Profile the cmd via :func:`exec` with the specified global and local " "environment." msgstr "" -#: library/profile.rst:326 +#: library/profile.rst:333 msgid "Profile ``func(*args, **kwargs)``" msgstr "" -#: library/profile.rst:328 +#: library/profile.rst:335 msgid "" "Note that profiling will only work if the called command/function actually " "returns. If the interpreter is terminated (e.g. via a :func:`sys.exit` call " @@ -510,23 +520,23 @@ msgid "" "printed." msgstr "" -#: library/profile.rst:336 +#: library/profile.rst:343 msgid "The :class:`Stats` Class" msgstr "" -#: library/profile.rst:338 +#: library/profile.rst:345 msgid "" "Analysis of the profiler data is done using the :class:`~pstats.Stats` class." msgstr "" -#: library/profile.rst:345 +#: library/profile.rst:352 msgid "" "This class constructor creates an instance of a \"statistics object\" from a " "*filename* (or list of filenames) or from a :class:`Profile` instance. " "Output will be printed to the stream specified by *stream*." msgstr "" -#: library/profile.rst:349 +#: library/profile.rst:356 msgid "" "The file selected by the above constructor must have been created by the " "corresponding version of :mod:`profile` or :mod:`cProfile`. To be specific, " @@ -540,17 +550,17 @@ msgid "" "can be used." msgstr "" -#: library/profile.rst:360 +#: library/profile.rst:367 msgid "" "Instead of reading the profile data from a file, a :class:`cProfile.Profile` " "or :class:`profile.Profile` object can be used as the profile data source." msgstr "" -#: library/profile.rst:363 +#: library/profile.rst:370 msgid ":class:`Stats` objects have the following methods:" msgstr "" -#: library/profile.rst:367 +#: library/profile.rst:374 msgid "" "This method for the :class:`Stats` class removes all leading path " "information from file names. It is very useful in reducing the size of the " @@ -564,7 +574,7 @@ msgid "" "single entry." msgstr "" -#: library/profile.rst:381 +#: library/profile.rst:388 msgid "" "This method of the :class:`Stats` class accumulates additional profiling " "information into the current profiling object. Its arguments should refer " @@ -573,7 +583,7 @@ msgid "" "functions are automatically accumulated into single function statistics." msgstr "" -#: library/profile.rst:391 +#: library/profile.rst:398 msgid "" "Save the data loaded into the :class:`Stats` object to a file named " "*filename*. The file is created if it does not exist, and is overwritten if " @@ -581,7 +591,7 @@ msgid "" "the :class:`profile.Profile` and :class:`cProfile.Profile` classes." msgstr "" -#: library/profile.rst:399 +#: library/profile.rst:406 msgid "" "This method modifies the :class:`Stats` object by sorting it according to " "the supplied criteria. The argument can be either a string or a SortKey " @@ -591,7 +601,7 @@ msgid "" "prone." msgstr "" -#: library/profile.rst:406 +#: library/profile.rst:413 msgid "" "When more than one key is provided, then additional keys are used as " "secondary criteria when there is equality in all keys selected before them. " @@ -600,161 +610,161 @@ msgid "" "function names) by sorting by file name." msgstr "" -#: library/profile.rst:412 +#: library/profile.rst:419 msgid "" "For the string argument, abbreviations can be used for any key names, as " "long as the abbreviation is unambiguous." msgstr "" -#: library/profile.rst:415 +#: library/profile.rst:422 msgid "The following are the valid string and SortKey:" msgstr "" -#: library/profile.rst:418 +#: library/profile.rst:425 msgid "Valid String Arg" msgstr "" -#: library/profile.rst:418 +#: library/profile.rst:425 msgid "Valid enum Arg" msgstr "" -#: library/profile.rst:418 +#: library/profile.rst:425 msgid "Meaning" msgstr "" -#: library/profile.rst:420 +#: library/profile.rst:427 msgid "``'calls'``" msgstr "" -#: library/profile.rst:420 +#: library/profile.rst:427 msgid "SortKey.CALLS" msgstr "" -#: library/profile.rst:432 +#: library/profile.rst:439 msgid "call count" msgstr "" -#: library/profile.rst:422 +#: library/profile.rst:429 msgid "``'cumulative'``" msgstr "" -#: library/profile.rst:422 +#: library/profile.rst:429 msgid "SortKey.CUMULATIVE" msgstr "" -#: library/profile.rst:424 +#: library/profile.rst:431 msgid "cumulative time" msgstr "" -#: library/profile.rst:424 +#: library/profile.rst:431 msgid "``'cumtime'``" msgstr "" -#: library/profile.rst:426 library/profile.rst:432 library/profile.rst:446 +#: library/profile.rst:433 library/profile.rst:439 library/profile.rst:453 msgid "N/A" msgstr "" -#: library/profile.rst:426 +#: library/profile.rst:433 msgid "``'file'``" msgstr "" -#: library/profile.rst:428 library/profile.rst:430 +#: library/profile.rst:435 library/profile.rst:437 msgid "file name" msgstr "" -#: library/profile.rst:428 +#: library/profile.rst:435 msgid "``'filename'``" msgstr "" -#: library/profile.rst:428 +#: library/profile.rst:435 msgid "SortKey.FILENAME" msgstr "" -#: library/profile.rst:430 +#: library/profile.rst:437 msgid "``'module'``" msgstr "" -#: library/profile.rst:432 +#: library/profile.rst:439 msgid "``'ncalls'``" msgstr "" -#: library/profile.rst:434 +#: library/profile.rst:441 msgid "``'pcalls'``" msgstr "" -#: library/profile.rst:434 +#: library/profile.rst:441 msgid "SortKey.PCALLS" msgstr "" -#: library/profile.rst:434 +#: library/profile.rst:441 msgid "primitive call count" msgstr "" -#: library/profile.rst:436 +#: library/profile.rst:443 msgid "``'line'``" msgstr "" -#: library/profile.rst:436 +#: library/profile.rst:443 msgid "SortKey.LINE" msgstr "" -#: library/profile.rst:436 +#: library/profile.rst:443 msgid "line number" msgstr "" -#: library/profile.rst:438 +#: library/profile.rst:445 msgid "``'name'``" msgstr "" -#: library/profile.rst:438 +#: library/profile.rst:445 msgid "SortKey.NAME" msgstr "" -#: library/profile.rst:438 +#: library/profile.rst:445 msgid "function name" msgstr "" -#: library/profile.rst:440 +#: library/profile.rst:447 msgid "``'nfl'``" msgstr "" -#: library/profile.rst:440 +#: library/profile.rst:447 msgid "SortKey.NFL" msgstr "" -#: library/profile.rst:440 +#: library/profile.rst:447 msgid "name/file/line" msgstr "" -#: library/profile.rst:442 +#: library/profile.rst:449 msgid "``'stdname'``" msgstr "" -#: library/profile.rst:442 +#: library/profile.rst:449 msgid "SortKey.STDNAME" msgstr "" -#: library/profile.rst:442 +#: library/profile.rst:449 msgid "standard name" msgstr "" -#: library/profile.rst:444 +#: library/profile.rst:451 msgid "``'time'``" msgstr "" -#: library/profile.rst:444 +#: library/profile.rst:451 msgid "SortKey.TIME" msgstr "" -#: library/profile.rst:446 +#: library/profile.rst:453 msgid "internal time" msgstr "" -#: library/profile.rst:446 +#: library/profile.rst:453 msgid "``'tottime'``" msgstr "" -#: library/profile.rst:449 +#: library/profile.rst:456 msgid "" "Note that all sorts on statistics are in descending order (placing most time " "consuming items first), where as name, file, and line number searches are in " @@ -768,7 +778,7 @@ msgid "" "SortKey.FILENAME, SortKey.LINE)``." msgstr "" -#: library/profile.rst:460 +#: library/profile.rst:467 msgid "" "For backward-compatibility reasons, the numeric arguments ``-1``, ``0``, " "``1``, and ``2`` are permitted. They are interpreted as ``'stdname'``, " @@ -777,31 +787,31 @@ msgid "" "used, and additional arguments will be silently ignored." msgstr "" -#: library/profile.rst:468 +#: library/profile.rst:475 msgid "Added the SortKey enum." msgstr "" -#: library/profile.rst:473 +#: library/profile.rst:480 msgid "" "This method for the :class:`Stats` class reverses the ordering of the basic " "list within the object. Note that by default ascending vs descending order " "is properly selected based on the sort key of choice." msgstr "" -#: library/profile.rst:483 +#: library/profile.rst:490 msgid "" "This method for the :class:`Stats` class prints out a report as described in " "the :func:`profile.run` definition." msgstr "" -#: library/profile.rst:486 +#: library/profile.rst:493 msgid "" "The order of the printing is based on the last :meth:`~pstats.Stats." "sort_stats` operation done on the object (subject to caveats in :meth:" "`~pstats.Stats.add` and :meth:`~pstats.Stats.strip_dirs`)." msgstr "" -#: library/profile.rst:491 +#: library/profile.rst:498 msgid "" "The arguments provided (if any) can be used to limit the list down to the " "significant entries. Initially, the list is taken to be the complete set of " @@ -813,28 +823,28 @@ msgid "" "example::" msgstr "" -#: library/profile.rst:500 +#: library/profile.rst:507 msgid "print_stats(.1, 'foo:')" msgstr "" -#: library/profile.rst:502 +#: library/profile.rst:509 msgid "" "would first limit the printing to first 10% of list, and then only print " "functions that were part of filename :file:`.\\*foo:`. In contrast, the " "command::" msgstr "" -#: library/profile.rst:506 +#: library/profile.rst:513 msgid "print_stats('foo:', .1)" msgstr "" -#: library/profile.rst:508 +#: library/profile.rst:515 msgid "" "would limit the list to all functions having file names :file:`.\\*foo:`, " "and then proceed to only print the first 10% of them." msgstr "" -#: library/profile.rst:514 +#: library/profile.rst:521 msgid "" "This method for the :class:`Stats` class prints a list of all functions that " "called each function in the profiled database. The ordering is identical to " @@ -844,7 +854,7 @@ msgid "" "produced the stats:" msgstr "" -#: library/profile.rst:521 +#: library/profile.rst:528 msgid "" "With :mod:`profile`, a number is shown in parentheses after each caller to " "show how many times this specific call was made. For convenience, a second " @@ -852,14 +862,14 @@ msgid "" "at the right." msgstr "" -#: library/profile.rst:526 +#: library/profile.rst:533 msgid "" "With :mod:`cProfile`, each caller is preceded by three numbers: the number " "of times this specific call was made, and the total and cumulative times " "spent in the current function while it was invoked by this specific caller." msgstr "" -#: library/profile.rst:534 +#: library/profile.rst:541 msgid "" "This method for the :class:`Stats` class prints a list of all function that " "were called by the indicated function. Aside from this reversal of " @@ -867,7 +877,7 @@ msgid "" "are identical to the :meth:`~pstats.Stats.print_callers` method." msgstr "" -#: library/profile.rst:542 +#: library/profile.rst:549 msgid "" "This method returns an instance of StatsProfile, which contains a mapping of " "function names to instances of FunctionProfile. Each FunctionProfile " @@ -875,17 +885,17 @@ msgid "" "long the function took to run, how many times it was called, etc..." msgstr "" -#: library/profile.rst:547 +#: library/profile.rst:554 msgid "" "Added the following dataclasses: StatsProfile, FunctionProfile. Added the " "following function: get_stats_profile." msgstr "" -#: library/profile.rst:554 +#: library/profile.rst:561 msgid "What Is Deterministic Profiling?" msgstr "" -#: library/profile.rst:556 +#: library/profile.rst:563 msgid "" ":dfn:`Deterministic profiling` is meant to reflect the fact that all " "*function call*, *function return*, and *exception* events are monitored, " @@ -898,7 +908,7 @@ msgid "" "being spent." msgstr "" -#: library/profile.rst:565 +#: library/profile.rst:572 msgid "" "In Python, since there is an interpreter active during execution, the " "presence of instrumented code is not required in order to do deterministic " @@ -910,7 +920,7 @@ msgid "" "time statistics about the execution of a Python program." msgstr "" -#: library/profile.rst:574 +#: library/profile.rst:581 msgid "" "Call count statistics can be used to identify bugs in code (surprising " "counts), and to identify possible inline-expansion points (high call " @@ -922,11 +932,11 @@ msgid "" "compared to iterative implementations." msgstr "" -#: library/profile.rst:587 +#: library/profile.rst:594 msgid "Limitations" msgstr "" -#: library/profile.rst:589 +#: library/profile.rst:596 msgid "" "One limitation has to do with accuracy of timing information. There is a " "fundamental problem with deterministic profilers involving accuracy. The " @@ -937,7 +947,7 @@ msgid "" "first error induces a second source of error." msgstr "" -#: library/profile.rst:597 +#: library/profile.rst:604 msgid "" "The second problem is that it \"takes a while\" from when an event is " "dispatched until the profiler's call to get the time actually *gets* the " @@ -950,7 +960,7 @@ msgid "" "clock tick), but it *can* accumulate and become very significant." msgstr "" -#: library/profile.rst:607 +#: library/profile.rst:614 msgid "" "The problem is more important with :mod:`profile` than with the lower-" "overhead :mod:`cProfile`. For this reason, :mod:`profile` provides a means " @@ -964,11 +974,11 @@ msgid "" "calibration." msgstr "" -#: library/profile.rst:621 +#: library/profile.rst:628 msgid "Calibration" msgstr "" -#: library/profile.rst:623 +#: library/profile.rst:630 msgid "" "The profiler of the :mod:`profile` module subtracts a constant from each " "event handling time to compensate for the overhead of calling the time " @@ -977,7 +987,7 @@ msgid "" "platform (see :ref:`profile-limitations`). ::" msgstr "" -#: library/profile.rst:629 +#: library/profile.rst:636 msgid "" "import profile\n" "pr = profile.Profile()\n" @@ -985,7 +995,7 @@ msgid "" " print(pr.calibrate(10000))" msgstr "" -#: library/profile.rst:634 +#: library/profile.rst:641 msgid "" "The method executes the number of Python calls given by the argument, " "directly and again under the profiler, measuring the time for both. It then " @@ -995,19 +1005,19 @@ msgid "" "4.04e-6." msgstr "" -#: library/profile.rst:640 +#: library/profile.rst:647 msgid "" "The object of this exercise is to get a fairly consistent result. If your " "computer is *very* fast, or your timer function has poor resolution, you " "might have to pass 100000, or even 1000000, to get consistent results." msgstr "" -#: library/profile.rst:644 +#: library/profile.rst:651 msgid "" "When you have a consistent answer, there are three ways you can use it::" msgstr "" -#: library/profile.rst:646 +#: library/profile.rst:653 msgid "" "import profile\n" "\n" @@ -1022,40 +1032,40 @@ msgid "" "pr = profile.Profile(bias=your_computed_bias)" msgstr "" -#: library/profile.rst:658 +#: library/profile.rst:665 msgid "" "If you have a choice, you are better off choosing a smaller constant, and " "then your results will \"less often\" show up as negative in profile " "statistics." msgstr "" -#: library/profile.rst:664 +#: library/profile.rst:671 msgid "Using a custom timer" msgstr "" -#: library/profile.rst:666 +#: library/profile.rst:673 msgid "" "If you want to change how current time is determined (for example, to force " "use of wall-clock time or elapsed process time), pass the timing function " "you want to the :class:`Profile` class constructor::" msgstr "" -#: library/profile.rst:670 +#: library/profile.rst:677 msgid "pr = profile.Profile(your_time_func)" msgstr "" -#: library/profile.rst:672 +#: library/profile.rst:679 msgid "" "The resulting profiler will then call ``your_time_func``. Depending on " "whether you are using :class:`profile.Profile` or :class:`cProfile.Profile`, " "``your_time_func``'s return value will be interpreted differently:" msgstr "" -#: library/profile.rst:676 +#: library/profile.rst:683 msgid ":class:`profile.Profile`" msgstr "" -#: library/profile.rst:677 +#: library/profile.rst:684 msgid "" "``your_time_func`` should return a single number, or a list of numbers whose " "sum is the current time (like what :func:`os.times` returns). If the " @@ -1064,7 +1074,7 @@ msgid "" "routine." msgstr "" -#: library/profile.rst:683 +#: library/profile.rst:690 msgid "" "Be warned that you should calibrate the profiler class for the timer " "function that you choose (see :ref:`profile-calibration`). For most " @@ -1076,11 +1086,11 @@ msgid "" "along with the appropriate calibration constant." msgstr "" -#: library/profile.rst:692 +#: library/profile.rst:699 msgid ":class:`cProfile.Profile`" msgstr "" -#: library/profile.rst:693 +#: library/profile.rst:700 msgid "" "``your_time_func`` should return a single number. If it returns integers, " "you can also invoke the class constructor with a second argument specifying " @@ -1089,11 +1099,11 @@ msgid "" "you would construct the :class:`Profile` instance as follows::" msgstr "" -#: library/profile.rst:699 +#: library/profile.rst:706 msgid "pr = cProfile.Profile(your_integer_time_func, 0.001)" msgstr "" -#: library/profile.rst:701 +#: library/profile.rst:708 msgid "" "As the :class:`cProfile.Profile` class cannot be calibrated, custom timer " "functions should be used with care and should be as fast as possible. For " @@ -1101,7 +1111,7 @@ msgid "" "in the C source of the internal :mod:`!_lsprof` module." msgstr "" -#: library/profile.rst:706 +#: library/profile.rst:713 msgid "" "Python 3.3 adds several new functions in :mod:`time` that can be used to " "make precise measurements of process or wall-clock time. For example, see :" diff --git a/library/pty.po b/library/pty.po index eb31924b..35da2c4d 100644 --- a/library/pty.po +++ b/library/pty.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" diff --git a/library/pwd.po b/library/pwd.po index c036f341..2503a937 100644 --- a/library/pwd.po +++ b/library/pwd.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -140,55 +140,38 @@ msgid "" "is raised if the entry asked for cannot be found." msgstr "" -#: library/pwd.rst:44 +#: library/pwd.rst:42 msgid "" "In traditional Unix the field ``pw_passwd`` usually contains a password " -"encrypted with a DES derived algorithm (see module :mod:`crypt`). However " -"most modern unices use a so-called *shadow password* system. On those " -"unices the *pw_passwd* field only contains an asterisk (``'*'``) or the " -"letter ``'x'`` where the encrypted password is stored in a file :file:`/etc/" -"shadow` which is not world readable. Whether the *pw_passwd* field contains " -"anything useful is system-dependent. If available, the :mod:`spwd` module " -"should be used where access to the encrypted password is required." +"encrypted with a DES derived algorithm. However most modern unices use a " +"so-called *shadow password* system. On those unices the *pw_passwd* field " +"only contains an asterisk (``'*'``) or the letter ``'x'`` where the " +"encrypted password is stored in a file :file:`/etc/shadow` which is not " +"world readable. Whether the *pw_passwd* field contains anything useful is " +"system-dependent." msgstr "" -#: library/pwd.rst:53 +#: library/pwd.rst:50 msgid "It defines the following items:" msgstr "" -#: library/pwd.rst:58 +#: library/pwd.rst:55 msgid "Return the password database entry for the given numeric user ID." msgstr "" -#: library/pwd.rst:63 +#: library/pwd.rst:60 msgid "Return the password database entry for the given user name." msgstr "" -#: library/pwd.rst:68 +#: library/pwd.rst:65 msgid "" "Return a list of all available password database entries, in arbitrary order." msgstr "" -#: library/pwd.rst:73 +#: library/pwd.rst:70 msgid "Module :mod:`grp`" msgstr "" -#: library/pwd.rst:74 +#: library/pwd.rst:71 msgid "An interface to the group database, similar to this." msgstr "" - -#: library/pwd.rst:76 -msgid "Module :mod:`spwd`" -msgstr "" - -#: library/pwd.rst:77 -msgid "An interface to the shadow password database, similar to this." -msgstr "" - -#: library/pwd.rst:42 -msgid "module" -msgstr "" - -#: library/pwd.rst:42 -msgid "crypt" -msgstr "" diff --git a/library/py_compile.po b/library/py_compile.po index 0adb53f9..d7499da3 100644 --- a/library/py_compile.po +++ b/library/py_compile.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" diff --git a/library/pyclbr.po b/library/pyclbr.po index d79ee4e2..27fc1d2d 100644 --- a/library/pyclbr.po +++ b/library/pyclbr.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" diff --git a/library/pydoc.po b/library/pydoc.po index f786bf97..1c0e91dc 100644 --- a/library/pydoc.po +++ b/library/pydoc.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" diff --git a/library/pyexpat.po b/library/pyexpat.po index e972c7f4..dcc1f25c 100644 --- a/library/pyexpat.po +++ b/library/pyexpat.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" diff --git a/library/python.po b/library/python.po index 780443ae..4788875e 100644 --- a/library/python.po +++ b/library/python.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" diff --git a/library/queue.po b/library/queue.po index 71de2a43..f471144e 100644 --- a/library/queue.po +++ b/library/queue.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -131,24 +131,30 @@ msgid "" "put_nowait`) is called on a :class:`Queue` object which is full." msgstr "" -#: library/queue.rst:99 +#: library/queue.rst:98 +msgid "" +"Exception raised when :meth:`~Queue.put` or :meth:`~Queue.get` is called on " +"a :class:`Queue` object which has been shut down." +msgstr "" + +#: library/queue.rst:107 msgid "Queue Objects" msgstr "" -#: library/queue.rst:101 +#: library/queue.rst:109 msgid "" "Queue objects (:class:`Queue`, :class:`LifoQueue`, or :class:" "`PriorityQueue`) provide the public methods described below." msgstr "" -#: library/queue.rst:107 +#: library/queue.rst:115 msgid "" "Return the approximate size of the queue. Note, qsize() > 0 doesn't " "guarantee that a subsequent get() will not block, nor will qsize() < maxsize " "guarantee that put() will not block." msgstr "" -#: library/queue.rst:114 +#: library/queue.rst:122 msgid "" "Return ``True`` if the queue is empty, ``False`` otherwise. If empty() " "returns ``True`` it doesn't guarantee that a subsequent call to put() will " @@ -156,7 +162,7 @@ msgid "" "that a subsequent call to get() will not block." msgstr "" -#: library/queue.rst:122 +#: library/queue.rst:130 msgid "" "Return ``True`` if the queue is full, ``False`` otherwise. If full() " "returns ``True`` it doesn't guarantee that a subsequent call to get() will " @@ -164,7 +170,7 @@ msgid "" "a subsequent call to put() will not block." msgstr "" -#: library/queue.rst:130 +#: library/queue.rst:138 msgid "" "Put *item* into the queue. If optional args *block* is true and *timeout* " "is ``None`` (the default), block if necessary until a free slot is " @@ -175,11 +181,15 @@ msgid "" "(*timeout* is ignored in that case)." msgstr "" -#: library/queue.rst:141 +#: library/queue.rst:146 +msgid "Raises :exc:`ShutDown` if the queue has been shut down." +msgstr "" + +#: library/queue.rst:151 msgid "Equivalent to ``put(item, block=False)``." msgstr "" -#: library/queue.rst:258 +#: library/queue.rst:297 msgid "" "Remove and return an item from the queue. If optional args *block* is true " "and *timeout* is ``None`` (the default), block if necessary until an item is " @@ -190,7 +200,7 @@ msgid "" "ignored in that case)." msgstr "" -#: library/queue.rst:153 +#: library/queue.rst:163 msgid "" "Prior to 3.0 on POSIX systems, and for all versions on Windows, if *block* " "is true and *timeout* is ``None``, this operation goes into an " @@ -199,41 +209,53 @@ msgid "" "`KeyboardInterrupt`." msgstr "" -#: library/queue.rst:268 +#: library/queue.rst:168 +msgid "" +"Raises :exc:`ShutDown` if the queue has been shut down and is empty, or if " +"the queue has been shut down immediately." +msgstr "" + +#: library/queue.rst:307 msgid "Equivalent to ``get(False)``." msgstr "" -#: library/queue.rst:163 +#: library/queue.rst:176 msgid "" "Two methods are offered to support tracking whether enqueued tasks have been " "fully processed by daemon consumer threads." msgstr "" -#: library/queue.rst:169 +#: library/queue.rst:182 msgid "" "Indicate that a formerly enqueued task is complete. Used by queue consumer " "threads. For each :meth:`get` used to fetch a task, a subsequent call to :" "meth:`task_done` tells the queue that the processing on the task is complete." msgstr "" -#: library/queue.rst:173 +#: library/queue.rst:186 msgid "" "If a :meth:`join` is currently blocking, it will resume when all items have " "been processed (meaning that a :meth:`task_done` call was received for every " "item that had been :meth:`put` into the queue)." msgstr "" -#: library/queue.rst:177 +#: library/queue.rst:190 +msgid "" +"``shutdown(immediate=True)`` calls :meth:`task_done` for each remaining item " +"in the queue." +msgstr "" + +#: library/queue.rst:193 msgid "" "Raises a :exc:`ValueError` if called more times than there were items placed " "in the queue." msgstr "" -#: library/queue.rst:183 +#: library/queue.rst:199 msgid "Blocks until all items in the queue have been gotten and processed." msgstr "" -#: library/queue.rst:185 +#: library/queue.rst:201 msgid "" "The count of unfinished tasks goes up whenever an item is added to the " "queue. The count goes down whenever a consumer thread calls :meth:" @@ -242,11 +264,11 @@ msgid "" "unblocks." msgstr "" -#: library/queue.rst:191 +#: library/queue.rst:207 msgid "Example of how to wait for enqueued tasks to be completed::" msgstr "" -#: library/queue.rst:193 +#: library/queue.rst:209 msgid "" "import threading\n" "import queue\n" @@ -272,29 +294,60 @@ msgid "" "print('All work completed')" msgstr "" -#: library/queue.rst:218 +#: library/queue.rst:234 +msgid "Terminating queues" +msgstr "" + +#: library/queue.rst:236 +msgid "" +":class:`Queue` objects can be made to prevent further interaction by " +"shutting them down." +msgstr "" + +#: library/queue.rst:241 +msgid "" +"Shut down the queue, making :meth:`~Queue.get` and :meth:`~Queue.put` raise :" +"exc:`ShutDown`." +msgstr "" + +#: library/queue.rst:244 +msgid "" +"By default, :meth:`~Queue.get` on a shut down queue will only raise once the " +"queue is empty. Set *immediate* to true to make :meth:`~Queue.get` raise " +"immediately instead." +msgstr "" + +#: library/queue.rst:248 +msgid "" +"All blocked callers of :meth:`~Queue.put` and :meth:`~Queue.get` will be " +"unblocked. If *immediate* is true, a task will be marked as done for each " +"remaining item in the queue, which may unblock callers of :meth:`~Queue." +"join`." +msgstr "" + +#: library/queue.rst:257 msgid "SimpleQueue Objects" msgstr "" -#: library/queue.rst:220 +#: library/queue.rst:259 msgid "" ":class:`SimpleQueue` objects provide the public methods described below." msgstr "" -#: library/queue.rst:224 +#: library/queue.rst:263 msgid "" "Return the approximate size of the queue. Note, qsize() > 0 doesn't " "guarantee that a subsequent get() will not block." msgstr "" -#: library/queue.rst:230 +#: library/queue.rst:269 msgid "" "Return ``True`` if the queue is empty, ``False`` otherwise. If empty() " "returns ``False`` it doesn't guarantee that a subsequent call to get() will " "not block." msgstr "" -#: library/queue.rst:237 +#: library/queue.rst:276 msgid "" "Put *item* into the queue. The method never blocks and always succeeds " "(except for potential low-level errors such as failure to allocate memory). " @@ -302,7 +355,7 @@ msgid "" "compatibility with :meth:`Queue.put`." msgstr "" -#: library/queue.rst:243 +#: library/queue.rst:282 msgid "" "This method has a C implementation which is reentrant. That is, a ``put()`` " "or ``get()`` call can be interrupted by another ``put()`` call in the same " @@ -311,23 +364,23 @@ msgid "" "or :mod:`weakref` callbacks." msgstr "" -#: library/queue.rst:252 +#: library/queue.rst:291 msgid "" "Equivalent to ``put(item, block=False)``, provided for compatibility with :" "meth:`Queue.put_nowait`." msgstr "" -#: library/queue.rst:273 +#: library/queue.rst:312 msgid "Class :class:`multiprocessing.Queue`" msgstr "" -#: library/queue.rst:274 +#: library/queue.rst:313 msgid "" "A queue class for use in a multi-processing (rather than multi-threading) " "context." msgstr "" -#: library/queue.rst:277 +#: library/queue.rst:316 msgid "" ":class:`collections.deque` is an alternative implementation of unbounded " "queues with fast atomic :meth:`~collections.deque.append` and :meth:" diff --git a/library/quopri.po b/library/quopri.po index 5364d8ae..5bdb124c 100644 --- a/library/quopri.po +++ b/library/quopri.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" diff --git a/library/random.po b/library/random.po index 75a510f4..e48fdb8e 100644 --- a/library/random.po +++ b/library/random.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -100,15 +100,24 @@ msgid "" "simple update operations." msgstr "" -#: library/random.rst:64 +#: library/random.rst:63 +msgid "" +"The global random number generator and instances of :class:`Random` are " +"thread-safe. However, in the free-threaded build, concurrent calls to the " +"global generator or to the same instance of :class:`Random` may encounter " +"contention and poor performance. Consider using separate instances of :class:" +"`Random` per thread instead." +msgstr "" + +#: library/random.rst:70 msgid "Bookkeeping functions" msgstr "" -#: library/random.rst:68 +#: library/random.rst:74 msgid "Initialize the random number generator." msgstr "" -#: library/random.rst:70 +#: library/random.rst:76 msgid "" "If *a* is omitted or ``None``, the current system time is used. If " "randomness sources are provided by the operating system, they are used " @@ -116,108 +125,108 @@ msgid "" "on availability)." msgstr "" -#: library/random.rst:75 +#: library/random.rst:81 msgid "If *a* is an int, it is used directly." msgstr "" -#: library/random.rst:77 +#: library/random.rst:83 msgid "" "With version 2 (the default), a :class:`str`, :class:`bytes`, or :class:" "`bytearray` object gets converted to an :class:`int` and all of its bits are " "used." msgstr "" -#: library/random.rst:80 +#: library/random.rst:86 msgid "" "With version 1 (provided for reproducing random sequences from older " "versions of Python), the algorithm for :class:`str` and :class:`bytes` " "generates a narrower range of seeds." msgstr "" -#: library/random.rst:84 +#: library/random.rst:90 msgid "" "Moved to the version 2 scheme which uses all of the bits in a string seed." msgstr "" -#: library/random.rst:87 +#: library/random.rst:93 msgid "" "The *seed* must be one of the following types: ``None``, :class:`int`, :" "class:`float`, :class:`str`, :class:`bytes`, or :class:`bytearray`." msgstr "" -#: library/random.rst:94 +#: library/random.rst:100 msgid "" "Return an object capturing the current internal state of the generator. " "This object can be passed to :func:`setstate` to restore the state." msgstr "" -#: library/random.rst:100 +#: library/random.rst:106 msgid "" "*state* should have been obtained from a previous call to :func:`getstate`, " "and :func:`setstate` restores the internal state of the generator to what it " "was at the time :func:`getstate` was called." msgstr "" -#: library/random.rst:106 +#: library/random.rst:112 msgid "Functions for bytes" msgstr "" -#: library/random.rst:110 +#: library/random.rst:116 msgid "Generate *n* random bytes." msgstr "" -#: library/random.rst:112 +#: library/random.rst:118 msgid "" "This method should not be used for generating security tokens. Use :func:" "`secrets.token_bytes` instead." msgstr "" -#: library/random.rst:119 +#: library/random.rst:125 msgid "Functions for integers" msgstr "" -#: library/random.rst:124 +#: library/random.rst:130 msgid "Return a randomly selected element from ``range(start, stop, step)``." msgstr "" -#: library/random.rst:126 +#: library/random.rst:132 msgid "" "This is roughly equivalent to ``choice(range(start, stop, step))`` but " "supports arbitrarily large ranges and is optimized for common cases." msgstr "" -#: library/random.rst:129 +#: library/random.rst:135 msgid "The positional argument pattern matches the :func:`range` function." msgstr "" -#: library/random.rst:131 +#: library/random.rst:137 msgid "" "Keyword arguments should not be used because they can be interpreted in " "unexpected ways. For example ``randrange(start=100)`` is interpreted as " "``randrange(0, 100, 1)``." msgstr "" -#: library/random.rst:135 +#: library/random.rst:141 msgid "" ":meth:`randrange` is more sophisticated about producing equally distributed " "values. Formerly it used a style like ``int(random()*n)`` which could " "produce slightly uneven distributions." msgstr "" -#: library/random.rst:140 +#: library/random.rst:146 msgid "" "Automatic conversion of non-integer types is no longer supported. Calls such " "as ``randrange(10.0)`` and ``randrange(Fraction(10, 1))`` now raise a :exc:" "`TypeError`." msgstr "" -#: library/random.rst:147 +#: library/random.rst:153 msgid "" "Return a random integer *N* such that ``a <= N <= b``. Alias for " "``randrange(a, b+1)``." msgstr "" -#: library/random.rst:152 +#: library/random.rst:158 msgid "" "Returns a non-negative Python integer with *k* random bits. This method is " "supplied with the Mersenne Twister generator and some other generators may " @@ -225,27 +234,27 @@ msgid "" "`getrandbits` enables :meth:`randrange` to handle arbitrarily large ranges." msgstr "" -#: library/random.rst:158 +#: library/random.rst:164 msgid "This method now accepts zero for *k*." msgstr "" -#: library/random.rst:163 +#: library/random.rst:169 msgid "Functions for sequences" msgstr "" -#: library/random.rst:167 +#: library/random.rst:173 msgid "" "Return a random element from the non-empty sequence *seq*. If *seq* is " "empty, raises :exc:`IndexError`." msgstr "" -#: library/random.rst:172 +#: library/random.rst:178 msgid "" "Return a *k* sized list of elements chosen from the *population* with " "replacement. If the *population* is empty, raises :exc:`IndexError`." msgstr "" -#: library/random.rst:175 +#: library/random.rst:181 msgid "" "If a *weights* sequence is specified, selections are made according to the " "relative weights. Alternatively, if a *cum_weights* sequence is given, the " @@ -256,7 +265,7 @@ msgid "" "before making selections, so supplying the cumulative weights saves work." msgstr "" -#: library/random.rst:184 +#: library/random.rst:190 msgid "" "If neither *weights* nor *cum_weights* are specified, selections are made " "with equal probability. If a weights sequence is supplied, it must be the " @@ -264,7 +273,7 @@ msgid "" "specify both *weights* and *cum_weights*." msgstr "" -#: library/random.rst:189 +#: library/random.rst:195 msgid "" "The *weights* or *cum_weights* can use any numeric type that interoperates " "with the :class:`float` values returned by :func:`random` (that includes " @@ -273,7 +282,7 @@ msgid "" "are zero." msgstr "" -#: library/random.rst:195 +#: library/random.rst:201 msgid "" "For a given seed, the :func:`choices` function with equal weighting " "typically produces a different sequence than repeated calls to :func:" @@ -283,21 +292,21 @@ msgid "" "small biases from round-off error." msgstr "" -#: library/random.rst:204 +#: library/random.rst:210 msgid "Raises a :exc:`ValueError` if all weights are zero." msgstr "" -#: library/random.rst:210 +#: library/random.rst:216 msgid "Shuffle the sequence *x* in place." msgstr "" -#: library/random.rst:212 +#: library/random.rst:218 msgid "" "To shuffle an immutable sequence and return a new shuffled list, use " "``sample(x, k=len(x))`` instead." msgstr "" -#: library/random.rst:215 +#: library/random.rst:221 msgid "" "Note that even for small ``len(x)``, the total number of permutations of *x* " "can quickly grow larger than the period of most random number generators. " @@ -306,17 +315,17 @@ msgid "" "fit within the period of the Mersenne Twister random number generator." msgstr "" -#: library/random.rst:221 +#: library/random.rst:227 msgid "Removed the optional parameter *random*." msgstr "" -#: library/random.rst:227 +#: library/random.rst:233 msgid "" "Return a *k* length list of unique elements chosen from the population " "sequence. Used for random sampling without replacement." msgstr "" -#: library/random.rst:230 +#: library/random.rst:236 msgid "" "Returns a new list containing elements from the population while leaving the " "original population unchanged. The resulting list is in selection order so " @@ -325,14 +334,14 @@ msgid "" "winners (the subslices)." msgstr "" -#: library/random.rst:236 +#: library/random.rst:242 msgid "" "Members of the population need not be :term:`hashable` or unique. If the " "population contains repeats, then each occurrence is a possible selection in " "the sample." msgstr "" -#: library/random.rst:239 +#: library/random.rst:245 msgid "" "Repeated elements can be specified one at a time or with the optional " "keyword-only *counts* parameter. For example, ``sample(['red', 'blue'], " @@ -340,64 +349,64 @@ msgid "" "'blue', 'blue'], k=5)``." msgstr "" -#: library/random.rst:244 +#: library/random.rst:250 msgid "" "To choose a sample from a range of integers, use a :func:`range` object as " "an argument. This is especially fast and space efficient for sampling from " "a large population: ``sample(range(10000000), k=60)``." msgstr "" -#: library/random.rst:248 +#: library/random.rst:254 msgid "" "If the sample size is larger than the population size, a :exc:`ValueError` " "is raised." msgstr "" -#: library/random.rst:251 +#: library/random.rst:257 msgid "Added the *counts* parameter." msgstr "" -#: library/random.rst:256 +#: library/random.rst:262 msgid "" "The *population* must be a sequence. Automatic conversion of sets to lists " "is no longer supported." msgstr "" -#: library/random.rst:260 +#: library/random.rst:266 msgid "Discrete distributions" msgstr "" -#: library/random.rst:262 +#: library/random.rst:268 msgid "The following function generates a discrete distribution." msgstr "" -#: library/random.rst:266 +#: library/random.rst:272 msgid "" "`Binomial distribution `_. Return the number of successes for *n* independent trials with the " "probability of success in each trial being *p*:" msgstr "" -#: library/random.rst:271 +#: library/random.rst:277 msgid "Mathematically equivalent to::" msgstr "" -#: library/random.rst:273 +#: library/random.rst:279 msgid "sum(random() < p for i in range(n))" msgstr "" -#: library/random.rst:275 +#: library/random.rst:281 msgid "" "The number of trials *n* should be a non-negative integer. The probability " "of success *p* should be between ``0.0 <= p <= 1.0``. The result is an " "integer in the range ``0 <= X <= n``." msgstr "" -#: library/random.rst:285 +#: library/random.rst:291 msgid "Real-valued distributions" msgstr "" -#: library/random.rst:287 +#: library/random.rst:293 msgid "" "The following functions generate specific real-valued distributions. " "Function parameters are named after the corresponding variables in the " @@ -405,24 +414,24 @@ msgid "" "these equations can be found in any statistics text." msgstr "" -#: library/random.rst:295 +#: library/random.rst:301 msgid "" "Return the next random floating-point number in the range ``0.0 <= X < 1.0``" msgstr "" -#: library/random.rst:300 +#: library/random.rst:306 msgid "" "Return a random floating-point number *N* such that ``a <= N <= b`` for ``a " "<= b`` and ``b <= N <= a`` for ``b < a``." msgstr "" -#: library/random.rst:303 +#: library/random.rst:309 msgid "" "The end-point value ``b`` may or may not be included in the range depending " "on floating-point rounding in the expression ``a + (b-a) * random()``." msgstr "" -#: library/random.rst:310 +#: library/random.rst:316 msgid "" "Return a random floating-point number *N* such that ``low <= N <= high`` and " "with the specified *mode* between those bounds. The *low* and *high* bounds " @@ -430,13 +439,13 @@ msgid "" "between the bounds, giving a symmetric distribution." msgstr "" -#: library/random.rst:318 +#: library/random.rst:324 msgid "" "Beta distribution. Conditions on the parameters are ``alpha > 0`` and " "``beta > 0``. Returned values range between 0 and 1." msgstr "" -#: library/random.rst:324 +#: library/random.rst:330 msgid "" "Exponential distribution. *lambd* is 1.0 divided by the desired mean. It " "should be nonzero. (The parameter would be called \"lambda\", but that is a " @@ -445,36 +454,36 @@ msgid "" "negative." msgstr "" -#: library/random.rst:330 +#: library/random.rst:336 msgid "Added the default value for ``lambd``." msgstr "" -#: library/random.rst:336 +#: library/random.rst:342 msgid "" "Gamma distribution. (*Not* the gamma function!) The shape and scale " "parameters, *alpha* and *beta*, must have positive values. (Calling " "conventions vary and some sources define 'beta' as the inverse of the scale)." msgstr "" -#: library/random.rst:341 +#: library/random.rst:347 msgid "The probability distribution function is::" msgstr "" -#: library/random.rst:343 +#: library/random.rst:349 msgid "" " x ** (alpha - 1) * math.exp(-x / beta)\n" "pdf(x) = --------------------------------------\n" " math.gamma(alpha) * beta ** alpha" msgstr "" -#: library/random.rst:350 +#: library/random.rst:356 msgid "" "Normal distribution, also called the Gaussian distribution. *mu* is the " "mean, and *sigma* is the standard deviation. This is slightly faster than " "the :func:`normalvariate` function defined below." msgstr "" -#: library/random.rst:355 +#: library/random.rst:361 msgid "" "Multithreading note: When two threads call this function simultaneously, it " "is possible that they will receive the same return value. This can be " @@ -483,11 +492,11 @@ msgid "" "but thread-safe :func:`normalvariate` function instead." msgstr "" -#: library/random.rst:378 +#: library/random.rst:384 msgid "*mu* and *sigma* now have default arguments." msgstr "" -#: library/random.rst:368 +#: library/random.rst:374 msgid "" "Log normal distribution. If you take the natural logarithm of this " "distribution, you'll get a normal distribution with mean *mu* and standard " @@ -495,13 +504,13 @@ msgid "" "than zero." msgstr "" -#: library/random.rst:376 +#: library/random.rst:382 msgid "" "Normal distribution. *mu* is the mean, and *sigma* is the standard " "deviation." msgstr "" -#: library/random.rst:384 +#: library/random.rst:390 msgid "" "*mu* is the mean angle, expressed in radians between 0 and 2\\*\\ *pi*, and " "*kappa* is the concentration parameter, which must be greater than or equal " @@ -509,75 +518,75 @@ msgid "" "uniform random angle over the range 0 to 2\\*\\ *pi*." msgstr "" -#: library/random.rst:392 +#: library/random.rst:398 msgid "Pareto distribution. *alpha* is the shape parameter." msgstr "" -#: library/random.rst:397 +#: library/random.rst:403 msgid "" "Weibull distribution. *alpha* is the scale parameter and *beta* is the " "shape parameter." msgstr "" -#: library/random.rst:402 +#: library/random.rst:408 msgid "Alternative Generator" msgstr "" -#: library/random.rst:406 +#: library/random.rst:412 msgid "" "Class that implements the default pseudo-random number generator used by " "the :mod:`random` module." msgstr "" -#: library/random.rst:409 +#: library/random.rst:415 msgid "" "Formerly the *seed* could be any hashable object. Now it is limited to: " "``None``, :class:`int`, :class:`float`, :class:`str`, :class:`bytes`, or :" "class:`bytearray`." msgstr "" -#: library/random.rst:414 +#: library/random.rst:420 msgid "" "Subclasses of :class:`!Random` should override the following methods if they " "wish to make use of a different basic generator:" msgstr "" -#: library/random.rst:419 +#: library/random.rst:425 msgid "" "Override this method in subclasses to customise the :meth:`~random.seed` " "behaviour of :class:`!Random` instances." msgstr "" -#: library/random.rst:424 +#: library/random.rst:430 msgid "" "Override this method in subclasses to customise the :meth:`~random.getstate` " "behaviour of :class:`!Random` instances." msgstr "" -#: library/random.rst:429 +#: library/random.rst:435 msgid "" "Override this method in subclasses to customise the :meth:`~random.setstate` " "behaviour of :class:`!Random` instances." msgstr "" -#: library/random.rst:434 +#: library/random.rst:440 msgid "" "Override this method in subclasses to customise the :meth:`~random.random` " "behaviour of :class:`!Random` instances." msgstr "" -#: library/random.rst:437 +#: library/random.rst:443 msgid "" "Optionally, a custom generator subclass can also supply the following method:" msgstr "" -#: library/random.rst:441 +#: library/random.rst:447 msgid "" "Override this method in subclasses to customise the :meth:`~random." "getrandbits` behaviour of :class:`!Random` instances." msgstr "" -#: library/random.rst:447 +#: library/random.rst:453 msgid "" "Class that uses the :func:`os.urandom` function for generating random " "numbers from sources provided by the operating system. Not available on all " @@ -587,11 +596,11 @@ msgid "" "`NotImplementedError` if called." msgstr "" -#: library/random.rst:456 +#: library/random.rst:462 msgid "Notes on Reproducibility" msgstr "" -#: library/random.rst:458 +#: library/random.rst:464 msgid "" "Sometimes it is useful to be able to reproduce the sequences given by a " "pseudo-random number generator. By reusing a seed value, the same sequence " @@ -599,33 +608,33 @@ msgid "" "running." msgstr "" -#: library/random.rst:462 +#: library/random.rst:468 msgid "" "Most of the random module's algorithms and seeding functions are subject to " "change across Python versions, but two aspects are guaranteed not to change:" msgstr "" -#: library/random.rst:465 +#: library/random.rst:471 msgid "" "If a new seeding method is added, then a backward compatible seeder will be " "offered." msgstr "" -#: library/random.rst:468 +#: library/random.rst:474 msgid "" "The generator's :meth:`~Random.random` method will continue to produce the " "same sequence when the compatible seeder is given the same seed." msgstr "" -#: library/random.rst:474 +#: library/random.rst:480 msgid "Examples" msgstr "" -#: library/random.rst:476 +#: library/random.rst:482 msgid "Basic examples::" msgstr "" -#: library/random.rst:478 +#: library/random.rst:484 msgid "" ">>> random() # Random float: 0.0 <= x < 1.0\n" "0.37444887175646646\n" @@ -657,11 +666,11 @@ msgid "" "[40, 10, 50, 30]" msgstr "" -#: library/random.rst:504 +#: library/random.rst:510 msgid "Simulations::" msgstr "" -#: library/random.rst:506 +#: library/random.rst:512 msgid "" ">>> # Six roulette wheel spins (weighted sampling with replacement)\n" ">>> choices(['red', 'black', 'green'], [18, 18, 2], k=6)\n" @@ -687,14 +696,14 @@ msgid "" "0.7958" msgstr "" -#: library/random.rst:529 +#: library/random.rst:535 msgid "" "Example of `statistical bootstrapping `_ using resampling with replacement to estimate " "a confidence interval for the mean of a sample::" msgstr "" -#: library/random.rst:533 +#: library/random.rst:539 msgid "" "# https://www.thoughtco.com/example-of-bootstrapping-3126155\n" "from statistics import fmean as mean\n" @@ -706,7 +715,7 @@ msgid "" " f'interval from {means[5]:.1f} to {means[94]:.1f}')" msgstr "" -#: library/random.rst:542 +#: library/random.rst:548 msgid "" "Example of a `resampling permutation test `_ to determine the statistical " @@ -714,7 +723,7 @@ msgid "" "observed difference between the effects of a drug versus a placebo::" msgstr "" -#: library/random.rst:548 +#: library/random.rst:554 msgid "" "# Example from \"Statistics is Easy\" by Dennis Shasha and Manda Wilson\n" "from statistics import fmean as mean\n" @@ -742,12 +751,12 @@ msgid "" "placebo.')" msgstr "" -#: library/random.rst:569 +#: library/random.rst:575 msgid "" "Simulation of arrival times and service deliveries for a multiserver queue::" msgstr "" -#: library/random.rst:571 +#: library/random.rst:577 msgid "" "from heapq import heapify, heapreplace\n" "from random import expovariate, gauss\n" @@ -776,7 +785,7 @@ msgid "" "print('Quartiles:', [round(q, 1) for q in quantiles(waits)])" msgstr "" -#: library/random.rst:598 +#: library/random.rst:604 msgid "" "`Statistics for Hackers `_ a " "video tutorial by `Jake Vanderplas `_ a simulation of a marketplace by `Peter Norvig `_ a tutorial by `Peter Norvig " @@ -801,17 +810,17 @@ msgid "" "how to write simulations, and how to perform data analysis using Python." msgstr "" -#: library/random.rst:619 +#: library/random.rst:625 msgid "Recipes" msgstr "" -#: library/random.rst:621 +#: library/random.rst:627 msgid "" "These recipes show how to efficiently make random selections from the " "combinatoric iterators in the :mod:`itertools` module:" msgstr "" -#: library/random.rst:624 +#: library/random.rst:630 msgid "" "def random_product(*args, repeat=1):\n" " \"Random selection from itertools.product(*args, **kwds)\"\n" @@ -842,7 +851,7 @@ msgid "" " return tuple(pool[i] for i in indices)" msgstr "" -#: library/random.rst:653 +#: library/random.rst:659 msgid "" "The default :func:`.random` returns multiples of 2⁻⁵³ in the range *0.0 ≤ x " "< 1.0*. All such numbers are evenly spaced and are exactly representable as " @@ -851,7 +860,7 @@ msgid "" "integer multiple of 2⁻⁵³." msgstr "" -#: library/random.rst:659 +#: library/random.rst:665 msgid "" "The following recipe takes a different approach. All floats in the interval " "are possible selections. The mantissa comes from a uniform distribution of " @@ -860,7 +869,7 @@ msgid "" "often as the next larger exponent." msgstr "" -#: library/random.rst:667 +#: library/random.rst:673 msgid "" "from random import Random\n" "from math import ldexp\n" @@ -877,13 +886,13 @@ msgid "" " return ldexp(mantissa, exponent)" msgstr "" -#: library/random.rst:681 +#: library/random.rst:687 msgid "" "All :ref:`real valued distributions ` in the " "class will use the new method::" msgstr "" -#: library/random.rst:684 +#: library/random.rst:690 msgid "" ">>> fr = FullRandom()\n" ">>> fr.random()\n" @@ -892,7 +901,7 @@ msgid "" "8.87925541791544" msgstr "" -#: library/random.rst:690 +#: library/random.rst:696 msgid "" "The recipe is conceptually equivalent to an algorithm that chooses from all " "the multiples of 2⁻¹⁰⁷⁴ in the range *0.0 ≤ x < 1.0*. All such numbers are " @@ -901,10 +910,103 @@ msgid "" "and is equal to ``math.ulp(0.0)``.)" msgstr "" -#: library/random.rst:699 +#: library/random.rst:705 msgid "" "`Generating Pseudo-random Floating-Point Values `_ a paper by Allen B. Downey describing " "ways to generate more fine-grained floats than normally generated by :func:`." "random`." msgstr "" + +#: library/random.rst:713 +msgid "Command-line usage" +msgstr "" + +#: library/random.rst:717 +msgid "The :mod:`!random` module can be executed from the command line." +msgstr "" + +#: library/random.rst:719 +msgid "" +"python -m random [-h] [-c CHOICE [CHOICE ...] | -i N | -f N] [input ...]" +msgstr "" + +#: library/random.rst:723 +msgid "The following options are accepted:" +msgstr "" + +#: library/random.rst:729 +msgid "Show the help message and exit." +msgstr "" + +#: library/random.rst:734 +msgid "Print a random choice, using :meth:`choice`." +msgstr "" + +#: library/random.rst:739 +msgid "" +"Print a random integer between 1 and N inclusive, using :meth:`randint`." +msgstr "" + +#: library/random.rst:744 +msgid "" +"Print a random floating-point number between 0 and N inclusive, using :meth:" +"`uniform`." +msgstr "" + +#: library/random.rst:747 +msgid "If no options are given, the output depends on the input:" +msgstr "" + +#: library/random.rst:749 +msgid "String or multiple: same as :option:`--choice`." +msgstr "" + +#: library/random.rst:750 +msgid "Integer: same as :option:`--integer`." +msgstr "" + +#: library/random.rst:751 +msgid "Float: same as :option:`--float`." +msgstr "" + +#: library/random.rst:756 +msgid "Command-line example" +msgstr "" + +#: library/random.rst:758 +msgid "Here are some examples of the :mod:`!random` command-line interface:" +msgstr "" + +#: library/random.rst:760 +msgid "" +"$ # Choose one at random\n" +"$ python -m random egg bacon sausage spam \"Lobster Thermidor aux crevettes " +"with a Mornay sauce\"\n" +"Lobster Thermidor aux crevettes with a Mornay sauce\n" +"\n" +"$ # Random integer\n" +"$ python -m random 6\n" +"6\n" +"\n" +"$ # Random floating-point number\n" +"$ python -m random 1.8\n" +"1.7080016272295635\n" +"\n" +"$ # With explicit arguments\n" +"$ python -m random --choice egg bacon sausage spam \"Lobster Thermidor aux " +"crevettes with a Mornay sauce\"\n" +"egg\n" +"\n" +"$ python -m random --integer 6\n" +"3\n" +"\n" +"$ python -m random --float 1.8\n" +"1.5666339105010318\n" +"\n" +"$ python -m random --integer 6\n" +"5\n" +"\n" +"$ python -m random --float 6\n" +"3.1942323316565915" +msgstr "" diff --git a/library/re.po b/library/re.po index 5a1dffdb..13e57251 100644 --- a/library/re.po +++ b/library/re.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -145,7 +145,7 @@ msgstr "" msgid "The special characters are:" msgstr "" -#: library/re.rst:1643 +#: library/re.rst:1658 msgid "``.``" msgstr "" @@ -355,19 +355,24 @@ msgstr "" #: library/re.rst:253 msgid "" -"Special characters lose their special meaning inside sets. For example, " -"``[(+*)]`` will match any of the literal characters ``'('``, ``'+'``, " -"``'*'``, or ``')'``." +"Special characters except backslash lose their special meaning inside sets. " +"For example, ``[(+*)]`` will match any of the literal characters ``'('``, " +"``'+'``, ``'*'``, or ``')'``." msgstr "" -#: library/re.rst:259 +#: library/re.rst:260 msgid "" -"Character classes such as ``\\w`` or ``\\S`` (defined below) are also " -"accepted inside a set, although the characters they match depend on the " -"flags_ used." +"Backslash either escapes characters which have special meaning in a set such " +"as ``'-'``, ``']'``, ``'^'`` and ``'\\\\'`` itself or signals a special " +"sequence which represents a single character such as ``\\xa0`` or ``\\n`` or " +"a character class such as ``\\w`` or ``\\S`` (defined below). Note that " +"``\\b`` represents a single \"backspace\" character, not a word boundary as " +"outside a set, and numeric escapes such as ``\\1`` are always octal escapes, " +"not group references. Special sequences which do not match a single " +"character such as ``\\A`` and ``\\Z`` are not allowed." msgstr "" -#: library/re.rst:264 +#: library/re.rst:273 msgid "" "Characters that are not within a range can be matched by :dfn:" "`complementing` the set. If the first character of the set is ``'^'``, all " @@ -377,7 +382,7 @@ msgid "" "first character in the set." msgstr "" -#: library/re.rst:271 +#: library/re.rst:280 msgid "" "To match a literal ``']'`` inside a set, precede it with a backslash, or " "place it at the beginning of the set. For example, both ``[()[\\]{}]`` and " @@ -385,7 +390,7 @@ msgid "" "and parentheses." msgstr "" -#: library/re.rst:281 +#: library/re.rst:290 msgid "" "Support of nested sets and set operations as in `Unicode Technical Standard " "#18`_ might be added in the future. This would change the syntax, so to " @@ -395,17 +400,17 @@ msgid "" "``'||'``. To avoid a warning escape them with a backslash." msgstr "" -#: library/re.rst:291 +#: library/re.rst:300 msgid "" ":exc:`FutureWarning` is raised if a character set contains constructs that " "will change semantically in the future." msgstr "" -#: library/re.rst:297 +#: library/re.rst:306 msgid "``|``" msgstr "" -#: library/re.rst:298 +#: library/re.rst:307 msgid "" "``A|B``, where *A* and *B* can be arbitrary REs, creates a regular " "expression that will match either *A* or *B*. An arbitrary number of REs " @@ -418,11 +423,11 @@ msgid "" "use ``\\|``, or enclose it inside a character class, as in ``[|]``." msgstr "" -#: library/re.rst:311 +#: library/re.rst:320 msgid "``(...)``" msgstr "" -#: library/re.rst:312 +#: library/re.rst:321 msgid "" "Matches whatever regular expression is inside the parentheses, and indicates " "the start and end of a group; the contents of a group can be retrieved after " @@ -432,11 +437,11 @@ msgid "" "character class: ``[(]``, ``[)]``." msgstr "" -#: library/re.rst:320 +#: library/re.rst:329 msgid "``(?...)``" msgstr "" -#: library/re.rst:321 +#: library/re.rst:330 msgid "" "This is an extension notation (a ``'?'`` following a ``'('`` is not " "meaningful otherwise). The first character after the ``'?'`` determines " @@ -445,46 +450,46 @@ msgid "" "rule. Following are the currently supported extensions." msgstr "" -#: library/re.rst:327 +#: library/re.rst:336 msgid "``(?aiLmsux)``" msgstr "" -#: library/re.rst:328 +#: library/re.rst:337 msgid "" "(One or more letters from the set ``'a'``, ``'i'``, ``'L'``, ``'m'``, " "``'s'``, ``'u'``, ``'x'``.) The group matches the empty string; the letters " "set the corresponding flags for the entire regular expression:" msgstr "" -#: library/re.rst:365 +#: library/re.rst:374 msgid ":const:`re.A` (ASCII-only matching)" msgstr "" -#: library/re.rst:366 +#: library/re.rst:375 msgid ":const:`re.I` (ignore case)" msgstr "" -#: library/re.rst:367 +#: library/re.rst:376 msgid ":const:`re.L` (locale dependent)" msgstr "" -#: library/re.rst:368 +#: library/re.rst:377 msgid ":const:`re.M` (multi-line)" msgstr "" -#: library/re.rst:369 +#: library/re.rst:378 msgid ":const:`re.S` (dot matches all)" msgstr "" -#: library/re.rst:370 +#: library/re.rst:379 msgid ":const:`re.U` (Unicode matching)" msgstr "" -#: library/re.rst:371 +#: library/re.rst:380 msgid ":const:`re.X` (verbose)" msgstr "" -#: library/re.rst:341 +#: library/re.rst:350 msgid "" "(The flags are described in :ref:`contents-of-module-re`.) This is useful if " "you wish to include the flags as part of the regular expression, instead of " @@ -492,15 +497,15 @@ msgid "" "be used first in the expression string." msgstr "" -#: library/re.rst:347 +#: library/re.rst:356 msgid "This construction can only be used at the start of the expression." msgstr "" -#: library/re.rst:352 +#: library/re.rst:361 msgid "``(?:...)``" msgstr "" -#: library/re.rst:353 +#: library/re.rst:362 msgid "" "A non-capturing version of regular parentheses. Matches whatever regular " "expression is inside the parentheses, but the substring matched by the group " @@ -508,11 +513,11 @@ msgid "" "pattern." msgstr "" -#: library/re.rst:358 +#: library/re.rst:367 msgid "``(?aiLmsux-imsx:...)``" msgstr "" -#: library/re.rst:359 +#: library/re.rst:368 msgid "" "(Zero or more letters from the set ``'a'``, ``'i'``, ``'L'``, ``'m'``, " "``'s'``, ``'u'``, ``'x'``, optionally followed by ``'-'`` followed by one or " @@ -520,11 +525,11 @@ msgid "" "or remove the corresponding flags for the part of the expression:" msgstr "" -#: library/re.rst:373 +#: library/re.rst:382 msgid "(The flags are described in :ref:`contents-of-module-re`.)" msgstr "" -#: library/re.rst:375 +#: library/re.rst:384 msgid "" "The letters ``'a'``, ``'L'`` and ``'u'`` are mutually exclusive when used as " "inline flags, so they can't be combined or follow ``'-'``. Instead, when " @@ -537,15 +542,15 @@ msgid "" "restored outside of the group." msgstr "" -#: library/re.rst:387 +#: library/re.rst:396 msgid "The letters ``'a'``, ``'L'`` and ``'u'`` also can be used in a group." msgstr "" -#: library/re.rst:390 +#: library/re.rst:399 msgid "``(?>...)``" msgstr "" -#: library/re.rst:391 +#: library/re.rst:400 msgid "" "Attempts to match ``...`` as if it was a separate regular expression, and if " "successful, continues to match the rest of the pattern following it. If the " @@ -559,11 +564,11 @@ msgid "" "thus fail to match." msgstr "" -#: library/re.rst:407 +#: library/re.rst:416 msgid "``(?P...)``" msgstr "" -#: library/re.rst:408 +#: library/re.rst:417 msgid "" "Similar to regular parentheses, but the substring matched by the group is " "accessible via the symbolic group name *name*. Group names must be valid " @@ -573,108 +578,108 @@ msgid "" "the group were not named." msgstr "" -#: library/re.rst:415 +#: library/re.rst:424 msgid "" "Named groups can be referenced in three contexts. If the pattern is ``(?" "P['\"]).*?(?P=quote)`` (i.e. matching a string quoted with either " "single or double quotes):" msgstr "" -#: library/re.rst:420 +#: library/re.rst:429 msgid "Context of reference to group \"quote\"" msgstr "" -#: library/re.rst:420 +#: library/re.rst:429 msgid "Ways to reference it" msgstr "" -#: library/re.rst:422 +#: library/re.rst:431 msgid "in the same pattern itself" msgstr "" -#: library/re.rst:422 +#: library/re.rst:431 msgid "``(?P=quote)`` (as shown)" msgstr "" -#: library/re.rst:430 +#: library/re.rst:439 msgid "``\\1``" msgstr "" -#: library/re.rst:425 +#: library/re.rst:434 msgid "when processing match object *m*" msgstr "" -#: library/re.rst:425 +#: library/re.rst:434 msgid "``m.group('quote')``" msgstr "" -#: library/re.rst:426 +#: library/re.rst:435 msgid "``m.end('quote')`` (etc.)" msgstr "" -#: library/re.rst:428 +#: library/re.rst:437 msgid "in a string passed to the *repl* argument of ``re.sub()``" msgstr "" -#: library/re.rst:428 +#: library/re.rst:437 msgid "``\\g``" msgstr "" -#: library/re.rst:429 +#: library/re.rst:438 msgid "``\\g<1>``" msgstr "" -#: library/re.rst:433 +#: library/re.rst:442 msgid "" "In :class:`bytes` patterns, group *name* can only contain bytes in the ASCII " "range (``b'\\x00'``-``b'\\x7f'``)." msgstr "" -#: library/re.rst:439 +#: library/re.rst:448 msgid "``(?P=name)``" msgstr "" -#: library/re.rst:440 +#: library/re.rst:449 msgid "" "A backreference to a named group; it matches whatever text was matched by " "the earlier group named *name*." msgstr "" -#: library/re.rst:445 +#: library/re.rst:454 msgid "``(?#...)``" msgstr "" -#: library/re.rst:446 +#: library/re.rst:455 msgid "A comment; the contents of the parentheses are simply ignored." msgstr "" -#: library/re.rst:450 +#: library/re.rst:459 msgid "``(?=...)``" msgstr "" -#: library/re.rst:451 +#: library/re.rst:460 msgid "" "Matches if ``...`` matches next, but doesn't consume any of the string. " "This is called a :dfn:`lookahead assertion`. For example, ``Isaac (?" "=Asimov)`` will match ``'Isaac '`` only if it's followed by ``'Asimov'``." msgstr "" -#: library/re.rst:457 +#: library/re.rst:466 msgid "``(?!...)``" msgstr "" -#: library/re.rst:458 +#: library/re.rst:467 msgid "" "Matches if ``...`` doesn't match next. This is a :dfn:`negative lookahead " "assertion`. For example, ``Isaac (?!Asimov)`` will match ``'Isaac '`` only " "if it's *not* followed by ``'Asimov'``." msgstr "" -#: library/re.rst:464 +#: library/re.rst:473 msgid "``(?<=...)``" msgstr "" -#: library/re.rst:465 +#: library/re.rst:474 msgid "" "Matches if the current position in the string is preceded by a match for " "``...`` that ends at the current position. This is called a :dfn:`positive " @@ -688,19 +693,19 @@ msgid "" "func:`match` function:" msgstr "" -#: library/re.rst:480 +#: library/re.rst:489 msgid "This example looks for a word following a hyphen:" msgstr "" -#: library/re.rst:486 +#: library/re.rst:495 msgid "Added support for group references of fixed length." msgstr "" -#: library/re.rst:491 +#: library/re.rst:500 msgid "``(?'``." msgstr "" -#: library/re.rst:509 +#: library/re.rst:518 msgid "" "Group *id* can only contain ASCII digits. In :class:`bytes` patterns, group " "*name* can only contain bytes in the ASCII range (``b'\\x00'``-``b'\\x7f'``)." msgstr "" -#: library/re.rst:517 +#: library/re.rst:526 msgid "" "The special sequences consist of ``'\\'`` and a character from the list " "below. If the ordinary character is not an ASCII digit or an ASCII letter, " @@ -737,11 +742,11 @@ msgid "" "matches the character ``'$'``." msgstr "" -#: library/re.rst:524 +#: library/re.rst:533 msgid "``\\number``" msgstr "" -#: library/re.rst:525 +#: library/re.rst:534 msgid "" "Matches the contents of the group of the same number. Groups are numbered " "starting from 1. For example, ``(.+) \\1`` matches ``'the the'`` or ``'55 " @@ -753,19 +758,19 @@ msgid "" "escapes are treated as characters." msgstr "" -#: library/re.rst:536 +#: library/re.rst:545 msgid "``\\A``" msgstr "" -#: library/re.rst:537 +#: library/re.rst:546 msgid "Matches only at the start of the string." msgstr "" -#: library/re.rst:541 +#: library/re.rst:550 msgid "``\\b``" msgstr "" -#: library/re.rst:542 +#: library/re.rst:551 msgid "" "Matches the empty string, but only at the beginning or end of a word. A word " "is defined as a sequence of word characters. Note that formally, ``\\b`` is " @@ -775,7 +780,7 @@ msgid "" "``'as at ay'`` but not ``'attempt'`` or ``'atlas'``." msgstr "" -#: library/re.rst:550 +#: library/re.rst:559 msgid "" "The default word characters in Unicode (str) patterns are Unicode " "alphanumerics and the underscore, but this can be changed by using the :py:" @@ -783,17 +788,17 @@ msgid "" "if the :py:const:`~re.LOCALE` flag is used." msgstr "" -#: library/re.rst:558 +#: library/re.rst:567 msgid "" "Inside a character range, ``\\b`` represents the backspace character, for " "compatibility with Python's string literals." msgstr "" -#: library/re.rst:563 +#: library/re.rst:572 msgid "``\\B``" msgstr "" -#: library/re.rst:564 +#: library/re.rst:573 msgid "" "Matches the empty string, but only when it is *not* at the beginning or end " "of a word. This means that ``r'at\\B'`` matches ``'athens'``, ``'atom'``, " @@ -804,61 +809,61 @@ msgid "" "current locale if the :py:const:`~re.LOCALE` flag is used." msgstr "" -#: library/re.rst:577 +#: library/re.rst:586 msgid "" "Note that ``\\B`` does not match an empty string, which differs from RE " "implementations in other programming languages such as Perl. This behavior " "is kept for compatibility reasons." msgstr "" -#: library/re.rst:583 +#: library/re.rst:592 msgid "``\\d``" msgstr "" -#: library/re.rst:608 library/re.rst:630 +#: library/re.rst:617 library/re.rst:639 msgid "For Unicode (str) patterns:" msgstr "" -#: library/re.rst:585 +#: library/re.rst:594 msgid "" "Matches any Unicode decimal digit (that is, any character in Unicode " "character category `[Nd]`__). This includes ``[0-9]``, and also many other " "digit characters." msgstr "" -#: library/re.rst:589 +#: library/re.rst:598 msgid "Matches ``[0-9]`` if the :py:const:`~re.ASCII` flag is used." msgstr "" -#: library/re.rst:615 library/re.rst:638 +#: library/re.rst:624 library/re.rst:647 msgid "For 8-bit (bytes) patterns:" msgstr "" -#: library/re.rst:594 +#: library/re.rst:603 msgid "" "Matches any decimal digit in the ASCII character set; this is equivalent to " "``[0-9]``." msgstr "" -#: library/re.rst:599 +#: library/re.rst:608 msgid "``\\D``" msgstr "" -#: library/re.rst:600 +#: library/re.rst:609 msgid "" "Matches any character which is not a decimal digit. This is the opposite of " "``\\d``." msgstr "" -#: library/re.rst:603 +#: library/re.rst:612 msgid "Matches ``[^0-9]`` if the :py:const:`~re.ASCII` flag is used." msgstr "" -#: library/re.rst:607 +#: library/re.rst:616 msgid "``\\s``" msgstr "" -#: library/re.rst:609 +#: library/re.rst:618 msgid "" "Matches Unicode whitespace characters (as defined by :py:meth:`str." "isspace`). This includes ``[ \\t\\n\\r\\f\\v]``, and also many other " @@ -866,48 +871,48 @@ msgid "" "in many languages." msgstr "" -#: library/re.rst:613 +#: library/re.rst:622 msgid "" "Matches ``[ \\t\\n\\r\\f\\v]`` if the :py:const:`~re.ASCII` flag is used." msgstr "" -#: library/re.rst:616 +#: library/re.rst:625 msgid "" "Matches characters considered whitespace in the ASCII character set; this is " "equivalent to ``[ \\t\\n\\r\\f\\v]``." msgstr "" -#: library/re.rst:621 +#: library/re.rst:630 msgid "``\\S``" msgstr "" -#: library/re.rst:622 +#: library/re.rst:631 msgid "" "Matches any character which is not a whitespace character. This is the " "opposite of ``\\s``." msgstr "" -#: library/re.rst:625 +#: library/re.rst:634 msgid "" "Matches ``[^ \\t\\n\\r\\f\\v]`` if the :py:const:`~re.ASCII` flag is used." msgstr "" -#: library/re.rst:629 +#: library/re.rst:638 msgid "``\\w``" msgstr "" -#: library/re.rst:631 +#: library/re.rst:640 msgid "" "Matches Unicode word characters; this includes all Unicode alphanumeric " "characters (as defined by :py:meth:`str.isalnum`), as well as the underscore " "(``_``)." msgstr "" -#: library/re.rst:636 +#: library/re.rst:645 msgid "Matches ``[a-zA-Z0-9_]`` if the :py:const:`~re.ASCII` flag is used." msgstr "" -#: library/re.rst:639 +#: library/re.rst:648 msgid "" "Matches characters considered alphanumeric in the ASCII character set; this " "is equivalent to ``[a-zA-Z0-9_]``. If the :py:const:`~re.LOCALE` flag is " @@ -915,62 +920,62 @@ msgid "" "the underscore." msgstr "" -#: library/re.rst:646 +#: library/re.rst:655 msgid "``\\W``" msgstr "" -#: library/re.rst:647 +#: library/re.rst:656 msgid "" "Matches any character which is not a word character. This is the opposite of " "``\\w``. By default, matches non-underscore (``_``) characters for which :py:" "meth:`str.isalnum` returns ``False``." msgstr "" -#: library/re.rst:652 +#: library/re.rst:661 msgid "Matches ``[^a-zA-Z0-9_]`` if the :py:const:`~re.ASCII` flag is used." msgstr "" -#: library/re.rst:654 +#: library/re.rst:663 msgid "" "If the :py:const:`~re.LOCALE` flag is used, matches characters which are " "neither alphanumeric in the current locale nor the underscore." msgstr "" -#: library/re.rst:660 +#: library/re.rst:669 msgid "``\\Z``" msgstr "" -#: library/re.rst:661 +#: library/re.rst:670 msgid "Matches only at the end of the string." msgstr "" -#: library/re.rst:677 +#: library/re.rst:686 msgid "" "Most of the :ref:`escape sequences ` supported by Python " "string literals are also accepted by the regular expression parser::" msgstr "" -#: library/re.rst:680 +#: library/re.rst:689 msgid "" "\\a \\b \\f \\n\n" "\\N \\r \\t \\u\n" "\\U \\v \\x \\\\" msgstr "" -#: library/re.rst:684 +#: library/re.rst:693 msgid "" "(Note that ``\\b`` is used to represent word boundaries, and means " "\"backspace\" only inside character classes.)" msgstr "" -#: library/re.rst:687 +#: library/re.rst:696 msgid "" "``'\\u'``, ``'\\U'``, and ``'\\N'`` escape sequences are only recognized in " "Unicode (str) patterns. In bytes patterns they are errors. Unknown escapes " "of ASCII letters are reserved for future use and treated as errors." msgstr "" -#: library/re.rst:693 +#: library/re.rst:702 msgid "" "Octal escapes are included in a limited form. If the first digit is a 0, or " "if there are three octal digits, it is considered an octal escape. " @@ -978,27 +983,27 @@ msgid "" "are always at most three digits in length." msgstr "" -#: library/re.rst:698 +#: library/re.rst:707 msgid "The ``'\\u'`` and ``'\\U'`` escape sequences have been added." msgstr "" -#: library/re.rst:701 +#: library/re.rst:710 msgid "" "Unknown escapes consisting of ``'\\'`` and an ASCII letter now are errors." msgstr "" -#: library/re.rst:704 +#: library/re.rst:713 msgid "" "The :samp:`'\\\\N\\\\{{name}\\\\}'` escape sequence has been added. As in " "string literals, it expands to the named Unicode character (e.g. ``'\\N{EM " "DASH}'``)." msgstr "" -#: library/re.rst:712 +#: library/re.rst:721 msgid "Module Contents" msgstr "" -#: library/re.rst:714 +#: library/re.rst:723 msgid "" "The module defines several functions, constants, and an exception. Some of " "the functions are simplified versions of the full featured methods for " @@ -1006,26 +1011,26 @@ msgid "" "compiled form." msgstr "" -#: library/re.rst:721 +#: library/re.rst:730 msgid "Flags" msgstr "" -#: library/re.rst:723 +#: library/re.rst:732 msgid "" "Flag constants are now instances of :class:`RegexFlag`, which is a subclass " "of :class:`enum.IntFlag`." msgstr "" -#: library/re.rst:730 +#: library/re.rst:739 msgid "" "An :class:`enum.IntFlag` class containing the regex options listed below." msgstr "" -#: library/re.rst:732 +#: library/re.rst:741 msgid "- added to ``__all__``" msgstr "" -#: library/re.rst:737 +#: library/re.rst:746 msgid "" "Make ``\\w``, ``\\W``, ``\\b``, ``\\B``, ``\\d``, ``\\D``, ``\\s`` and " "``\\S`` perform ASCII-only matching instead of full Unicode matching. This " @@ -1033,11 +1038,11 @@ msgid "" "patterns." msgstr "" -#: library/re.rst:741 +#: library/re.rst:750 msgid "Corresponds to the inline flag ``(?a)``." msgstr "" -#: library/re.rst:745 +#: library/re.rst:754 msgid "" "The :py:const:`~re.U` flag still exists for backward compatibility, but is " "redundant in Python 3 since matches are Unicode by default for ``str`` " @@ -1045,15 +1050,15 @@ msgid "" "`~re.UNICODE` and the inline flag ``(?u)`` are similarly redundant." msgstr "" -#: library/re.rst:754 +#: library/re.rst:763 msgid "Display debug information about compiled expression." msgstr "" -#: library/re.rst:756 +#: library/re.rst:765 msgid "No corresponding inline flag." msgstr "" -#: library/re.rst:762 +#: library/re.rst:771 msgid "" "Perform case-insensitive matching; expressions like ``[A-Z]`` will also " "match lowercase letters. Full Unicode matching (such as ``Ü`` matching " @@ -1062,11 +1067,11 @@ msgid "" "flag unless the :py:const:`~re.LOCALE` flag is also used." msgstr "" -#: library/re.rst:770 +#: library/re.rst:779 msgid "Corresponds to the inline flag ``(?i)``." msgstr "" -#: library/re.rst:772 +#: library/re.rst:781 msgid "" "Note that when the Unicode patterns ``[a-z]`` or ``[A-Z]`` are used in " "combination with the :const:`IGNORECASE` flag, they will match the 52 ASCII " @@ -1077,18 +1082,18 @@ msgid "" "'Z' are matched." msgstr "" -#: library/re.rst:783 +#: library/re.rst:792 msgid "" "Make ``\\w``, ``\\W``, ``\\b``, ``\\B`` and case-insensitive matching " "dependent on the current locale. This flag can be used only with bytes " "patterns." msgstr "" -#: library/re.rst:787 +#: library/re.rst:796 msgid "Corresponds to the inline flag ``(?L)``." msgstr "" -#: library/re.rst:791 +#: library/re.rst:800 msgid "" "This flag is discouraged; consider Unicode matching instead. The locale " "mechanism is very unreliable as it only handles one \"culture\" at a time " @@ -1097,20 +1102,20 @@ msgid "" "languages." msgstr "" -#: library/re.rst:798 +#: library/re.rst:807 msgid "" ":py:const:`~re.LOCALE` can be used only with bytes patterns and is not " "compatible with :py:const:`~re.ASCII`." msgstr "" -#: library/re.rst:802 +#: library/re.rst:811 msgid "" "Compiled regular expression objects with the :py:const:`~re.LOCALE` flag no " "longer depend on the locale at compile time. Only the locale at matching " "time affects the result of matching." msgstr "" -#: library/re.rst:811 +#: library/re.rst:820 msgid "" "When specified, the pattern character ``'^'`` matches at the beginning of " "the string and at the beginning of each line (immediately following each " @@ -1121,11 +1126,11 @@ msgid "" "the end of the string." msgstr "" -#: library/re.rst:818 +#: library/re.rst:827 msgid "Corresponds to the inline flag ``(?m)``." msgstr "" -#: library/re.rst:822 +#: library/re.rst:831 msgid "" "Indicates no flag being applied, the value is ``0``. This flag may be used " "as a default value for a function keyword argument or as a base value that " @@ -1133,35 +1138,35 @@ msgid "" "value::" msgstr "" -#: library/re.rst:827 +#: library/re.rst:836 msgid "" "def myfunc(text, flag=re.NOFLAG):\n" " return re.match(text, flag)" msgstr "" -#: library/re.rst:835 +#: library/re.rst:844 msgid "" "Make the ``'.'`` special character match any character at all, including a " "newline; without this flag, ``'.'`` will match anything *except* a newline." msgstr "" -#: library/re.rst:838 +#: library/re.rst:847 msgid "Corresponds to the inline flag ``(?s)``." msgstr "" -#: library/re.rst:844 +#: library/re.rst:853 msgid "" "In Python 3, Unicode characters are matched by default for ``str`` patterns. " "This flag is therefore redundant with **no effect** and is only kept for " "backward compatibility." msgstr "" -#: library/re.rst:849 +#: library/re.rst:858 msgid "" "See :py:const:`~re.ASCII` to restrict matching to ASCII characters instead." msgstr "" -#: library/re.rst:856 +#: library/re.rst:865 msgid "" "This flag allows you to write regular expressions that look nicer and are " "more readable by allowing you to visually separate logical sections of the " @@ -1174,13 +1179,13 @@ msgid "" "ignored." msgstr "" -#: library/re.rst:866 +#: library/re.rst:875 msgid "" "This means that the two following regular expression objects that match a " "decimal number are functionally equal::" msgstr "" -#: library/re.rst:869 +#: library/re.rst:878 msgid "" "a = re.compile(r\"\"\"\\d + # the integral part\n" " \\. # the decimal point\n" @@ -1188,55 +1193,55 @@ msgid "" "b = re.compile(r\"\\d+\\.\\d*\")" msgstr "" -#: library/re.rst:874 +#: library/re.rst:883 msgid "Corresponds to the inline flag ``(?x)``." msgstr "" -#: library/re.rst:878 +#: library/re.rst:887 msgid "Functions" msgstr "" -#: library/re.rst:882 +#: library/re.rst:891 msgid "" "Compile a regular expression pattern into a :ref:`regular expression object " "`, which can be used for matching using its :func:`~Pattern." "match`, :func:`~Pattern.search` and other methods, described below." msgstr "" -#: library/re.rst:919 library/re.rst:948 library/re.rst:1023 -#: library/re.rst:1097 library/re.rst:1136 +#: library/re.rst:928 library/re.rst:957 library/re.rst:1037 +#: library/re.rst:1111 library/re.rst:1147 msgid "" "The expression's behaviour can be modified by specifying a *flags* value. " "Values can be any of the `flags`_ variables, combined using bitwise OR (the " "``|`` operator)." msgstr "" -#: library/re.rst:891 +#: library/re.rst:900 msgid "The sequence ::" msgstr "" -#: library/re.rst:893 +#: library/re.rst:902 msgid "" "prog = re.compile(pattern)\n" "result = prog.match(string)" msgstr "" -#: library/re.rst:896 +#: library/re.rst:905 msgid "is equivalent to ::" msgstr "" -#: library/re.rst:898 +#: library/re.rst:907 msgid "result = re.match(pattern, string)" msgstr "" -#: library/re.rst:900 +#: library/re.rst:909 msgid "" "but using :func:`re.compile` and saving the resulting regular expression " "object for reuse is more efficient when the expression will be used several " "times in a single program." msgstr "" -#: library/re.rst:906 +#: library/re.rst:915 msgid "" "The compiled versions of the most recent patterns passed to :func:`re." "compile` and the module-level matching functions are cached, so programs " @@ -1244,7 +1249,7 @@ msgid "" "compiling regular expressions." msgstr "" -#: library/re.rst:914 +#: library/re.rst:923 msgid "" "Scan through *string* looking for the first location where the regular " "expression *pattern* produces a match, and return a corresponding :class:" @@ -1253,7 +1258,7 @@ msgid "" "some point in the string." msgstr "" -#: library/re.rst:926 +#: library/re.rst:935 msgid "" "If zero or more characters at the beginning of *string* match the regular " "expression *pattern*, return a corresponding :class:`~re.Match`. Return " @@ -1261,26 +1266,26 @@ msgid "" "different from a zero-length match." msgstr "" -#: library/re.rst:931 +#: library/re.rst:940 msgid "" "Note that even in :const:`MULTILINE` mode, :func:`re.match` will only match " "at the beginning of the string and not at the beginning of each line." msgstr "" -#: library/re.rst:934 +#: library/re.rst:943 msgid "" "If you want to locate a match anywhere in *string*, use :func:`search` " "instead (see also :ref:`search-vs-match`)." msgstr "" -#: library/re.rst:944 +#: library/re.rst:953 msgid "" "If the whole *string* matches the regular expression *pattern*, return a " "corresponding :class:`~re.Match`. Return ``None`` if the string does not " "match the pattern; note that this is different from a zero-length match." msgstr "" -#: library/re.rst:957 +#: library/re.rst:966 msgid "" "Split *string* by the occurrences of *pattern*. If capturing parentheses " "are used in *pattern*, then the text of all groups in the pattern are also " @@ -1289,44 +1294,44 @@ msgid "" "final element of the list. ::" msgstr "" -#: library/re.rst:963 +#: library/re.rst:972 msgid "" ">>> re.split(r'\\W+', 'Words, words, words.')\n" "['Words', 'words', 'words', '']\n" ">>> re.split(r'(\\W+)', 'Words, words, words.')\n" "['Words', ', ', 'words', ', ', 'words', '.', '']\n" -">>> re.split(r'\\W+', 'Words, words, words.', 1)\n" +">>> re.split(r'\\W+', 'Words, words, words.', maxsplit=1)\n" "['Words', 'words, words.']\n" ">>> re.split('[a-f]+', '0a3B9', flags=re.IGNORECASE)\n" "['0', '3', '9']" msgstr "" -#: library/re.rst:972 +#: library/re.rst:981 msgid "" "If there are capturing groups in the separator and it matches at the start " "of the string, the result will start with an empty string. The same holds " "for the end of the string::" msgstr "" -#: library/re.rst:976 +#: library/re.rst:985 msgid "" ">>> re.split(r'(\\W+)', '...words, words...')\n" "['', '...', 'words', ', ', 'words', '...', '']" msgstr "" -#: library/re.rst:979 +#: library/re.rst:988 msgid "" "That way, separator components are always found at the same relative indices " "within the result list." msgstr "" -#: library/re.rst:982 +#: library/re.rst:991 msgid "" "Empty matches for the pattern split the string only when not adjacent to a " "previous empty match." msgstr "" -#: library/re.rst:985 +#: library/re.rst:994 msgid "" ">>> re.split(r'\\b', 'Words, words, words.')\n" "['', 'Words', ', ', 'words', ', ', 'words', '.']\n" @@ -1337,23 +1342,30 @@ msgid "" "'']" msgstr "" -#: library/re.rst:1101 library/re.rst:1130 +#: library/re.rst:1115 msgid "Added the optional flags argument." msgstr "" -#: library/re.rst:1001 +#: library/re.rst:1010 msgid "" "Added support of splitting on a pattern that could match an empty string." msgstr "" -#: library/re.rst:1007 +#: library/re.rst:1013 +msgid "" +"Passing *maxsplit* and *flags* as positional arguments is deprecated. In " +"future Python versions they will be :ref:`keyword-only parameters `." +msgstr "" + +#: library/re.rst:1021 msgid "" "Return all non-overlapping matches of *pattern* in *string*, as a list of " "strings or tuples. The *string* is scanned left-to-right, and matches are " "returned in the order found. Empty matches are included in the result." msgstr "" -#: library/re.rst:1011 +#: library/re.rst:1025 msgid "" "The result depends on the number of capturing groups in the pattern. If " "there are no groups, return a list of strings matching the whole pattern. " @@ -1363,11 +1375,11 @@ msgid "" "result." msgstr "" -#: library/re.rst:1042 +#: library/re.rst:1056 msgid "Non-empty matches can now start just after a previous empty match." msgstr "" -#: library/re.rst:1033 +#: library/re.rst:1047 msgid "" "Return an :term:`iterator` yielding :class:`~re.Match` objects over all non-" "overlapping matches for the RE *pattern* in *string*. The *string* is " @@ -1375,7 +1387,7 @@ msgid "" "matches are included in the result." msgstr "" -#: library/re.rst:1048 +#: library/re.rst:1062 msgid "" "Return the string obtained by replacing the leftmost non-overlapping " "occurrences of *pattern* in *string* by the replacement *repl*. If the " @@ -1389,7 +1401,7 @@ msgid "" "For example::" msgstr "" -#: library/re.rst:1059 +#: library/re.rst:1073 msgid "" ">>> re.sub(r'def\\s+([a-zA-Z_][a-zA-Z_0-9]*)\\s*\\(\\s*\\):',\n" "... r'static PyObject*\\npy_\\1(void)\\n{',\n" @@ -1397,14 +1409,14 @@ msgid "" "'static PyObject*\\npy_myfunc(void)\\n{'" msgstr "" -#: library/re.rst:1064 +#: library/re.rst:1078 msgid "" "If *repl* is a function, it is called for every non-overlapping occurrence " "of *pattern*. The function takes a single :class:`~re.Match` argument, and " "returns the replacement string. For example::" msgstr "" -#: library/re.rst:1068 +#: library/re.rst:1082 msgid "" ">>> def dashrepl(matchobj):\n" "... if matchobj.group(0) == '-': return ' '\n" @@ -1417,11 +1429,11 @@ msgid "" "'Baked Beans & Spam'" msgstr "" -#: library/re.rst:1077 +#: library/re.rst:1091 msgid "The pattern may be a string or a :class:`~re.Pattern`." msgstr "" -#: library/re.rst:1079 +#: library/re.rst:1093 msgid "" "The optional argument *count* is the maximum number of pattern occurrences " "to be replaced; *count* must be a non-negative integer. If omitted or zero, " @@ -1430,7 +1442,7 @@ msgid "" "'abxd')`` returns ``'-a-b--d-'``." msgstr "" -#: library/re.rst:1087 +#: library/re.rst:1101 msgid "" "In string-type *repl* arguments, in addition to the character escapes and " "backreferences described above, ``\\g`` will use the substring matched " @@ -1443,49 +1455,51 @@ msgid "" "RE." msgstr "" -#: library/re.rst:1133 library/re.rst:1381 +#: library/re.rst:1396 msgid "Unmatched groups are replaced with an empty string." msgstr "" -#: library/re.rst:1107 +#: library/re.rst:1121 msgid "" "Unknown escapes in *pattern* consisting of ``'\\'`` and an ASCII letter now " "are errors." msgstr "" -#: library/re.rst:1111 +#: library/re.rst:1125 msgid "" "Unknown escapes in *repl* consisting of ``'\\'`` and an ASCII letter now are " -"errors." +"errors. Empty matches for the pattern are replaced when adjacent to a " +"previous non-empty match." msgstr "" -#: library/re.rst:1115 -msgid "" -"Empty matches for the pattern are replaced when adjacent to a previous non-" -"empty match." -msgstr "" - -#: library/re.rst:1119 +#: library/re.rst:1131 msgid "" "Group *id* can only contain ASCII digits. In :class:`bytes` replacement " "strings, group *name* can only contain bytes in the ASCII range " "(``b'\\x00'``-``b'\\x7f'``)." msgstr "" -#: library/re.rst:1127 +#: library/re.rst:1136 +msgid "" +"Passing *count* and *flags* as positional arguments is deprecated. In future " +"Python versions they will be :ref:`keyword-only parameters `." +msgstr "" + +#: library/re.rst:1144 msgid "" "Perform the same operation as :func:`sub`, but return a tuple ``(new_string, " "number_of_subs_made)``." msgstr "" -#: library/re.rst:1143 +#: library/re.rst:1154 msgid "" "Escape special characters in *pattern*. This is useful if you want to match " "an arbitrary literal string that may have regular expression metacharacters " "in it. For example::" msgstr "" -#: library/re.rst:1147 +#: library/re.rst:1158 msgid "" ">>> print(re.escape('https://www.python.org'))\n" "https://www\\.python\\.org\n" @@ -1500,13 +1514,13 @@ msgid "" "/|\\-|\\+|\\*\\*|\\*" msgstr "" -#: library/re.rst:1158 +#: library/re.rst:1169 msgid "" "This function must not be used for the replacement string in :func:`sub` " "and :func:`subn`, only backslashes should be escaped. For example::" msgstr "" -#: library/re.rst:1161 +#: library/re.rst:1172 msgid "" ">>> digits_re = r'\\d+'\n" ">>> sample = '/usr/sbin/sendmail - 0 errors, 12 warnings'\n" @@ -1514,11 +1528,11 @@ msgid "" "/usr/sbin/sendmail - \\d+ errors, \\d+ warnings" msgstr "" -#: library/re.rst:1166 +#: library/re.rst:1177 msgid "The ``'_'`` character is no longer escaped." msgstr "" -#: library/re.rst:1169 +#: library/re.rst:1180 msgid "" "Only characters that can have special meaning in a regular expression are " "escaped. As a result, ``'!'``, ``'\"'``, ``'%'``, ``\"'\"``, ``','``, " @@ -1526,62 +1540,69 @@ msgid "" "are no longer escaped." msgstr "" -#: library/re.rst:1178 +#: library/re.rst:1189 msgid "Clear the regular expression cache." msgstr "" -#: library/re.rst:1182 +#: library/re.rst:1193 msgid "Exceptions" msgstr "" -#: library/re.rst:1186 +#: library/re.rst:1197 msgid "" "Exception raised when a string passed to one of the functions here is not a " "valid regular expression (for example, it might contain unmatched " "parentheses) or when some other error occurs during compilation or " "matching. It is never an error if a string contains no match for a " -"pattern. The error instance has the following additional attributes:" +"pattern. The ``PatternError`` instance has the following additional " +"attributes:" msgstr "" -#: library/re.rst:1194 +#: library/re.rst:1205 msgid "The unformatted error message." msgstr "" -#: library/re.rst:1198 +#: library/re.rst:1209 msgid "The regular expression pattern." msgstr "" -#: library/re.rst:1202 +#: library/re.rst:1213 msgid "The index in *pattern* where compilation failed (may be ``None``)." msgstr "" -#: library/re.rst:1206 +#: library/re.rst:1217 msgid "The line corresponding to *pos* (may be ``None``)." msgstr "" -#: library/re.rst:1210 +#: library/re.rst:1221 msgid "The column corresponding to *pos* (may be ``None``)." msgstr "" -#: library/re.rst:1212 +#: library/re.rst:1223 msgid "Added additional attributes." msgstr "" -#: library/re.rst:1218 +#: library/re.rst:1226 +msgid "" +"``PatternError`` was originally named ``error``; the latter is kept as an " +"alias for backward compatibility." +msgstr "" + +#: library/re.rst:1233 msgid "Regular Expression Objects" msgstr "" -#: library/re.rst:1222 +#: library/re.rst:1237 msgid "Compiled regular expression object returned by :func:`re.compile`." msgstr "" -#: library/re.rst:1224 +#: library/re.rst:1239 msgid "" ":py:class:`re.Pattern` supports ``[]`` to indicate a Unicode (str) or bytes " "pattern. See :ref:`types-genericalias`." msgstr "" -#: library/re.rst:1230 +#: library/re.rst:1245 msgid "" "Scan through *string* looking for the first location where this regular " "expression produces a match, and return a corresponding :class:`~re.Match`. " @@ -1590,7 +1611,7 @@ msgid "" "string." msgstr "" -#: library/re.rst:1235 +#: library/re.rst:1250 msgid "" "The optional second parameter *pos* gives an index in the string where the " "search is to start; it defaults to ``0``. This is not completely equivalent " @@ -1599,7 +1620,7 @@ msgid "" "necessarily at the index where the search is to start." msgstr "" -#: library/re.rst:1241 +#: library/re.rst:1256 msgid "" "The optional parameter *endpos* limits how far the string will be searched; " "it will be as if the string is *endpos* characters long, so only the " @@ -1609,7 +1630,7 @@ msgid "" "equivalent to ``rx.search(string[:50], 0)``. ::" msgstr "" -#: library/re.rst:1248 +#: library/re.rst:1263 msgid "" ">>> pattern = re.compile(\"d\")\n" ">>> pattern.search(\"dog\") # Match at index 0\n" @@ -1617,7 +1638,7 @@ msgid "" ">>> pattern.search(\"dog\", 1) # No match; search doesn't include the \"d\"" msgstr "" -#: library/re.rst:1256 +#: library/re.rst:1271 msgid "" "If zero or more characters at the *beginning* of *string* match this regular " "expression, return a corresponding :class:`~re.Match`. Return ``None`` if " @@ -1625,13 +1646,13 @@ msgid "" "zero-length match." msgstr "" -#: library/re.rst:1279 +#: library/re.rst:1294 msgid "" "The optional *pos* and *endpos* parameters have the same meaning as for the :" "meth:`~Pattern.search` method. ::" msgstr "" -#: library/re.rst:1264 +#: library/re.rst:1279 msgid "" ">>> pattern = re.compile(\"o\")\n" ">>> pattern.match(\"dog\") # No match as \"o\" is not at the start of " @@ -1641,20 +1662,20 @@ msgid "" "" msgstr "" -#: library/re.rst:1269 +#: library/re.rst:1284 msgid "" "If you want to locate a match anywhere in *string*, use :meth:`~Pattern." "search` instead (see also :ref:`search-vs-match`)." msgstr "" -#: library/re.rst:1275 +#: library/re.rst:1290 msgid "" "If the whole *string* matches this regular expression, return a " "corresponding :class:`~re.Match`. Return ``None`` if the string does not " "match the pattern; note that this is different from a zero-length match." msgstr "" -#: library/re.rst:1282 +#: library/re.rst:1297 msgid "" ">>> pattern = re.compile(\"o[gh]\")\n" ">>> pattern.fullmatch(\"dog\") # No match as \"o\" is not at the start " @@ -1665,89 +1686,89 @@ msgid "" "" msgstr "" -#: library/re.rst:1293 +#: library/re.rst:1308 msgid "Identical to the :func:`split` function, using the compiled pattern." msgstr "" -#: library/re.rst:1298 +#: library/re.rst:1313 msgid "" "Similar to the :func:`findall` function, using the compiled pattern, but " "also accepts optional *pos* and *endpos* parameters that limit the search " "region like for :meth:`search`." msgstr "" -#: library/re.rst:1305 +#: library/re.rst:1320 msgid "" "Similar to the :func:`finditer` function, using the compiled pattern, but " "also accepts optional *pos* and *endpos* parameters that limit the search " "region like for :meth:`search`." msgstr "" -#: library/re.rst:1312 +#: library/re.rst:1327 msgid "Identical to the :func:`sub` function, using the compiled pattern." msgstr "" -#: library/re.rst:1317 +#: library/re.rst:1332 msgid "Identical to the :func:`subn` function, using the compiled pattern." msgstr "" -#: library/re.rst:1322 +#: library/re.rst:1337 msgid "" "The regex matching flags. This is a combination of the flags given to :func:" "`.compile`, any ``(?...)`` inline flags in the pattern, and implicit flags " "such as :py:const:`~re.UNICODE` if the pattern is a Unicode string." msgstr "" -#: library/re.rst:1329 +#: library/re.rst:1344 msgid "The number of capturing groups in the pattern." msgstr "" -#: library/re.rst:1334 +#: library/re.rst:1349 msgid "" "A dictionary mapping any symbolic group names defined by ``(?P)`` to " "group numbers. The dictionary is empty if no symbolic groups were used in " "the pattern." msgstr "" -#: library/re.rst:1341 +#: library/re.rst:1356 msgid "The pattern string from which the pattern object was compiled." msgstr "" -#: library/re.rst:1344 +#: library/re.rst:1359 msgid "" "Added support of :func:`copy.copy` and :func:`copy.deepcopy`. Compiled " "regular expression objects are considered atomic." msgstr "" -#: library/re.rst:1352 +#: library/re.rst:1367 msgid "Match Objects" msgstr "" -#: library/re.rst:1354 +#: library/re.rst:1369 msgid "" "Match objects always have a boolean value of ``True``. Since :meth:`~Pattern." "match` and :meth:`~Pattern.search` return ``None`` when there is no match, " "you can test whether there was a match with a simple ``if`` statement::" msgstr "" -#: library/re.rst:1359 +#: library/re.rst:1374 msgid "" "match = re.search(pattern, string)\n" "if match:\n" " process(match)" msgstr "" -#: library/re.rst:1365 +#: library/re.rst:1380 msgid "Match object returned by successful ``match``\\ es and ``search``\\ es." msgstr "" -#: library/re.rst:1367 +#: library/re.rst:1382 msgid "" ":py:class:`re.Match` supports ``[]`` to indicate a Unicode (str) or bytes " "match. See :ref:`types-genericalias`." msgstr "" -#: library/re.rst:1373 +#: library/re.rst:1388 msgid "" "Return the string obtained by doing backslash substitution on the template " "string *template*, as done by the :meth:`~Pattern.sub` method. Escapes such " @@ -1757,7 +1778,7 @@ msgid "" "backreference ``\\g<0>`` will be replaced by the entire match." msgstr "" -#: library/re.rst:1386 +#: library/re.rst:1401 msgid "" "Returns one or more subgroups of the match. If there is a single argument, " "the result is a single string; if there are multiple arguments, the result " @@ -1772,7 +1793,7 @@ msgid "" "the pattern that matched multiple times, the last match is returned. ::" msgstr "" -#: library/re.rst:1398 +#: library/re.rst:1413 msgid "" ">>> m = re.match(r\"(\\w+) (\\w+)\", \"Isaac Newton, physicist\")\n" ">>> m.group(0) # The entire match\n" @@ -1785,7 +1806,7 @@ msgid "" "('Isaac', 'Newton')" msgstr "" -#: library/re.rst:1408 +#: library/re.rst:1423 msgid "" "If the regular expression uses the ``(?P...)`` syntax, the *groupN* " "arguments may also be strings identifying groups by their group name. If a " @@ -1793,11 +1814,11 @@ msgid "" "`IndexError` exception is raised." msgstr "" -#: library/re.rst:1413 +#: library/re.rst:1428 msgid "A moderately complicated example::" msgstr "" -#: library/re.rst:1415 +#: library/re.rst:1430 msgid "" ">>> m = re.match(r\"(?P\\w+) (?P\\w+)\", \"Malcolm " "Reynolds\")\n" @@ -1807,11 +1828,11 @@ msgid "" "'Reynolds'" msgstr "" -#: library/re.rst:1421 +#: library/re.rst:1436 msgid "Named groups can also be referred to by their index::" msgstr "" -#: library/re.rst:1423 +#: library/re.rst:1438 msgid "" ">>> m.group(1)\n" "'Malcolm'\n" @@ -1819,24 +1840,24 @@ msgid "" "'Reynolds'" msgstr "" -#: library/re.rst:1428 +#: library/re.rst:1443 msgid "If a group matches multiple times, only the last match is accessible::" msgstr "" -#: library/re.rst:1430 +#: library/re.rst:1445 msgid "" ">>> m = re.match(r\"(..)+\", \"a1b2c3\") # Matches 3 times.\n" ">>> m.group(1) # Returns only the last match.\n" "'c3'" msgstr "" -#: library/re.rst:1437 +#: library/re.rst:1452 msgid "" "This is identical to ``m.group(g)``. This allows easier access to an " "individual group from a match::" msgstr "" -#: library/re.rst:1440 +#: library/re.rst:1455 msgid "" ">>> m = re.match(r\"(\\w+) (\\w+)\", \"Isaac Newton, physicist\")\n" ">>> m[0] # The entire match\n" @@ -1847,11 +1868,11 @@ msgid "" "'Newton'" msgstr "" -#: library/re.rst:1448 +#: library/re.rst:1463 msgid "Named groups are supported as well::" msgstr "" -#: library/re.rst:1450 +#: library/re.rst:1465 msgid "" ">>> m = re.match(r\"(?P\\w+) (?P\\w+)\", \"Isaac " "Newton\")\n" @@ -1861,32 +1882,32 @@ msgid "" "'Newton'" msgstr "" -#: library/re.rst:1461 +#: library/re.rst:1476 msgid "" "Return a tuple containing all the subgroups of the match, from 1 up to " "however many groups are in the pattern. The *default* argument is used for " "groups that did not participate in the match; it defaults to ``None``." msgstr "" -#: library/re.rst:1690 +#: library/re.rst:1705 msgid "For example::" msgstr "" -#: library/re.rst:1467 +#: library/re.rst:1482 msgid "" ">>> m = re.match(r\"(\\d+)\\.(\\d+)\", \"24.1632\")\n" ">>> m.groups()\n" "('24', '1632')" msgstr "" -#: library/re.rst:1471 +#: library/re.rst:1486 msgid "" "If we make the decimal place and everything after it optional, not all " "groups might participate in the match. These groups will default to " "``None`` unless the *default* argument is given::" msgstr "" -#: library/re.rst:1475 +#: library/re.rst:1490 msgid "" ">>> m = re.match(r\"(\\d+)\\.?(\\d+)?\", \"24\")\n" ">>> m.groups() # Second group defaults to None.\n" @@ -1895,14 +1916,14 @@ msgid "" "('24', '0')" msgstr "" -#: library/re.rst:1484 +#: library/re.rst:1499 msgid "" "Return a dictionary containing all the *named* subgroups of the match, keyed " "by the subgroup name. The *default* argument is used for groups that did " "not participate in the match; it defaults to ``None``. For example::" msgstr "" -#: library/re.rst:1488 +#: library/re.rst:1503 msgid "" ">>> m = re.match(r\"(?P\\w+) (?P\\w+)\", \"Malcolm " "Reynolds\")\n" @@ -1910,7 +1931,7 @@ msgid "" "{'first_name': 'Malcolm', 'last_name': 'Reynolds'}" msgstr "" -#: library/re.rst:1496 +#: library/re.rst:1511 msgid "" "Return the indices of the start and end of the substring matched by *group*; " "*group* defaults to zero (meaning the whole matched substring). Return " @@ -1919,11 +1940,11 @@ msgid "" "matched by group *g* (equivalent to ``m.group(g)``) is ::" msgstr "" -#: library/re.rst:1502 +#: library/re.rst:1517 msgid "m.string[m.start(g):m.end(g)]" msgstr "" -#: library/re.rst:1504 +#: library/re.rst:1519 msgid "" "Note that ``m.start(group)`` will equal ``m.end(group)`` if *group* matched " "a null string. For example, after ``m = re.search('b(c?)', 'cba')``, ``m." @@ -1931,11 +1952,11 @@ msgid "" "2, and ``m.start(2)`` raises an :exc:`IndexError` exception." msgstr "" -#: library/re.rst:1509 +#: library/re.rst:1524 msgid "An example that will remove *remove_this* from email addresses::" msgstr "" -#: library/re.rst:1511 +#: library/re.rst:1526 msgid "" ">>> email = \"tony@tiremove_thisger.net\"\n" ">>> m = re.search(\"remove_this\", email)\n" @@ -1943,28 +1964,28 @@ msgid "" "'tony@tiger.net'" msgstr "" -#: library/re.rst:1519 +#: library/re.rst:1534 msgid "" "For a match *m*, return the 2-tuple ``(m.start(group), m.end(group))``. Note " "that if *group* did not contribute to the match, this is ``(-1, -1)``. " "*group* defaults to zero, the entire match." msgstr "" -#: library/re.rst:1526 +#: library/re.rst:1541 msgid "" "The value of *pos* which was passed to the :meth:`~Pattern.search` or :meth:" "`~Pattern.match` method of a :ref:`regex object `. This is the " "index into the string at which the RE engine started looking for a match." msgstr "" -#: library/re.rst:1533 +#: library/re.rst:1548 msgid "" "The value of *endpos* which was passed to the :meth:`~Pattern.search` or :" "meth:`~Pattern.match` method of a :ref:`regex object `. This is " "the index into the string beyond which the RE engine will not go." msgstr "" -#: library/re.rst:1540 +#: library/re.rst:1555 msgid "" "The integer index of the last matched capturing group, or ``None`` if no " "group was matched at all. For example, the expressions ``(a)b``, ``((a)" @@ -1973,43 +1994,43 @@ msgid "" "applied to the same string." msgstr "" -#: library/re.rst:1549 +#: library/re.rst:1564 msgid "" "The name of the last matched capturing group, or ``None`` if the group " "didn't have a name, or if no group was matched at all." msgstr "" -#: library/re.rst:1555 +#: library/re.rst:1570 msgid "" "The :ref:`regular expression object ` whose :meth:`~Pattern." "match` or :meth:`~Pattern.search` method produced this match instance." msgstr "" -#: library/re.rst:1561 +#: library/re.rst:1576 msgid "The string passed to :meth:`~Pattern.match` or :meth:`~Pattern.search`." msgstr "" -#: library/re.rst:1564 +#: library/re.rst:1579 msgid "" "Added support of :func:`copy.copy` and :func:`copy.deepcopy`. Match objects " "are considered atomic." msgstr "" -#: library/re.rst:1572 +#: library/re.rst:1587 msgid "Regular Expression Examples" msgstr "" -#: library/re.rst:1576 +#: library/re.rst:1591 msgid "Checking for a Pair" msgstr "" -#: library/re.rst:1578 +#: library/re.rst:1593 msgid "" "In this example, we'll use the following helper function to display match " "objects a little more gracefully::" msgstr "" -#: library/re.rst:1581 +#: library/re.rst:1596 msgid "" "def displaymatch(match):\n" " if match is None:\n" @@ -2017,7 +2038,7 @@ msgid "" " return '' % (match.group(), match.groups())" msgstr "" -#: library/re.rst:1586 +#: library/re.rst:1601 msgid "" "Suppose you are writing a poker program where a player's hand is represented " "as a 5-character string with each character representing a card, \"a\" for " @@ -2025,11 +2046,11 @@ msgid "" "\"2\" through \"9\" representing the card with that value." msgstr "" -#: library/re.rst:1591 +#: library/re.rst:1606 msgid "To see if a given string is a valid hand, one could do the following::" msgstr "" -#: library/re.rst:1593 +#: library/re.rst:1608 msgid "" ">>> valid = re.compile(r\"^[a2-9tjqk]{5}$\")\n" ">>> displaymatch(valid.match(\"akt5q\")) # Valid.\n" @@ -2040,14 +2061,14 @@ msgid "" "\"\"" msgstr "" -#: library/re.rst:1601 +#: library/re.rst:1616 msgid "" "That last hand, ``\"727ak\"``, contained a pair, or two of the same valued " "cards. To match this with a regular expression, one could use backreferences " "as such::" msgstr "" -#: library/re.rst:1604 +#: library/re.rst:1619 msgid "" ">>> pair = re.compile(r\".*(.).*\\1\")\n" ">>> displaymatch(pair.match(\"717ak\")) # Pair of 7s.\n" @@ -2057,13 +2078,13 @@ msgid "" "\"\"" msgstr "" -#: library/re.rst:1611 +#: library/re.rst:1626 msgid "" "To find out what card the pair consists of, one could use the :meth:`~Match." "group` method of the match object in the following manner::" msgstr "" -#: library/re.rst:1614 +#: library/re.rst:1629 msgid "" ">>> pair = re.compile(r\".*(.).*\\1\")\n" ">>> pair.match(\"717ak\").group(1)\n" @@ -2081,11 +2102,11 @@ msgid "" "'a'" msgstr "" -#: library/re.rst:1630 +#: library/re.rst:1645 msgid "Simulating scanf()" msgstr "" -#: library/re.rst:1634 +#: library/re.rst:1649 msgid "" "Python does not currently have an equivalent to :c:func:`!scanf`. Regular " "expressions are generally more powerful, though also more verbose, than :c:" @@ -2094,130 +2115,130 @@ msgid "" "expressions." msgstr "" -#: library/re.rst:1641 +#: library/re.rst:1656 msgid ":c:func:`!scanf` Token" msgstr "" -#: library/re.rst:1641 +#: library/re.rst:1656 msgid "Regular Expression" msgstr "" -#: library/re.rst:1643 +#: library/re.rst:1658 msgid "``%c``" msgstr "" -#: library/re.rst:1645 +#: library/re.rst:1660 msgid "``%5c``" msgstr "" -#: library/re.rst:1645 +#: library/re.rst:1660 msgid "``.{5}``" msgstr "" -#: library/re.rst:1647 +#: library/re.rst:1662 msgid "``%d``" msgstr "" -#: library/re.rst:1647 +#: library/re.rst:1662 msgid "``[-+]?\\d+``" msgstr "" -#: library/re.rst:1649 +#: library/re.rst:1664 msgid "``%e``, ``%E``, ``%f``, ``%g``" msgstr "" -#: library/re.rst:1649 +#: library/re.rst:1664 msgid "``[-+]?(\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?``" msgstr "" -#: library/re.rst:1651 +#: library/re.rst:1666 msgid "``%i``" msgstr "" -#: library/re.rst:1651 +#: library/re.rst:1666 msgid "``[-+]?(0[xX][\\dA-Fa-f]+|0[0-7]*|\\d+)``" msgstr "" -#: library/re.rst:1653 +#: library/re.rst:1668 msgid "``%o``" msgstr "" -#: library/re.rst:1653 +#: library/re.rst:1668 msgid "``[-+]?[0-7]+``" msgstr "" -#: library/re.rst:1655 +#: library/re.rst:1670 msgid "``%s``" msgstr "" -#: library/re.rst:1655 +#: library/re.rst:1670 msgid "``\\S+``" msgstr "" -#: library/re.rst:1657 +#: library/re.rst:1672 msgid "``%u``" msgstr "" -#: library/re.rst:1657 +#: library/re.rst:1672 msgid "``\\d+``" msgstr "" -#: library/re.rst:1659 +#: library/re.rst:1674 msgid "``%x``, ``%X``" msgstr "" -#: library/re.rst:1659 +#: library/re.rst:1674 msgid "``[-+]?(0[xX])?[\\dA-Fa-f]+``" msgstr "" -#: library/re.rst:1662 +#: library/re.rst:1677 msgid "To extract the filename and numbers from a string like ::" msgstr "" -#: library/re.rst:1664 +#: library/re.rst:1679 msgid "/usr/sbin/sendmail - 0 errors, 4 warnings" msgstr "" -#: library/re.rst:1666 +#: library/re.rst:1681 msgid "you would use a :c:func:`!scanf` format like ::" msgstr "" -#: library/re.rst:1668 +#: library/re.rst:1683 msgid "%s - %d errors, %d warnings" msgstr "" -#: library/re.rst:1670 +#: library/re.rst:1685 msgid "The equivalent regular expression would be ::" msgstr "" -#: library/re.rst:1672 +#: library/re.rst:1687 msgid "(\\S+) - (\\d+) errors, (\\d+) warnings" msgstr "" -#: library/re.rst:1678 +#: library/re.rst:1693 msgid "search() vs. match()" msgstr "" -#: library/re.rst:1682 +#: library/re.rst:1697 msgid "" "Python offers different primitive operations based on regular expressions:" msgstr "" -#: library/re.rst:1684 +#: library/re.rst:1699 msgid ":func:`re.match` checks for a match only at the beginning of the string" msgstr "" -#: library/re.rst:1685 +#: library/re.rst:1700 msgid "" ":func:`re.search` checks for a match anywhere in the string (this is what " "Perl does by default)" msgstr "" -#: library/re.rst:1687 +#: library/re.rst:1702 msgid ":func:`re.fullmatch` checks for entire string to be a match" msgstr "" -#: library/re.rst:1692 +#: library/re.rst:1707 msgid "" ">>> re.match(\"c\", \"abcdef\") # No match\n" ">>> re.search(\"c\", \"abcdef\") # Match\n" @@ -2227,13 +2248,13 @@ msgid "" ">>> re.fullmatch(\"r.*n\", \"python\") # No match" msgstr "" -#: library/re.rst:1699 +#: library/re.rst:1714 msgid "" "Regular expressions beginning with ``'^'`` can be used with :func:`search` " "to restrict the match at the beginning of the string::" msgstr "" -#: library/re.rst:1702 +#: library/re.rst:1717 msgid "" ">>> re.match(\"c\", \"abcdef\") # No match\n" ">>> re.search(\"^c\", \"abcdef\") # No match\n" @@ -2241,7 +2262,7 @@ msgid "" "" msgstr "" -#: library/re.rst:1707 +#: library/re.rst:1722 msgid "" "Note however that in :const:`MULTILINE` mode :func:`match` only matches at " "the beginning of the string, whereas using :func:`search` with a regular " @@ -2249,18 +2270,18 @@ msgid "" "line. ::" msgstr "" -#: library/re.rst:1711 +#: library/re.rst:1726 msgid "" ">>> re.match(\"X\", \"A\\nB\\nX\", re.MULTILINE) # No match\n" ">>> re.search(\"^X\", \"A\\nB\\nX\", re.MULTILINE) # Match\n" "" msgstr "" -#: library/re.rst:1717 +#: library/re.rst:1732 msgid "Making a Phonebook" msgstr "" -#: library/re.rst:1719 +#: library/re.rst:1734 msgid "" ":func:`split` splits a string into a list delimited by the passed pattern. " "The method is invaluable for converting textual data into data structures " @@ -2268,13 +2289,13 @@ msgid "" "following example that creates a phonebook." msgstr "" -#: library/re.rst:1724 +#: library/re.rst:1739 msgid "" "First, here is the input. Normally it may come from a file, here we are " "using triple-quoted string syntax" msgstr "" -#: library/re.rst:1727 +#: library/re.rst:1742 msgid "" ">>> text = \"\"\"Ross McFluff: 834.345.1254 155 Elm Street\n" "...\n" @@ -2285,13 +2306,13 @@ msgid "" "... Heather Albrecht: 548.326.4584 919 Park Place\"\"\"" msgstr "" -#: library/re.rst:1737 +#: library/re.rst:1752 msgid "" "The entries are separated by one or more newlines. Now we convert the string " "into a list with each nonempty line having its own entry:" msgstr "" -#: library/re.rst:1740 +#: library/re.rst:1755 msgid "" ">>> entries = re.split(\"\\n+\", text)\n" ">>> entries\n" @@ -2301,43 +2322,43 @@ msgid "" "'Heather Albrecht: 548.326.4584 919 Park Place']" msgstr "" -#: library/re.rst:1750 +#: library/re.rst:1765 msgid "" "Finally, split each entry into a list with first name, last name, telephone " "number, and address. We use the ``maxsplit`` parameter of :func:`split` " "because the address has spaces, our splitting pattern, in it:" msgstr "" -#: library/re.rst:1754 +#: library/re.rst:1769 msgid "" -">>> [re.split(\":? \", entry, 3) for entry in entries]\n" +">>> [re.split(\":? \", entry, maxsplit=3) for entry in entries]\n" "[['Ross', 'McFluff', '834.345.1254', '155 Elm Street'],\n" "['Ronald', 'Heathmore', '892.345.3428', '436 Finley Avenue'],\n" "['Frank', 'Burger', '925.541.7625', '662 South Dogwood Way'],\n" "['Heather', 'Albrecht', '548.326.4584', '919 Park Place']]" msgstr "" -#: library/re.rst:1763 +#: library/re.rst:1778 msgid "" "The ``:?`` pattern matches the colon after the last name, so that it does " "not occur in the result list. With a ``maxsplit`` of ``4``, we could " "separate the house number from the street name:" msgstr "" -#: library/re.rst:1767 +#: library/re.rst:1782 msgid "" -">>> [re.split(\":? \", entry, 4) for entry in entries]\n" +">>> [re.split(\":? \", entry, maxsplit=4) for entry in entries]\n" "[['Ross', 'McFluff', '834.345.1254', '155', 'Elm Street'],\n" "['Ronald', 'Heathmore', '892.345.3428', '436', 'Finley Avenue'],\n" "['Frank', 'Burger', '925.541.7625', '662', 'South Dogwood Way'],\n" "['Heather', 'Albrecht', '548.326.4584', '919', 'Park Place']]" msgstr "" -#: library/re.rst:1778 +#: library/re.rst:1793 msgid "Text Munging" msgstr "" -#: library/re.rst:1780 +#: library/re.rst:1795 msgid "" ":func:`sub` replaces every occurrence of a pattern with a string or the " "result of a function. This example demonstrates using :func:`sub` with a " @@ -2345,7 +2366,7 @@ msgid "" "each word of a sentence except for the first and last characters::" msgstr "" -#: library/re.rst:1785 +#: library/re.rst:1800 msgid "" ">>> def repl(m):\n" "... inner_word = list(m.group(2))\n" @@ -2359,11 +2380,11 @@ msgid "" "'Pofsroser Aodlambelk, plasee reoprt yuor asnebces potlmrpy.'" msgstr "" -#: library/re.rst:1798 +#: library/re.rst:1813 msgid "Finding all Adverbs" msgstr "" -#: library/re.rst:1800 +#: library/re.rst:1815 msgid "" ":func:`findall` matches *all* occurrences of a pattern, not just the first " "one as :func:`search` does. For example, if a writer wanted to find all of " @@ -2371,18 +2392,18 @@ msgid "" "manner::" msgstr "" -#: library/re.rst:1805 +#: library/re.rst:1820 msgid "" ">>> text = \"He was carefully disguised but captured quickly by police.\"\n" ">>> re.findall(r\"\\w+ly\\b\", text)\n" "['carefully', 'quickly']" msgstr "" -#: library/re.rst:1811 +#: library/re.rst:1826 msgid "Finding all Adverbs and their Positions" msgstr "" -#: library/re.rst:1813 +#: library/re.rst:1828 msgid "" "If one wants more information about all matches of a pattern than the " "matched text, :func:`finditer` is useful as it provides :class:`~re.Match` " @@ -2391,7 +2412,7 @@ msgid "" "they would use :func:`finditer` in the following manner::" msgstr "" -#: library/re.rst:1819 +#: library/re.rst:1834 msgid "" ">>> text = \"He was carefully disguised but captured quickly by police.\"\n" ">>> for m in re.finditer(r\"\\w+ly\\b\", text):\n" @@ -2400,11 +2421,11 @@ msgid "" "40-47: quickly" msgstr "" -#: library/re.rst:1827 +#: library/re.rst:1842 msgid "Raw String Notation" msgstr "" -#: library/re.rst:1829 +#: library/re.rst:1844 msgid "" "Raw string notation (``r\"text\"``) keeps regular expressions sane. Without " "it, every backslash (``'\\'``) in a regular expression would have to be " @@ -2412,7 +2433,7 @@ msgid "" "lines of code are functionally identical::" msgstr "" -#: library/re.rst:1834 +#: library/re.rst:1849 msgid "" ">>> re.match(r\"\\W(.)\\1\\W\", \" ff \")\n" "\n" @@ -2420,7 +2441,7 @@ msgid "" "" msgstr "" -#: library/re.rst:1839 +#: library/re.rst:1854 msgid "" "When one wants to match a literal backslash, it must be escaped in the " "regular expression. With raw string notation, this means ``r\"\\\\\"``. " @@ -2428,7 +2449,7 @@ msgid "" "following lines of code functionally identical::" msgstr "" -#: library/re.rst:1844 +#: library/re.rst:1859 msgid "" ">>> re.match(r\"\\\\\", r\"\\\\\")\n" "\n" @@ -2436,25 +2457,25 @@ msgid "" "" msgstr "" -#: library/re.rst:1851 +#: library/re.rst:1866 msgid "Writing a Tokenizer" msgstr "" -#: library/re.rst:1853 +#: library/re.rst:1868 msgid "" "A `tokenizer or scanner `_ " "analyzes a string to categorize groups of characters. This is a useful " "first step in writing a compiler or interpreter." msgstr "" -#: library/re.rst:1857 +#: library/re.rst:1872 msgid "" "The text categories are specified with regular expressions. The technique " "is to combine those into a single master regular expression and to loop over " "successive matches::" msgstr "" -#: library/re.rst:1861 +#: library/re.rst:1876 msgid "" "from typing import NamedTuple\n" "import re\n" @@ -2510,11 +2531,11 @@ msgid "" " print(token)" msgstr "" -#: library/re.rst:1913 +#: library/re.rst:1928 msgid "The tokenizer produces the following output::" msgstr "" -#: library/re.rst:1915 +#: library/re.rst:1930 msgid "" "Token(type='IF', value='IF', line=2, column=4)\n" "Token(type='ID', value='quantity', line=2, column=7)\n" @@ -2537,7 +2558,7 @@ msgid "" "Token(type='END', value=';', line=5, column=9)" msgstr "" -#: library/re.rst:1936 +#: library/re.rst:1951 msgid "" "Friedl, Jeffrey. Mastering Regular Expressions. 3rd ed., O'Reilly Media, " "2009. The third edition of the book no longer covers Python at all, but the " @@ -2550,14 +2571,14 @@ msgid ". (dot)" msgstr "" #: library/re.rst:112 library/re.rst:130 library/re.rst:143 library/re.rst:181 -#: library/re.rst:235 library/re.rst:257 library/re.rst:295 library/re.rst:318 -#: library/re.rst:405 library/re.rst:443 library/re.rst:455 library/re.rst:489 -#: library/re.rst:522 library/re.rst:539 library/re.rst:581 library/re.rst:605 -#: library/re.rst:627 library/re.rst:658 library/re.rst:854 library/re.rst:1085 +#: library/re.rst:235 library/re.rst:258 library/re.rst:304 library/re.rst:327 +#: library/re.rst:414 library/re.rst:452 library/re.rst:464 library/re.rst:498 +#: library/re.rst:531 library/re.rst:548 library/re.rst:590 library/re.rst:614 +#: library/re.rst:636 library/re.rst:667 library/re.rst:863 library/re.rst:1099 msgid "in regular expressions" msgstr "" -#: library/re.rst:262 +#: library/re.rst:271 msgid "^ (caret)" msgstr "" @@ -2605,7 +2626,7 @@ msgstr "" msgid "{} (curly brackets)" msgstr "" -#: library/re.rst:257 library/re.rst:522 +#: library/re.rst:258 library/re.rst:531 msgid "\\ (backslash)" msgstr "" @@ -2617,146 +2638,146 @@ msgstr "" msgid "- (minus)" msgstr "" -#: library/re.rst:295 +#: library/re.rst:304 msgid "| (vertical bar)" msgstr "" -#: library/re.rst:308 +#: library/re.rst:317 msgid "() (parentheses)" msgstr "" -#: library/re.rst:318 +#: library/re.rst:327 msgid "(?" msgstr "" -#: library/re.rst:350 +#: library/re.rst:359 msgid "(?:" msgstr "" -#: library/re.rst:405 +#: library/re.rst:414 msgid "(?P<" msgstr "" -#: library/re.rst:437 +#: library/re.rst:446 msgid "(?P=" msgstr "" -#: library/re.rst:443 +#: library/re.rst:452 msgid "(?#" msgstr "" -#: library/re.rst:448 +#: library/re.rst:457 msgid "(?=" msgstr "" -#: library/re.rst:455 +#: library/re.rst:464 msgid "(?!" msgstr "" -#: library/re.rst:462 +#: library/re.rst:471 msgid "(?<=" msgstr "" -#: library/re.rst:489 +#: library/re.rst:498 msgid "(?\n" "Language-Team: LANGUAGE \n" @@ -42,112 +42,127 @@ msgid "" "general." msgstr "" -#: library/readline.rst:29 +#: includes/wasm-mobile-notavail.rst:3 +msgid "Availability" +msgstr "" + +#: includes/wasm-mobile-notavail.rst:5 +msgid "" +"This module is not supported on :ref:`mobile platforms ` or :ref:`WebAssembly platforms `." +msgstr "" + +#: library/readline.rst:31 msgid "" -"The underlying Readline library API may be implemented by the ``libedit`` " -"library instead of GNU readline. On macOS the :mod:`readline` module detects " -"which library is being used at run time." +"The underlying Readline library API may be implemented by the ``editline`` " +"(``libedit``) library instead of GNU readline. On macOS the :mod:`readline` " +"module detects which library is being used at run time." msgstr "" -#: library/readline.rst:34 +#: library/readline.rst:36 msgid "" -"The configuration file for ``libedit`` is different from that of GNU " -"readline. If you programmatically load configuration strings you can check " -"for the text \"libedit\" in :const:`readline.__doc__` to differentiate " -"between GNU readline and libedit." +"The configuration file for ``editline`` is different from that of GNU " +"readline. If you programmatically load configuration strings you can use :" +"data:`backend` to determine which library is being used." msgstr "" -#: library/readline.rst:39 +#: library/readline.rst:40 msgid "" -"If you use *editline*/``libedit`` readline emulation on macOS, the " +"If you use ``editline``/``libedit`` readline emulation on macOS, the " "initialization file located in your home directory is named ``.editrc``. For " "example, the following content in ``~/.editrc`` will turn ON *vi* " "keybindings and TAB completion::" msgstr "" -#: library/readline.rst:44 +#: library/readline.rst:45 msgid "" "python:bind -v\n" "python:bind ^I rl_complete" msgstr "" -#: library/readline.rst:47 +#: library/readline.rst:48 msgid "" "Also note that different libraries may use different history file formats. " "When switching the underlying library, existing history files may become " "unusable." msgstr "" -#: library/readline.rst:53 +#: library/readline.rst:54 +msgid "" +"The name of the underlying Readline library being used, either " +"``\"readline\"`` or ``\"editline\"``." +msgstr "" + +#: library/readline.rst:60 msgid "Init file" msgstr "" -#: library/readline.rst:55 +#: library/readline.rst:62 msgid "The following functions relate to the init file and user configuration:" msgstr "" -#: library/readline.rst:60 +#: library/readline.rst:67 msgid "" "Execute the init line provided in the *string* argument. This calls :c:func:" "`!rl_parse_and_bind` in the underlying library." msgstr "" -#: library/readline.rst:66 +#: library/readline.rst:73 msgid "" "Execute a readline initialization file. The default filename is the last " "filename used. This calls :c:func:`!rl_read_init_file` in the underlying " "library." msgstr "" -#: library/readline.rst:71 +#: library/readline.rst:78 msgid "Line buffer" msgstr "" -#: library/readline.rst:73 +#: library/readline.rst:80 msgid "The following functions operate on the line buffer:" msgstr "" -#: library/readline.rst:78 +#: library/readline.rst:85 msgid "" "Return the current contents of the line buffer (:c:data:`!rl_line_buffer` in " "the underlying library)." msgstr "" -#: library/readline.rst:84 +#: library/readline.rst:91 msgid "" "Insert text into the line buffer at the cursor position. This calls :c:func:" "`!rl_insert_text` in the underlying library, but ignores the return value." msgstr "" -#: library/readline.rst:91 +#: library/readline.rst:98 msgid "" "Change what's displayed on the screen to reflect the current contents of the " "line buffer. This calls :c:func:`!rl_redisplay` in the underlying library." msgstr "" -#: library/readline.rst:96 +#: library/readline.rst:103 msgid "History file" msgstr "" -#: library/readline.rst:98 +#: library/readline.rst:105 msgid "The following functions operate on a history file:" msgstr "" -#: library/readline.rst:103 +#: library/readline.rst:110 msgid "" "Load a readline history file, and append it to the history list. The default " "filename is :file:`~/.history`. This calls :c:func:`!read_history` in the " "underlying library." msgstr "" -#: library/readline.rst:110 +#: library/readline.rst:117 msgid "" "Save the history list to a readline history file, overwriting any existing " "file. The default filename is :file:`~/.history`. This calls :c:func:`!" "write_history` in the underlying library." msgstr "" -#: library/readline.rst:117 +#: library/readline.rst:124 msgid "" "Append the last *nelements* items of history to a file. The default " "filename is :file:`~/.history`. The file must already exist. This calls :c:" @@ -155,7 +170,7 @@ msgid "" "if Python was compiled for a version of the library that supports it." msgstr "" -#: library/readline.rst:129 +#: library/readline.rst:136 msgid "" "Set or return the desired number of lines to save in the history file. The :" "func:`write_history_file` function uses this value to truncate the history " @@ -163,72 +178,72 @@ msgid "" "library. Negative values imply unlimited history file size." msgstr "" -#: library/readline.rst:137 +#: library/readline.rst:144 msgid "History list" msgstr "" -#: library/readline.rst:139 +#: library/readline.rst:146 msgid "The following functions operate on a global history list:" msgstr "" -#: library/readline.rst:144 +#: library/readline.rst:151 msgid "" "Clear the current history. This calls :c:func:`!clear_history` in the " "underlying library. The Python function only exists if Python was compiled " "for a version of the library that supports it." msgstr "" -#: library/readline.rst:151 +#: library/readline.rst:158 msgid "" "Return the number of items currently in the history. (This is different " "from :func:`get_history_length`, which returns the maximum number of lines " "that will be written to a history file.)" msgstr "" -#: library/readline.rst:158 +#: library/readline.rst:165 msgid "" "Return the current contents of history item at *index*. The item index is " "one-based. This calls :c:func:`!history_get` in the underlying library." msgstr "" -#: library/readline.rst:164 +#: library/readline.rst:171 msgid "" "Remove history item specified by its position from the history. The position " "is zero-based. This calls :c:func:`!remove_history` in the underlying " "library." msgstr "" -#: library/readline.rst:171 +#: library/readline.rst:178 msgid "" "Replace history item specified by its position with *line*. The position is " "zero-based. This calls :c:func:`!replace_history_entry` in the underlying " "library." msgstr "" -#: library/readline.rst:178 +#: library/readline.rst:185 msgid "" "Append *line* to the history buffer, as if it was the last line typed. This " "calls :c:func:`!add_history` in the underlying library." msgstr "" -#: library/readline.rst:184 +#: library/readline.rst:191 msgid "" "Enable or disable automatic calls to :c:func:`!add_history` when reading " "input via readline. The *enabled* argument should be a Boolean value that " "when true, enables auto history, and that when false, disables auto history." msgstr "" -#: library/readline.rst:192 +#: library/readline.rst:199 msgid "" "Auto history is enabled by default, and changes to this do not persist " "across multiple sessions." msgstr "" -#: library/readline.rst:197 +#: library/readline.rst:204 msgid "Startup hooks" msgstr "" -#: library/readline.rst:202 +#: library/readline.rst:209 msgid "" "Set or remove the function invoked by the :c:data:`!rl_startup_hook` " "callback of the underlying library. If *function* is specified, it will be " @@ -237,7 +252,7 @@ msgid "" "readline prints the first prompt." msgstr "" -#: library/readline.rst:211 +#: library/readline.rst:218 msgid "" "Set or remove the function invoked by the :c:data:`!rl_pre_input_hook` " "callback of the underlying library. If *function* is specified, it will be " @@ -248,11 +263,11 @@ msgid "" "of the library that supports it." msgstr "" -#: library/readline.rst:223 +#: library/readline.rst:230 msgid "Completion" msgstr "" -#: library/readline.rst:225 +#: library/readline.rst:232 msgid "" "The following functions relate to implementing a custom word completion " "function. This is typically operated by the Tab key, and can suggest and " @@ -262,7 +277,7 @@ msgid "" "custom completer, a different set of word delimiters should be set." msgstr "" -#: library/readline.rst:235 +#: library/readline.rst:242 msgid "" "Set or remove the completer function. If *function* is specified, it will " "be used as the new completer function; if omitted or ``None``, any completer " @@ -272,7 +287,7 @@ msgid "" "starting with *text*." msgstr "" -#: library/readline.rst:242 +#: library/readline.rst:249 msgid "" "The installed completer function is invoked by the *entry_func* callback " "passed to :c:func:`!rl_completion_matches` in the underlying library. The " @@ -280,19 +295,19 @@ msgid "" "rl_attempted_completion_function` callback of the underlying library." msgstr "" -#: library/readline.rst:251 +#: library/readline.rst:258 msgid "" "Get the completer function, or ``None`` if no completer function has been " "set." msgstr "" -#: library/readline.rst:256 +#: library/readline.rst:263 msgid "" "Get the type of completion being attempted. This returns the :c:data:`!" "rl_completion_type` variable in the underlying library as an integer." msgstr "" -#: library/readline.rst:264 +#: library/readline.rst:271 msgid "" "Get the beginning or ending index of the completion scope. These indexes are " "the *start* and *end* arguments passed to the :c:data:`!" @@ -302,7 +317,7 @@ msgid "" "differently than libreadline." msgstr "" -#: library/readline.rst:275 +#: library/readline.rst:282 msgid "" "Set or get the word delimiters for completion. These determine the start of " "the word to be considered for completion (the completion scope). These " @@ -310,7 +325,7 @@ msgid "" "in the underlying library." msgstr "" -#: library/readline.rst:283 +#: library/readline.rst:290 msgid "" "Set or remove the completion display function. If *function* is specified, " "it will be used as the new completion display function; if omitted or " @@ -321,11 +336,11 @@ msgid "" "each time matches need to be displayed." msgstr "" -#: library/readline.rst:296 +#: library/readline.rst:303 msgid "Example" msgstr "" -#: library/readline.rst:298 +#: library/readline.rst:305 msgid "" "The following example demonstrates how to use the :mod:`readline` module's " "history reading and writing functions to automatically load and save a " @@ -334,7 +349,7 @@ msgid "" "sessions from the user's :envvar:`PYTHONSTARTUP` file. ::" msgstr "" -#: library/readline.rst:304 +#: library/readline.rst:311 msgid "" "import atexit\n" "import os\n" @@ -351,19 +366,19 @@ msgid "" "atexit.register(readline.write_history_file, histfile)" msgstr "" -#: library/readline.rst:318 +#: library/readline.rst:325 msgid "" "This code is actually automatically run when Python is run in :ref:" "`interactive mode ` (see :ref:`rlcompleter-config`)." msgstr "" -#: library/readline.rst:321 +#: library/readline.rst:328 msgid "" "The following example achieves the same goal but supports concurrent " "interactive sessions, by only appending the new history. ::" msgstr "" -#: library/readline.rst:324 +#: library/readline.rst:331 msgid "" "import atexit\n" "import os\n" @@ -384,13 +399,13 @@ msgid "" "atexit.register(save, h_len, histfile)" msgstr "" -#: library/readline.rst:342 +#: library/readline.rst:349 msgid "" "The following example extends the :class:`code.InteractiveConsole` class to " "support history save/restore. ::" msgstr "" -#: library/readline.rst:345 +#: library/readline.rst:352 msgid "" "import atexit\n" "import code\n" diff --git a/library/removed.po b/library/removed.po index e92490f6..ae1aa224 100644 --- a/library/removed.po +++ b/library/removed.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" diff --git a/library/reprlib.po b/library/reprlib.po index d16a8f79..6de7cb24 100644 --- a/library/reprlib.po +++ b/library/reprlib.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" diff --git a/library/resource.po b/library/resource.po index 4c0cbd49..94379b0e 100644 --- a/library/resource.po +++ b/library/resource.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" diff --git a/library/rlcompleter.po b/library/rlcompleter.po index 7fff0278..3815f376 100644 --- a/library/rlcompleter.po +++ b/library/rlcompleter.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" diff --git a/library/runpy.po b/library/runpy.po index a8dbe47e..1a89c41b 100644 --- a/library/runpy.po +++ b/library/runpy.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -54,7 +54,7 @@ msgstr "" #: library/runpy.rst:35 msgid "" -"Execute the code of the specified module and return the resulting module " +"Execute the code of the specified module and return the resulting module's " "globals dictionary. The module's code is first located using the standard " "import mechanism (refer to :pep:`302` for details) and then executed in a " "fresh module namespace." @@ -71,19 +71,19 @@ msgstr "" #: library/runpy.rst:46 msgid "" "The optional dictionary argument *init_globals* may be used to pre-populate " -"the module's globals dictionary before the code is executed. The supplied " -"dictionary will not be modified. If any of the special global variables " -"below are defined in the supplied dictionary, those definitions are " -"overridden by :func:`run_module`." +"the module's globals dictionary before the code is executed. *init_globals* " +"will not be modified. If any of the special global variables below are " +"defined in *init_globals*, those definitions are overridden by :func:" +"`run_module`." msgstr "" #: library/runpy.rst:127 msgid "" "The special global variables ``__name__``, ``__spec__``, ``__file__``, " "``__cached__``, ``__loader__`` and ``__package__`` are set in the globals " -"dictionary before the module code is executed (Note that this is a minimal " +"dictionary before the module code is executed. (Note that this is a minimal " "set of variables - other variables may be set implicitly as an interpreter " -"implementation detail)." +"implementation detail.)" msgstr "" #: library/runpy.rst:58 @@ -97,7 +97,7 @@ msgstr "" msgid "" "``__spec__`` will be set appropriately for the *actually* imported module " "(that is, ``__spec__.name`` will always be *mod_name* or ``mod_name + '." -"__main__``, never *run_name*)." +"__main__'``, never *run_name*)." msgstr "" #: library/runpy.rst:66 @@ -155,11 +155,10 @@ msgstr "" #: library/runpy.rst:106 msgid "" "Execute the code at the named filesystem location and return the resulting " -"module globals dictionary. As with a script name supplied to the CPython " -"command line, the supplied path may refer to a Python source file, a " -"compiled bytecode file or a valid :data:`sys.path` entry containing a :mod:" -"`__main__` module (e.g. a zipfile containing a top-level ``__main__.py`` " -"file)." +"module's globals dictionary. As with a script name supplied to the CPython " +"command line, *file_path* may refer to a Python source file, a compiled " +"bytecode file or a valid :data:`sys.path` entry containing a :mod:`__main__` " +"module (e.g. a zipfile containing a top-level :file:`__main__.py` file)." msgstr "" #: library/runpy.rst:113 @@ -176,10 +175,10 @@ msgstr "" #: library/runpy.rst:121 msgid "" "The optional dictionary argument *init_globals* may be used to pre-populate " -"the module's globals dictionary before the code is executed. The supplied " -"dictionary will not be modified. If any of the special global variables " -"below are defined in the supplied dictionary, those definitions are " -"overridden by :func:`run_path`." +"the module's globals dictionary before the code is executed. *init_globals* " +"will not be modified. If any of the special global variables below are " +"defined in *init_globals*, those definitions are overridden by :func:" +"`run_path`." msgstr "" #: library/runpy.rst:133 @@ -190,15 +189,15 @@ msgstr "" #: library/runpy.rst:136 msgid "" -"If the supplied path directly references a script file (whether as source or " -"as precompiled byte code), then ``__file__`` will be set to the supplied " -"path, and ``__spec__``, ``__cached__``, ``__loader__`` and ``__package__`` " -"will all be set to :const:`None`." +"If *file_path* directly references a script file (whether as source or as " +"precompiled byte code), then ``__file__`` will be set to *file_path*, and " +"``__spec__``, ``__cached__``, ``__loader__`` and ``__package__`` will all be " +"set to :const:`None`." msgstr "" #: library/runpy.rst:141 msgid "" -"If the supplied path is a reference to a valid :data:`sys.path` entry, then " +"If *file_path* is a reference to a valid :data:`sys.path` entry, then " "``__spec__`` will be set appropriately for the imported :mod:`__main__` " "module (that is, ``__spec__.name`` will always be ``__main__``). " "``__file__``, ``__cached__``, ``__loader__`` and ``__package__`` will be :" @@ -209,7 +208,7 @@ msgstr "" msgid "" "A number of alterations are also made to the :mod:`sys` module. Firstly, :" "data:`sys.path` may be altered as described above. ``sys.argv[0]`` is " -"updated with the value of ``path_name`` and ``sys.modules[__name__]`` is " +"updated with the value of *file_path* and ``sys.modules[__name__]`` is " "updated with a temporary module object for the module being executed. All " "modifications to items in :mod:`sys` are reverted before the function " "returns." diff --git a/library/sched.po b/library/sched.po index d7953b41..a17abe95 100644 --- a/library/sched.po +++ b/library/sched.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" diff --git a/library/secrets.po b/library/secrets.po index 12f4d941..c1d1df7c 100644 --- a/library/secrets.po +++ b/library/secrets.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" diff --git a/library/security_warnings.po b/library/security_warnings.po index 39341583..b838f1e2 100644 --- a/library/security_warnings.po +++ b/library/security_warnings.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -32,78 +32,74 @@ msgid "" msgstr "" #: library/security_warnings.rst:12 -msgid ":mod:`cgi`: :ref:`CGI security considerations `" -msgstr "" - -#: library/security_warnings.rst:13 msgid "" ":mod:`hashlib`: :ref:`all constructors take a \"usedforsecurity\" keyword-" "only argument disabling known insecure and blocked algorithms `" msgstr "" -#: library/security_warnings.rst:16 +#: library/security_warnings.rst:15 msgid "" ":mod:`http.server` is not suitable for production use, only implementing " "basic security checks. See the :ref:`security considerations `." msgstr "" -#: library/security_warnings.rst:18 +#: library/security_warnings.rst:17 msgid "" ":mod:`logging`: :ref:`Logging configuration uses eval() `" msgstr "" -#: library/security_warnings.rst:20 +#: library/security_warnings.rst:19 msgid "" ":mod:`multiprocessing`: :ref:`Connection.recv() uses pickle `" msgstr "" -#: library/security_warnings.rst:22 +#: library/security_warnings.rst:21 msgid ":mod:`pickle`: :ref:`Restricting globals in pickle `" msgstr "" -#: library/security_warnings.rst:23 +#: library/security_warnings.rst:22 msgid "" ":mod:`random` shouldn't be used for security purposes, use :mod:`secrets` " "instead" msgstr "" -#: library/security_warnings.rst:25 +#: library/security_warnings.rst:24 msgid "" ":mod:`shelve`: :ref:`shelve is based on pickle and thus unsuitable for " "dealing with untrusted sources `" msgstr "" -#: library/security_warnings.rst:27 +#: library/security_warnings.rst:26 msgid ":mod:`ssl`: :ref:`SSL/TLS security considerations `" msgstr "" -#: library/security_warnings.rst:28 +#: library/security_warnings.rst:27 msgid "" ":mod:`subprocess`: :ref:`Subprocess security considerations `" msgstr "" -#: library/security_warnings.rst:30 +#: library/security_warnings.rst:29 msgid "" ":mod:`tempfile`: :ref:`mktemp is deprecated due to vulnerability to race " "conditions `" msgstr "" -#: library/security_warnings.rst:32 +#: library/security_warnings.rst:31 msgid ":mod:`xml`: :ref:`XML vulnerabilities `" msgstr "" -#: library/security_warnings.rst:33 +#: library/security_warnings.rst:32 msgid "" ":mod:`zipfile`: :ref:`maliciously prepared .zip files can cause disk volume " "exhaustion `" msgstr "" -#: library/security_warnings.rst:36 +#: library/security_warnings.rst:35 msgid "" "The :option:`-I` command line option can be used to run Python in isolated " "mode. When it cannot be used, the :option:`-P` option or the :envvar:" diff --git a/library/select.po b/library/select.po index 6bcb0a5f..c509a76e 100644 --- a/library/select.po +++ b/library/select.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -46,9 +46,8 @@ msgstr "" #: includes/wasm-notavail.rst:5 msgid "" -"This module does not work or is not available on WebAssembly platforms " -"``wasm32-emscripten`` and ``wasm32-wasi``. See :ref:`wasm-availability` for " -"more information." +"This module does not work or is not available on WebAssembly. See :ref:`wasm-" +"availability` for more information." msgstr "" #: library/select.rst:27 diff --git a/library/selectors.po b/library/selectors.po index 24e18676..e7684856 100644 --- a/library/selectors.po +++ b/library/selectors.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -75,9 +75,8 @@ msgstr "" #: includes/wasm-notavail.rst:5 msgid "" -"This module does not work or is not available on WebAssembly platforms " -"``wasm32-emscripten`` and ``wasm32-wasi``. See :ref:`wasm-availability` for " -"more information." +"This module does not work or is not available on WebAssembly. See :ref:`wasm-" +"availability` for more information." msgstr "" #: library/selectors.rst:44 diff --git a/library/shelve.po b/library/shelve.po index fe2239f3..70557b1c 100644 --- a/library/shelve.po +++ b/library/shelve.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" diff --git a/library/shlex.po b/library/shlex.po index ed768051..5641065e 100644 --- a/library/shlex.po +++ b/library/shlex.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" diff --git a/library/shutil.po b/library/shutil.po index b292a20e..afc74de7 100644 --- a/library/shutil.po +++ b/library/shutil.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -110,7 +110,7 @@ msgid "" "subclass of the latter, this change is backward compatible." msgstr "" -#: library/shutil.rst:185 library/shutil.rst:287 library/shutil.rst:390 +#: library/shutil.rst:185 library/shutil.rst:287 library/shutil.rst:396 msgid "" "Platform-specific fast-copy syscalls may be used internally in order to copy " "the file more efficiently. See :ref:`shutil-platform-dependent-efficient-" @@ -436,33 +436,40 @@ msgstr "" msgid "Added the *onexc* parameter, deprecated *onerror*." msgstr "" -#: library/shutil.rst:348 +#: library/shutil.rst:346 +msgid "" +":func:`!rmtree` now ignores :exc:`FileNotFoundError` exceptions for all but " +"the top-level path. Exceptions other than :exc:`OSError` and subclasses of :" +"exc:`!OSError` are now always propagated to the caller." +msgstr "" + +#: library/shutil.rst:354 msgid "" "Indicates whether the current platform and implementation provides a symlink " "attack resistant version of :func:`rmtree`. Currently this is only true for " "platforms supporting fd-based directory access functions." msgstr "" -#: library/shutil.rst:357 +#: library/shutil.rst:363 msgid "" "Recursively move a file or directory (*src*) to another location and return " "the destination." msgstr "" -#: library/shutil.rst:360 +#: library/shutil.rst:366 msgid "" "If *dst* is an existing directory or a symlink to a directory, then *src* is " "moved inside that directory. The destination path in that directory must not " "already exist." msgstr "" -#: library/shutil.rst:364 +#: library/shutil.rst:370 msgid "" "If *dst* already exists but is not a directory, it may be overwritten " "depending on :func:`os.rename` semantics." msgstr "" -#: library/shutil.rst:367 +#: library/shutil.rst:373 msgid "" "If the destination is on the current filesystem, then :func:`os.rename` is " "used. Otherwise, *src* is copied to the destination using *copy_function* " @@ -470,7 +477,7 @@ msgid "" "of *src* will be created as the destination and *src* will be removed." msgstr "" -#: library/shutil.rst:372 +#: library/shutil.rst:378 msgid "" "If *copy_function* is given, it must be a callable that takes two arguments, " "*src* and the destination, and will be used to copy *src* to the destination " @@ -481,81 +488,85 @@ msgid "" "copy the metadata, at the expense of not copying any of the metadata." msgstr "" -#: library/shutil.rst:380 +#: library/shutil.rst:386 msgid "" "Raises an :ref:`auditing event ` ``shutil.move`` with arguments " "``src``, ``dst``." msgstr "" -#: library/shutil.rst:382 +#: library/shutil.rst:388 msgid "" "Added explicit symlink handling for foreign filesystems, thus adapting it to " "the behavior of GNU's :program:`mv`. Now returns *dst*." msgstr "" -#: library/shutil.rst:387 +#: library/shutil.rst:393 msgid "Added the *copy_function* keyword argument." msgstr "" -#: library/shutil.rst:395 +#: library/shutil.rst:401 msgid "Accepts a :term:`path-like object` for both *src* and *dst*." msgstr "" -#: library/shutil.rst:400 +#: library/shutil.rst:406 msgid "" "Return disk usage statistics about the given path as a :term:`named tuple` " "with the attributes *total*, *used* and *free*, which are the amount of " "total, used and free space, in bytes. *path* may be a file or a directory." msgstr "" -#: library/shutil.rst:407 +#: library/shutil.rst:413 msgid "" "On Unix filesystems, *path* must point to a path within a **mounted** " "filesystem partition. On those platforms, CPython doesn't attempt to " "retrieve disk usage information from non-mounted filesystems." msgstr "" -#: library/shutil.rst:413 +#: library/shutil.rst:419 msgid "On Windows, *path* can now be a file or directory." msgstr "" -#: library/shutil.rst:429 +#: library/shutil.rst:436 msgid "Availability" msgstr "" -#: library/shutil.rst:420 +#: library/shutil.rst:427 msgid "Change owner *user* and/or *group* of the given *path*." msgstr "" -#: library/shutil.rst:422 +#: library/shutil.rst:429 msgid "" "*user* can be a system user name or a uid; the same applies to *group*. At " "least one argument is required." msgstr "" -#: library/shutil.rst:425 +#: library/shutil.rst:432 msgid "See also :func:`os.chown`, the underlying function." msgstr "" -#: library/shutil.rst:427 +#: library/shutil.rst:434 msgid "" "Raises an :ref:`auditing event ` ``shutil.chown`` with arguments " "``path``, ``user``, ``group``." msgstr "" -#: library/shutil.rst:436 +#: library/shutil.rst:440 +msgid "Added *dir_fd* and *follow_symlinks* parameters." +msgstr "" + +#: library/shutil.rst:446 msgid "" "Return the path to an executable which would be run if the given *cmd* was " "called. If no *cmd* would be called, return ``None``." msgstr "" -#: library/shutil.rst:439 +#: library/shutil.rst:449 msgid "" "*mode* is a permission mask passed to :func:`os.access`, by default " "determining if the file exists and is executable." msgstr "" -#: library/shutil.rst:442 +#: library/shutil.rst:452 msgid "" "*path* is a \"``PATH`` string\" specifying the directories to look in, " "delimited by :data:`os.pathsep`. When no *path* is specified, the :envvar:" @@ -563,7 +574,7 @@ msgid "" "to :data:`os.defpath` if it is not set." msgstr "" -#: library/shutil.rst:447 +#: library/shutil.rst:457 msgid "" "On Windows, the current directory is prepended to the *path* if *mode* does " "not include ``os.X_OK``. When the *mode* does include ``os.X_OK``, the " @@ -573,7 +584,7 @@ msgid "" "environment variable ``NoDefaultCurrentDirectoryInExePath``." msgstr "" -#: library/shutil.rst:454 +#: library/shutil.rst:464 msgid "" "Also on Windows, the :envvar:`PATHEXT` environment variable is used to " "resolve commands that may not already include an extension. For example, if " @@ -582,31 +593,31 @@ msgid "" "directories. For example, on Windows::" msgstr "" -#: library/shutil.rst:460 +#: library/shutil.rst:470 msgid "" ">>> shutil.which(\"python\")\n" "'C:\\\\Python33\\\\python.EXE'" msgstr "" -#: library/shutil.rst:463 +#: library/shutil.rst:473 msgid "" "This is also applied when *cmd* is a path that contains a directory " "component::" msgstr "" -#: library/shutil.rst:466 +#: library/shutil.rst:476 msgid "" -">> shutil.which(\"C:\\\\Python33\\\\python\")\n" +">>> shutil.which(\"C:\\\\Python33\\\\python\")\n" "'C:\\\\Python33\\\\python.EXE'" msgstr "" -#: library/shutil.rst:471 +#: library/shutil.rst:481 msgid "" "The :class:`bytes` type is now accepted. If *cmd* type is :class:`bytes`, " "the result type is also :class:`bytes`." msgstr "" -#: library/shutil.rst:475 +#: library/shutil.rst:485 msgid "" "On Windows, the current directory is no longer prepended to the search path " "if *mode* includes ``os.X_OK`` and WinAPI " @@ -617,18 +628,18 @@ msgid "" "now be found." msgstr "" -#: library/shutil.rst:486 +#: library/shutil.rst:496 msgid "" "This exception collects exceptions that are raised during a multi-file " "operation. For :func:`copytree`, the exception argument is a list of 3-" "tuples (*srcname*, *dstname*, *exception*)." msgstr "" -#: library/shutil.rst:493 +#: library/shutil.rst:503 msgid "Platform-dependent efficient copy operations" msgstr "" -#: library/shutil.rst:495 +#: library/shutil.rst:505 msgid "" "Starting from Python 3.8, all functions involving a file copy (:func:" "`copyfile`, :func:`~shutil.copy`, :func:`copy2`, :func:`copytree`, and :func:" @@ -638,54 +649,54 @@ msgid "" "buffers in Python as in \"``outfd.write(infd.read())``\"." msgstr "" -#: library/shutil.rst:503 +#: library/shutil.rst:513 msgid "On macOS `fcopyfile`_ is used to copy the file content (not metadata)." msgstr "" -#: library/shutil.rst:505 +#: library/shutil.rst:515 msgid "On Linux :func:`os.sendfile` is used." msgstr "" -#: library/shutil.rst:507 +#: library/shutil.rst:517 msgid "" "On Windows :func:`shutil.copyfile` uses a bigger default buffer size (1 MiB " "instead of 64 KiB) and a :func:`memoryview`-based variant of :func:`shutil." "copyfileobj` is used." msgstr "" -#: library/shutil.rst:511 +#: library/shutil.rst:521 msgid "" "If the fast-copy operation fails and no data was written in the destination " "file then shutil will silently fallback on using less efficient :func:" "`copyfileobj` function internally." msgstr "" -#: library/shutil.rst:520 +#: library/shutil.rst:530 msgid "copytree example" msgstr "" -#: library/shutil.rst:522 +#: library/shutil.rst:532 msgid "An example that uses the :func:`ignore_patterns` helper::" msgstr "" -#: library/shutil.rst:524 +#: library/shutil.rst:534 msgid "" "from shutil import copytree, ignore_patterns\n" "\n" "copytree(source, destination, ignore=ignore_patterns('*.pyc', 'tmp*'))" msgstr "" -#: library/shutil.rst:528 +#: library/shutil.rst:538 msgid "" "This will copy everything except ``.pyc`` files and files or directories " "whose name starts with ``tmp``." msgstr "" -#: library/shutil.rst:531 +#: library/shutil.rst:541 msgid "Another example that uses the *ignore* argument to add a logging call::" msgstr "" -#: library/shutil.rst:533 +#: library/shutil.rst:543 msgid "" "from shutil import copytree\n" "import logging\n" @@ -697,11 +708,11 @@ msgid "" "copytree(source, destination, ignore=_logpath)" msgstr "" -#: library/shutil.rst:546 +#: library/shutil.rst:556 msgid "rmtree example" msgstr "" -#: library/shutil.rst:548 +#: library/shutil.rst:558 msgid "" "This example shows how to remove a directory tree on Windows where some of " "the files have their read-only bit set. It uses the onexc callback to clear " @@ -709,7 +720,7 @@ msgid "" "propagate. ::" msgstr "" -#: library/shutil.rst:553 +#: library/shutil.rst:563 msgid "" "import os, stat\n" "import shutil\n" @@ -722,31 +733,31 @@ msgid "" "shutil.rmtree(directory, onexc=remove_readonly)" msgstr "" -#: library/shutil.rst:566 +#: library/shutil.rst:576 msgid "Archiving operations" msgstr "" -#: library/shutil.rst:570 +#: library/shutil.rst:580 msgid "Added support for the *xztar* format." msgstr "" -#: library/shutil.rst:574 +#: library/shutil.rst:584 msgid "" "High-level utilities to create and read compressed and archived files are " "also provided. They rely on the :mod:`zipfile` and :mod:`tarfile` modules." msgstr "" -#: library/shutil.rst:579 +#: library/shutil.rst:589 msgid "Create an archive file (such as zip or tar) and return its name." msgstr "" -#: library/shutil.rst:581 +#: library/shutil.rst:591 msgid "" "*base_name* is the name of the file to create, including the path, minus any " "format-specific extension." msgstr "" -#: library/shutil.rst:584 +#: library/shutil.rst:594 msgid "" "*format* is the archive format: one of \"zip\" (if the :mod:`zlib` module is " "available), \"tar\", \"gztar\" (if the :mod:`zlib` module is available), " @@ -754,14 +765,14 @@ msgid "" "`lzma` module is available)." msgstr "" -#: library/shutil.rst:589 +#: library/shutil.rst:599 msgid "" "*root_dir* is a directory that will be the root directory of the archive, " "all paths in the archive will be relative to it; for example, we typically " "chdir into *root_dir* before creating the archive." msgstr "" -#: library/shutil.rst:593 +#: library/shutil.rst:603 msgid "" "*base_dir* is the directory where we start archiving from; i.e. *base_dir* " "will be the common prefix of all files and directories in the archive. " @@ -769,39 +780,39 @@ msgid "" "example-with-basedir` for how to use *base_dir* and *root_dir* together." msgstr "" -#: library/shutil.rst:599 +#: library/shutil.rst:609 msgid "*root_dir* and *base_dir* both default to the current directory." msgstr "" -#: library/shutil.rst:601 +#: library/shutil.rst:611 msgid "" "If *dry_run* is true, no archive is created, but the operations that would " "be executed are logged to *logger*." msgstr "" -#: library/shutil.rst:604 +#: library/shutil.rst:614 msgid "" "*owner* and *group* are used when creating a tar archive. By default, uses " "the current owner and group." msgstr "" -#: library/shutil.rst:607 +#: library/shutil.rst:617 msgid "" "*logger* must be an object compatible with :pep:`282`, usually an instance " "of :class:`logging.Logger`." msgstr "" -#: library/shutil.rst:610 +#: library/shutil.rst:620 msgid "The *verbose* argument is unused and deprecated." msgstr "" -#: library/shutil.rst:612 +#: library/shutil.rst:622 msgid "" "Raises an :ref:`auditing event ` ``shutil.make_archive`` with " "arguments ``base_name``, ``format``, ``root_dir``, ``base_dir``." msgstr "" -#: library/shutil.rst:616 +#: library/shutil.rst:626 msgid "" "This function is not thread-safe when custom archivers registered with :func:" "`register_archive_format` do not support the *root_dir* argument. In this " @@ -809,60 +820,60 @@ msgid "" "*root_dir* to perform archiving." msgstr "" -#: library/shutil.rst:622 +#: library/shutil.rst:632 msgid "" "The modern pax (POSIX.1-2001) format is now used instead of the legacy GNU " "format for archives created with ``format=\"tar\"``." msgstr "" -#: library/shutil.rst:626 +#: library/shutil.rst:636 msgid "" "This function is now made thread-safe during creation of standard ``.zip`` " "and tar archives." msgstr "" -#: library/shutil.rst:632 +#: library/shutil.rst:642 msgid "" "Return a list of supported formats for archiving. Each element of the " "returned sequence is a tuple ``(name, description)``." msgstr "" -#: library/shutil.rst:746 +#: library/shutil.rst:756 msgid "By default :mod:`shutil` provides these formats:" msgstr "" -#: library/shutil.rst:637 +#: library/shutil.rst:647 msgid "*zip*: ZIP file (if the :mod:`zlib` module is available)." msgstr "" -#: library/shutil.rst:638 +#: library/shutil.rst:648 msgid "" "*tar*: Uncompressed tar file. Uses POSIX.1-2001 pax format for new archives." msgstr "" -#: library/shutil.rst:751 +#: library/shutil.rst:761 msgid "*gztar*: gzip'ed tar-file (if the :mod:`zlib` module is available)." msgstr "" -#: library/shutil.rst:752 +#: library/shutil.rst:762 msgid "*bztar*: bzip2'ed tar-file (if the :mod:`bz2` module is available)." msgstr "" -#: library/shutil.rst:753 +#: library/shutil.rst:763 msgid "*xztar*: xz'ed tar-file (if the :mod:`lzma` module is available)." msgstr "" -#: library/shutil.rst:643 +#: library/shutil.rst:653 msgid "" "You can register new formats or provide your own archiver for any existing " "formats, by using :func:`register_archive_format`." msgstr "" -#: library/shutil.rst:649 +#: library/shutil.rst:659 msgid "Register an archiver for the format *name*." msgstr "" -#: library/shutil.rst:651 +#: library/shutil.rst:661 msgid "" "*function* is the callable that will be used to unpack archives. The " "callable will receive the *base_name* of the file to create, followed by the " @@ -871,7 +882,7 @@ msgid "" "*dry_run* and *logger* (as passed in :func:`make_archive`)." msgstr "" -#: library/shutil.rst:657 +#: library/shutil.rst:667 msgid "" "If *function* has the custom attribute ``function.supports_root_dir`` set to " "``True``, the *root_dir* argument is passed as a keyword argument. Otherwise " @@ -880,37 +891,37 @@ msgid "" "not thread-safe." msgstr "" -#: library/shutil.rst:663 +#: library/shutil.rst:673 msgid "" "If given, *extra_args* is a sequence of ``(name, value)`` pairs that will be " "used as extra keywords arguments when the archiver callable is used." msgstr "" -#: library/shutil.rst:666 +#: library/shutil.rst:676 msgid "" "*description* is used by :func:`get_archive_formats` which returns the list " "of archivers. Defaults to an empty string." msgstr "" -#: library/shutil.rst:669 +#: library/shutil.rst:679 msgid "Added support for functions supporting the *root_dir* argument." msgstr "" -#: library/shutil.rst:675 +#: library/shutil.rst:685 msgid "Remove the archive format *name* from the list of supported formats." msgstr "" -#: library/shutil.rst:680 +#: library/shutil.rst:690 msgid "Unpack an archive. *filename* is the full path of the archive." msgstr "" -#: library/shutil.rst:682 +#: library/shutil.rst:692 msgid "" "*extract_dir* is the name of the target directory where the archive is " "unpacked. If not provided, the current working directory is used." msgstr "" -#: library/shutil.rst:685 +#: library/shutil.rst:695 msgid "" "*format* is the archive format: one of \"zip\", \"tar\", \"gztar\", " "\"bztar\", or \"xztar\". Or any other format registered with :func:" @@ -919,7 +930,7 @@ msgid "" "that extension. In case none is found, a :exc:`ValueError` is raised." msgstr "" -#: library/shutil.rst:692 +#: library/shutil.rst:702 msgid "" "The keyword-only *filter* argument is passed to the underlying unpacking " "function. For zip files, *filter* is not accepted. For tar files, it is " @@ -929,13 +940,13 @@ msgid "" "Python 3.14." msgstr "" -#: library/shutil.rst:700 +#: library/shutil.rst:710 msgid "" "Raises an :ref:`auditing event ` ``shutil.unpack_archive`` with " "arguments ``filename``, ``extract_dir``, ``format``." msgstr "" -#: library/shutil.rst:704 +#: library/shutil.rst:714 msgid "" "Never extract archives from untrusted sources without prior inspection. It " "is possible that files are created outside of the path specified in the " @@ -943,91 +954,91 @@ msgid "" "with \"/\" or filenames with two dots \"..\"." msgstr "" -#: library/shutil.rst:709 +#: library/shutil.rst:719 msgid "Accepts a :term:`path-like object` for *filename* and *extract_dir*." msgstr "" -#: library/shutil.rst:712 +#: library/shutil.rst:722 msgid "Added the *filter* argument." msgstr "" -#: library/shutil.rst:717 +#: library/shutil.rst:727 msgid "" "Registers an unpack format. *name* is the name of the format and " "*extensions* is a list of extensions corresponding to the format, like ``." "zip`` for Zip files." msgstr "" -#: library/shutil.rst:721 +#: library/shutil.rst:731 msgid "" "*function* is the callable that will be used to unpack archives. The " "callable will receive:" msgstr "" -#: library/shutil.rst:724 +#: library/shutil.rst:734 msgid "the path of the archive, as a positional argument;" msgstr "" -#: library/shutil.rst:725 +#: library/shutil.rst:735 msgid "" "the directory the archive must be extracted to, as a positional argument;" msgstr "" -#: library/shutil.rst:726 +#: library/shutil.rst:736 msgid "" "possibly a *filter* keyword argument, if it was given to :func:" "`unpack_archive`;" msgstr "" -#: library/shutil.rst:728 +#: library/shutil.rst:738 msgid "" "additional keyword arguments, specified by *extra_args* as a sequence of " "``(name, value)`` tuples." msgstr "" -#: library/shutil.rst:731 +#: library/shutil.rst:741 msgid "" "*description* can be provided to describe the format, and will be returned " "by the :func:`get_unpack_formats` function." msgstr "" -#: library/shutil.rst:737 +#: library/shutil.rst:747 msgid "Unregister an unpack format. *name* is the name of the format." msgstr "" -#: library/shutil.rst:742 +#: library/shutil.rst:752 msgid "" "Return a list of all registered formats for unpacking. Each element of the " "returned sequence is a tuple ``(name, extensions, description)``." msgstr "" -#: library/shutil.rst:748 +#: library/shutil.rst:758 msgid "" "*zip*: ZIP file (unpacking compressed files works only if the corresponding " "module is available)." msgstr "" -#: library/shutil.rst:750 +#: library/shutil.rst:760 msgid "*tar*: uncompressed tar file." msgstr "" -#: library/shutil.rst:755 +#: library/shutil.rst:765 msgid "" "You can register new formats or provide your own unpacker for any existing " "formats, by using :func:`register_unpack_format`." msgstr "" -#: library/shutil.rst:762 +#: library/shutil.rst:772 msgid "Archiving example" msgstr "" -#: library/shutil.rst:764 +#: library/shutil.rst:774 msgid "" "In this example, we create a gzip'ed tar-file archive containing all files " "found in the :file:`.ssh` directory of the user::" msgstr "" -#: library/shutil.rst:767 +#: library/shutil.rst:777 msgid "" ">>> from shutil import make_archive\n" ">>> import os\n" @@ -1037,11 +1048,11 @@ msgid "" "'/Users/tarek/myarchive.tar.gz'" msgstr "" -#: library/shutil.rst:774 +#: library/shutil.rst:784 msgid "The resulting archive contains:" msgstr "" -#: library/shutil.rst:776 +#: library/shutil.rst:786 msgid "" "$ tar -tzvf /Users/tarek/myarchive.tar.gz\n" "drwx------ tarek/staff 0 2010-02-01 16:23:40 ./\n" @@ -1054,18 +1065,18 @@ msgid "" "-rw-r--r-- tarek/staff 37192 2010-02-06 18:23:10 ./known_hosts" msgstr "" -#: library/shutil.rst:792 +#: library/shutil.rst:802 msgid "Archiving example with *base_dir*" msgstr "" -#: library/shutil.rst:794 +#: library/shutil.rst:804 msgid "" "In this example, similar to the `one above `_, we " "show how to use :func:`make_archive`, but this time with the usage of " "*base_dir*. We now have the following directory structure:" msgstr "" -#: library/shutil.rst:798 +#: library/shutil.rst:808 msgid "" "$ tree tmp\n" "tmp\n" @@ -1076,13 +1087,13 @@ msgid "" " └── do_not_add.txt" msgstr "" -#: library/shutil.rst:808 +#: library/shutil.rst:818 msgid "" "In the final archive, :file:`please_add.txt` should be included, but :file:" "`do_not_add.txt` should not. Therefore we use the following::" msgstr "" -#: library/shutil.rst:811 +#: library/shutil.rst:821 msgid "" ">>> from shutil import make_archive\n" ">>> import os\n" @@ -1096,40 +1107,40 @@ msgid "" "'/Users/tarek/my_archive.tar'" msgstr "" -#: library/shutil.rst:822 +#: library/shutil.rst:832 msgid "Listing the files in the resulting archive gives us:" msgstr "" -#: library/shutil.rst:824 +#: library/shutil.rst:834 msgid "" "$ python -m tarfile -l /Users/tarek/myarchive.tar\n" "structure/content/\n" "structure/content/please_add.txt" msgstr "" -#: library/shutil.rst:832 +#: library/shutil.rst:842 msgid "Querying the size of the output terminal" msgstr "" -#: library/shutil.rst:836 +#: library/shutil.rst:846 msgid "Get the size of the terminal window." msgstr "" -#: library/shutil.rst:838 +#: library/shutil.rst:848 msgid "" "For each of the two dimensions, the environment variable, ``COLUMNS`` and " "``LINES`` respectively, is checked. If the variable is defined and the value " "is a positive integer, it is used." msgstr "" -#: library/shutil.rst:842 +#: library/shutil.rst:852 msgid "" "When ``COLUMNS`` or ``LINES`` is not defined, which is the common case, the " "terminal connected to :data:`sys.__stdout__` is queried by invoking :func:" "`os.get_terminal_size`." msgstr "" -#: library/shutil.rst:846 +#: library/shutil.rst:856 msgid "" "If the terminal size cannot be successfully queried, either because the " "system doesn't support querying, or because we are not connected to a " @@ -1138,17 +1149,17 @@ msgid "" "emulators." msgstr "" -#: library/shutil.rst:852 +#: library/shutil.rst:862 msgid "The value returned is a named tuple of type :class:`os.terminal_size`." msgstr "" -#: library/shutil.rst:854 +#: library/shutil.rst:864 msgid "" "See also: The Single UNIX Specification, Version 2, `Other Environment " "Variables`_." msgstr "" -#: library/shutil.rst:859 +#: library/shutil.rst:869 msgid "" "The ``fallback`` values are also used if :func:`os.get_terminal_size` " "returns zeroes." diff --git a/library/signal.po b/library/signal.po index fb511163..63865306 100644 --- a/library/signal.po +++ b/library/signal.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -53,9 +53,9 @@ msgstr "" #: library/signal.rst:29 msgid "" -"On WebAssembly platforms ``wasm32-emscripten`` and ``wasm32-wasi``, signals " -"are emulated and therefore behave differently. Several functions and signals " -"are not available on these platforms." +"On WebAssembly platforms, signals are emulated and therefore behave " +"differently. Several functions and signals are not available on these " +"platforms." msgstr "" #: library/signal.rst:34 @@ -154,8 +154,8 @@ msgstr "" #: library/signal.rst:136 library/signal.rst:148 library/signal.rst:160 #: library/signal.rst:180 library/signal.rst:206 library/signal.rst:232 #: library/signal.rst:244 library/signal.rst:272 library/signal.rst:390 -#: library/signal.rst:437 library/signal.rst:501 library/signal.rst:561 -#: library/signal.rst:618 library/signal.rst:664 +#: library/signal.rst:437 library/signal.rst:501 library/signal.rst:563 +#: library/signal.rst:620 library/signal.rst:666 msgid "Availability" msgstr "" @@ -571,13 +571,15 @@ msgstr "" #: library/signal.rst:513 msgid "" -"Set the wakeup file descriptor to *fd*. When a signal is received, the " -"signal number is written as a single byte into the fd. This can be used by " -"a library to wakeup a poll or select call, allowing the signal to be fully " -"processed." +"Set the wakeup file descriptor to *fd*. When a signal your program has " +"registered a signal handler for is received, the signal number is written as " +"a single byte into the fd. If you haven't registered a signal handler for " +"the signals you care about, then nothing will be written to the wakeup fd. " +"This can be used by a library to wakeup a poll or select call, allowing the " +"signal to be fully processed." msgstr "" -#: library/signal.rst:518 +#: library/signal.rst:520 msgid "" "The old wakeup fd is returned (or -1 if file descriptor wakeup was not " "enabled). If *fd* is -1, file descriptor wakeup is disabled. If not -1, " @@ -585,7 +587,7 @@ msgid "" "*fd* before calling poll or select again." msgstr "" -#: library/signal.rst:578 +#: library/signal.rst:580 msgid "" "When threads are enabled, this function can only be called from :ref:`the " "main thread of the main interpreter `; attempting to " @@ -593,14 +595,14 @@ msgid "" "raised." msgstr "" -#: library/signal.rst:528 +#: library/signal.rst:530 msgid "" "There are two common ways to use this function. In both approaches, you use " "the fd to wake up when a signal arrives, but then they differ in how they " "determine *which* signal or signals have arrived." msgstr "" -#: library/signal.rst:533 +#: library/signal.rst:535 msgid "" "In the first approach, we read the data out of the fd's buffer, and the byte " "values give you the signal numbers. This is simple, but in rare cases it can " @@ -611,7 +613,7 @@ msgid "" "warning to be printed to stderr when signals are lost." msgstr "" -#: library/signal.rst:542 +#: library/signal.rst:544 msgid "" "In the second approach, we use the wakeup fd *only* for wakeups, and ignore " "the actual byte values. In this case, all we care about is whether the fd's " @@ -621,33 +623,33 @@ msgid "" "spurious warning messages." msgstr "" -#: library/signal.rst:549 +#: library/signal.rst:551 msgid "On Windows, the function now also supports socket handles." msgstr "" -#: library/signal.rst:552 +#: library/signal.rst:554 msgid "Added ``warn_on_full_buffer`` parameter." msgstr "" -#: library/signal.rst:557 +#: library/signal.rst:559 msgid "" "Change system call restart behaviour: if *flag* is :const:`False`, system " "calls will be restarted when interrupted by signal *signalnum*, otherwise " "system calls will be interrupted. Returns nothing." msgstr "" -#: library/signal.rst:563 +#: library/signal.rst:565 msgid "See the man page :manpage:`siginterrupt(3)` for further information." msgstr "" -#: library/signal.rst:565 +#: library/signal.rst:567 msgid "" "Note that installing a signal handler with :func:`signal` will reset the " "restart behaviour to interruptible by implicitly calling :c:func:`!" "siginterrupt` with a true *flag* value for the given signal." msgstr "" -#: library/signal.rst:572 +#: library/signal.rst:574 msgid "" "Set the handler for signal *signalnum* to the function *handler*. *handler* " "can be a callable Python object taking two arguments (see below), or one of " @@ -657,7 +659,7 @@ msgid "" "information.)" msgstr "" -#: library/signal.rst:583 +#: library/signal.rst:585 msgid "" "The *handler* is called with two arguments: the signal number and the " "current stack frame (``None`` or a frame object; for a description of frame " @@ -665,7 +667,7 @@ msgid "" "see the attribute descriptions in the :mod:`inspect` module)." msgstr "" -#: library/signal.rst:588 +#: library/signal.rst:590 msgid "" "On Windows, :func:`signal` can only be called with :const:`SIGABRT`, :const:" "`SIGFPE`, :const:`SIGILL`, :const:`SIGINT`, :const:`SIGSEGV`, :const:" @@ -675,22 +677,22 @@ msgid "" "``SIG*`` module level constant." msgstr "" -#: library/signal.rst:599 +#: library/signal.rst:601 msgid "" "Examine the set of signals that are pending for delivery to the calling " "thread (i.e., the signals which have been raised while blocked). Return the " "set of the pending signals." msgstr "" -#: library/signal.rst:605 +#: library/signal.rst:607 msgid "See the man page :manpage:`sigpending(2)` for further information." msgstr "" -#: library/signal.rst:607 +#: library/signal.rst:609 msgid "See also :func:`pause`, :func:`pthread_sigmask` and :func:`sigwait`." msgstr "" -#: library/signal.rst:614 +#: library/signal.rst:616 msgid "" "Suspend execution of the calling thread until the delivery of one of the " "signals specified in the signal set *sigset*. The function accepts the " @@ -698,17 +700,17 @@ msgid "" "number." msgstr "" -#: library/signal.rst:620 +#: library/signal.rst:622 msgid "See the man page :manpage:`sigwait(3)` for further information." msgstr "" -#: library/signal.rst:622 +#: library/signal.rst:624 msgid "" "See also :func:`pause`, :func:`pthread_sigmask`, :func:`sigpending`, :func:" "`sigwaitinfo` and :func:`sigtimedwait`." msgstr "" -#: library/signal.rst:630 +#: library/signal.rst:632 msgid "" "Suspend execution of the calling thread until the delivery of one of the " "signals specified in the signal set *sigset*. The function accepts the " @@ -719,7 +721,7 @@ msgid "" "`InterruptedError` if it is interrupted by a signal that is not in *sigset*." msgstr "" -#: library/signal.rst:639 +#: library/signal.rst:641 msgid "" "The return value is an object representing the data contained in the :c:type:" "`siginfo_t` structure, namely: :attr:`si_signo`, :attr:`si_code`, :attr:" @@ -727,48 +729,48 @@ msgid "" "`si_band`." msgstr "" -#: library/signal.rst:646 +#: library/signal.rst:648 msgid "See the man page :manpage:`sigwaitinfo(2)` for further information." msgstr "" -#: library/signal.rst:648 +#: library/signal.rst:650 msgid "See also :func:`pause`, :func:`sigwait` and :func:`sigtimedwait`." msgstr "" -#: library/signal.rst:652 +#: library/signal.rst:654 msgid "" "The function is now retried if interrupted by a signal not in *sigset* and " "the signal handler does not raise an exception (see :pep:`475` for the " "rationale)." msgstr "" -#: library/signal.rst:660 +#: library/signal.rst:662 msgid "" "Like :func:`sigwaitinfo`, but takes an additional *timeout* argument " "specifying a timeout. If *timeout* is specified as ``0``, a poll is " "performed. Returns :const:`None` if a timeout occurs." msgstr "" -#: library/signal.rst:666 +#: library/signal.rst:668 msgid "See the man page :manpage:`sigtimedwait(2)` for further information." msgstr "" -#: library/signal.rst:668 +#: library/signal.rst:670 msgid "See also :func:`pause`, :func:`sigwait` and :func:`sigwaitinfo`." msgstr "" -#: library/signal.rst:672 +#: library/signal.rst:674 msgid "" "The function is now retried with the recomputed *timeout* if interrupted by " "a signal not in *sigset* and the signal handler does not raise an exception " "(see :pep:`475` for the rationale)." msgstr "" -#: library/signal.rst:681 +#: library/signal.rst:683 msgid "Examples" msgstr "" -#: library/signal.rst:683 +#: library/signal.rst:685 msgid "" "Here is a minimal example program. It uses the :func:`alarm` function to " "limit the time spent waiting to open a file; this is useful if the file is " @@ -778,7 +780,7 @@ msgid "" "signal will be sent, and the handler raises an exception. ::" msgstr "" -#: library/signal.rst:690 +#: library/signal.rst:692 msgid "" "import signal, os\n" "\n" @@ -797,11 +799,11 @@ msgid "" "signal.alarm(0) # Disable the alarm" msgstr "" -#: library/signal.rst:707 +#: library/signal.rst:709 msgid "Note on SIGPIPE" msgstr "" -#: library/signal.rst:709 +#: library/signal.rst:711 msgid "" "Piping output of your program to tools like :manpage:`head(1)` will cause a :" "const:`SIGPIPE` signal to be sent to your process when the receiver of its " @@ -810,7 +812,7 @@ msgid "" "entry point to catch this exception as follows::" msgstr "" -#: library/signal.rst:715 +#: library/signal.rst:717 msgid "" "import os\n" "import sys\n" @@ -835,7 +837,7 @@ msgid "" " main()" msgstr "" -#: library/signal.rst:736 +#: library/signal.rst:738 msgid "" "Do not set :const:`SIGPIPE`'s disposition to :const:`SIG_DFL` in order to " "avoid :exc:`BrokenPipeError`. Doing that would cause your program to exit " @@ -843,11 +845,11 @@ msgid "" "program is still writing to it." msgstr "" -#: library/signal.rst:745 +#: library/signal.rst:747 msgid "Note on Signal Handlers and Exceptions" msgstr "" -#: library/signal.rst:747 +#: library/signal.rst:749 msgid "" "If a signal handler raises an exception, the exception will be propagated to " "the main thread and may be raised after any :term:`bytecode` instruction. " @@ -858,11 +860,11 @@ msgid "" "program in an unexpected state." msgstr "" -#: library/signal.rst:754 +#: library/signal.rst:756 msgid "To illustrate this issue, consider the following code::" msgstr "" -#: library/signal.rst:756 +#: library/signal.rst:758 msgid "" "class SpamContext:\n" " def __init__(self):\n" @@ -880,7 +882,7 @@ msgid "" " self.lock.release()" msgstr "" -#: library/signal.rst:771 +#: library/signal.rst:773 msgid "" "For many programs, especially those that merely want to exit on :exc:" "`KeyboardInterrupt`, this is not a problem, but applications that are " @@ -891,7 +893,7 @@ msgid "" "avoids :exc:`KeyboardInterrupt`::" msgstr "" -#: library/signal.rst:779 +#: library/signal.rst:781 msgid "" "import signal\n" "import socket\n" diff --git a/library/site.po b/library/site.po index 1385492b..cf1b536a 100644 --- a/library/site.po +++ b/library/site.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -54,18 +54,27 @@ msgid "" "It starts by constructing up to four directories from a head and a tail " "part. For the head part, it uses ``sys.prefix`` and ``sys.exec_prefix``; " "empty heads are skipped. For the tail part, it uses the empty string and " -"then :file:`lib/site-packages` (on Windows) or :file:`lib/python{X.Y}/site-" -"packages` (on Unix and macOS). For each of the distinct head-tail " +"then :file:`lib/site-packages` (on Windows) or :file:`lib/python{X.Y[t]}/" +"site-packages` (on Unix and macOS). (The optional suffix \"t\" indicates " +"the :term:`free threading` build, and is appended if ``\"t\"`` is present in " +"the :data:`sys.abiflags` constant.) For each of the distinct head-tail " "combinations, it sees if it refers to an existing directory, and if so, adds " "it to ``sys.path`` and also inspects the newly added path for configuration " "files." msgstr "" -#: library/site.rst:41 +#: library/site.rst:44 msgid "Support for the \"site-python\" directory has been removed." msgstr "" -#: library/site.rst:44 +#: library/site.rst:47 +msgid "" +"On Unix, :term:`Free threading ` Python installations are " +"identified by the \"t\" suffix in the version-specific directory name, such " +"as :file:`lib/python3.13t/`." +msgstr "" + +#: library/site.rst:52 msgid "" "If a file named \"pyvenv.cfg\" exists one directory above sys.executable, " "sys.prefix and sys.exec_prefix are set to that directory and it is also " @@ -77,7 +86,7 @@ msgid "" "will." msgstr "" -#: library/site.rst:57 +#: library/site.rst:65 msgid "" "A path configuration file is a file whose name has the form :file:`{name}." "pth` and exists in one of the four directories mentioned above; its contents " @@ -89,7 +98,7 @@ msgid "" "executed." msgstr "" -#: library/site.rst:67 +#: library/site.rst:75 msgid "" "An executable line in a :file:`.pth` file is run at every Python startup, " "regardless of whether a particular module is actually going to be used. Its " @@ -101,7 +110,13 @@ msgid "" "putting anything more complex here." msgstr "" -#: library/site.rst:82 +#: library/site.rst:86 +msgid "" +"The :file:`.pth` files are now decoded by UTF-8 at first and then by the :" +"term:`locale encoding` if it fails." +msgstr "" + +#: library/site.rst:94 msgid "" "For example, suppose ``sys.prefix`` and ``sys.exec_prefix`` are set to :file:" "`/usr/local`. The Python X.Y library is then installed in :file:`/usr/local/" @@ -111,7 +126,7 @@ msgid "" "and :file:`bar.pth`. Assume :file:`foo.pth` contains the following::" msgstr "" -#: library/site.rst:90 +#: library/site.rst:102 msgid "" "# foo package configuration\n" "\n" @@ -120,30 +135,30 @@ msgid "" "bletch" msgstr "" -#: library/site.rst:96 +#: library/site.rst:108 msgid "and :file:`bar.pth` contains::" msgstr "" -#: library/site.rst:98 +#: library/site.rst:110 msgid "" "# bar package configuration\n" "\n" "bar" msgstr "" -#: library/site.rst:102 +#: library/site.rst:114 msgid "" "Then the following version-specific directories are added to ``sys.path``, " "in this order::" msgstr "" -#: library/site.rst:105 +#: library/site.rst:117 msgid "" "/usr/local/lib/pythonX.Y/site-packages/bar\n" "/usr/local/lib/pythonX.Y/site-packages/foo" msgstr "" -#: library/site.rst:108 +#: library/site.rst:120 msgid "" "Note that :file:`bletch` is omitted because it doesn't exist; the :file:" "`bar` directory precedes the :file:`foo` directory because :file:`bar.pth` " @@ -151,11 +166,11 @@ msgid "" "because it is not mentioned in either path configuration file." msgstr "" -#: library/site.rst:114 +#: library/site.rst:126 msgid ":mod:`sitecustomize`" msgstr "" -#: library/site.rst:118 +#: library/site.rst:130 msgid "" "After these path manipulations, an attempt is made to import a module named :" "mod:`sitecustomize`, which can perform arbitrary site-specific " @@ -169,11 +184,11 @@ msgid "" "mysterious failure of the process." msgstr "" -#: library/site.rst:130 +#: library/site.rst:142 msgid ":mod:`usercustomize`" msgstr "" -#: library/site.rst:134 +#: library/site.rst:146 msgid "" "After this, an attempt is made to import a module named :mod:" "`usercustomize`, which can perform arbitrary user-specific customizations, " @@ -185,18 +200,18 @@ msgid "" "ignored." msgstr "" -#: library/site.rst:142 +#: library/site.rst:154 msgid "" "Note that for some non-Unix systems, ``sys.prefix`` and ``sys.exec_prefix`` " "are empty, and the path manipulations are skipped; however the import of :" "mod:`sitecustomize` and :mod:`usercustomize` is still attempted." msgstr "" -#: library/site.rst:151 +#: library/site.rst:163 msgid "Readline configuration" msgstr "" -#: library/site.rst:153 +#: library/site.rst:165 msgid "" "On systems that support :mod:`readline`, this module will also import and " "configure the :mod:`rlcompleter` module, if Python is started in :ref:" @@ -208,19 +223,19 @@ msgid "" "`PYTHONSTARTUP` file." msgstr "" -#: library/site.rst:162 +#: library/site.rst:174 msgid "Activation of rlcompleter and history was made automatic." msgstr "" -#: library/site.rst:167 +#: library/site.rst:179 msgid "Module contents" msgstr "" -#: library/site.rst:171 +#: library/site.rst:183 msgid "A list of prefixes for site-packages directories." msgstr "" -#: library/site.rst:176 +#: library/site.rst:188 msgid "" "Flag showing the status of the user site-packages directory. ``True`` means " "that it is enabled and was added to ``sys.path``. ``False`` means that it " @@ -229,18 +244,19 @@ msgid "" "(mismatch between user or group id and effective id) or by an administrator." msgstr "" -#: library/site.rst:186 +#: library/site.rst:198 msgid "" "Path to the user site-packages for the running Python. Can be ``None`` if :" "func:`getusersitepackages` hasn't been called yet. Default value is :file:" -"`~/.local/lib/python{X.Y}/site-packages` for UNIX and non-framework macOS " +"`~/.local/lib/python{X.Y}[t]/site-packages` for UNIX and non-framework macOS " "builds, :file:`~/Library/Python/{X.Y}/lib/python/site-packages` for macOS " "framework builds, and :file:`{%APPDATA%}\\\\Python\\\\Python{XY}\\\\site-" -"packages` on Windows. This directory is a site directory, which means that :" -"file:`.pth` files in it will be processed." +"packages` on Windows. The optional \"t\" indicates the free-threaded " +"build. This directory is a site directory, which means that :file:`.pth` " +"files in it will be processed." msgstr "" -#: library/site.rst:197 +#: library/site.rst:210 msgid "" "Path to the base directory for the user site-packages. Can be ``None`` if :" "func:`getuserbase` hasn't been called yet. Default value is :file:`~/." @@ -251,35 +267,35 @@ msgid "" "scheme `. See also :envvar:`PYTHONUSERBASE`." msgstr "" -#: library/site.rst:209 +#: library/site.rst:222 msgid "" "Adds all the standard site-specific directories to the module search path. " "This function is called automatically when this module is imported, unless " "the Python interpreter was started with the :option:`-S` flag." msgstr "" -#: library/site.rst:213 +#: library/site.rst:226 msgid "This function used to be called unconditionally." msgstr "" -#: library/site.rst:219 +#: library/site.rst:232 msgid "" "Add a directory to sys.path and process its :file:`.pth` files. Typically " "used in :mod:`sitecustomize` or :mod:`usercustomize` (see above)." msgstr "" -#: library/site.rst:225 +#: library/site.rst:238 msgid "Return a list containing all global site-packages directories." msgstr "" -#: library/site.rst:232 +#: library/site.rst:245 msgid "" "Return the path of the user base directory, :data:`USER_BASE`. If it is not " "initialized yet, this function will also set it, respecting :envvar:" "`PYTHONUSERBASE`." msgstr "" -#: library/site.rst:241 +#: library/site.rst:254 msgid "" "Return the path of the user-specific site-packages directory, :data:" "`USER_SITE`. If it is not initialized yet, this function will also set it, " @@ -287,23 +303,23 @@ msgid "" "packages was added to ``sys.path`` :data:`ENABLE_USER_SITE` should be used." msgstr "" -#: library/site.rst:253 +#: library/site.rst:266 msgid "Command Line Interface" msgstr "" -#: library/site.rst:257 +#: library/site.rst:270 msgid "" "The :mod:`site` module also provides a way to get the user directories from " "the command line:" msgstr "" -#: library/site.rst:260 +#: library/site.rst:273 msgid "" "$ python -m site --user-site\n" "/home/user/.local/lib/python3.11/site-packages" msgstr "" -#: library/site.rst:265 +#: library/site.rst:278 msgid "" "If it is called without arguments, it will print the contents of :data:`sys." "path` on the standard output, followed by the value of :data:`USER_BASE` and " @@ -311,21 +327,21 @@ msgid "" "finally the value of :data:`ENABLE_USER_SITE`." msgstr "" -#: library/site.rst:272 +#: library/site.rst:285 msgid "Print the path to the user base directory." msgstr "" -#: library/site.rst:276 +#: library/site.rst:289 msgid "Print the path to the user site-packages directory." msgstr "" -#: library/site.rst:278 +#: library/site.rst:291 msgid "" "If both options are given, user base and user site will be printed (always " "in this order), separated by :data:`os.pathsep`." msgstr "" -#: library/site.rst:281 +#: library/site.rst:294 msgid "" "If any option is given, the script will exit with one of these values: ``0`` " "if the user site-packages directory is enabled, ``1`` if it was disabled by " @@ -333,11 +349,11 @@ msgid "" "administrator, and a value greater than 2 if there is an error." msgstr "" -#: library/site.rst:288 +#: library/site.rst:301 msgid ":pep:`370` -- Per user site-packages directory" msgstr "" -#: library/site.rst:289 +#: library/site.rst:302 msgid ":ref:`sys-path-init` -- The initialization of :data:`sys.path`." msgstr "" @@ -349,7 +365,7 @@ msgstr "" msgid "search" msgstr "" -#: library/site.rst:78 +#: library/site.rst:90 msgid "path" msgstr "" @@ -361,30 +377,30 @@ msgstr "" msgid "directory" msgstr "" -#: library/site.rst:53 +#: library/site.rst:61 msgid "# (hash)" msgstr "" -#: library/site.rst:53 +#: library/site.rst:61 msgid "comment" msgstr "" -#: library/site.rst:53 +#: library/site.rst:61 msgid "statement" msgstr "" -#: library/site.rst:53 +#: library/site.rst:61 msgid "import" msgstr "" -#: library/site.rst:78 +#: library/site.rst:90 msgid "package" msgstr "" -#: library/site.rst:78 +#: library/site.rst:90 msgid "configuration" msgstr "" -#: library/site.rst:78 +#: library/site.rst:90 msgid "file" msgstr "" diff --git a/library/smtpd.po b/library/smtpd.po index 2257a44c..46faa467 100644 --- a/library/smtpd.po +++ b/library/smtpd.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" diff --git a/library/smtplib.po b/library/smtplib.po index 7623cc93..cb78b1d3 100644 --- a/library/smtplib.po +++ b/library/smtplib.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -39,9 +39,8 @@ msgstr "" #: includes/wasm-notavail.rst:5 msgid "" -"This module does not work or is not available on WebAssembly platforms " -"``wasm32-emscripten`` and ``wasm32-wasi``. See :ref:`wasm-availability` for " -"more information." +"This module does not work or is not available on WebAssembly. See :ref:`wasm-" +"availability` for more information." msgstr "" #: library/smtplib.rst:26 diff --git a/library/sndhdr.po b/library/sndhdr.po index c42e4af7..ea97cdb9 100644 --- a/library/sndhdr.po +++ b/library/sndhdr.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -18,187 +18,25 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" #: library/sndhdr.rst:2 -msgid ":mod:`sndhdr` --- Determine type of sound file" +msgid ":mod:`!sndhdr` --- Determine type of sound file" msgstr "" -#: library/sndhdr.rst:11 -msgid "**Source code:** :source:`Lib/sndhdr.py`" -msgstr "" - -#: library/sndhdr.rst:17 -msgid "" -"The :mod:`sndhdr` module is deprecated (see :pep:`PEP 594 <594#sndhdr>` for " -"details and alternatives)." -msgstr "" - -#: library/sndhdr.rst:23 +#: library/sndhdr.rst:10 msgid "" -"The :mod:`sndhdr` provides utility functions which attempt to determine the " -"type of sound data which is in a file. When these functions are able to " -"determine what type of sound data is stored in a file, they return a :func:" -"`~collections.namedtuple`, containing five attributes: (``filetype``, " -"``framerate``, ``nchannels``, ``nframes``, ``sampwidth``). The value for " -"*type* indicates the data type and will be one of the strings ``'aifc'``, " -"``'aiff'``, ``'au'``, ``'hcom'``, ``'sndr'``, ``'sndt'``, ``'voc'``, " -"``'wav'``, ``'8svx'``, ``'sb'``, ``'ub'``, or ``'ul'``. The *sampling_rate* " -"will be either the actual value or ``0`` if unknown or difficult to decode. " -"Similarly, *channels* will be either the number of channels or ``0`` if it " -"cannot be determined or if the value is difficult to decode. The value for " -"*frames* will be either the number of frames or ``-1``. The last item in " -"the tuple, *bits_per_sample*, will either be the sample size in bits or " -"``'A'`` for A-LAW or ``'U'`` for u-LAW." -msgstr "" - -#: library/sndhdr.rst:40 -msgid "" -"Determines the type of sound data stored in the file *filename* using :func:" -"`whathdr`. If it succeeds, returns a namedtuple as described above, " -"otherwise ``None`` is returned." -msgstr "" - -#: library/sndhdr.rst:54 -msgid "Result changed from a tuple to a namedtuple." +"This module is no longer part of the Python standard library. It was :ref:" +"`removed in Python 3.13 ` after being deprecated in " +"Python 3.11. The removal was decided in :pep:`594`." msgstr "" -#: library/sndhdr.rst:50 +#: library/sndhdr.rst:14 msgid "" -"Determines the type of sound data stored in a file based on the file " -"header. The name of the file is given by *filename*. This function returns " -"a namedtuple as described above on success, or ``None``." +"Possible replacements are third-party modules from PyPI: :pypi:`filetype`, :" +"pypi:`puremagic`, or :pypi:`python-magic`. These are not supported or " +"maintained by the Python core team." msgstr "" -#: library/sndhdr.rst:57 +#: library/sndhdr.rst:18 msgid "" -"The following sound header types are recognized, as listed below with the " -"return value from :func:`whathdr`: and :func:`what`:" -msgstr "" - -#: library/sndhdr.rst:61 -msgid "Value" -msgstr "" - -#: library/sndhdr.rst:61 -msgid "Sound header format" -msgstr "" - -#: library/sndhdr.rst:63 -msgid "``'aifc'``" -msgstr "" - -#: library/sndhdr.rst:63 -msgid "Compressed Audio Interchange Files" -msgstr "" - -#: library/sndhdr.rst:65 -msgid "``'aiff'``" -msgstr "" - -#: library/sndhdr.rst:65 -msgid "Audio Interchange Files" -msgstr "" - -#: library/sndhdr.rst:67 -msgid "``'au'``" -msgstr "" - -#: library/sndhdr.rst:67 -msgid "Au Files" -msgstr "" - -#: library/sndhdr.rst:69 -msgid "``'hcom'``" -msgstr "" - -#: library/sndhdr.rst:69 -msgid "HCOM Files" -msgstr "" - -#: library/sndhdr.rst:71 -msgid "``'sndt'``" -msgstr "" - -#: library/sndhdr.rst:71 -msgid "Sndtool Sound Files" -msgstr "" - -#: library/sndhdr.rst:73 -msgid "``'voc'``" -msgstr "" - -#: library/sndhdr.rst:73 -msgid "Creative Labs Audio Files" -msgstr "" - -#: library/sndhdr.rst:75 -msgid "``'wav'``" -msgstr "" - -#: library/sndhdr.rst:75 -msgid "Waveform Audio File Format Files" -msgstr "" - -#: library/sndhdr.rst:77 -msgid "``'8svx'``" -msgstr "" - -#: library/sndhdr.rst:77 -msgid "8-Bit Sampled Voice Files" -msgstr "" - -#: library/sndhdr.rst:79 -msgid "``'sb'``" -msgstr "" - -#: library/sndhdr.rst:79 -msgid "Signed Byte Audio Data Files" -msgstr "" - -#: library/sndhdr.rst:81 -msgid "``'ub'``" -msgstr "" - -#: library/sndhdr.rst:81 -msgid "UB Files" -msgstr "" - -#: library/sndhdr.rst:83 -msgid "``'ul'``" -msgstr "" - -#: library/sndhdr.rst:83 -msgid "uLAW Audio Files" -msgstr "" - -#: library/sndhdr.rst:88 -msgid "" -"A list of functions performing the individual tests. Each function takes " -"two arguments: the byte-stream and an open file-like object. When :func:" -"`what` is called with a byte-stream, the file-like object will be ``None``." -msgstr "" - -#: library/sndhdr.rst:92 -msgid "" -"The test function should return a string describing the image type if the " -"test succeeded, or ``None`` if it failed." -msgstr "" - -#: library/sndhdr.rst:95 -msgid "Example:" -msgstr "" - -#: library/sndhdr.rst:97 -msgid "" -">>> import sndhdr\n" -">>> imghdr.what('bass.wav')\n" -"'wav'\n" -">>> imghdr.whathdr('bass.wav')\n" -"'wav'" -msgstr "" - -#: library/sndhdr.rst:13 -msgid "A-LAW" -msgstr "" - -#: library/sndhdr.rst:13 -msgid "u-LAW" +"The last version of Python that provided the :mod:`!sndhdr` module was " +"`Python 3.12 `_." msgstr "" diff --git a/library/socket.po b/library/socket.po index 6fb255f8..eb76d864 100644 --- a/library/socket.po +++ b/library/socket.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -38,24 +38,23 @@ msgid "" "operating system socket APIs." msgstr "" -#: library/socket.rst:181 library/socket.rst:216 library/socket.rst:383 -#: library/socket.rst:470 library/socket.rst:496 library/socket.rst:514 -#: library/socket.rst:537 library/socket.rst:561 library/socket.rst:601 -#: library/socket.rst:638 library/socket.rst:662 library/socket.rst:694 -#: library/socket.rst:893 library/socket.rst:1034 library/socket.rst:1062 -#: library/socket.rst:1090 library/socket.rst:1112 library/socket.rst:1221 -#: library/socket.rst:1270 library/socket.rst:1310 library/socket.rst:1354 -#: library/socket.rst:1385 library/socket.rst:1483 library/socket.rst:1517 -#: library/socket.rst:1609 library/socket.rst:1778 library/socket.rst:1904 -#: library/socket.rst:1998 includes/wasm-notavail.rst:3 +#: library/socket.rst:186 library/socket.rst:221 library/socket.rst:388 +#: library/socket.rst:483 library/socket.rst:509 library/socket.rst:527 +#: library/socket.rst:550 library/socket.rst:574 library/socket.rst:614 +#: library/socket.rst:650 library/socket.rst:674 library/socket.rst:706 +#: library/socket.rst:905 library/socket.rst:1046 library/socket.rst:1074 +#: library/socket.rst:1102 library/socket.rst:1124 library/socket.rst:1233 +#: library/socket.rst:1282 library/socket.rst:1322 library/socket.rst:1366 +#: library/socket.rst:1397 library/socket.rst:1495 library/socket.rst:1529 +#: library/socket.rst:1621 library/socket.rst:1790 library/socket.rst:1916 +#: library/socket.rst:2010 includes/wasm-notavail.rst:3 msgid "Availability" msgstr "" #: includes/wasm-notavail.rst:5 msgid "" -"This module does not work or is not available on WebAssembly platforms " -"``wasm32-emscripten`` and ``wasm32-wasi``. See :ref:`wasm-availability` for " -"more information." +"This module does not work or is not available on WebAssembly. See :ref:`wasm-" +"availability` for more information." msgstr "" #: library/socket.rst:24 @@ -119,7 +118,7 @@ msgid "" "Previously, :const:`AF_UNIX` socket paths were assumed to use UTF-8 encoding." msgstr "" -#: library/socket.rst:1184 library/socket.rst:1982 +#: library/socket.rst:1196 library/socket.rst:1994 msgid "Writable :term:`bytes-like object` is now accepted." msgstr "" @@ -252,120 +251,132 @@ msgid "" msgstr "" #: library/socket.rst:146 +msgid ":const:`BTPROTO_HCI` accepts a format that depends on your OS." +msgstr "" + +#: library/socket.rst:148 +msgid "" +"On Linux it accepts a tuple ``(device_id,)`` where ``device_id`` is an " +"integer specifying the number of the Bluetooth device." +msgstr "" + +#: library/socket.rst:150 msgid "" -":const:`BTPROTO_HCI` accepts ``(device_id,)`` where ``device_id`` is either " -"an integer or a string with the Bluetooth address of the interface. (This " -"depends on your OS; NetBSD and DragonFlyBSD expect a Bluetooth address while " -"everything else expects an integer.)" +"On FreeBSD, NetBSD and DragonFly BSD it accepts ``bdaddr`` where ``bdaddr`` " +"is the Bluetooth address as a string." msgstr "" -#: library/socket.rst:151 +#: library/socket.rst:153 msgid "NetBSD and DragonFlyBSD support added." msgstr "" -#: library/socket.rst:154 -msgid "" -":const:`BTPROTO_SCO` accepts ``bdaddr`` where ``bdaddr`` is a :class:`bytes` " -"object containing the Bluetooth address in a string format. (ex. " -"``b'12:23:34:45:56:67'``) This protocol is not supported under FreeBSD." +#: library/socket.rst:156 +msgid "FreeBSD support added." msgstr "" #: library/socket.rst:159 msgid "" +":const:`BTPROTO_SCO` accepts ``bdaddr`` where ``bdaddr`` is the Bluetooth " +"address as a string or a :class:`bytes` object. (ex. ``'12:23:34:45:56:67'`` " +"or ``b'12:23:34:45:56:67'``) This protocol is not supported under FreeBSD." +msgstr "" + +#: library/socket.rst:164 +msgid "" ":const:`AF_ALG` is a Linux-only socket based interface to Kernel " "cryptography. An algorithm socket is configured with a tuple of two to four " "elements ``(type, name [, feat [, mask]])``, where:" msgstr "" -#: library/socket.rst:163 +#: library/socket.rst:168 msgid "" "*type* is the algorithm type as string, e.g. ``aead``, ``hash``, " "``skcipher`` or ``rng``." msgstr "" -#: library/socket.rst:166 +#: library/socket.rst:171 msgid "" "*name* is the algorithm name and operation mode as string, e.g. ``sha256``, " "``hmac(sha256)``, ``cbc(aes)`` or ``drbg_nopr_ctr_aes256``." msgstr "" -#: library/socket.rst:169 +#: library/socket.rst:174 msgid "*feat* and *mask* are unsigned 32bit integers." msgstr "" -#: library/socket.rst:173 +#: library/socket.rst:178 msgid "Some algorithm types require more recent Kernels." msgstr "" -#: library/socket.rst:177 +#: library/socket.rst:182 msgid "" ":const:`AF_VSOCK` allows communication between virtual machines and their " "hosts. The sockets are represented as a ``(CID, port)`` tuple where the " "context ID or CID and port are integers." msgstr "" -#: library/socket.rst:183 +#: library/socket.rst:188 msgid "See :manpage:`vsock(7)`" msgstr "" -#: library/socket.rst:187 +#: library/socket.rst:192 msgid "" ":const:`AF_PACKET` is a low-level interface directly to network devices. The " "addresses are represented by the tuple ``(ifname, proto[, pkttype[, hatype[, " "addr]]])`` where:" msgstr "" -#: library/socket.rst:191 +#: library/socket.rst:196 msgid "*ifname* - String specifying the device name." msgstr "" -#: library/socket.rst:192 +#: library/socket.rst:197 msgid "" "*proto* - The Ethernet protocol number. May be :data:`ETH_P_ALL` to capture " "all protocols, one of the :ref:`ETHERTYPE_* constants ` or any other Ethernet protocol number." msgstr "" -#: library/socket.rst:196 +#: library/socket.rst:201 msgid "*pkttype* - Optional integer specifying the packet type:" msgstr "" -#: library/socket.rst:198 +#: library/socket.rst:203 msgid "``PACKET_HOST`` (the default) - Packet addressed to the local host." msgstr "" -#: library/socket.rst:199 +#: library/socket.rst:204 msgid "``PACKET_BROADCAST`` - Physical-layer broadcast packet." msgstr "" -#: library/socket.rst:200 +#: library/socket.rst:205 msgid "" "``PACKET_MULTICAST`` - Packet sent to a physical-layer multicast address." msgstr "" -#: library/socket.rst:201 +#: library/socket.rst:206 msgid "" "``PACKET_OTHERHOST`` - Packet to some other host that has been caught by a " "device driver in promiscuous mode." msgstr "" -#: library/socket.rst:203 +#: library/socket.rst:208 msgid "" "``PACKET_OUTGOING`` - Packet originating from the local host that is looped " "back to a packet socket." msgstr "" -#: library/socket.rst:205 +#: library/socket.rst:210 msgid "*hatype* - Optional integer specifying the ARP hardware address type." msgstr "" -#: library/socket.rst:206 +#: library/socket.rst:211 msgid "" "*addr* - Optional bytes-like object specifying the hardware physical " "address, whose interpretation depends on the device." msgstr "" -#: library/socket.rst:211 +#: library/socket.rst:216 msgid "" ":const:`AF_QIPCRTR` is a Linux-only socket based interface for communicating " "with services running on co-processors in Qualcomm platforms. The address " @@ -373,7 +384,7 @@ msgid "" "*port* are non-negative integers." msgstr "" -#: library/socket.rst:220 +#: library/socket.rst:225 msgid "" ":const:`IPPROTO_UDPLITE` is a variant of UDP which allows you to specify " "what portion of a packet is covered with the checksum. It adds two socket " @@ -384,14 +395,14 @@ msgid "" "of their data. In both cases ``length`` should be in ``range(8, 2**16, 8)``." msgstr "" -#: library/socket.rst:229 +#: library/socket.rst:234 msgid "" "Such a socket should be constructed with ``socket(AF_INET, SOCK_DGRAM, " "IPPROTO_UDPLITE)`` for IPv4 or ``socket(AF_INET6, SOCK_DGRAM, " "IPPROTO_UDPLITE)`` for IPv6." msgstr "" -#: library/socket.rst:237 +#: library/socket.rst:242 msgid "" ":const:`AF_HYPERV` is a Windows-only socket based interface for " "communicating with Hyper-V hosts and guests. The address family is " @@ -399,49 +410,49 @@ msgid "" "``service_id`` are UUID strings." msgstr "" -#: library/socket.rst:242 +#: library/socket.rst:247 msgid "" "The ``vm_id`` is the virtual machine identifier or a set of known VMID " "values if the target is not a specific virtual machine. Known VMID constants " "defined on ``socket`` are:" msgstr "" -#: library/socket.rst:246 +#: library/socket.rst:251 msgid "``HV_GUID_ZERO``" msgstr "" -#: library/socket.rst:247 +#: library/socket.rst:252 msgid "``HV_GUID_BROADCAST``" msgstr "" -#: library/socket.rst:248 +#: library/socket.rst:253 msgid "" "``HV_GUID_WILDCARD`` - Used to bind on itself and accept connections from " "all partitions." msgstr "" -#: library/socket.rst:250 +#: library/socket.rst:255 msgid "" "``HV_GUID_CHILDREN`` - Used to bind on itself and accept connection from " "child partitions." msgstr "" -#: library/socket.rst:252 +#: library/socket.rst:257 msgid "``HV_GUID_LOOPBACK`` - Used as a target to itself." msgstr "" -#: library/socket.rst:253 +#: library/socket.rst:258 msgid "" "``HV_GUID_PARENT`` - When used as a bind accepts connection from the parent " "partition. When used as an address target it will connect to the parent " "partition." msgstr "" -#: library/socket.rst:256 +#: library/socket.rst:261 msgid "The ``service_id`` is the service identifier of the registered service." msgstr "" -#: library/socket.rst:260 +#: library/socket.rst:265 msgid "" "If you use a hostname in the *host* portion of IPv4/v6 socket address, the " "program may show a nondeterministic behavior, as Python uses the first " @@ -451,41 +462,41 @@ msgid "" "deterministic behavior use a numeric address in *host* portion." msgstr "" -#: library/socket.rst:267 +#: library/socket.rst:272 msgid "" "All errors raise exceptions. The normal exceptions for invalid argument " "types and out-of-memory conditions can be raised. Errors related to socket " "or address semantics raise :exc:`OSError` or one of its subclasses." msgstr "" -#: library/socket.rst:272 +#: library/socket.rst:277 msgid "" "Non-blocking mode is supported through :meth:`~socket.setblocking`. A " "generalization of this based on timeouts is supported through :meth:`~socket." "settimeout`." msgstr "" -#: library/socket.rst:278 +#: library/socket.rst:283 msgid "Module contents" msgstr "" -#: library/socket.rst:280 +#: library/socket.rst:285 msgid "The module :mod:`socket` exports the following elements." msgstr "" -#: library/socket.rst:284 +#: library/socket.rst:289 msgid "Exceptions" msgstr "" -#: library/socket.rst:288 +#: library/socket.rst:293 msgid "A deprecated alias of :exc:`OSError`." msgstr "" -#: library/socket.rst:290 +#: library/socket.rst:295 msgid "Following :pep:`3151`, this class was made an alias of :exc:`OSError`." msgstr "" -#: library/socket.rst:296 +#: library/socket.rst:301 msgid "" "A subclass of :exc:`OSError`, this exception is raised for address-related " "errors, i.e. for functions that use *h_errno* in the POSIX C API, including :" @@ -495,11 +506,11 @@ msgid "" "description of *h_errno*, as returned by the :c:func:`hstrerror` C function." msgstr "" -#: library/socket.rst:317 library/socket.rst:330 +#: library/socket.rst:322 library/socket.rst:335 msgid "This class was made a subclass of :exc:`OSError`." msgstr "" -#: library/socket.rst:309 +#: library/socket.rst:314 msgid "" "A subclass of :exc:`OSError`, this exception is raised for address-related " "errors by :func:`getaddrinfo` and :func:`getnameinfo`. The accompanying " @@ -509,11 +520,11 @@ msgid "" "match one of the :const:`!EAI_\\*` constants defined in this module." msgstr "" -#: library/socket.rst:322 +#: library/socket.rst:327 msgid "A deprecated alias of :exc:`TimeoutError`." msgstr "" -#: library/socket.rst:324 +#: library/socket.rst:329 msgid "" "A subclass of :exc:`OSError`, this exception is raised when a timeout occurs " "on a socket which has had timeouts enabled via a prior call to :meth:" @@ -522,21 +533,21 @@ msgid "" "currently always \"timed out\"." msgstr "" -#: library/socket.rst:333 +#: library/socket.rst:338 msgid "This class was made an alias of :exc:`TimeoutError`." msgstr "" -#: library/socket.rst:338 +#: library/socket.rst:343 msgid "Constants" msgstr "" -#: library/socket.rst:340 +#: library/socket.rst:345 msgid "" "The AF_* and SOCK_* constants are now :class:`AddressFamily` and :class:" "`SocketKind` :class:`.IntEnum` collections." msgstr "" -#: library/socket.rst:349 +#: library/socket.rst:354 msgid "" "These constants represent the address (and protocol) families, used for the " "first argument to :func:`~socket.socket`. If the :const:`AF_UNIX` constant " @@ -544,14 +555,14 @@ msgid "" "available depending on the system." msgstr "" -#: library/socket.rst:356 +#: library/socket.rst:361 msgid "" ":const:`AF_UNSPEC` means that :func:`getaddrinfo` should return socket " "addresses for any address family (either IPv4, IPv6, or any other) that can " "be used." msgstr "" -#: library/socket.rst:366 +#: library/socket.rst:371 msgid "" "These constants represent the socket types, used for the second argument to :" "func:`~socket.socket`. More constants may be available depending on the " @@ -559,20 +570,20 @@ msgid "" "generally useful.)" msgstr "" -#: library/socket.rst:374 +#: library/socket.rst:379 msgid "" "These two constants, if defined, can be combined with the socket types and " "allow you to set some flags atomically (thus avoiding possible race " "conditions and the need for separate calls)." msgstr "" -#: library/socket.rst:380 +#: library/socket.rst:385 msgid "" "`Secure File Descriptor Handling `_ for a more thorough explanation." msgstr "" -#: library/socket.rst:404 +#: library/socket.rst:409 msgid "" "Many constants of these forms, documented in the Unix documentation on " "sockets and/or the IP protocol, are also defined in the socket module. They " @@ -582,41 +593,41 @@ msgid "" "symbols, default values are provided." msgstr "" -#: library/socket.rst:411 +#: library/socket.rst:416 msgid "" "``SO_DOMAIN``, ``SO_PROTOCOL``, ``SO_PEERSEC``, ``SO_PASSSEC``, " "``TCP_USER_TIMEOUT``, ``TCP_CONGESTION`` were added." msgstr "" -#: library/socket.rst:415 +#: library/socket.rst:420 msgid "" "On Windows, ``TCP_FASTOPEN``, ``TCP_KEEPCNT`` appear if run-time Windows " "supports." msgstr "" -#: library/socket.rst:419 +#: library/socket.rst:424 msgid "``TCP_NOTSENT_LOWAT`` was added." msgstr "" -#: library/socket.rst:422 +#: library/socket.rst:427 msgid "" "On Windows, ``TCP_KEEPIDLE``, ``TCP_KEEPINTVL`` appear if run-time Windows " "supports." msgstr "" -#: library/socket.rst:425 +#: library/socket.rst:430 msgid "" "``IP_RECVTOS`` was added. Added ``TCP_KEEPALIVE``. On MacOS this constant " "can be used in the same way that ``TCP_KEEPIDLE`` is used on Linux." msgstr "" -#: library/socket.rst:430 +#: library/socket.rst:435 msgid "" "Added ``TCP_CONNECTION_INFO``. On MacOS this constant can be used in the " "same way that ``TCP_INFO`` is used on Linux and BSD." msgstr "" -#: library/socket.rst:434 +#: library/socket.rst:439 msgid "" "Added ``SO_RTABLE`` and ``SO_USER_COOKIE``. On OpenBSD and FreeBSD " "respectively those constants can be used in the same way that ``SO_MARK`` is " @@ -632,125 +643,136 @@ msgid "" "``IP_DROP_SOURCE_MEMBERSHIP``." msgstr "" -#: library/socket.rst:534 library/socket.rst:558 +#: library/socket.rst:453 +msgid "" +"Added ``SO_BINDTOIFINDEX``. On Linux this constant can be used in the same " +"way that ``SO_BINDTODEVICE`` is used, but with the index of a network " +"interface instead of its name." +msgstr "" + +#: library/socket.rst:547 library/socket.rst:571 msgid "" "Many constants of these forms, documented in the Linux documentation, are " "also defined in the socket module." msgstr "" -#: library/socket.rst:460 +#: library/socket.rst:470 msgid "NetBSD support was added." msgstr "" -#: library/socket.rst:466 +#: library/socket.rst:473 +msgid "Restored missing ``CAN_RAW_ERR_FILTER`` on Linux." +msgstr "" + +#: library/socket.rst:479 msgid "" "CAN_BCM, in the CAN protocol family, is the broadcast manager (BCM) " "protocol. Broadcast manager constants, documented in the Linux " "documentation, are also defined in the socket module." msgstr "" -#: library/socket.rst:473 +#: library/socket.rst:486 msgid "" "The :data:`CAN_BCM_CAN_FD_FRAME` flag is only available on Linux >= 4.8." msgstr "" -#: library/socket.rst:479 +#: library/socket.rst:492 msgid "" "Enables CAN FD support in a CAN_RAW socket. This is disabled by default. " "This allows your application to send both CAN and CAN FD frames; however, " "you must accept both CAN and CAN FD frames when reading from the socket." msgstr "" -#: library/socket.rst:494 +#: library/socket.rst:507 msgid "This constant is documented in the Linux documentation." msgstr "" -#: library/socket.rst:491 +#: library/socket.rst:504 msgid "" "Joins the applied CAN filters such that only CAN frames that match all given " "CAN filters are passed to user space." msgstr "" -#: library/socket.rst:502 +#: library/socket.rst:515 msgid "" "CAN_ISOTP, in the CAN protocol family, is the ISO-TP (ISO 15765-2) protocol. " "ISO-TP constants, documented in the Linux documentation." msgstr "" -#: library/socket.rst:511 +#: library/socket.rst:524 msgid "" "CAN_J1939, in the CAN protocol family, is the SAE J1939 protocol. J1939 " "constants, documented in the Linux documentation." msgstr "" -#: library/socket.rst:522 +#: library/socket.rst:535 msgid "" "These two constants, documented in the FreeBSD divert(4) manual page, are " "also defined in the socket module." msgstr "" -#: library/socket.rst:542 +#: library/socket.rst:555 msgid "" ":data:`!ETH_P_ALL` can be used in the :class:`~socket.socket` constructor as " "*proto* for the :const:`AF_PACKET` family in order to capture every packet, " "regardless of protocol." msgstr "" -#: library/socket.rst:546 +#: library/socket.rst:559 msgid "For more information, see the :manpage:`packet(7)` manpage." msgstr "" -#: library/socket.rst:571 +#: library/socket.rst:584 msgid "" "Constants for Windows' WSAIoctl(). The constants are used as arguments to " "the :meth:`~socket.socket.ioctl` method of socket objects." msgstr "" -#: library/socket.rst:1599 +#: library/socket.rst:1611 msgid "``SIO_LOOPBACK_FAST_PATH`` was added." msgstr "" -#: library/socket.rst:580 +#: library/socket.rst:593 msgid "" "TIPC related constants, matching the ones exported by the C socket API. See " "the TIPC documentation for more information." msgstr "" -#: library/socket.rst:587 +#: library/socket.rst:600 msgid "Constants for Linux Kernel cryptography." msgstr "" -#: library/socket.rst:599 +#: library/socket.rst:612 msgid "Constants for Linux host/guest communication." msgstr "" -#: library/socket.rst:613 +#: library/socket.rst:626 msgid "" "This constant contains a boolean value which indicates if IPv6 is supported " "on this platform." msgstr "" -#: library/socket.rst:619 +#: library/socket.rst:632 msgid "" "These are string constants containing Bluetooth addresses with special " "meanings. For example, :const:`BDADDR_ANY` can be used to indicate any " "address when specifying the binding socket with :const:`BTPROTO_RFCOMM`." msgstr "" -#: library/socket.rst:628 +#: library/socket.rst:641 msgid "" -"For use with :const:`BTPROTO_HCI`. :const:`HCI_FILTER` is not available for " -"NetBSD or DragonFlyBSD. :const:`HCI_TIME_STAMP` and :const:`HCI_DATA_DIR` " -"are not available for FreeBSD, NetBSD, or DragonFlyBSD." +"For use with :const:`BTPROTO_HCI`. :const:`!HCI_FILTER` is only available on " +"Linux and FreeBSD. :const:`!HCI_TIME_STAMP` and :const:`!HCI_DATA_DIR` are " +"only available on Linux." msgstr "" -#: library/socket.rst:635 +#: library/socket.rst:647 msgid "" "Constant for Qualcomm's IPC router protocol, used to communicate with " "service providing remote processors." msgstr "" -#: library/socket.rst:644 +#: library/socket.rst:656 msgid "" "LOCAL_CREDS and LOCAL_CREDS_PERSISTENT can be used with SOCK_DGRAM, " "SOCK_STREAM sockets, equivalent to Linux/DragonFlyBSD SO_PASSCRED, while " @@ -759,42 +781,42 @@ msgid "" "message type." msgstr "" -#: library/socket.rst:657 +#: library/socket.rst:669 msgid "" "Constant to optimize CPU locality, to be used in conjunction with :data:" "`SO_REUSEPORT`." msgstr "" -#: library/socket.rst:677 +#: library/socket.rst:689 msgid "Constants for Windows Hyper-V sockets for host/guest communications." msgstr "" -#: library/socket.rst:690 +#: library/socket.rst:702 msgid "" "`IEEE 802.3 protocol number `_. constants." msgstr "" -#: library/socket.rst:702 +#: library/socket.rst:714 msgid "" "These constants are used by the :meth:`~socket.socket.shutdown` method of " "socket objects." msgstr "" -#: library/socket.rst:707 +#: library/socket.rst:719 msgid "Functions" msgstr "" -#: library/socket.rst:710 +#: library/socket.rst:722 msgid "Creating sockets" msgstr "" -#: library/socket.rst:712 +#: library/socket.rst:724 msgid "" "The following functions all create :ref:`socket objects `." msgstr "" -#: library/socket.rst:717 +#: library/socket.rst:729 msgid "" "Create a new socket using the given address family, socket type and protocol " "number. The address family should be :const:`AF_INET` (the default), :const:" @@ -807,7 +829,7 @@ msgid "" "`CAN_J1939`." msgstr "" -#: library/socket.rst:727 +#: library/socket.rst:739 msgid "" "If *fileno* is specified, the values for *family*, *type*, and *proto* are " "auto-detected from the specified file descriptor. Auto-detection can be " @@ -818,61 +840,61 @@ msgid "" "This may help close a detached socket using :meth:`socket.close`." msgstr "" -#: library/socket.rst:882 library/socket.rst:1512 +#: library/socket.rst:894 library/socket.rst:1524 msgid "The newly created socket is :ref:`non-inheritable `." msgstr "" -#: library/socket.rst:738 +#: library/socket.rst:750 msgid "" "Raises an :ref:`auditing event ` ``socket.__new__`` with arguments " "``self``, ``family``, ``type``, ``protocol``." msgstr "" -#: library/socket.rst:740 +#: library/socket.rst:752 msgid "The AF_CAN family was added. The AF_RDS family was added." msgstr "" -#: library/socket.rst:744 +#: library/socket.rst:756 msgid "The CAN_BCM protocol was added." msgstr "" -#: library/socket.rst:884 +#: library/socket.rst:896 msgid "The returned socket is now non-inheritable." msgstr "" -#: library/socket.rst:750 +#: library/socket.rst:762 msgid "The CAN_ISOTP protocol was added." msgstr "" -#: library/socket.rst:753 +#: library/socket.rst:765 msgid "" "When :const:`SOCK_NONBLOCK` or :const:`SOCK_CLOEXEC` bit flags are applied " "to *type* they are cleared, and :attr:`socket.type` will not reflect them. " "They are still passed to the underlying system ``socket()`` call. Therefore," msgstr "" -#: library/socket.rst:761 +#: library/socket.rst:773 msgid "" "sock = socket.socket(\n" " socket.AF_INET,\n" " socket.SOCK_STREAM | socket.SOCK_NONBLOCK)" msgstr "" -#: library/socket.rst:765 +#: library/socket.rst:777 msgid "" "will still create a non-blocking socket on OSes that support " "``SOCK_NONBLOCK``, but ``sock.type`` will be set to ``socket.SOCK_STREAM``." msgstr "" -#: library/socket.rst:769 +#: library/socket.rst:781 msgid "The CAN_J1939 protocol was added." msgstr "" -#: library/socket.rst:772 +#: library/socket.rst:784 msgid "The IPPROTO_MPTCP protocol was added." msgstr "" -#: library/socket.rst:777 +#: library/socket.rst:789 msgid "" "Build a pair of connected socket objects using the given address family, " "socket type, and protocol number. Address family, socket type, and protocol " @@ -881,25 +903,25 @@ msgid "" "default is :const:`AF_INET`." msgstr "" -#: library/socket.rst:782 +#: library/socket.rst:794 msgid "The newly created sockets are :ref:`non-inheritable `." msgstr "" -#: library/socket.rst:784 +#: library/socket.rst:796 msgid "" "The returned socket objects now support the whole socket API, rather than a " "subset." msgstr "" -#: library/socket.rst:788 +#: library/socket.rst:800 msgid "The returned sockets are now non-inheritable." msgstr "" -#: library/socket.rst:791 +#: library/socket.rst:803 msgid "Windows support added." msgstr "" -#: library/socket.rst:797 +#: library/socket.rst:809 msgid "" "Connect to a TCP service listening on the internet *address* (a 2-tuple " "``(host, port)``), and return the socket object. This is a higher-level " @@ -910,21 +932,21 @@ msgid "" "IPv4 and IPv6." msgstr "" -#: library/socket.rst:805 +#: library/socket.rst:817 msgid "" "Passing the optional *timeout* parameter will set the timeout on the socket " "instance before attempting to connect. If no *timeout* is supplied, the " "global default timeout setting returned by :func:`getdefaulttimeout` is used." msgstr "" -#: library/socket.rst:810 +#: library/socket.rst:822 msgid "" "If supplied, *source_address* must be a 2-tuple ``(host, port)`` for the " "socket to bind to as its source address before connecting. If host or port " "are '' or 0 respectively the OS default behavior will be used." msgstr "" -#: library/socket.rst:814 +#: library/socket.rst:826 msgid "" "When a connection cannot be created, an exception is raised. By default, it " "is the exception from the last address in the list. If *all_errors* is " @@ -932,21 +954,21 @@ msgid "" "attempts." msgstr "" -#: library/socket.rst:819 +#: library/socket.rst:831 msgid "*source_address* was added." msgstr "" -#: library/socket.rst:822 +#: library/socket.rst:834 msgid "*all_errors* was added." msgstr "" -#: library/socket.rst:828 +#: library/socket.rst:840 msgid "" "Convenience function which creates a TCP socket bound to *address* (a 2-" "tuple ``(host, port)``) and returns the socket object." msgstr "" -#: library/socket.rst:831 +#: library/socket.rst:843 msgid "" "*family* should be either :data:`AF_INET` or :data:`AF_INET6`. *backlog* is " "the queue size passed to :meth:`socket.listen`; if not specified , a default " @@ -954,7 +976,7 @@ msgid "" "`SO_REUSEPORT` socket option." msgstr "" -#: library/socket.rst:836 +#: library/socket.rst:848 msgid "" "If *dualstack_ipv6* is true, *family* is :data:`AF_INET6` and the platform " "supports it the socket will be able to accept both IPv4 and IPv6 " @@ -967,7 +989,7 @@ msgid "" "parameter can be used in conjunction with :func:`has_dualstack_ipv6`:" msgstr "" -#: library/socket.rst:849 +#: library/socket.rst:861 msgid "" "import socket\n" "\n" @@ -979,20 +1001,20 @@ msgid "" " s = socket.create_server(addr)" msgstr "" -#: library/socket.rst:858 +#: library/socket.rst:870 msgid "" "On POSIX platforms the :data:`SO_REUSEADDR` socket option is set in order to " "immediately reuse previous sockets which were bound on the same *address* " "and remained in TIME_WAIT state." msgstr "" -#: library/socket.rst:866 +#: library/socket.rst:878 msgid "" "Return ``True`` if the platform supports creating a TCP socket which can " "handle both IPv4 and IPv6 connections." msgstr "" -#: library/socket.rst:873 +#: library/socket.rst:885 msgid "" "Duplicate the file descriptor *fd* (an integer as returned by a file " "object's :meth:`~io.IOBase.fileno` method) and build a socket object from " @@ -1005,39 +1027,39 @@ msgid "" "daemon). The socket is assumed to be in blocking mode." msgstr "" -#: library/socket.rst:890 +#: library/socket.rst:902 msgid "" "Instantiate a socket from data obtained from the :meth:`socket.share` " "method. The socket is assumed to be in blocking mode." msgstr "" -#: library/socket.rst:900 +#: library/socket.rst:912 msgid "" "This is a Python type object that represents the socket object type. It is " "the same as ``type(socket(...))``." msgstr "" -#: library/socket.rst:905 +#: library/socket.rst:917 msgid "Other functions" msgstr "" -#: library/socket.rst:907 +#: library/socket.rst:919 msgid "The :mod:`socket` module also offers various network-related services:" msgstr "" -#: library/socket.rst:912 +#: library/socket.rst:924 msgid "" "Close a socket file descriptor. This is like :func:`os.close`, but for " "sockets. On some platforms (most noticeable Windows) :func:`os.close` does " "not work for socket file descriptors." msgstr "" -#: library/socket.rst:920 +#: library/socket.rst:932 msgid "" "This function wraps the C function ``getaddrinfo`` of the underlying system." msgstr "" -#: library/socket.rst:922 +#: library/socket.rst:934 msgid "" "Translate the *host*/*port* argument into a sequence of 5-tuples that " "contain all the necessary arguments for creating a socket connected to that " @@ -1047,7 +1069,7 @@ msgid "" "and *port*, you can pass ``NULL`` to the underlying C API." msgstr "" -#: library/socket.rst:929 +#: library/socket.rst:941 msgid "" "The *family*, *type* and *proto* arguments can be optionally specified in " "order to provide options and limit the list of addresses returned. Pass " @@ -1055,7 +1077,7 @@ msgid "" "limit the results. See the note below for details." msgstr "" -#: library/socket.rst:934 +#: library/socket.rst:946 msgid "" "The *flags* argument can be one or several of the ``AI_*`` constants, and " "will influence how results are computed and returned. For example, :const:" @@ -1063,15 +1085,15 @@ msgid "" "if *host* is a domain name." msgstr "" -#: library/socket.rst:939 +#: library/socket.rst:951 msgid "The function returns a list of 5-tuples with the following structure:" msgstr "" -#: library/socket.rst:941 +#: library/socket.rst:953 msgid "``(family, type, proto, canonname, sockaddr)``" msgstr "" -#: library/socket.rst:943 +#: library/socket.rst:955 msgid "" "In these tuples, *family*, *type*, *proto* are all integers and are meant to " "be passed to the :func:`~socket.socket` function. *canonname* will be a " @@ -1083,7 +1105,7 @@ msgid "" "`AF_INET6`), and is meant to be passed to the :meth:`socket.connect` method." msgstr "" -#: library/socket.rst:955 +#: library/socket.rst:967 msgid "" "If you intend to use results from :func:`!getaddrinfo` to create a socket " "(rather than, for example, retrieve *canonname*), consider limiting the " @@ -1092,13 +1114,13 @@ msgid "" "application can handle." msgstr "" -#: library/socket.rst:961 +#: library/socket.rst:973 msgid "" "The behavior with default values of *family*, *type*, *proto* and *flags* is " "system-specific." msgstr "" -#: library/socket.rst:964 +#: library/socket.rst:976 msgid "" "Many systems (for example, most Linux configurations) will return a sorted " "list of all matching addresses. These addresses should generally be tried in " @@ -1108,27 +1130,27 @@ msgid "" "attempts." msgstr "" -#: library/socket.rst:971 +#: library/socket.rst:983 msgid "" "Some systems will, however, only return a single address. (For example, this " "was reported on Solaris and AIX configurations.) On these systems, limiting " "the *type* and/or *proto* helps ensure that this address is usable." msgstr "" -#: library/socket.rst:976 +#: library/socket.rst:988 msgid "" "Raises an :ref:`auditing event ` ``socket.getaddrinfo`` with " "arguments ``host``, ``port``, ``family``, ``type``, ``protocol``." msgstr "" -#: library/socket.rst:978 +#: library/socket.rst:990 msgid "" "The following example fetches address information for a hypothetical TCP " "connection to ``example.org`` on port 80 (results may differ on your system " "if IPv6 isn't enabled)::" msgstr "" -#: library/socket.rst:982 +#: library/socket.rst:994 msgid "" ">>> socket.getaddrinfo(\"example.org\", 80, proto=socket.IPPROTO_TCP)\n" "[(socket.AF_INET6, socket.SOCK_STREAM,\n" @@ -1137,17 +1159,17 @@ msgid "" " 6, '', ('93.184.216.34', 80))]" msgstr "" -#: library/socket.rst:988 +#: library/socket.rst:1000 msgid "parameters can now be passed using keyword arguments." msgstr "" -#: library/socket.rst:991 +#: library/socket.rst:1003 msgid "" "for IPv6 multicast addresses, string representing an address will not " "contain ``%scope_id`` part." msgstr "" -#: library/socket.rst:999 +#: library/socket.rst:1011 msgid "" "Return a fully qualified domain name for *name*. If *name* is omitted or " "empty, it is interpreted as the local host. To find the fully qualified " @@ -1158,7 +1180,7 @@ msgid "" "``'0.0.0.0'``, the hostname from :func:`gethostname` is returned." msgstr "" -#: library/socket.rst:1010 +#: library/socket.rst:1022 msgid "" "Translate a host name to IPv4 address format. The IPv4 address is returned " "as a string, such as ``'100.50.200.5'``. If the host name is an IPv4 " @@ -1168,13 +1190,13 @@ msgid "" "stack support." msgstr "" -#: library/socket.rst:1032 +#: library/socket.rst:1044 msgid "" "Raises an :ref:`auditing event ` ``socket.gethostbyname`` with " "argument ``hostname``." msgstr "" -#: library/socket.rst:1023 +#: library/socket.rst:1035 msgid "" "Translate a host name to IPv4 address format, extended interface. Return a 3-" "tuple ``(hostname, aliaslist, ipaddrlist)`` where *hostname* is the host's " @@ -1186,25 +1208,25 @@ msgid "" "stack support." msgstr "" -#: library/socket.rst:1039 +#: library/socket.rst:1051 msgid "" "Return a string containing the hostname of the machine where the Python " "interpreter is currently executing." msgstr "" -#: library/socket.rst:1042 +#: library/socket.rst:1054 msgid "" "Raises an :ref:`auditing event ` ``socket.gethostname`` with no " "arguments." msgstr "" -#: library/socket.rst:1044 +#: library/socket.rst:1056 msgid "" "Note: :func:`gethostname` doesn't always return the fully qualified domain " "name; use :func:`getfqdn` for that." msgstr "" -#: library/socket.rst:1052 +#: library/socket.rst:1064 msgid "" "Return a 3-tuple ``(hostname, aliaslist, ipaddrlist)`` where *hostname* is " "the primary host name responding to the given *ip_address*, *aliaslist* is a " @@ -1215,13 +1237,13 @@ msgid "" "`gethostbyaddr` supports both IPv4 and IPv6." msgstr "" -#: library/socket.rst:1060 +#: library/socket.rst:1072 msgid "" "Raises an :ref:`auditing event ` ``socket.gethostbyaddr`` with " "argument ``ip_address``." msgstr "" -#: library/socket.rst:1067 +#: library/socket.rst:1079 msgid "" "Translate a socket address *sockaddr* into a 2-tuple ``(host, port)``. " "Depending on the settings of *flags*, the result can contain a fully " @@ -1229,24 +1251,24 @@ msgid "" "Similarly, *port* can contain a string port name or a numeric port number." msgstr "" -#: library/socket.rst:1072 +#: library/socket.rst:1084 msgid "" "For IPv6 addresses, ``%scope_id`` is appended to the host part if *sockaddr* " "contains meaningful *scope_id*. Usually this happens for multicast addresses." msgstr "" -#: library/socket.rst:1075 +#: library/socket.rst:1087 msgid "" "For more information about *flags* you can consult :manpage:`getnameinfo(3)`." msgstr "" -#: library/socket.rst:1077 +#: library/socket.rst:1089 msgid "" "Raises an :ref:`auditing event ` ``socket.getnameinfo`` with " "argument ``sockaddr``." msgstr "" -#: library/socket.rst:1084 +#: library/socket.rst:1096 msgid "" "Translate an internet protocol name (for example, ``'icmp'``) to a constant " "suitable for passing as the (optional) third argument to the :func:`~socket." @@ -1255,66 +1277,66 @@ msgid "" "is chosen automatically if the protocol is omitted or zero." msgstr "" -#: library/socket.rst:1095 +#: library/socket.rst:1107 msgid "" "Translate an internet service name and protocol name to a port number for " "that service. The optional protocol name, if given, should be ``'tcp'`` or " "``'udp'``, otherwise any protocol will match." msgstr "" -#: library/socket.rst:1099 +#: library/socket.rst:1111 msgid "" "Raises an :ref:`auditing event ` ``socket.getservbyname`` with " "arguments ``servicename``, ``protocolname``." msgstr "" -#: library/socket.rst:1106 +#: library/socket.rst:1118 msgid "" "Translate an internet port number and protocol name to a service name for " "that service. The optional protocol name, if given, should be ``'tcp'`` or " "``'udp'``, otherwise any protocol will match." msgstr "" -#: library/socket.rst:1110 +#: library/socket.rst:1122 msgid "" "Raises an :ref:`auditing event ` ``socket.getservbyport`` with " "arguments ``port``, ``protocolname``." msgstr "" -#: library/socket.rst:1117 +#: library/socket.rst:1129 msgid "" "Convert 32-bit positive integers from network to host byte order. On " "machines where the host byte order is the same as network byte order, this " "is a no-op; otherwise, it performs a 4-byte swap operation." msgstr "" -#: library/socket.rst:1124 +#: library/socket.rst:1136 msgid "" "Convert 16-bit positive integers from network to host byte order. On " "machines where the host byte order is the same as network byte order, this " "is a no-op; otherwise, it performs a 2-byte swap operation." msgstr "" -#: library/socket.rst:1146 +#: library/socket.rst:1158 msgid "" "Raises :exc:`OverflowError` if *x* does not fit in a 16-bit unsigned integer." msgstr "" -#: library/socket.rst:1135 +#: library/socket.rst:1147 msgid "" "Convert 32-bit positive integers from host to network byte order. On " "machines where the host byte order is the same as network byte order, this " "is a no-op; otherwise, it performs a 4-byte swap operation." msgstr "" -#: library/socket.rst:1142 +#: library/socket.rst:1154 msgid "" "Convert 16-bit positive integers from host to network byte order. On " "machines where the host byte order is the same as network byte order, this " "is a no-op; otherwise, it performs a 2-byte swap operation." msgstr "" -#: library/socket.rst:1153 +#: library/socket.rst:1165 msgid "" "Convert an IPv4 address from dotted-quad string format (for example, " "'123.45.67.89') to 32-bit packed binary format, as a bytes object four " @@ -1323,26 +1345,26 @@ msgid "" "which is the C type for the 32-bit packed binary this function returns." msgstr "" -#: library/socket.rst:1159 +#: library/socket.rst:1171 msgid "" ":func:`inet_aton` also accepts strings with less than three dots; see the " "Unix manual page :manpage:`inet(3)` for details." msgstr "" -#: library/socket.rst:1162 +#: library/socket.rst:1174 msgid "" "If the IPv4 address string passed to this function is invalid, :exc:" "`OSError` will be raised. Note that exactly what is valid depends on the " "underlying C implementation of :c:func:`inet_aton`." msgstr "" -#: library/socket.rst:1166 +#: library/socket.rst:1178 msgid "" ":func:`inet_aton` does not support IPv6, and :func:`inet_pton` should be " "used instead for IPv4/v6 dual stack support." msgstr "" -#: library/socket.rst:1172 +#: library/socket.rst:1184 msgid "" "Convert a 32-bit packed IPv4 address (a :term:`bytes-like object` four bytes " "in length) to its standard dotted-quad string representation (for example, " @@ -1352,7 +1374,7 @@ msgid "" "argument." msgstr "" -#: library/socket.rst:1179 +#: library/socket.rst:1191 msgid "" "If the byte sequence passed to this function is not exactly 4 bytes in " "length, :exc:`OSError` will be raised. :func:`inet_ntoa` does not support " @@ -1360,7 +1382,7 @@ msgid "" "support." msgstr "" -#: library/socket.rst:1190 +#: library/socket.rst:1202 msgid "" "Convert an IP address from its family-specific string format to a packed, " "binary format. :func:`inet_pton` is useful when a library or network " @@ -1368,7 +1390,7 @@ msgid "" "`inet_aton`) or :c:struct:`in6_addr`." msgstr "" -#: library/socket.rst:1195 +#: library/socket.rst:1207 msgid "" "Supported values for *address_family* are currently :const:`AF_INET` and :" "const:`AF_INET6`. If the IP address string *ip_string* is invalid, :exc:" @@ -1377,11 +1399,11 @@ msgid "" "`inet_pton`." msgstr "" -#: library/socket.rst:1223 +#: library/socket.rst:1235 msgid "Windows support added" msgstr "" -#: library/socket.rst:1209 +#: library/socket.rst:1221 msgid "" "Convert a packed IP address (a :term:`bytes-like object` of some number of " "bytes) to its standard, family-specific string representation (for example, " @@ -1390,7 +1412,7 @@ msgid "" "(similar to :func:`inet_ntoa`) or :c:struct:`in6_addr`." msgstr "" -#: library/socket.rst:1216 +#: library/socket.rst:1228 msgid "" "Supported values for *address_family* are currently :const:`AF_INET` and :" "const:`AF_INET6`. If the bytes object *packed_ip* is not the correct length " @@ -1398,7 +1420,7 @@ msgid "" "`OSError` is raised for errors from the call to :func:`inet_ntop`." msgstr "" -#: library/socket.rst:1238 +#: library/socket.rst:1250 msgid "" "Return the total length, without trailing padding, of an ancillary data item " "with associated data of the given *length*. This value can often be used as " @@ -1409,11 +1431,11 @@ msgid "" "the permissible range of values." msgstr "" -#: library/socket.rst:1736 library/socket.rst:1888 +#: library/socket.rst:1748 library/socket.rst:1900 msgid "Most Unix platforms." msgstr "" -#: library/socket.rst:1256 +#: library/socket.rst:1268 msgid "" "Return the buffer size needed for :meth:`~socket.recvmsg` to receive an " "ancillary data item with associated data of the given *length*, along with " @@ -1423,7 +1445,7 @@ msgid "" "values." msgstr "" -#: library/socket.rst:1264 +#: library/socket.rst:1276 msgid "" "Note that some systems might support ancillary data without providing this " "function. Also note that setting the buffer size using the results of this " @@ -1431,131 +1453,131 @@ msgid "" "received, since additional data may be able to fit into the padding area." msgstr "" -#: library/socket.rst:1272 +#: library/socket.rst:1284 msgid "most Unix platforms." msgstr "" -#: library/socket.rst:1279 +#: library/socket.rst:1291 msgid "" "Return the default timeout in seconds (float) for new socket objects. A " "value of ``None`` indicates that new socket objects have no timeout. When " "the socket module is first imported, the default is ``None``." msgstr "" -#: library/socket.rst:1286 +#: library/socket.rst:1298 msgid "" "Set the default timeout in seconds (float) for new socket objects. When the " "socket module is first imported, the default is ``None``. See :meth:" "`~socket.settimeout` for possible values and their respective meanings." msgstr "" -#: library/socket.rst:1294 +#: library/socket.rst:1306 msgid "" "Set the machine's hostname to *name*. This will raise an :exc:`OSError` if " "you don't have enough rights." msgstr "" -#: library/socket.rst:1297 +#: library/socket.rst:1309 msgid "" "Raises an :ref:`auditing event ` ``socket.sethostname`` with " "argument ``name``." msgstr "" -#: library/socket.rst:1306 +#: library/socket.rst:1318 msgid "" "Return a list of network interface information (index int, name string) " "tuples. :exc:`OSError` if the system call fails." msgstr "" -#: library/socket.rst:1341 library/socket.rst:1358 +#: library/socket.rst:1353 library/socket.rst:1370 msgid "Windows support was added." msgstr "" -#: library/socket.rst:1319 +#: library/socket.rst:1331 msgid "" "On Windows network interfaces have different names in different contexts " "(all names are examples):" msgstr "" -#: library/socket.rst:1322 +#: library/socket.rst:1334 msgid "UUID: ``{FB605B73-AAC2-49A6-9A2F-25416AEA0573}``" msgstr "" -#: library/socket.rst:1323 +#: library/socket.rst:1335 msgid "name: ``ethernet_32770``" msgstr "" -#: library/socket.rst:1324 +#: library/socket.rst:1336 msgid "friendly name: ``vEthernet (nat)``" msgstr "" -#: library/socket.rst:1325 +#: library/socket.rst:1337 msgid "description: ``Hyper-V Virtual Ethernet Adapter``" msgstr "" -#: library/socket.rst:1327 +#: library/socket.rst:1339 msgid "" "This function returns names of the second form from the list, " "``ethernet_32770`` in this example case." msgstr "" -#: library/socket.rst:1333 +#: library/socket.rst:1345 msgid "" "Return a network interface index number corresponding to an interface name. :" "exc:`OSError` if no interface with the given name exists." msgstr "" -#: library/socket.rst:1362 +#: library/socket.rst:1374 msgid "\"Interface name\" is a name as documented in :func:`if_nameindex`." msgstr "" -#: library/socket.rst:1350 +#: library/socket.rst:1362 msgid "" "Return a network interface name corresponding to an interface index number. :" "exc:`OSError` if no interface with the given index exists." msgstr "" -#: library/socket.rst:1367 +#: library/socket.rst:1379 msgid "" "Send the list of file descriptors *fds* over an :const:`AF_UNIX` socket " "*sock*. The *fds* parameter is a sequence of file descriptors. Consult :meth:" "`~socket.sendmsg` for the documentation of these parameters." msgstr "" -#: library/socket.rst:1387 +#: library/socket.rst:1399 msgid "" "Unix platforms supporting :meth:`~socket.sendmsg` and :const:`SCM_RIGHTS` " "mechanism." msgstr "" -#: library/socket.rst:1381 +#: library/socket.rst:1393 msgid "" "Receive up to *maxfds* file descriptors from an :const:`AF_UNIX` socket " "*sock*. Return ``(msg, list(fds), flags, addr)``. Consult :meth:`~socket." "recvmsg` for the documentation of these parameters." msgstr "" -#: library/socket.rst:1394 +#: library/socket.rst:1406 msgid "Any truncated integers at the end of the list of file descriptors." msgstr "" -#: library/socket.rst:1400 +#: library/socket.rst:1412 msgid "Socket Objects" msgstr "" -#: library/socket.rst:1402 +#: library/socket.rst:1414 msgid "" "Socket objects have the following methods. Except for :meth:`~socket." "makefile`, these correspond to Unix system calls applicable to sockets." msgstr "" -#: library/socket.rst:1406 +#: library/socket.rst:1418 msgid "" "Support for the :term:`context manager` protocol was added. Exiting the " "context manager is equivalent to calling :meth:`~socket.close`." msgstr "" -#: library/socket.rst:1413 +#: library/socket.rst:1425 msgid "" "Accept a connection. The socket must be bound to an address and listening " "for connections. The return value is a pair ``(conn, address)`` where *conn* " @@ -1564,31 +1586,31 @@ msgid "" "connection." msgstr "" -#: library/socket.rst:1514 +#: library/socket.rst:1526 msgid "The socket is now non-inheritable." msgstr "" -#: library/socket.rst:1649 library/socket.rst:1740 library/socket.rst:1832 -#: library/socket.rst:1894 +#: library/socket.rst:1661 library/socket.rst:1752 library/socket.rst:1844 +#: library/socket.rst:1906 msgid "" "If the system call is interrupted and the signal handler does not raise an " "exception, the method now retries the system call instead of raising an :exc:" "`InterruptedError` exception (see :pep:`475` for the rationale)." msgstr "" -#: library/socket.rst:1431 +#: library/socket.rst:1443 msgid "" "Bind the socket to *address*. The socket must not already be bound. (The " "format of *address* depends on the address family --- see above.)" msgstr "" -#: library/socket.rst:1434 +#: library/socket.rst:1446 msgid "" "Raises an :ref:`auditing event ` ``socket.bind`` with arguments " "``self``, ``address``." msgstr "" -#: library/socket.rst:1441 +#: library/socket.rst:1453 msgid "" "Mark the socket closed. The underlying system resource (e.g. a file " "descriptor) is also closed when all file objects from :meth:`makefile` are " @@ -1597,33 +1619,33 @@ msgid "" "flushed)." msgstr "" -#: library/socket.rst:1447 +#: library/socket.rst:1459 msgid "" "Sockets are automatically closed when they are garbage-collected, but it is " "recommended to :meth:`close` them explicitly, or to use a :keyword:`with` " "statement around them." msgstr "" -#: library/socket.rst:1451 +#: library/socket.rst:1463 msgid "" ":exc:`OSError` is now raised if an error occurs when the underlying :c:func:" "`close` call is made." msgstr "" -#: library/socket.rst:1457 +#: library/socket.rst:1469 msgid "" ":meth:`close` releases the resource associated with a connection but does " "not necessarily close the connection immediately. If you want to close the " "connection in a timely fashion, call :meth:`shutdown` before :meth:`close`." msgstr "" -#: library/socket.rst:1465 +#: library/socket.rst:1477 msgid "" "Connect to a remote socket at *address*. (The format of *address* depends on " "the address family --- see above.)" msgstr "" -#: library/socket.rst:1468 +#: library/socket.rst:1480 msgid "" "If the connection is interrupted by a signal, the method waits until the " "connection completes, or raise a :exc:`TimeoutError` on timeout, if the " @@ -1633,13 +1655,13 @@ msgid "" "(or the exception raised by the signal handler)." msgstr "" -#: library/socket.rst:1495 +#: library/socket.rst:1507 msgid "" "Raises an :ref:`auditing event ` ``socket.connect`` with arguments " "``self``, ``address``." msgstr "" -#: library/socket.rst:1477 +#: library/socket.rst:1489 msgid "" "The method now waits until the connection completes instead of raising an :" "exc:`InterruptedError` exception if the connection is interrupted by a " @@ -1647,7 +1669,7 @@ msgid "" "blocking or has a timeout (see the :pep:`475` for the rationale)." msgstr "" -#: library/socket.rst:1488 +#: library/socket.rst:1500 msgid "" "Like ``connect(address)``, but return an error indicator instead of raising " "an exception for errors returned by the C-level :c:func:`connect` call " @@ -1657,38 +1679,38 @@ msgid "" "asynchronous connects." msgstr "" -#: library/socket.rst:1501 +#: library/socket.rst:1513 msgid "" "Put the socket object into closed state without actually closing the " "underlying file descriptor. The file descriptor is returned, and can be " "reused for other purposes." msgstr "" -#: library/socket.rst:1510 +#: library/socket.rst:1522 msgid "Duplicate the socket." msgstr "" -#: library/socket.rst:1522 +#: library/socket.rst:1534 msgid "" "Return the socket's file descriptor (a small integer), or -1 on failure. " "This is useful with :func:`select.select`." msgstr "" -#: library/socket.rst:1525 +#: library/socket.rst:1537 msgid "" "Under Windows the small integer returned by this method cannot be used where " "a file descriptor can be used (such as :func:`os.fdopen`). Unix does not " "have this limitation." msgstr "" -#: library/socket.rst:1531 +#: library/socket.rst:1543 msgid "" "Get the :ref:`inheritable flag ` of the socket's file " "descriptor or socket's handle: ``True`` if the socket can be inherited in " "child processes, ``False`` if it cannot." msgstr "" -#: library/socket.rst:1540 +#: library/socket.rst:1552 msgid "" "Return the remote address to which the socket is connected. This is useful " "to find out the port number of a remote IPv4/v6 socket, for instance. (The " @@ -1696,14 +1718,14 @@ msgid "" "above.) On some systems this function is not supported." msgstr "" -#: library/socket.rst:1548 +#: library/socket.rst:1560 msgid "" "Return the socket's own address. This is useful to find out the port number " "of an IPv4/v6 socket, for instance. (The format of the address returned " "depends on the address family --- see above.)" msgstr "" -#: library/socket.rst:1555 +#: library/socket.rst:1567 msgid "" "Return the value of the given socket option (see the Unix man page :manpage:" "`getsockopt(2)`). The needed symbolic constants (:ref:`SO_\\* etc. `_ for more information." msgstr "" -#: library/socket.rst:1593 +#: library/socket.rst:1605 msgid "" "On other platforms, the generic :func:`fcntl.fcntl` and :func:`fcntl.ioctl` " "functions may be used; they accept a socket object as their first argument." msgstr "" -#: library/socket.rst:1596 +#: library/socket.rst:1608 msgid "" "Currently only the following control codes are supported: ``SIO_RCVALL``, " "``SIO_KEEPALIVE_VALS``, and ``SIO_LOOPBACK_FAST_PATH``." msgstr "" -#: library/socket.rst:1604 +#: library/socket.rst:1616 msgid "" "Enable a server to accept connections. If *backlog* is specified, it must " "be at least 0 (if it is lower, it is set to 0); it specifies the number of " @@ -1767,11 +1789,11 @@ msgid "" "connections. If not specified, a default reasonable value is chosen." msgstr "" -#: library/socket.rst:1611 +#: library/socket.rst:1623 msgid "The *backlog* parameter is now optional." msgstr "" -#: library/socket.rst:1620 +#: library/socket.rst:1632 msgid "" "Return a :term:`file object` associated with the socket. The exact returned " "type depends on the arguments given to :meth:`makefile`. These arguments " @@ -1780,28 +1802,28 @@ msgid "" "``'b'``, or a combination of those." msgstr "" -#: library/socket.rst:1626 +#: library/socket.rst:1638 msgid "" "The socket must be in blocking mode; it can have a timeout, but the file " "object's internal buffer may end up in an inconsistent state if a timeout " "occurs." msgstr "" -#: library/socket.rst:1630 +#: library/socket.rst:1642 msgid "" "Closing the file object returned by :meth:`makefile` won't close the " "original socket unless all other file objects have been closed and :meth:" "`socket.close` has been called on the socket object." msgstr "" -#: library/socket.rst:1636 +#: library/socket.rst:1648 msgid "" "On Windows, the file-like object created by :meth:`makefile` cannot be used " "where a file object with a file descriptor is expected, such as the stream " "arguments of :meth:`subprocess.Popen`." msgstr "" -#: library/socket.rst:1643 +#: library/socket.rst:1655 msgid "" "Receive data from the socket. The return value is a bytes object " "representing the data received. The maximum amount of data to be received " @@ -1811,7 +1833,7 @@ msgid "" "zero." msgstr "" -#: library/socket.rst:1657 +#: library/socket.rst:1669 msgid "" "Receive data from the socket. The return value is a pair ``(bytes, " "address)`` where *bytes* is a bytes object representing the data received " @@ -1821,14 +1843,14 @@ msgid "" "address family --- see above.)" msgstr "" -#: library/socket.rst:1668 +#: library/socket.rst:1680 msgid "" "For multicast IPv6 address, first item of *address* does not contain " "``%scope_id`` part anymore. In order to get full IPv6 address use :func:" "`getnameinfo`." msgstr "" -#: library/socket.rst:1675 +#: library/socket.rst:1687 msgid "" "Receive normal data (up to *bufsize* bytes) and ancillary data from the " "socket. The *ancbufsize* argument sets the size in bytes of the internal " @@ -1839,7 +1861,7 @@ msgid "" "*flags* argument defaults to 0 and has the same meaning as for :meth:`recv`." msgstr "" -#: library/socket.rst:1685 +#: library/socket.rst:1697 msgid "" "The return value is a 4-tuple: ``(data, ancdata, msg_flags, address)``. The " "*data* item is a :class:`bytes` object holding the non-ancillary data " @@ -1854,7 +1876,7 @@ msgid "" "socket, if available; otherwise, its value is unspecified." msgstr "" -#: library/socket.rst:1699 +#: library/socket.rst:1711 msgid "" "On some systems, :meth:`sendmsg` and :meth:`recvmsg` can be used to pass " "file descriptors between processes over an :const:`AF_UNIX` socket. When " @@ -1867,7 +1889,7 @@ msgid "" "descriptors received via this mechanism." msgstr "" -#: library/socket.rst:1710 +#: library/socket.rst:1722 msgid "" "Some systems do not indicate the truncated length of ancillary data items " "which have been only partially received. If an item appears to extend " @@ -1876,7 +1898,7 @@ msgid "" "provided it has not been truncated before the start of its associated data." msgstr "" -#: library/socket.rst:1717 +#: library/socket.rst:1729 msgid "" "On systems which support the :const:`SCM_RIGHTS` mechanism, the following " "function will receive up to *maxfds* file descriptors, returning the message " @@ -1885,7 +1907,7 @@ msgid "" "meth:`sendmsg`. ::" msgstr "" -#: library/socket.rst:1723 +#: library/socket.rst:1735 msgid "" "import socket, array\n" "\n" @@ -1902,7 +1924,7 @@ msgid "" " return msg, list(fds)" msgstr "" -#: library/socket.rst:1748 +#: library/socket.rst:1760 msgid "" "Receive normal data and ancillary data from the socket, behaving as :meth:" "`recvmsg` would, but scatter the non-ancillary data into a series of buffers " @@ -1915,7 +1937,7 @@ msgid "" "arguments have the same meaning as for :meth:`recvmsg`." msgstr "" -#: library/socket.rst:1759 +#: library/socket.rst:1771 msgid "" "The return value is a 4-tuple: ``(nbytes, ancdata, msg_flags, address)``, " "where *nbytes* is the total number of bytes of non-ancillary data written " @@ -1923,11 +1945,11 @@ msgid "" "for :meth:`recvmsg`." msgstr "" -#: library/socket.rst:1764 +#: library/socket.rst:1776 msgid "Example::" msgstr "" -#: library/socket.rst:1766 +#: library/socket.rst:1778 msgid "" ">>> import socket\n" ">>> s1, s2 = socket.socketpair()\n" @@ -1942,7 +1964,7 @@ msgid "" "[bytearray(b'Mary'), bytearray(b'01 had a 9'), bytearray(b'little lamb---')]" msgstr "" -#: library/socket.rst:1787 +#: library/socket.rst:1799 msgid "" "Receive data from the socket, writing it into *buffer* instead of creating a " "new bytestring. The return value is a pair ``(nbytes, address)`` where " @@ -1952,7 +1974,7 @@ msgid "" "format of *address* depends on the address family --- see above.)" msgstr "" -#: library/socket.rst:1797 +#: library/socket.rst:1809 msgid "" "Receive up to *nbytes* bytes from the socket, storing the data into a buffer " "rather than creating a new bytestring. If *nbytes* is not specified (or 0), " @@ -1961,7 +1983,7 @@ msgid "" "of the optional argument *flags*; it defaults to zero." msgstr "" -#: library/socket.rst:1806 +#: library/socket.rst:1818 msgid "" "Send data to the socket. The socket must be connected to a remote socket. " "The optional *flags* argument has the same meaning as for :meth:`recv` " @@ -1971,7 +1993,7 @@ msgid "" "data. For further information on this topic, consult the :ref:`socket-howto`." msgstr "" -#: library/socket.rst:1821 +#: library/socket.rst:1833 msgid "" "Send data to the socket. The socket must be connected to a remote socket. " "The optional *flags* argument has the same meaning as for :meth:`recv` " @@ -1981,13 +2003,13 @@ msgid "" "to determine how much data, if any, was successfully sent." msgstr "" -#: library/socket.rst:1828 +#: library/socket.rst:1840 msgid "" "The socket timeout is no longer reset each time data is sent successfully. " "The socket timeout is now the maximum total duration to send all data." msgstr "" -#: library/socket.rst:1841 +#: library/socket.rst:1853 msgid "" "Send data to the socket. The socket should not be connected to a remote " "socket, since the destination socket is specified by *address*. The " @@ -1996,13 +2018,13 @@ msgid "" "address family --- see above.)" msgstr "" -#: library/socket.rst:1847 +#: library/socket.rst:1859 msgid "" "Raises an :ref:`auditing event ` ``socket.sendto`` with arguments " "``self``, ``address``." msgstr "" -#: library/socket.rst:1857 +#: library/socket.rst:1869 msgid "" "Send normal and ancillary data to the socket, gathering the non-ancillary " "data from a series of buffers and concatenating it into a single message. " @@ -2022,14 +2044,14 @@ msgid "" "bytes of non-ancillary data sent." msgstr "" -#: library/socket.rst:1877 +#: library/socket.rst:1889 msgid "" "The following function sends the list of file descriptors *fds* over an :" "const:`AF_UNIX` socket, on systems which support the :const:`SCM_RIGHTS` " "mechanism. See also :meth:`recvmsg`. ::" msgstr "" -#: library/socket.rst:1881 +#: library/socket.rst:1893 msgid "" "import socket, array\n" "\n" @@ -2038,20 +2060,20 @@ msgid "" "array(\"i\", fds))])" msgstr "" -#: library/socket.rst:1890 +#: library/socket.rst:1902 msgid "" "Raises an :ref:`auditing event ` ``socket.sendmsg`` with arguments " "``self``, ``address``." msgstr "" -#: library/socket.rst:1901 +#: library/socket.rst:1913 msgid "" "Specialized version of :meth:`~socket.sendmsg` for :const:`AF_ALG` socket. " "Set mode, IV, AEAD associated data length and flags for :const:`AF_ALG` " "socket." msgstr "" -#: library/socket.rst:1910 +#: library/socket.rst:1922 msgid "" "Send a file until EOF is reached by using high-performance :mod:`os." "sendfile` and return the total number of bytes which were sent. *file* must " @@ -2065,38 +2087,38 @@ msgid "" "be of :const:`SOCK_STREAM` type. Non-blocking sockets are not supported." msgstr "" -#: library/socket.rst:1926 +#: library/socket.rst:1938 msgid "" "Set the :ref:`inheritable flag ` of the socket's file " "descriptor or socket's handle." msgstr "" -#: library/socket.rst:1934 +#: library/socket.rst:1946 msgid "" "Set blocking or non-blocking mode of the socket: if *flag* is false, the " "socket is set to non-blocking, else to blocking mode." msgstr "" -#: library/socket.rst:1937 +#: library/socket.rst:1949 msgid "" "This method is a shorthand for certain :meth:`~socket.settimeout` calls:" msgstr "" -#: library/socket.rst:1939 +#: library/socket.rst:1951 msgid "``sock.setblocking(True)`` is equivalent to ``sock.settimeout(None)``" msgstr "" -#: library/socket.rst:1941 +#: library/socket.rst:1953 msgid "``sock.setblocking(False)`` is equivalent to ``sock.settimeout(0.0)``" msgstr "" -#: library/socket.rst:1943 +#: library/socket.rst:1955 msgid "" "The method no longer applies :const:`SOCK_NONBLOCK` flag on :attr:`socket." "type`." msgstr "" -#: library/socket.rst:1950 +#: library/socket.rst:1962 msgid "" "Set a timeout on blocking socket operations. The *value* argument can be a " "nonnegative floating-point number expressing seconds, or ``None``. If a non-" @@ -2106,19 +2128,19 @@ msgid "" "blocking mode. If ``None`` is given, the socket is put in blocking mode." msgstr "" -#: library/socket.rst:1957 +#: library/socket.rst:1969 msgid "" "For further information, please consult the :ref:`notes on socket timeouts " "`." msgstr "" -#: library/socket.rst:1959 +#: library/socket.rst:1971 msgid "" "The method no longer toggles :const:`SOCK_NONBLOCK` flag on :attr:`socket." "type`." msgstr "" -#: library/socket.rst:1972 +#: library/socket.rst:1984 msgid "" "Set the value of the given socket option (see the Unix manual page :manpage:" "`setsockopt(2)`). The needed symbolic constants are defined in this module " @@ -2131,11 +2153,11 @@ msgid "" "C function with ``optval=NULL`` and ``optlen=optlen``." msgstr "" -#: library/socket.rst:1985 +#: library/socket.rst:1997 msgid "setsockopt(level, optname, None, optlen: int) form added." msgstr "" -#: library/socket.rst:1993 +#: library/socket.rst:2005 msgid "" "Shut down one or both halves of the connection. If *how* is :const:" "`SHUT_RD`, further receives are disallowed. If *how* is :const:`SHUT_WR`, " @@ -2143,7 +2165,7 @@ msgid "" "and receives are disallowed." msgstr "" -#: library/socket.rst:2003 +#: library/socket.rst:2015 msgid "" "Duplicate a socket and prepare it for sharing with a target process. The " "target process must be provided with *process_id*. The resulting bytes " @@ -2154,48 +2176,48 @@ msgid "" "process." msgstr "" -#: library/socket.rst:2015 +#: library/socket.rst:2027 msgid "" "Note that there are no methods :meth:`read` or :meth:`write`; use :meth:" "`~socket.recv` and :meth:`~socket.send` without *flags* argument instead." msgstr "" -#: library/socket.rst:2018 +#: library/socket.rst:2030 msgid "" "Socket objects also have these (read-only) attributes that correspond to the " "values given to the :class:`~socket.socket` constructor." msgstr "" -#: library/socket.rst:2024 +#: library/socket.rst:2036 msgid "The socket family." msgstr "" -#: library/socket.rst:2029 +#: library/socket.rst:2041 msgid "The socket type." msgstr "" -#: library/socket.rst:2034 +#: library/socket.rst:2046 msgid "The socket protocol." msgstr "" -#: library/socket.rst:2041 +#: library/socket.rst:2053 msgid "Notes on socket timeouts" msgstr "" -#: library/socket.rst:2043 +#: library/socket.rst:2055 msgid "" "A socket object can be in one of three modes: blocking, non-blocking, or " "timeout. Sockets are by default always created in blocking mode, but this " "can be changed by calling :func:`setdefaulttimeout`." msgstr "" -#: library/socket.rst:2047 +#: library/socket.rst:2059 msgid "" "In *blocking mode*, operations block until complete or the system returns an " "error (such as connection timed out)." msgstr "" -#: library/socket.rst:2050 +#: library/socket.rst:2062 msgid "" "In *non-blocking mode*, operations fail (with an error that is unfortunately " "system-dependent) if they cannot be completed immediately: functions from " @@ -2203,14 +2225,14 @@ msgid "" "available for reading or writing." msgstr "" -#: library/socket.rst:2055 +#: library/socket.rst:2067 msgid "" "In *timeout mode*, operations fail if they cannot be completed within the " "timeout specified for the socket (they raise a :exc:`timeout` exception) or " "if the system returns an error." msgstr "" -#: library/socket.rst:2060 +#: library/socket.rst:2072 msgid "" "At the operating system level, sockets in *timeout mode* are internally set " "in non-blocking mode. Also, the blocking and timeout modes are shared " @@ -2219,11 +2241,11 @@ msgid "" "you decide to use the :meth:`~socket.fileno` of a socket." msgstr "" -#: library/socket.rst:2067 +#: library/socket.rst:2079 msgid "Timeouts and the ``connect`` method" msgstr "" -#: library/socket.rst:2069 +#: library/socket.rst:2081 msgid "" "The :meth:`~socket.connect` operation is also subject to the timeout " "setting, and in general it is recommended to call :meth:`~socket.settimeout` " @@ -2233,24 +2255,24 @@ msgid "" "setting." msgstr "" -#: library/socket.rst:2077 +#: library/socket.rst:2089 msgid "Timeouts and the ``accept`` method" msgstr "" -#: library/socket.rst:2079 +#: library/socket.rst:2091 msgid "" "If :func:`getdefaulttimeout` is not :const:`None`, sockets returned by the :" "meth:`~socket.accept` method inherit that timeout. Otherwise, the behaviour " "depends on settings of the listening socket:" msgstr "" -#: library/socket.rst:2083 +#: library/socket.rst:2095 msgid "" "if the listening socket is in *blocking mode* or in *timeout mode*, the " "socket returned by :meth:`~socket.accept` is in *blocking mode*;" msgstr "" -#: library/socket.rst:2086 +#: library/socket.rst:2098 msgid "" "if the listening socket is in *non-blocking mode*, whether the socket " "returned by :meth:`~socket.accept` is in blocking or non-blocking mode is " @@ -2258,11 +2280,11 @@ msgid "" "it is recommended you manually override this setting." msgstr "" -#: library/socket.rst:2095 +#: library/socket.rst:2107 msgid "Example" msgstr "" -#: library/socket.rst:2097 +#: library/socket.rst:2109 msgid "" "Here are four minimal example programs using the TCP/IP protocol: a server " "that echoes all data that it receives back (servicing only one client), and " @@ -2275,11 +2297,11 @@ msgid "" "on the new socket returned by :meth:`~socket.accept`." msgstr "" -#: library/socket.rst:2107 +#: library/socket.rst:2119 msgid "The first two examples support IPv4 only. ::" msgstr "" -#: library/socket.rst:2109 +#: library/socket.rst:2121 msgid "" "# Echo server program\n" "import socket\n" @@ -2298,7 +2320,7 @@ msgid "" " conn.sendall(data)" msgstr "" -#: library/socket.rst:2127 +#: library/socket.rst:2139 msgid "" "# Echo client program\n" "import socket\n" @@ -2312,7 +2334,7 @@ msgid "" "print('Received', repr(data))" msgstr "" -#: library/socket.rst:2138 +#: library/socket.rst:2150 msgid "" "The next two examples are identical to the above two, but support both IPv4 " "and IPv6. The server side will listen to the first address family available " @@ -2322,7 +2344,7 @@ msgid "" "resolution, and sends traffic to the first one connected successfully. ::" msgstr "" -#: library/socket.rst:2145 +#: library/socket.rst:2157 msgid "" "# Echo server program\n" "import socket\n" @@ -2359,7 +2381,7 @@ msgid "" " conn.send(data)" msgstr "" -#: library/socket.rst:2181 +#: library/socket.rst:2193 msgid "" "# Echo client program\n" "import socket\n" @@ -2392,14 +2414,14 @@ msgid "" "print('Received', repr(data))" msgstr "" -#: library/socket.rst:2210 +#: library/socket.rst:2222 msgid "" "The next example shows how to write a very simple network sniffer with raw " "sockets on Windows. The example requires administrator privileges to modify " "the interface::" msgstr "" -#: library/socket.rst:2214 +#: library/socket.rst:2226 msgid "" "import socket\n" "\n" @@ -2423,29 +2445,29 @@ msgid "" "s.ioctl(socket.SIO_RCVALL, socket.RCVALL_OFF)" msgstr "" -#: library/socket.rst:2235 +#: library/socket.rst:2247 msgid "" "The next example shows how to use the socket interface to communicate to a " "CAN network using the raw socket protocol. To use CAN with the broadcast " "manager protocol instead, open a socket with::" msgstr "" -#: library/socket.rst:2239 +#: library/socket.rst:2251 msgid "socket.socket(socket.AF_CAN, socket.SOCK_DGRAM, socket.CAN_BCM)" msgstr "" -#: library/socket.rst:2241 +#: library/socket.rst:2253 msgid "" "After binding (:const:`CAN_RAW`) or connecting (:const:`CAN_BCM`) the " "socket, you can use the :meth:`socket.send` and :meth:`socket.recv` " "operations (and their counterparts) on the socket object as usual." msgstr "" -#: library/socket.rst:2245 +#: library/socket.rst:2257 msgid "This last example might require special privileges::" msgstr "" -#: library/socket.rst:2247 +#: library/socket.rst:2259 msgid "" "import socket\n" "import struct\n" @@ -2487,59 +2509,59 @@ msgid "" " print('Error sending CAN frame')" msgstr "" -#: library/socket.rst:2285 +#: library/socket.rst:2297 msgid "" "Running an example several times with too small delay between executions, " "could lead to this error::" msgstr "" -#: library/socket.rst:2288 +#: library/socket.rst:2300 msgid "OSError: [Errno 98] Address already in use" msgstr "" -#: library/socket.rst:2290 +#: library/socket.rst:2302 msgid "" "This is because the previous execution has left the socket in a " "``TIME_WAIT`` state, and can't be immediately reused." msgstr "" -#: library/socket.rst:2293 +#: library/socket.rst:2305 msgid "" "There is a :mod:`socket` flag to set, in order to prevent this, :const:" "`socket.SO_REUSEADDR`::" msgstr "" -#: library/socket.rst:2296 +#: library/socket.rst:2308 msgid "" "s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)\n" "s.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)\n" "s.bind((HOST, PORT))" msgstr "" -#: library/socket.rst:2300 +#: library/socket.rst:2312 msgid "" "the :data:`SO_REUSEADDR` flag tells the kernel to reuse a local socket in " "``TIME_WAIT`` state, without waiting for its natural timeout to expire." msgstr "" -#: library/socket.rst:2306 +#: library/socket.rst:2318 msgid "" "For an introduction to socket programming (in C), see the following papers:" msgstr "" -#: library/socket.rst:2308 +#: library/socket.rst:2320 msgid "" "*An Introductory 4.3BSD Interprocess Communication Tutorial*, by Stuart " "Sechrest" msgstr "" -#: library/socket.rst:2310 +#: library/socket.rst:2322 msgid "" "*An Advanced 4.3BSD Interprocess Communication Tutorial*, by Samuel J. " "Leffler et al," msgstr "" -#: library/socket.rst:2313 +#: library/socket.rst:2325 msgid "" "both in the UNIX Programmer's Manual, Supplementary Documents 1 (sections " "PS1:7 and PS1:8). The platform-specific reference material for the various " @@ -2558,18 +2580,18 @@ msgstr "" msgid "socket" msgstr "" -#: library/socket.rst:1618 +#: library/socket.rst:1630 msgid "I/O control" msgstr "" -#: library/socket.rst:1618 +#: library/socket.rst:1630 msgid "buffering" msgstr "" -#: library/socket.rst:1970 +#: library/socket.rst:1982 msgid "module" msgstr "" -#: library/socket.rst:1970 +#: library/socket.rst:1982 msgid "struct" msgstr "" diff --git a/library/socketserver.po b/library/socketserver.po index f96bc139..0ddb773e 100644 --- a/library/socketserver.po +++ b/library/socketserver.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -37,9 +37,8 @@ msgstr "" #: includes/wasm-notavail.rst:5 msgid "" -"This module does not work or is not available on WebAssembly platforms " -"``wasm32-emscripten`` and ``wasm32-wasi``. See :ref:`wasm-availability` for " -"more information." +"This module does not work or is not available on WebAssembly. See :ref:`wasm-" +"availability` for more information." msgstr "" #: library/socketserver.rst:15 diff --git a/library/spwd.po b/library/spwd.po index dd649cc5..6d5b3b81 100644 --- a/library/spwd.po +++ b/library/spwd.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -18,203 +18,24 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" #: library/spwd.rst:2 -msgid ":mod:`spwd` --- The shadow password database" +msgid ":mod:`!spwd` --- The shadow password database" msgstr "" -#: library/spwd.rst:9 +#: library/spwd.rst:10 msgid "" -"The :mod:`spwd` module is deprecated (see :pep:`PEP 594 <594#spwd>` for " -"details and alternatives)." +"This module is no longer part of the Python standard library. It was :ref:" +"`removed in Python 3.13 ` after being deprecated in " +"Python 3.11. The removal was decided in :pep:`594`." msgstr "" -#: library/spwd.rst:15 +#: library/spwd.rst:14 msgid "" -"This module provides access to the Unix shadow password database. It is " -"available on various Unix versions." +"A possible replacement is the third-party library :pypi:`python-pam`. This " +"library is not supported or maintained by the Python core team." msgstr "" -#: includes/wasm-notavail.rst:3 -msgid "Availability" -msgstr "" - -#: includes/wasm-notavail.rst:5 -msgid "" -"This module does not work or is not available on WebAssembly platforms " -"``wasm32-emscripten`` and ``wasm32-wasi``. See :ref:`wasm-availability` for " -"more information." -msgstr "" - -#: library/spwd.rst:20 -msgid "" -"You must have enough privileges to access the shadow password database (this " -"usually means you have to be root)." -msgstr "" - -#: library/spwd.rst:23 +#: library/spwd.rst:17 msgid "" -"Shadow password database entries are reported as a tuple-like object, whose " -"attributes correspond to the members of the ``spwd`` structure (Attribute " -"field below, see ````):" -msgstr "" - -#: library/spwd.rst:28 -msgid "Index" -msgstr "" - -#: library/spwd.rst:28 -msgid "Attribute" -msgstr "" - -#: library/spwd.rst:28 -msgid "Meaning" -msgstr "" - -#: library/spwd.rst:30 -msgid "0" -msgstr "" - -#: library/spwd.rst:30 -msgid "``sp_namp``" -msgstr "" - -#: library/spwd.rst:30 -msgid "Login name" -msgstr "" - -#: library/spwd.rst:32 -msgid "1" -msgstr "" - -#: library/spwd.rst:32 -msgid "``sp_pwdp``" -msgstr "" - -#: library/spwd.rst:32 -msgid "Encrypted password" -msgstr "" - -#: library/spwd.rst:34 -msgid "2" -msgstr "" - -#: library/spwd.rst:34 -msgid "``sp_lstchg``" -msgstr "" - -#: library/spwd.rst:34 -msgid "Date of last change" -msgstr "" - -#: library/spwd.rst:36 -msgid "3" -msgstr "" - -#: library/spwd.rst:36 -msgid "``sp_min``" -msgstr "" - -#: library/spwd.rst:36 -msgid "Minimal number of days between changes" -msgstr "" - -#: library/spwd.rst:39 -msgid "4" -msgstr "" - -#: library/spwd.rst:39 -msgid "``sp_max``" -msgstr "" - -#: library/spwd.rst:39 -msgid "Maximum number of days between changes" -msgstr "" - -#: library/spwd.rst:42 -msgid "5" -msgstr "" - -#: library/spwd.rst:42 -msgid "``sp_warn``" -msgstr "" - -#: library/spwd.rst:42 -msgid "Number of days before password expires to warn user about it" -msgstr "" - -#: library/spwd.rst:45 -msgid "6" -msgstr "" - -#: library/spwd.rst:45 -msgid "``sp_inact``" -msgstr "" - -#: library/spwd.rst:45 -msgid "Number of days after password expires until account is disabled" -msgstr "" - -#: library/spwd.rst:49 -msgid "7" -msgstr "" - -#: library/spwd.rst:49 -msgid "``sp_expire``" -msgstr "" - -#: library/spwd.rst:49 -msgid "Number of days since 1970-01-01 when account expires" -msgstr "" - -#: library/spwd.rst:52 -msgid "8" -msgstr "" - -#: library/spwd.rst:52 -msgid "``sp_flag``" -msgstr "" - -#: library/spwd.rst:52 -msgid "Reserved" -msgstr "" - -#: library/spwd.rst:55 -msgid "" -"The sp_namp and sp_pwdp items are strings, all others are integers. :exc:" -"`KeyError` is raised if the entry asked for cannot be found." -msgstr "" - -#: library/spwd.rst:58 -msgid "The following functions are defined:" -msgstr "" - -#: library/spwd.rst:63 -msgid "Return the shadow password database entry for the given user name." -msgstr "" - -#: library/spwd.rst:65 -msgid "" -"Raises a :exc:`PermissionError` instead of :exc:`KeyError` if the user " -"doesn't have privileges." -msgstr "" - -#: library/spwd.rst:71 -msgid "" -"Return a list of all available shadow password database entries, in " -"arbitrary order." -msgstr "" - -#: library/spwd.rst:77 -msgid "Module :mod:`grp`" -msgstr "" - -#: library/spwd.rst:78 -msgid "An interface to the group database, similar to this." -msgstr "" - -#: library/spwd.rst:80 -msgid "Module :mod:`pwd`" -msgstr "" - -#: library/spwd.rst:81 -msgid "An interface to the normal password database, similar to this." +"The last version of Python that provided the :mod:`!spwd` module was `Python " +"3.12 `_." msgstr "" diff --git a/library/sqlite3.po b/library/sqlite3.po index 26347f6d..bb2f4015 100644 --- a/library/sqlite3.po +++ b/library/sqlite3.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -39,7 +39,7 @@ msgstr "" msgid "" "The :mod:`!sqlite3` module was written by Gerhard Häring. It provides an " "SQL interface compliant with the DB-API 2.0 specification described by :pep:" -"`249`, and requires SQLite 3.7.15 or newer." +"`249`, and requires SQLite 3.15.2 or newer." msgstr "" #: library/sqlite3.rst:36 @@ -321,7 +321,7 @@ msgstr "" msgid ":ref:`sqlite3-converters`" msgstr "" -#: library/sqlite3.rst:612 +#: library/sqlite3.rst:618 msgid ":ref:`sqlite3-connection-context-manager`" msgstr "" @@ -457,7 +457,14 @@ msgstr "" msgid "Added the *autocommit* parameter." msgstr "" -#: library/sqlite3.rst:360 +#: library/sqlite3.rst:358 +msgid "" +"Positional use of the parameters *timeout*, *detect_types*, " +"*isolation_level*, *check_same_thread*, *factory*, *cached_statements*, and " +"*uri* is deprecated. They will become keyword-only parameters in Python 3.15." +msgstr "" + +#: library/sqlite3.rst:366 msgid "" "Return ``True`` if the string *statement* appears to contain one or more " "complete SQL statements. No syntactic verification or parsing of any kind is " @@ -465,11 +472,11 @@ msgid "" "and the statement is terminated by a semicolon." msgstr "" -#: library/sqlite3.rst:366 +#: library/sqlite3.rst:372 msgid "For example:" msgstr "" -#: library/sqlite3.rst:368 +#: library/sqlite3.rst:374 msgid "" ">>> sqlite3.complete_statement(\"SELECT foo FROM bar;\")\n" "True\n" @@ -477,20 +484,20 @@ msgid "" "False" msgstr "" -#: library/sqlite3.rst:375 +#: library/sqlite3.rst:381 msgid "" "This function may be useful during command-line input to determine if the " "entered text seems to form a complete SQL statement, or if additional input " "is needed before calling :meth:`~Cursor.execute`." msgstr "" -#: library/sqlite3.rst:379 +#: library/sqlite3.rst:385 msgid "" "See :func:`!runsource` in :source:`Lib/sqlite3/__main__.py` for real-world " "use." msgstr "" -#: library/sqlite3.rst:384 +#: library/sqlite3.rst:390 msgid "" "Enable or disable callback tracebacks. By default you will not get any " "tracebacks in user-defined functions, aggregates, converters, authorizer " @@ -499,14 +506,14 @@ msgid "" "on :data:`sys.stderr`. Use ``False`` to disable the feature again." msgstr "" -#: library/sqlite3.rst:393 +#: library/sqlite3.rst:399 msgid "" "Errors in user-defined function callbacks are logged as unraisable " "exceptions. Use an :func:`unraisable hook handler ` for " "introspection of the failed callback." msgstr "" -#: library/sqlite3.rst:399 +#: library/sqlite3.rst:405 msgid "" "Register an *adapter* :term:`callable` to adapt the Python type *type* into " "an SQLite type. The adapter is called with a Python object of type *type* as " @@ -514,7 +521,7 @@ msgid "" "natively understands `." msgstr "" -#: library/sqlite3.rst:407 +#: library/sqlite3.rst:413 msgid "" "Register the *converter* :term:`callable` to convert SQLite objects of type " "*typename* into a Python object of a specific type. The converter is invoked " @@ -524,24 +531,24 @@ msgid "" "type detection works." msgstr "" -#: library/sqlite3.rst:415 +#: library/sqlite3.rst:421 msgid "" "Note: *typename* and the name of the type in your query are matched case-" "insensitively." msgstr "" -#: library/sqlite3.rst:422 +#: library/sqlite3.rst:428 msgid "Module constants" msgstr "" -#: library/sqlite3.rst:426 +#: library/sqlite3.rst:432 msgid "" "Set :attr:`~Connection.autocommit` to this constant to select old style (pre-" "Python 3.12) transaction control behaviour. See :ref:`sqlite3-transaction-" "control-isolation-level` for more information." msgstr "" -#: library/sqlite3.rst:432 +#: library/sqlite3.rst:438 msgid "" "Pass this flag value to the *detect_types* parameter of :func:`connect` to " "look up a converter function using the declared types for each column. The " @@ -550,7 +557,7 @@ msgid "" "the converter dictionary key. For example:" msgstr "" -#: library/sqlite3.rst:440 +#: library/sqlite3.rst:446 msgid "" "CREATE TABLE test(\n" " i integer primary key, ! will look up a converter named \"integer\"\n" @@ -559,19 +566,19 @@ msgid "" " )" msgstr "" -#: library/sqlite3.rst:448 +#: library/sqlite3.rst:454 msgid "" "This flag may be combined with :const:`PARSE_COLNAMES` using the ``|`` " "(bitwise or) operator." msgstr "" -#: library/sqlite3.rst:453 +#: library/sqlite3.rst:459 msgid "" "Generated fields (for example ``MAX(p)``) are returned as :class:`str`. Use :" "const:`!PARSE_COLNAMES` to enforce types for such queries." msgstr "" -#: library/sqlite3.rst:458 +#: library/sqlite3.rst:464 msgid "" "Pass this flag value to the *detect_types* parameter of :func:`connect` to " "look up a converter function by using the type name, parsed from the query " @@ -580,66 +587,66 @@ msgid "" "square brackets (``[]``)." msgstr "" -#: library/sqlite3.rst:465 +#: library/sqlite3.rst:471 msgid "" "SELECT MAX(p) as \"p [point]\" FROM test; ! will look up converter \"point\"" msgstr "" -#: library/sqlite3.rst:469 +#: library/sqlite3.rst:475 msgid "" "This flag may be combined with :const:`PARSE_DECLTYPES` using the ``|`` " "(bitwise or) operator." msgstr "" -#: library/sqlite3.rst:476 +#: library/sqlite3.rst:482 msgid "" "Flags that should be returned by the *authorizer_callback* :term:`callable` " "passed to :meth:`Connection.set_authorizer`, to indicate whether:" msgstr "" -#: library/sqlite3.rst:479 +#: library/sqlite3.rst:485 msgid "Access is allowed (:const:`!SQLITE_OK`)," msgstr "" -#: library/sqlite3.rst:480 +#: library/sqlite3.rst:486 msgid "" "The SQL statement should be aborted with an error (:const:`!SQLITE_DENY`)" msgstr "" -#: library/sqlite3.rst:481 +#: library/sqlite3.rst:487 msgid "" "The column should be treated as a ``NULL`` value (:const:`!SQLITE_IGNORE`)" msgstr "" -#: library/sqlite3.rst:485 +#: library/sqlite3.rst:491 msgid "" "String constant stating the supported DB-API level. Required by the DB-API. " "Hard-coded to ``\"2.0\"``." msgstr "" -#: library/sqlite3.rst:490 +#: library/sqlite3.rst:496 msgid "" "String constant stating the type of parameter marker formatting expected by " "the :mod:`!sqlite3` module. Required by the DB-API. Hard-coded to " "``\"qmark\"``." msgstr "" -#: library/sqlite3.rst:496 +#: library/sqlite3.rst:502 msgid "The ``named`` DB-API parameter style is also supported." msgstr "" -#: library/sqlite3.rst:500 +#: library/sqlite3.rst:506 msgid "" "Version number of the runtime SQLite library as a :class:`string `." msgstr "" -#: library/sqlite3.rst:504 +#: library/sqlite3.rst:510 msgid "" "Version number of the runtime SQLite library as a :class:`tuple` of :class:" "`integers `." msgstr "" -#: library/sqlite3.rst:509 +#: library/sqlite3.rst:515 msgid "" "Integer constant required by the DB-API 2.0, stating the level of thread " "safety the :mod:`!sqlite3` module supports. This attribute is set based on " @@ -647,181 +654,187 @@ msgid "" "underlying SQLite library is compiled with. The SQLite threading modes are:" msgstr "" -#: library/sqlite3.rst:514 +#: library/sqlite3.rst:520 msgid "" "**Single-thread**: In this mode, all mutexes are disabled and SQLite is " "unsafe to use in more than a single thread at once." msgstr "" -#: library/sqlite3.rst:516 +#: library/sqlite3.rst:522 msgid "" "**Multi-thread**: In this mode, SQLite can be safely used by multiple " "threads provided that no single database connection is used simultaneously " "in two or more threads." msgstr "" -#: library/sqlite3.rst:519 +#: library/sqlite3.rst:525 msgid "" "**Serialized**: In serialized mode, SQLite can be safely used by multiple " "threads with no restriction." msgstr "" -#: library/sqlite3.rst:522 +#: library/sqlite3.rst:528 msgid "" "The mappings from SQLite threading modes to DB-API 2.0 threadsafety levels " "are as follows:" msgstr "" -#: library/sqlite3.rst:526 +#: library/sqlite3.rst:532 msgid "SQLite threading mode" msgstr "" -#: library/sqlite3.rst:526 +#: library/sqlite3.rst:532 msgid ":pep:`threadsafety <0249#threadsafety>`" msgstr "" -#: library/sqlite3.rst:526 +#: library/sqlite3.rst:532 msgid "`SQLITE_THREADSAFE`_" msgstr "" -#: library/sqlite3.rst:526 +#: library/sqlite3.rst:532 msgid "DB-API 2.0 meaning" msgstr "" -#: library/sqlite3.rst:529 +#: library/sqlite3.rst:535 msgid "single-thread" msgstr "" -#: library/sqlite3.rst:529 +#: library/sqlite3.rst:535 msgid "0" msgstr "" -#: library/sqlite3.rst:529 +#: library/sqlite3.rst:535 msgid "Threads may not share the module" msgstr "" -#: library/sqlite3.rst:532 +#: library/sqlite3.rst:538 msgid "multi-thread" msgstr "" -#: library/sqlite3.rst:535 +#: library/sqlite3.rst:541 msgid "1" msgstr "" -#: library/sqlite3.rst:532 +#: library/sqlite3.rst:538 msgid "2" msgstr "" -#: library/sqlite3.rst:532 +#: library/sqlite3.rst:538 msgid "Threads may share the module, but not connections" msgstr "" -#: library/sqlite3.rst:535 +#: library/sqlite3.rst:541 msgid "serialized" msgstr "" -#: library/sqlite3.rst:535 +#: library/sqlite3.rst:541 msgid "3" msgstr "" -#: library/sqlite3.rst:535 +#: library/sqlite3.rst:541 msgid "Threads may share the module, connections and cursors" msgstr "" -#: library/sqlite3.rst:541 +#: library/sqlite3.rst:547 msgid "Set *threadsafety* dynamically instead of hard-coding it to ``1``." msgstr "" -#: library/sqlite3.rst:546 +#: library/sqlite3.rst:552 msgid "" "Version number of this module as a :class:`string `. This is not the " "version of the SQLite library." msgstr "" -#: library/sqlite3.rst:559 +#: library/sqlite3.rst:565 msgid "" "This constant used to reflect the version number of the ``pysqlite`` " "package, a third-party library which used to upstream changes to :mod:`!" "sqlite3`. Today, it carries no meaning or practical value." msgstr "" -#: library/sqlite3.rst:556 +#: library/sqlite3.rst:562 msgid "" "Version number of this module as a :class:`tuple` of :class:`integers " "`. This is not the version of the SQLite library." msgstr "" -#: library/sqlite3.rst:583 +#: library/sqlite3.rst:589 msgid "" "These constants are used for the :meth:`Connection.setconfig` and :meth:" "`~Connection.getconfig` methods." msgstr "" -#: library/sqlite3.rst:586 +#: library/sqlite3.rst:592 msgid "" "The availability of these constants varies depending on the version of " "SQLite Python was compiled with." msgstr "" -#: library/sqlite3.rst:593 +#: library/sqlite3.rst:599 msgid "https://www.sqlite.org/c3ref/c_dbconfig_defensive.html" msgstr "" -#: library/sqlite3.rst:594 +#: library/sqlite3.rst:600 msgid "SQLite docs: Database Connection Configuration Options" msgstr "" -#: library/sqlite3.rst:600 +#: library/sqlite3.rst:606 msgid "Connection objects" msgstr "" -#: library/sqlite3.rst:604 +#: library/sqlite3.rst:610 msgid "" "Each open SQLite database is represented by a ``Connection`` object, which " "is created using :func:`sqlite3.connect`. Their main purpose is creating :" "class:`Cursor` objects, and :ref:`sqlite3-controlling-transactions`." msgstr "" -#: library/sqlite3.rst:611 +#: library/sqlite3.rst:617 msgid ":ref:`sqlite3-connection-shortcuts`" msgstr "" -#: library/sqlite3.rst:614 +#: library/sqlite3.rst:623 +msgid "" +"A :exc:`ResourceWarning` is emitted if :meth:`close` is not called before a :" +"class:`!Connection` object is deleted." +msgstr "" + +#: library/sqlite3.rst:626 msgid "An SQLite database connection has the following attributes and methods:" msgstr "" -#: library/sqlite3.rst:618 +#: library/sqlite3.rst:630 msgid "" "Create and return a :class:`Cursor` object. The cursor method accepts a " "single optional parameter *factory*. If supplied, this must be a :term:" "`callable` returning an instance of :class:`Cursor` or its subclasses." msgstr "" -#: library/sqlite3.rst:625 +#: library/sqlite3.rst:637 msgid "" "Open a :class:`Blob` handle to an existing :abbr:`BLOB (Binary Large " "OBject)`." msgstr "" -#: library/sqlite3.rst:628 +#: library/sqlite3.rst:640 msgid "The name of the table where the blob is located." msgstr "" -#: library/sqlite3.rst:631 +#: library/sqlite3.rst:643 msgid "The name of the column where the blob is located." msgstr "" -#: library/sqlite3.rst:634 +#: library/sqlite3.rst:646 msgid "The name of the row where the blob is located." msgstr "" -#: library/sqlite3.rst:637 +#: library/sqlite3.rst:649 msgid "" "Set to ``True`` if the blob should be opened without write permissions. " "Defaults to ``False``." msgstr "" -#: library/sqlite3.rst:642 +#: library/sqlite3.rst:654 msgid "" "The name of the database where the blob is located. Defaults to ``\"main\"``." msgstr "" @@ -830,17 +843,17 @@ msgstr "" msgid "Raises" msgstr "" -#: library/sqlite3.rst:646 +#: library/sqlite3.rst:658 msgid "When trying to open a blob in a ``WITHOUT ROWID`` table." msgstr "" -#: library/sqlite3.rst:653 +#: library/sqlite3.rst:665 msgid "" "The blob size cannot be changed using the :class:`Blob` class. Use the SQL " "function ``zeroblob`` to create a blob with a fixed size." msgstr "" -#: library/sqlite3.rst:660 +#: library/sqlite3.rst:672 msgid "" "Commit any pending transaction to the database. If :attr:`autocommit` is " "``True``, or there is no open transaction, this method does nothing. If :" @@ -848,7 +861,7 @@ msgid "" "pending transaction was committed by this method." msgstr "" -#: library/sqlite3.rst:668 +#: library/sqlite3.rst:680 msgid "" "Roll back to the start of any pending transaction. If :attr:`autocommit` is " "``True``, or there is no open transaction, this method does nothing. If :" @@ -856,7 +869,7 @@ msgid "" "pending transaction was rolled back by this method." msgstr "" -#: library/sqlite3.rst:676 +#: library/sqlite3.rst:688 msgid "" "Close the database connection. If :attr:`autocommit` is ``False``, any " "pending transaction is implicitly rolled back. If :attr:`!autocommit` is " @@ -865,65 +878,61 @@ msgid "" "losing pending changes." msgstr "" -#: library/sqlite3.rst:686 +#: library/sqlite3.rst:698 msgid "" "Create a new :class:`Cursor` object and call :meth:`~Cursor.execute` on it " "with the given *sql* and *parameters*. Return the new cursor object." msgstr "" -#: library/sqlite3.rst:692 +#: library/sqlite3.rst:704 msgid "" "Create a new :class:`Cursor` object and call :meth:`~Cursor.executemany` on " "it with the given *sql* and *parameters*. Return the new cursor object." msgstr "" -#: library/sqlite3.rst:698 +#: library/sqlite3.rst:710 msgid "" "Create a new :class:`Cursor` object and call :meth:`~Cursor.executescript` " "on it with the given *sql_script*. Return the new cursor object." msgstr "" -#: library/sqlite3.rst:704 +#: library/sqlite3.rst:716 msgid "Create or remove a user-defined SQL function." msgstr "" -#: library/sqlite3.rst:706 +#: library/sqlite3.rst:718 msgid "The name of the SQL function." msgstr "" -#: library/sqlite3.rst:709 +#: library/sqlite3.rst:721 msgid "" "The number of arguments the SQL function can accept. If ``-1``, it may take " "any number of arguments." msgstr "" -#: library/sqlite3.rst:713 +#: library/sqlite3.rst:725 msgid "" "A :term:`callable` that is called when the SQL function is invoked. The " "callable must return :ref:`a type natively supported by SQLite `. Set to ``None`` to remove an existing SQL function." msgstr "" -#: library/sqlite3.rst:720 +#: library/sqlite3.rst:732 msgid "" "If ``True``, the created SQL function is marked as `deterministic `_, which allows SQLite to perform additional " "optimizations." msgstr "" -#: library/sqlite3.rst:725 -msgid "If *deterministic* is used with SQLite versions older than 3.8.3." -msgstr "" - -#: library/sqlite3.rst:728 +#: library/sqlite3.rst:737 msgid "Added the *deterministic* parameter." msgstr "" -#: library/sqlite3.rst:770 library/sqlite3.rst:1093 library/sqlite3.rst:1556 +#: library/sqlite3.rst:784 library/sqlite3.rst:1131 library/sqlite3.rst:1596 msgid "Example:" msgstr "" -#: library/sqlite3.rst:733 +#: library/sqlite3.rst:742 msgid "" ">>> import hashlib\n" ">>> def md5sum(t):\n" @@ -936,21 +945,27 @@ msgid "" ">>> con.close()" msgstr "" -#: library/sqlite3.rst:748 +#: library/sqlite3.rst:756 +msgid "" +"Passing *name*, *narg*, and *func* as keyword arguments is deprecated. These " +"parameters will become positional-only in Python 3.15." +msgstr "" + +#: library/sqlite3.rst:762 msgid "Create or remove a user-defined SQL aggregate function." msgstr "" -#: library/sqlite3.rst:750 +#: library/sqlite3.rst:764 msgid "The name of the SQL aggregate function." msgstr "" -#: library/sqlite3.rst:753 +#: library/sqlite3.rst:767 msgid "" "The number of arguments the SQL aggregate function can accept. If ``-1``, it " "may take any number of arguments." msgstr "" -#: library/sqlite3.rst:757 +#: library/sqlite3.rst:771 msgid "" "A class must implement the following methods: * ``step()``: Add a row to " "the aggregate. * ``finalize()``: Return the final result of the aggregate " @@ -959,31 +974,31 @@ msgid "" "*n_arg*. Set to ``None`` to remove an existing SQL aggregate function." msgstr "" -#: library/sqlite3.rst:758 +#: library/sqlite3.rst:772 msgid "A class must implement the following methods:" msgstr "" -#: library/sqlite3.rst:760 +#: library/sqlite3.rst:774 msgid "``step()``: Add a row to the aggregate." msgstr "" -#: library/sqlite3.rst:817 +#: library/sqlite3.rst:836 msgid "" "``finalize()``: Return the final result of the aggregate as :ref:`a type " "natively supported by SQLite `." msgstr "" -#: library/sqlite3.rst:764 +#: library/sqlite3.rst:778 msgid "" "The number of arguments that the ``step()`` method must accept is controlled " "by *n_arg*." msgstr "" -#: library/sqlite3.rst:767 +#: library/sqlite3.rst:781 msgid "Set to ``None`` to remove an existing SQL aggregate function." msgstr "" -#: library/sqlite3.rst:772 +#: library/sqlite3.rst:786 msgid "" "class MySum:\n" " def __init__(self):\n" @@ -1006,21 +1021,27 @@ msgid "" "con.close()" msgstr "" -#: library/sqlite3.rst:802 +#: library/sqlite3.rst:815 +msgid "" +"Passing *name*, *n_arg*, and *aggregate_class* as keyword arguments is " +"deprecated. These parameters will become positional-only in Python 3.15." +msgstr "" + +#: library/sqlite3.rst:821 msgid "Create or remove a user-defined aggregate window function." msgstr "" -#: library/sqlite3.rst:804 +#: library/sqlite3.rst:823 msgid "The name of the SQL aggregate window function to create or remove." msgstr "" -#: library/sqlite3.rst:807 +#: library/sqlite3.rst:826 msgid "" "The number of arguments the SQL aggregate window function can accept. If " "``-1``, it may take any number of arguments." msgstr "" -#: library/sqlite3.rst:811 +#: library/sqlite3.rst:830 msgid "" "A class that must implement the following methods: * ``step()``: Add a row " "to the current window. * ``value()``: Return the current value of the " @@ -1032,39 +1053,39 @@ msgid "" "function." msgstr "" -#: library/sqlite3.rst:812 +#: library/sqlite3.rst:831 msgid "A class that must implement the following methods:" msgstr "" -#: library/sqlite3.rst:814 +#: library/sqlite3.rst:833 msgid "``step()``: Add a row to the current window." msgstr "" -#: library/sqlite3.rst:815 +#: library/sqlite3.rst:834 msgid "``value()``: Return the current value of the aggregate." msgstr "" -#: library/sqlite3.rst:816 +#: library/sqlite3.rst:835 msgid "``inverse()``: Remove a row from the current window." msgstr "" -#: library/sqlite3.rst:820 +#: library/sqlite3.rst:839 msgid "" "The number of arguments that the ``step()`` and ``value()`` methods must " "accept is controlled by *num_params*." msgstr "" -#: library/sqlite3.rst:823 +#: library/sqlite3.rst:842 msgid "Set to ``None`` to remove an existing SQL aggregate window function." msgstr "" -#: library/sqlite3.rst:825 +#: library/sqlite3.rst:844 msgid "" "If used with a version of SQLite older than 3.25.0, which does not support " "aggregate window functions." msgstr "" -#: library/sqlite3.rst:835 +#: library/sqlite3.rst:854 msgid "" "# Example taken from https://www.sqlite.org/windowfunctions.html#udfwinfunc\n" "class WindowSumInt:\n" @@ -1112,30 +1133,30 @@ msgid "" "con.close()" msgstr "" -#: library/sqlite3.rst:889 +#: library/sqlite3.rst:908 msgid "" "Create a collation named *name* using the collating function *callable*. " "*callable* is passed two :class:`string ` arguments, and it should " "return an :class:`integer `:" msgstr "" -#: library/sqlite3.rst:893 +#: library/sqlite3.rst:912 msgid "``1`` if the first is ordered higher than the second" msgstr "" -#: library/sqlite3.rst:894 +#: library/sqlite3.rst:913 msgid "``-1`` if the first is ordered lower than the second" msgstr "" -#: library/sqlite3.rst:895 +#: library/sqlite3.rst:914 msgid "``0`` if they are ordered equal" msgstr "" -#: library/sqlite3.rst:897 +#: library/sqlite3.rst:916 msgid "The following example shows a reverse sorting collation:" msgstr "" -#: library/sqlite3.rst:899 +#: library/sqlite3.rst:918 msgid "" "def collate_reverse(string1, string2):\n" " if string1 == string2:\n" @@ -1156,24 +1177,24 @@ msgid "" "con.close()" msgstr "" -#: library/sqlite3.rst:925 +#: library/sqlite3.rst:944 msgid "Remove a collation function by setting *callable* to ``None``." msgstr "" -#: library/sqlite3.rst:927 +#: library/sqlite3.rst:946 msgid "" "The collation name can contain any Unicode character. Earlier, only ASCII " "characters were allowed." msgstr "" -#: library/sqlite3.rst:934 +#: library/sqlite3.rst:953 msgid "" "Call this method from a different thread to abort any queries that might be " "executing on the connection. Aborted queries will raise an :exc:" "`OperationalError`." msgstr "" -#: library/sqlite3.rst:941 +#: library/sqlite3.rst:960 msgid "" "Register :term:`callable` *authorizer_callback* to be invoked for each " "attempt to access a column of a table in the database. The callback should " @@ -1182,7 +1203,7 @@ msgid "" "underlying SQLite library." msgstr "" -#: library/sqlite3.rst:948 +#: library/sqlite3.rst:967 msgid "" "The first argument to the callback signifies what kind of operation is to be " "authorized. The second and third argument will be arguments or ``None`` " @@ -1192,7 +1213,7 @@ msgid "" "attempt or ``None`` if this access attempt is directly from input SQL code." msgstr "" -#: library/sqlite3.rst:955 +#: library/sqlite3.rst:974 msgid "" "Please consult the SQLite documentation about the possible values for the " "first argument and the meaning of the second and third argument depending on " @@ -1200,15 +1221,21 @@ msgid "" "module." msgstr "" -#: library/sqlite3.rst:959 +#: library/sqlite3.rst:978 msgid "Passing ``None`` as *authorizer_callback* will disable the authorizer." msgstr "" -#: library/sqlite3.rst:961 +#: library/sqlite3.rst:980 msgid "Added support for disabling the authorizer using ``None``." msgstr "" -#: library/sqlite3.rst:967 +#: library/sqlite3.rst:983 +msgid "" +"Passing *authorizer_callback* as a keyword argument is deprecated. The " +"parameter will become positional-only in Python 3.15." +msgstr "" + +#: library/sqlite3.rst:990 msgid "" "Register :term:`callable` *progress_handler* to be invoked for every *n* " "instructions of the SQLite virtual machine. This is useful if you want to " @@ -1216,26 +1243,32 @@ msgid "" "a GUI." msgstr "" -#: library/sqlite3.rst:972 +#: library/sqlite3.rst:995 msgid "" "If you want to clear any previously installed progress handler, call the " "method with ``None`` for *progress_handler*." msgstr "" -#: library/sqlite3.rst:975 +#: library/sqlite3.rst:998 msgid "" "Returning a non-zero value from the handler function will terminate the " "currently executing query and cause it to raise a :exc:`DatabaseError` " "exception." msgstr "" -#: library/sqlite3.rst:982 +#: library/sqlite3.rst:1002 +msgid "" +"Passing *progress_handler* as a keyword argument is deprecated. The " +"parameter will become positional-only in Python 3.15." +msgstr "" + +#: library/sqlite3.rst:1009 msgid "" "Register :term:`callable` *trace_callback* to be invoked for each SQL " "statement that is actually executed by the SQLite backend." msgstr "" -#: library/sqlite3.rst:985 +#: library/sqlite3.rst:1012 msgid "" "The only argument passed to the callback is the statement (as :class:`str`) " "that is being executed. The return value of the callback is ignored. Note " @@ -1245,18 +1278,24 @@ msgid "" "execution of triggers defined in the current database." msgstr "" -#: library/sqlite3.rst:993 +#: library/sqlite3.rst:1020 msgid "Passing ``None`` as *trace_callback* will disable the trace callback." msgstr "" -#: library/sqlite3.rst:996 +#: library/sqlite3.rst:1023 msgid "" "Exceptions raised in the trace callback are not propagated. As a development " "and debugging aid, use :meth:`~sqlite3.enable_callback_tracebacks` to enable " "printing tracebacks from exceptions raised in the trace callback." msgstr "" -#: library/sqlite3.rst:1006 +#: library/sqlite3.rst:1030 +msgid "" +"Passing *trace_callback* as a keyword argument is deprecated. The parameter " +"will become positional-only in Python 3.15." +msgstr "" + +#: library/sqlite3.rst:1037 msgid "" "Enable the SQLite engine to load SQLite extensions from shared libraries if " "*enabled* is ``True``; else, disallow loading SQLite extensions. SQLite " @@ -1265,7 +1304,7 @@ msgid "" "distributed with SQLite." msgstr "" -#: library/sqlite3.rst:1015 +#: library/sqlite3.rst:1046 msgid "" "The :mod:`!sqlite3` module is not built with loadable extension support by " "default, because some platforms (notably macOS) have SQLite libraries which " @@ -1274,17 +1313,17 @@ msgid "" "program:`configure`." msgstr "" -#: library/sqlite3.rst:1022 +#: library/sqlite3.rst:1053 msgid "" "Raises an :ref:`auditing event ` ``sqlite3.enable_load_extension`` " "with arguments ``connection``, ``enabled``." msgstr "" -#: library/sqlite3.rst:1026 +#: library/sqlite3.rst:1057 msgid "Added the ``sqlite3.enable_load_extension`` auditing event." msgstr "" -#: library/sqlite3.rst:1032 +#: library/sqlite3.rst:1063 msgid "" "con.enable_load_extension(True)\n" "\n" @@ -1314,45 +1353,52 @@ msgid "" " print(row)" msgstr "" -#: library/sqlite3.rst:1058 +#: library/sqlite3.rst:1089 msgid "" "Load an SQLite extension from a shared library. Enable extension loading " "with :meth:`enable_load_extension` before calling this method." msgstr "" -#: library/sqlite3.rst:1062 +#: library/sqlite3.rst:1093 msgid "The path to the SQLite extension." msgstr "" -#: library/sqlite3.rst:1066 +#: library/sqlite3.rst:1097 msgid "" "Entry point name. If ``None`` (the default), SQLite will come up with an " "entry point name of its own; see the SQLite docs `Loading an Extension`_ for " "details." msgstr "" -#: library/sqlite3.rst:1075 +#: library/sqlite3.rst:1106 msgid "" "Raises an :ref:`auditing event ` ``sqlite3.load_extension`` with " "arguments ``connection``, ``path``." msgstr "" -#: library/sqlite3.rst:1079 +#: library/sqlite3.rst:1110 msgid "Added the ``sqlite3.load_extension`` auditing event." msgstr "" -#: library/sqlite3.rst:1082 +#: library/sqlite3.rst:1113 msgid "Added the *entrypoint* parameter." msgstr "" -#: library/sqlite3.rst:1089 +#: library/sqlite3.rst:1120 msgid "" "Return an :term:`iterator` to dump the database as SQL source code. Useful " "when saving an in-memory database for later restoration. Similar to the ``." "dump`` command in the :program:`sqlite3` shell." msgstr "" -#: library/sqlite3.rst:1095 +#: library/sqlite3.rst:1124 +msgid "" +"An optional ``LIKE`` pattern for database objects to dump, e.g. " +"``prefix_%``. If ``None`` (the default), all database objects will be " +"included." +msgstr "" + +#: library/sqlite3.rst:1133 msgid "" "# Convert file example.db to SQL dump file dump.sql\n" "con = sqlite3.connect('example.db')\n" @@ -1362,31 +1408,35 @@ msgid "" "con.close()" msgstr "" -#: library/sqlite3.rst:1178 +#: library/sqlite3.rst:1218 msgid ":ref:`sqlite3-howto-encoding`" msgstr "" -#: library/sqlite3.rst:1111 +#: library/sqlite3.rst:1146 +msgid "Added the *filter* parameter." +msgstr "" + +#: library/sqlite3.rst:1151 msgid "Create a backup of an SQLite database." msgstr "" -#: library/sqlite3.rst:1113 +#: library/sqlite3.rst:1153 msgid "" "Works even if the database is being accessed by other clients or " "concurrently by the same connection." msgstr "" -#: library/sqlite3.rst:1116 +#: library/sqlite3.rst:1156 msgid "The database connection to save the backup to." msgstr "" -#: library/sqlite3.rst:1119 +#: library/sqlite3.rst:1159 msgid "" "The number of pages to copy at a time. If equal to or less than ``0``, the " "entire database is copied in a single step. Defaults to ``-1``." msgstr "" -#: library/sqlite3.rst:1125 +#: library/sqlite3.rst:1165 msgid "" "If set to a :term:`callable`, it is invoked with three integer arguments for " "every backup iteration: the *status* of the last iteration, the *remaining* " @@ -1394,24 +1444,24 @@ msgid "" "Defaults to ``None``." msgstr "" -#: library/sqlite3.rst:1134 +#: library/sqlite3.rst:1174 msgid "" "The name of the database to back up. Either ``\"main\"`` (the default) for " "the main database, ``\"temp\"`` for the temporary database, or the name of a " "custom database as attached using the ``ATTACH DATABASE`` SQL statement." msgstr "" -#: library/sqlite3.rst:1141 +#: library/sqlite3.rst:1181 msgid "" "The number of seconds to sleep between successive attempts to back up " "remaining pages." msgstr "" -#: library/sqlite3.rst:1145 +#: library/sqlite3.rst:1185 msgid "Example 1, copy an existing database into another:" msgstr "" -#: library/sqlite3.rst:1147 +#: library/sqlite3.rst:1187 msgid "" "def progress(status, remaining, total):\n" " print(f'Copied {total-remaining} of {total} pages...')\n" @@ -1424,11 +1474,11 @@ msgid "" "src.close()" msgstr "" -#: library/sqlite3.rst:1164 +#: library/sqlite3.rst:1204 msgid "Example 2, copy an existing database into a transient copy:" msgstr "" -#: library/sqlite3.rst:1166 +#: library/sqlite3.rst:1206 msgid "" "src = sqlite3.connect('example.db')\n" "dst = sqlite3.connect(':memory:')\n" @@ -1437,31 +1487,31 @@ msgid "" "src.close()" msgstr "" -#: library/sqlite3.rst:1182 +#: library/sqlite3.rst:1222 msgid "Get a connection runtime limit." msgstr "" -#: library/sqlite3.rst:1184 +#: library/sqlite3.rst:1224 msgid "The `SQLite limit category`_ to be queried." msgstr "" -#: library/sqlite3.rst:1226 +#: library/sqlite3.rst:1266 msgid "If *category* is not recognised by the underlying SQLite library." msgstr "" -#: library/sqlite3.rst:1192 +#: library/sqlite3.rst:1232 msgid "" "Example, query the maximum length of an SQL statement for :class:" "`Connection` ``con`` (the default is 1000000000):" msgstr "" -#: library/sqlite3.rst:1202 +#: library/sqlite3.rst:1242 msgid "" ">>> con.getlimit(sqlite3.SQLITE_LIMIT_SQL_LENGTH)\n" "1000000000" msgstr "" -#: library/sqlite3.rst:1212 +#: library/sqlite3.rst:1252 msgid "" "Set a connection runtime limit. Attempts to increase a limit above its hard " "upper bound are silently truncated to the hard upper bound. Regardless of " @@ -1469,22 +1519,22 @@ msgid "" "returned." msgstr "" -#: library/sqlite3.rst:1217 +#: library/sqlite3.rst:1257 msgid "The `SQLite limit category`_ to be set." msgstr "" -#: library/sqlite3.rst:1220 +#: library/sqlite3.rst:1260 msgid "" "The value of the new limit. If negative, the current limit is unchanged." msgstr "" -#: library/sqlite3.rst:1229 +#: library/sqlite3.rst:1269 msgid "" "Example, limit the number of attached databases to 1 for :class:`Connection` " "``con`` (the default limit is 10):" msgstr "" -#: library/sqlite3.rst:1232 +#: library/sqlite3.rst:1272 msgid "" ">>> con.setlimit(sqlite3.SQLITE_LIMIT_ATTACHED, 1)\n" "10\n" @@ -1492,25 +1542,25 @@ msgid "" "1" msgstr "" -#: library/sqlite3.rst:1250 +#: library/sqlite3.rst:1290 msgid "Query a boolean connection configuration option." msgstr "" -#: library/sqlite3.rst:1263 +#: library/sqlite3.rst:1303 msgid "A :ref:`SQLITE_DBCONFIG code `." msgstr "" -#: library/sqlite3.rst:1261 +#: library/sqlite3.rst:1301 msgid "Set a boolean connection configuration option." msgstr "" -#: library/sqlite3.rst:1266 +#: library/sqlite3.rst:1306 msgid "" "``True`` if the configuration option should be enabled (default); ``False`` " "if it should be disabled." msgstr "" -#: library/sqlite3.rst:1274 +#: library/sqlite3.rst:1314 msgid "" "Serialize a database into a :class:`bytes` object. For an ordinary on-disk " "database file, the serialization is just a copy of the disk file. For an in-" @@ -1519,17 +1569,17 @@ msgid "" "backed up to disk." msgstr "" -#: library/sqlite3.rst:1280 +#: library/sqlite3.rst:1320 msgid "The database name to be serialized. Defaults to ``\"main\"``." msgstr "" -#: library/sqlite3.rst:1288 +#: library/sqlite3.rst:1328 msgid "" "This method is only available if the underlying SQLite library has the " "serialize API." msgstr "" -#: library/sqlite3.rst:1296 +#: library/sqlite3.rst:1336 msgid "" "Deserialize a :meth:`serialized ` database into a :class:" "`Connection`. This method causes the database connection to disconnect from " @@ -1537,96 +1587,96 @@ msgid "" "serialization contained in *data*." msgstr "" -#: library/sqlite3.rst:1302 +#: library/sqlite3.rst:1342 msgid "A serialized database." msgstr "" -#: library/sqlite3.rst:1305 +#: library/sqlite3.rst:1345 msgid "The database name to deserialize into. Defaults to ``\"main\"``." msgstr "" -#: library/sqlite3.rst:1309 +#: library/sqlite3.rst:1349 msgid "" "If the database connection is currently involved in a read transaction or a " "backup operation." msgstr "" -#: library/sqlite3.rst:1313 +#: library/sqlite3.rst:1353 msgid "If *data* does not contain a valid SQLite database." msgstr "" -#: library/sqlite3.rst:1316 +#: library/sqlite3.rst:1356 msgid "If :func:`len(data) ` is larger than ``2**63 - 1``." msgstr "" -#: library/sqlite3.rst:1321 +#: library/sqlite3.rst:1361 msgid "" "This method is only available if the underlying SQLite library has the " "deserialize API." msgstr "" -#: library/sqlite3.rst:1328 +#: library/sqlite3.rst:1368 msgid "" "This attribute controls :pep:`249`-compliant transaction behaviour. :attr:`!" "autocommit` has three allowed values:" msgstr "" -#: library/sqlite3.rst:1331 +#: library/sqlite3.rst:1371 msgid "" "``False``: Select :pep:`249`-compliant transaction behaviour, implying that :" "mod:`!sqlite3` ensures a transaction is always open. Use :meth:`commit` and :" "meth:`rollback` to close transactions." msgstr "" -#: library/sqlite3.rst:1335 +#: library/sqlite3.rst:1375 msgid "This is the recommended value of :attr:`!autocommit`." msgstr "" -#: library/sqlite3.rst:1337 +#: library/sqlite3.rst:1377 msgid "" "``True``: Use SQLite's `autocommit mode`_. :meth:`commit` and :meth:" "`rollback` have no effect in this mode." msgstr "" -#: library/sqlite3.rst:1340 +#: library/sqlite3.rst:1380 msgid "" ":data:`LEGACY_TRANSACTION_CONTROL`: Pre-Python 3.12 (non-:pep:`249`-" "compliant) transaction control. See :attr:`isolation_level` for more details." msgstr "" -#: library/sqlite3.rst:1344 +#: library/sqlite3.rst:1384 msgid "This is currently the default value of :attr:`!autocommit`." msgstr "" -#: library/sqlite3.rst:1346 +#: library/sqlite3.rst:1386 msgid "" "Changing :attr:`!autocommit` to ``False`` will open a new transaction, and " "changing it to ``True`` will commit any pending transaction." msgstr "" -#: library/sqlite3.rst:1349 +#: library/sqlite3.rst:1389 msgid "See :ref:`sqlite3-transaction-control-autocommit` for more details." msgstr "" -#: library/sqlite3.rst:1353 +#: library/sqlite3.rst:1393 msgid "" "The :attr:`isolation_level` attribute has no effect unless :attr:" "`autocommit` is :data:`LEGACY_TRANSACTION_CONTROL`." msgstr "" -#: library/sqlite3.rst:1360 +#: library/sqlite3.rst:1400 msgid "" "This read-only attribute corresponds to the low-level SQLite `autocommit " "mode`_." msgstr "" -#: library/sqlite3.rst:1363 +#: library/sqlite3.rst:1403 msgid "" "``True`` if a transaction is active (there are uncommitted changes), " "``False`` otherwise." msgstr "" -#: library/sqlite3.rst:1370 +#: library/sqlite3.rst:1410 msgid "" "Controls the :ref:`legacy transaction handling mode ` of :mod:`!sqlite3`. If set to ``None``, " @@ -1636,13 +1686,13 @@ msgid "" "` is performed." msgstr "" -#: library/sqlite3.rst:1378 +#: library/sqlite3.rst:1418 msgid "" "If not overridden by the *isolation_level* parameter of :func:`connect`, the " "default is ``\"\"``, which is an alias for ``\"DEFERRED\"``." msgstr "" -#: library/sqlite3.rst:1383 +#: library/sqlite3.rst:1423 msgid "" "Using :attr:`autocommit` to control transaction handling is recommended over " "using :attr:`!isolation_level`. :attr:`!isolation_level` has no effect " @@ -1650,7 +1700,7 @@ msgid "" "default)." msgstr "" -#: library/sqlite3.rst:1390 +#: library/sqlite3.rst:1430 msgid "" "The initial :attr:`~Cursor.row_factory` for :class:`Cursor` objects created " "from this connection. Assigning to this attribute does not affect the :attr:" @@ -1659,32 +1709,32 @@ msgid "" "`tuple`." msgstr "" -#: library/sqlite3.rst:1683 library/sqlite3.rst:1706 +#: library/sqlite3.rst:1723 library/sqlite3.rst:1746 msgid "See :ref:`sqlite3-howto-row-factory` for more details." msgstr "" -#: library/sqlite3.rst:1401 +#: library/sqlite3.rst:1441 msgid "" "A :term:`callable` that accepts a :class:`bytes` parameter and returns a " "text representation of it. The callable is invoked for SQLite values with " "the ``TEXT`` data type. By default, this attribute is set to :class:`str`." msgstr "" -#: library/sqlite3.rst:1406 +#: library/sqlite3.rst:1446 msgid "See :ref:`sqlite3-howto-encoding` for more details." msgstr "" -#: library/sqlite3.rst:1410 +#: library/sqlite3.rst:1450 msgid "" "Return the total number of database rows that have been modified, inserted, " "or deleted since the database connection was opened." msgstr "" -#: library/sqlite3.rst:1417 +#: library/sqlite3.rst:1457 msgid "Cursor objects" msgstr "" -#: library/sqlite3.rst:1419 +#: library/sqlite3.rst:1459 msgid "" "A ``Cursor`` object represents a `database cursor`_ which is used to execute " "SQL statements, and manage the context of a fetch operation. Cursors are " @@ -1692,45 +1742,45 @@ msgid "" "`connection shortcut methods `." msgstr "" -#: library/sqlite3.rst:1426 +#: library/sqlite3.rst:1466 msgid "" "Cursor objects are :term:`iterators `, meaning that if you :meth:" "`~Cursor.execute` a ``SELECT`` query, you can simply iterate over the cursor " "to fetch the resulting rows:" msgstr "" -#: library/sqlite3.rst:1437 +#: library/sqlite3.rst:1477 msgid "" "for row in cur.execute(\"SELECT t FROM data\"):\n" " print(row)" msgstr "" -#: library/sqlite3.rst:1451 +#: library/sqlite3.rst:1491 msgid "A :class:`Cursor` instance has the following attributes and methods." msgstr "" -#: library/sqlite3.rst:1458 +#: library/sqlite3.rst:1498 msgid "" "Execute a single SQL statement, optionally binding Python values using :ref:" "`placeholders `." msgstr "" -#: library/sqlite3.rst:1462 +#: library/sqlite3.rst:1502 msgid "A single SQL statement." msgstr "" -#: library/sqlite3.rst:1465 +#: library/sqlite3.rst:1505 msgid "" "Python values to bind to placeholders in *sql*. A :class:`!dict` if named " "placeholders are used. A :term:`!sequence` if unnamed placeholders are used. " "See :ref:`sqlite3-placeholders`." msgstr "" -#: library/sqlite3.rst:1472 +#: library/sqlite3.rst:1512 msgid "If *sql* contains more than one SQL statement." msgstr "" -#: library/sqlite3.rst:1475 +#: library/sqlite3.rst:1515 msgid "" "If :attr:`~Connection.autocommit` is :data:`LEGACY_TRANSACTION_CONTROL`, :" "attr:`~Connection.isolation_level` is not ``None``, *sql* is an ``INSERT``, " @@ -1738,7 +1788,7 @@ msgid "" "transaction, a transaction is implicitly opened before executing *sql*." msgstr "" -#: library/sqlite3.rst:1484 +#: library/sqlite3.rst:1524 msgid "" ":exc:`DeprecationWarning` is emitted if :ref:`named placeholders ` are used and *parameters* is a sequence instead of a :class:" @@ -1746,37 +1796,37 @@ msgid "" "instead." msgstr "" -#: library/sqlite3.rst:1490 +#: library/sqlite3.rst:1530 msgid "Use :meth:`executescript` to execute multiple SQL statements." msgstr "" -#: library/sqlite3.rst:1494 +#: library/sqlite3.rst:1534 msgid "" "For every item in *parameters*, repeatedly execute the :ref:`parameterized " "` :abbr:`DML (Data Manipulation Language)` SQL " "statement *sql*." msgstr "" -#: library/sqlite3.rst:1498 +#: library/sqlite3.rst:1538 msgid "Uses the same implicit transaction handling as :meth:`~Cursor.execute`." msgstr "" -#: library/sqlite3.rst:1500 +#: library/sqlite3.rst:1540 msgid "A single SQL DML statement." msgstr "" -#: library/sqlite3.rst:1503 +#: library/sqlite3.rst:1543 msgid "" "An :term:`!iterable` of parameters to bind with the placeholders in *sql*. " "See :ref:`sqlite3-placeholders`." msgstr "" -#: library/sqlite3.rst:1509 +#: library/sqlite3.rst:1549 msgid "" "If *sql* contains more than one SQL statement, or is not a DML statement." msgstr "" -#: library/sqlite3.rst:1515 +#: library/sqlite3.rst:1555 msgid "" "rows = [\n" " (\"row1\",),\n" @@ -1786,13 +1836,13 @@ msgid "" "cur.executemany(\"INSERT INTO data VALUES(?)\", rows)" msgstr "" -#: library/sqlite3.rst:1530 +#: library/sqlite3.rst:1570 msgid "" "Any resulting rows are discarded, including DML statements with `RETURNING " "clauses`_." msgstr "" -#: library/sqlite3.rst:1537 +#: library/sqlite3.rst:1577 msgid "" ":exc:`DeprecationWarning` is emitted if :ref:`named placeholders ` are used and the items in *parameters* are sequences instead " @@ -1800,7 +1850,7 @@ msgid "" "be raised instead." msgstr "" -#: library/sqlite3.rst:1546 +#: library/sqlite3.rst:1586 msgid "" "Execute the SQL statements in *sql_script*. If the :attr:`~Connection." "autocommit` is :data:`LEGACY_TRANSACTION_CONTROL` and there is a pending " @@ -1809,11 +1859,11 @@ msgid "" "added to *sql_script*." msgstr "" -#: library/sqlite3.rst:1554 +#: library/sqlite3.rst:1594 msgid "*sql_script* must be a :class:`string `." msgstr "" -#: library/sqlite3.rst:1558 +#: library/sqlite3.rst:1598 msgid "" "# cur is an sqlite3.Cursor object\n" "cur.executescript(\"\"\"\n" @@ -1825,20 +1875,20 @@ msgid "" "\"\"\")" msgstr "" -#: library/sqlite3.rst:1571 +#: library/sqlite3.rst:1611 msgid "" "If :attr:`~Cursor.row_factory` is ``None``, return the next row query result " "set as a :class:`tuple`. Else, pass it to the row factory and return its " "result. Return ``None`` if no more data is available." msgstr "" -#: library/sqlite3.rst:1579 +#: library/sqlite3.rst:1619 msgid "" "Return the next set of rows of a query result as a :class:`list`. Return an " "empty list if no more rows are available." msgstr "" -#: library/sqlite3.rst:1582 +#: library/sqlite3.rst:1622 msgid "" "The number of rows to fetch per call is specified by the *size* parameter. " "If *size* is not given, :attr:`arraysize` determines the number of rows to " @@ -1846,7 +1896,7 @@ msgid "" "available are returned." msgstr "" -#: library/sqlite3.rst:1588 +#: library/sqlite3.rst:1628 msgid "" "Note there are performance considerations involved with the *size* " "parameter. For optimal performance, it is usually best to use the arraysize " @@ -1854,36 +1904,36 @@ msgid "" "the same value from one :meth:`fetchmany` call to the next." msgstr "" -#: library/sqlite3.rst:1595 +#: library/sqlite3.rst:1635 msgid "" "Return all (remaining) rows of a query result as a :class:`list`. Return an " "empty list if no rows are available. Note that the :attr:`arraysize` " "attribute can affect the performance of this operation." msgstr "" -#: library/sqlite3.rst:1602 +#: library/sqlite3.rst:1642 msgid "Close the cursor now (rather than whenever ``__del__`` is called)." msgstr "" -#: library/sqlite3.rst:1604 +#: library/sqlite3.rst:1644 msgid "" "The cursor will be unusable from this point forward; a :exc:" "`ProgrammingError` exception will be raised if any operation is attempted " "with the cursor." msgstr "" -#: library/sqlite3.rst:1613 +#: library/sqlite3.rst:1653 msgid "Required by the DB-API. Does nothing in :mod:`!sqlite3`." msgstr "" -#: library/sqlite3.rst:1617 +#: library/sqlite3.rst:1657 msgid "" "Read/write attribute that controls the number of rows returned by :meth:" "`fetchmany`. The default value is 1 which means a single row would be " "fetched per call." msgstr "" -#: library/sqlite3.rst:1622 +#: library/sqlite3.rst:1662 msgid "" "Read-only attribute that provides the SQLite database :class:`Connection` " "belonging to the cursor. A :class:`Cursor` object created by calling :meth:" @@ -1891,7 +1941,7 @@ msgid "" "that refers to *con*:" msgstr "" -#: library/sqlite3.rst:1627 +#: library/sqlite3.rst:1667 msgid "" ">>> con = sqlite3.connect(\":memory:\")\n" ">>> cur = con.cursor()\n" @@ -1900,18 +1950,18 @@ msgid "" ">>> con.close()" msgstr "" -#: library/sqlite3.rst:1637 +#: library/sqlite3.rst:1677 msgid "" "Read-only attribute that provides the column names of the last query. To " "remain compatible with the Python DB API, it returns a 7-tuple for each " "column where the last six items of each tuple are ``None``." msgstr "" -#: library/sqlite3.rst:1641 +#: library/sqlite3.rst:1681 msgid "It is set for ``SELECT`` statements without any matching rows as well." msgstr "" -#: library/sqlite3.rst:1645 +#: library/sqlite3.rst:1685 msgid "" "Read-only attribute that provides the row id of the last inserted row. It is " "only updated after successful ``INSERT`` or ``REPLACE`` statements using " @@ -1921,15 +1971,15 @@ msgid "" "``None``." msgstr "" -#: library/sqlite3.rst:1653 +#: library/sqlite3.rst:1693 msgid "Inserts into ``WITHOUT ROWID`` tables are not recorded." msgstr "" -#: library/sqlite3.rst:1655 +#: library/sqlite3.rst:1695 msgid "Added support for the ``REPLACE`` statement." msgstr "" -#: library/sqlite3.rst:1660 +#: library/sqlite3.rst:1700 msgid "" "Read-only attribute that provides the number of modified rows for " "``INSERT``, ``UPDATE``, ``DELETE``, and ``REPLACE`` statements; is ``-1`` " @@ -1939,7 +1989,7 @@ msgid "" "resulting rows must be fetched in order for :attr:`!rowcount` to be updated." msgstr "" -#: library/sqlite3.rst:1671 +#: library/sqlite3.rst:1711 msgid "" "Control how a row fetched from this :class:`!Cursor` is represented. If " "``None``, a row is represented as a :class:`tuple`. Can be set to the " @@ -1948,18 +1998,18 @@ msgid "" "and returns a custom object representing an SQLite row." msgstr "" -#: library/sqlite3.rst:1678 +#: library/sqlite3.rst:1718 msgid "" "Defaults to what :attr:`Connection.row_factory` was set to when the :class:`!" "Cursor` was created. Assigning to this attribute does not affect :attr:" "`Connection.row_factory` of the parent connection." msgstr "" -#: library/sqlite3.rst:1694 +#: library/sqlite3.rst:1734 msgid "Row objects" msgstr "" -#: library/sqlite3.rst:1698 +#: library/sqlite3.rst:1738 msgid "" "A :class:`!Row` instance serves as a highly optimized :attr:`~Connection." "row_factory` for :class:`Connection` objects. It supports iteration, " @@ -1967,28 +2017,28 @@ msgid "" "index." msgstr "" -#: library/sqlite3.rst:1703 +#: library/sqlite3.rst:1743 msgid "" "Two :class:`!Row` objects compare equal if they have identical column names " "and values." msgstr "" -#: library/sqlite3.rst:1710 +#: library/sqlite3.rst:1750 msgid "" "Return a :class:`list` of column names as :class:`strings `. " "Immediately after a query, it is the first member of each tuple in :attr:" "`Cursor.description`." msgstr "" -#: library/sqlite3.rst:1714 +#: library/sqlite3.rst:1754 msgid "Added support of slicing." msgstr "" -#: library/sqlite3.rst:1721 +#: library/sqlite3.rst:1761 msgid "Blob objects" msgstr "" -#: library/sqlite3.rst:1727 +#: library/sqlite3.rst:1767 msgid "" "A :class:`Blob` instance is a :term:`file-like object` that can read and " "write data in an SQLite :abbr:`BLOB (Binary Large OBject)`. Call :func:" @@ -1996,13 +2046,13 @@ msgid "" "and :term:`slices ` for direct access to the blob data." msgstr "" -#: library/sqlite3.rst:1732 +#: library/sqlite3.rst:1772 msgid "" "Use the :class:`Blob` as a :term:`context manager` to ensure that the blob " "handle is closed after use." msgstr "" -#: library/sqlite3.rst:1735 +#: library/sqlite3.rst:1775 msgid "" "con = sqlite3.connect(\":memory:\")\n" "con.execute(\"CREATE TABLE test(blob_col blob)\")\n" @@ -2024,18 +2074,18 @@ msgid "" "con.close()" msgstr "" -#: library/sqlite3.rst:1763 +#: library/sqlite3.rst:1803 msgid "Close the blob." msgstr "" -#: library/sqlite3.rst:1765 +#: library/sqlite3.rst:1805 msgid "" "The blob will be unusable from this point onward. An :class:`~sqlite3." "Error` (or subclass) exception will be raised if any further operation is " "attempted with the blob." msgstr "" -#: library/sqlite3.rst:1771 +#: library/sqlite3.rst:1811 msgid "" "Read *length* bytes of data from the blob at the current offset position. If " "the end of the blob is reached, the data up to :abbr:`EOF (End of File)` " @@ -2043,18 +2093,18 @@ msgid "" "`~Blob.read` will read until the end of the blob." msgstr "" -#: library/sqlite3.rst:1779 +#: library/sqlite3.rst:1819 msgid "" "Write *data* to the blob at the current offset. This function cannot change " "the blob length. Writing beyond the end of the blob will raise :exc:" "`ValueError`." msgstr "" -#: library/sqlite3.rst:1785 +#: library/sqlite3.rst:1825 msgid "Return the current access position of the blob." msgstr "" -#: library/sqlite3.rst:1789 +#: library/sqlite3.rst:1829 msgid "" "Set the current access position of the blob to *offset*. The *origin* " "argument defaults to :const:`os.SEEK_SET` (absolute blob positioning). Other " @@ -2062,26 +2112,26 @@ msgid "" "position) and :const:`os.SEEK_END` (seek relative to the blob’s end)." msgstr "" -#: library/sqlite3.rst:1797 +#: library/sqlite3.rst:1837 msgid "PrepareProtocol objects" msgstr "" -#: library/sqlite3.rst:1801 +#: library/sqlite3.rst:1841 msgid "" "The PrepareProtocol type's single purpose is to act as a :pep:`246` style " "adaption protocol for objects that can :ref:`adapt themselves ` to :ref:`native SQLite types `." msgstr "" -#: library/sqlite3.rst:1809 +#: library/sqlite3.rst:1849 msgid "Exceptions" msgstr "" -#: library/sqlite3.rst:1811 +#: library/sqlite3.rst:1851 msgid "The exception hierarchy is defined by the DB-API 2.0 (:pep:`249`)." msgstr "" -#: library/sqlite3.rst:1815 +#: library/sqlite3.rst:1855 msgid "" "This exception is not currently raised by the :mod:`!sqlite3` module, but " "may be raised by applications using :mod:`!sqlite3`, for example if a user-" @@ -2089,39 +2139,39 @@ msgid "" "of :exc:`Exception`." msgstr "" -#: library/sqlite3.rst:1822 +#: library/sqlite3.rst:1862 msgid "" "The base class of the other exceptions in this module. Use this to catch all " "errors with one single :keyword:`except` statement. ``Error`` is a subclass " "of :exc:`Exception`." msgstr "" -#: library/sqlite3.rst:1826 +#: library/sqlite3.rst:1866 msgid "" "If the exception originated from within the SQLite library, the following " "two attributes are added to the exception:" msgstr "" -#: library/sqlite3.rst:1831 +#: library/sqlite3.rst:1871 msgid "" "The numeric error code from the `SQLite API `_" msgstr "" -#: library/sqlite3.rst:1838 +#: library/sqlite3.rst:1878 msgid "" "The symbolic name of the numeric error code from the `SQLite API `_" msgstr "" -#: library/sqlite3.rst:1845 +#: library/sqlite3.rst:1885 msgid "" "Exception raised for misuse of the low-level SQLite C API. In other words, " "if this exception is raised, it probably indicates a bug in the :mod:`!" "sqlite3` module. ``InterfaceError`` is a subclass of :exc:`Error`." msgstr "" -#: library/sqlite3.rst:1852 +#: library/sqlite3.rst:1892 msgid "" "Exception raised for errors that are related to the database. This serves as " "the base exception for several types of database errors. It is only raised " @@ -2129,14 +2179,14 @@ msgid "" "subclass of :exc:`Error`." msgstr "" -#: library/sqlite3.rst:1859 +#: library/sqlite3.rst:1899 msgid "" "Exception raised for errors caused by problems with the processed data, like " "numeric values out of range, and strings which are too long. ``DataError`` " "is a subclass of :exc:`DatabaseError`." msgstr "" -#: library/sqlite3.rst:1865 +#: library/sqlite3.rst:1905 msgid "" "Exception raised for errors that are related to the database's operation, " "and not necessarily under the control of the programmer. For example, the " @@ -2144,20 +2194,20 @@ msgid "" "``OperationalError`` is a subclass of :exc:`DatabaseError`." msgstr "" -#: library/sqlite3.rst:1873 +#: library/sqlite3.rst:1913 msgid "" "Exception raised when the relational integrity of the database is affected, " "e.g. a foreign key check fails. It is a subclass of :exc:`DatabaseError`." msgstr "" -#: library/sqlite3.rst:1878 +#: library/sqlite3.rst:1918 msgid "" "Exception raised when SQLite encounters an internal error. If this is " "raised, it may indicate that there is a problem with the runtime SQLite " "library. ``InternalError`` is a subclass of :exc:`DatabaseError`." msgstr "" -#: library/sqlite3.rst:1885 +#: library/sqlite3.rst:1925 msgid "" "Exception raised for :mod:`!sqlite3` API programming errors, for example " "supplying the wrong number of bindings to a query, or trying to operate on a " @@ -2165,7 +2215,7 @@ msgid "" "`DatabaseError`." msgstr "" -#: library/sqlite3.rst:1892 +#: library/sqlite3.rst:1932 msgid "" "Exception raised in case a method or database API is not supported by the " "underlying SQLite library. For example, setting *deterministic* to ``True`` " @@ -2174,78 +2224,78 @@ msgid "" "subclass of :exc:`DatabaseError`." msgstr "" -#: library/sqlite3.rst:1902 +#: library/sqlite3.rst:1942 msgid "SQLite and Python types" msgstr "" -#: library/sqlite3.rst:1904 +#: library/sqlite3.rst:1944 msgid "" "SQLite natively supports the following types: ``NULL``, ``INTEGER``, " "``REAL``, ``TEXT``, ``BLOB``." msgstr "" -#: library/sqlite3.rst:1907 +#: library/sqlite3.rst:1947 msgid "" "The following Python types can thus be sent to SQLite without any problem:" msgstr "" -#: library/sqlite3.rst:1927 +#: library/sqlite3.rst:1967 msgid "Python type" msgstr "" -#: library/sqlite3.rst:1927 +#: library/sqlite3.rst:1967 msgid "SQLite type" msgstr "" -#: library/sqlite3.rst:1929 +#: library/sqlite3.rst:1969 msgid "``None``" msgstr "" -#: library/sqlite3.rst:1929 +#: library/sqlite3.rst:1969 msgid "``NULL``" msgstr "" -#: library/sqlite3.rst:1931 +#: library/sqlite3.rst:1971 msgid ":class:`int`" msgstr "" -#: library/sqlite3.rst:1931 +#: library/sqlite3.rst:1971 msgid "``INTEGER``" msgstr "" -#: library/sqlite3.rst:1933 +#: library/sqlite3.rst:1973 msgid ":class:`float`" msgstr "" -#: library/sqlite3.rst:1933 +#: library/sqlite3.rst:1973 msgid "``REAL``" msgstr "" -#: library/sqlite3.rst:1918 +#: library/sqlite3.rst:1958 msgid ":class:`str`" msgstr "" -#: library/sqlite3.rst:1935 +#: library/sqlite3.rst:1975 msgid "``TEXT``" msgstr "" -#: library/sqlite3.rst:1938 +#: library/sqlite3.rst:1978 msgid ":class:`bytes`" msgstr "" -#: library/sqlite3.rst:1938 +#: library/sqlite3.rst:1978 msgid "``BLOB``" msgstr "" -#: library/sqlite3.rst:1924 +#: library/sqlite3.rst:1964 msgid "This is how SQLite types are converted to Python types by default:" msgstr "" -#: library/sqlite3.rst:1935 +#: library/sqlite3.rst:1975 msgid "depends on :attr:`~Connection.text_factory`, :class:`str` by default" msgstr "" -#: library/sqlite3.rst:1941 +#: library/sqlite3.rst:1981 msgid "" "The type system of the :mod:`!sqlite3` module is extensible in two ways: you " "can store additional Python types in an SQLite database via :ref:`object " @@ -2254,47 +2304,47 @@ msgid "" "converters>`." msgstr "" -#: library/sqlite3.rst:1951 +#: library/sqlite3.rst:1991 msgid "Default adapters and converters (deprecated)" msgstr "" -#: library/sqlite3.rst:1955 +#: library/sqlite3.rst:1995 msgid "" "The default adapters and converters are deprecated as of Python 3.12. " "Instead, use the :ref:`sqlite3-adapter-converter-recipes` and tailor them to " "your needs." msgstr "" -#: library/sqlite3.rst:1959 +#: library/sqlite3.rst:1999 msgid "The deprecated default adapters and converters consist of:" msgstr "" -#: library/sqlite3.rst:1961 +#: library/sqlite3.rst:2001 msgid "" "An adapter for :class:`datetime.date` objects to :class:`strings ` in " "`ISO 8601`_ format." msgstr "" -#: library/sqlite3.rst:1963 +#: library/sqlite3.rst:2003 msgid "" "An adapter for :class:`datetime.datetime` objects to strings in ISO 8601 " "format." msgstr "" -#: library/sqlite3.rst:1965 +#: library/sqlite3.rst:2005 msgid "" "A converter for :ref:`declared ` \"date\" types to :" "class:`datetime.date` objects." msgstr "" -#: library/sqlite3.rst:1967 +#: library/sqlite3.rst:2007 msgid "" "A converter for declared \"timestamp\" types to :class:`datetime.datetime` " "objects. Fractional parts will be truncated to 6 digits (microsecond " "precision)." msgstr "" -#: library/sqlite3.rst:1973 +#: library/sqlite3.rst:2013 msgid "" "The default \"timestamp\" converter ignores UTC offsets in the database and " "always returns a naive :class:`datetime.datetime` object. To preserve UTC " @@ -2302,42 +2352,42 @@ msgid "" "offset-aware converter with :func:`register_converter`." msgstr "" -#: library/sqlite3.rst:1986 +#: library/sqlite3.rst:2026 msgid "Command-line interface" msgstr "" -#: library/sqlite3.rst:1988 +#: library/sqlite3.rst:2028 msgid "" "The :mod:`!sqlite3` module can be invoked as a script, using the " "interpreter's :option:`-m` switch, in order to provide a simple SQLite " "shell. The argument signature is as follows::" msgstr "" -#: library/sqlite3.rst:1993 +#: library/sqlite3.rst:2033 msgid "python -m sqlite3 [-h] [-v] [filename] [sql]" msgstr "" -#: library/sqlite3.rst:1995 +#: library/sqlite3.rst:2035 msgid "Type ``.quit`` or CTRL-D to exit the shell." msgstr "" -#: library/sqlite3.rst:2001 +#: library/sqlite3.rst:2041 msgid "Print CLI help." msgstr "" -#: library/sqlite3.rst:2005 +#: library/sqlite3.rst:2045 msgid "Print underlying SQLite library version." msgstr "" -#: library/sqlite3.rst:2013 +#: library/sqlite3.rst:2053 msgid "How-to guides" msgstr "" -#: library/sqlite3.rst:2018 +#: library/sqlite3.rst:2058 msgid "How to use placeholders to bind values in SQL queries" msgstr "" -#: library/sqlite3.rst:2020 +#: library/sqlite3.rst:2060 msgid "" "SQL operations usually need to use values from Python variables. However, " "beware of using Python's string operations to assemble queries, as they are " @@ -2345,7 +2395,7 @@ msgid "" "close the single quote and inject ``OR TRUE`` to select all rows::" msgstr "" -#: library/sqlite3.rst:2025 +#: library/sqlite3.rst:2065 msgid "" ">>> # Never do this -- insecure!\n" ">>> symbol = input()\n" @@ -2356,7 +2406,7 @@ msgid "" ">>> cur.execute(sql)" msgstr "" -#: library/sqlite3.rst:2033 +#: library/sqlite3.rst:2073 msgid "" "Instead, use the DB-API's parameter substitution. To insert a variable into " "a query string, use a placeholder in the string, and substitute the actual " @@ -2364,7 +2414,7 @@ msgid "" "second argument of the cursor's :meth:`~Cursor.execute` method." msgstr "" -#: library/sqlite3.rst:2038 +#: library/sqlite3.rst:2078 msgid "" "An SQL statement may use one of two kinds of placeholders: question marks " "(qmark style) or named placeholders (named style). For the qmark style, " @@ -2375,7 +2425,7 @@ msgid "" "ignored. Here's an example of both styles:" msgstr "" -#: library/sqlite3.rst:2049 +#: library/sqlite3.rst:2089 msgid "" "con = sqlite3.connect(\":memory:\")\n" "cur = con.execute(\"CREATE TABLE lang(name, first_appeared)\")\n" @@ -2396,24 +2446,24 @@ msgid "" "con.close()" msgstr "" -#: library/sqlite3.rst:2076 +#: library/sqlite3.rst:2116 msgid "" ":pep:`249` numeric placeholders are *not* supported. If used, they will be " "interpreted as named placeholders." msgstr "" -#: library/sqlite3.rst:2083 +#: library/sqlite3.rst:2123 msgid "How to adapt custom Python types to SQLite values" msgstr "" -#: library/sqlite3.rst:2085 +#: library/sqlite3.rst:2125 msgid "" "SQLite supports only a limited set of data types natively. To store custom " "Python types in SQLite databases, *adapt* them to one of the :ref:`Python " "types SQLite natively understands `." msgstr "" -#: library/sqlite3.rst:2089 +#: library/sqlite3.rst:2129 msgid "" "There are two ways to adapt Python objects to SQLite types: letting your " "object adapt itself, or using an *adapter callable*. The latter will take " @@ -2423,11 +2473,11 @@ msgid "" "custom adapter functions." msgstr "" -#: library/sqlite3.rst:2101 +#: library/sqlite3.rst:2141 msgid "How to write adaptable objects" msgstr "" -#: library/sqlite3.rst:2103 +#: library/sqlite3.rst:2143 msgid "" "Suppose we have a :class:`!Point` class that represents a pair of " "coordinates, ``x`` and ``y``, in a Cartesian coordinate system. The " @@ -2437,7 +2487,7 @@ msgid "" "object passed to *protocol* will be of type :class:`PrepareProtocol`." msgstr "" -#: library/sqlite3.rst:2111 +#: library/sqlite3.rst:2151 msgid "" "class Point:\n" " def __init__(self, x, y):\n" @@ -2455,18 +2505,18 @@ msgid "" "con.close()" msgstr "" -#: library/sqlite3.rst:2135 +#: library/sqlite3.rst:2175 msgid "How to register adapter callables" msgstr "" -#: library/sqlite3.rst:2137 +#: library/sqlite3.rst:2177 msgid "" "The other possibility is to create a function that converts the Python " "object to an SQLite-compatible type. This function can then be registered " "using :func:`register_adapter`." msgstr "" -#: library/sqlite3.rst:2141 +#: library/sqlite3.rst:2181 msgid "" "class Point:\n" " def __init__(self, x, y):\n" @@ -2485,68 +2535,68 @@ msgid "" "con.close()" msgstr "" -#: library/sqlite3.rst:2168 +#: library/sqlite3.rst:2208 msgid "How to convert SQLite values to custom Python types" msgstr "" -#: library/sqlite3.rst:2170 +#: library/sqlite3.rst:2210 msgid "" "Writing an adapter lets you convert *from* custom Python types *to* SQLite " "values. To be able to convert *from* SQLite values *to* custom Python types, " "we use *converters*." msgstr "" -#: library/sqlite3.rst:2175 +#: library/sqlite3.rst:2215 msgid "" "Let's go back to the :class:`!Point` class. We stored the x and y " "coordinates separated via semicolons as strings in SQLite." msgstr "" -#: library/sqlite3.rst:2178 +#: library/sqlite3.rst:2218 msgid "" "First, we'll define a converter function that accepts the string as a " "parameter and constructs a :class:`!Point` object from it." msgstr "" -#: library/sqlite3.rst:2183 +#: library/sqlite3.rst:2223 msgid "" "Converter functions are **always** passed a :class:`bytes` object, no matter " "the underlying SQLite data type." msgstr "" -#: library/sqlite3.rst:2186 +#: library/sqlite3.rst:2226 msgid "" "def convert_point(s):\n" " x, y = map(float, s.split(b\";\"))\n" " return Point(x, y)" msgstr "" -#: library/sqlite3.rst:2192 +#: library/sqlite3.rst:2232 msgid "" "We now need to tell :mod:`!sqlite3` when it should convert a given SQLite " "value. This is done when connecting to a database, using the *detect_types* " "parameter of :func:`connect`. There are three options:" msgstr "" -#: library/sqlite3.rst:2196 +#: library/sqlite3.rst:2236 msgid "Implicit: set *detect_types* to :const:`PARSE_DECLTYPES`" msgstr "" -#: library/sqlite3.rst:2197 +#: library/sqlite3.rst:2237 msgid "Explicit: set *detect_types* to :const:`PARSE_COLNAMES`" msgstr "" -#: library/sqlite3.rst:2198 +#: library/sqlite3.rst:2238 msgid "" "Both: set *detect_types* to ``sqlite3.PARSE_DECLTYPES | sqlite3." "PARSE_COLNAMES``. Column names take precedence over declared types." msgstr "" -#: library/sqlite3.rst:2202 +#: library/sqlite3.rst:2242 msgid "The following example illustrates the implicit and explicit approaches:" msgstr "" -#: library/sqlite3.rst:2204 +#: library/sqlite3.rst:2244 msgid "" "class Point:\n" " def __init__(self, x, y):\n" @@ -2588,15 +2638,15 @@ msgid "" "con.close()" msgstr "" -#: library/sqlite3.rst:2255 +#: library/sqlite3.rst:2295 msgid "Adapter and converter recipes" msgstr "" -#: library/sqlite3.rst:2257 +#: library/sqlite3.rst:2297 msgid "This section shows recipes for common adapters and converters." msgstr "" -#: library/sqlite3.rst:2259 +#: library/sqlite3.rst:2299 msgid "" "import datetime\n" "import sqlite3\n" @@ -2634,11 +2684,11 @@ msgid "" "sqlite3.register_converter(\"timestamp\", convert_timestamp)" msgstr "" -#: library/sqlite3.rst:2319 +#: library/sqlite3.rst:2359 msgid "How to use connection shortcut methods" msgstr "" -#: library/sqlite3.rst:2321 +#: library/sqlite3.rst:2361 msgid "" "Using the :meth:`~Connection.execute`, :meth:`~Connection.executemany`, and :" "meth:`~Connection.executescript` methods of the :class:`Connection` class, " @@ -2650,7 +2700,7 @@ msgid "" "object." msgstr "" -#: library/sqlite3.rst:2330 +#: library/sqlite3.rst:2370 msgid "" "# Create and fill the table.\n" "con = sqlite3.connect(\":memory:\")\n" @@ -2674,11 +2724,11 @@ msgid "" "con.close()" msgstr "" -#: library/sqlite3.rst:2362 +#: library/sqlite3.rst:2402 msgid "How to use the connection context manager" msgstr "" -#: library/sqlite3.rst:2364 +#: library/sqlite3.rst:2404 msgid "" "A :class:`Connection` object can be used as a context manager that " "automatically commits or rolls back open transactions when leaving the body " @@ -2690,21 +2740,21 @@ msgid "" "rolling back." msgstr "" -#: library/sqlite3.rst:2375 +#: library/sqlite3.rst:2415 msgid "" "If there is no open transaction upon leaving the body of the ``with`` " "statement, or if :attr:`~Connection.autocommit` is ``True``, the context " "manager does nothing." msgstr "" -#: library/sqlite3.rst:2380 +#: library/sqlite3.rst:2420 msgid "" "The context manager neither implicitly opens a new transaction nor closes " "the connection. If you need a closing context manager, consider using :meth:" "`contextlib.closing`." msgstr "" -#: library/sqlite3.rst:2384 +#: library/sqlite3.rst:2424 msgid "" "con = sqlite3.connect(\":memory:\")\n" "con.execute(\"CREATE TABLE lang(id INTEGER PRIMARY KEY, name VARCHAR " @@ -2728,19 +2778,19 @@ msgid "" "con.close()" msgstr "" -#: library/sqlite3.rst:2414 +#: library/sqlite3.rst:2454 msgid "How to work with SQLite URIs" msgstr "" -#: library/sqlite3.rst:2416 +#: library/sqlite3.rst:2456 msgid "Some useful URI tricks include:" msgstr "" -#: library/sqlite3.rst:2418 +#: library/sqlite3.rst:2458 msgid "Open a database in read-only mode:" msgstr "" -#: library/sqlite3.rst:2420 +#: library/sqlite3.rst:2460 msgid "" ">>> con = sqlite3.connect(\"file:tutorial.db?mode=ro\", uri=True)\n" ">>> con.execute(\"CREATE TABLE readonly(data)\")\n" @@ -2749,24 +2799,24 @@ msgid "" ">>> con.close()" msgstr "" -#: library/sqlite3.rst:2428 +#: library/sqlite3.rst:2468 msgid "" "Do not implicitly create a new database file if it does not already exist; " "will raise :exc:`~sqlite3.OperationalError` if unable to create a new file:" msgstr "" -#: library/sqlite3.rst:2431 +#: library/sqlite3.rst:2471 msgid "" ">>> con = sqlite3.connect(\"file:nosuchdb.db?mode=rw\", uri=True)\n" "Traceback (most recent call last):\n" "OperationalError: unable to open database file" msgstr "" -#: library/sqlite3.rst:2438 +#: library/sqlite3.rst:2478 msgid "Create a shared named in-memory database:" msgstr "" -#: library/sqlite3.rst:2440 +#: library/sqlite3.rst:2480 msgid "" "db = \"file:mem1?mode=memory&cache=shared\"\n" "con1 = sqlite3.connect(db, uri=True)\n" @@ -2781,24 +2831,24 @@ msgid "" "con2.close()" msgstr "" -#: library/sqlite3.rst:2454 +#: library/sqlite3.rst:2494 msgid "" "More information about this feature, including a list of parameters, can be " "found in the `SQLite URI documentation`_." msgstr "" -#: library/sqlite3.rst:2463 +#: library/sqlite3.rst:2503 msgid "How to create and use row factories" msgstr "" -#: library/sqlite3.rst:2465 +#: library/sqlite3.rst:2505 msgid "" "By default, :mod:`!sqlite3` represents each row as a :class:`tuple`. If a :" "class:`!tuple` does not suit your needs, you can use the :class:`sqlite3." "Row` class or a custom :attr:`~Cursor.row_factory`." msgstr "" -#: library/sqlite3.rst:2470 +#: library/sqlite3.rst:2510 msgid "" "While :attr:`!row_factory` exists as an attribute both on the :class:" "`Cursor` and the :class:`Connection`, it is recommended to set :class:" @@ -2806,7 +2856,7 @@ msgid "" "use the same row factory." msgstr "" -#: library/sqlite3.rst:2475 +#: library/sqlite3.rst:2515 msgid "" ":class:`!Row` provides indexed and case-insensitive named access to columns, " "with minimal memory overhead and performance impact over a :class:`!tuple`. " @@ -2814,17 +2864,17 @@ msgid "" "attribute:" msgstr "" -#: library/sqlite3.rst:2480 +#: library/sqlite3.rst:2520 msgid "" ">>> con = sqlite3.connect(\":memory:\")\n" ">>> con.row_factory = sqlite3.Row" msgstr "" -#: library/sqlite3.rst:2485 +#: library/sqlite3.rst:2525 msgid "Queries now return :class:`!Row` objects:" msgstr "" -#: library/sqlite3.rst:2487 +#: library/sqlite3.rst:2527 msgid "" ">>> res = con.execute(\"SELECT 'Earth' AS name, 6378 AS radius\")\n" ">>> row = res.fetchone()\n" @@ -2839,7 +2889,7 @@ msgid "" ">>> con.close()" msgstr "" -#: library/sqlite3.rst:2503 +#: library/sqlite3.rst:2543 msgid "" "The ``FROM`` clause can be omitted in the ``SELECT`` statement, as in the " "above example. In such cases, SQLite returns a single row with columns " @@ -2847,25 +2897,25 @@ msgid "" "alias``." msgstr "" -#: library/sqlite3.rst:2508 +#: library/sqlite3.rst:2548 msgid "" "You can create a custom :attr:`~Cursor.row_factory` that returns each row as " "a :class:`dict`, with column names mapped to values:" msgstr "" -#: library/sqlite3.rst:2511 +#: library/sqlite3.rst:2551 msgid "" "def dict_factory(cursor, row):\n" " fields = [column[0] for column in cursor.description]\n" " return {key: value for key, value in zip(fields, row)}" msgstr "" -#: library/sqlite3.rst:2517 +#: library/sqlite3.rst:2557 msgid "" "Using it, queries now return a :class:`!dict` instead of a :class:`!tuple`:" msgstr "" -#: library/sqlite3.rst:2519 +#: library/sqlite3.rst:2559 msgid "" ">>> con = sqlite3.connect(\":memory:\")\n" ">>> con.row_factory = dict_factory\n" @@ -2875,11 +2925,11 @@ msgid "" ">>> con.close()" msgstr "" -#: library/sqlite3.rst:2528 +#: library/sqlite3.rst:2568 msgid "The following row factory returns a :term:`named tuple`:" msgstr "" -#: library/sqlite3.rst:2530 +#: library/sqlite3.rst:2570 msgid "" "from collections import namedtuple\n" "\n" @@ -2889,11 +2939,11 @@ msgid "" " return cls._make(row)" msgstr "" -#: library/sqlite3.rst:2539 +#: library/sqlite3.rst:2579 msgid ":func:`!namedtuple_factory` can be used as follows:" msgstr "" -#: library/sqlite3.rst:2541 +#: library/sqlite3.rst:2581 msgid "" ">>> con = sqlite3.connect(\":memory:\")\n" ">>> con.row_factory = namedtuple_factory\n" @@ -2908,18 +2958,18 @@ msgid "" ">>> con.close()" msgstr "" -#: library/sqlite3.rst:2555 +#: library/sqlite3.rst:2595 msgid "" "With some adjustments, the above recipe can be adapted to use a :class:" "`~dataclasses.dataclass`, or any other custom class, instead of a :class:" "`~collections.namedtuple`." msgstr "" -#: library/sqlite3.rst:2563 +#: library/sqlite3.rst:2603 msgid "How to handle non-UTF-8 text encodings" msgstr "" -#: library/sqlite3.rst:2565 +#: library/sqlite3.rst:2605 msgid "" "By default, :mod:`!sqlite3` uses :class:`str` to adapt SQLite values with " "the ``TEXT`` data type. This works well for UTF-8 encoded text, but it might " @@ -2927,7 +2977,7 @@ msgid "" "`~Connection.text_factory` to handle such cases." msgstr "" -#: library/sqlite3.rst:2571 +#: library/sqlite3.rst:2611 msgid "" "Because of SQLite's `flexible typing`_, it is not uncommon to encounter " "table columns with the ``TEXT`` data type containing non-UTF-8 encodings, or " @@ -2938,39 +2988,39 @@ msgid "" "text using this :attr:`~Connection.text_factory`:" msgstr "" -#: library/sqlite3.rst:2580 +#: library/sqlite3.rst:2620 msgid "con.text_factory = lambda data: str(data, encoding=\"latin2\")" msgstr "" -#: library/sqlite3.rst:2584 +#: library/sqlite3.rst:2624 msgid "" "For invalid UTF-8 or arbitrary data in stored in ``TEXT`` table columns, you " "can use the following technique, borrowed from the :ref:`unicode-howto`:" msgstr "" -#: library/sqlite3.rst:2587 +#: library/sqlite3.rst:2627 msgid "con.text_factory = lambda data: str(data, errors=\"surrogateescape\")" msgstr "" -#: library/sqlite3.rst:2593 +#: library/sqlite3.rst:2633 msgid "" "The :mod:`!sqlite3` module API does not support strings containing " "surrogates." msgstr "" -#: library/sqlite3.rst:2598 +#: library/sqlite3.rst:2638 msgid ":ref:`unicode-howto`" msgstr "" -#: library/sqlite3.rst:2604 +#: library/sqlite3.rst:2644 msgid "Explanation" msgstr "" -#: library/sqlite3.rst:2610 +#: library/sqlite3.rst:2650 msgid "Transaction control" msgstr "" -#: library/sqlite3.rst:2612 +#: library/sqlite3.rst:2652 msgid "" ":mod:`!sqlite3` offers multiple methods of controlling whether, when and how " "database transactions are opened and closed. :ref:`sqlite3-transaction-" @@ -2978,24 +3028,24 @@ msgid "" "isolation-level` retains the pre-Python 3.12 behaviour." msgstr "" -#: library/sqlite3.rst:2621 +#: library/sqlite3.rst:2661 msgid "Transaction control via the ``autocommit`` attribute" msgstr "" -#: library/sqlite3.rst:2623 +#: library/sqlite3.rst:2663 msgid "" "The recommended way of controlling transaction behaviour is through the :" "attr:`Connection.autocommit` attribute, which should preferably be set using " "the *autocommit* parameter of :func:`connect`." msgstr "" -#: library/sqlite3.rst:2628 +#: library/sqlite3.rst:2668 msgid "" "It is suggested to set *autocommit* to ``False``, which implies :pep:`249`-" "compliant transaction control. This means:" msgstr "" -#: library/sqlite3.rst:2632 +#: library/sqlite3.rst:2672 msgid "" ":mod:`!sqlite3` ensures that a transaction is always open, so :func:" "`connect`, :meth:`Connection.commit`, and :meth:`Connection.rollback` will " @@ -3004,21 +3054,21 @@ msgid "" "when opening transactions." msgstr "" -#: library/sqlite3.rst:2637 +#: library/sqlite3.rst:2677 msgid "Transactions should be committed explicitly using :meth:`!commit`." msgstr "" -#: library/sqlite3.rst:2638 +#: library/sqlite3.rst:2678 msgid "Transactions should be rolled back explicitly using :meth:`!rollback`." msgstr "" -#: library/sqlite3.rst:2639 +#: library/sqlite3.rst:2679 msgid "" "An implicit rollback is performed if the database is :meth:`~Connection." "close`-ed with pending changes." msgstr "" -#: library/sqlite3.rst:2642 +#: library/sqlite3.rst:2682 msgid "" "Set *autocommit* to ``True`` to enable SQLite's `autocommit mode`_. In this " "mode, :meth:`Connection.commit` and :meth:`Connection.rollback` have no " @@ -3027,25 +3077,25 @@ msgid "" "in_transaction` to query the low-level SQLite autocommit mode." msgstr "" -#: library/sqlite3.rst:2650 +#: library/sqlite3.rst:2690 msgid "" "Set *autocommit* to :data:`LEGACY_TRANSACTION_CONTROL` to leave transaction " "control behaviour to the :attr:`Connection.isolation_level` attribute. See :" "ref:`sqlite3-transaction-control-isolation-level` for more information." msgstr "" -#: library/sqlite3.rst:2659 +#: library/sqlite3.rst:2699 msgid "Transaction control via the ``isolation_level`` attribute" msgstr "" -#: library/sqlite3.rst:2663 +#: library/sqlite3.rst:2703 msgid "" "The recommended way of controlling transactions is via the :attr:" "`~Connection.autocommit` attribute. See :ref:`sqlite3-transaction-control-" "autocommit`." msgstr "" -#: library/sqlite3.rst:2667 +#: library/sqlite3.rst:2707 msgid "" "If :attr:`Connection.autocommit` is set to :data:" "`LEGACY_TRANSACTION_CONTROL` (the default), transaction behaviour is " @@ -3053,7 +3103,7 @@ msgid "" "Otherwise, :attr:`!isolation_level` has no effect." msgstr "" -#: library/sqlite3.rst:2673 +#: library/sqlite3.rst:2713 msgid "" "If the connection attribute :attr:`~Connection.isolation_level` is not " "``None``, new transactions are implicitly opened before :meth:`~Cursor." @@ -3067,7 +3117,7 @@ msgid "" "attribute." msgstr "" -#: library/sqlite3.rst:2686 +#: library/sqlite3.rst:2726 msgid "" "If :attr:`~Connection.isolation_level` is set to ``None``, no transactions " "are implicitly opened at all. This leaves the underlying SQLite library in " @@ -3077,33 +3127,33 @@ msgid "" "in_transaction` attribute." msgstr "" -#: library/sqlite3.rst:2694 +#: library/sqlite3.rst:2734 msgid "" "The :meth:`~Cursor.executescript` method implicitly commits any pending " "transaction before execution of the given SQL script, regardless of the " "value of :attr:`~Connection.isolation_level`." msgstr "" -#: library/sqlite3.rst:2698 +#: library/sqlite3.rst:2738 msgid "" ":mod:`!sqlite3` used to implicitly commit an open transaction before DDL " "statements. This is no longer the case." msgstr "" -#: library/sqlite3.rst:2702 +#: library/sqlite3.rst:2742 msgid "" "The recommended way of controlling transactions is now via the :attr:" "`~Connection.autocommit` attribute." msgstr "" -#: library/sqlite3.rst:1453 +#: library/sqlite3.rst:1493 msgid "? (question mark)" msgstr "" -#: library/sqlite3.rst:1454 +#: library/sqlite3.rst:1494 msgid "in SQL statements" msgstr "" -#: library/sqlite3.rst:1454 +#: library/sqlite3.rst:1494 msgid ": (colon)" msgstr "" diff --git a/library/ssl.po b/library/ssl.po index 2c364ad5..f60c6380 100644 --- a/library/ssl.po +++ b/library/ssl.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -50,15 +50,14 @@ msgid "" "are not necessarily appropriate for your application." msgstr "" -#: library/ssl.rst:447 includes/wasm-notavail.rst:3 +#: library/ssl.rst:469 includes/wasm-notavail.rst:3 msgid "Availability" msgstr "" #: includes/wasm-notavail.rst:5 msgid "" -"This module does not work or is not available on WebAssembly platforms " -"``wasm32-emscripten`` and ``wasm32-wasi``. See :ref:`wasm-availability` for " -"more information." +"This module does not work or is not available on WebAssembly. See :ref:`wasm-" +"availability` for more information." msgstr "" #: library/ssl.rst:38 @@ -74,58 +73,60 @@ msgid "" "the :class:`socket.socket` type, and provides a socket-like wrapper that " "also encrypts and decrypts the data going over the socket with SSL. It " "supports additional methods such as :meth:`getpeercert`, which retrieves the " -"certificate of the other side of the connection, and :meth:`cipher`, which " -"retrieves the cipher being used for the secure connection." +"certificate of the other side of the connection, :meth:`cipher`, which " +"retrieves the cipher being used for the secure connection or :meth:" +"`get_verified_chain`, :meth:`get_unverified_chain` which retrieves " +"certificate chain." msgstr "" -#: library/ssl.rst:49 +#: library/ssl.rst:51 msgid "" "For more sophisticated applications, the :class:`ssl.SSLContext` class helps " "manage settings and certificates, which can then be inherited by SSL sockets " "created through the :meth:`SSLContext.wrap_socket` method." msgstr "" -#: library/ssl.rst:53 +#: library/ssl.rst:55 msgid "Updated to support linking with OpenSSL 1.1.0" msgstr "" -#: library/ssl.rst:58 +#: library/ssl.rst:60 msgid "" "OpenSSL 0.9.8, 1.0.0 and 1.0.1 are deprecated and no longer supported. In " "the future the ssl module will require at least OpenSSL 1.0.2 or 1.1.0." msgstr "" -#: library/ssl.rst:64 +#: library/ssl.rst:66 msgid "" ":pep:`644` has been implemented. The ssl module requires OpenSSL 1.1.1 or " "newer." msgstr "" -#: library/ssl.rst:67 +#: library/ssl.rst:69 msgid "" "Use of deprecated constants and functions result in deprecation warnings." msgstr "" -#: library/ssl.rst:71 +#: library/ssl.rst:73 msgid "Functions, Constants, and Exceptions" msgstr "" -#: library/ssl.rst:75 +#: library/ssl.rst:77 msgid "Socket creation" msgstr "" -#: library/ssl.rst:77 +#: library/ssl.rst:79 msgid "" "Instances of :class:`SSLSocket` must be created using the :meth:`SSLContext." "wrap_socket` method. The helper function :func:`create_default_context` " "returns a new context with secure default settings." msgstr "" -#: library/ssl.rst:82 +#: library/ssl.rst:84 msgid "Client socket example with default context and IPv4/IPv6 dual stack::" msgstr "" -#: library/ssl.rst:84 +#: library/ssl.rst:86 msgid "" "import socket\n" "import ssl\n" @@ -138,11 +139,11 @@ msgid "" " print(ssock.version())" msgstr "" -#: library/ssl.rst:95 +#: library/ssl.rst:97 msgid "Client socket example with custom context and IPv4::" msgstr "" -#: library/ssl.rst:97 +#: library/ssl.rst:99 msgid "" "hostname = 'www.python.org'\n" "# PROTOCOL_TLS_CLIENT requires valid cert chain and hostname\n" @@ -154,11 +155,11 @@ msgid "" " print(ssock.version())" msgstr "" -#: library/ssl.rst:107 +#: library/ssl.rst:109 msgid "Server socket example listening on localhost IPv4::" msgstr "" -#: library/ssl.rst:109 +#: library/ssl.rst:111 msgid "" "context = ssl.SSLContext(ssl.PROTOCOL_TLS_SERVER)\n" "context.load_cert_chain('/path/to/certchain.pem', '/path/to/private.key')\n" @@ -171,17 +172,17 @@ msgid "" " ..." msgstr "" -#: library/ssl.rst:121 +#: library/ssl.rst:123 msgid "Context creation" msgstr "" -#: library/ssl.rst:123 +#: library/ssl.rst:125 msgid "" "A convenience function helps create :class:`SSLContext` objects for common " "purposes." msgstr "" -#: library/ssl.rst:128 +#: library/ssl.rst:130 msgid "" "Return a new :class:`SSLContext` object with default settings for the given " "*purpose*. The settings are chosen by the :mod:`ssl` module, and usually " @@ -189,7 +190,7 @@ msgid "" "constructor directly." msgstr "" -#: library/ssl.rst:133 +#: library/ssl.rst:135 msgid "" "*cafile*, *capath*, *cadata* represent optional CA certificates to trust for " "certificate verification, as in :meth:`SSLContext.load_verify_locations`. " @@ -197,7 +198,7 @@ msgid "" "system's default CA certificates instead." msgstr "" -#: library/ssl.rst:139 +#: library/ssl.rst:141 msgid "" "The settings are: :data:`PROTOCOL_TLS_CLIENT` or :data:" "`PROTOCOL_TLS_SERVER`, :data:`OP_NO_SSLv2`, and :data:`OP_NO_SSLv3` with " @@ -209,27 +210,36 @@ msgid "" "certificates." msgstr "" -#: library/ssl.rst:148 +#: library/ssl.rst:150 msgid "" "When :attr:`~SSLContext.keylog_filename` is supported and the environment " "variable :envvar:`SSLKEYLOGFILE` is set, :func:`create_default_context` " "enables key logging." msgstr "" -#: library/ssl.rst:153 +#: library/ssl.rst:154 +msgid "" +"The default settings for this context include :data:" +"`VERIFY_X509_PARTIAL_CHAIN` and :data:`VERIFY_X509_STRICT`. These make the " +"underlying OpenSSL implementation behave more like a conforming " +"implementation of :rfc:`5280`, in exchange for a small amount of " +"incompatibility with older X.509 certificates." +msgstr "" + +#: library/ssl.rst:161 msgid "" "The protocol, options, cipher and other settings may change to more " "restrictive values anytime without prior deprecation. The values represent " "a fair balance between compatibility and security." msgstr "" -#: library/ssl.rst:157 +#: library/ssl.rst:165 msgid "" "If your application needs specific settings, you should create a :class:" "`SSLContext` and apply the settings yourself." msgstr "" -#: library/ssl.rst:161 +#: library/ssl.rst:169 msgid "" "If you find that when certain older clients or servers attempt to connect " "with a :class:`SSLContext` created by this function that they get an error " @@ -240,39 +250,59 @@ msgid "" "still allow SSL 3.0 connections you can re-enable them using::" msgstr "" -#: library/ssl.rst:170 +#: library/ssl.rst:178 msgid "" "ctx = ssl.create_default_context(Purpose.CLIENT_AUTH)\n" "ctx.options &= ~ssl.OP_NO_SSLv3" msgstr "" -#: library/ssl.rst:177 +#: library/ssl.rst:182 +msgid "" +"This context enables :data:`VERIFY_X509_STRICT` by default, which may reject " +"pre-:rfc:`5280` or malformed certificates that the underlying OpenSSL " +"implementation otherwise would accept. While disabling this is not " +"recommended, you can do so using::" +msgstr "" + +#: library/ssl.rst:187 +msgid "" +"ctx = ssl.create_default_context()\n" +"ctx.verify_flags &= ~ssl.VERIFY_X509_STRICT" +msgstr "" + +#: library/ssl.rst:194 msgid "RC4 was dropped from the default cipher string." msgstr "" -#: library/ssl.rst:181 +#: library/ssl.rst:198 msgid "ChaCha20/Poly1305 was added to the default cipher string." msgstr "" -#: library/ssl.rst:183 +#: library/ssl.rst:200 msgid "3DES was dropped from the default cipher string." msgstr "" -#: library/ssl.rst:187 +#: library/ssl.rst:204 msgid "Support for key logging to :envvar:`SSLKEYLOGFILE` was added." msgstr "" -#: library/ssl.rst:191 +#: library/ssl.rst:208 msgid "" "The context now uses :data:`PROTOCOL_TLS_CLIENT` or :data:" "`PROTOCOL_TLS_SERVER` protocol instead of generic :data:`PROTOCOL_TLS`." msgstr "" -#: library/ssl.rst:197 +#: library/ssl.rst:214 +msgid "" +"The context now uses :data:`VERIFY_X509_PARTIAL_CHAIN` and :data:" +"`VERIFY_X509_STRICT` in its default verify flags." +msgstr "" + +#: library/ssl.rst:219 msgid "Exceptions" msgstr "" -#: library/ssl.rst:201 +#: library/ssl.rst:223 msgid "" "Raised to signal an error from the underlying SSL implementation (currently " "provided by the OpenSSL library). This signifies some problem in the higher-" @@ -282,85 +312,85 @@ msgid "" "OpenSSL library." msgstr "" -#: library/ssl.rst:208 +#: library/ssl.rst:230 msgid ":exc:`SSLError` used to be a subtype of :exc:`socket.error`." msgstr "" -#: library/ssl.rst:213 +#: library/ssl.rst:235 msgid "" "A string mnemonic designating the OpenSSL submodule in which the error " "occurred, such as ``SSL``, ``PEM`` or ``X509``. The range of possible " "values depends on the OpenSSL version." msgstr "" -#: library/ssl.rst:221 +#: library/ssl.rst:243 msgid "" "A string mnemonic designating the reason this error occurred, for example " "``CERTIFICATE_VERIFY_FAILED``. The range of possible values depends on the " "OpenSSL version." msgstr "" -#: library/ssl.rst:229 +#: library/ssl.rst:251 msgid "" "A subclass of :exc:`SSLError` raised when trying to read or write and the " "SSL connection has been closed cleanly. Note that this doesn't mean that " "the underlying transport (read TCP) has been closed." msgstr "" -#: library/ssl.rst:237 +#: library/ssl.rst:259 msgid "" "A subclass of :exc:`SSLError` raised by a :ref:`non-blocking SSL socket ` when trying to read or write data, but more data needs to be " "received on the underlying TCP transport before the request can be fulfilled." msgstr "" -#: library/ssl.rst:246 +#: library/ssl.rst:268 msgid "" "A subclass of :exc:`SSLError` raised by a :ref:`non-blocking SSL socket ` when trying to read or write data, but more data needs to be " "sent on the underlying TCP transport before the request can be fulfilled." msgstr "" -#: library/ssl.rst:255 +#: library/ssl.rst:277 msgid "" "A subclass of :exc:`SSLError` raised when a system error was encountered " "while trying to fulfill an operation on a SSL socket. Unfortunately, there " "is no easy way to inspect the original errno number." msgstr "" -#: library/ssl.rst:263 +#: library/ssl.rst:285 msgid "" "A subclass of :exc:`SSLError` raised when the SSL connection has been " "terminated abruptly. Generally, you shouldn't try to reuse the underlying " "transport when this error is encountered." msgstr "" -#: library/ssl.rst:271 +#: library/ssl.rst:293 msgid "" "A subclass of :exc:`SSLError` raised when certificate validation has failed." msgstr "" -#: library/ssl.rst:278 +#: library/ssl.rst:300 msgid "A numeric error number that denotes the verification error." msgstr "" -#: library/ssl.rst:282 +#: library/ssl.rst:304 msgid "A human readable string of the verification error." msgstr "" -#: library/ssl.rst:286 +#: library/ssl.rst:308 msgid "An alias for :exc:`SSLCertVerificationError`." msgstr "" -#: library/ssl.rst:288 +#: library/ssl.rst:310 msgid "The exception is now an alias for :exc:`SSLCertVerificationError`." msgstr "" -#: library/ssl.rst:293 +#: library/ssl.rst:315 msgid "Random generation" msgstr "" -#: library/ssl.rst:297 +#: library/ssl.rst:319 msgid "" "Return *num* cryptographically strong pseudo-random bytes. Raises an :class:" "`SSLError` if the PRNG has not been seeded with enough data or if the " @@ -369,11 +399,11 @@ msgid "" "to seed the PRNG." msgstr "" -#: library/ssl.rst:303 +#: library/ssl.rst:325 msgid "For almost all applications :func:`os.urandom` is preferable." msgstr "" -#: library/ssl.rst:305 +#: library/ssl.rst:327 msgid "" "Read the Wikipedia article, `Cryptographically secure pseudorandom number " "generator (CSPRNG) >> import ssl\n" ">>> timestamp = ssl.cert_time_to_seconds(\"Jan 5 09:34:43 2018 GMT\")\n" @@ -427,18 +457,18 @@ msgid "" "2018-01-05 09:34:43" msgstr "" -#: library/ssl.rst:355 +#: library/ssl.rst:377 msgid "\"notBefore\" or \"notAfter\" dates must use GMT (:rfc:`5280`)." msgstr "" -#: library/ssl.rst:357 +#: library/ssl.rst:379 msgid "" "Interpret the input time as a time in UTC as specified by 'GMT' timezone in " "the input string. Local timezone was used previously. Return an integer (no " "fractions of a second in the input format)" msgstr "" -#: library/ssl.rst:366 +#: library/ssl.rst:388 msgid "" "Given the address ``addr`` of an SSL-protected server, as a (*hostname*, " "*port-number*) pair, fetches the server's certificate, and returns it as a " @@ -452,79 +482,79 @@ msgid "" "parameter." msgstr "" -#: library/ssl.rst:377 +#: library/ssl.rst:399 msgid "This function is now IPv6-compatible." msgstr "" -#: library/ssl.rst:380 +#: library/ssl.rst:402 msgid "" "The default *ssl_version* is changed from :data:`PROTOCOL_SSLv3` to :data:" "`PROTOCOL_TLS` for maximum compatibility with modern servers." msgstr "" -#: library/ssl.rst:384 +#: library/ssl.rst:406 msgid "The *timeout* parameter was added." msgstr "" -#: library/ssl.rst:389 +#: library/ssl.rst:411 msgid "" "Given a certificate as a DER-encoded blob of bytes, returns a PEM-encoded " "string version of the same certificate." msgstr "" -#: library/ssl.rst:394 +#: library/ssl.rst:416 msgid "" "Given a certificate as an ASCII PEM string, returns a DER-encoded sequence " "of bytes for that same certificate." msgstr "" -#: library/ssl.rst:399 +#: library/ssl.rst:421 msgid "" "Returns a named tuple with paths to OpenSSL's default cafile and capath. The " "paths are the same as used by :meth:`SSLContext.set_default_verify_paths`. " "The return value is a :term:`named tuple` ``DefaultVerifyPaths``:" msgstr "" -#: library/ssl.rst:404 +#: library/ssl.rst:426 msgid "" ":attr:`cafile` - resolved path to cafile or ``None`` if the file doesn't " "exist," msgstr "" -#: library/ssl.rst:405 +#: library/ssl.rst:427 msgid "" ":attr:`capath` - resolved path to capath or ``None`` if the directory " "doesn't exist," msgstr "" -#: library/ssl.rst:406 +#: library/ssl.rst:428 msgid "" ":attr:`openssl_cafile_env` - OpenSSL's environment key that points to a " "cafile," msgstr "" -#: library/ssl.rst:407 +#: library/ssl.rst:429 msgid ":attr:`openssl_cafile` - hard coded path to a cafile," msgstr "" -#: library/ssl.rst:408 +#: library/ssl.rst:430 msgid "" ":attr:`openssl_capath_env` - OpenSSL's environment key that points to a " "capath," msgstr "" -#: library/ssl.rst:409 +#: library/ssl.rst:431 msgid ":attr:`openssl_capath` - hard coded path to a capath directory" msgstr "" -#: library/ssl.rst:415 +#: library/ssl.rst:437 msgid "" "Retrieve certificates from Windows' system cert store. *store_name* may be " "one of ``CA``, ``ROOT`` or ``MY``. Windows may provide additional cert " "stores, too." msgstr "" -#: library/ssl.rst:419 +#: library/ssl.rst:441 msgid "" "The function returns a list of (cert_bytes, encoding_type, trust) tuples. " "The encoding_type specifies the encoding of cert_bytes. It is either :const:" @@ -533,41 +563,41 @@ msgid "" "exactly ``True`` if the certificate is trustworthy for all purposes." msgstr "" -#: library/ssl.rst:1555 library/ssl.rst:1853 +#: library/ssl.rst:1599 library/ssl.rst:1898 msgid "Example::" msgstr "" -#: library/ssl.rst:428 +#: library/ssl.rst:450 msgid "" ">>> ssl.enum_certificates(\"CA\")\n" "[(b'data...', 'x509_asn', {'1.3.6.1.5.5.7.3.1', '1.3.6.1.5.5.7.3.2'}),\n" " (b'data...', 'x509_asn', True)]" msgstr "" -#: library/ssl.rst:438 +#: library/ssl.rst:460 msgid "" "Retrieve CRLs from Windows' system cert store. *store_name* may be one of " "``CA``, ``ROOT`` or ``MY``. Windows may provide additional cert stores, too." msgstr "" -#: library/ssl.rst:442 +#: library/ssl.rst:464 msgid "" "The function returns a list of (cert_bytes, encoding_type, trust) tuples. " "The encoding_type specifies the encoding of cert_bytes. It is either :const:" "`x509_asn` for X.509 ASN.1 data or :const:`pkcs_7_asn` for PKCS#7 ASN.1 data." msgstr "" -#: library/ssl.rst:453 +#: library/ssl.rst:475 msgid "Constants" msgstr "" -#: library/ssl.rst:455 +#: library/ssl.rst:477 msgid "" "All constants are now :class:`enum.IntEnum` or :class:`enum.IntFlag` " "collections." msgstr "" -#: library/ssl.rst:461 +#: library/ssl.rst:483 msgid "" "Possible value for :attr:`SSLContext.verify_mode`. Except for :const:" "`PROTOCOL_TLS_CLIENT`, it is the default mode. With client-side sockets, " @@ -575,24 +605,24 @@ msgid "" "expired cert, are ignored and do not abort the TLS/SSL handshake." msgstr "" -#: library/ssl.rst:467 +#: library/ssl.rst:489 msgid "" "In server mode, no certificate is requested from the client, so the client " "does not send any for client cert authentication." msgstr "" -#: library/ssl.rst:2261 +#: library/ssl.rst:2400 msgid "See the discussion of :ref:`ssl-security` below." msgstr "" -#: library/ssl.rst:474 +#: library/ssl.rst:496 msgid "" "Possible value for :attr:`SSLContext.verify_mode`. In client mode, :const:" "`CERT_OPTIONAL` has the same meaning as :const:`CERT_REQUIRED`. It is " "recommended to use :const:`CERT_REQUIRED` for client-side sockets instead." msgstr "" -#: library/ssl.rst:479 +#: library/ssl.rst:501 msgid "" "In server mode, a client certificate request is sent to the client. The " "client may either ignore the request or send a certificate in order perform " @@ -601,13 +631,13 @@ msgid "" "TLS handshake." msgstr "" -#: library/ssl.rst:504 +#: library/ssl.rst:526 msgid "" "Use of this setting requires a valid set of CA certificates to be passed to :" "meth:`SSLContext.load_verify_locations`." msgstr "" -#: library/ssl.rst:490 +#: library/ssl.rst:512 msgid "" "Possible value for :attr:`SSLContext.verify_mode`. In this mode, " "certificates are required from the other side of the socket connection; an :" @@ -619,25 +649,25 @@ msgid "" "attr:`~SSLContext.check_hostname` by default." msgstr "" -#: library/ssl.rst:500 +#: library/ssl.rst:522 msgid "" "With server socket, this mode provides mandatory TLS client cert " "authentication. A client certificate request is sent to the client and the " "client must provide a valid and trusted certificate." msgstr "" -#: library/ssl.rst:509 +#: library/ssl.rst:531 msgid ":class:`enum.IntEnum` collection of CERT_* constants." msgstr "" -#: library/ssl.rst:515 +#: library/ssl.rst:537 msgid "" "Possible value for :attr:`SSLContext.verify_flags`. In this mode, " "certificate revocation lists (CRLs) are not checked. By default OpenSSL does " "neither require nor verify CRLs." msgstr "" -#: library/ssl.rst:523 +#: library/ssl.rst:545 msgid "" "Possible value for :attr:`SSLContext.verify_flags`. In this mode, only the " "peer cert is checked but none of the intermediate CA certificates. The mode " @@ -646,32 +676,32 @@ msgid "" "load_verify_locations`, validation will fail." msgstr "" -#: library/ssl.rst:533 +#: library/ssl.rst:555 msgid "" "Possible value for :attr:`SSLContext.verify_flags`. In this mode, CRLs of " "all certificates in the peer cert chain are checked." msgstr "" -#: library/ssl.rst:540 +#: library/ssl.rst:562 msgid "" "Possible value for :attr:`SSLContext.verify_flags` to disable workarounds " "for broken X.509 certificates." msgstr "" -#: library/ssl.rst:547 +#: library/ssl.rst:569 msgid "" "Possible value for :attr:`SSLContext.verify_flags` to enables proxy " "certificate verification." msgstr "" -#: library/ssl.rst:554 +#: library/ssl.rst:576 msgid "" "Possible value for :attr:`SSLContext.verify_flags`. It instructs OpenSSL to " "prefer trusted certificates when building the trust chain to validate a " "certificate. This flag is enabled by default." msgstr "" -#: library/ssl.rst:562 +#: library/ssl.rst:584 msgid "" "Possible value for :attr:`SSLContext.verify_flags`. It instructs OpenSSL to " "accept intermediate CAs in the trust store to be treated as trust-anchors, " @@ -680,25 +710,25 @@ msgid "" "to trust its ancestor root CA." msgstr "" -#: library/ssl.rst:573 +#: library/ssl.rst:595 msgid ":class:`enum.IntFlag` collection of VERIFY_* constants." msgstr "" -#: library/ssl.rst:579 +#: library/ssl.rst:601 msgid "" "Selects the highest protocol version that both the client and server " "support. Despite the name, this option can select both \"SSL\" and \"TLS\" " "protocols." msgstr "" -#: library/ssl.rst:586 +#: library/ssl.rst:608 msgid "" "TLS clients and servers require different default settings for secure " "communication. The generic TLS protocol constant is deprecated in favor of :" "data:`PROTOCOL_TLS_CLIENT` and :data:`PROTOCOL_TLS_SERVER`." msgstr "" -#: library/ssl.rst:592 +#: library/ssl.rst:614 msgid "" "Auto-negotiate the highest protocol version that both the client and server " "support, and configure the context client-side connections. The protocol " @@ -706,35 +736,35 @@ msgid "" "default." msgstr "" -#: library/ssl.rst:601 +#: library/ssl.rst:623 msgid "" "Auto-negotiate the highest protocol version that both the client and server " "support, and configure the context server-side connections." msgstr "" -#: library/ssl.rst:608 +#: library/ssl.rst:630 msgid "Alias for :data:`PROTOCOL_TLS`." msgstr "" -#: library/ssl.rst:612 +#: library/ssl.rst:634 msgid "Use :data:`PROTOCOL_TLS` instead." msgstr "" -#: library/ssl.rst:616 +#: library/ssl.rst:638 msgid "Selects SSL version 3 as the channel encryption protocol." msgstr "" -#: library/ssl.rst:618 +#: library/ssl.rst:640 msgid "" "This protocol is not available if OpenSSL is compiled with the ``no-ssl3`` " "option." msgstr "" -#: library/ssl.rst:623 +#: library/ssl.rst:645 msgid "SSL version 3 is insecure. Its use is highly discouraged." msgstr "" -#: library/ssl.rst:627 +#: library/ssl.rst:649 msgid "" "OpenSSL has deprecated all version specific protocols. Use the default " "protocol :data:`PROTOCOL_TLS_SERVER` or :data:`PROTOCOL_TLS_CLIENT` with :" @@ -742,87 +772,87 @@ msgid "" "instead." msgstr "" -#: library/ssl.rst:635 +#: library/ssl.rst:657 msgid "Selects TLS version 1.0 as the channel encryption protocol." msgstr "" -#: library/ssl.rst:650 library/ssl.rst:661 +#: library/ssl.rst:672 library/ssl.rst:683 msgid "OpenSSL has deprecated all version specific protocols." msgstr "" -#: library/ssl.rst:643 +#: library/ssl.rst:665 msgid "" "Selects TLS version 1.1 as the channel encryption protocol. Available only " "with openssl version 1.0.1+." msgstr "" -#: library/ssl.rst:654 +#: library/ssl.rst:676 msgid "" "Selects TLS version 1.2 as the channel encryption protocol. Available only " "with openssl version 1.0.1+." msgstr "" -#: library/ssl.rst:665 +#: library/ssl.rst:687 msgid "" "Enables workarounds for various bugs present in other SSL implementations. " "This option is set by default. It does not necessarily set the same flags " "as OpenSSL's ``SSL_OP_ALL`` constant." msgstr "" -#: library/ssl.rst:673 +#: library/ssl.rst:695 msgid "" "Prevents an SSLv2 connection. This option is only applicable in conjunction " "with :const:`PROTOCOL_TLS`. It prevents the peers from choosing SSLv2 as " "the protocol version." msgstr "" -#: library/ssl.rst:681 +#: library/ssl.rst:703 msgid "SSLv2 is deprecated" msgstr "" -#: library/ssl.rst:685 +#: library/ssl.rst:707 msgid "" "Prevents an SSLv3 connection. This option is only applicable in conjunction " "with :const:`PROTOCOL_TLS`. It prevents the peers from choosing SSLv3 as " "the protocol version." msgstr "" -#: library/ssl.rst:693 +#: library/ssl.rst:715 msgid "SSLv3 is deprecated" msgstr "" -#: library/ssl.rst:697 +#: library/ssl.rst:719 msgid "" "Prevents a TLSv1 connection. This option is only applicable in conjunction " "with :const:`PROTOCOL_TLS`. It prevents the peers from choosing TLSv1 as " "the protocol version." msgstr "" -#: library/ssl.rst:703 +#: library/ssl.rst:725 msgid "" "The option is deprecated since OpenSSL 1.1.0, use the new :attr:`SSLContext." "minimum_version` and :attr:`SSLContext.maximum_version` instead." msgstr "" -#: library/ssl.rst:710 +#: library/ssl.rst:732 msgid "" "Prevents a TLSv1.1 connection. This option is only applicable in conjunction " "with :const:`PROTOCOL_TLS`. It prevents the peers from choosing TLSv1.1 as " "the protocol version. Available only with openssl version 1.0.1+." msgstr "" -#: library/ssl.rst:727 +#: library/ssl.rst:749 msgid "The option is deprecated since OpenSSL 1.1.0." msgstr "" -#: library/ssl.rst:721 +#: library/ssl.rst:743 msgid "" "Prevents a TLSv1.2 connection. This option is only applicable in conjunction " "with :const:`PROTOCOL_TLS`. It prevents the peers from choosing TLSv1.2 as " "the protocol version. Available only with openssl version 1.0.1+." msgstr "" -#: library/ssl.rst:732 +#: library/ssl.rst:754 msgid "" "Prevents a TLSv1.3 connection. This option is only applicable in conjunction " "with :const:`PROTOCOL_TLS`. It prevents the peers from choosing TLSv1.3 as " @@ -831,75 +861,75 @@ msgid "" "defaults to *0*." msgstr "" -#: library/ssl.rst:740 +#: library/ssl.rst:762 msgid "" "The option is deprecated since OpenSSL 1.1.0. It was added to 2.7.15 and " "3.6.3 for backwards compatibility with OpenSSL 1.0.2." msgstr "" -#: library/ssl.rst:746 +#: library/ssl.rst:768 msgid "" "Disable all renegotiation in TLSv1.2 and earlier. Do not send HelloRequest " "messages, and ignore renegotiation requests via ClientHello." msgstr "" -#: library/ssl.rst:749 +#: library/ssl.rst:771 msgid "This option is only available with OpenSSL 1.1.0h and later." msgstr "" -#: library/ssl.rst:755 +#: library/ssl.rst:777 msgid "" "Use the server's cipher ordering preference, rather than the client's. This " "option has no effect on client sockets and SSLv2 server sockets." msgstr "" -#: library/ssl.rst:762 +#: library/ssl.rst:784 msgid "" "Prevents reuse of the same DH key for distinct SSL sessions. This improves " "forward secrecy but requires more computational resources. This option only " "applies to server sockets." msgstr "" -#: library/ssl.rst:770 +#: library/ssl.rst:792 msgid "" "Prevents reuse of the same ECDH key for distinct SSL sessions. This " "improves forward secrecy but requires more computational resources. This " "option only applies to server sockets." msgstr "" -#: library/ssl.rst:778 +#: library/ssl.rst:800 msgid "" "Send dummy Change Cipher Spec (CCS) messages in TLS 1.3 handshake to make a " "TLS 1.3 connection look more like a TLS 1.2 connection." msgstr "" -#: library/ssl.rst:781 +#: library/ssl.rst:803 msgid "This option is only available with OpenSSL 1.1.1 and later." msgstr "" -#: library/ssl.rst:787 +#: library/ssl.rst:809 msgid "" "Disable compression on the SSL channel. This is useful if the application " "protocol supports its own compression scheme." msgstr "" -#: library/ssl.rst:794 +#: library/ssl.rst:816 msgid ":class:`enum.IntFlag` collection of OP_* constants." msgstr "" -#: library/ssl.rst:798 +#: library/ssl.rst:820 msgid "Prevent client side from requesting a session ticket." msgstr "" -#: library/ssl.rst:804 +#: library/ssl.rst:826 msgid "Ignore unexpected shutdown of TLS connections." msgstr "" -#: library/ssl.rst:822 +#: library/ssl.rst:844 msgid "This option is only available with OpenSSL 3.0.0 and later." msgstr "" -#: library/ssl.rst:812 +#: library/ssl.rst:834 msgid "" "Enable the use of the kernel TLS. To benefit from the feature, OpenSSL must " "have been compiled with support for it, and the negotiated cipher suites and " @@ -907,7 +937,7 @@ msgid "" "platform and kernel version)." msgstr "" -#: library/ssl.rst:817 +#: library/ssl.rst:839 msgid "" "Note that with enabled kernel TLS some cryptographic operations are " "performed by the kernel directly and not via any available OpenSSL " @@ -915,38 +945,38 @@ msgid "" "requires all cryptographic operations to be performed by the FIPS provider." msgstr "" -#: library/ssl.rst:828 +#: library/ssl.rst:850 msgid "" "Allow legacy insecure renegotiation between OpenSSL and unpatched servers " "only." msgstr "" -#: library/ssl.rst:835 +#: library/ssl.rst:857 msgid "" "Whether the OpenSSL library has built-in support for the *Application-Layer " "Protocol Negotiation* TLS extension as described in :rfc:`7301`." msgstr "" -#: library/ssl.rst:842 +#: library/ssl.rst:864 msgid "" "Whether the OpenSSL library has built-in support not checking subject common " "name and :attr:`SSLContext.hostname_checks_common_name` is writeable." msgstr "" -#: library/ssl.rst:850 +#: library/ssl.rst:872 msgid "" "Whether the OpenSSL library has built-in support for the Elliptic Curve-" "based Diffie-Hellman key exchange. This should be true unless the feature " "was explicitly disabled by the distributor." msgstr "" -#: library/ssl.rst:858 +#: library/ssl.rst:880 msgid "" "Whether the OpenSSL library has built-in support for the *Server Name " "Indication* extension (as defined in :rfc:`6066`)." msgstr "" -#: library/ssl.rst:865 +#: library/ssl.rst:887 msgid "" "Whether the OpenSSL library has built-in support for the *Next Protocol " "Negotiation* as described in the `Application Layer Protocol Negotiation " @@ -955,69 +985,73 @@ msgid "" "advertise which protocols you want to support." msgstr "" -#: library/ssl.rst:875 +#: library/ssl.rst:897 msgid "" "Whether the OpenSSL library has built-in support for the SSL 2.0 protocol." msgstr "" -#: library/ssl.rst:881 +#: library/ssl.rst:903 msgid "" "Whether the OpenSSL library has built-in support for the SSL 3.0 protocol." msgstr "" -#: library/ssl.rst:887 +#: library/ssl.rst:909 msgid "" "Whether the OpenSSL library has built-in support for the TLS 1.0 protocol." msgstr "" -#: library/ssl.rst:893 +#: library/ssl.rst:915 msgid "" "Whether the OpenSSL library has built-in support for the TLS 1.1 protocol." msgstr "" -#: library/ssl.rst:899 +#: library/ssl.rst:921 msgid "" "Whether the OpenSSL library has built-in support for the TLS 1.2 protocol." msgstr "" -#: library/ssl.rst:905 +#: library/ssl.rst:927 msgid "" "Whether the OpenSSL library has built-in support for the TLS 1.3 protocol." msgstr "" -#: library/ssl.rst:911 +#: library/ssl.rst:933 +msgid "Whether the OpenSSL library has built-in support for TLS-PSK." +msgstr "" + +#: library/ssl.rst:939 msgid "" "List of supported TLS channel binding types. Strings in this list can be " "used as arguments to :meth:`SSLSocket.get_channel_binding`." msgstr "" -#: library/ssl.rst:918 +#: library/ssl.rst:946 msgid "The version string of the OpenSSL library loaded by the interpreter::" msgstr "" -#: library/ssl.rst:920 +#: library/ssl.rst:948 msgid "" ">>> ssl.OPENSSL_VERSION\n" "'OpenSSL 1.0.2k 26 Jan 2017'" msgstr "" -#: library/ssl.rst:927 +#: library/ssl.rst:955 msgid "" "A tuple of five integers representing version information about the OpenSSL " "library::" msgstr "" -#: library/ssl.rst:930 +#: library/ssl.rst:958 msgid "" ">>> ssl.OPENSSL_VERSION_INFO\n" "(1, 0, 2, 11, 15)" msgstr "" -#: library/ssl.rst:937 +#: library/ssl.rst:965 msgid "The raw version number of the OpenSSL library, as a single integer::" msgstr "" -#: library/ssl.rst:939 +#: library/ssl.rst:967 msgid "" ">>> ssl.OPENSSL_VERSION_NUMBER\n" "268443839\n" @@ -1025,7 +1059,7 @@ msgid "" "'0x100020bf'" msgstr "" -#: library/ssl.rst:950 +#: library/ssl.rst:978 msgid "" "Alert Descriptions from :rfc:`5246` and others. The `IANA TLS Alert Registry " "`." msgstr "" -#: library/ssl.rst:1049 +#: library/ssl.rst:1077 msgid "" "Instances of :class:`SSLSocket` must be created using the :meth:`SSLContext." "wrap_socket` method." msgstr "" -#: library/ssl.rst:1052 +#: library/ssl.rst:1080 msgid "The :meth:`sendfile` method was added." msgstr "" -#: library/ssl.rst:1055 +#: library/ssl.rst:1083 msgid "" "The :meth:`shutdown` does not reset the socket timeout each time bytes are " "received or sent. The socket timeout is now the maximum total duration of " "the shutdown." msgstr "" -#: library/ssl.rst:1060 +#: library/ssl.rst:1088 msgid "" "It is deprecated to create a :class:`SSLSocket` instance directly, use :meth:" "`SSLContext.wrap_socket` to wrap a socket." msgstr "" -#: library/ssl.rst:1064 +#: library/ssl.rst:1092 msgid "" ":class:`SSLSocket` instances must to created with :meth:`~SSLContext." "wrap_socket`. In earlier versions, it was possible to create instances " "directly. This was never documented or officially supported." msgstr "" -#: library/ssl.rst:1070 +#: library/ssl.rst:1098 msgid "" "Python now uses ``SSL_read_ex`` and ``SSL_write_ex`` internally. The " "functions support reading and writing of data larger than 2 GB. Writing zero-" "length data no longer fails with a protocol violation error." msgstr "" -#: library/ssl.rst:1075 +#: library/ssl.rst:1103 msgid "SSL sockets also have the following additional methods and attributes:" msgstr "" -#: library/ssl.rst:1079 +#: library/ssl.rst:1107 msgid "" "Read up to *len* bytes of data from the SSL socket and return the result as " "a ``bytes`` instance. If *buffer* is specified, then read into the buffer " "instead, and return the number of bytes read." msgstr "" -#: library/ssl.rst:1083 +#: library/ssl.rst:1111 msgid "" "Raise :exc:`SSLWantReadError` or :exc:`SSLWantWriteError` if the socket is :" "ref:`non-blocking ` and the read would block." msgstr "" -#: library/ssl.rst:1086 +#: library/ssl.rst:1114 msgid "" "As at any time a re-negotiation is possible, a call to :meth:`read` can also " "cause write operations." msgstr "" -#: library/ssl.rst:1089 +#: library/ssl.rst:1117 msgid "" "The socket timeout is no longer reset each time bytes are received or sent. " "The socket timeout is now the maximum total duration to read up to *len* " "bytes." msgstr "" -#: library/ssl.rst:1094 +#: library/ssl.rst:1122 msgid "Use :meth:`~SSLSocket.recv` instead of :meth:`~SSLSocket.read`." msgstr "" -#: library/ssl.rst:1099 +#: library/ssl.rst:1127 msgid "" "Write *buf* to the SSL socket and return the number of bytes written. The " "*buf* argument must be an object supporting the buffer interface." msgstr "" -#: library/ssl.rst:1102 +#: library/ssl.rst:1130 msgid "" "Raise :exc:`SSLWantReadError` or :exc:`SSLWantWriteError` if the socket is :" "ref:`non-blocking ` and the write would block." msgstr "" -#: library/ssl.rst:1105 +#: library/ssl.rst:1133 msgid "" "As at any time a re-negotiation is possible, a call to :meth:`write` can " "also cause read operations." msgstr "" -#: library/ssl.rst:1108 +#: library/ssl.rst:1136 msgid "" "The socket timeout is no longer reset each time bytes are received or sent. " "The socket timeout is now the maximum total duration to write *buf*." msgstr "" -#: library/ssl.rst:1112 +#: library/ssl.rst:1140 msgid "Use :meth:`~SSLSocket.send` instead of :meth:`~SSLSocket.write`." msgstr "" -#: library/ssl.rst:1117 +#: library/ssl.rst:1145 msgid "" "The :meth:`~SSLSocket.read` and :meth:`~SSLSocket.write` methods are the low-" "level methods that read and write unencrypted, application-level data and " @@ -1278,30 +1312,30 @@ msgid "" "unwrap` was not called." msgstr "" -#: library/ssl.rst:1123 +#: library/ssl.rst:1151 msgid "" "Normally you should use the socket API methods like :meth:`~socket.socket." "recv` and :meth:`~socket.socket.send` instead of these methods." msgstr "" -#: library/ssl.rst:1129 +#: library/ssl.rst:1157 msgid "Perform the SSL setup handshake." msgstr "" -#: library/ssl.rst:1131 +#: library/ssl.rst:1159 msgid "" "The handshake method also performs :func:`match_hostname` when the :attr:" "`~SSLContext.check_hostname` attribute of the socket's :attr:`~SSLSocket." "context` is true." msgstr "" -#: library/ssl.rst:1136 +#: library/ssl.rst:1164 msgid "" "The socket timeout is no longer reset each time bytes are received or sent. " "The socket timeout is now the maximum total duration of the handshake." msgstr "" -#: library/ssl.rst:1140 +#: library/ssl.rst:1168 msgid "" "Hostname or IP address is matched by OpenSSL during handshake. The function :" "func:`match_hostname` is no longer used. In case OpenSSL refuses a hostname " @@ -1309,14 +1343,14 @@ msgid "" "sent to the peer." msgstr "" -#: library/ssl.rst:1148 +#: library/ssl.rst:1176 msgid "" "If there is no certificate for the peer on the other end of the connection, " "return ``None``. If the SSL handshake hasn't been done yet, raise :exc:" "`ValueError`." msgstr "" -#: library/ssl.rst:1152 +#: library/ssl.rst:1180 msgid "" "If the ``binary_form`` parameter is :const:`False`, and a certificate was " "received from the peer, this method returns a :class:`dict` instance. If " @@ -1328,7 +1362,7 @@ msgid "" "also be a ``subjectAltName`` key in the dictionary." msgstr "" -#: library/ssl.rst:1161 +#: library/ssl.rst:1189 msgid "" "The ``subject`` and ``issuer`` fields are tuples containing the sequence of " "relative distinguished names (RDNs) given in the certificate's data " @@ -1336,7 +1370,7 @@ msgid "" "value pairs. Here is a real-world example::" msgstr "" -#: library/ssl.rst:1166 +#: library/ssl.rst:1194 msgid "" "{'issuer': ((('countryName', 'IL'),),\n" " (('organizationName', 'StartCom Ltd.'),),\n" @@ -1359,7 +1393,7 @@ msgid "" " 'version': 3}" msgstr "" -#: library/ssl.rst:1185 +#: library/ssl.rst:1213 msgid "" "If the ``binary_form`` parameter is :const:`True`, and a certificate was " "provided, this method returns the DER-encoded form of the entire certificate " @@ -1368,13 +1402,13 @@ msgid "" "socket's role:" msgstr "" -#: library/ssl.rst:1191 +#: library/ssl.rst:1219 msgid "" "for a client SSL socket, the server will always provide a certificate, " "regardless of whether validation was required;" msgstr "" -#: library/ssl.rst:1194 +#: library/ssl.rst:1222 msgid "" "for a server SSL socket, the client will only provide a certificate when " "requested by the server; therefore :meth:`getpeercert` will return :const:" @@ -1382,28 +1416,41 @@ msgid "" "or :const:`CERT_REQUIRED`)." msgstr "" -#: library/ssl.rst:1199 +#: library/ssl.rst:1227 msgid "See also :attr:`SSLContext.check_hostname`." msgstr "" -#: library/ssl.rst:1201 +#: library/ssl.rst:1229 msgid "" "The returned dictionary includes additional items such as ``issuer`` and " "``notBefore``." msgstr "" -#: library/ssl.rst:1205 +#: library/ssl.rst:1233 msgid "" ":exc:`ValueError` is raised when the handshake isn't done. The returned " "dictionary includes additional X509v3 extension items such as " "``crlDistributionPoints``, ``caIssuers`` and ``OCSP`` URIs." msgstr "" -#: library/ssl.rst:1210 +#: library/ssl.rst:1238 msgid "IPv6 address strings no longer have a trailing new line." msgstr "" -#: library/ssl.rst:1215 +#: library/ssl.rst:1243 +msgid "" +"Returns verified certificate chain provided by the other end of the SSL " +"channel as a list of DER-encoded bytes. If certificate verification was " +"disabled method acts the same as :meth:`~SSLSocket.get_unverified_chain`." +msgstr "" + +#: library/ssl.rst:1252 +msgid "" +"Returns raw certificate chain provided by the other end of the SSL channel " +"as a list of DER-encoded bytes." +msgstr "" + +#: library/ssl.rst:1259 msgid "" "Returns a three-value tuple containing the name of the cipher being used, " "the version of the SSL protocol that defines its use, and the number of " @@ -1411,7 +1458,7 @@ msgid "" "``None``." msgstr "" -#: library/ssl.rst:1221 +#: library/ssl.rst:1265 msgid "" "Return the list of ciphers available in both the client and server. Each " "entry of the returned list is a three-value tuple containing the name of the " @@ -1421,25 +1468,25 @@ msgid "" "socket." msgstr "" -#: library/ssl.rst:1232 +#: library/ssl.rst:1276 msgid "" "Return the compression algorithm being used as a string, or ``None`` if the " "connection isn't compressed." msgstr "" -#: library/ssl.rst:1235 +#: library/ssl.rst:1279 msgid "" "If the higher-level protocol supports its own compression mechanism, you can " "use :data:`OP_NO_COMPRESSION` to disable SSL-level compression." msgstr "" -#: library/ssl.rst:1242 +#: library/ssl.rst:1286 msgid "" "Get channel binding data for current connection, as a bytes object. Returns " "``None`` if not connected or the handshake has not been completed." msgstr "" -#: library/ssl.rst:1245 +#: library/ssl.rst:1289 msgid "" "The *cb_type* parameter allow selection of the desired channel binding type. " "Valid channel binding types are listed in the :data:`CHANNEL_BINDING_TYPES` " @@ -1448,7 +1495,7 @@ msgid "" "channel binding type is requested." msgstr "" -#: library/ssl.rst:1255 +#: library/ssl.rst:1299 msgid "" "Return the protocol that was selected during the TLS handshake. If :meth:" "`SSLContext.set_alpn_protocols` was not called, if the other party does not " @@ -1456,7 +1503,7 @@ msgid "" "protocols, or if the handshake has not happened yet, ``None`` is returned." msgstr "" -#: library/ssl.rst:1265 +#: library/ssl.rst:1309 msgid "" "Return the higher-level protocol that was selected during the TLS/SSL " "handshake. If :meth:`SSLContext.set_npn_protocols` was not called, or if the " @@ -1464,11 +1511,11 @@ msgid "" "this will return ``None``." msgstr "" -#: library/ssl.rst:1643 +#: library/ssl.rst:1687 msgid "NPN has been superseded by ALPN" msgstr "" -#: library/ssl.rst:1278 +#: library/ssl.rst:1322 msgid "" "Performs the SSL shutdown handshake, which removes the TLS layer from the " "underlying socket, and returns the underlying socket object. This can be " @@ -1477,7 +1524,7 @@ msgid "" "other side of the connection, rather than the original socket." msgstr "" -#: library/ssl.rst:1286 +#: library/ssl.rst:1330 msgid "" "Requests post-handshake authentication (PHA) from a TLS 1.3 client. PHA can " "only be initiated for a TLS 1.3 connection from a server-side socket, after " @@ -1485,26 +1532,26 @@ msgid "" "`SSLContext.post_handshake_auth`." msgstr "" -#: library/ssl.rst:1291 +#: library/ssl.rst:1335 msgid "" "The method does not perform a cert exchange immediately. The server-side " "sends a CertificateRequest during the next write event and expects the " "client to respond with a certificate on the next read event." msgstr "" -#: library/ssl.rst:1295 +#: library/ssl.rst:1339 msgid "" "If any precondition isn't met (e.g. not TLS 1.3, PHA not enabled), an :exc:" "`SSLError` is raised." msgstr "" -#: library/ssl.rst:1299 +#: library/ssl.rst:1343 msgid "" "Only available with OpenSSL 1.1.1 and TLS 1.3 enabled. Without TLS 1.3 " "support, the method raises :exc:`NotImplementedError`." msgstr "" -#: library/ssl.rst:1306 +#: library/ssl.rst:1350 msgid "" "Return the actual SSL protocol version negotiated by the connection as a " "string, or ``None`` if no secure connection is established. As of this " @@ -1513,29 +1560,29 @@ msgid "" "may define more return values." msgstr "" -#: library/ssl.rst:1316 +#: library/ssl.rst:1360 msgid "" "Returns the number of already decrypted bytes available for read, pending on " "the connection." msgstr "" -#: library/ssl.rst:1321 +#: library/ssl.rst:1365 msgid "The :class:`SSLContext` object this SSL socket is tied to." msgstr "" -#: library/ssl.rst:1327 +#: library/ssl.rst:1371 msgid "" "A boolean which is ``True`` for server-side sockets and ``False`` for client-" "side sockets." msgstr "" -#: library/ssl.rst:1334 +#: library/ssl.rst:1378 msgid "" "Hostname of the server: :class:`str` type, or ``None`` for server-side " "socket or if the hostname was not specified in the constructor." msgstr "" -#: library/ssl.rst:1339 +#: library/ssl.rst:1383 msgid "" "The attribute is now always ASCII text. When ``server_hostname`` is an " "internationalized domain name (IDN), this attribute now stores the A-label " @@ -1543,7 +1590,7 @@ msgid "" "org\"``)." msgstr "" -#: library/ssl.rst:1347 +#: library/ssl.rst:1391 msgid "" "The :class:`SSLSession` for this SSL connection. The session is available " "for client and server side sockets after the TLS handshake has been " @@ -1551,11 +1598,11 @@ msgid "" "`~SSLSocket.do_handshake` has been called to reuse a session." msgstr "" -#: library/ssl.rst:1360 +#: library/ssl.rst:1404 msgid "SSL Contexts" msgstr "" -#: library/ssl.rst:1364 +#: library/ssl.rst:1408 msgid "" "An SSL context holds various data longer-lived than single SSL connections, " "such as SSL configuration options, certificate(s) and private key(s). It " @@ -1563,7 +1610,7 @@ msgid "" "speed up repeated connections from the same clients." msgstr "" -#: library/ssl.rst:1371 +#: library/ssl.rst:1415 msgid "" "Create a new SSL context. You may pass *protocol* which must be one of the " "``PROTOCOL_*`` constants defined in this module. The parameter specifies " @@ -1574,105 +1621,105 @@ msgid "" "provides the most compatibility with other versions." msgstr "" -#: library/ssl.rst:1380 +#: library/ssl.rst:1424 msgid "" "Here's a table showing which versions in a client (down the side) can " "connect to which versions in a server (along the top):" msgstr "" -#: library/ssl.rst:1386 +#: library/ssl.rst:1430 msgid "*client* / **server**" msgstr "" -#: library/ssl.rst:1386 +#: library/ssl.rst:1430 msgid "**SSLv2**" msgstr "" -#: library/ssl.rst:1386 +#: library/ssl.rst:1430 msgid "**SSLv3**" msgstr "" -#: library/ssl.rst:1386 +#: library/ssl.rst:1430 msgid "**TLS** [3]_" msgstr "" -#: library/ssl.rst:1386 +#: library/ssl.rst:1430 msgid "**TLSv1**" msgstr "" -#: library/ssl.rst:1386 +#: library/ssl.rst:1430 msgid "**TLSv1.1**" msgstr "" -#: library/ssl.rst:1386 +#: library/ssl.rst:1430 msgid "**TLSv1.2**" msgstr "" -#: library/ssl.rst:1388 +#: library/ssl.rst:1432 msgid "*SSLv2*" msgstr "" -#: library/ssl.rst:1389 library/ssl.rst:1391 library/ssl.rst:1393 +#: library/ssl.rst:1433 library/ssl.rst:1435 library/ssl.rst:1437 msgid "yes" msgstr "" -#: library/ssl.rst:1389 library/ssl.rst:1392 library/ssl.rst:1393 +#: library/ssl.rst:1433 library/ssl.rst:1436 library/ssl.rst:1437 msgid "no" msgstr "" -#: library/ssl.rst:1390 +#: library/ssl.rst:1434 msgid "no [1]_" msgstr "" -#: library/ssl.rst:1389 +#: library/ssl.rst:1433 msgid "*SSLv3*" msgstr "" -#: library/ssl.rst:1390 +#: library/ssl.rst:1434 msgid "no [2]_" msgstr "" -#: library/ssl.rst:1390 +#: library/ssl.rst:1434 msgid "*TLS* (*SSLv23*) [3]_" msgstr "" -#: library/ssl.rst:1391 +#: library/ssl.rst:1435 msgid "*TLSv1*" msgstr "" -#: library/ssl.rst:1392 +#: library/ssl.rst:1436 msgid "*TLSv1.1*" msgstr "" -#: library/ssl.rst:1393 +#: library/ssl.rst:1437 msgid "*TLSv1.2*" msgstr "" -#: library/ssl.rst:1396 +#: library/ssl.rst:1440 msgid "Footnotes" msgstr "" -#: library/ssl.rst:1397 +#: library/ssl.rst:1441 msgid ":class:`SSLContext` disables SSLv2 with :data:`OP_NO_SSLv2` by default." msgstr "" -#: library/ssl.rst:1398 +#: library/ssl.rst:1442 msgid ":class:`SSLContext` disables SSLv3 with :data:`OP_NO_SSLv3` by default." msgstr "" -#: library/ssl.rst:1399 +#: library/ssl.rst:1443 msgid "" "TLS 1.3 protocol will be available with :data:`PROTOCOL_TLS` in OpenSSL >= " "1.1.1. There is no dedicated PROTOCOL constant for just TLS 1.3." msgstr "" -#: library/ssl.rst:1404 +#: library/ssl.rst:1448 msgid "" ":func:`create_default_context` lets the :mod:`ssl` module choose security " "settings for a given purpose." msgstr "" -#: library/ssl.rst:1409 +#: library/ssl.rst:1453 msgid "" "The context is created with secure default values. The options :data:" "`OP_NO_COMPRESSION`, :data:`OP_CIPHER_SERVER_PREFERENCE`, :data:" @@ -1682,14 +1729,14 @@ msgid "" "ciphers and no ``MD5`` ciphers." msgstr "" -#: library/ssl.rst:1419 +#: library/ssl.rst:1463 msgid "" ":class:`SSLContext` without protocol argument is deprecated. The context " "class will either require :data:`PROTOCOL_TLS_CLIENT` or :data:" "`PROTOCOL_TLS_SERVER` protocol in the future." msgstr "" -#: library/ssl.rst:1425 +#: library/ssl.rst:1469 msgid "" "The default cipher suites now include only secure AES and ChaCha20 ciphers " "with forward secrecy and security level 2. RSA and DH keys with less than " @@ -1698,7 +1745,7 @@ msgid "" "use TLS 1.2 as minimum TLS version." msgstr "" -#: library/ssl.rst:1433 +#: library/ssl.rst:1477 msgid "" ":class:`SSLContext` only supports limited mutation once it has been used by " "a connection. Adding new certificates to the internal trust store is " @@ -1706,35 +1753,35 @@ msgid "" "may result in surprising behavior." msgstr "" -#: library/ssl.rst:1440 +#: library/ssl.rst:1484 msgid "" ":class:`SSLContext` is designed to be shared and used by multiple " "connections. Thus, it is thread-safe as long as it is not reconfigured after " "being used by a connection." msgstr "" -#: library/ssl.rst:1445 +#: library/ssl.rst:1489 msgid ":class:`SSLContext` objects have the following methods and attributes:" msgstr "" -#: library/ssl.rst:1449 +#: library/ssl.rst:1493 msgid "" "Get statistics about quantities of loaded X.509 certificates, count of X.509 " "certificates flagged as CA certificates and certificate revocation lists as " "dictionary." msgstr "" -#: library/ssl.rst:1453 +#: library/ssl.rst:1497 msgid "Example for a context with one CA cert and one other cert::" msgstr "" -#: library/ssl.rst:1455 +#: library/ssl.rst:1499 msgid "" ">>> context.cert_store_stats()\n" "{'crl': 0, 'x509_ca': 1, 'x509': 2}" msgstr "" -#: library/ssl.rst:1463 +#: library/ssl.rst:1507 msgid "" "Load a private key and the corresponding certificate. The *certfile* string " "must be the path to a single file in PEM format containing the certificate " @@ -1745,7 +1792,7 @@ msgid "" "more information on how the certificate is stored in the *certfile*." msgstr "" -#: library/ssl.rst:1472 +#: library/ssl.rst:1516 msgid "" "The *password* argument may be a function to call to get the password for " "decrypting the private key. It will only be called if the private key is " @@ -1757,24 +1804,24 @@ msgid "" "encrypted and no password is needed." msgstr "" -#: library/ssl.rst:1481 +#: library/ssl.rst:1525 msgid "" "If the *password* argument is not specified and a password is required, " "OpenSSL's built-in password prompting mechanism will be used to " "interactively prompt the user for a password." msgstr "" -#: library/ssl.rst:1485 +#: library/ssl.rst:1529 msgid "" "An :class:`SSLError` is raised if the private key doesn't match with the " "certificate." msgstr "" -#: library/ssl.rst:1488 +#: library/ssl.rst:1532 msgid "New optional argument *password*." msgstr "" -#: library/ssl.rst:1493 +#: library/ssl.rst:1537 msgid "" "Load a set of default \"certification authority\" (CA) certificates from " "default locations. On Windows it loads CA certs from the ``CA`` and ``ROOT`` " @@ -1783,7 +1830,7 @@ msgid "" "from other locations, too." msgstr "" -#: library/ssl.rst:1499 +#: library/ssl.rst:1543 msgid "" "The *purpose* flag specifies what kind of CA certificates are loaded. The " "default settings :const:`Purpose.SERVER_AUTH` loads certificates, that are " @@ -1792,35 +1839,35 @@ msgid "" "certificate verification on the server side." msgstr "" -#: library/ssl.rst:1509 +#: library/ssl.rst:1553 msgid "" "Load a set of \"certification authority\" (CA) certificates used to validate " "other peers' certificates when :data:`verify_mode` is other than :data:" "`CERT_NONE`. At least one of *cafile* or *capath* must be specified." msgstr "" -#: library/ssl.rst:1513 +#: library/ssl.rst:1557 msgid "" "This method can also load certification revocation lists (CRLs) in PEM or " "DER format. In order to make use of CRLs, :attr:`SSLContext.verify_flags` " "must be configured properly." msgstr "" -#: library/ssl.rst:1517 +#: library/ssl.rst:1561 msgid "" "The *cafile* string, if present, is the path to a file of concatenated CA " "certificates in PEM format. See the discussion of :ref:`ssl-certificates` " "for more information about how to arrange the certificates in this file." msgstr "" -#: library/ssl.rst:1522 +#: library/ssl.rst:1566 msgid "" "The *capath* string, if present, is the path to a directory containing " "several CA certificates in PEM format, following an `OpenSSL specific layout " "`_." msgstr "" -#: library/ssl.rst:1527 +#: library/ssl.rst:1571 msgid "" "The *cadata* object, if present, is either an ASCII string of one or more " "PEM-encoded certificates or a :term:`bytes-like object` of DER-encoded " @@ -1828,11 +1875,11 @@ msgid "" "are ignored but at least one certificate must be present." msgstr "" -#: library/ssl.rst:1532 +#: library/ssl.rst:1576 msgid "New optional argument *cadata*" msgstr "" -#: library/ssl.rst:1537 +#: library/ssl.rst:1581 msgid "" "Get a list of loaded \"certification authority\" (CA) certificates. If the " "``binary_form`` parameter is :const:`False` each list entry is a dict like " @@ -1842,19 +1889,19 @@ msgid "" "a SSL connection." msgstr "" -#: library/ssl.rst:1545 +#: library/ssl.rst:1589 msgid "" "Certificates in a capath directory aren't loaded unless they have been used " "at least once." msgstr "" -#: library/ssl.rst:1552 +#: library/ssl.rst:1596 msgid "" "Get a list of enabled ciphers. The list is in order of cipher priority. See :" "meth:`SSLContext.set_ciphers`." msgstr "" -#: library/ssl.rst:1557 +#: library/ssl.rst:1601 msgid "" ">>> ctx = ssl.SSLContext(ssl.PROTOCOL_SSLv23)\n" ">>> ctx.set_ciphers('ECDHE+AESGCM:!ECDSA')\n" @@ -1885,7 +1932,7 @@ msgid "" " 'symmetric': 'aes-128-gcm'}]" msgstr "" -#: library/ssl.rst:1589 +#: library/ssl.rst:1633 msgid "" "Load a set of default \"certification authority\" (CA) certificates from a " "filesystem path defined when building the OpenSSL library. Unfortunately, " @@ -1895,7 +1942,7 @@ msgid "" "configured properly." msgstr "" -#: library/ssl.rst:1598 +#: library/ssl.rst:1642 msgid "" "Set the available ciphers for sockets created with this context. It should " "be a string in the `OpenSSL cipher list format `_" msgstr "" -#: library/ssl.rst:1736 +#: library/ssl.rst:1781 msgid "Vincent Bernat." msgstr "" -#: library/ssl.rst:1742 +#: library/ssl.rst:1787 msgid "" "Wrap an existing Python socket *sock* and return an instance of :attr:" "`SSLContext.sslsocket_class` (default :class:`SSLSocket`). The returned SSL " @@ -2084,13 +2132,13 @@ msgid "" "a :const:`~socket.SOCK_STREAM` socket; other socket types are unsupported." msgstr "" -#: library/ssl.rst:1748 +#: library/ssl.rst:1793 msgid "" "The parameter ``server_side`` is a boolean which identifies whether server-" "side or client-side behavior is desired from this socket." msgstr "" -#: library/ssl.rst:1751 +#: library/ssl.rst:1796 msgid "" "For client-side sockets, the context construction is lazy; if the underlying " "socket isn't connected yet, the context construction will be performed " @@ -2101,7 +2149,7 @@ msgid "" "exc:`SSLError`." msgstr "" -#: library/ssl.rst:1759 +#: library/ssl.rst:1804 msgid "" "On client connections, the optional parameter *server_hostname* specifies " "the hostname of the service which we are connecting to. This allows a " @@ -2110,7 +2158,7 @@ msgid "" "*server_hostname* will raise a :exc:`ValueError` if *server_side* is true." msgstr "" -#: library/ssl.rst:1765 +#: library/ssl.rst:1810 msgid "" "The parameter ``do_handshake_on_connect`` specifies whether to do the SSL " "handshake automatically after doing a :meth:`socket.connect`, or whether the " @@ -2120,7 +2168,7 @@ msgid "" "socket I/O involved in the handshake." msgstr "" -#: library/ssl.rst:1772 +#: library/ssl.rst:1817 msgid "" "The parameter ``suppress_ragged_eofs`` specifies how the :meth:`SSLSocket." "recv` method should signal unexpected EOF from the other end of the " @@ -2130,40 +2178,40 @@ msgid "" "exceptions back to the caller." msgstr "" -#: library/ssl.rst:1779 +#: library/ssl.rst:1824 msgid "*session*, see :attr:`~SSLSocket.session`." msgstr "" -#: library/ssl.rst:1781 +#: library/ssl.rst:1826 msgid "" "To wrap an :class:`SSLSocket` in another :class:`SSLSocket`, use :meth:" "`SSLContext.wrap_bio`." msgstr "" -#: library/ssl.rst:1784 +#: library/ssl.rst:1829 msgid "" "Always allow a server_hostname to be passed, even if OpenSSL does not have " "SNI." msgstr "" -#: library/ssl.rst:1814 +#: library/ssl.rst:1859 msgid "*session* argument was added." msgstr "" -#: library/ssl.rst:1791 +#: library/ssl.rst:1836 msgid "" "The method returns an instance of :attr:`SSLContext.sslsocket_class` instead " "of hard-coded :class:`SSLSocket`." msgstr "" -#: library/ssl.rst:1797 +#: library/ssl.rst:1842 msgid "" "The return type of :meth:`SSLContext.wrap_socket`, defaults to :class:" "`SSLSocket`. The attribute can be overridden on instance of class in order " "to return a custom subclass of :class:`SSLSocket`." msgstr "" -#: library/ssl.rst:1806 +#: library/ssl.rst:1851 msgid "" "Wrap the BIO objects *incoming* and *outgoing* and return an instance of :" "attr:`SSLContext.sslobject_class` (default :class:`SSLObject`). The SSL " @@ -2171,26 +2219,26 @@ msgid "" "outgoing BIO." msgstr "" -#: library/ssl.rst:1811 +#: library/ssl.rst:1856 msgid "" "The *server_side*, *server_hostname* and *session* parameters have the same " "meaning as in :meth:`SSLContext.wrap_socket`." msgstr "" -#: library/ssl.rst:1817 +#: library/ssl.rst:1862 msgid "" "The method returns an instance of :attr:`SSLContext.sslobject_class` instead " "of hard-coded :class:`SSLObject`." msgstr "" -#: library/ssl.rst:1823 +#: library/ssl.rst:1868 msgid "" "The return type of :meth:`SSLContext.wrap_bio`, defaults to :class:" "`SSLObject`. The attribute can be overridden on instance of class in order " "to return a custom subclass of :class:`SSLObject`." msgstr "" -#: library/ssl.rst:1831 +#: library/ssl.rst:1876 msgid "" "Get statistics about the SSL sessions created or managed by this context. A " "dictionary is returned which maps the names of each `piece of information " @@ -2199,14 +2247,14 @@ msgid "" "the session cache since the context was created::" msgstr "" -#: library/ssl.rst:1836 +#: library/ssl.rst:1881 msgid "" ">>> stats = context.session_stats()\n" ">>> stats['hits'], stats['misses']\n" "(0, 0)" msgstr "" -#: library/ssl.rst:1842 +#: library/ssl.rst:1887 msgid "" "Whether to match the peer cert's hostname in :meth:`SSLSocket.do_handshake`. " "The context's :attr:`~SSLContext.verify_mode` must be set to :data:" @@ -2219,7 +2267,7 @@ msgid "" "With other protocols, hostname checking must be enabled explicitly." msgstr "" -#: library/ssl.rst:1855 +#: library/ssl.rst:1900 msgid "" "import socket, ssl\n" "\n" @@ -2233,7 +2281,7 @@ msgid "" "ssl_sock.connect(('www.verisign.com', 443))" msgstr "" -#: library/ssl.rst:1870 +#: library/ssl.rst:1915 msgid "" ":attr:`~SSLContext.verify_mode` is now automatically changed to :data:" "`CERT_REQUIRED` when hostname checking is enabled and :attr:`~SSLContext." @@ -2241,7 +2289,7 @@ msgid "" "failed with a :exc:`ValueError`." msgstr "" -#: library/ssl.rst:1877 +#: library/ssl.rst:1922 msgid "" "Write TLS keys to a keylog file, whenever key material is generated or " "received. The keylog file is designed for debugging purposes only. The file " @@ -2250,7 +2298,7 @@ msgid "" "synchronized between threads, but not between processes." msgstr "" -#: library/ssl.rst:1887 +#: library/ssl.rst:1932 msgid "" "A :class:`TLSVersion` enum member representing the highest supported TLS " "version. The value defaults to :attr:`TLSVersion.MAXIMUM_SUPPORTED`. The " @@ -2258,7 +2306,7 @@ msgid "" "const:`PROTOCOL_TLS_CLIENT`, and :const:`PROTOCOL_TLS_SERVER`." msgstr "" -#: library/ssl.rst:1892 +#: library/ssl.rst:1937 msgid "" "The attributes :attr:`~SSLContext.maximum_version`, :attr:`~SSLContext." "minimum_version` and :attr:`SSLContext.options` all affect the supported SSL " @@ -2268,38 +2316,38 @@ msgid "" "`TLSVersion.TLSv1_2` will not be able to establish a TLS 1.2 connection." msgstr "" -#: library/ssl.rst:1905 +#: library/ssl.rst:1950 msgid "" "Like :attr:`SSLContext.maximum_version` except it is the lowest supported " "version or :attr:`TLSVersion.MINIMUM_SUPPORTED`." msgstr "" -#: library/ssl.rst:1912 +#: library/ssl.rst:1957 msgid "" "Control the number of TLS 1.3 session tickets of a :const:" "`PROTOCOL_TLS_SERVER` context. The setting has no impact on TLS 1.0 to 1.2 " "connections." msgstr "" -#: library/ssl.rst:1920 +#: library/ssl.rst:1965 msgid "" "An integer representing the set of SSL options enabled on this context. The " "default value is :data:`OP_ALL`, but you can specify other options such as :" "data:`OP_NO_SSLv2` by ORing them together." msgstr "" -#: library/ssl.rst:1924 +#: library/ssl.rst:1969 msgid ":attr:`SSLContext.options` returns :class:`Options` flags:" msgstr "" -#: library/ssl.rst:1932 +#: library/ssl.rst:1977 msgid "" "All ``OP_NO_SSL*`` and ``OP_NO_TLS*`` options have been deprecated since " "Python 3.7. Use :attr:`SSLContext.minimum_version` and :attr:`SSLContext." "maximum_version` instead." msgstr "" -#: library/ssl.rst:1938 +#: library/ssl.rst:1983 msgid "" "Enable TLS 1.3 post-handshake client authentication. Post-handshake auth is " "disabled by default and a server can only request a TLS client certificate " @@ -2307,13 +2355,13 @@ msgid "" "client certificate at any time after the handshake." msgstr "" -#: library/ssl.rst:1943 +#: library/ssl.rst:1988 msgid "" "When enabled on client-side sockets, the client signals the server that it " "supports post-handshake authentication." msgstr "" -#: library/ssl.rst:1946 +#: library/ssl.rst:1991 msgid "" "When enabled on server-side sockets, :attr:`SSLContext.verify_mode` must be " "set to :data:`CERT_OPTIONAL` or :data:`CERT_REQUIRED`, too. The actual " @@ -2321,59 +2369,175 @@ msgid "" "verify_client_post_handshake` is called and some I/O is performed." msgstr "" -#: library/ssl.rst:1956 +#: library/ssl.rst:2001 msgid "" "The protocol version chosen when constructing the context. This attribute " "is read-only." msgstr "" -#: library/ssl.rst:1961 +#: library/ssl.rst:2006 msgid "" "Whether :attr:`~SSLContext.check_hostname` falls back to verify the cert's " "subject common name in the absence of a subject alternative name extension " "(default: true)." msgstr "" -#: library/ssl.rst:1969 +#: library/ssl.rst:2014 msgid "" "The flag had no effect with OpenSSL before version 1.1.1l. Python 3.8.9, " "3.9.3, and 3.10 include workarounds for previous versions." msgstr "" -#: library/ssl.rst:1974 +#: library/ssl.rst:2019 msgid "" "An integer representing the `security level `_ for the context. This attribute is read-" "only." msgstr "" -#: library/ssl.rst:1982 +#: library/ssl.rst:2027 msgid "" "The flags for certificate verification operations. You can set flags like :" "data:`VERIFY_CRL_CHECK_LEAF` by ORing them together. By default OpenSSL does " "neither require nor verify certificate revocation lists (CRLs)." msgstr "" -#: library/ssl.rst:1988 +#: library/ssl.rst:2033 msgid ":attr:`SSLContext.verify_flags` returns :class:`VerifyFlags` flags:" msgstr "" -#: library/ssl.rst:1996 +#: library/ssl.rst:2041 msgid "" "Whether to try to verify other peers' certificates and how to behave if " "verification fails. This attribute must be one of :data:`CERT_NONE`, :data:" "`CERT_OPTIONAL` or :data:`CERT_REQUIRED`." msgstr "" -#: library/ssl.rst:2000 +#: library/ssl.rst:2045 msgid ":attr:`SSLContext.verify_mode` returns :class:`VerifyMode` enum:" msgstr "" -#: library/ssl.rst:2013 +#: library/ssl.rst:2053 +msgid "" +"Enables TLS-PSK (pre-shared key) authentication on a client-side connection." +msgstr "" + +#: library/ssl.rst:2104 +msgid "" +"In general, certificate based authentication should be preferred over this " +"method." +msgstr "" + +#: library/ssl.rst:2057 +msgid "" +"The parameter ``callback`` is a callable object with the signature: ``def " +"callback(hint: str | None) -> tuple[str | None, bytes]``. The ``hint`` " +"parameter is an optional identity hint sent by the server. The return value " +"is a tuple in the form (client-identity, psk). Client-identity is an " +"optional string which may be used by the server to select a corresponding " +"PSK for the client. The string must be less than or equal to ``256`` octets " +"when UTF-8 encoded. PSK is a :term:`bytes-like object` representing the pre-" +"shared key. Return a zero length PSK to reject the connection." +msgstr "" + +#: library/ssl.rst:2113 +msgid "Setting ``callback`` to :const:`None` removes any existing callback." +msgstr "" + +#: library/ssl.rst:2070 +msgid "When using TLS 1.3:" +msgstr "" + +#: library/ssl.rst:2072 +msgid "the ``hint`` parameter is always :const:`None`." +msgstr "" + +#: library/ssl.rst:2073 +msgid "client-identity must be a non-empty string." +msgstr "" + +#: library/ssl.rst:2122 +msgid "Example usage::" +msgstr "" + +#: library/ssl.rst:2077 +msgid "" +"context = ssl.SSLContext(ssl.PROTOCOL_TLS_CLIENT)\n" +"context.check_hostname = False\n" +"context.verify_mode = ssl.CERT_NONE\n" +"context.maximum_version = ssl.TLSVersion.TLSv1_2\n" +"context.set_ciphers('PSK')\n" +"\n" +"# A simple lambda:\n" +"psk = bytes.fromhex('c0ffee')\n" +"context.set_psk_client_callback(lambda hint: (None, psk))\n" +"\n" +"# A table using the hint from the server:\n" +"psk_table = { 'ServerId_1': bytes.fromhex('c0ffee'),\n" +" 'ServerId_2': bytes.fromhex('facade')\n" +"}\n" +"def callback(hint):\n" +" return 'ClientId_1', psk_table.get(hint, b'')\n" +"context.set_psk_client_callback(callback)" +msgstr "" + +#: library/ssl.rst:2140 +msgid "" +"This method will raise :exc:`NotImplementedError` if :data:`HAS_PSK` is " +"``False``." +msgstr "" + +#: library/ssl.rst:2102 +msgid "" +"Enables TLS-PSK (pre-shared key) authentication on a server-side connection." +msgstr "" + +#: library/ssl.rst:2106 +msgid "" +"The parameter ``callback`` is a callable object with the signature: ``def " +"callback(identity: str | None) -> bytes``. The ``identity`` parameter is an " +"optional identity sent by the client which can be used to select a " +"corresponding PSK. The return value is a :term:`bytes-like object` " +"representing the pre-shared key. Return a zero length PSK to reject the " +"connection." +msgstr "" + +#: library/ssl.rst:2115 +msgid "" +"The parameter ``identity_hint`` is an optional identity hint string sent to " +"the client. The string must be less than or equal to ``256`` octets when " +"UTF-8 encoded." +msgstr "" + +#: library/ssl.rst:2120 +msgid "" +"When using TLS 1.3 the ``identity_hint`` parameter is not sent to the client." +msgstr "" + +#: library/ssl.rst:2124 +msgid "" +"context = ssl.SSLContext(ssl.PROTOCOL_TLS_SERVER)\n" +"context.maximum_version = ssl.TLSVersion.TLSv1_2\n" +"context.set_ciphers('PSK')\n" +"\n" +"# A simple lambda:\n" +"psk = bytes.fromhex('c0ffee')\n" +"context.set_psk_server_callback(lambda identity: psk)\n" +"\n" +"# A table using the identity of the client:\n" +"psk_table = { 'ClientId_1': bytes.fromhex('c0ffee'),\n" +" 'ClientId_2': bytes.fromhex('facade')\n" +"}\n" +"def callback(identity):\n" +" return psk_table.get(identity, b'')\n" +"context.set_psk_server_callback(callback, 'ServerId_1')" +msgstr "" + +#: library/ssl.rst:2152 msgid "Certificates" msgstr "" -#: library/ssl.rst:2015 +#: library/ssl.rst:2154 msgid "" "Certificates in general are part of a public-key / private-key system. In " "this system, each *principal*, (which may be a machine, or a person, or an " @@ -2384,7 +2548,7 @@ msgid "" "other part, and **only** with the other part." msgstr "" -#: library/ssl.rst:2023 +#: library/ssl.rst:2162 msgid "" "A certificate contains information about two principals. It contains the " "name of a *subject*, and the subject's public key. It also contains a " @@ -2398,7 +2562,7 @@ msgid "" "as two fields, called \"notBefore\" and \"notAfter\"." msgstr "" -#: library/ssl.rst:2033 +#: library/ssl.rst:2172 msgid "" "In the Python use of certificates, a client or server can use a certificate " "to prove who they are. The other side of a network connection can also be " @@ -2411,25 +2575,25 @@ msgid "" "take place." msgstr "" -#: library/ssl.rst:2043 +#: library/ssl.rst:2182 msgid "" "Python uses files to contain certificates. They should be formatted as " "\"PEM\" (see :rfc:`1422`), which is a base-64 encoded form wrapped with a " "header line and a footer line::" msgstr "" -#: library/ssl.rst:2047 +#: library/ssl.rst:2186 msgid "" "-----BEGIN CERTIFICATE-----\n" "... (certificate in base64 PEM encoding) ...\n" "-----END CERTIFICATE-----" msgstr "" -#: library/ssl.rst:2052 +#: library/ssl.rst:2191 msgid "Certificate chains" msgstr "" -#: library/ssl.rst:2054 +#: library/ssl.rst:2193 msgid "" "The Python files which contain certificates can contain a sequence of " "certificates, sometimes called a *certificate chain*. This chain should " @@ -2445,7 +2609,7 @@ msgid "" "agency which issued the certification authority's certificate::" msgstr "" -#: library/ssl.rst:2067 +#: library/ssl.rst:2206 msgid "" "-----BEGIN CERTIFICATE-----\n" "... (certificate for your server)...\n" @@ -2458,11 +2622,11 @@ msgid "" "-----END CERTIFICATE-----" msgstr "" -#: library/ssl.rst:2078 +#: library/ssl.rst:2217 msgid "CA certificates" msgstr "" -#: library/ssl.rst:2080 +#: library/ssl.rst:2219 msgid "" "If you are going to require validation of the other side of the connection's " "certificate, you need to provide a \"CA certs\" file, filled with the " @@ -2474,11 +2638,11 @@ msgid "" "create_default_context`." msgstr "" -#: library/ssl.rst:2089 +#: library/ssl.rst:2228 msgid "Combined key and certificate" msgstr "" -#: library/ssl.rst:2091 +#: library/ssl.rst:2230 msgid "" "Often the private key is stored in the same file as the certificate; in this " "case, only the ``certfile`` parameter to :meth:`SSLContext.load_cert_chain` " @@ -2486,7 +2650,7 @@ msgid "" "should come before the first certificate in the certificate chain::" msgstr "" -#: library/ssl.rst:2097 +#: library/ssl.rst:2236 msgid "" "-----BEGIN RSA PRIVATE KEY-----\n" "... (private key in base64 encoding) ...\n" @@ -2496,11 +2660,11 @@ msgid "" "-----END CERTIFICATE-----" msgstr "" -#: library/ssl.rst:2105 +#: library/ssl.rst:2244 msgid "Self-signed certificates" msgstr "" -#: library/ssl.rst:2107 +#: library/ssl.rst:2246 msgid "" "If you are going to create a server that provides SSL-encrypted connection " "services, you will need to acquire a certificate for that service. There " @@ -2510,7 +2674,7 @@ msgid "" "package, using something like the following::" msgstr "" -#: library/ssl.rst:2114 +#: library/ssl.rst:2253 msgid "" "% openssl req -new -x509 -days 365 -nodes -out cert.pem -keyout cert.pem\n" "Generating a 1024 bit RSA private key\n" @@ -2536,28 +2700,28 @@ msgid "" "%" msgstr "" -#: library/ssl.rst:2136 +#: library/ssl.rst:2275 msgid "" "The disadvantage of a self-signed certificate is that it is its own root " "certificate, and no one else will have it in their cache of known (and " "trusted) root certificates." msgstr "" -#: library/ssl.rst:2142 +#: library/ssl.rst:2281 msgid "Examples" msgstr "" -#: library/ssl.rst:2145 +#: library/ssl.rst:2284 msgid "Testing for SSL support" msgstr "" -#: library/ssl.rst:2147 +#: library/ssl.rst:2286 msgid "" "To test for the presence of SSL support in a Python installation, user code " "should use the following idiom::" msgstr "" -#: library/ssl.rst:2150 +#: library/ssl.rst:2289 msgid "" "try:\n" " import ssl\n" @@ -2567,40 +2731,40 @@ msgid "" " ... # do something that requires SSL support" msgstr "" -#: library/ssl.rst:2158 +#: library/ssl.rst:2297 msgid "Client-side operation" msgstr "" -#: library/ssl.rst:2160 +#: library/ssl.rst:2299 msgid "" "This example creates a SSL context with the recommended security settings " "for client sockets, including automatic certificate verification::" msgstr "" -#: library/ssl.rst:2163 +#: library/ssl.rst:2302 msgid ">>> context = ssl.create_default_context()" msgstr "" -#: library/ssl.rst:2165 +#: library/ssl.rst:2304 msgid "" "If you prefer to tune security settings yourself, you might create a context " "from scratch (but beware that you might not get the settings right)::" msgstr "" -#: library/ssl.rst:2169 +#: library/ssl.rst:2308 msgid "" ">>> context = ssl.SSLContext(ssl.PROTOCOL_TLS_CLIENT)\n" ">>> context.load_verify_locations(\"/etc/ssl/certs/ca-bundle.crt\")" msgstr "" -#: library/ssl.rst:2172 +#: library/ssl.rst:2311 msgid "" "(this snippet assumes your operating system places a bundle of all CA " "certificates in ``/etc/ssl/certs/ca-bundle.crt``; if not, you'll get an " "error and have to adjust the location)" msgstr "" -#: library/ssl.rst:2176 +#: library/ssl.rst:2315 msgid "" "The :data:`PROTOCOL_TLS_CLIENT` protocol configures the context for cert " "validation and hostname verification. :attr:`~SSLContext.verify_mode` is set " @@ -2608,7 +2772,7 @@ msgid "" "``True``. All other protocols create SSL contexts with insecure defaults." msgstr "" -#: library/ssl.rst:2181 +#: library/ssl.rst:2320 msgid "" "When you use the context to connect to a server, :const:`CERT_REQUIRED` and :" "attr:`~SSLContext.check_hostname` validate the server certificate: it " @@ -2617,28 +2781,28 @@ msgid "" "properties like validity and identity of the hostname::" msgstr "" -#: library/ssl.rst:2187 +#: library/ssl.rst:2326 msgid "" ">>> conn = context.wrap_socket(socket.socket(socket.AF_INET),\n" "... server_hostname=\"www.python.org\")\n" ">>> conn.connect((\"www.python.org\", 443))" msgstr "" -#: library/ssl.rst:2191 +#: library/ssl.rst:2330 msgid "You may then fetch the certificate::" msgstr "" -#: library/ssl.rst:2193 +#: library/ssl.rst:2332 msgid ">>> cert = conn.getpeercert()" msgstr "" -#: library/ssl.rst:2195 +#: library/ssl.rst:2334 msgid "" "Visual inspection shows that the certificate does identify the desired " "service (that is, the HTTPS host ``www.python.org``)::" msgstr "" -#: library/ssl.rst:2198 +#: library/ssl.rst:2337 msgid "" ">>> pprint.pprint(cert)\n" "{'OCSP': ('http://ocsp.digicert.com',),\n" @@ -2685,13 +2849,13 @@ msgid "" " 'version': 3}" msgstr "" -#: library/ssl.rst:2238 +#: library/ssl.rst:2377 msgid "" "Now the SSL channel is established and the certificate verified, you can " "proceed to talk with the server::" msgstr "" -#: library/ssl.rst:2241 +#: library/ssl.rst:2380 msgid "" ">>> conn.sendall(b\"HEAD / HTTP/1.0\\r\\nHost: linuxfr.org\\r\\n\\r\\n\")\n" ">>> pprint.pprint(conn.recv(1024).split(b\"\\r\\n\"))\n" @@ -2714,11 +2878,11 @@ msgid "" " b'']" msgstr "" -#: library/ssl.rst:2265 +#: library/ssl.rst:2404 msgid "Server-side operation" msgstr "" -#: library/ssl.rst:2267 +#: library/ssl.rst:2406 msgid "" "For server operation, typically you'll need to have a server certificate, " "and private key, each in a file. You'll first create a context holding the " @@ -2727,7 +2891,7 @@ msgid "" "start waiting for clients to connect::" msgstr "" -#: library/ssl.rst:2273 +#: library/ssl.rst:2412 msgid "" "import socket, ssl\n" "\n" @@ -2739,14 +2903,14 @@ msgid "" "bindsocket.listen(5)" msgstr "" -#: library/ssl.rst:2282 +#: library/ssl.rst:2421 msgid "" "When a client connects, you'll call :meth:`accept` on the socket to get the " "new socket from the other end, and use the context's :meth:`SSLContext." "wrap_socket` method to create a server-side SSL socket for the connection::" msgstr "" -#: library/ssl.rst:2286 +#: library/ssl.rst:2425 msgid "" "while True:\n" " newsocket, fromaddr = bindsocket.accept()\n" @@ -2758,13 +2922,13 @@ msgid "" " connstream.close()" msgstr "" -#: library/ssl.rst:2295 +#: library/ssl.rst:2434 msgid "" "Then you'll read data from the ``connstream`` and do something with it till " "you are finished with the client (or the client is finished with you)::" msgstr "" -#: library/ssl.rst:2298 +#: library/ssl.rst:2437 msgid "" "def deal_with_client(connstream):\n" " data = connstream.recv(1024)\n" @@ -2778,7 +2942,7 @@ msgid "" " # finished with client" msgstr "" -#: library/ssl.rst:2309 +#: library/ssl.rst:2448 msgid "" "And go back to listening for new client connections (of course, a real " "server would probably handle each client connection in a separate thread, or " @@ -2786,18 +2950,18 @@ msgid "" "event loop)." msgstr "" -#: library/ssl.rst:2317 +#: library/ssl.rst:2456 msgid "Notes on non-blocking sockets" msgstr "" -#: library/ssl.rst:2319 +#: library/ssl.rst:2458 msgid "" "SSL sockets behave slightly different than regular sockets in non-blocking " "mode. When working with non-blocking sockets, there are thus several things " "you need to be aware of:" msgstr "" -#: library/ssl.rst:2323 +#: library/ssl.rst:2462 msgid "" "Most :class:`SSLSocket` methods will raise either :exc:`SSLWantWriteError` " "or :exc:`SSLWantReadError` instead of :exc:`BlockingIOError` if an I/O " @@ -2809,13 +2973,13 @@ msgid "" "require a prior *write* to the underlying socket." msgstr "" -#: library/ssl.rst:2335 +#: library/ssl.rst:2474 msgid "" "In earlier Python versions, the :meth:`!SSLSocket.send` method returned zero " "instead of raising :exc:`SSLWantWriteError` or :exc:`SSLWantReadError`." msgstr "" -#: library/ssl.rst:2339 +#: library/ssl.rst:2478 msgid "" "Calling :func:`~select.select` tells you that the OS-level socket can be " "read from (or written to), but it does not imply that there is sufficient " @@ -2825,7 +2989,7 @@ msgid "" "`~select.select`." msgstr "" -#: library/ssl.rst:2346 +#: library/ssl.rst:2485 msgid "" "Conversely, since the SSL layer has its own framing, a SSL socket may still " "have data available for reading without :func:`~select.select` being aware " @@ -2834,13 +2998,13 @@ msgid "" "call if still necessary." msgstr "" -#: library/ssl.rst:2352 +#: library/ssl.rst:2491 msgid "" "(of course, similar provisions apply when using other primitives such as :" "func:`~select.poll`, or those in the :mod:`selectors` module)" msgstr "" -#: library/ssl.rst:2355 +#: library/ssl.rst:2494 msgid "" "The SSL handshake itself will be non-blocking: the :meth:`SSLSocket." "do_handshake` method has to be retried until it returns successfully. Here " @@ -2848,7 +3012,7 @@ msgid "" "readiness::" msgstr "" -#: library/ssl.rst:2360 +#: library/ssl.rst:2499 msgid "" "while True:\n" " try:\n" @@ -2860,7 +3024,7 @@ msgid "" " select.select([], [sock], [])" msgstr "" -#: library/ssl.rst:2371 +#: library/ssl.rst:2510 msgid "" "The :mod:`asyncio` module supports :ref:`non-blocking SSL sockets ` and provides a higher level :ref:`Streams API `. " "This means that for example :meth:`~SSLSocket.read` will raise an :exc:" "`SSLWantReadError` if it needs more data than the incoming BIO has available." msgstr "" -#: library/ssl.rst:2472 +#: library/ssl.rst:2613 msgid "" ":class:`SSLObject` instances must be created with :meth:`~SSLContext." "wrap_bio`. In earlier versions, it was possible to create instances " "directly. This was never documented or officially supported." msgstr "" -#: library/ssl.rst:2478 +#: library/ssl.rst:2619 msgid "" "An SSLObject communicates with the outside world using memory buffers. The " "class :class:`MemoryBIO` provides a memory buffer that can be used for this " "purpose. It wraps an OpenSSL memory BIO (Basic IO) object:" msgstr "" -#: library/ssl.rst:2484 +#: library/ssl.rst:2625 msgid "" "A memory buffer that can be used to pass data between Python and an SSL " "protocol instance." msgstr "" -#: library/ssl.rst:2489 +#: library/ssl.rst:2630 msgid "Return the number of bytes currently in the memory buffer." msgstr "" -#: library/ssl.rst:2493 +#: library/ssl.rst:2634 msgid "" "A boolean indicating whether the memory BIO is current at the end-of-file " "position." msgstr "" -#: library/ssl.rst:2498 +#: library/ssl.rst:2639 msgid "" "Read up to *n* bytes from the memory buffer. If *n* is not specified or " "negative, all bytes are returned." msgstr "" -#: library/ssl.rst:2503 +#: library/ssl.rst:2644 msgid "" "Write the bytes from *buf* to the memory BIO. The *buf* argument must be an " "object supporting the buffer protocol." msgstr "" -#: library/ssl.rst:2506 +#: library/ssl.rst:2647 msgid "" "The return value is the number of bytes written, which is always equal to " "the length of *buf*." msgstr "" -#: library/ssl.rst:2511 +#: library/ssl.rst:2652 msgid "" "Write an EOF marker to the memory BIO. After this method has been called, it " "is illegal to call :meth:`~MemoryBIO.write`. The attribute :attr:`eof` will " "become true after all data currently in the buffer has been read." msgstr "" -#: library/ssl.rst:2517 +#: library/ssl.rst:2658 msgid "SSL session" msgstr "" -#: library/ssl.rst:2523 +#: library/ssl.rst:2664 msgid "Session object used by :attr:`~SSLSocket.session`." msgstr "" -#: library/ssl.rst:2535 +#: library/ssl.rst:2676 msgid "Security considerations" msgstr "" -#: library/ssl.rst:2538 +#: library/ssl.rst:2679 msgid "Best defaults" msgstr "" -#: library/ssl.rst:2540 +#: library/ssl.rst:2681 msgid "" "For **client use**, if you don't have any special requirements for your " "security policy, it is highly recommended that you use the :func:" @@ -3144,13 +3316,13 @@ msgid "" "settings." msgstr "" -#: library/ssl.rst:2547 +#: library/ssl.rst:2688 msgid "" "For example, here is how you would use the :class:`smtplib.SMTP` class to " "create a trusted, secure connection to a SMTP server::" msgstr "" -#: library/ssl.rst:2550 +#: library/ssl.rst:2691 msgid "" ">>> import ssl, smtplib\n" ">>> smtp = smtplib.SMTP(\"mail.python.org\", port=587)\n" @@ -3159,13 +3331,13 @@ msgid "" "(220, b'2.0.0 Ready to start TLS')" msgstr "" -#: library/ssl.rst:2556 +#: library/ssl.rst:2697 msgid "" "If a client certificate is needed for the connection, it can be added with :" "meth:`SSLContext.load_cert_chain`." msgstr "" -#: library/ssl.rst:2559 +#: library/ssl.rst:2700 msgid "" "By contrast, if you create the SSL context by calling the :class:" "`SSLContext` constructor yourself, it will not have certificate validation " @@ -3173,15 +3345,15 @@ msgid "" "paragraphs below to achieve a good security level." msgstr "" -#: library/ssl.rst:2565 +#: library/ssl.rst:2706 msgid "Manual settings" msgstr "" -#: library/ssl.rst:2568 +#: library/ssl.rst:2709 msgid "Verifying certificates" msgstr "" -#: library/ssl.rst:2570 +#: library/ssl.rst:2711 msgid "" "When calling the :class:`SSLContext` constructor directly, :const:" "`CERT_NONE` is the default. Since it does not authenticate the other peer, " @@ -3196,13 +3368,13 @@ msgid "" "enabled." msgstr "" -#: library/ssl.rst:2582 +#: library/ssl.rst:2723 msgid "" "Hostname matchings is now performed by OpenSSL. Python no longer uses :func:" "`match_hostname`." msgstr "" -#: library/ssl.rst:2586 +#: library/ssl.rst:2727 msgid "" "In server mode, if you want to authenticate your clients using the SSL layer " "(rather than using a higher-level authentication mechanism), you'll also " @@ -3210,11 +3382,11 @@ msgid "" "certificate." msgstr "" -#: library/ssl.rst:2592 +#: library/ssl.rst:2733 msgid "Protocol versions" msgstr "" -#: library/ssl.rst:2594 +#: library/ssl.rst:2735 msgid "" "SSL versions 2 and 3 are considered insecure and are therefore dangerous to " "use. If you want maximum compatibility between clients and servers, it is " @@ -3223,14 +3395,14 @@ msgid "" "by default." msgstr "" -#: library/ssl.rst:2602 +#: library/ssl.rst:2743 msgid "" ">>> client_context = ssl.SSLContext(ssl.PROTOCOL_TLS_CLIENT)\n" ">>> client_context.minimum_version = ssl.TLSVersion.TLSv1_3\n" ">>> client_context.maximum_version = ssl.TLSVersion.TLSv1_3" msgstr "" -#: library/ssl.rst:2607 +#: library/ssl.rst:2748 msgid "" "The SSL context created above will only allow TLSv1.3 and later (if " "supported by your system) connections to a server. :const:" @@ -3238,11 +3410,11 @@ msgid "" "default. You have to load certificates into the context." msgstr "" -#: library/ssl.rst:2614 +#: library/ssl.rst:2755 msgid "Cipher selection" msgstr "" -#: library/ssl.rst:2616 +#: library/ssl.rst:2757 msgid "" "If you have advanced security requirements, fine-tuning of the ciphers " "enabled when negotiating a SSL session is possible through the :meth:" @@ -3255,11 +3427,11 @@ msgid "" "command on your system." msgstr "" -#: library/ssl.rst:2627 +#: library/ssl.rst:2768 msgid "Multi-processing" msgstr "" -#: library/ssl.rst:2629 +#: library/ssl.rst:2770 msgid "" "If using this module as part of a multi-processed application (using, for " "example the :mod:`multiprocessing` or :mod:`concurrent.futures` modules), be " @@ -3270,17 +3442,17 @@ msgid "" "sufficient." msgstr "" -#: library/ssl.rst:2641 +#: library/ssl.rst:2782 msgid "TLS 1.3" msgstr "" -#: library/ssl.rst:2645 +#: library/ssl.rst:2786 msgid "" "The TLS 1.3 protocol behaves slightly differently than previous version of " "TLS/SSL. Some new TLS 1.3 features are not yet available." msgstr "" -#: library/ssl.rst:2648 +#: library/ssl.rst:2789 msgid "" "TLS 1.3 uses a disjunct set of cipher suites. All AES-GCM and ChaCha20 " "cipher suites are enabled by default. The method :meth:`SSLContext." @@ -3288,14 +3460,14 @@ msgid "" "`SSLContext.get_ciphers` returns them." msgstr "" -#: library/ssl.rst:2652 +#: library/ssl.rst:2793 msgid "" "Session tickets are no longer sent as part of the initial handshake and are " "handled differently. :attr:`SSLSocket.session` and :class:`SSLSession` are " "not compatible with TLS 1.3." msgstr "" -#: library/ssl.rst:2655 +#: library/ssl.rst:2796 msgid "" "Client-side certificates are also no longer verified during the initial " "handshake. A server can request a certificate at any time. Clients process " @@ -3303,103 +3475,103 @@ msgid "" "server." msgstr "" -#: library/ssl.rst:2659 +#: library/ssl.rst:2800 msgid "" "TLS 1.3 features like early data, deferred TLS client cert request, " "signature algorithm configuration, and rekeying are not supported yet." msgstr "" -#: library/ssl.rst:2665 +#: library/ssl.rst:2806 msgid "Class :class:`socket.socket`" msgstr "" -#: library/ssl.rst:2666 +#: library/ssl.rst:2807 msgid "Documentation of underlying :mod:`socket` class" msgstr "" -#: library/ssl.rst:2668 +#: library/ssl.rst:2809 msgid "" "`SSL/TLS Strong Encryption: An Introduction `_" msgstr "" -#: library/ssl.rst:2669 +#: library/ssl.rst:2810 msgid "Intro from the Apache HTTP Server documentation" msgstr "" -#: library/ssl.rst:2671 +#: library/ssl.rst:2812 msgid "" ":rfc:`RFC 1422: Privacy Enhancement for Internet Electronic Mail: Part II: " "Certificate-Based Key Management <1422>`" msgstr "" -#: library/ssl.rst:2672 +#: library/ssl.rst:2813 msgid "Steve Kent" msgstr "" -#: library/ssl.rst:2674 +#: library/ssl.rst:2815 msgid ":rfc:`RFC 4086: Randomness Requirements for Security <4086>`" msgstr "" -#: library/ssl.rst:2675 +#: library/ssl.rst:2816 msgid "Donald E., Jeffrey I. Schiller" msgstr "" -#: library/ssl.rst:2677 +#: library/ssl.rst:2818 msgid "" ":rfc:`RFC 5280: Internet X.509 Public Key Infrastructure Certificate and " "Certificate Revocation List (CRL) Profile <5280>`" msgstr "" -#: library/ssl.rst:2678 +#: library/ssl.rst:2819 msgid "D. Cooper" msgstr "" -#: library/ssl.rst:2680 +#: library/ssl.rst:2821 msgid "" ":rfc:`RFC 5246: The Transport Layer Security (TLS) Protocol Version 1.2 " "<5246>`" msgstr "" -#: library/ssl.rst:2681 +#: library/ssl.rst:2822 msgid "T. Dierks et. al." msgstr "" -#: library/ssl.rst:2683 +#: library/ssl.rst:2824 msgid ":rfc:`RFC 6066: Transport Layer Security (TLS) Extensions <6066>`" msgstr "" -#: library/ssl.rst:2684 +#: library/ssl.rst:2825 msgid "D. Eastlake" msgstr "" -#: library/ssl.rst:2686 +#: library/ssl.rst:2827 msgid "" "`IANA TLS: Transport Layer Security (TLS) Parameters `_" msgstr "" -#: library/ssl.rst:2687 +#: library/ssl.rst:2828 msgid "IANA" msgstr "" -#: library/ssl.rst:2689 +#: library/ssl.rst:2830 msgid "" ":rfc:`RFC 7525: Recommendations for Secure Use of Transport Layer Security " "(TLS) and Datagram Transport Layer Security (DTLS) <7525>`" msgstr "" -#: library/ssl.rst:2690 +#: library/ssl.rst:2831 msgid "IETF" msgstr "" -#: library/ssl.rst:2692 +#: library/ssl.rst:2833 msgid "" "`Mozilla's Server Side TLS recommendations `_" msgstr "" -#: library/ssl.rst:2693 +#: library/ssl.rst:2834 msgid "Mozilla" msgstr "" @@ -3427,10 +3599,10 @@ msgstr "" msgid "Secure Sockets Layer" msgstr "" -#: library/ssl.rst:2006 +#: library/ssl.rst:2145 msgid "certificates" msgstr "" -#: library/ssl.rst:2008 +#: library/ssl.rst:2147 msgid "X509 certificate" msgstr "" diff --git a/library/stat.po b/library/stat.po index 5d93c667..d185fc52 100644 --- a/library/stat.po +++ b/library/stat.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -380,48 +380,88 @@ msgid "" msgstr "" #: library/stat.rst:355 +msgid "All user settable flags." +msgstr "" + +#: library/stat.rst:361 msgid "Do not dump the file." msgstr "" -#: library/stat.rst:387 +#: library/stat.rst:427 msgid "The file may not be changed." msgstr "" -#: library/stat.rst:391 +#: library/stat.rst:431 msgid "The file may only be appended to." msgstr "" -#: library/stat.rst:367 +#: library/stat.rst:373 msgid "The directory is opaque when viewed through a union stack." msgstr "" -#: library/stat.rst:395 +#: library/stat.rst:441 msgid "The file may not be renamed or deleted." msgstr "" -#: library/stat.rst:375 +#: library/stat.rst:381 msgid "The file is stored compressed (macOS 10.6+)." msgstr "" -#: library/stat.rst:379 +#: library/stat.rst:385 +msgid "Used for handling document IDs (macOS)" +msgstr "" + +#: library/stat.rst:391 +msgid "The file needs an entitlement for reading or writing (macOS 10.13+)" +msgstr "" + +#: library/stat.rst:397 msgid "The file should not be displayed in a GUI (macOS 10.5+)." msgstr "" -#: library/stat.rst:383 +#: library/stat.rst:401 +msgid "All super-user changeable flags" +msgstr "" + +#: library/stat.rst:407 +msgid "All super-user supported flags" +msgstr "" + +#: library/stat.rst:417 +msgid "Availability" +msgstr "" + +#: library/stat.rst:415 +msgid "All super-user read-only synthetic flags" +msgstr "" + +#: library/stat.rst:423 msgid "The file may be archived." msgstr "" -#: library/stat.rst:399 +#: library/stat.rst:435 +msgid "The file needs an entitlement to write to (macOS 10.13+)" +msgstr "" + +#: library/stat.rst:445 msgid "The file is a snapshot file." msgstr "" -#: library/stat.rst:401 +#: library/stat.rst:449 +msgid "The file is a firmlink (macOS 10.15+)" +msgstr "" + +#: library/stat.rst:455 +msgid "The file is a dataless object (macOS 10.15+)" +msgstr "" + +#: library/stat.rst:459 msgid "" "See the \\*BSD or macOS systems man page :manpage:`chflags(2)` for more " "information." msgstr "" -#: library/stat.rst:403 +#: library/stat.rst:461 msgid "" "On Windows, the following file attribute constants are available for use " "when testing bits in the ``st_file_attributes`` member returned by :func:`os." @@ -430,7 +470,7 @@ msgid "" "these constants." msgstr "" -#: library/stat.rst:429 +#: library/stat.rst:487 msgid "" "On Windows, the following constants are available for comparing against the " "``st_reparse_tag`` member returned by :func:`os.lstat`. These are well-known " diff --git a/library/statistics.po b/library/statistics.po index e19ece50..956a46bc 100644 --- a/library/statistics.po +++ b/library/statistics.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -128,153 +128,169 @@ msgid "Harmonic mean of data." msgstr "" #: library/statistics.rst:79 -msgid ":func:`median`" +msgid ":func:`kde`" msgstr "" #: library/statistics.rst:79 -msgid "Median (middle value) of data." +msgid "Estimate the probability density distribution of the data." msgstr "" #: library/statistics.rst:80 -msgid ":func:`median_low`" +msgid ":func:`kde_random`" msgstr "" #: library/statistics.rst:80 -msgid "Low median of data." +msgid "Random sampling from the PDF generated by kde()." msgstr "" #: library/statistics.rst:81 -msgid ":func:`median_high`" +msgid ":func:`median`" msgstr "" #: library/statistics.rst:81 -msgid "High median of data." +msgid "Median (middle value) of data." msgstr "" #: library/statistics.rst:82 -msgid ":func:`median_grouped`" +msgid ":func:`median_low`" msgstr "" #: library/statistics.rst:82 -msgid "Median (50th percentile) of grouped data." +msgid "Low median of data." msgstr "" #: library/statistics.rst:83 -msgid ":func:`mode`" +msgid ":func:`median_high`" msgstr "" #: library/statistics.rst:83 -msgid "Single mode (most common value) of discrete or nominal data." +msgid "High median of data." msgstr "" #: library/statistics.rst:84 -msgid ":func:`multimode`" +msgid ":func:`median_grouped`" msgstr "" #: library/statistics.rst:84 -msgid "List of modes (most common values) of discrete or nominal data." +msgid "Median (50th percentile) of grouped data." msgstr "" #: library/statistics.rst:85 -msgid ":func:`quantiles`" +msgid ":func:`mode`" msgstr "" #: library/statistics.rst:85 +msgid "Single mode (most common value) of discrete or nominal data." +msgstr "" + +#: library/statistics.rst:86 +msgid ":func:`multimode`" +msgstr "" + +#: library/statistics.rst:86 +msgid "List of modes (most common values) of discrete or nominal data." +msgstr "" + +#: library/statistics.rst:87 +msgid ":func:`quantiles`" +msgstr "" + +#: library/statistics.rst:87 msgid "Divide data into intervals with equal probability." msgstr "" -#: library/statistics.rst:89 +#: library/statistics.rst:91 msgid "Measures of spread" msgstr "" -#: library/statistics.rst:91 +#: library/statistics.rst:93 msgid "" "These functions calculate a measure of how much the population or sample " "tends to deviate from the typical or average values." msgstr "" -#: library/statistics.rst:95 +#: library/statistics.rst:97 msgid ":func:`pstdev`" msgstr "" -#: library/statistics.rst:95 +#: library/statistics.rst:97 msgid "Population standard deviation of data." msgstr "" -#: library/statistics.rst:96 +#: library/statistics.rst:98 msgid ":func:`pvariance`" msgstr "" -#: library/statistics.rst:96 +#: library/statistics.rst:98 msgid "Population variance of data." msgstr "" -#: library/statistics.rst:97 +#: library/statistics.rst:99 msgid ":func:`stdev`" msgstr "" -#: library/statistics.rst:97 +#: library/statistics.rst:99 msgid "Sample standard deviation of data." msgstr "" -#: library/statistics.rst:98 +#: library/statistics.rst:100 msgid ":func:`variance`" msgstr "" -#: library/statistics.rst:98 +#: library/statistics.rst:100 msgid "Sample variance of data." msgstr "" -#: library/statistics.rst:102 +#: library/statistics.rst:104 msgid "Statistics for relations between two inputs" msgstr "" -#: library/statistics.rst:104 +#: library/statistics.rst:106 msgid "" "These functions calculate statistics regarding relations between two inputs." msgstr "" -#: library/statistics.rst:107 +#: library/statistics.rst:109 msgid ":func:`covariance`" msgstr "" -#: library/statistics.rst:107 +#: library/statistics.rst:109 msgid "Sample covariance for two variables." msgstr "" -#: library/statistics.rst:108 +#: library/statistics.rst:110 msgid ":func:`correlation`" msgstr "" -#: library/statistics.rst:108 +#: library/statistics.rst:110 msgid "Pearson and Spearman's correlation coefficients." msgstr "" -#: library/statistics.rst:109 +#: library/statistics.rst:111 msgid ":func:`linear_regression`" msgstr "" -#: library/statistics.rst:109 +#: library/statistics.rst:111 msgid "Slope and intercept for simple linear regression." msgstr "" -#: library/statistics.rst:114 +#: library/statistics.rst:116 msgid "Function details" msgstr "" -#: library/statistics.rst:116 +#: library/statistics.rst:118 msgid "" "Note: The functions do not require the data given to them to be sorted. " "However, for reading convenience, most of the examples show sorted sequences." msgstr "" -#: library/statistics.rst:121 +#: library/statistics.rst:123 msgid "" "Return the sample arithmetic mean of *data* which can be a sequence or " "iterable." msgstr "" -#: library/statistics.rst:123 +#: library/statistics.rst:125 msgid "" "The arithmetic mean is the sum of the data divided by the number of data " "points. It is commonly called \"the average\", although it is only one of " @@ -282,15 +298,15 @@ msgid "" "location of the data." msgstr "" -#: library/statistics.rst:128 +#: library/statistics.rst:130 msgid "If *data* is empty, :exc:`StatisticsError` will be raised." msgstr "" -#: library/statistics.rst:130 +#: library/statistics.rst:132 msgid "Some examples of use:" msgstr "" -#: library/statistics.rst:132 +#: library/statistics.rst:134 msgid "" ">>> mean([1, 2, 3, 4, 4])\n" "2.8\n" @@ -306,7 +322,7 @@ msgid "" "Decimal('0.5625')" msgstr "" -#: library/statistics.rst:149 +#: library/statistics.rst:151 msgid "" "The mean is strongly affected by `outliers `_ and is not necessarily a typical example of the data points. For " @@ -314,7 +330,7 @@ msgid "" "`_, see :func:`median`." msgstr "" -#: library/statistics.rst:155 +#: library/statistics.rst:157 msgid "" "The sample mean gives an unbiased estimate of the true population mean, so " "that when taken on average over all the possible samples, ``mean(sample)`` " @@ -323,31 +339,31 @@ msgid "" "equivalent to calculating the true population mean μ." msgstr "" -#: library/statistics.rst:164 +#: library/statistics.rst:166 msgid "Convert *data* to floats and compute the arithmetic mean." msgstr "" -#: library/statistics.rst:166 +#: library/statistics.rst:168 msgid "" "This runs faster than the :func:`mean` function and it always returns a :" "class:`float`. The *data* may be a sequence or iterable. If the input " "dataset is empty, raises a :exc:`StatisticsError`." msgstr "" -#: library/statistics.rst:170 +#: library/statistics.rst:172 msgid "" ">>> fmean([3.5, 4.0, 5.25])\n" "4.25" msgstr "" -#: library/statistics.rst:175 +#: library/statistics.rst:177 msgid "" "Optional weighting is supported. For example, a professor assigns a grade " "for a course by weighting quizzes at 20%, homework at 20%, a midterm exam at " "30%, and a final exam at 30%:" msgstr "" -#: library/statistics.rst:179 +#: library/statistics.rst:181 msgid "" ">>> grades = [85, 92, 83, 91]\n" ">>> weights = [0.20, 0.20, 0.30, 0.30]\n" @@ -355,54 +371,54 @@ msgid "" "87.6" msgstr "" -#: library/statistics.rst:186 +#: library/statistics.rst:188 msgid "" "If *weights* is supplied, it must be the same length as the *data* or a :exc:" "`ValueError` will be raised." msgstr "" -#: library/statistics.rst:259 +#: library/statistics.rst:261 msgid "Added support for *weights*." msgstr "" -#: library/statistics.rst:197 +#: library/statistics.rst:199 msgid "Convert *data* to floats and compute the geometric mean." msgstr "" -#: library/statistics.rst:199 +#: library/statistics.rst:201 msgid "" "The geometric mean indicates the central tendency or typical value of the " "*data* using the product of the values (as opposed to the arithmetic mean " "which uses their sum)." msgstr "" -#: library/statistics.rst:203 +#: library/statistics.rst:205 msgid "" "Raises a :exc:`StatisticsError` if the input dataset is empty, if it " "contains a zero, or if it contains a negative value. The *data* may be a " "sequence or iterable." msgstr "" -#: library/statistics.rst:207 +#: library/statistics.rst:209 msgid "" "No special efforts are made to achieve exact results. (However, this may " "change in the future.)" msgstr "" -#: library/statistics.rst:210 +#: library/statistics.rst:212 msgid "" ">>> round(geometric_mean([54, 24, 36]), 1)\n" "36.0" msgstr "" -#: library/statistics.rst:220 +#: library/statistics.rst:222 msgid "" "Return the harmonic mean of *data*, a sequence or iterable of real-valued " "numbers. If *weights* is omitted or ``None``, then equal weighting is " "assumed." msgstr "" -#: library/statistics.rst:224 +#: library/statistics.rst:226 msgid "" "The harmonic mean is the reciprocal of the arithmetic :func:`mean` of the " "reciprocals of the data. For example, the harmonic mean of three values *a*, " @@ -410,110 +426,206 @@ msgid "" "values is zero, the result will be zero." msgstr "" -#: library/statistics.rst:229 +#: library/statistics.rst:231 msgid "" "The harmonic mean is a type of average, a measure of the central location of " "the data. It is often appropriate when averaging ratios or rates, for " "example speeds." msgstr "" -#: library/statistics.rst:233 +#: library/statistics.rst:235 msgid "" "Suppose a car travels 10 km at 40 km/hr, then another 10 km at 60 km/hr. " "What is the average speed?" msgstr "" -#: library/statistics.rst:236 +#: library/statistics.rst:238 msgid "" ">>> harmonic_mean([40, 60])\n" "48.0" msgstr "" -#: library/statistics.rst:241 +#: library/statistics.rst:243 msgid "" "Suppose a car travels 40 km/hr for 5 km, and when traffic clears, speeds-up " "to 60 km/hr for the remaining 30 km of the journey. What is the average " "speed?" msgstr "" -#: library/statistics.rst:245 +#: library/statistics.rst:247 msgid "" ">>> harmonic_mean([40, 60], weights=[5, 30])\n" "56.0" msgstr "" -#: library/statistics.rst:250 +#: library/statistics.rst:252 msgid "" ":exc:`StatisticsError` is raised if *data* is empty, any element is less " "than zero, or if the weighted sum isn't positive." msgstr "" -#: library/statistics.rst:253 +#: library/statistics.rst:255 msgid "" "The current algorithm has an early-out when it encounters a zero in the " "input. This means that the subsequent inputs are not tested for validity. " "(This behavior may change in the future.)" msgstr "" -#: library/statistics.rst:264 +#: library/statistics.rst:267 +msgid "" +"`Kernel Density Estimation (KDE) `_: Create a continuous " +"probability density function or cumulative distribution function from " +"discrete samples." +msgstr "" + +#: library/statistics.rst:272 +msgid "" +"The basic idea is to smooth the data using `a kernel function `_. to help draw inferences about a " +"population from a sample." +msgstr "" + +#: library/statistics.rst:276 +msgid "" +"The degree of smoothing is controlled by the scaling parameter *h* which is " +"called the bandwidth. Smaller values emphasize local features while larger " +"values give smoother results." +msgstr "" + +#: library/statistics.rst:280 +msgid "" +"The *kernel* determines the relative weights of the sample data points. " +"Generally, the choice of kernel shape does not matter as much as the more " +"influential bandwidth smoothing parameter." +msgstr "" + +#: library/statistics.rst:284 +msgid "" +"Kernels that give some weight to every sample point include *normal* " +"(*gauss*), *logistic*, and *sigmoid*." +msgstr "" + +#: library/statistics.rst:287 +msgid "" +"Kernels that only give weight to sample points within the bandwidth include " +"*rectangular* (*uniform*), *triangular*, *parabolic* (*epanechnikov*), " +"*quartic* (*biweight*), *triweight*, and *cosine*." +msgstr "" + +#: library/statistics.rst:291 +msgid "" +"If *cumulative* is true, will return a cumulative distribution function." +msgstr "" + +#: library/statistics.rst:324 +msgid "" +"A :exc:`StatisticsError` will be raised if the *data* sequence is empty." +msgstr "" + +#: library/statistics.rst:295 +msgid "" +"`Wikipedia has an example `_ where we can use :func:`kde` to " +"generate and plot a probability density function estimated from a small " +"sample:" +msgstr "" + +#: library/statistics.rst:300 +msgid "" +">>> sample = [-2.1, -1.3, -0.4, 1.9, 5.1, 6.2]\n" +">>> f_hat = kde(sample, h=1.5)\n" +">>> xarr = [i/100 for i in range(-750, 1100)]\n" +">>> yarr = [f_hat(x) for x in xarr]" +msgstr "" + +#: library/statistics.rst:307 +msgid "The points in ``xarr`` and ``yarr`` can be used to make a PDF plot:" +msgstr "" + +#: library/statistics.rst:309 +msgid "Scatter plot of the estimated probability density function." +msgstr "" + +#: library/statistics.rst:317 +msgid "" +"Return a function that makes a random selection from the estimated " +"probability density function produced by ``kde(data, h, kernel)``." +msgstr "" + +#: library/statistics.rst:320 +msgid "" +"Providing a *seed* allows reproducible selections. In the future, the values " +"may change slightly as more accurate kernel inverse CDF estimates are " +"implemented. The seed may be an integer, float, str, or bytes." +msgstr "" + +#: library/statistics.rst:326 +msgid "" +"Continuing the example for :func:`kde`, we can use :func:`kde_random` to " +"generate new random selections from an estimated probability density " +"function:" +msgstr "" + +#: library/statistics.rst:341 msgid "" "Return the median (middle value) of numeric data, using the common \"mean of " "middle two\" method. If *data* is empty, :exc:`StatisticsError` is raised. " "*data* can be a sequence or iterable." msgstr "" -#: library/statistics.rst:268 +#: library/statistics.rst:345 msgid "" "The median is a robust measure of central location and is less affected by " "the presence of outliers. When the number of data points is odd, the middle " "data point is returned:" msgstr "" -#: library/statistics.rst:272 +#: library/statistics.rst:349 msgid "" ">>> median([1, 3, 5])\n" "3" msgstr "" -#: library/statistics.rst:277 +#: library/statistics.rst:354 msgid "" "When the number of data points is even, the median is interpolated by taking " "the average of the two middle values:" msgstr "" -#: library/statistics.rst:280 +#: library/statistics.rst:357 msgid "" ">>> median([1, 3, 5, 7])\n" "4.0" msgstr "" -#: library/statistics.rst:285 +#: library/statistics.rst:362 msgid "" "This is suited for when your data is discrete, and you don't mind that the " "median may not be an actual data point." msgstr "" -#: library/statistics.rst:288 +#: library/statistics.rst:365 msgid "" "If the data is ordinal (supports order operations) but not numeric (doesn't " "support addition), consider using :func:`median_low` or :func:`median_high` " "instead." msgstr "" -#: library/statistics.rst:294 +#: library/statistics.rst:371 msgid "" "Return the low median of numeric data. If *data* is empty, :exc:" "`StatisticsError` is raised. *data* can be a sequence or iterable." msgstr "" -#: library/statistics.rst:297 +#: library/statistics.rst:374 msgid "" "The low median is always a member of the data set. When the number of data " "points is odd, the middle value is returned. When it is even, the smaller " "of the two middle values is returned." msgstr "" -#: library/statistics.rst:301 +#: library/statistics.rst:378 msgid "" ">>> median_low([1, 3, 5])\n" "3\n" @@ -521,26 +633,26 @@ msgid "" "3" msgstr "" -#: library/statistics.rst:308 +#: library/statistics.rst:385 msgid "" "Use the low median when your data are discrete and you prefer the median to " "be an actual data point rather than interpolated." msgstr "" -#: library/statistics.rst:314 +#: library/statistics.rst:391 msgid "" "Return the high median of data. If *data* is empty, :exc:`StatisticsError` " "is raised. *data* can be a sequence or iterable." msgstr "" -#: library/statistics.rst:317 +#: library/statistics.rst:394 msgid "" "The high median is always a member of the data set. When the number of data " "points is odd, the middle value is returned. When it is even, the larger of " "the two middle values is returned." msgstr "" -#: library/statistics.rst:321 +#: library/statistics.rst:398 msgid "" ">>> median_high([1, 3, 5])\n" "3\n" @@ -548,37 +660,37 @@ msgid "" "5" msgstr "" -#: library/statistics.rst:328 +#: library/statistics.rst:405 msgid "" "Use the high median when your data are discrete and you prefer the median to " "be an actual data point rather than interpolated." msgstr "" -#: library/statistics.rst:334 +#: library/statistics.rst:411 msgid "" "Estimates the median for numeric data that has been `grouped or binned " "`_ around the midpoints of " "consecutive, fixed-width intervals." msgstr "" -#: library/statistics.rst:338 +#: library/statistics.rst:415 msgid "" "The *data* can be any iterable of numeric data with each value being exactly " "the midpoint of a bin. At least one value must be present." msgstr "" -#: library/statistics.rst:341 +#: library/statistics.rst:418 msgid "The *interval* is the width of each bin." msgstr "" -#: library/statistics.rst:343 +#: library/statistics.rst:420 msgid "" "For example, demographic information may have been summarized into " "consecutive ten-year age groups with each group being represented by the 5-" "year midpoints of the intervals:" msgstr "" -#: library/statistics.rst:347 +#: library/statistics.rst:424 msgid "" ">>> from collections import Counter\n" ">>> demographics = Counter({\n" @@ -591,13 +703,13 @@ msgid "" "..." msgstr "" -#: library/statistics.rst:359 +#: library/statistics.rst:436 msgid "" "The 50th percentile (median) is the 536th person out of the 1071 member " "cohort. That person is in the 30 to 40 year old age group." msgstr "" -#: library/statistics.rst:362 +#: library/statistics.rst:439 msgid "" "The regular :func:`median` function would assume that everyone in the " "tricenarian age group was exactly 35 years old. A more tenable assumption " @@ -605,7 +717,7 @@ msgid "" "and 40. For that, we use :func:`median_grouped`:" msgstr "" -#: library/statistics.rst:368 +#: library/statistics.rst:445 msgid "" ">>> data = list(demographics.elements())\n" ">>> median(data)\n" @@ -614,27 +726,27 @@ msgid "" "37.5" msgstr "" -#: library/statistics.rst:376 +#: library/statistics.rst:453 msgid "" "The caller is responsible for making sure the data points are separated by " "exact multiples of *interval*. This is essential for getting a correct " "result. The function does not check this precondition." msgstr "" -#: library/statistics.rst:380 +#: library/statistics.rst:457 msgid "" "Inputs may be any numeric type that can be coerced to a float during the " "interpolation step." msgstr "" -#: library/statistics.rst:386 +#: library/statistics.rst:463 msgid "" "Return the single most common data point from discrete or nominal *data*. " "The mode (when it exists) is the most typical value and serves as a measure " "of central location." msgstr "" -#: library/statistics.rst:390 +#: library/statistics.rst:467 msgid "" "If there are multiple modes with the same frequency, returns the first one " "encountered in the *data*. If the smallest or largest of those is desired " @@ -642,32 +754,32 @@ msgid "" "input *data* is empty, :exc:`StatisticsError` is raised." msgstr "" -#: library/statistics.rst:395 +#: library/statistics.rst:472 msgid "" "``mode`` assumes discrete data and returns a single value. This is the " "standard treatment of the mode as commonly taught in schools:" msgstr "" -#: library/statistics.rst:398 +#: library/statistics.rst:475 msgid "" ">>> mode([1, 1, 2, 3, 3, 3, 3, 4])\n" "3" msgstr "" -#: library/statistics.rst:403 +#: library/statistics.rst:480 msgid "" "The mode is unique in that it is the only statistic in this package that " "also applies to nominal (non-numeric) data:" msgstr "" -#: library/statistics.rst:406 +#: library/statistics.rst:483 msgid "" ">>> mode([\"red\", \"blue\", \"blue\", \"red\", \"green\", \"red\", " "\"red\"])\n" "'red'" msgstr "" -#: library/statistics.rst:411 +#: library/statistics.rst:488 msgid "" "Only hashable inputs are supported. To handle type :class:`set`, consider " "casting to :class:`frozenset`. To handle type :class:`list`, consider " @@ -676,20 +788,20 @@ msgid "" "key=data.count)``." msgstr "" -#: library/statistics.rst:417 +#: library/statistics.rst:494 msgid "" "Now handles multimodal datasets by returning the first mode encountered. " "Formerly, it raised :exc:`StatisticsError` when more than one mode was found." msgstr "" -#: library/statistics.rst:425 +#: library/statistics.rst:502 msgid "" "Return a list of the most frequently occurring values in the order they were " "first encountered in the *data*. Will return more than one result if there " "are multiple modes or an empty list if the *data* is empty:" msgstr "" -#: library/statistics.rst:429 +#: library/statistics.rst:506 msgid "" ">>> multimode('aabbbbccddddeeffffgg')\n" "['b', 'd', 'f']\n" @@ -697,19 +809,19 @@ msgid "" "[]" msgstr "" -#: library/statistics.rst:441 +#: library/statistics.rst:518 msgid "" "Return the population standard deviation (the square root of the population " "variance). See :func:`pvariance` for arguments and other details." msgstr "" -#: library/statistics.rst:444 +#: library/statistics.rst:521 msgid "" ">>> pstdev([1.5, 2.5, 2.5, 2.75, 3.25, 4.75])\n" "0.986893273527251" msgstr "" -#: library/statistics.rst:452 +#: library/statistics.rst:529 msgid "" "Return the population variance of *data*, a non-empty sequence or iterable " "of real-valued numbers. Variance, or second moment about the mean, is a " @@ -718,7 +830,7 @@ msgid "" "clustered closely around the mean." msgstr "" -#: library/statistics.rst:458 +#: library/statistics.rst:535 msgid "" "If the optional second argument *mu* is given, it should be the *population* " "mean of the *data*. It can also be used to compute the second moment around " @@ -726,46 +838,46 @@ msgid "" "the arithmetic mean is automatically calculated." msgstr "" -#: library/statistics.rst:463 +#: library/statistics.rst:540 msgid "" "Use this function to calculate the variance from the entire population. To " "estimate the variance from a sample, the :func:`variance` function is " "usually a better choice." msgstr "" -#: library/statistics.rst:467 +#: library/statistics.rst:544 msgid "Raises :exc:`StatisticsError` if *data* is empty." msgstr "" -#: library/statistics.rst:539 library/statistics.rst:643 +#: library/statistics.rst:616 library/statistics.rst:725 msgid "Examples:" msgstr "" -#: library/statistics.rst:471 +#: library/statistics.rst:548 msgid "" ">>> data = [0.0, 0.25, 0.25, 1.25, 1.5, 1.75, 2.75, 3.25]\n" ">>> pvariance(data)\n" "1.25" msgstr "" -#: library/statistics.rst:477 +#: library/statistics.rst:554 msgid "" "If you have already calculated the mean of your data, you can pass it as the " "optional second argument *mu* to avoid recalculation:" msgstr "" -#: library/statistics.rst:480 +#: library/statistics.rst:557 msgid "" ">>> mu = mean(data)\n" ">>> pvariance(data, mu)\n" "1.25" msgstr "" -#: library/statistics.rst:486 +#: library/statistics.rst:563 msgid "Decimals and Fractions are supported:" msgstr "" -#: library/statistics.rst:488 +#: library/statistics.rst:565 msgid "" ">>> from decimal import Decimal as D\n" ">>> pvariance([D(\"27.5\"), D(\"30.25\"), D(\"30.25\"), D(\"34.5\"), " @@ -777,14 +889,14 @@ msgid "" "Fraction(13, 72)" msgstr "" -#: library/statistics.rst:500 +#: library/statistics.rst:577 msgid "" "When called with the entire population, this gives the population variance " "σ². When called on a sample instead, this is the biased sample variance s², " "also known as variance with N degrees of freedom." msgstr "" -#: library/statistics.rst:504 +#: library/statistics.rst:581 msgid "" "If you somehow know the true population mean μ, you may use this function to " "calculate the variance of a sample, giving the known population mean as the " @@ -793,19 +905,19 @@ msgid "" "variance." msgstr "" -#: library/statistics.rst:513 +#: library/statistics.rst:590 msgid "" "Return the sample standard deviation (the square root of the sample " "variance). See :func:`variance` for arguments and other details." msgstr "" -#: library/statistics.rst:516 +#: library/statistics.rst:593 msgid "" ">>> stdev([1.5, 2.5, 2.5, 2.75, 3.25, 4.75])\n" "1.0810874155219827" msgstr "" -#: library/statistics.rst:524 +#: library/statistics.rst:601 msgid "" "Return the sample variance of *data*, an iterable of at least two real-" "valued numbers. Variance, or second moment about the mean, is a measure of " @@ -814,55 +926,55 @@ msgid "" "closely around the mean." msgstr "" -#: library/statistics.rst:530 +#: library/statistics.rst:607 msgid "" "If the optional second argument *xbar* is given, it should be the *sample* " "mean of *data*. If it is missing or ``None`` (the default), the mean is " "automatically calculated." msgstr "" -#: library/statistics.rst:534 +#: library/statistics.rst:611 msgid "" "Use this function when your data is a sample from a population. To calculate " "the variance from the entire population, see :func:`pvariance`." msgstr "" -#: library/statistics.rst:537 +#: library/statistics.rst:614 msgid "Raises :exc:`StatisticsError` if *data* has fewer than two values." msgstr "" -#: library/statistics.rst:541 +#: library/statistics.rst:618 msgid "" ">>> data = [2.75, 1.75, 1.25, 0.25, 0.5, 1.25, 3.5]\n" ">>> variance(data)\n" "1.3720238095238095" msgstr "" -#: library/statistics.rst:547 +#: library/statistics.rst:624 msgid "" "If you have already calculated the sample mean of your data, you can pass it " "as the optional second argument *xbar* to avoid recalculation:" msgstr "" -#: library/statistics.rst:550 +#: library/statistics.rst:627 msgid "" ">>> m = mean(data)\n" ">>> variance(data, m)\n" "1.3720238095238095" msgstr "" -#: library/statistics.rst:556 +#: library/statistics.rst:633 msgid "" "This function does not attempt to verify that you have passed the actual " "mean as *xbar*. Using arbitrary values for *xbar* can lead to invalid or " "impossible results." msgstr "" -#: library/statistics.rst:560 +#: library/statistics.rst:637 msgid "Decimal and Fraction values are supported:" msgstr "" -#: library/statistics.rst:562 +#: library/statistics.rst:639 msgid "" ">>> from decimal import Decimal as D\n" ">>> variance([D(\"27.5\"), D(\"30.25\"), D(\"30.25\"), D(\"34.5\"), " @@ -874,7 +986,7 @@ msgid "" "Fraction(67, 108)" msgstr "" -#: library/statistics.rst:574 +#: library/statistics.rst:651 msgid "" "This is the sample variance s² with Bessel's correction, also known as " "variance with N-1 degrees of freedom. Provided that the data points are " @@ -882,20 +994,20 @@ msgid "" "should be an unbiased estimate of the true population variance." msgstr "" -#: library/statistics.rst:579 +#: library/statistics.rst:656 msgid "" "If you somehow know the actual population mean μ you should pass it to the :" "func:`pvariance` function as the *mu* parameter to get the variance of a " "sample." msgstr "" -#: library/statistics.rst:585 +#: library/statistics.rst:662 msgid "" "Divide *data* into *n* continuous intervals with equal probability. Returns " "a list of ``n - 1`` cut points separating the intervals." msgstr "" -#: library/statistics.rst:588 +#: library/statistics.rst:665 msgid "" "Set *n* to 4 for quartiles (the default). Set *n* to 10 for deciles. Set " "*n* to 100 for percentiles which gives the 99 cuts points that separate " @@ -903,28 +1015,28 @@ msgid "" "not least 1." msgstr "" -#: library/statistics.rst:593 +#: library/statistics.rst:670 msgid "" "The *data* can be any iterable containing sample data. For meaningful " "results, the number of data points in *data* should be larger than *n*. " -"Raises :exc:`StatisticsError` if there are not at least two data points." +"Raises :exc:`StatisticsError` if there is not at least one data point." msgstr "" -#: library/statistics.rst:597 +#: library/statistics.rst:674 msgid "" "The cut points are linearly interpolated from the two nearest data points. " "For example, if a cut point falls one-third of the distance between two " "sample values, ``100`` and ``112``, the cut-point will evaluate to ``104``." msgstr "" -#: library/statistics.rst:602 +#: library/statistics.rst:679 msgid "" "The *method* for computing quantiles can be varied depending on whether the " "*data* includes or excludes the lowest and highest possible values from the " "population." msgstr "" -#: library/statistics.rst:606 +#: library/statistics.rst:683 msgid "" "The default *method* is \"exclusive\" and is used for data sampled from a " "population that can have more extreme values than found in the samples. The " @@ -934,7 +1046,7 @@ msgid "" "70%, 80%, 90%." msgstr "" -#: library/statistics.rst:613 +#: library/statistics.rst:690 msgid "" "Setting the *method* to \"inclusive\" is used for describing population data " "or for samples that are known to include the most extreme values from the " @@ -946,7 +1058,7 @@ msgid "" "80%, 90%, 100%." msgstr "" -#: library/statistics.rst:622 +#: library/statistics.rst:699 msgid "" "# Decile cut points for empirically sampled data\n" ">>> data = [105, 129, 87, 86, 111, 111, 89, 81, 108, 92, 110,\n" @@ -958,19 +1070,26 @@ msgid "" "[81.0, 86.2, 89.0, 99.4, 102.5, 103.6, 106.0, 109.8, 111.0]" msgstr "" -#: library/statistics.rst:637 +#: library/statistics.rst:712 +msgid "" +"No longer raises an exception for an input with only a single data point. " +"This allows quantile estimates to be built up one sample point at a time " +"becoming gradually more refined with each new data point." +msgstr "" + +#: library/statistics.rst:719 msgid "" "Return the sample covariance of two inputs *x* and *y*. Covariance is a " "measure of the joint variability of two inputs." msgstr "" -#: library/statistics.rst:640 +#: library/statistics.rst:722 msgid "" "Both inputs must be of the same length (no less than two), otherwise :exc:" "`StatisticsError` is raised." msgstr "" -#: library/statistics.rst:645 +#: library/statistics.rst:727 msgid "" ">>> x = [1, 2, 3, 4, 5, 6, 7, 8, 9]\n" ">>> y = [1, 2, 3, 1, 2, 3, 1, 2, 3]\n" @@ -983,7 +1102,7 @@ msgid "" "-7.5" msgstr "" -#: library/statistics.rst:661 +#: library/statistics.rst:743 msgid "" "Return the `Pearson's correlation coefficient `_ for two inputs. Pearson's correlation " @@ -991,7 +1110,7 @@ msgid "" "direction of a linear relationship." msgstr "" -#: library/statistics.rst:667 +#: library/statistics.rst:749 msgid "" "If *method* is \"ranked\", computes `Spearman's rank correlation coefficient " "`_ " @@ -1000,26 +1119,26 @@ msgid "" "strength of a monotonic relationship." msgstr "" -#: library/statistics.rst:673 +#: library/statistics.rst:755 msgid "" "Spearman's correlation coefficient is appropriate for ordinal data or for " "continuous data that doesn't meet the linear proportion requirement for " "Pearson's correlation coefficient." msgstr "" -#: library/statistics.rst:677 +#: library/statistics.rst:759 msgid "" "Both inputs must be of the same length (no less than two), and need not to " "be constant, otherwise :exc:`StatisticsError` is raised." msgstr "" -#: library/statistics.rst:680 +#: library/statistics.rst:762 msgid "" "Example with `Kepler's laws of planetary motion `_:" msgstr "" -#: library/statistics.rst:683 +#: library/statistics.rst:765 msgid "" ">>> # Mercury, Venus, Earth, Mars, Jupiter, Saturn, Uranus, and Neptune\n" ">>> orbital_period = [88, 225, 365, 687, 4331, 10_756, 30_687, 60_190] # " @@ -1044,11 +1163,11 @@ msgid "" "1.0" msgstr "" -#: library/statistics.rst:707 +#: library/statistics.rst:789 msgid "Added support for Spearman's rank correlation coefficient." msgstr "" -#: library/statistics.rst:712 +#: library/statistics.rst:794 msgid "" "Return the slope and intercept of `simple linear regression `_ parameters estimated using " @@ -1057,11 +1176,11 @@ msgid "" "this linear function:" msgstr "" -#: library/statistics.rst:718 +#: library/statistics.rst:800 msgid "*y = slope \\* x + intercept + noise*" msgstr "" -#: library/statistics.rst:720 +#: library/statistics.rst:802 msgid "" "where ``slope`` and ``intercept`` are the regression parameters that are " "estimated, and ``noise`` represents the variability of the data that was not " @@ -1069,14 +1188,14 @@ msgid "" "predicted and actual values of the dependent variable)." msgstr "" -#: library/statistics.rst:726 +#: library/statistics.rst:808 msgid "" "Both inputs must be of the same length (no less than two), and the " "independent variable *x* cannot be constant; otherwise a :exc:" "`StatisticsError` is raised." msgstr "" -#: library/statistics.rst:730 +#: library/statistics.rst:812 msgid "" "For example, we can use the `release dates of the Monty Python films " "`_ to predict the " @@ -1084,7 +1203,7 @@ msgid "" "2019 assuming that they had kept the pace." msgstr "" -#: library/statistics.rst:736 +#: library/statistics.rst:818 msgid "" ">>> year = [1971, 1975, 1979, 1982, 1983]\n" ">>> films_total = [1, 2, 3, 4, 5]\n" @@ -1093,7 +1212,7 @@ msgid "" "16" msgstr "" -#: library/statistics.rst:744 +#: library/statistics.rst:826 msgid "" "If *proportional* is true, the independent variable *x* and the dependent " "variable *y* are assumed to be directly proportional. The data is fit to a " @@ -1101,18 +1220,18 @@ msgid "" "the underlying linear function simplifies to:" msgstr "" -#: library/statistics.rst:750 +#: library/statistics.rst:832 msgid "*y = slope \\* x + noise*" msgstr "" -#: library/statistics.rst:752 +#: library/statistics.rst:834 msgid "" "Continuing the example from :func:`correlation`, we look to see how well a " "model based on major planets can predict the orbital distances for dwarf " "planets:" msgstr "" -#: library/statistics.rst:756 +#: library/statistics.rst:838 msgid "" ">>> model = linear_regression(period_squared, dist_cubed, " "proportional=True)\n" @@ -1128,27 +1247,27 @@ msgid "" "[5906, 10152, 6796, 6450, 414]" msgstr "" -#: library/statistics.rst:772 +#: library/statistics.rst:854 msgid "Added support for *proportional*." msgstr "" -#: library/statistics.rst:776 +#: library/statistics.rst:858 msgid "Exceptions" msgstr "" -#: library/statistics.rst:778 +#: library/statistics.rst:860 msgid "A single exception is defined:" msgstr "" -#: library/statistics.rst:782 +#: library/statistics.rst:864 msgid "Subclass of :exc:`ValueError` for statistics-related exceptions." msgstr "" -#: library/statistics.rst:786 +#: library/statistics.rst:868 msgid ":class:`NormalDist` objects" msgstr "" -#: library/statistics.rst:788 +#: library/statistics.rst:870 msgid "" ":class:`NormalDist` is a tool for creating and manipulating normal " "distributions of a `random variable `_ and have a wide range of " "applications in statistics." msgstr "" -#: library/statistics.rst:800 +#: library/statistics.rst:882 msgid "" "Returns a new *NormalDist* object where *mu* represents the `arithmetic mean " "`_ and *sigma* represents the " "`standard deviation `_." msgstr "" -#: library/statistics.rst:805 +#: library/statistics.rst:887 msgid "If *sigma* is negative, raises :exc:`StatisticsError`." msgstr "" -#: library/statistics.rst:809 +#: library/statistics.rst:891 msgid "" "A read-only property for the `arithmetic mean `_ of a normal distribution." msgstr "" -#: library/statistics.rst:815 +#: library/statistics.rst:897 msgid "" "A read-only property for the `median `_ of a normal distribution." msgstr "" -#: library/statistics.rst:821 +#: library/statistics.rst:903 msgid "" "A read-only property for the `mode `_ of a normal distribution." msgstr "" -#: library/statistics.rst:827 +#: library/statistics.rst:909 msgid "" "A read-only property for the `standard deviation `_ of a normal distribution." msgstr "" -#: library/statistics.rst:833 +#: library/statistics.rst:915 msgid "" "A read-only property for the `variance `_ of a normal distribution. Equal to the square of the standard " "deviation." msgstr "" -#: library/statistics.rst:839 +#: library/statistics.rst:921 msgid "" "Makes a normal distribution instance with *mu* and *sigma* parameters " "estimated from the *data* using :func:`fmean` and :func:`stdev`." msgstr "" -#: library/statistics.rst:842 +#: library/statistics.rst:924 msgid "" "The *data* can be any :term:`iterable` and should consist of values that can " "be converted to type :class:`float`. If *data* does not contain at least " @@ -1220,20 +1339,26 @@ msgid "" "dispersion." msgstr "" -#: library/statistics.rst:850 +#: library/statistics.rst:932 msgid "" "Generates *n* random samples for a given mean and standard deviation. " "Returns a :class:`list` of :class:`float` values." msgstr "" -#: library/statistics.rst:853 +#: library/statistics.rst:935 msgid "" "If *seed* is given, creates a new instance of the underlying random number " "generator. This is useful for creating reproducible results, even in a " "multi-threading context." msgstr "" -#: library/statistics.rst:859 +#: library/statistics.rst:941 +msgid "" +"Switched to a faster algorithm. To reproduce samples from previous " +"versions, use :func:`random.seed` and :func:`random.gauss`." +msgstr "" + +#: library/statistics.rst:946 msgid "" "Using a `probability density function (pdf) `_, compute the relative likelihood that a " @@ -1241,7 +1366,7 @@ msgid "" "the limit of the ratio ``P(x <= X < x+dx) / dx`` as *dx* approaches zero." msgstr "" -#: library/statistics.rst:865 +#: library/statistics.rst:952 msgid "" "The relative likelihood is computed as the probability of a sample occurring " "in a narrow range divided by the width of the range (hence the word " @@ -1249,7 +1374,7 @@ msgid "" "can be greater than ``1.0``." msgstr "" -#: library/statistics.rst:872 +#: library/statistics.rst:959 msgid "" "Using a `cumulative distribution function (cdf) `_, compute the probability that a " @@ -1257,7 +1382,7 @@ msgid "" "is written ``P(X <= x)``." msgstr "" -#: library/statistics.rst:879 +#: library/statistics.rst:966 msgid "" "Compute the inverse cumulative distribution function, also known as the " "`quantile function `_ or " @@ -1266,34 +1391,34 @@ msgid "" "function. Mathematically, it is written ``x : P(X <= x) = p``." msgstr "" -#: library/statistics.rst:885 +#: library/statistics.rst:972 msgid "" "Finds the value *x* of the random variable *X* such that the probability of " "the variable being less than or equal to that value equals the given " "probability *p*." msgstr "" -#: library/statistics.rst:891 +#: library/statistics.rst:978 msgid "" "Measures the agreement between two normal probability distributions. Returns " "a value between 0.0 and 1.0 giving `the overlapping area for the two " "probability density functions `_." msgstr "" -#: library/statistics.rst:898 +#: library/statistics.rst:985 msgid "" "Divide the normal distribution into *n* continuous intervals with equal " "probability. Returns a list of (n - 1) cut points separating the intervals." msgstr "" -#: library/statistics.rst:902 +#: library/statistics.rst:989 msgid "" "Set *n* to 4 for quartiles (the default). Set *n* to 10 for deciles. Set " "*n* to 100 for percentiles which gives the 99 cuts points that separate the " "normal distribution into 100 equal sized groups." msgstr "" -#: library/statistics.rst:908 +#: library/statistics.rst:995 msgid "" "Compute the `Standard Score `_ describing *x* in terms of the number of standard " @@ -1301,27 +1426,27 @@ msgid "" "mean) / stdev``." msgstr "" -#: library/statistics.rst:916 +#: library/statistics.rst:1003 msgid "" "Instances of :class:`NormalDist` support addition, subtraction, " "multiplication and division by a constant. These operations are used for " "translation and scaling. For example:" msgstr "" -#: library/statistics.rst:920 +#: library/statistics.rst:1007 msgid "" ">>> temperature_february = NormalDist(5, 2.5) # Celsius\n" ">>> temperature_february * (9/5) + 32 # Fahrenheit\n" "NormalDist(mu=41.0, sigma=4.5)" msgstr "" -#: library/statistics.rst:926 +#: library/statistics.rst:1013 msgid "" "Dividing a constant by an instance of :class:`NormalDist` is not supported " "because the result wouldn't be normally distributed." msgstr "" -#: library/statistics.rst:929 +#: library/statistics.rst:1016 msgid "" "Since normal distributions arise from additive effects of independent " "variables, it is possible to `add and subtract two independent normally " @@ -1330,7 +1455,7 @@ msgid "" "class:`NormalDist`. For example:" msgstr "" -#: library/statistics.rst:935 +#: library/statistics.rst:1022 msgid "" ">>> birth_weights = NormalDist.from_samples([2.5, 3.1, 2.1, 2.4, 2.7, 3.5])\n" ">>> drug_effects = NormalDist(0.4, 0.15)\n" @@ -1341,19 +1466,19 @@ msgid "" "0.5" msgstr "" -#: library/statistics.rst:949 +#: library/statistics.rst:1036 msgid "Examples and Recipes" msgstr "" -#: library/statistics.rst:953 +#: library/statistics.rst:1040 msgid "Classic probability problems" msgstr "" -#: library/statistics.rst:955 +#: library/statistics.rst:1042 msgid ":class:`NormalDist` readily solves classic probability problems." msgstr "" -#: library/statistics.rst:957 +#: library/statistics.rst:1044 msgid "" "For example, given `historical data for SAT exams `_ showing that scores are " @@ -1362,7 +1487,7 @@ msgid "" "after rounding to the nearest whole number:" msgstr "" -#: library/statistics.rst:963 +#: library/statistics.rst:1050 msgid "" ">>> sat = NormalDist(1060, 195)\n" ">>> fraction = sat.cdf(1200 + 0.5) - sat.cdf(1100 - 0.5)\n" @@ -1370,13 +1495,13 @@ msgid "" "18.4" msgstr "" -#: library/statistics.rst:970 +#: library/statistics.rst:1057 msgid "" "Find the `quartiles `_ and `deciles " "`_ for the SAT scores:" msgstr "" -#: library/statistics.rst:973 +#: library/statistics.rst:1060 msgid "" ">>> list(map(round, sat.quantiles()))\n" "[928, 1060, 1192]\n" @@ -1384,18 +1509,18 @@ msgid "" "[810, 896, 958, 1011, 1060, 1109, 1162, 1224, 1310]" msgstr "" -#: library/statistics.rst:982 +#: library/statistics.rst:1069 msgid "Monte Carlo inputs for simulations" msgstr "" -#: library/statistics.rst:984 +#: library/statistics.rst:1071 msgid "" "To estimate the distribution for a model that isn't easy to solve " "analytically, :class:`NormalDist` can generate input samples for a `Monte " "Carlo simulation `_:" msgstr "" -#: library/statistics.rst:988 +#: library/statistics.rst:1075 msgid "" ">>> def model(x, y, z):\n" "... return (3*x + 7*x*y - 5*y) / (11 * z)\n" @@ -1408,18 +1533,18 @@ msgid "" "[1.4591308524824727, 1.8035946855390597, 2.175091447274739]" msgstr "" -#: library/statistics.rst:1001 +#: library/statistics.rst:1088 msgid "Approximating binomial distributions" msgstr "" -#: library/statistics.rst:1003 +#: library/statistics.rst:1090 msgid "" "Normal distributions can be used to approximate `Binomial distributions " "`_ when the sample " "size is large and when the probability of a successful trial is near 50%." msgstr "" -#: library/statistics.rst:1008 +#: library/statistics.rst:1095 msgid "" "For example, an open source conference has 750 attendees and two rooms with " "a 500 person capacity. There is a talk about Python and another about Ruby. " @@ -1428,7 +1553,7 @@ msgid "" "probability that the Python room will stay within its capacity limits?" msgstr "" -#: library/statistics.rst:1014 +#: library/statistics.rst:1101 msgid "" ">>> n = 750 # Sample size\n" ">>> p = 0.65 # Preference for Python\n" @@ -1452,15 +1577,15 @@ msgid "" "0.8406" msgstr "" -#: library/statistics.rst:1039 +#: library/statistics.rst:1126 msgid "Naive bayesian classifier" msgstr "" -#: library/statistics.rst:1041 +#: library/statistics.rst:1128 msgid "Normal distributions commonly arise in machine learning problems." msgstr "" -#: library/statistics.rst:1043 +#: library/statistics.rst:1130 msgid "" "Wikipedia has a `nice example of a Naive Bayesian Classifier `_. The " @@ -1468,14 +1593,14 @@ msgid "" "distributed features including height, weight, and foot size." msgstr "" -#: library/statistics.rst:1048 +#: library/statistics.rst:1135 msgid "" "We're given a training dataset with measurements for eight people. The " "measurements are assumed to be normally distributed, so we summarize the " "data with :class:`NormalDist`:" msgstr "" -#: library/statistics.rst:1052 +#: library/statistics.rst:1139 msgid "" ">>> height_male = NormalDist.from_samples([6, 5.92, 5.58, 5.92])\n" ">>> height_female = NormalDist.from_samples([5, 5.5, 5.42, 5.75])\n" @@ -1485,20 +1610,20 @@ msgid "" ">>> foot_size_female = NormalDist.from_samples([6, 8, 7, 9])" msgstr "" -#: library/statistics.rst:1061 +#: library/statistics.rst:1148 msgid "" "Next, we encounter a new person whose feature measurements are known but " "whose gender is unknown:" msgstr "" -#: library/statistics.rst:1064 +#: library/statistics.rst:1151 msgid "" ">>> ht = 6.0 # height\n" ">>> wt = 130 # weight\n" ">>> fs = 8 # foot size" msgstr "" -#: library/statistics.rst:1070 +#: library/statistics.rst:1157 msgid "" "Starting with a 50% `prior probability `_ of being male or female, we compute the posterior as " @@ -1506,7 +1631,7 @@ msgid "" "given the gender:" msgstr "" -#: library/statistics.rst:1075 +#: library/statistics.rst:1162 msgid "" ">>> prior_male = 0.5\n" ">>> prior_female = 0.5\n" @@ -1517,115 +1642,15 @@ msgid "" "... weight_female.pdf(wt) * foot_size_female.pdf(fs))" msgstr "" -#: library/statistics.rst:1085 +#: library/statistics.rst:1172 msgid "" "The final prediction goes to the largest posterior. This is known as the " "`maximum a posteriori `_ or MAP:" msgstr "" -#: library/statistics.rst:1089 +#: library/statistics.rst:1176 msgid "" ">>> 'male' if posterior_male > posterior_female else 'female'\n" "'female'" msgstr "" - -#: library/statistics.rst:1096 -msgid "Kernel density estimation" -msgstr "" - -#: library/statistics.rst:1098 -msgid "" -"It is possible to estimate a continuous probability distribution from a " -"fixed number of discrete samples." -msgstr "" - -#: library/statistics.rst:1101 -msgid "" -"The basic idea is to smooth the data using `a kernel function such as a " -"normal distribution, triangular distribution, or uniform distribution " -"`_. The degree of " -"smoothing is controlled by a scaling parameter, ``h``, which is called the " -"*bandwidth*." -msgstr "" - -#: library/statistics.rst:1107 -msgid "" -"from random import choice, random\n" -"\n" -"def kde_normal(data, h):\n" -" \"Create a continuous probability distribution from discrete samples.\"\n" -"\n" -" # Smooth the data with a normal distribution kernel scaled by h.\n" -" K_h = NormalDist(0.0, h)\n" -"\n" -" def pdf(x):\n" -" 'Probability density function. P(x <= X < x+dx) / dx'\n" -" return sum(K_h.pdf(x - x_i) for x_i in data) / len(data)\n" -"\n" -" def cdf(x):\n" -" 'Cumulative distribution function. P(X <= x)'\n" -" return sum(K_h.cdf(x - x_i) for x_i in data) / len(data)\n" -"\n" -" def rand():\n" -" 'Random selection from the probability distribution.'\n" -" return choice(data) + K_h.inv_cdf(random())\n" -"\n" -" return pdf, cdf, rand" -msgstr "" - -#: library/statistics.rst:1131 -msgid "" -"`Wikipedia has an example `_ where we can use the ``kde_normal()`` " -"recipe to generate and plot a probability density function estimated from a " -"small sample:" -msgstr "" - -#: library/statistics.rst:1136 -msgid "" -">>> sample = [-2.1, -1.3, -0.4, 1.9, 5.1, 6.2]\n" -">>> pdf, cdf, rand = kde_normal(sample, h=1.5)\n" -">>> xarr = [i/100 for i in range(-750, 1100)]\n" -">>> yarr = [pdf(x) for x in xarr]" -msgstr "" - -#: library/statistics.rst:1143 -msgid "The points in ``xarr`` and ``yarr`` can be used to make a PDF plot:" -msgstr "" - -#: library/statistics.rst:1145 -msgid "Scatter plot of the estimated probability density function." -msgstr "" - -#: library/statistics.rst:1148 -msgid "" -"`Resample `_ the data " -"to produce 100 new selections:" -msgstr "" - -#: library/statistics.rst:1151 -msgid ">>> new_selections = [rand() for i in range(100)]" -msgstr "" - -#: library/statistics.rst:1155 -msgid "Determine the probability of a new selection being below ``2.0``:" -msgstr "" - -#: library/statistics.rst:1157 -msgid "" -">>> round(cdf(2.0), 4)\n" -"0.5794" -msgstr "" - -#: library/statistics.rst:1162 -msgid "Add a new sample data point and find the new CDF at ``2.0``:" -msgstr "" - -#: library/statistics.rst:1164 -msgid "" -">>> sample.append(4.9)\n" -">>> round(cdf(2.0), 4)\n" -"0.5005" -msgstr "" diff --git a/library/stdtypes.po b/library/stdtypes.po index f1d0a0f5..7407a184 100644 --- a/library/stdtypes.po +++ b/library/stdtypes.po @@ -8,11 +8,10 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: 2025-05-03 00:13+0300\n" -"Last-Translator: Theofanis Petkos Language-Team: PyGreece " -"\n" -"Language-Team: \n" +"Last-Translator: Theofanis Petkos \n" +"Language-Team: PyGreece \n" "Language: el\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" @@ -144,8 +143,8 @@ msgstr "Πράξη" msgid "Result" msgstr "Αποτέλεσμα" -#: library/stdtypes.rst:276 library/stdtypes.rst:965 library/stdtypes.rst:2429 -#: library/stdtypes.rst:3648 +#: library/stdtypes.rst:276 library/stdtypes.rst:965 library/stdtypes.rst:2578 +#: library/stdtypes.rst:3797 msgid "Notes" msgstr "Σημειώσεις" @@ -157,7 +156,7 @@ msgstr "``x or y``" msgid "if *x* is true, then *x*, else *y*" msgstr "αν το *x* είναι true, τότε *x*, αλλιώς *y*" -#: library/stdtypes.rst:967 library/stdtypes.rst:1181 library/stdtypes.rst:3654 +#: library/stdtypes.rst:967 library/stdtypes.rst:1181 library/stdtypes.rst:3803 msgid "\\(1)" msgstr "\\(1)" @@ -169,8 +168,8 @@ msgstr "``x and y``" msgid "if *x* is false, then *x*, else *y*" msgstr "αν το *x* είναι false, τότε *x*, αλλιώς *y*" -#: library/stdtypes.rst:289 library/stdtypes.rst:1209 library/stdtypes.rst:2441 -#: library/stdtypes.rst:3660 +#: library/stdtypes.rst:289 library/stdtypes.rst:1209 library/stdtypes.rst:2590 +#: library/stdtypes.rst:3809 msgid "\\(2)" msgstr "\\(2)" @@ -182,14 +181,14 @@ msgstr "``not x``" msgid "if *x* is false, then ``True``, else ``False``" msgstr "if *x* είναι false, τότε ``True``, αλλιώς ``False``" -#: library/stdtypes.rst:979 library/stdtypes.rst:2443 library/stdtypes.rst:2447 -#: library/stdtypes.rst:3662 library/stdtypes.rst:3666 -#: library/stdtypes.rst:3668 +#: library/stdtypes.rst:979 library/stdtypes.rst:2592 library/stdtypes.rst:2596 +#: library/stdtypes.rst:3811 library/stdtypes.rst:3815 +#: library/stdtypes.rst:3817 msgid "\\(3)" msgstr "\\(3)" -#: library/stdtypes.rst:320 library/stdtypes.rst:1016 library/stdtypes.rst:2475 -#: library/stdtypes.rst:3698 +#: library/stdtypes.rst:320 library/stdtypes.rst:1016 library/stdtypes.rst:2624 +#: library/stdtypes.rst:3847 msgid "Notes:" msgstr "Σημειώσεις:" @@ -241,8 +240,8 @@ msgstr "" msgid "This table summarizes the comparison operations:" msgstr "Αυτός ο πίνακας συνοψίζει τις πράξεις σύγκρισης:" -#: library/stdtypes.rst:2406 library/stdtypes.rst:3625 -#: library/stdtypes.rst:3648 +#: library/stdtypes.rst:2410 library/stdtypes.rst:2578 +#: library/stdtypes.rst:3797 msgid "Meaning" msgstr "Έννοια" @@ -584,7 +583,7 @@ msgstr "" "ένας μιγαδικός αριθμός με πραγματικό μέρος *re*, φανταστικό μέρος *im*. Το " "*im* μετατρέπεται αυτόματα σε μηδέν." -#: library/stdtypes.rst:1202 library/stdtypes.rst:3685 +#: library/stdtypes.rst:1202 library/stdtypes.rst:3834 msgid "\\(6)" msgstr "\\(6)" @@ -620,8 +619,8 @@ msgstr "``pow(x, y)``" msgid "*x* to the power *y*" msgstr "*x* σε δύναμη του *y*" -#: library/stdtypes.rst:313 library/stdtypes.rst:1194 library/stdtypes.rst:2465 -#: library/stdtypes.rst:3681 library/stdtypes.rst:3688 +#: library/stdtypes.rst:313 library/stdtypes.rst:1194 library/stdtypes.rst:2614 +#: library/stdtypes.rst:3830 library/stdtypes.rst:3837 msgid "\\(5)" msgstr "\\(5)" @@ -796,8 +795,8 @@ msgstr "``x | y``" msgid "bitwise :dfn:`or` of *x* and *y*" msgstr "bitwise :dfn:`or` των *x* και *y*" -#: library/stdtypes.rst:421 library/stdtypes.rst:1216 library/stdtypes.rst:2455 -#: library/stdtypes.rst:3674 +#: library/stdtypes.rst:421 library/stdtypes.rst:1216 library/stdtypes.rst:2604 +#: library/stdtypes.rst:3823 msgid "\\(4)" msgstr "\\(4)" @@ -1356,8 +1355,8 @@ msgstr "" "τούτου ισχύει για όλα τα instances :class:`int` και :class:`fractions." "Fraction` και όλα πεπερασμένα instances :class:`float` και :class:`decimal." "Decimal`. Ουσιαστικά, αυτή η συνάρτηση δίνεται από το modulo μείωσης ``P`` " -"για ένα σταθερό πρώτο ``P``. Η τιμή του ``P`` διατίθεται στην Python ως :" -"attr:`~sys.hash_info.modulus` atrribute του :data:`sys.hash_info`." +"για ένα σταθερό πρώτο ``P``. Η τιμή του ``P`` διατίθεται στην Python ως " +"χαρακτηριστικό :attr:`~sys.hash_info.modulus` του :data:`sys.hash_info`." #: library/stdtypes.rst:726 msgid "" @@ -1885,7 +1884,7 @@ msgstr "" "δείκτης της πρώτης εμφάνισης του *x* στο *s* (μετά από τον ή στον δείκτη *i* " "και πριν από το δείκτη *j*)" -#: library/stdtypes.rst:3656 +#: library/stdtypes.rst:3805 msgid "\\(8)" msgstr "\\(8)" @@ -3130,7 +3129,7 @@ msgstr "" msgid "" "The casefolding algorithm is `described in section 3.13 'Default Case " "Folding' of the Unicode Standard `__." +"Unicode15.1.0/ch03.pdf>`__." msgstr "" "Ο αλγόριθμος casefolding περιγράφεται στην ενότητα 3.13 'Default Case " "Folding' του προτύπου Unicode ` " "χρησιμοποιείται." -#: library/stdtypes.rst:2840 +#: library/stdtypes.rst:2989 msgid "Added support for keyword arguments." msgstr "Επιπρόσθετη υποστήριξη για keyword ορίσματα." -#: library/stdtypes.rst:2843 +#: library/stdtypes.rst:2992 msgid "" "The value of the *errors* argument is now checked in :ref:`devmode` and in :" "ref:`debug mode `." @@ -3379,7 +3378,7 @@ msgid "" "e., those with general category property being one of \"Lm\", \"Lt\", " "\"Lu\", \"Ll\", or \"Lo\". Note that this is different from the `Alphabetic " "property defined in the section 4.10 'Letters, Alphabetic, and Ideographic' " -"of the Unicode Standard `_." msgstr "" "Επιστρέφει ``True`` αν όλοι οι χαρακτήρες στη συμβολοσειρά (string) είναι " @@ -3389,7 +3388,7 @@ msgstr "" "ιδιότητα μία από τα \"Lm\", \"Lt\", \"Lu\", \"Ll\", ή \"Lo\". Σημειώστε ότι " "αυτό είναι διαφορετικό από το `Αλφαβητικό που ορίζεται στην ενότητα 4.10 " "'Letters, Alphabetic, and Ideographic' του προτύπου Unicode `_." +"unicode.org/versions/Unicode15.1.0/ch04.pdf>`_." #: library/stdtypes.rst:1815 msgid "" @@ -3608,11 +3607,11 @@ msgstr "" msgid "" "The lowercasing algorithm used is `described in section 3.13 'Default Case " "Folding' of the Unicode Standard `__." +"Unicode15.1.0/ch03.pdf>`__." msgstr "" "Ο αλγόριθμος που χρησιμοποιείται για την πεζογράμμιση περιγράφεται στην " "ενότητα 3.13 'Default Case Folding' του προτύπου Unicode `__." +"unicode.org/versions/Unicode15.1.0/ch03.pdf>`__." #: library/stdtypes.rst:1957 msgid "" @@ -3754,15 +3753,20 @@ msgstr "" #: library/stdtypes.rst:2029 msgid "" "Return a copy of the string with all occurrences of substring *old* replaced " -"by *new*. If the optional argument *count* is given, only the first *count* " -"occurrences are replaced." +"by *new*. If *count* is given, only the first *count* occurrences are " +"replaced. If *count* is not specified or ``-1``, then all occurrences are " +"replaced." msgstr "" "Επιστρέφει ένα αντίγραφο της συμβολοσειράς (string) με όλες τις εμφανίσεις " -"της υπό-συμβολοσειράς *old* αντικατεστημένες από την *new*. Εάν δοθεί το " -"προαιρετικό όρισμα *count*, μόνο οι πρώτες *count* εμφανίσεις " -"αντικαθίστανται." +"της υπό-συμβολοσειράς *old* αντικατεστημένες από την *new*. Εάν δοθεί η " +"παράμετρος *count*, μόνο οι πρώτες *count* εμφανίσεις. Αν δεν έχει οριστεί ή " +"είναι -1, τότε αντικαθίστανται όλες οι εμφανίσεις." -#: library/stdtypes.rst:2036 +#: library/stdtypes.rst:2033 +msgid "*count* is now supported as a keyword argument." +msgstr "Το *count* υποστηρίζεται πλέον ως όρισμα λέξης-κλειδιού." + +#: library/stdtypes.rst:2039 msgid "" "Return the highest index in the string where substring *sub* is found, such " "that *sub* is contained within ``s[start:end]``. Optional arguments *start* " @@ -3773,7 +3777,7 @@ msgstr "" "προαιρετικά ορίσματα *start* και *end* ερμηνεύονται ως slice notation. " "Επιστρέφει ``-1`` σε περίπτωση αποτυχίας." -#: library/stdtypes.rst:2043 +#: library/stdtypes.rst:2046 msgid "" "Like :meth:`rfind` but raises :exc:`ValueError` when the substring *sub* is " "not found." @@ -3781,7 +3785,7 @@ msgstr "" "Όπως η :meth:`rfind`, αλλά κάνει raise :exc:`ValueError` όταν η υπό-" "συμβολοσειρά (sub-string) *sub* δεν βρέθηκε." -#: library/stdtypes.rst:2049 +#: library/stdtypes.rst:2052 msgid "" "Return the string right justified in a string of length *width*. Padding is " "done using the specified *fillchar* (default is an ASCII space). The " @@ -3792,7 +3796,7 @@ msgstr "" "καθορισμένο *fillchar* (η προεπιλογή είναι ένα διάστημα ASCII). Η αρχική " "συμβολοσειρά επιστρέφεται εάν το *width* είναι μικρότερο ή ίσο με ``len(s)``." -#: library/stdtypes.rst:2056 +#: library/stdtypes.rst:2059 msgid "" "Split the string at the last occurrence of *sep*, and return a 3-tuple " "containing the part before the separator, the separator itself, and the part " @@ -3805,7 +3809,7 @@ msgstr "" "δεν βρεθεί, επιστρέφει ένα 3-tuple που περιέχει δύο κενές συμβολοσειρές, " "ακολουθούμενες από την ίδια τη συμβολοσειρά." -#: library/stdtypes.rst:2064 +#: library/stdtypes.rst:2067 msgid "" "Return a list of the words in the string, using *sep* as the delimiter " "string. If *maxsplit* is given, at most *maxsplit* splits are done, the " @@ -3820,7 +3824,7 @@ msgstr "" "Εκτός από το διαχωρισμό από τα δεξιά, η :meth:`rsplit` συμπεριφέρεται όπως " "η :meth:`split` που περιγράφεται λεπτομερώς παρακάτω." -#: library/stdtypes.rst:2073 +#: library/stdtypes.rst:2076 msgid "" "Return a copy of the string with trailing characters removed. The *chars* " "argument is a string specifying the set of characters to be removed. If " @@ -3835,7 +3839,7 @@ msgstr "" "διαστημάτων. Το όρισμα *chars* δεν είναι suffix, αλλά όλοι οι συνδυασμοί " "των τιμών του αφαιρούνται::" -#: library/stdtypes.rst:2078 +#: library/stdtypes.rst:2081 msgid "" ">>> ' spacious '.rstrip()\n" "' spacious'\n" @@ -3847,7 +3851,7 @@ msgstr "" ">>> 'mississippi'.rstrip('ipz')\n" "'mississ'" -#: library/stdtypes.rst:2083 +#: library/stdtypes.rst:2086 msgid "" "See :meth:`str.removesuffix` for a method that will remove a single suffix " "string rather than all of a set of characters. For example::" @@ -3855,7 +3859,7 @@ msgstr "" "Δείτε τη :meth:`str.removesuffix` για μια μέθοδο που θα αφαιρέσει ένα απλό " "suffix αντί για όλο το σύνολο των χαρακτήρων. Για παράδειγμα::" -#: library/stdtypes.rst:2086 +#: library/stdtypes.rst:2089 msgid "" ">>> 'Monty Python'.rstrip(' Python')\n" "'M'\n" @@ -3867,7 +3871,7 @@ msgstr "" ">>> 'Monty Python'.removesuffix(' Python')\n" "'Monty'" -#: library/stdtypes.rst:2093 +#: library/stdtypes.rst:2096 msgid "" "Return a list of the words in the string, using *sep* as the delimiter " "string. If *maxsplit* is given, at most *maxsplit* splits are done (thus, " @@ -3882,7 +3886,7 @@ msgstr "" "υπάρχει όριο στον αριθμό των διαχωρισμών (γίνονται όλες οι πιθανές " "διασπάσεις)." -#: library/stdtypes.rst:2099 +#: library/stdtypes.rst:2102 msgid "" "If *sep* is given, consecutive delimiters are not grouped together and are " "deemed to delimit empty strings (for example, ``'1,,2'.split(',')`` returns " @@ -3899,15 +3903,15 @@ msgstr "" "διαχωρισμός μιας κενής συμβολοσειράς με ένα καθορισμένο διαχωριστικό " "επιστρέφει το ``['']``." -#: library/stdtypes.rst:2124 library/stdtypes.rst:2244 -#: library/stdtypes.rst:3158 library/stdtypes.rst:3267 -#: library/stdtypes.rst:3308 library/stdtypes.rst:3350 -#: library/stdtypes.rst:3382 library/stdtypes.rst:3432 -#: library/stdtypes.rst:3501 library/stdtypes.rst:3525 +#: library/stdtypes.rst:2127 library/stdtypes.rst:2247 +#: library/stdtypes.rst:3307 library/stdtypes.rst:3416 +#: library/stdtypes.rst:3457 library/stdtypes.rst:3499 +#: library/stdtypes.rst:3531 library/stdtypes.rst:3581 +#: library/stdtypes.rst:3650 library/stdtypes.rst:3674 msgid "For example::" msgstr "Για παράδειγμα::" -#: library/stdtypes.rst:2108 +#: library/stdtypes.rst:2111 msgid "" ">>> '1,2,3'.split(',')\n" "['1', '2', '3']\n" @@ -3927,7 +3931,7 @@ msgstr "" ">>> '1<>2<>3<4'.split('<>')\n" "['1', '2', '3<4']" -#: library/stdtypes.rst:2117 +#: library/stdtypes.rst:2120 msgid "" "If *sep* is not specified or is ``None``, a different splitting algorithm is " "applied: runs of consecutive whitespace are regarded as a single separator, " @@ -3944,7 +3948,7 @@ msgstr "" "συμβολοσειράς που αποτελείται μόνο από κενά διαστήματα με ένα ``None`` ως " "διαχωριστικό επιστρέφει ``[]``." -#: library/stdtypes.rst:2126 +#: library/stdtypes.rst:2129 msgid "" ">>> '1 2 3'.split()\n" "['1', '2', '3']\n" @@ -3960,7 +3964,7 @@ msgstr "" ">>> ' 1 2 3 '.split()\n" "['1', '2', '3']" -#: library/stdtypes.rst:2139 +#: library/stdtypes.rst:2142 msgid "" "Return a list of the lines in the string, breaking at line boundaries. Line " "breaks are not included in the resulting list unless *keepends* is given and " @@ -3970,7 +3974,7 @@ msgstr "" "διαχωρίζοντας στα όρια των γραμμών. Τα διαχωριστικά των γραμμών δεν " "περιλαμβάνονται στην νέα λίστα, εκτός αν δοθεί το *keepends* και είναι true." -#: library/stdtypes.rst:2143 +#: library/stdtypes.rst:2146 msgid "" "This method splits on the following line boundaries. In particular, the " "boundaries are a superset of :term:`universal newlines`." @@ -3978,107 +3982,107 @@ msgstr "" "Αυτή η μέθοδος διαχωρίζει στα ακόλουθα όρια γραμμών. Πιο συγκεκριμένα, τα " "όρια είναι ένα υπερσύνολο του :term:`universal newlines`." -#: library/stdtypes.rst:2147 +#: library/stdtypes.rst:2150 msgid "Representation" msgstr "Αναπαράσταση" -#: library/stdtypes.rst:2147 +#: library/stdtypes.rst:2150 msgid "Description" msgstr "Περιγραφή" -#: library/stdtypes.rst:2149 +#: library/stdtypes.rst:2152 msgid "``\\n``" msgstr "``\\n``" -#: library/stdtypes.rst:2149 +#: library/stdtypes.rst:2152 msgid "Line Feed" msgstr "Line Feed" -#: library/stdtypes.rst:2151 +#: library/stdtypes.rst:2154 msgid "``\\r``" msgstr "``\\r``" -#: library/stdtypes.rst:2151 +#: library/stdtypes.rst:2154 msgid "Carriage Return" msgstr "Carriage Return" -#: library/stdtypes.rst:2153 +#: library/stdtypes.rst:2156 msgid "``\\r\\n``" msgstr "``\\r\\n``" -#: library/stdtypes.rst:2153 +#: library/stdtypes.rst:2156 msgid "Carriage Return + Line Feed" msgstr "Carriage Return + Line Feed" -#: library/stdtypes.rst:2155 +#: library/stdtypes.rst:2158 msgid "``\\v`` or ``\\x0b``" msgstr "``\\v`` or ``\\x0b``" -#: library/stdtypes.rst:2155 +#: library/stdtypes.rst:2158 msgid "Line Tabulation" msgstr "Line Tabulation" -#: library/stdtypes.rst:2157 +#: library/stdtypes.rst:2160 msgid "``\\f`` or ``\\x0c``" msgstr "``\\f`` or ``\\x0c``" -#: library/stdtypes.rst:2157 +#: library/stdtypes.rst:2160 msgid "Form Feed" msgstr "Form Feed" -#: library/stdtypes.rst:2159 +#: library/stdtypes.rst:2162 msgid "``\\x1c``" msgstr "``\\x1c``" -#: library/stdtypes.rst:2159 +#: library/stdtypes.rst:2162 msgid "File Separator" msgstr "Διαχωριστής Αρχείου" -#: library/stdtypes.rst:2161 +#: library/stdtypes.rst:2164 msgid "``\\x1d``" msgstr "``\\x1d``" -#: library/stdtypes.rst:2161 +#: library/stdtypes.rst:2164 msgid "Group Separator" msgstr "Διαχωριστής Group" -#: library/stdtypes.rst:2163 +#: library/stdtypes.rst:2166 msgid "``\\x1e``" msgstr "``\\x1e``" -#: library/stdtypes.rst:2163 +#: library/stdtypes.rst:2166 msgid "Record Separator" msgstr "Διαχωριστής Εγγραφών" -#: library/stdtypes.rst:2165 +#: library/stdtypes.rst:2168 msgid "``\\x85``" msgstr "``\\x85``" -#: library/stdtypes.rst:2165 +#: library/stdtypes.rst:2168 msgid "Next Line (C1 Control Code)" msgstr "Επόμενη Γραμμή (C1 Control Code)" -#: library/stdtypes.rst:2167 +#: library/stdtypes.rst:2170 msgid "``\\u2028``" msgstr "``\\u2028``" -#: library/stdtypes.rst:2167 +#: library/stdtypes.rst:2170 msgid "Line Separator" msgstr "Διαχωριστής Γραμμής" -#: library/stdtypes.rst:2169 +#: library/stdtypes.rst:2172 msgid "``\\u2029``" msgstr "``\\u2029``" -#: library/stdtypes.rst:2169 +#: library/stdtypes.rst:2172 msgid "Paragraph Separator" msgstr "Διαχωριστής Παραγράφου" -#: library/stdtypes.rst:2174 +#: library/stdtypes.rst:2177 msgid "``\\v`` and ``\\f`` added to list of line boundaries." msgstr "Τα ``\\v`` και ``\\f`` προστίθενται στην λίστα ορίων των γραμμών." -#: library/stdtypes.rst:2178 +#: library/stdtypes.rst:2181 msgid "" ">>> 'ab c\\n\\nde fg\\rkl\\r\\n'.splitlines()\n" "['ab c', '', 'de fg', 'kl']\n" @@ -4090,7 +4094,7 @@ msgstr "" ">>> 'ab c\\n\\nde fg\\rkl\\r\\n'.splitlines(keepends=True)\n" "['ab c\\n', '\\n', 'de fg\\r', 'kl\\r\\n']" -#: library/stdtypes.rst:2183 +#: library/stdtypes.rst:2186 msgid "" "Unlike :meth:`~str.split` when a delimiter string *sep* is given, this " "method returns an empty list for the empty string, and a terminal line break " @@ -4101,7 +4105,7 @@ msgstr "" "αλφαριθμητικό, και μια τερματικό break γραμμής δεν οδηγεί σε μια επιπλέον " "γραμμή::" -#: library/stdtypes.rst:2187 +#: library/stdtypes.rst:2190 msgid "" ">>> \"\".splitlines()\n" "[]\n" @@ -4113,11 +4117,11 @@ msgstr "" ">>> \"One line\\n\".splitlines()\n" "['One line']" -#: library/stdtypes.rst:2192 +#: library/stdtypes.rst:2195 msgid "For comparison, ``split('\\n')`` gives::" msgstr "Συγκριτικά, η ``split('\\n')`` δίνει::" -#: library/stdtypes.rst:2194 +#: library/stdtypes.rst:2197 msgid "" ">>> ''.split('\\n')\n" "['']\n" @@ -4129,7 +4133,7 @@ msgstr "" ">>> 'Two lines\\n'.split('\\n')\n" "['Two lines', '']" -#: library/stdtypes.rst:2202 +#: library/stdtypes.rst:2205 msgid "" "Return ``True`` if string starts with the *prefix*, otherwise return " "``False``. *prefix* can also be a tuple of prefixes to look for. With " @@ -4142,7 +4146,7 @@ msgstr "" "αλφαριθμητικό που αρχίζει από τη συγκεκριμένη θέση. Με το προαιρετικό " "*end*, σταματά η σύγκριση της συμβολοσειράς σε αυτή τη θέση." -#: library/stdtypes.rst:2210 +#: library/stdtypes.rst:2213 msgid "" "Return a copy of the string with the leading and trailing characters " "removed. The *chars* argument is a string specifying the set of characters " @@ -4157,7 +4161,7 @@ msgstr "" "default την αφαίρεση των κενών διαστημάτων. Το όρισμα *chars* δεν είναι " "prefix ή suffix· μάλλον, όλοι οι συνδυασμοί των τιμών του αφαιρούνται::" -#: library/stdtypes.rst:2216 +#: library/stdtypes.rst:2219 msgid "" ">>> ' spacious '.strip()\n" "'spacious'\n" @@ -4169,7 +4173,7 @@ msgstr "" ">>> 'www.example.com'.strip('cmowz.')\n" "'example'" -#: library/stdtypes.rst:2221 +#: library/stdtypes.rst:2224 msgid "" "The outermost leading and trailing *chars* argument values are stripped from " "the string. Characters are removed from the leading end until reaching a " @@ -4182,7 +4186,7 @@ msgstr "" "στο σύνολο χαρακτήρων του *chars*. Μια παρόμοια ενέργεια λαμβάνει χώρα στο " "τέλος της ουράς. Για παράδειγμα:" -#: library/stdtypes.rst:2227 +#: library/stdtypes.rst:2230 msgid "" ">>> comment_string = '#....... Section 3.2.1 Issue #32 .......'\n" ">>> comment_string.strip('.#! ')\n" @@ -4192,7 +4196,7 @@ msgstr "" ">>> comment_string.strip('.#! ')\n" "'Section 3.2.1 Issue #32'" -#: library/stdtypes.rst:2234 +#: library/stdtypes.rst:2237 msgid "" "Return a copy of the string with uppercase characters converted to lowercase " "and vice versa. Note that it is not necessarily true that ``s.swapcase()." @@ -4202,7 +4206,7 @@ msgstr "" "που έχουν μετατραπεί σε πεζούς και αντίστροφα. Σημειώστε ότι δεν είναι " "απαραίτητα αληθές ότι ``s.swapcase().swapcase() == s``." -#: library/stdtypes.rst:2241 +#: library/stdtypes.rst:2244 msgid "" "Return a titlecased version of the string where words start with an " "uppercase character and the remaining characters are lowercase." @@ -4210,7 +4214,7 @@ msgstr "" "Επιστρέφει μια titlecased έκδοση της συμβολοσειράς, όπου οι λέξεις ξεκινούν " "με ένα κεφαλαίο χαρακτήρα και οι υπόλοιποι χαρακτήρες είναι πεζοί." -#: library/stdtypes.rst:2246 +#: library/stdtypes.rst:2249 msgid "" ">>> 'Hello world'.title()\n" "'Hello World'" @@ -4218,7 +4222,7 @@ msgstr "" ">>> 'Hello world'.title()\n" "'Hello World'" -#: library/stdtypes.rst:3469 +#: library/stdtypes.rst:3618 msgid "" "The algorithm uses a simple language-independent definition of a word as " "groups of consecutive letters. The definition works in many contexts but it " @@ -4230,7 +4234,7 @@ msgstr "" "contexts, αλλά σημαίνει ότι οι απόστροφοι σε συναιρέσεις και κτητικές λέξεις " "αποτελούν όρια λέξεων, που μπορεί να μην είναι το επιθυμητό αποτέλεσμα::" -#: library/stdtypes.rst:2254 +#: library/stdtypes.rst:2257 msgid "" ">>> \"they're bill's friends from the UK\".title()\n" "\"They'Re Bill'S Friends From The Uk\"" @@ -4238,7 +4242,7 @@ msgstr "" ">>> \"they're bill's friends from the UK\".title()\n" "\"They'Re Bill'S Friends From The Uk\"" -#: library/stdtypes.rst:2257 +#: library/stdtypes.rst:2260 msgid "" "The :func:`string.capwords` function does not have this problem, as it " "splits words on spaces only." @@ -4246,7 +4250,7 @@ msgstr "" "Η συνάρτηση :func:`string.capwords` δεν έχει αυτό το πρόβλημα, καθώς χωρίζει " "τις λέξεις μόνο σε κενά." -#: library/stdtypes.rst:2260 +#: library/stdtypes.rst:2263 msgid "" "Alternatively, a workaround for apostrophes can be constructed using regular " "expressions::" @@ -4254,7 +4258,7 @@ msgstr "" "Εναλλακτικά, μπορεί να κατασκευαστεί μια λύση για τις αποστρόφους " "χρησιμοποιώντας κανονικές εκφράσεις::" -#: library/stdtypes.rst:2263 +#: library/stdtypes.rst:2266 msgid "" ">>> import re\n" ">>> def titlecase(s):\n" @@ -4274,7 +4278,7 @@ msgstr "" ">>> titlecase(\"they're bill's friends.\")\n" "\"They're Bill's Friends.\"" -#: library/stdtypes.rst:2275 +#: library/stdtypes.rst:2278 msgid "" "Return a copy of the string in which each character has been mapped through " "the given translation table. The table must be an object that implements " @@ -4297,7 +4301,7 @@ msgstr "" "επιστρέφεται· ή να κάνει raise ένα :exc:`LookupError`, για να αντιστοιχίσει " "τον χαρακτήρα στον εαυτό του." -#: library/stdtypes.rst:2284 +#: library/stdtypes.rst:2287 msgid "" "You can use :meth:`str.maketrans` to create a translation map from character-" "to-character mappings in different formats." @@ -4306,7 +4310,7 @@ msgstr "" "ένα χάρτη μετάφρασης αντιστοίχισης από χαρακτήρα-σε-χαρακτήρα σε " "διαφορετικές μορφές." -#: library/stdtypes.rst:2287 +#: library/stdtypes.rst:2290 msgid "" "See also the :mod:`codecs` module for a more flexible approach to custom " "character mappings." @@ -4314,7 +4318,7 @@ msgstr "" "Δείτε επίσης την ενότητα :mod:`codecs` για μια πιο ευέλικτη προσέγγιση σε " "προσαρμοσμένα mappings χαρακτήρων." -#: library/stdtypes.rst:2293 +#: library/stdtypes.rst:2296 msgid "" "Return a copy of the string with all the cased characters [4]_ converted to " "uppercase. Note that ``s.upper().isupper()`` might be ``False`` if ``s`` " @@ -4328,17 +4332,17 @@ msgstr "" "πεζά γράμματα ή αν η κατηγορία Unicode του προκύπτοντος χαρακτήρα(ων) δεν " "είναι \"Lu\" (Γράμμα, κεφαλαίο), αλλά π.χ. \"Lt\" (Γράμμα, titlecase)." -#: library/stdtypes.rst:2299 +#: library/stdtypes.rst:2302 msgid "" "The uppercasing algorithm used is `described in section 3.13 'Default Case " "Folding' of the Unicode Standard `__." +"Unicode15.1.0/ch03.pdf>`__." msgstr "" "Ο uppercasing αλγόριθμος που χρησιμοποιείται `περιγράφεται στην ενότητα 3.13 " "'Default Case Folding' του προτύπου Unicode `__." +"versions/Unicode15.1.0/ch03.pdf>`__." -#: library/stdtypes.rst:2306 +#: library/stdtypes.rst:2309 msgid "" "Return a copy of the string left filled with ASCII ``'0'`` digits to make a " "string of length *width*. A leading sign prefix (``'+'``/``'-'``) is handled " @@ -4351,7 +4355,7 @@ msgstr "" "συμπλήρωση *μετά* τον χαρακτήρα sign αντί για πριν. Η αρχική συμβολοσειρά " "επιστρέφεται εάν το *width* είναι μικρότερο ή ίσο με ``len(s)``." -#: library/stdtypes.rst:2314 +#: library/stdtypes.rst:2317 msgid "" ">>> \"42\".zfill(5)\n" "'00042'\n" @@ -4363,11 +4367,272 @@ msgstr "" ">>> \"-42\".zfill(5)\n" "'-0042'" -#: library/stdtypes.rst:2324 +#: library/stdtypes.rst:2338 +msgid "Formatted String Literals (f-strings)" +msgstr "Διαμορφωμένες Κυριολεκτικές Συμβολοσειρές (f-strings)" + +#: library/stdtypes.rst:2341 +msgid "" +"The :keyword:`await` and :keyword:`async for` can be used in expressions " +"within f-strings." +msgstr "" +"Τα :keyword:`await` και :keyword:`async for` μπορούν να χρησιμοποιηθούν σε " +"εκφράσεις μέσα σε f-strings." + +#: library/stdtypes.rst:2344 +msgid "Added the debugging operator (``=``)" +msgstr "Προστέθηκε ο τελεστής αποσφαλμάτωσης (``=``)" + +#: library/stdtypes.rst:2346 +msgid "" +"Many restrictions on expressions within f-strings have been removed. " +"Notably, nested strings, comments, and backslashes are now permitted." +msgstr "" +"Πολλοί περιορισμοί στις εκφράσεις μέσα σε f-strings έχουν αφαιρεθεί. " +"Ιδιαίτερα, πλέον επιτρέπονται οι εμφωλευμένες συμβολοσειρές, τα σχόλια και " +"οι κάθετοι." + +#: library/stdtypes.rst:2350 +msgid "" +"An :dfn:`f-string` (formally a :dfn:`formatted string literal`) is a string " +"literal that is prefixed with ``f`` or ``F``. This type of string literal " +"allows embedding arbitrary Python expressions within *replacement fields*, " +"which are delimited by curly brackets (``{}``). These expressions are " +"evaluated at runtime, similarly to :meth:`str.format`, and are converted " +"into regular :class:`str` objects. For example:" +msgstr "" +"Ένα :dfn:`f-string` (επίσημα ένα :dfn:`formatted string literal`) είναι μια " +"κυριολεκτική συμβολοσειρά που προεξέχει με ``f`` ή ``F``. Αυτός ο τύπος " +"κυριολεκτικής συμβολοσειράς επιτρέπει την ενσωμάτωση αυθαίρετων εκφράσεων " +"Python μέσα σε *πεδία αντικατάστασης*, τα οποία περιβάλλονται από αγκύλες " +"(``{}``). Αυτές οι εκφράσεις αξιολογούνται κατά την εκτέλεση, με παρόμοιο " +"τρόπο όπως η μέθοδος :meth:`str.format`, και μετατρέπονται σε κανονικά " +"αντικείμενα τύπου :class:`str`. Για παράδειγμα:" + +#: library/stdtypes.rst:2358 +msgid "" +">>> who = 'nobody'\n" +">>> nationality = 'Spanish'\n" +">>> f'{who.title()} expects the {nationality} Inquisition!'\n" +"'Nobody expects the Spanish Inquisition!'" +msgstr "" +">>> who = 'nobody'\n" +">>> nationality = 'Spanish'\n" +">>> f'{who.title()} expects the {nationality} Inquisition!'\n" +"'Nobody expects the Spanish Inquisition!'" + +#: library/stdtypes.rst:2365 +msgid "It is also possible to use a multi line f-string:" +msgstr "Είναι επίσης δυνατό να χρησιμοποιηθεί μια f-string πολλών γραμμών:" + +#: library/stdtypes.rst:2367 +msgid "" +">>> f'''This is a string\n" +"... on two lines'''\n" +"'This is a string\\non two lines'" +msgstr "" +">>> f'''This is a string\n" +"... on two lines'''\n" +"'This is a string\\non two lines'" + +#: library/stdtypes.rst:2373 +msgid "" +"A single opening curly bracket, ``'{'``, marks a *replacement field* that " +"can contain any Python expression:" +msgstr "" +"Ένα μόνο άνοιγμα αγκύλης, ``'{'``, δηλώνει ένα *πεδίο αντικατάστασης* που " +"μπορεί να περιέχει οποιαδήποτε έκφραση Python:" + +#: library/stdtypes.rst:2376 +msgid "" +">>> nationality = 'Spanish'\n" +">>> f'The {nationality} Inquisition!'\n" +"'The Spanish Inquisition!'" +msgstr "" +">>> nationality = 'Spanish'\n" +">>> f'The {nationality} Inquisition!'\n" +"'The Spanish Inquisition!'" + +#: library/stdtypes.rst:2382 +msgid "To include a literal ``{`` or ``}``, use a double bracket:" +msgstr "" +"Για να συμπεριλάβετε μια κυριολεξία ``{`` ή ``}``, χρησιμοποιήστε διπλή " +"αγκύλη:" + +#: library/stdtypes.rst:2384 +msgid "" +">>> x = 42\n" +">>> f'{{x}} is {x}'\n" +"'{x} is 42'" +msgstr "" +">>> x = 42\n" +">>> f'{{x}} is {x}'\n" +"'{x} is 42'" + +#: library/stdtypes.rst:2390 +msgid "" +"Functions can also be used, and :ref:`format specifiers `:" +msgstr "" +"Μπορούν επίσης να χρησιμοποιηθούν συναρτήσεις καθώς και :ref:`format " +"specifiers `:" + +#: library/stdtypes.rst:2392 +msgid "" +">>> from math import sqrt\n" +">>> f'√2 \\N{ALMOST EQUAL TO} {sqrt(2):.5f}'\n" +"'√2 ≈ 1.41421'" +msgstr "" +">>> from math import sqrt\n" +">>> f'√2 \\N{ALMOST EQUAL TO} {sqrt(2):.5f}'\n" +"'√2 ≈ 1.41421'" + +#: library/stdtypes.rst:2398 +msgid "Any non-string expression is converted using :func:`str`, by default:" +msgstr "" +"Κάθε έκφραση μη-συμβολοσειράς μετατρέπεται χρησιμοποιώντας τη :func:`str`, " +"από προεπιλογή:" + +#: library/stdtypes.rst:2400 +msgid "" +">>> from fractions import Fraction\n" +">>> f'{Fraction(1, 3)}'\n" +"'1/3'" +msgstr "" +">>> from fractions import Fraction\n" +">>> f'{Fraction(1, 3)}'\n" +"'1/3'" + +#: library/stdtypes.rst:2406 +msgid "" +"To use an explicit conversion, use the ``!`` (exclamation mark) operator, " +"followed by any of the valid formats, which are:" +msgstr "" +"Για να χρησιμοποιήσετε ρητή μετατροπή, χρησιμοποιήστε τον τελεστή ``!`` " +"(θαυμαστικό), ακολουθούμενο από οποιεσδήποτε από τις έγκυρες μορφές, τα " +"οποία είναι:" + +#: library/stdtypes.rst:2578 library/stdtypes.rst:3797 +msgid "Conversion" +msgstr "Μετατροπή" + +#: library/stdtypes.rst:2412 +msgid "``!a``" +msgstr "``!a``" + +#: library/stdtypes.rst:2412 +msgid ":func:`ascii`" +msgstr ":func:`ascii`" + +#: library/stdtypes.rst:2413 +msgid "``!r``" +msgstr "``!r``" + +#: library/stdtypes.rst:2413 +msgid ":func:`repr`" +msgstr ":func:`repr`" + +#: library/stdtypes.rst:2414 +msgid "``!s``" +msgstr "``!s``" + +#: library/stdtypes.rst:2414 +msgid ":func:`str`" +msgstr ":func:`str`" + +#: library/stdtypes.rst:2417 +msgid "For example:" +msgstr "Για παράδειγμα:" + +#: library/stdtypes.rst:2419 +msgid "" +">>> from fractions import Fraction\n" +">>> f'{Fraction(1, 3)!s}'\n" +"'1/3'\n" +">>> f'{Fraction(1, 3)!r}'\n" +"'Fraction(1, 3)'\n" +">>> question = '¿Dónde está el Presidente?'\n" +">>> print(f'{question!a}')\n" +"'\\xbfD\\xf3nde est\\xe1 el Presidente?'" +msgstr "" +">>> from fractions import Fraction\n" +">>> f'{Fraction(1, 3)!s}'\n" +"'1/3'\n" +">>> f'{Fraction(1, 3)!r}'\n" +"'Fraction(1, 3)'\n" +">>> question = '¿Dónde está el Presidente?'\n" +">>> print(f'{question!a}')\n" +"'\\xbfD\\xf3nde est\\xe1 el Presidente?'" + +#: library/stdtypes.rst:2430 +msgid "" +"While debugging it may be helpful to see both the expression and its value, " +"by using the equals sign (``=``) after the expression. This preserves spaces " +"within the brackets, and can be used with a converter. By default, the " +"debugging operator uses the :func:`repr` (``!r``) conversion. For example:" +msgstr "" +"Κατά την αποσφαλμάτωση, μπορεί να είναι χρήσιμο να βλέπουμε τόσο την έκφραση " +"όσο και την τιμή της, χρησιμοποιώντας το σύμβολο του ίσου (``=``) μετά την " +"έκφραση. Αυτό διατηρεί τα κενά μέσα στις αγκύλες και μπορείς να " +"χρησιμοποιηθεί με έναν μετατροπέα. Από προεπιλογή, ο χειριστής " +"αποσφαλμάτωσης χρησιμοποιεί τη μετατροπή :func:`repr` (``!r``). Για " +"παράδειγμα:" + +#: library/stdtypes.rst:2436 +msgid "" +">>> from fractions import Fraction\n" +">>> calculation = Fraction(1, 3)\n" +">>> f'{calculation=}'\n" +"'calculation=Fraction(1, 3)'\n" +">>> f'{calculation = }'\n" +"'calculation = Fraction(1, 3)'\n" +">>> f'{calculation = !s}'\n" +"'calculation = 1/3'" +msgstr "" +">>> from fractions import Fraction\n" +">>> calculation = Fraction(1, 3)\n" +">>> f'{calculation=}'\n" +"'calculation=Fraction(1, 3)'\n" +">>> f'{calculation = }'\n" +"'calculation = Fraction(1, 3)'\n" +">>> f'{calculation = !s}'\n" +"'calculation = 1/3'" + +#: library/stdtypes.rst:2447 +msgid "" +"Once the output has been evaluated, it can be formatted using a :ref:`format " +"specifier ` following a colon (``':'``). After the expression " +"has been evaluated, and possibly converted to a string, the :meth:`!" +"__format__` method of the result is called with the format specifier, or the " +"empty string if no format specifier is given. The formatted result is then " +"used as the final value for the replacement field. For example:" +msgstr "" +"Μόλις η έξοδος έχει αξιολογηθεί, μπορεί να μορφοποιηθεί χρησιμοποιώντας ένα :" +"ref:`format specifier ` που ακολουθείται από άνω και κάτω " +"τελεία (``':'``). Αφού η έκφραση έχει αξιολογηθεί και, πιθανώς μετατραπεί σε " +"συμβολοσειρά, καλείται η μέθοδος :meth:`!__format__` του αποτελέσματος με " +"τον καθοριστή μορφοποίησης, ή η κενή συμβολοσειρά αν δεν έχει δοθεί " +"καθοριστής μορφοποίησης. Το μορφοποιημένο αποτέλεσμα χρησιμοποιείται στη " +"συνέχεια ως η τελική τιμή για το πεδίο αντικατάστασης. Για παράδειγμα:" + +#: library/stdtypes.rst:2455 +msgid "" +">>> from fractions import Fraction\n" +">>> f'{Fraction(1, 7):.6f}'\n" +"'0.142857'\n" +">>> f'{Fraction(1, 7):_^+10}'\n" +"'___+1/7___'" +msgstr "" +">>> from fractions import Fraction\n" +">>> f'{Fraction(1, 7):.6f}'\n" +"'0.142857'\n" +">>> f'{Fraction(1, 7):_^+10}'\n" +"'___+1/7___'" + +#: library/stdtypes.rst:2467 msgid "``printf``-style String Formatting" msgstr "``printf``-style String Formatting" -#: library/stdtypes.rst:2337 +#: library/stdtypes.rst:2480 msgid "" "The formatting operations described here exhibit a variety of quirks that " "lead to a number of common errors (such as failing to display tuples and " @@ -4386,23 +4651,32 @@ msgstr "" "τους δικούς τις συμβιβασμούς και τα οφέλη της απλότητας, ευελιξίας και/ή " "επεκτασιμότητας." -#: library/stdtypes.rst:2345 +#: library/stdtypes.rst:2488 msgid "" "String objects have one unique built-in operation: the ``%`` operator " "(modulo). This is also known as the string *formatting* or *interpolation* " "operator. Given ``format % values`` (where *format* is a string), ``%`` " "conversion specifications in *format* are replaced with zero or more " "elements of *values*. The effect is similar to using the :c:func:`sprintf` " -"in the C language." +"function in the C language. For example:" msgstr "" "Τα αντικείμενα string έχουν μια μοναδική ενσωματωμένη λειτουργία: τον " "τελεστή ``%`` (modulo). Αυτός είναι επίσης γνωστός ως τελεστής *formatting* " "ή * interpolation*. Δεδομένων των ``format % values`` (όπου *format* είναι " "μία συμβολοσειρά), ``%`` οι προδιαγραφές μετατροπής στο *format* " "αντικαθίστανται από μηδέν ή περισσότερα στοιχεία των *values*. Το αποτέλεσμα " -"είναι παρόμοιο με τη χρήση του :c:func:`sprintf` στη γλώσσα C." +"είναι παρόμοιο με τη χρήση του :c:func:`sprintf` στη γλώσσα C. Για " +"παράδειγμα:" -#: library/stdtypes.rst:2351 +#: library/stdtypes.rst:2495 +msgid "" +">>> print('%s has %d quote types.' % ('Python', 2))\n" +"Python has 2 quote types." +msgstr "" +">>> print('%s has %d quote types.' % ('Python', 2))\n" +"Python has 2 quote types." + +#: library/stdtypes.rst:2500 msgid "" "If *format* requires a single argument, *values* may be a single non-tuple " "object. [5]_ Otherwise, *values* must be a tuple with exactly the number of " @@ -4415,7 +4689,7 @@ msgstr "" "από το format string ή ένα μεμονωμένο αντικείμενο αντιστοίχισης (για " "παράδειγμα, ένα λεξικό)." -#: library/stdtypes.rst:3580 +#: library/stdtypes.rst:3729 msgid "" "A conversion specifier contains two or more characters and has the following " "components, which must occur in this order:" @@ -4423,11 +4697,11 @@ msgstr "" "Ένας προσδιοριστής μετατροπής περιέχει δύο ή περισσότερους χαρακτήρες και " "έχει τους εξής components, οι οποίοι πρέπει να εμφανίζονται με αυτή τη σειρά:" -#: library/stdtypes.rst:3583 +#: library/stdtypes.rst:3732 msgid "The ``'%'`` character, which marks the start of the specifier." msgstr "Ο χαρακτήρας ```%''``, που σηματοδοτεί την αρχή του προσδιοριστή." -#: library/stdtypes.rst:3585 +#: library/stdtypes.rst:3734 msgid "" "Mapping key (optional), consisting of a parenthesised sequence of characters " "(for example, ``(somename)``)." @@ -4435,7 +4709,7 @@ msgstr "" "Κλειδί mapping (προαιρετικό), που αποτελείται από μια ακολουθία χαρακτήρων " "σε παρένθεση (για παράδειγμα, ``(somename)``)." -#: library/stdtypes.rst:3588 +#: library/stdtypes.rst:3737 msgid "" "Conversion flags (optional), which affect the result of some conversion " "types." @@ -4443,7 +4717,7 @@ msgstr "" "Δείκτες μετατροπής (προαιρετικό), που επηρεάζουν το αποτέλεσμα κάποιων τύπων " "μετατροπής." -#: library/stdtypes.rst:3591 +#: library/stdtypes.rst:3740 msgid "" "Minimum field width (optional). If specified as an ``'*'`` (asterisk), the " "actual width is read from the next element of the tuple in *values*, and the " @@ -4454,7 +4728,7 @@ msgstr "" "*values*, και το αντικείμενο προς μετατροπή έρχεται μετά από το ελάχιστο " "πλάτος πεδίου και το προαιρετικό precision." -#: library/stdtypes.rst:3595 +#: library/stdtypes.rst:3744 msgid "" "Precision (optional), given as a ``'.'`` (dot) followed by the precision. " "If specified as ``'*'`` (an asterisk), the actual precision is read from the " @@ -4466,15 +4740,15 @@ msgstr "" "διαβάζεται από το επόμενο στοιχείο του tuple στα *values*, και η τιμή προς " "μετατροπή έρχεται μετά το precision." -#: library/stdtypes.rst:3600 +#: library/stdtypes.rst:3749 msgid "Length modifier (optional)." msgstr "Μετατροπέας του length (προαιρετικό)." -#: library/stdtypes.rst:3602 +#: library/stdtypes.rst:3751 msgid "Conversion type." msgstr "Τύπος conversion." -#: library/stdtypes.rst:2385 +#: library/stdtypes.rst:2534 msgid "" "When the right argument is a dictionary (or other mapping type), then the " "formats in the string *must* include a parenthesised mapping key into that " @@ -4487,7 +4761,7 @@ msgstr "" "``'%'``. Το κλειδί αντιστοίχισης επιλέγει την τιμή που θα μορφοποιηθεί από " "την αντιστοίχιση. Για παράδειγμα:" -#: library/stdtypes.rst:3613 +#: library/stdtypes.rst:3762 msgid "" "In this case no ``*`` specifiers may occur in a format (since they require a " "sequential parameter list)." @@ -4495,38 +4769,38 @@ msgstr "" "Σε αυτήν την περίπτωση δεν μπορεί να υπάρχουν προσδιοριστές ``*`` σε μια " "μορφή (καθώς απαιτούν μια διαδοχική λίστα παραμέτρων)." -#: library/stdtypes.rst:3616 +#: library/stdtypes.rst:3765 msgid "The conversion flag characters are:" msgstr "Οι δείκτες μετατροπής είναι:" -#: library/stdtypes.rst:3625 +#: library/stdtypes.rst:3774 msgid "Flag" msgstr "Flag" -#: library/stdtypes.rst:3627 +#: library/stdtypes.rst:3776 msgid "``'#'``" msgstr "``'#'``" -#: library/stdtypes.rst:3627 +#: library/stdtypes.rst:3776 msgid "" "The value conversion will use the \"alternate form\" (where defined below)." msgstr "" "Οι μετατροπή τιμής θα χρησιμοποιήσει την \"εναλλακτική φόρμα\" (όπου " "ορίζεται παρακάτω)." -#: library/stdtypes.rst:3630 +#: library/stdtypes.rst:3779 msgid "``'0'``" msgstr "``'0'``" -#: library/stdtypes.rst:3630 +#: library/stdtypes.rst:3779 msgid "The conversion will be zero padded for numeric values." msgstr "Η μετατροπή θα έχει μηδενική συμπλήρωση για αριθμητικές τιμές." -#: library/stdtypes.rst:3632 +#: library/stdtypes.rst:3781 msgid "``'-'``" msgstr "``'-'``" -#: library/stdtypes.rst:3632 +#: library/stdtypes.rst:3781 msgid "" "The converted value is left adjusted (overrides the ``'0'`` conversion if " "both are given)." @@ -4534,11 +4808,11 @@ msgstr "" "Η τιμή μετατροπής αφήνεται προσαρμοσμένη (παρακάμπτει τη μετατροπή ``'0'`` " "εάν δίνονται και τα δύο)." -#: library/stdtypes.rst:3635 +#: library/stdtypes.rst:3784 msgid "``' '``" msgstr "``' '``" -#: library/stdtypes.rst:3635 +#: library/stdtypes.rst:3784 msgid "" "(a space) A blank should be left before a positive number (or empty string) " "produced by a signed conversion." @@ -4546,11 +4820,11 @@ msgstr "" "(ένα κενό) Πρέπει να προστεθεί ένα κενό πριν από έναν θετικό αριθμό (ή κενή " "συμβολοσειρά) που παράγεται από μια υπογεγραμμένη μετατροπή." -#: library/stdtypes.rst:3638 +#: library/stdtypes.rst:3787 msgid "``'+'``" msgstr "``'+'``" -#: library/stdtypes.rst:3638 +#: library/stdtypes.rst:3787 msgid "" "A sign character (``'+'`` or ``'-'``) will precede the conversion (overrides " "a \"space\" flag)." @@ -4558,7 +4832,7 @@ msgstr "" "Ένα χαρακτήρας προσήμου (``'+'`` ή ``'-'``) θα προηγείται της μετατροπής " "(παρακάμπτει ένα \"κενό\" δείκτη)." -#: library/stdtypes.rst:3642 +#: library/stdtypes.rst:3791 msgid "" "A length modifier (``h``, ``l``, or ``L``) may be present, but is ignored as " "it is not necessary for Python -- so e.g. ``%ld`` is identical to ``%d``." @@ -4567,91 +4841,87 @@ msgstr "" "αγνοείται καθώς δεν είναι απαραίτητος για την Python -- οπότε π.χ. ``%ld`` " "είναι πανομοιότυπο σε ``%d``." -#: library/stdtypes.rst:3645 +#: library/stdtypes.rst:3794 msgid "The conversion types are:" msgstr "Οι τύποι μετατροπής είναι:" -#: library/stdtypes.rst:3648 -msgid "Conversion" -msgstr "Μετατροπή" - -#: library/stdtypes.rst:3650 +#: library/stdtypes.rst:3799 msgid "``'d'``" msgstr "``'d'``" -#: library/stdtypes.rst:2433 library/stdtypes.rst:3652 +#: library/stdtypes.rst:2582 library/stdtypes.rst:3801 msgid "Signed integer decimal." msgstr "Υπογεγραμμένος δεκαδικός ακέραιος." -#: library/stdtypes.rst:3652 +#: library/stdtypes.rst:3801 msgid "``'i'``" msgstr "``'i'``" -#: library/stdtypes.rst:3654 +#: library/stdtypes.rst:3803 msgid "``'o'``" msgstr "``'o'``" -#: library/stdtypes.rst:3654 +#: library/stdtypes.rst:3803 msgid "Signed octal value." msgstr "Υπογεγραμμένη οκταδική τιμή." -#: library/stdtypes.rst:3656 +#: library/stdtypes.rst:3805 msgid "``'u'``" msgstr "``'u'``" -#: library/stdtypes.rst:3656 +#: library/stdtypes.rst:3805 msgid "Obsolete type -- it is identical to ``'d'``." msgstr "Απαρχαιωμένος τύπος -- είναι πανομοιότυπος με το ``'d'``." -#: library/stdtypes.rst:3658 +#: library/stdtypes.rst:3807 msgid "``'x'``" msgstr "``'x'``" -#: library/stdtypes.rst:3658 +#: library/stdtypes.rst:3807 msgid "Signed hexadecimal (lowercase)." msgstr "Υπογεγραμμένο δεκαεξαδικό (πεζά)." -#: library/stdtypes.rst:3660 +#: library/stdtypes.rst:3809 msgid "``'X'``" msgstr "``'X'``" -#: library/stdtypes.rst:3660 +#: library/stdtypes.rst:3809 msgid "Signed hexadecimal (uppercase)." msgstr "Υπογεγραμμένο δεκαεξαδικό (κεφαλαίο)." -#: library/stdtypes.rst:3662 +#: library/stdtypes.rst:3811 msgid "``'e'``" msgstr "``'e'``" -#: library/stdtypes.rst:3662 +#: library/stdtypes.rst:3811 msgid "Floating-point exponential format (lowercase)." msgstr "Εκθετική μορφή κινητής υποδιαστολής (πεζά)" -#: library/stdtypes.rst:3664 +#: library/stdtypes.rst:3813 msgid "``'E'``" msgstr "``'E'``" -#: library/stdtypes.rst:3664 +#: library/stdtypes.rst:3813 msgid "Floating-point exponential format (uppercase)." msgstr "Εκθετική μορφή κινητής υποδιαστολής (κεφαλαία)" -#: library/stdtypes.rst:3666 +#: library/stdtypes.rst:3815 msgid "``'f'``" msgstr "``'f'``" -#: library/stdtypes.rst:2449 library/stdtypes.rst:3668 +#: library/stdtypes.rst:2598 library/stdtypes.rst:3817 msgid "Floating-point decimal format." msgstr "Δεκαδική μορφή κινητής υποδιαστολής." -#: library/stdtypes.rst:3668 +#: library/stdtypes.rst:3817 msgid "``'F'``" msgstr "``'F'``" -#: library/stdtypes.rst:3670 +#: library/stdtypes.rst:3819 msgid "``'g'``" msgstr "``'g'``" -#: library/stdtypes.rst:3670 +#: library/stdtypes.rst:3819 msgid "" "Floating-point format. Uses lowercase exponential format if exponent is less " "than -4 or not less than precision, decimal format otherwise." @@ -4660,11 +4930,11 @@ msgstr "" "είναι μικρότερος από -4 ή όχι μικρότερος από την ακρίβεια, διαφορετικά " "χρησιμοποιεί δεκαδική μορφή." -#: library/stdtypes.rst:3674 +#: library/stdtypes.rst:3823 msgid "``'G'``" msgstr "``'G'``" -#: library/stdtypes.rst:3674 +#: library/stdtypes.rst:3823 msgid "" "Floating-point format. Uses uppercase exponential format if exponent is less " "than -4 or not less than precision, decimal format otherwise." @@ -4673,56 +4943,56 @@ msgstr "" "εκθέτης είναι μικρότερος από -4 ή όχι μικρότερος από την ακρίβεια, " "διαφορετικά χρησιμοποιεί δεκαδική μορφή." -#: library/stdtypes.rst:3678 +#: library/stdtypes.rst:3827 msgid "``'c'``" msgstr "``'c'``" -#: library/stdtypes.rst:2459 +#: library/stdtypes.rst:2608 msgid "Single character (accepts integer or single character string)." msgstr "" "Μεμονωμένος χαρακτήρας (δέχεται ακέραιο ή μονό χαρακτήρα συμβολοσειράς)." -#: library/stdtypes.rst:3691 +#: library/stdtypes.rst:3840 msgid "``'r'``" msgstr "``'r'``" -#: library/stdtypes.rst:2462 +#: library/stdtypes.rst:2611 msgid "String (converts any Python object using :func:`repr`)." msgstr "" "Συμβολοσειρά (μετατρέπει οποιοδήποτε αντικείμενο Python χρησιμοποιώντας :" "func:`repr`)." -#: library/stdtypes.rst:3685 +#: library/stdtypes.rst:3834 msgid "``'s'``" msgstr "``'s'``" -#: library/stdtypes.rst:2465 +#: library/stdtypes.rst:2614 msgid "String (converts any Python object using :func:`str`)." msgstr "" "Συμβολοσειρά (μετατρέπει οποιοδήποτε αντικείμενο Python χρησιμοποιώντας :" "func:`str`)." -#: library/stdtypes.rst:3688 +#: library/stdtypes.rst:3837 msgid "``'a'``" msgstr "``'a'``" -#: library/stdtypes.rst:2468 +#: library/stdtypes.rst:2617 msgid "String (converts any Python object using :func:`ascii`)." msgstr "" "Συμβολοσειρά (μετατρέπει οποιοδήποτε αντικείμενο Python χρησιμοποιώντας :" "func:`ascii`)." -#: library/stdtypes.rst:3694 +#: library/stdtypes.rst:3843 msgid "``'%'``" msgstr "``'%'``" -#: library/stdtypes.rst:3694 +#: library/stdtypes.rst:3843 msgid "No argument is converted, results in a ``'%'`` character in the result." msgstr "" "Κανένα όρισμα δεν μετατρέπεται, έχει ως αποτέλεσμα έναν χαρακτήρα ``'%'`` το " "αποτέλεσμα." -#: library/stdtypes.rst:3701 +#: library/stdtypes.rst:3850 msgid "" "The alternate form causes a leading octal specifier (``'0o'``) to be " "inserted before the first digit." @@ -4730,7 +5000,7 @@ msgstr "" "Η εναλλακτική μορφή προκαλεί την εισαγωγή ενός πρώτου οκταδικού προσδιοριστή " "(``'0o'``) πριν από το πρώτο ψηφίο." -#: library/stdtypes.rst:3705 +#: library/stdtypes.rst:3854 msgid "" "The alternate form causes a leading ``'0x'`` or ``'0X'`` (depending on " "whether the ``'x'`` or ``'X'`` format was used) to be inserted before the " @@ -4740,7 +5010,7 @@ msgstr "" "(ανάλογα με το εάν χρησιμοποιήθηκε η μορφή ``'x'`` ή ``'X'``) πριν το πρώτο " "ψηφίο." -#: library/stdtypes.rst:3709 +#: library/stdtypes.rst:3858 msgid "" "The alternate form causes the result to always contain a decimal point, even " "if no digits follow it." @@ -4748,7 +5018,7 @@ msgstr "" "Η εναλλακτική μορφή κάνει το αποτέλεσμα να περιέχει πάντα μια υποδιαστολή, " "ακόμα κι αν δεν ακολουθούν ψηφία." -#: library/stdtypes.rst:3712 +#: library/stdtypes.rst:3861 msgid "" "The precision determines the number of digits after the decimal point and " "defaults to 6." @@ -4756,7 +5026,7 @@ msgstr "" "Η ακρίβεια καθορίζει τον αριθμό των ψηφίων μετά την υποδιαστολή και ορίζεται " "από προεπιλογή ως 6." -#: library/stdtypes.rst:3716 +#: library/stdtypes.rst:3865 msgid "" "The alternate form causes the result to always contain a decimal point, and " "trailing zeroes are not removed as they would otherwise be." @@ -4764,7 +5034,7 @@ msgstr "" "Η εναλλακτική μορφή κάνει το αποτέλεσμα να περιέχει πάντα μια υποδιαστολή " "και τα μηδενικά στο τέλος δεν αφαιρούνται όπως θα ήταν διαφορετικά." -#: library/stdtypes.rst:3719 +#: library/stdtypes.rst:3868 msgid "" "The precision determines the number of significant digits before and after " "the decimal point and defaults to 6." @@ -4772,15 +5042,15 @@ msgstr "" "Η ακρίβεια καθορίζει τον αριθμό των σημαντικών ψηφίων πριν και μετά την " "υποδιαστολή και ορίζει το 6." -#: library/stdtypes.rst:3723 +#: library/stdtypes.rst:3872 msgid "If precision is ``N``, the output is truncated to ``N`` characters." msgstr "Εάν η ακρίβεια είναι``N``, η έξοδος περικόπτεται σε ``N`` χαρακτήρες." -#: library/stdtypes.rst:3732 +#: library/stdtypes.rst:3881 msgid "See :pep:`237`." msgstr "Βλέπε :pep:`237`." -#: library/stdtypes.rst:2505 +#: library/stdtypes.rst:2654 msgid "" "Since Python strings have an explicit length, ``%s`` conversions do not " "assume that ``'\\0'`` is the end of the string." @@ -4788,7 +5058,7 @@ msgstr "" "Δεδομένου ότι οι συμβολοσειρές Python έχουν ρητό μήκος, οι ``%s`` μετατροπές " "δεν υποθέτουν ότι το ``'\\0'`` είναι το τέλος της συμβολοσειράς." -#: library/stdtypes.rst:2510 +#: library/stdtypes.rst:2659 msgid "" "``%f`` conversions for numbers whose absolute value is over 1e50 are no " "longer replaced by ``%g`` conversions." @@ -4796,7 +5066,7 @@ msgstr "" "Οι μετατροπείς ``%f`` για αριθμούς των οποίων η απόλυτη τιμή είναι " "μεγαλύτερη από 1e50 δεν αντικαθίστανται πλέον από μετατροπές ``%g``." -#: library/stdtypes.rst:2521 +#: library/stdtypes.rst:2670 msgid "" "Binary Sequence Types --- :class:`bytes`, :class:`bytearray`, :class:" "`memoryview`" @@ -4804,7 +5074,7 @@ msgstr "" "Τύποι δυαδικής ακολουθίας --- :class:`bytes`, :class:`bytearray`, :class:" "`memoryview`" -#: library/stdtypes.rst:2529 +#: library/stdtypes.rst:2678 msgid "" "The core built-in types for manipulating binary data are :class:`bytes` and :" "class:`bytearray`. They are supported by :class:`memoryview` which uses the :" @@ -4817,7 +5087,7 @@ msgstr "" "` για την πρόσβαση στη μνήμη άλλων δυαδικών αντικειμένων " "χωρίς να χρειάζεται η δημιουργία αντιγράφου." -#: library/stdtypes.rst:2534 +#: library/stdtypes.rst:2683 msgid "" "The :mod:`array` module supports efficient storage of basic data types like " "32-bit integers and IEEE754 double-precision floating values." @@ -4826,11 +5096,11 @@ msgstr "" "δεδομένων όπως 32-bit ακέραιους και IEEE754 διπλής ακρίβειας κινητής " "υποδιαστολής τιμές." -#: library/stdtypes.rst:2540 +#: library/stdtypes.rst:2689 msgid "Bytes Objects" msgstr "Αντικείμενα Bytes" -#: library/stdtypes.rst:2544 +#: library/stdtypes.rst:2693 msgid "" "Bytes objects are immutable sequences of single bytes. Since many major " "binary protocols are based on the ASCII text encoding, bytes objects offer " @@ -4843,7 +5113,7 @@ msgstr "" "ισχύουν μόνο όταν εργάζονται με δεδομένα συμβατά με ASCII και σχετίζονται " "στενά με αντικείμενα συμβολοσειρών σε μια ποικιλία διαφόρων τρόπων." -#: library/stdtypes.rst:2551 +#: library/stdtypes.rst:2700 msgid "" "Firstly, the syntax for bytes literals is largely the same as that for " "string literals, except that a ``b`` prefix is added:" @@ -4852,25 +5122,25 @@ msgstr "" "για τα literals συμβολοσειρών, με τη διαφορά ότι προστίθεται ένα πρόθεμα " "``b``::" -#: library/stdtypes.rst:2554 +#: library/stdtypes.rst:2703 msgid "Single quotes: ``b'still allows embedded \"double\" quotes'``" msgstr "" "Μονά εισαγωγικά: ``b'ακόμα επιτρέπει ενσωματωμένα \"διπλά\" εισαγωγικά'``" -#: library/stdtypes.rst:2555 +#: library/stdtypes.rst:2704 msgid "Double quotes: ``b\"still allows embedded 'single' quotes\"``" msgstr "" "Διπλά εισαγωγικά: ``b\"εξακολουθεί να επιτρέπει ενσωματωμένα 'μονά' " "εισαγωγικά\"``" -#: library/stdtypes.rst:2556 +#: library/stdtypes.rst:2705 msgid "" "Triple quoted: ``b'''3 single quotes'''``, ``b\"\"\"3 double quotes\"\"\"``" msgstr "" "Τριπλά εισαγωγικά: ``b'''3 μονά εισαγωγικά'''``, ``b\"\"\"3 διπλά " "εισαγωγικά\"\"\"``" -#: library/stdtypes.rst:2558 +#: library/stdtypes.rst:2707 msgid "" "Only ASCII characters are permitted in bytes literals (regardless of the " "declared source code encoding). Any binary values over 127 must be entered " @@ -4881,7 +5151,7 @@ msgstr "" "127, πρέπει να εισαχθούν σε bytes literals χρησιμοποιώντας την κατάλληλη " "ακολουθία διαφυγής χαρακτήρων." -#: library/stdtypes.rst:2562 +#: library/stdtypes.rst:2711 msgid "" "As with string literals, bytes literals may also use a ``r`` prefix to " "disable processing of escape sequences. See :ref:`strings` for more about " @@ -4893,7 +5163,7 @@ msgstr "" "πληροφορίες σχετικά με τις διάφορες μορφές bytes literal, " "συμπεριλαμβανομένων των υποστηριζόμενων ακολουθιών διαφυγής χαρακτήρων." -#: library/stdtypes.rst:2566 +#: library/stdtypes.rst:2715 msgid "" "While bytes literals and representations are based on ASCII text, bytes " "objects actually behave like immutable sequences of integers, with each " @@ -4916,7 +5186,7 @@ msgstr "" "εφαρμογή αλγορίθμων επεξεργασίας κειμένου σε δυαδικές μορφές δεδομένων που " "δεν είναι συμβατές με ASCII συνήθως οδηγεί σε καταστροφή δεδομένων)." -#: library/stdtypes.rst:2576 +#: library/stdtypes.rst:2725 msgid "" "In addition to the literal forms, bytes objects can be created in a number " "of other ways:" @@ -4924,25 +5194,25 @@ msgstr "" "Εκτός από τις literal μορφές, τα αντικείμενα bytes μπορούν να δημιουργηθούν " "με πολλούς άλλους τρόπους:" -#: library/stdtypes.rst:2579 +#: library/stdtypes.rst:2728 msgid "A zero-filled bytes object of a specified length: ``bytes(10)``" msgstr "Ένα μηδενικό αντικείμενο bytes με καθορισμένο μήκος: ``bytes(10)``" -#: library/stdtypes.rst:2580 +#: library/stdtypes.rst:2729 msgid "From an iterable of integers: ``bytes(range(20))``" msgstr "Από ένα iterable ακεραίων αριθμών: ``bytes(range(20))``" -#: library/stdtypes.rst:2581 +#: library/stdtypes.rst:2730 msgid "Copying existing binary data via the buffer protocol: ``bytes(obj)``" msgstr "" "Αντιγραφή υπαρχόντων δυαδικών δεδομένων μέσω του πρωτοκόλλου buffer: " "``bytes(obj)``" -#: library/stdtypes.rst:2583 +#: library/stdtypes.rst:2732 msgid "Also see the :ref:`bytes ` built-in." msgstr "Δείτε επίσης το ενσωματωμένο :ref:`bytes `." -#: library/stdtypes.rst:2585 +#: library/stdtypes.rst:2734 msgid "" "Since 2 hexadecimal digits correspond precisely to a single byte, " "hexadecimal numbers are a commonly used format for describing binary data. " @@ -4954,7 +5224,7 @@ msgstr "" "περιγραφή δυαδικών δεδομένων. Συνεπώς, ο τύπος bytes έχει μια πρόσθετη " "μέθοδο κλάσης για την ανάγνωση δεδομένων σε αυτήν την μορφή:" -#: library/stdtypes.rst:2591 +#: library/stdtypes.rst:2740 msgid "" "This :class:`bytes` class method returns a bytes object, decoding the given " "string object. The string must contain two hexadecimal digits per byte, " @@ -4965,7 +5235,7 @@ msgstr "" "πρέπει να περιέχει δύο δεκαεξαδικά ψηφία ανά byte, με το κενό διάστημα ASCII " "να αγνοείται." -#: library/stdtypes.rst:2598 +#: library/stdtypes.rst:2747 msgid "" ":meth:`bytes.fromhex` now skips all ASCII whitespace in the string, not just " "spaces." @@ -4973,7 +5243,7 @@ msgstr "" "Το :meth:`bytes.fromhex` παρακάμπτει πλέον όλα τα κενά ASCII στη " "συμβολοσειρά, όχι μόνο τα κενά." -#: library/stdtypes.rst:2602 +#: library/stdtypes.rst:2751 msgid "" "A reverse conversion function exists to transform a bytes object into its " "hexadecimal representation." @@ -4981,7 +5251,7 @@ msgstr "" "Υπάρχει μια συνάρτηση αντίστροφης μετατροπής για τη μετατροπή ενός " "αντικειμένου bytes στην δεκαεξαδική του αναπαράσταση." -#: library/stdtypes.rst:2692 +#: library/stdtypes.rst:2841 msgid "" "Return a string object containing two hexadecimal digits for each byte in " "the instance." @@ -4989,7 +5259,7 @@ msgstr "" "Επιστρέφετε ένα αντικείμενο συμβολοσειράς που περιέχει δύο δεκαεξαδικά ψηφία " "για κάθε byte στο στιγμιότυπο." -#: library/stdtypes.rst:2613 +#: library/stdtypes.rst:2762 msgid "" "If you want to make the hex string easier to read, you can specify a single " "character separator *sep* parameter to include in the output. By default, " @@ -5004,7 +5274,7 @@ msgstr "" "*bytes_per_sep* ελέγχει τα διαστήματα. Οι θετικές τιμές υπολογίζουν τη θέση " "του διαχωριστή από τα δεξιά, οι αρνητικές τιμές από τα αριστερά." -#: library/stdtypes.rst:2630 +#: library/stdtypes.rst:2779 msgid "" ":meth:`bytes.hex` now supports optional *sep* and *bytes_per_sep* parameters " "to insert separators between bytes in the hex output." @@ -5013,7 +5283,7 @@ msgstr "" "*bytes_per_sep* για την εισαγωγή διαχωριστικών μεταξύ των byte στην έξοδο " "δεκαεξαδικού." -#: library/stdtypes.rst:2634 +#: library/stdtypes.rst:2783 msgid "" "Since bytes objects are sequences of integers (akin to a tuple), for a bytes " "object *b*, ``b[0]`` will be an integer, while ``b[0:1]`` will be a bytes " @@ -5027,7 +5297,7 @@ msgstr "" "η λειτουργία πρόσβασης ως ευρετήριο όσο και η λειτουργία τμηματοποίησης θα " "παράγουν μια συμβολοσειρά μήκους 1)" -#: library/stdtypes.rst:2639 +#: library/stdtypes.rst:2788 msgid "" "The representation of bytes objects uses the literal format (``b'...'``) " "since it is often more useful than e.g. ``bytes([46, 46, 46])``. You can " @@ -5038,11 +5308,11 @@ msgstr "" "46])``. Μπορείτε πάντα να μετατρέψετε ένα αντικείμενο bytes σε μια λίστα " "ακέραιων αριθμών που χρησιμοποιούν ``list(b)``." -#: library/stdtypes.rst:2647 +#: library/stdtypes.rst:2796 msgid "Bytearray Objects" msgstr "Αντικείμενα Bytearray" -#: library/stdtypes.rst:2651 +#: library/stdtypes.rst:2800 msgid "" ":class:`bytearray` objects are a mutable counterpart to :class:`bytes` " "objects." @@ -5050,7 +5320,7 @@ msgstr "" "Τα αντικείμενα :class:`bytearray` είναι ένα μεταβλητό, αντίστοιχο, των " "αντικειμένων :class:`bytes`." -#: library/stdtypes.rst:2656 +#: library/stdtypes.rst:2805 msgid "" "There is no dedicated literal syntax for bytearray objects, instead they are " "always created by calling the constructor:" @@ -5058,26 +5328,26 @@ msgstr "" "Δεν υπάρχει αποκλειστική literal σύνταξη για αντικείμενα bytearray, αντίθετα " "δημιουργούνται πάντα καλώντας τον constructor:" -#: library/stdtypes.rst:2659 +#: library/stdtypes.rst:2808 msgid "Creating an empty instance: ``bytearray()``" msgstr "Δημιουργία ενός κενού στιγμιοτύπου: ``bytearray()``" -#: library/stdtypes.rst:2660 +#: library/stdtypes.rst:2809 msgid "Creating a zero-filled instance with a given length: ``bytearray(10)``" msgstr "Δημιουργία μηδενικού στιγμιοτύπου με δεδομένο μήκος: ``bytearray(10)``" -#: library/stdtypes.rst:2661 +#: library/stdtypes.rst:2810 msgid "From an iterable of integers: ``bytearray(range(20))``" msgstr "Από έναν iterable αριθμό ακεραίων: ``bytearray(range(20))``" -#: library/stdtypes.rst:2662 +#: library/stdtypes.rst:2811 msgid "" "Copying existing binary data via the buffer protocol: ``bytearray(b'Hi!')``" msgstr "" "Αντιγραφή υπαρχόντων δυαδικών δεδομένων μέσω του πρωτοκόλλου buffer: " "``bytearray(b'Hi!')``" -#: library/stdtypes.rst:2664 +#: library/stdtypes.rst:2813 msgid "" "As bytearray objects are mutable, they support the :ref:`mutable ` sequence operations in addition to the common bytes and bytearray " @@ -5088,11 +5358,11 @@ msgstr "" "κοινών λειτουργιών bytes και bytearray που περιγράφονται στο :ref:`bytes-" "methods`." -#: library/stdtypes.rst:2668 +#: library/stdtypes.rst:2817 msgid "Also see the :ref:`bytearray ` built-in." msgstr "Δείτε επίσης το ενσωματωμένο :ref:`bytearray `." -#: library/stdtypes.rst:2670 +#: library/stdtypes.rst:2819 msgid "" "Since 2 hexadecimal digits correspond precisely to a single byte, " "hexadecimal numbers are a commonly used format for describing binary data. " @@ -5104,7 +5374,7 @@ msgstr "" "δυαδικών δεδομένων. Συνεπώς, ο τύπος bytearray έχει μια πρόσθετη μέθοδο " "κλάσης για την ανάγνωση δεδομένων σε αυτήν την μορφή:" -#: library/stdtypes.rst:2676 +#: library/stdtypes.rst:2825 msgid "" "This :class:`bytearray` class method returns bytearray object, decoding the " "given string object. The string must contain two hexadecimal digits per " @@ -5115,7 +5385,7 @@ msgstr "" "πρέπει να περιέχει δύο δεκαεξαδικά ψηφία ανά byte, με το κενό διάστημα ASCII " "να αγνοείται." -#: library/stdtypes.rst:2683 +#: library/stdtypes.rst:2832 msgid "" ":meth:`bytearray.fromhex` now skips all ASCII whitespace in the string, not " "just spaces." @@ -5123,7 +5393,7 @@ msgstr "" "Το :meth:`bytearray.fromhex` παρακάμπτει τώρα όλα τα κενά ASCII στη " "συμβολοσειρά, όχι μόνο τα κενά." -#: library/stdtypes.rst:2687 +#: library/stdtypes.rst:2836 msgid "" "A reverse conversion function exists to transform a bytearray object into " "its hexadecimal representation." @@ -5131,7 +5401,7 @@ msgstr "" "Υπάρχει μια συνάρτηση αντίστροφης μετατροπής για να μετατρέψει ένα " "αντικείμενο bytearray στη δεκαεξαδική αναπαράσταση του." -#: library/stdtypes.rst:2700 +#: library/stdtypes.rst:2849 msgid "" "Similar to :meth:`bytes.hex`, :meth:`bytearray.hex` now supports optional " "*sep* and *bytes_per_sep* parameters to insert separators between bytes in " @@ -5141,7 +5411,7 @@ msgstr "" "προαιρετικές παραμέτρους *sep* και *bytes_per_sep* για την εισαγωγή " "διαχωριστικών μεταξύ των byte στην δεκαεξαδική έξοδο." -#: library/stdtypes.rst:2705 +#: library/stdtypes.rst:2854 msgid "" "Since bytearray objects are sequences of integers (akin to a list), for a " "bytearray object *b*, ``b[0]`` will be an integer, while ``b[0:1]`` will be " @@ -5155,7 +5425,7 @@ msgstr "" "κειμένου, όπου τόσο το indexing και το slicing θα παράγουν μια συμβολοσειρά " "μήκους 1)" -#: library/stdtypes.rst:2710 +#: library/stdtypes.rst:2859 msgid "" "The representation of bytearray objects uses the bytes literal format " "(``bytearray(b'...')``) since it is often more useful than e.g. " @@ -5167,11 +5437,11 @@ msgstr "" "``bytearray([46, 46, 46])``. Μπορείτε πάντα να μετατρέψετε ένα αντικείμενο " "bytearray σε λίστα ακεραίων χρησιμοποιώντας το ``list(b)``." -#: library/stdtypes.rst:2719 +#: library/stdtypes.rst:2868 msgid "Bytes and Bytearray Operations" msgstr "Λειτουργίες Bytes και Bytearray" -#: library/stdtypes.rst:2724 +#: library/stdtypes.rst:2873 msgid "" "Both bytes and bytearray objects support the :ref:`common ` " "sequence operations. They interoperate not just with operands of the same " @@ -5186,7 +5456,7 @@ msgstr "" "ελεύθερα σε λειτουργίες χωρίς να προκαλούνται σφάλματα. Ωστόσο, ο τύπος " "επιστροφής του αποτελέσματος μπορεί να εξαρτάται από τη σειρά των τελεστών." -#: library/stdtypes.rst:2732 +#: library/stdtypes.rst:2881 msgid "" "The methods on bytes and bytearray objects don't accept strings as their " "arguments, just as the methods on strings don't accept bytes as their " @@ -5196,7 +5466,7 @@ msgstr "" "ως ορίσματά τους, όπως και οι μέθοδοι σε συμβολοσειρές δεν δέχονται bytes ως " "ορίσματα. Για παράδειγμα, πρέπει να γράψετε::" -#: library/stdtypes.rst:2736 +#: library/stdtypes.rst:2885 msgid "" "a = \"abc\"\n" "b = a.replace(\"a\", \"f\")" @@ -5204,11 +5474,11 @@ msgstr "" "a = \"abc\"\n" "b = a.replace(\"a\", \"f\")" -#: library/stdtypes.rst:2739 +#: library/stdtypes.rst:2888 msgid "and::" msgstr "και::" -#: library/stdtypes.rst:2741 +#: library/stdtypes.rst:2890 msgid "" "a = b\"abc\"\n" "b = a.replace(b\"a\", b\"f\")" @@ -5216,7 +5486,7 @@ msgstr "" "a = b\"abc\"\n" "b = a.replace(b\"a\", b\"f\")" -#: library/stdtypes.rst:2744 +#: library/stdtypes.rst:2893 msgid "" "Some bytes and bytearray operations assume the use of ASCII compatible " "binary formats, and hence should be avoided when working with arbitrary " @@ -5227,7 +5497,7 @@ msgstr "" "εργάζεστε με αυθαίρετα δυαδικά δεδομένα. Αυτοί οι περιορισμοί καλύπτονται " "παρακάτω." -#: library/stdtypes.rst:2749 +#: library/stdtypes.rst:2898 msgid "" "Using these ASCII based operations to manipulate binary data that is not " "stored in an ASCII based format may lead to data corruption." @@ -5236,7 +5506,7 @@ msgstr "" "δεδομένων που δεν είναι αποθηκευμένα σε μορφή που βασίζεται σε ASCII μπορεί " "να οδηγήσει σε καταστροφή δεδομένων." -#: library/stdtypes.rst:2752 +#: library/stdtypes.rst:2901 msgid "" "The following methods on bytes and bytearray objects can be used with " "arbitrary binary data." @@ -5244,7 +5514,7 @@ msgstr "" "Οι ακόλουθες μέθοδοι σε byte και αντικείμενα bytearray μπορούν να " "χρησιμοποιηθούν με αυθαίρετα δυαδικά δεδομένα." -#: library/stdtypes.rst:2758 +#: library/stdtypes.rst:2907 msgid "" "Return the number of non-overlapping occurrences of subsequence *sub* in the " "range [*start*, *end*]. Optional arguments *start* and *end* are " @@ -5254,8 +5524,8 @@ msgstr "" "ακολουθίας *sub* στο εύρος [*start*, *end*]. Τα προαιρετικά ορίσματα *start* " "και *end* ερμηνεύονται όπως στη σημειογραφία τμηματοποίησης." -#: library/stdtypes.rst:2867 library/stdtypes.rst:2955 -#: library/stdtypes.rst:2968 +#: library/stdtypes.rst:3016 library/stdtypes.rst:3104 +#: library/stdtypes.rst:3117 msgid "" "The subsequence to search for may be any :term:`bytes-like object` or an " "integer in the range 0 to 255." @@ -5263,7 +5533,7 @@ msgstr "" "Η υποακολουθία για αναζήτηση μπορεί να είναι οποιοδήποτε :term:`bytes-like " "object` ή ένας ακέραιος αριθμός στην περιοχή από 0 έως 255." -#: library/stdtypes.rst:2765 +#: library/stdtypes.rst:2914 msgid "" "If *sub* is empty, returns the number of empty slices between characters " "which is the length of the bytes object plus one." @@ -5271,13 +5541,13 @@ msgstr "" "Εάν το *sub* είναι κενό, επιστρέφει τον αριθμό των κενών τμημάτων μεταξύ των " "χαρακτήρων που είναι το μήκος του αντικειμένου bytes συν ένα." -#: library/stdtypes.rst:2879 library/stdtypes.rst:2958 -#: library/stdtypes.rst:2971 +#: library/stdtypes.rst:3028 library/stdtypes.rst:3107 +#: library/stdtypes.rst:3120 msgid "Also accept an integer in the range 0 to 255 as the subsequence." msgstr "" "Επίσης αποδέχεται έναν ακέραιο αριθμό στο εύρος 0 έως 255 ως υποακολουθία." -#: library/stdtypes.rst:2775 +#: library/stdtypes.rst:2924 msgid "" "If the binary data starts with the *prefix* string, return " "``bytes[len(prefix):]``. Otherwise, return a copy of the original binary " @@ -5287,7 +5557,7 @@ msgstr "" "``bytes[len(prefix):]``. Διαφορετικά επιστρέψτε ένα αντίγραφο των αρχικών " "δυαδικών δεδομένων::" -#: library/stdtypes.rst:2779 +#: library/stdtypes.rst:2928 msgid "" ">>> b'TestHook'.removeprefix(b'Test')\n" "b'Hook'\n" @@ -5299,15 +5569,15 @@ msgstr "" ">>> b'BaseTestCase'.removeprefix(b'Test')\n" "b'BaseTestCase'" -#: library/stdtypes.rst:2784 +#: library/stdtypes.rst:2933 msgid "The *prefix* may be any :term:`bytes-like object`." msgstr "Το *prefix* μπορεί να είναι οποιοδήποτε :term:`bytes-like object`." -#: library/stdtypes.rst:2810 library/stdtypes.rst:3036 -#: library/stdtypes.rst:3081 library/stdtypes.rst:3137 -#: library/stdtypes.rst:3226 library/stdtypes.rst:3393 -#: library/stdtypes.rst:3491 library/stdtypes.rst:3534 -#: library/stdtypes.rst:3736 +#: library/stdtypes.rst:2959 library/stdtypes.rst:3185 +#: library/stdtypes.rst:3230 library/stdtypes.rst:3286 +#: library/stdtypes.rst:3375 library/stdtypes.rst:3542 +#: library/stdtypes.rst:3640 library/stdtypes.rst:3683 +#: library/stdtypes.rst:3885 msgid "" "The bytearray version of this method does *not* operate in place - it always " "produces a new object, even if no changes were made." @@ -5315,7 +5585,7 @@ msgstr "" "Η έκδοση bytearray αυτής της μεθόδου *δεν* λειτουργεί στη θέση της - παράγει " "πάντα ένα νέο αντικείμενο, ακόμα και αν δεν έγιναν αλλαγές." -#: library/stdtypes.rst:2797 +#: library/stdtypes.rst:2946 msgid "" "If the binary data ends with the *suffix* string and that *suffix* is not " "empty, return ``bytes[:-len(suffix)]``. Otherwise, return a copy of the " @@ -5325,7 +5595,7 @@ msgstr "" "*suffix* δεν είναι κενό, επιστρέφει ``bytes[:-len(suffix)]``. Διαφορετικά, " "επιστρέφει ένα αντίγραφο των αρχικών δυαδικών δεδομένων::" -#: library/stdtypes.rst:2801 +#: library/stdtypes.rst:2950 msgid "" ">>> b'MiscTests'.removesuffix(b'Tests')\n" "b'Misc'\n" @@ -5337,15 +5607,15 @@ msgstr "" ">>> b'TmpDirMixin'.removesuffix(b'Tests')\n" "b'TmpDirMixin'" -#: library/stdtypes.rst:2806 +#: library/stdtypes.rst:2955 msgid "The *suffix* may be any :term:`bytes-like object`." msgstr "Το *suffix* μπορεί να είναι οποιοδήποτε :term:`bytes-like object`." -#: library/stdtypes.rst:2819 +#: library/stdtypes.rst:2968 msgid "Return the bytes decoded to a :class:`str`." msgstr "Επιστρέφει τα bytes που έχουν αποκωδικοποιηθεί σε μια :class:`str`." -#: library/stdtypes.rst:2824 +#: library/stdtypes.rst:2973 msgid "" "*errors* controls how decoding errors are handled. If ``'strict'`` (the " "default), a :exc:`UnicodeError` exception is raised. Other possible values " @@ -5358,7 +5628,7 @@ msgstr "" "άλλο όνομα που έχει καταχωρηθεί από την :func:`codecs.register_error`. " "Βλέπε :ref:`error-handlers` για λεπτομέρειες." -#: library/stdtypes.rst:2830 +#: library/stdtypes.rst:2979 msgid "" "For performance reasons, the value of *errors* is not checked for validity " "unless a decoding error actually occurs, :ref:`devmode` is enabled or a :ref:" @@ -5369,7 +5639,7 @@ msgstr "" "ενεργοποιημένο το :ref:`devmode` ή χρησιμοποιείται ένα :ref:`debug build " "`." -#: library/stdtypes.rst:2836 +#: library/stdtypes.rst:2985 msgid "" "Passing the *encoding* argument to :class:`str` allows decoding any :term:" "`bytes-like object` directly, without needing to make a temporary :class:`!" @@ -5380,7 +5650,7 @@ msgstr "" "χρειάζεται να δημιουργήσετε ένα προσωρινό αντικείμενο :class:`!bytes` ή :" "class:`!bytearray`." -#: library/stdtypes.rst:2851 +#: library/stdtypes.rst:3000 msgid "" "Return ``True`` if the binary data ends with the specified *suffix*, " "otherwise return ``False``. *suffix* can also be a tuple of suffixes to " @@ -5393,13 +5663,13 @@ msgstr "" "προαιρετικό *start*, η δοκιμή ξεκινά από αυτή τη θέση. Με το προαιρετικό " "*end*, σταματήστε να συγκρίνετε σε αυτή τη θέση." -#: library/stdtypes.rst:2856 +#: library/stdtypes.rst:3005 msgid "The suffix(es) to search for may be any :term:`bytes-like object`." msgstr "" "Το(α) επίθεμα(τα) για αναζήτηση μπορεί να είναι οποιοδήποτε :term:`bytes-" "like object`." -#: library/stdtypes.rst:2862 +#: library/stdtypes.rst:3011 msgid "" "Return the lowest index in the data where the subsequence *sub* is found, " "such that *sub* is contained in the slice ``s[start:end]``. Optional " @@ -5411,7 +5681,7 @@ msgstr "" "προαιρετικά ορίσματα *start* και *end* ερμηνεύονται ως συμβολισμό " "τμηματοποίησης. Επιστρέφει ``-1`` εάν το *sub* δεν βρεθεί." -#: library/stdtypes.rst:2872 +#: library/stdtypes.rst:3021 msgid "" "The :meth:`~bytes.find` method should be used only if you need to know the " "position of *sub*. To check if *sub* is a substring or not, use the :" @@ -5421,7 +5691,7 @@ msgstr "" "χρειάζεται να γνωρίζετε τη θέση του *sub*. Για να ελέγξετε εάν το *sub* " "είναι υποσυμβολοσειρά ή όχι, χρησιμοποιήστε τον τελεστή :keyword:`in`::" -#: library/stdtypes.rst:2876 +#: library/stdtypes.rst:3025 msgid "" ">>> b'Py' in b'Python'\n" "True" @@ -5429,7 +5699,7 @@ msgstr "" ">>> b'Py' in b'Python'\n" "True" -#: library/stdtypes.rst:2886 +#: library/stdtypes.rst:3035 msgid "" "Like :meth:`~bytes.find`, but raise :exc:`ValueError` when the subsequence " "is not found." @@ -5437,7 +5707,7 @@ msgstr "" "Όπως η :meth:`~bytes.find`, αλλά κάνει raise μια :exc:`ValueError` όταν δεν " "βρεθεί η δευτερεύουσα ακολουθία." -#: library/stdtypes.rst:2899 +#: library/stdtypes.rst:3048 msgid "" "Return a bytes or bytearray object which is the concatenation of the binary " "data sequences in *iterable*. A :exc:`TypeError` will be raised if there " @@ -5453,7 +5723,7 @@ msgstr "" "`str`. Το διαχωριστικό μεταξύ των στοιχειών είναι τα περιεχόμενα των byte ή " "του αντικειμένου bytearray που παρέχει αυτή τη μέθοδο." -#: library/stdtypes.rst:2910 +#: library/stdtypes.rst:3059 msgid "" "This static method returns a translation table usable for :meth:`bytes." "translate` that will map each character in *from* into the character at the " @@ -5466,7 +5736,7 @@ msgstr "" "*to* πρέπει να είναι και τα δύο :term:`bytes-like objects ` και να έχουν το ίδιο μήκος." -#: library/stdtypes.rst:2921 +#: library/stdtypes.rst:3070 msgid "" "Split the sequence at the first occurrence of *sep*, and return a 3-tuple " "containing the part before the separator, the separator itself or its " @@ -5480,13 +5750,13 @@ msgstr "" "διαχωριστικό, επιστρέφει μια 3-πλειάδα που περιέχει ένα αντίγραφο της " "αρχικής ακολουθίας, ακολουθούμενη από δύο κενά byte ή αντικείμενα bytearray." -#: library/stdtypes.rst:2985 +#: library/stdtypes.rst:3134 msgid "The separator to search for may be any :term:`bytes-like object`." msgstr "" "Το διαχωριστικό για αναζήτηση μπορεί να είναι οποιοδήποτε :term:`bytes-like " "object`." -#: library/stdtypes.rst:2934 +#: library/stdtypes.rst:3083 msgid "" "Return a copy of the sequence with all occurrences of subsequence *old* " "replaced by *new*. If the optional argument *count* is given, only the " @@ -5497,7 +5767,7 @@ msgstr "" "προαιρετικό όρισμα *count*, αντικαθίστανται μόνο οι πρώτες εμφανίσεις " "*count*." -#: library/stdtypes.rst:2938 +#: library/stdtypes.rst:3087 msgid "" "The subsequence to search for and its replacement may be any :term:`bytes-" "like object`." @@ -5505,7 +5775,7 @@ msgstr "" "Η ακολουθία για αναζήτηση και αντικατάσταση της μπορεί να είναι οποιοδήποτε :" "term:`bytes-like object`." -#: library/stdtypes.rst:2950 +#: library/stdtypes.rst:3099 msgid "" "Return the highest index in the sequence where the subsequence *sub* is " "found, such that *sub* is contained within ``s[start:end]``. Optional " @@ -5517,7 +5787,7 @@ msgstr "" "προαιρετικά ορίσματα *start* και *end* ερμηνεύονται με συμβολισμό " "τμηματοποίησης. Επιστρέφει ``-1`` σε περίπτωση αποτυχίας." -#: library/stdtypes.rst:2965 +#: library/stdtypes.rst:3114 msgid "" "Like :meth:`~bytes.rfind` but raises :exc:`ValueError` when the subsequence " "*sub* is not found." @@ -5525,7 +5795,7 @@ msgstr "" "Όπως η :meth:`~bytes.rfind` αλλά κάνει raise μια :exc:`ValueError` όταν δεν " "βρεθεί η υποακολουθία *sub*." -#: library/stdtypes.rst:2978 +#: library/stdtypes.rst:3127 msgid "" "Split the sequence at the last occurrence of *sep*, and return a 3-tuple " "containing the part before the separator, the separator itself or its " @@ -5540,7 +5810,7 @@ msgstr "" "κενά byte ή αντικείμενα bytearray, ακολουθούμενα από ένα αντίγραφο της " "αρχικής ακολουθίας." -#: library/stdtypes.rst:2991 +#: library/stdtypes.rst:3140 msgid "" "Return ``True`` if the binary data starts with the specified *prefix*, " "otherwise return ``False``. *prefix* can also be a tuple of prefixes to " @@ -5553,13 +5823,13 @@ msgstr "" "η δοκιμή ξεκινά από αυτή τη θέση. Με το προαιρετικό *end*, σταματάει να " "συγκρίνει σε αυτή τη θέση." -#: library/stdtypes.rst:2996 +#: library/stdtypes.rst:3145 msgid "The prefix(es) to search for may be any :term:`bytes-like object`." msgstr "" "Το(α) πρόθεμα(τα) για αναζήτηση μπορεί να είναι οποιοδήποτε :term:`bytes-" "like object`." -#: library/stdtypes.rst:3002 +#: library/stdtypes.rst:3151 msgid "" "Return a copy of the bytes or bytearray object where all bytes occurring in " "the optional argument *delete* are removed, and the remaining bytes have " @@ -5571,14 +5841,14 @@ msgstr "" "τα υπόλοιπα byte έχουν αντιστοιχιστεί μέσω του δεδομένου πίνακα μετάφρασης, " "ο οποίος πρέπει να είναι ένα αντικείμενο bytes μήκους 256." -#: library/stdtypes.rst:3007 +#: library/stdtypes.rst:3156 msgid "" "You can use the :func:`bytes.maketrans` method to create a translation table." msgstr "" "Μπορείτε να χρησιμοποιήσετε τη μέθοδο :func:`bytes.maketrans` για να " "δημιουργήσετε έναν πίνακα μετάφρασης." -#: library/stdtypes.rst:3010 +#: library/stdtypes.rst:3159 msgid "" "Set the *table* argument to ``None`` for translations that only delete " "characters::" @@ -5586,7 +5856,7 @@ msgstr "" "Ορίζει το όρισμα *table* σε ``None`` για μεταφράσεις που διαγράφουν μόνο " "χαρακτήρες::" -#: library/stdtypes.rst:3013 +#: library/stdtypes.rst:3162 msgid "" ">>> b'read this short text'.translate(None, b'aeiou')\n" "b'rd ths shrt txt'" @@ -5594,11 +5864,11 @@ msgstr "" ">>> b'read this short text'.translate(None, b'aeiou')\n" "b'rd ths shrt txt'" -#: library/stdtypes.rst:3016 +#: library/stdtypes.rst:3165 msgid "*delete* is now supported as a keyword argument." msgstr "Το *delete* υποστηρίζεται πλέον ως όρισμα λέξης-κλειδιού." -#: library/stdtypes.rst:3020 +#: library/stdtypes.rst:3169 msgid "" "The following methods on bytes and bytearray objects have default behaviours " "that assume the use of ASCII compatible binary formats, but can still be " @@ -5612,7 +5882,7 @@ msgstr "" "κατάλληλα ορίσματα. Σημειώστε ότι όλες οι μέθοδοι bytearray σε αυτήν την " "ενότητα *δεν* λειτουργούν στη θέση τους και όμως παράγουν νέα αντικείμενα." -#: library/stdtypes.rst:3029 +#: library/stdtypes.rst:3178 msgid "" "Return a copy of the object centered in a sequence of length *width*. " "Padding is done using the specified *fillbyte* (default is an ASCII space). " @@ -5625,7 +5895,7 @@ msgstr "" "`bytes, η αρχική ακολουθία επιστρέφεται εάν το *width* είναι μικρότερο ή ίσο " "με ``len(s)``." -#: library/stdtypes.rst:3043 +#: library/stdtypes.rst:3192 msgid "" "Return a copy of the object left justified in a sequence of length *width*. " "Padding is done using the specified *fillbyte* (default is an ASCII space). " @@ -5638,7 +5908,7 @@ msgstr "" "αντικείμενα :class:`bytes, η αρχική ακολουθία επιστρέφεται εάν το *width* " "είναι μικρότερο ή ίσο με ``len(s)``." -#: library/stdtypes.rst:3057 +#: library/stdtypes.rst:3206 msgid "" "Return a copy of the sequence with specified leading bytes removed. The " "*chars* argument is a binary sequence specifying the set of byte values to " @@ -5655,7 +5925,7 @@ msgstr "" "αφαίρεση του κενού διαστήματος ASCII. Το όρισμα *chars* δεν είναι " "πρόθεμα, αλλά οι συνδυασμοί των τιμών του αφαιρούνται:" -#: library/stdtypes.rst:3064 +#: library/stdtypes.rst:3213 msgid "" ">>> b' spacious '.lstrip()\n" "b'spacious '\n" @@ -5667,7 +5937,7 @@ msgstr "" ">>> b'www.example.com'.lstrip(b'cmowz.')\n" "b'example.com'" -#: library/stdtypes.rst:3069 +#: library/stdtypes.rst:3218 msgid "" "The binary sequence of byte values to remove may be any :term:`bytes-like " "object`. See :meth:`~bytes.removeprefix` for a method that will remove a " @@ -5678,7 +5948,7 @@ msgstr "" "που θα αφαιρέσει μια μεμονωμένη συμβολοσειρά προθέματος αντί όλο το σύνολο " "χαρακτήρων. Για παράδειγμα::" -#: library/stdtypes.rst:3074 +#: library/stdtypes.rst:3223 msgid "" ">>> b'Arthur: three!'.lstrip(b'Arthur: ')\n" "b'ee!'\n" @@ -5690,7 +5960,7 @@ msgstr "" ">>> b'Arthur: three!'.removeprefix(b'Arthur: ')\n" "b'three!'" -#: library/stdtypes.rst:3088 +#: library/stdtypes.rst:3237 msgid "" "Return a copy of the object right justified in a sequence of length *width*. " "Padding is done using the specified *fillbyte* (default is an ASCII space). " @@ -5703,7 +5973,7 @@ msgstr "" "είναι ένα διάστημα ASCII). Για αντικείμενα :class:`bytes`, η αρχική " "ακολουθία επιστρέφεται εάν το *width* είναι μικρότερο ή ίσο με ``len(s)``." -#: library/stdtypes.rst:3102 +#: library/stdtypes.rst:3251 msgid "" "Split the binary sequence into subsequences of the same type, using *sep* as " "the delimiter string. If *maxsplit* is given, at most *maxsplit* splits are " @@ -5720,7 +5990,7 @@ msgstr "" "διαχωρισμό από τα δεξιά, η :meth:`rsplit` συμπεριφέρεται όπως :meth:`split` " "που περιγράφεται λεπτομερώς παρακάτω." -#: library/stdtypes.rst:3113 +#: library/stdtypes.rst:3262 msgid "" "Return a copy of the sequence with specified trailing bytes removed. The " "*chars* argument is a binary sequence specifying the set of byte values to " @@ -5737,7 +6007,7 @@ msgstr "" "ως προεπιλογή την αφαίρεση του κενού διαστήματος ASCII. Το όρισμα *chars* " "δεν είναι επίθημα, αλλά αφαιρούνται όλοι οι συνδυασμοί των τιμών του::" -#: library/stdtypes.rst:3120 +#: library/stdtypes.rst:3269 msgid "" ">>> b' spacious '.rstrip()\n" "b' spacious'\n" @@ -5749,7 +6019,7 @@ msgstr "" ">>> b'mississippi'.rstrip(b'ipz')\n" "b'mississ'" -#: library/stdtypes.rst:3125 +#: library/stdtypes.rst:3274 msgid "" "The binary sequence of byte values to remove may be any :term:`bytes-like " "object`. See :meth:`~bytes.removesuffix` for a method that will remove a " @@ -5760,7 +6030,7 @@ msgstr "" "μέθοδο που θα αφαιρέσει μια συμβολοσειρά επιθέματος και όχι όλο το σύνολο " "χαρακτήρων. Για παράδειγμα:" -#: library/stdtypes.rst:3130 +#: library/stdtypes.rst:3279 msgid "" ">>> b'Monty Python'.rstrip(b' Python')\n" "b'M'\n" @@ -5772,7 +6042,7 @@ msgstr "" ">>> b'Monty Python'.removesuffix(b' Python')\n" "b'Monty'" -#: library/stdtypes.rst:3144 +#: library/stdtypes.rst:3293 msgid "" "Split the binary sequence into subsequences of the same type, using *sep* as " "the delimiter string. If *maxsplit* is given and non-negative, at most " @@ -5787,7 +6057,7 @@ msgstr "" "ή είναι ``-1``, τότε δεν υπάρχει όριο στον αριθμό των διαχωρισμών (όλες οι " "πιθανές διασπάσεις γίνονται)." -#: library/stdtypes.rst:3150 +#: library/stdtypes.rst:3299 msgid "" "If *sep* is given, consecutive delimiters are not grouped together and are " "deemed to delimit empty subsequences (for example, ``b'1,,2'.split(b',')`` " @@ -5805,7 +6075,7 @@ msgstr "" "το ``[bytearray(b'')]`` ανάλογα με τον τύπο του αντικειμένου που χωρίζεται. " "Το όρισμα *sep* μπορεί να είναι οποιοδήποτε :term:`bytes-like object`." -#: library/stdtypes.rst:3160 +#: library/stdtypes.rst:3309 msgid "" ">>> b'1,2,3'.split(b',')\n" "[b'1', b'2', b'3']\n" @@ -5825,7 +6095,7 @@ msgstr "" ">>> b'1<>2<>3<4'.split(b'<>')\n" "[b'1', b'2', b'3<4']" -#: library/stdtypes.rst:3169 +#: library/stdtypes.rst:3318 msgid "" "If *sep* is not specified or is ``None``, a different splitting algorithm is " "applied: runs of consecutive ASCII whitespace are regarded as a single " @@ -5842,7 +6112,7 @@ msgstr "" "ακολουθίας ή μιας ακολουθίας που αποτελείται αποκλειστικά από κενό διάστημα " "ASCII χωρίς καθορισμένο διαχωριστικό επιστρέφει το ``[]``." -#: library/stdtypes.rst:3179 +#: library/stdtypes.rst:3328 msgid "" ">>> b'1 2 3'.split()\n" "[b'1', b'2', b'3']\n" @@ -5858,7 +6128,7 @@ msgstr "" ">>> b' 1 2 3 '.split()\n" "[b'1', b'2', b'3']" -#: library/stdtypes.rst:3190 +#: library/stdtypes.rst:3339 msgid "" "Return a copy of the sequence with specified leading and trailing bytes " "removed. The *chars* argument is a binary sequence specifying the set of " @@ -5875,7 +6145,7 @@ msgstr "" "από προεπιλογή αφαιρεί το ASCII λευκό διάστημα. To όρισμα *chars* δεν είναι " "πρόθεμα ή επίθημα, αλλά αφαιρούνται όλοι οι συνδυασμοί των τιμών του:" -#: library/stdtypes.rst:3198 +#: library/stdtypes.rst:3347 msgid "" ">>> b' spacious '.strip()\n" "b'spacious'\n" @@ -5887,7 +6157,7 @@ msgstr "" ">>> b'www.example.com'.strip(b'cmowz.')\n" "b'example'" -#: library/stdtypes.rst:3203 +#: library/stdtypes.rst:3352 msgid "" "The binary sequence of byte values to remove may be any :term:`bytes-like " "object`." @@ -5895,7 +6165,7 @@ msgstr "" "Η δυαδική ακολουθία τιμών byte προς αφαίρεση μπορεί να είναι οποιοδήποτε :" "term:`bytes-like object`." -#: library/stdtypes.rst:3212 +#: library/stdtypes.rst:3361 msgid "" "The following methods on bytes and bytearray objects assume the use of ASCII " "compatible binary formats and should not be applied to arbitrary binary " @@ -5908,7 +6178,7 @@ msgstr "" "την ενότητα *δεν* λειτουργούν στη θέση τους και αντ' αυτού παράγουν νέα " "αντικείμενα." -#: library/stdtypes.rst:3220 +#: library/stdtypes.rst:3369 msgid "" "Return a copy of the sequence with each byte interpreted as an ASCII " "character, and the first byte capitalized and the rest lowercased. Non-ASCII " @@ -5918,7 +6188,7 @@ msgstr "" "χαρακτήρας ASCII, και το πρώτο byte γραμμένο με κεφαλαία και το υπόλοιπο με " "πεζά. Οι τιμές των byte που δεν είναι ASCII μεταβιβάζονται αμετάβλητες." -#: library/stdtypes.rst:3233 +#: library/stdtypes.rst:3382 msgid "" "Return a copy of the sequence where all ASCII tab characters are replaced by " "one or more ASCII spaces, depending on the current column and the given tab " @@ -5947,7 +6217,7 @@ msgstr "" "αντιγράφεται αμετάβλητη και η τρέχουσα στήλη προσαυξάνεται κατά ένα, " "ανεξάρτητα από το πώς αναπαρίσταται η τιμή byte όταν εκτυπώνεται::" -#: library/stdtypes.rst:3247 +#: library/stdtypes.rst:3396 msgid "" ">>> b'01\\t012\\t0123\\t01234'.expandtabs()\n" "b'01 012 0123 01234'\n" @@ -5959,7 +6229,7 @@ msgstr "" ">>> b'01\\t012\\t0123\\t01234'.expandtabs(4)\n" "b'01 012 0123 01234'" -#: library/stdtypes.rst:3261 +#: library/stdtypes.rst:3410 msgid "" "Return ``True`` if all bytes in the sequence are alphabetical ASCII " "characters or ASCII decimal digits and the sequence is not empty, ``False`` " @@ -5974,7 +6244,7 @@ msgstr "" "``b'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'``. Τα δεκαδικά " "ψηφία ASCII είναι αυτές οι τιμές byte στην ακολουθία ``b'0123456789'``." -#: library/stdtypes.rst:3269 +#: library/stdtypes.rst:3418 msgid "" ">>> b'ABCabc1'.isalnum()\n" "True\n" @@ -5986,7 +6256,7 @@ msgstr "" ">>> b'ABC abc1'.isalnum()\n" "False" -#: library/stdtypes.rst:3278 +#: library/stdtypes.rst:3427 msgid "" "Return ``True`` if all bytes in the sequence are alphabetic ASCII characters " "and the sequence is not empty, ``False`` otherwise. Alphabetic ASCII " @@ -5998,7 +6268,7 @@ msgstr "" "αλφαβητικοί χαρακτήρες ASCII είναι εκείνες οι τιμές bytes στην ακολουθία " "``b'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'``." -#: library/stdtypes.rst:3285 +#: library/stdtypes.rst:3434 msgid "" ">>> b'ABCabc'.isalpha()\n" "True\n" @@ -6010,7 +6280,7 @@ msgstr "" ">>> b'ABCabc1'.isalpha()\n" "False" -#: library/stdtypes.rst:3294 +#: library/stdtypes.rst:3443 msgid "" "Return ``True`` if the sequence is empty or all bytes in the sequence are " "ASCII, ``False`` otherwise. ASCII bytes are in the range 0-0x7F." @@ -6019,7 +6289,7 @@ msgstr "" "είναι ASCII, ``False`` διαφορετικά. Τα bytes ASCII βρίσκονται στο εύρος " "0-0x7F." -#: library/stdtypes.rst:3304 +#: library/stdtypes.rst:3453 msgid "" "Return ``True`` if all bytes in the sequence are ASCII decimal digits and " "the sequence is not empty, ``False`` otherwise. ASCII decimal digits are " @@ -6029,7 +6299,7 @@ msgstr "" "ASCII και η ακολουθία δεν είναι κενή, ``False`` διαφορετικά. Τα δεκαδικά " "ψηφία ASCII είναι αυτές οι τιμές byte στην ακολουθία ``b'0123456789'``." -#: library/stdtypes.rst:3310 +#: library/stdtypes.rst:3459 msgid "" ">>> b'1234'.isdigit()\n" "True\n" @@ -6041,7 +6311,7 @@ msgstr "" ">>> b'1.23'.isdigit()\n" "False" -#: library/stdtypes.rst:3319 +#: library/stdtypes.rst:3468 msgid "" "Return ``True`` if there is at least one lowercase ASCII character in the " "sequence and no uppercase ASCII characters, ``False`` otherwise." @@ -6049,7 +6319,7 @@ msgstr "" "Επιστρέφει ``True`` εάν υπάρχει τουλάχιστον ένας πεζός χαρακτήρας ASCII στην " "ακολουθία και κανένας κεφαλαίος χαρακτήρας ASCII, ``False`` διαφορετικά." -#: library/stdtypes.rst:3324 +#: library/stdtypes.rst:3473 msgid "" ">>> b'hello world'.islower()\n" "True\n" @@ -6061,8 +6331,8 @@ msgstr "" ">>> b'Hello world'.islower()\n" "False" -#: library/stdtypes.rst:3371 library/stdtypes.rst:3437 -#: library/stdtypes.rst:3506 +#: library/stdtypes.rst:3520 library/stdtypes.rst:3586 +#: library/stdtypes.rst:3655 msgid "" "Lowercase ASCII characters are those byte values in the sequence " "``b'abcdefghijklmnopqrstuvwxyz'``. Uppercase ASCII characters are those byte " @@ -6072,7 +6342,7 @@ msgstr "" "``b'abcdefghijklmnopqrstuvwxyz'``. Οι κεφαλαίοι χαρακτήρες ASCII είναι αυτές " "οι τιμές byte στην ακολουθία ``b'ABCDEFGHIJKLMNOPQRSTUVWXYZ'``." -#: library/stdtypes.rst:3337 +#: library/stdtypes.rst:3486 msgid "" "Return ``True`` if all bytes in the sequence are ASCII whitespace and the " "sequence is not empty, ``False`` otherwise. ASCII whitespace characters are " @@ -6085,7 +6355,7 @@ msgstr "" "\\t\\n\\r\\x0b\\f'`` (κενό, tab, νέα γραμμή, επιστροφή μεταφοράς, κάθετο " "tab, μορφή ροής)." -#: library/stdtypes.rst:3346 +#: library/stdtypes.rst:3495 msgid "" "Return ``True`` if the sequence is ASCII titlecase and the sequence is not " "empty, ``False`` otherwise. See :meth:`bytes.title` for more details on the " @@ -6096,7 +6366,7 @@ msgstr "" "``False`` διαφορετικά. Δείτε :meth:`bytes.title` για περισσότερες " "λεπτομέρειες σχετικά με τον ορισμό του \"titlecase\"." -#: library/stdtypes.rst:3352 +#: library/stdtypes.rst:3501 msgid "" ">>> b'Hello World'.istitle()\n" "True\n" @@ -6108,7 +6378,7 @@ msgstr "" ">>> b'Hello world'.istitle()\n" "False" -#: library/stdtypes.rst:3361 +#: library/stdtypes.rst:3510 msgid "" "Return ``True`` if there is at least one uppercase alphabetic ASCII " "character in the sequence and no lowercase ASCII characters, ``False`` " @@ -6118,7 +6388,7 @@ msgstr "" "χαρακτήρας ASCII στην ακολουθία και κανένας πεζός χαρακτήρας ASCII, " "διαφορετικά ``False``." -#: library/stdtypes.rst:3366 +#: library/stdtypes.rst:3515 msgid "" ">>> b'HELLO WORLD'.isupper()\n" "True\n" @@ -6130,7 +6400,7 @@ msgstr "" ">>> b'Hello world'.isupper()\n" "False" -#: library/stdtypes.rst:3379 +#: library/stdtypes.rst:3528 msgid "" "Return a copy of the sequence with all the uppercase ASCII characters " "converted to their corresponding lowercase counterpart." @@ -6138,7 +6408,7 @@ msgstr "" "Επιστρέφει ένα αντίγραφο της ακολουθίας με όλους τους κεφαλαίους χαρακτήρες " "ASCII να έχουν μετατραπεί στα ισοδύναμα πεζά." -#: library/stdtypes.rst:3384 +#: library/stdtypes.rst:3533 msgid "" ">>> b'Hello World'.lower()\n" "b'hello world'" @@ -6146,7 +6416,7 @@ msgstr "" ">>> b'Hello World'.lower()\n" "b'hello world'" -#: library/stdtypes.rst:3404 +#: library/stdtypes.rst:3553 msgid "" "Return a list of the lines in the binary sequence, breaking at ASCII line " "boundaries. This method uses the :term:`universal newlines` approach to " @@ -6159,7 +6429,7 @@ msgstr "" "περιλαμβάνονται στη λίστα που προκύπτει εκτός εάν δοθεί *keepends* και είναι " "αληθής." -#: library/stdtypes.rst:3411 +#: library/stdtypes.rst:3560 msgid "" ">>> b'ab c\\n\\nde fg\\rkl\\r\\n'.splitlines()\n" "[b'ab c', b'', b'de fg', b'kl']\n" @@ -6171,7 +6441,7 @@ msgstr "" ">>> b'ab c\\n\\nde fg\\rkl\\r\\n'.splitlines(keepends=True)\n" "[b'ab c\\n', b'\\n', b'de fg\\r', b'kl\\r\\n']" -#: library/stdtypes.rst:3416 +#: library/stdtypes.rst:3565 msgid "" "Unlike :meth:`~bytes.split` when a delimiter string *sep* is given, this " "method returns an empty list for the empty string, and a terminal line break " @@ -6182,7 +6452,7 @@ msgstr "" "συμβολοσειρά και μια αλλαγή γραμμής τερματικού δεν οδηγεί σε μια επιπλέον " "γραμμή::" -#: library/stdtypes.rst:3420 +#: library/stdtypes.rst:3569 msgid "" ">>> b\"\".split(b'\\n'), b\"Two lines\\n\".split(b'\\n')\n" "([b''], [b'Two lines', b''])\n" @@ -6194,7 +6464,7 @@ msgstr "" ">>> b\"\".splitlines(), b\"One line\\n\".splitlines()\n" "([], [b'One line'])" -#: library/stdtypes.rst:3429 +#: library/stdtypes.rst:3578 msgid "" "Return a copy of the sequence with all the lowercase ASCII characters " "converted to their corresponding uppercase counterpart and vice-versa." @@ -6202,7 +6472,7 @@ msgstr "" "Επιστρέφει ένα αντίγραφο της ακολουθίας με όλους τους πεζούς χαρακτήρες " "ASCII να έχουν μετατραπεί στο αντίστοιχο ισοδύναμο κεφαλαίο και αντίστροφα." -#: library/stdtypes.rst:3434 +#: library/stdtypes.rst:3583 msgid "" ">>> b'Hello World'.swapcase()\n" "b'hELLO wORLD'" @@ -6210,7 +6480,7 @@ msgstr "" ">>> b'Hello World'.swapcase()\n" "b'hELLO wORLD'" -#: library/stdtypes.rst:3441 +#: library/stdtypes.rst:3590 msgid "" "Unlike :func:`str.swapcase`, it is always the case that ``bin.swapcase()." "swapcase() == bin`` for the binary versions. Case conversions are " @@ -6222,7 +6492,7 @@ msgstr "" "συμμετρικές στο ASCII, παρόλο που αυτό δεν ισχύει γενικά για αυθαίρετα " "σημεία Unicode κώδικα." -#: library/stdtypes.rst:3455 +#: library/stdtypes.rst:3604 msgid "" "Return a titlecased version of the binary sequence where words start with an " "uppercase ASCII character and the remaining characters are lowercase. " @@ -6233,7 +6503,7 @@ msgstr "" "χαρακτήρα ASCII και οι υπόλοιποι χαρακτήρες είναι πεζοί. Οι τιμές byte χωρίς " "κεφαλαία γράμματα παραμένουν χωρίς τροποποίηση." -#: library/stdtypes.rst:3461 +#: library/stdtypes.rst:3610 msgid "" ">>> b'Hello world'.title()\n" "b'Hello World'" @@ -6241,7 +6511,7 @@ msgstr "" ">>> b'Hello world'.title()\n" "b'Hello World'" -#: library/stdtypes.rst:3464 +#: library/stdtypes.rst:3613 msgid "" "Lowercase ASCII characters are those byte values in the sequence " "``b'abcdefghijklmnopqrstuvwxyz'``. Uppercase ASCII characters are those byte " @@ -6253,7 +6523,7 @@ msgstr "" "εκείνες οι τιμές byte στην ακολουθία ``b'ABCDEFGHIJKLMNOPQRSTUVWXYZ'``. Όλες " "οι άλλες τιμές byte είναι χωρίς κεφαλαία." -#: library/stdtypes.rst:3474 +#: library/stdtypes.rst:3623 msgid "" ">>> b\"they're bill's friends from the UK\".title()\n" "b\"They'Re Bill'S Friends From The Uk\"" @@ -6261,14 +6531,14 @@ msgstr "" ">>> b\"they're bill's friends from the UK\".title()\n" "b\"They'Re Bill'S Friends From The Uk\"" -#: library/stdtypes.rst:3477 +#: library/stdtypes.rst:3626 msgid "" "A workaround for apostrophes can be constructed using regular expressions::" msgstr "" "Μια λύση για αποστρόφους μπορεί να δημιουργηθεί χρησιμοποιώντας κανονικές " "εκφράσεις::" -#: library/stdtypes.rst:3479 +#: library/stdtypes.rst:3628 msgid "" ">>> import re\n" ">>> def titlecase(s):\n" @@ -6290,7 +6560,7 @@ msgstr "" ">>> titlecase(b\"they're bill's friends.\")\n" "b\"They're Bill's Friends.\"" -#: library/stdtypes.rst:3498 +#: library/stdtypes.rst:3647 msgid "" "Return a copy of the sequence with all the lowercase ASCII characters " "converted to their corresponding uppercase counterpart." @@ -6298,7 +6568,7 @@ msgstr "" "Επιστρέφει ένα αντίγραφο της ακολουθίας με όλους τους πεζούς χαρακτήρες " "ASCII να έχουν μετατραπεί στο αντίστοιχο ισοδύναμο κεφαλαίο." -#: library/stdtypes.rst:3503 +#: library/stdtypes.rst:3652 msgid "" ">>> b'Hello World'.upper()\n" "b'HELLO WORLD'" @@ -6306,7 +6576,7 @@ msgstr "" ">>> b'Hello World'.upper()\n" "b'HELLO WORLD'" -#: library/stdtypes.rst:3519 +#: library/stdtypes.rst:3668 msgid "" "Return a copy of the sequence left filled with ASCII ``b'0'`` digits to make " "a sequence of length *width*. A leading sign prefix (``b'+'``/ ``b'-'``) is " @@ -6321,7 +6591,7 @@ msgstr "" "αντικείμενα :class:`bytes`, η αρχική ακολουθία επιστρέφεται εάν το *width* " "είναι μικρότερο ή ίσο με ``len(seq)``." -#: library/stdtypes.rst:3527 +#: library/stdtypes.rst:3676 msgid "" ">>> b\"42\".zfill(5)\n" "b'00042'\n" @@ -6333,11 +6603,11 @@ msgstr "" ">>> b\"-42\".zfill(5)\n" "b'-0042'" -#: library/stdtypes.rst:3541 +#: library/stdtypes.rst:3690 msgid "``printf``-style Bytes Formatting" msgstr "Μορφοποίηση Bytes τύπου ``printf``" -#: library/stdtypes.rst:3558 +#: library/stdtypes.rst:3707 msgid "" "The formatting operations described here exhibit a variety of quirks that " "lead to a number of common errors (such as failing to display tuples and " @@ -6349,7 +6619,7 @@ msgstr "" "εμφάνισης των πλειάδων και των λεξικών σωστά). Εάν η τιμή που εκτυπώνεται " "μπορεί να είναι πλειάδα ή λεξικό, κάντε το wrap σε μια πλειάδα." -#: library/stdtypes.rst:3563 +#: library/stdtypes.rst:3712 msgid "" "Bytes objects (``bytes``/``bytearray``) have one unique built-in operation: " "the ``%`` operator (modulo). This is also known as the bytes *formatting* or " @@ -6366,7 +6636,7 @@ msgstr "" "στοιχεία *values*. Το αποτέλεσμα είναι παρόμοιο με τη χρήση του :c:func:" "`sprintf` στη γλώσσας C." -#: library/stdtypes.rst:3570 +#: library/stdtypes.rst:3719 msgid "" "If *format* requires a single argument, *values* may be a single non-tuple " "object. [5]_ Otherwise, *values* must be a tuple with exactly the number of " @@ -6379,7 +6649,7 @@ msgstr "" "αντικείμενο μορφής bytes ή μεμονωμένο mapping αντικείμενο (για παράδειγμα, " "ένα λεξικό)." -#: library/stdtypes.rst:3604 +#: library/stdtypes.rst:3753 msgid "" "When the right argument is a dictionary (or other mapping type), then the " "formats in the bytes object *must* include a parenthesised mapping key into " @@ -6392,15 +6662,15 @@ msgstr "" "τον χαρακτήρα ``'%'``. Το κλειδί αντιστοίχισης επιλέγει την τιμή που θα " "μορφοποιηθεί από την αντιστοίχιση. Για παράδειγμα:" -#: library/stdtypes.rst:3678 +#: library/stdtypes.rst:3827 msgid "Single byte (accepts integer or single byte objects)." msgstr "Μονό byte (δέχεται ακέραια ή μεμονωμένα byte αντικείμενα)." -#: library/stdtypes.rst:3681 +#: library/stdtypes.rst:3830 msgid "``'b'``" msgstr "``'b'``" -#: library/stdtypes.rst:3681 +#: library/stdtypes.rst:3830 msgid "" "Bytes (any object that follows the :ref:`buffer protocol ` or " "has :meth:`~object.__bytes__`)." @@ -6408,7 +6678,7 @@ msgstr "" "Bytes (κάθε αντικείμενο που ακολουθεί το :ref:`buffer protocol " "` ή έχει :meth:`~object.__bytes__`)." -#: library/stdtypes.rst:3685 +#: library/stdtypes.rst:3834 msgid "" "``'s'`` is an alias for ``'b'`` and should only be used for Python2/3 code " "bases." @@ -6416,7 +6686,7 @@ msgstr "" "Το ``'s'`` είναι ένα ψευδώνυμο για το ``'b'`` και θα πρέπει να " "χρησιμοποιείται μόνο για κώδικα βάσει Python2/3." -#: library/stdtypes.rst:3688 +#: library/stdtypes.rst:3837 msgid "" "Bytes (converts any Python object using ``repr(obj).encode('ascii', " "'backslashreplace')``)." @@ -6424,7 +6694,7 @@ msgstr "" "Bytes (μετατρέπει οποιοδήποτε αντικείμενο Python χρησιμοποιώντας ``repr(obj)." "encode('ascii', 'backslashreplace')``)." -#: library/stdtypes.rst:3691 +#: library/stdtypes.rst:3840 msgid "" "``'r'`` is an alias for ``'a'`` and should only be used for Python2/3 code " "bases." @@ -6432,31 +6702,31 @@ msgstr "" "Το ``'r'`` είναι ένα ψευδώνυμο για ``'a'`` και θα πρέπει να χρησιμοποιείται " "μόνο για βάσεις κώδικα Python2/3." -#: library/stdtypes.rst:3691 +#: library/stdtypes.rst:3840 msgid "\\(7)" msgstr "\\(7)" -#: library/stdtypes.rst:3726 +#: library/stdtypes.rst:3875 msgid "``b'%s'`` is deprecated, but will not be removed during the 3.x series." msgstr "" "Το ``b'%s'`` έχει καταργηθεί, αλλά δεν θα αφαιρεθεί κατά τη διάρκεια της " "σειράς 3.x." -#: library/stdtypes.rst:3729 +#: library/stdtypes.rst:3878 msgid "``b'%r'`` is deprecated, but will not be removed during the 3.x series." msgstr "" "Το ``b'%r'`` έχει καταργηθεί, αλλά δεν θα αφαιρεθεί κατά τη διάρκεια της " "σειράς 3.x." -#: library/stdtypes.rst:3741 +#: library/stdtypes.rst:3890 msgid ":pep:`461` - Adding % formatting to bytes and bytearray" msgstr ":pep:`461` - Προσθήκη % για μορφοποίηση σε bytes και bytearray" -#: library/stdtypes.rst:3748 +#: library/stdtypes.rst:3897 msgid "Memory Views" msgstr "Όψεις Μνήμης" -#: library/stdtypes.rst:3750 +#: library/stdtypes.rst:3899 msgid "" ":class:`memoryview` objects allow Python code to access the internal data of " "an object that supports the :ref:`buffer protocol ` without " @@ -6466,7 +6736,7 @@ msgstr "" "πρόσβαση στα εσωτερικά δεδομένα ενός αντικειμένου που υποστηρίζει το " "πρωτόκολλο :ref:`buffer protocol ` χωρίς αντιγραφή." -#: library/stdtypes.rst:3756 +#: library/stdtypes.rst:3905 msgid "" "Create a :class:`memoryview` that references *object*. *object* must " "support the buffer protocol. Built-in objects that support the buffer " @@ -6477,7 +6747,7 @@ msgstr "" "υποστηρίζουν το πρωτόκολλο buffer περιλαμβάνουν :class:`bytes` και :class:" "`bytearray`." -#: library/stdtypes.rst:3760 +#: library/stdtypes.rst:3909 msgid "" "A :class:`memoryview` has the notion of an *element*, which is the atomic " "memory unit handled by the originating *object*. For many simple types such " @@ -6490,7 +6760,7 @@ msgstr "" "ένα μεμονωμένο byte, αλλά άλλοι τύποι όπως :class:`array.array` μπορεί να " "έχουν μεγαλύτερα στοιχεία." -#: library/stdtypes.rst:3765 +#: library/stdtypes.rst:3914 msgid "" "``len(view)`` is equal to the length of :class:`~memoryview.tolist`, which " "is the nested list representation of the view. If ``view.ndim = 1``, this is " @@ -6500,7 +6770,7 @@ msgstr "" "οποίο είναι η ένθετη αναπαράσταση κατά την προβολή της λίστας. Εάν ``view." "ndim = 1``, αυτό ισούται με τον αριθμό των στοιχείων για την προβολή." -#: library/stdtypes.rst:3769 +#: library/stdtypes.rst:3918 msgid "" "If ``view.ndim == 0``, ``len(view)`` now raises :exc:`TypeError` instead of " "returning 1." @@ -6508,7 +6778,7 @@ msgstr "" "Εάν ``view.ndim == 0``, το ``len(view)`` τώρα κάνει raise μια :exc:" "`TypeError` αντί να επιστρέψει 1." -#: library/stdtypes.rst:3772 +#: library/stdtypes.rst:3921 msgid "" "The :class:`~memoryview.itemsize` attribute will give you the number of " "bytes in a single element." @@ -6516,7 +6786,7 @@ msgstr "" "Το χαρακτηριστικό :class:`~memoryview.itemsize` θα σας δώσει τον αριθμό των " "byte σε ένα μόνο στοιχείο." -#: library/stdtypes.rst:3775 +#: library/stdtypes.rst:3924 msgid "" "A :class:`memoryview` supports slicing and indexing to expose its data. One-" "dimensional slicing will result in a subview::" @@ -6525,7 +6795,7 @@ msgstr "" "μέσω ευρετηρίου στα δεδομένα του. Μια μονοδιάστατη τμηματοποίηση θα έχει ως " "αποτέλεσμα μια δευτερεύουσα προβολή::" -#: library/stdtypes.rst:3778 +#: library/stdtypes.rst:3927 msgid "" ">>> v = memoryview(b'abcefg')\n" ">>> v[1]\n" @@ -6547,7 +6817,7 @@ msgstr "" ">>> bytes(v[1:4])\n" "b'bce'" -#: library/stdtypes.rst:3788 +#: library/stdtypes.rst:3937 msgid "" "If :class:`~memoryview.format` is one of the native format specifiers from " "the :mod:`struct` module, indexing with an integer or a tuple of integers is " @@ -6567,11 +6837,11 @@ msgstr "" "διαστάσεων. Τα μηδενικών διαστάσεων memoryviews μπορούν να γίνουν indexed " "με την κενή πλειάδα (tuple)." -#: library/stdtypes.rst:3797 +#: library/stdtypes.rst:3946 msgid "Here is an example with a non-byte format::" msgstr "Ακολουθεί ένα παράδειγμα με μη-byte μορφή::" -#: library/stdtypes.rst:3799 +#: library/stdtypes.rst:3948 msgid "" ">>> import array\n" ">>> a = array.array('l', [-11111111, 22222222, -33333333, 44444444])\n" @@ -6593,7 +6863,7 @@ msgstr "" ">>> m[::2].tolist()\n" "[-11111111, -33333333]" -#: library/stdtypes.rst:3809 +#: library/stdtypes.rst:3958 msgid "" "If the underlying object is writable, the memoryview supports one-" "dimensional slice assignment. Resizing is not allowed::" @@ -6601,7 +6871,7 @@ msgstr "" "Εάν το βασικό αντικείμενο είναι εγγράψιμο, το memoryview υποστηρίζει " "μονοδιάστατη εκχώρηση τμηματοποίησης. Δεν επιτρέπεται η αλλαγή μεγέθους::" -#: library/stdtypes.rst:3812 +#: library/stdtypes.rst:3961 msgid "" ">>> data = bytearray(b'abcefg')\n" ">>> v = memoryview(data)\n" @@ -6641,7 +6911,7 @@ msgstr "" ">>> data\n" "bytearray(b'z1spam')" -#: library/stdtypes.rst:3830 +#: library/stdtypes.rst:3979 msgid "" "One-dimensional memoryviews of :term:`hashable` (read-only) types with " "formats 'B', 'b' or 'c' are also hashable. The hash is defined as ``hash(m) " @@ -6651,7 +6921,7 @@ msgstr "" "με μορφές 'B', 'b' ή 'c' μπορούν επίσης να κατακερματιστούν. Ο " "κατακερματισμός ορίζεται ως ``hash(m) == hash(m.tobytes())``::" -#: library/stdtypes.rst:3834 +#: library/stdtypes.rst:3983 msgid "" ">>> v = memoryview(b'abcefg')\n" ">>> hash(v) == hash(b'abcefg')\n" @@ -6669,7 +6939,7 @@ msgstr "" ">>> hash(v[::-2]) == hash(b'abcefg'[::-2])\n" "True" -#: library/stdtypes.rst:3842 +#: library/stdtypes.rst:3991 msgid "" "One-dimensional memoryviews can now be sliced. One-dimensional memoryviews " "with formats 'B', 'b' or 'c' are now :term:`hashable`." @@ -6678,24 +6948,24 @@ msgstr "" "μονοδιάστατα memoryviews με μορφές 'B', 'b' ή 'c' είναι πλέον :term:" "`hashable`." -#: library/stdtypes.rst:3846 +#: library/stdtypes.rst:3995 msgid "" "memoryview is now registered automatically with :class:`collections.abc." "Sequence`" msgstr "" "το memoryview εγγράφεται πλέον αυτόματα με :class:`collections.abc.Sequence`" -#: library/stdtypes.rst:3850 +#: library/stdtypes.rst:3999 msgid "memoryviews can now be indexed with tuple of integers." msgstr "" "τα memoryviews μπορούν τώρα να γίνουν ευρετηριοποίηση με πλειάδα (tuple) " "ακεραίων." -#: library/stdtypes.rst:3853 +#: library/stdtypes.rst:4002 msgid ":class:`memoryview` has several methods:" msgstr "το :class:`memoryview` έχει διάφορες μεθόδους:" -#: library/stdtypes.rst:3857 +#: library/stdtypes.rst:4006 msgid "" "A memoryview and a :pep:`3118` exporter are equal if their shapes are " "equivalent and if all corresponding values are equal when the operands' " @@ -6706,7 +6976,7 @@ msgstr "" "αντίστοιχοι κωδικοί μορφής των τελεστών ερμηνεύονται χρησιμοποιώντας τη " "σύνταξη :mod:`struct`." -#: library/stdtypes.rst:3861 +#: library/stdtypes.rst:4010 msgid "" "For the subset of :mod:`struct` format strings currently supported by :meth:" "`tolist`, ``v`` and ``w`` are equal if ``v.tolist() == w.tolist()``::" @@ -6715,7 +6985,7 @@ msgstr "" "υποστηρίζονται αυτή τη στιγμή από το :meth:`tolist`, ``v`` και ``w`` είναι " "ίσες εάν ``v.tolist() == w.tolist()``::" -#: library/stdtypes.rst:3864 +#: library/stdtypes.rst:4013 msgid "" ">>> import array\n" ">>> a = array.array('I', [1, 2, 3, 4, 5])\n" @@ -6749,7 +7019,7 @@ msgstr "" ">>> z.tolist() == c.tolist()\n" "True" -#: library/stdtypes.rst:3880 +#: library/stdtypes.rst:4029 msgid "" "If either format string is not supported by the :mod:`struct` module, then " "the objects will always compare as unequal (even if the format strings and " @@ -6760,7 +7030,7 @@ msgstr "" "συμβολοσειρές μορφοποίησης και τα περιεχόμενα της προσωρινής μνήμης είναι " "πανομοιότυπα)::" -#: library/stdtypes.rst:3884 +#: library/stdtypes.rst:4033 msgid "" ">>> from ctypes import BigEndianStructure, c_long\n" ">>> class BEPoint(BigEndianStructure):\n" @@ -6786,7 +7056,7 @@ msgstr "" ">>> a == b\n" "False" -#: library/stdtypes.rst:3896 +#: library/stdtypes.rst:4045 msgid "" "Note that, as with floating-point numbers, ``v is w`` does *not* imply ``v " "== w`` for memoryview objects." @@ -6794,7 +7064,7 @@ msgstr "" "Λάβετε υπόψη ότι, όπως και με τους αριθμούς κινητής υποδιαστολής, ``v is w`` " "*δεν* σημαίνει ``v == w`` για αντικείμενα memoryview." -#: library/stdtypes.rst:3899 +#: library/stdtypes.rst:4048 msgid "" "Previous versions compared the raw memory disregarding the item format and " "the logical array structure." @@ -6802,7 +7072,7 @@ msgstr "" "Οι προηγούμενες εκδόσεις συνέκριναν την ακατέργαστη μνήμη αγνοώντας τη μορφή " "του στοιχείου και τη δομή του λογικού πίνακα." -#: library/stdtypes.rst:3905 +#: library/stdtypes.rst:4054 msgid "" "Return the data in the buffer as a bytestring. This is equivalent to " "calling the :class:`bytes` constructor on the memoryview. ::" @@ -6810,7 +7080,7 @@ msgstr "" "Επιστρέφει τα δεδομένα στο buffer ως ένα bytestring. Αυτό ισοδυναμεί με την " "κλήση του κατασκευαστή :class:`bytes` στο memoryview. ::" -#: library/stdtypes.rst:3908 +#: library/stdtypes.rst:4057 msgid "" ">>> m = memoryview(b\"abc\")\n" ">>> m.tobytes()\n" @@ -6824,7 +7094,7 @@ msgstr "" ">>> bytes(m)\n" "b'abc'" -#: library/stdtypes.rst:3914 +#: library/stdtypes.rst:4063 msgid "" "For non-contiguous arrays the result is equal to the flattened list " "representation with all elements converted to bytes. :meth:`tobytes` " @@ -6836,7 +7106,7 @@ msgstr "" "`tobytes` υποστηρίζει όλες τις συμβολοσειρές μορφής, συμπεριλαμβανομένων " "εκείνων που δεν είναι στη σύνταξη του module :mod:`struct`." -#: library/stdtypes.rst:3919 +#: library/stdtypes.rst:4068 msgid "" "*order* can be {'C', 'F', 'A'}. When *order* is 'C' or 'F', the data of the " "original array is converted to C or Fortran order. For contiguous views, 'A' " @@ -6851,7 +7121,7 @@ msgstr "" "συνεχόμενες προβολές, τα δεδομένα μετατρέπονται πρώτα σε C. Το *order=None* " "είναι το ίδιο με το *order='C'*." -#: library/stdtypes.rst:3928 +#: library/stdtypes.rst:4077 msgid "" "Return a string object containing two hexadecimal digits for each byte in " "the buffer. ::" @@ -6859,7 +7129,7 @@ msgstr "" "Επιστρέφει ένα αντικείμενο συμβολοσειράς που περιέχει δύο δεκαεξαδικά ψηφία " "για κάθε byte στο buffer. ::" -#: library/stdtypes.rst:3931 +#: library/stdtypes.rst:4080 msgid "" ">>> m = memoryview(b\"abc\")\n" ">>> m.hex()\n" @@ -6869,7 +7139,7 @@ msgstr "" ">>> m.hex()\n" "'616263'" -#: library/stdtypes.rst:3937 +#: library/stdtypes.rst:4086 msgid "" "Similar to :meth:`bytes.hex`, :meth:`memoryview.hex` now supports optional " "*sep* and *bytes_per_sep* parameters to insert separators between bytes in " @@ -6879,11 +7149,11 @@ msgstr "" "προαιρετικές παραμέτρους *sep* και *bytes_per_sep* για να εισάγετε " "διαχωριστικά μεταξύ των byte στην εξαγωγή δεκαεξαδικού." -#: library/stdtypes.rst:3944 +#: library/stdtypes.rst:4093 msgid "Return the data in the buffer as a list of elements. ::" msgstr "Επιστρέψτε τα δεδομένα στο buffer ως λίστα στοιχείων. ::" -#: library/stdtypes.rst:3946 +#: library/stdtypes.rst:4095 msgid "" ">>> memoryview(b'abc').tolist()\n" "[97, 98, 99]\n" @@ -6901,7 +7171,7 @@ msgstr "" ">>> m.tolist()\n" "[1.1, 2.2, 3.3]" -#: library/stdtypes.rst:3954 +#: library/stdtypes.rst:4103 msgid "" ":meth:`tolist` now supports all single character native formats in :mod:" "`struct` module syntax as well as multi-dimensional representations." @@ -6910,7 +7180,7 @@ msgstr "" "χαρακτήρων στη σύνταξη του :mod:`struct`, καθώς και πολυδιάστατες " "αναπαραστάσεις." -#: library/stdtypes.rst:3961 +#: library/stdtypes.rst:4110 msgid "" "Return a readonly version of the memoryview object. The original memoryview " "object is unchanged. ::" @@ -6918,7 +7188,7 @@ msgstr "" "Επιστρέφει μια έκδοση μόνο για ανάγνωση του αντικειμένου memoryview. Το " "αρχικό αντικείμενο memoryview είναι αμετάβλητο. ::" -#: library/stdtypes.rst:3964 +#: library/stdtypes.rst:4113 msgid "" ">>> m = memoryview(bytearray(b'abc'))\n" ">>> mm = m.toreadonly()\n" @@ -6944,7 +7214,7 @@ msgstr "" ">>> mm.tolist()\n" "[43, 98, 99]" -#: library/stdtypes.rst:3980 +#: library/stdtypes.rst:4129 msgid "" "Release the underlying buffer exposed by the memoryview object. Many " "objects take special actions when a view is held on them (for example, a :" @@ -6959,7 +7229,7 @@ msgstr "" "είναι βολική για την κατάργηση αυτών των περιορισμών (και απελευθερώνει " "οποιουσδήποτε αιωρούμενους πόρους) το συντομότερο δυνατό." -#: library/stdtypes.rst:3986 +#: library/stdtypes.rst:4135 msgid "" "After this method has been called, any further operation on the view raises " "a :class:`ValueError` (except :meth:`release` itself which can be called " @@ -6969,7 +7239,7 @@ msgstr "" "προβολή δημιουργεί μια :class:`ValueError` (εκτός από την ίδια την :meth:" "`release` που μπορεί να κληθεί πολλές φορές)::" -#: library/stdtypes.rst:3990 +#: library/stdtypes.rst:4139 msgid "" ">>> m = memoryview(b'abc')\n" ">>> m.release()\n" @@ -6985,7 +7255,7 @@ msgstr "" " File \"\", line 1, in \n" "ValueError: operation forbidden on released memoryview object" -#: library/stdtypes.rst:3997 +#: library/stdtypes.rst:4146 msgid "" "The context management protocol can be used for a similar effect, using the " "``with`` statement::" @@ -6993,7 +7263,7 @@ msgstr "" "Το πρωτόκολλο διαχείρισης περιεχομένου μπορεί να χρησιμοποιηθεί για παρόμοιο " "αποτέλεσμα, χρησιμοποιώντας τη δήλωση ``with``::" -#: library/stdtypes.rst:4000 +#: library/stdtypes.rst:4149 msgid "" ">>> with memoryview(b'abc') as m:\n" "... m[0]\n" @@ -7013,7 +7283,7 @@ msgstr "" " File \"\", line 1, in \n" "ValueError: operation forbidden on released memoryview object" -#: library/stdtypes.rst:4013 +#: library/stdtypes.rst:4162 msgid "" "Cast a memoryview to a new format or shape. *shape* defaults to " "``[byte_length//new_itemsize]``, which means that the result view will be " @@ -7027,7 +7297,7 @@ msgstr "" "memoryview, αλλά το ίδιο το buffer δεν αντιγράφεται. Οι υποστηριζόμενες " "μετατροπές είναι 1D -> C-:term:`contiguous` και C-contiguous -> 1D." -#: library/stdtypes.rst:4019 +#: library/stdtypes.rst:4168 msgid "" "The destination format is restricted to a single element native format in :" "mod:`struct` syntax. One of the formats must be a byte format ('B', 'b' or " @@ -7040,11 +7310,11 @@ msgstr "" "το αρχικό μήκος. Σημειώστε ότι όλα τα μήκη byte μπορεί να εξαρτώνται από το " "λειτουργικό σύστημα." -#: library/stdtypes.rst:4025 +#: library/stdtypes.rst:4174 msgid "Cast 1D/long to 1D/unsigned bytes::" msgstr "Μορφοποίηση από 1D/long σε 1D/unsigned bytes::" -#: library/stdtypes.rst:4027 +#: library/stdtypes.rst:4176 msgid "" ">>> import array\n" ">>> a = array.array('l', [1,2,3])\n" @@ -7088,11 +7358,11 @@ msgstr "" ">>> y.nbytes\n" "24" -#: library/stdtypes.rst:4048 +#: library/stdtypes.rst:4197 msgid "Cast 1D/unsigned bytes to 1D/char::" msgstr "Μορφοποίηση από 1D/unsigned bytes σε 1D/char::" -#: library/stdtypes.rst:4050 +#: library/stdtypes.rst:4199 msgid "" ">>> b = bytearray(b'zyz')\n" ">>> x = memoryview(b)\n" @@ -7116,11 +7386,11 @@ msgstr "" ">>> b\n" "bytearray(b'ayz')" -#: library/stdtypes.rst:4061 +#: library/stdtypes.rst:4210 msgid "Cast 1D/bytes to 3D/ints to 1D/signed char::" msgstr "Μορφοποίηση από 1D/bytes σε 3D/ints σε 1D/signed char::" -#: library/stdtypes.rst:4063 +#: library/stdtypes.rst:4212 msgid "" ">>> import struct\n" ">>> buf = struct.pack(\"i\"*12, *list(range(12)))\n" @@ -7170,11 +7440,11 @@ msgstr "" ">>> z.nbytes\n" "48" -#: library/stdtypes.rst:4087 +#: library/stdtypes.rst:4236 msgid "Cast 1D/unsigned long to 2D/unsigned long::" msgstr "Μορφοποίηση από 1D/unsigned long σε 2D/unsigned long::" -#: library/stdtypes.rst:4089 +#: library/stdtypes.rst:4238 msgid "" ">>> buf = struct.pack(\"L\"*6, *list(range(6)))\n" ">>> x = memoryview(buf)\n" @@ -7196,21 +7466,21 @@ msgstr "" ">>> y.tolist()\n" "[[0, 1, 2], [3, 4, 5]]" -#: library/stdtypes.rst:4101 +#: library/stdtypes.rst:4250 msgid "The source format is no longer restricted when casting to a byte view." msgstr "" "Η πηγαία μορφή δεν είναι πλέον περιορισμένη κατά τη μορφοποίηση σε μια όψη " "byte." -#: library/stdtypes.rst:4104 +#: library/stdtypes.rst:4253 msgid "There are also several readonly attributes available:" msgstr "Υπάρχουν επίσης αρκετά διαθέσιμα χαρακτηριστικά μόνο για ανάγνωση:" -#: library/stdtypes.rst:4108 +#: library/stdtypes.rst:4257 msgid "The underlying object of the memoryview::" msgstr "Το βασικό αντικείμενο του memoryview::" -#: library/stdtypes.rst:4110 +#: library/stdtypes.rst:4259 msgid "" ">>> b = bytearray(b'xyz')\n" ">>> m = memoryview(b)\n" @@ -7222,7 +7492,7 @@ msgstr "" ">>> m.obj is b\n" "True" -#: library/stdtypes.rst:4119 +#: library/stdtypes.rst:4268 msgid "" "``nbytes == product(shape) * itemsize == len(m.tobytes())``. This is the " "amount of space in bytes that the array would use in a contiguous " @@ -7232,7 +7502,7 @@ msgstr "" "ποσότητα χώρου σε byte που θα χρησιμοποιούσε ο πίνακας σε μια συνεχόμενη " "αναπαράσταση. Δεν ισούται απαραίτητα με ``len(m)``::" -#: library/stdtypes.rst:4123 +#: library/stdtypes.rst:4272 msgid "" ">>> import array\n" ">>> a = array.array('i', [1,2,3,4,5])\n" @@ -7264,11 +7534,11 @@ msgstr "" ">>> len(y.tobytes())\n" "12" -#: library/stdtypes.rst:4138 +#: library/stdtypes.rst:4287 msgid "Multi-dimensional arrays::" msgstr "Πολυδιάστατοι πίνακες::" -#: library/stdtypes.rst:4140 +#: library/stdtypes.rst:4289 msgid "" ">>> import struct\n" ">>> buf = struct.pack(\"d\"*12, *[1.5*x for x in range(12)])\n" @@ -7292,11 +7562,11 @@ msgstr "" ">>> y.nbytes\n" "96" -#: library/stdtypes.rst:4155 +#: library/stdtypes.rst:4304 msgid "A bool indicating whether the memory is read only." msgstr "Ένα bool που υποδεικνύει εάν η μνήμη είναι μόνο για ανάγνωση." -#: library/stdtypes.rst:4159 +#: library/stdtypes.rst:4308 msgid "" "A string containing the format (in :mod:`struct` module style) for each " "element in the view. A memoryview can be created from exporters with " @@ -7308,7 +7578,7 @@ msgstr "" "εξαγωγείς με συμβολοσειρές αυθαίρετης μορφής, αλλά ορισμένες μέθοδοι (π.χ. :" "meth:`tolist`) είναι περιορισμένες σε εγγενείς μορφές ενός στοιχείου." -#: library/stdtypes.rst:4164 +#: library/stdtypes.rst:4313 msgid "" "format ``'B'`` is now handled according to the struct module syntax. This " "means that ``memoryview(b'abc')[0] == b'abc'[0] == 97``." @@ -7316,11 +7586,11 @@ msgstr "" "η μορφή ``'B'`` αντιμετωπίζεται πλέον σύμφωνα με τη σύνταξη ενός struct " "module. Αυτό σημαίνει ότι ``memoryview(b'abc')[0] == b'abc'[0] == 97``." -#: library/stdtypes.rst:4170 +#: library/stdtypes.rst:4319 msgid "The size in bytes of each element of the memoryview::" msgstr "Το μέγεθος σε bytes κάθε στοιχείου στο memoryview::" -#: library/stdtypes.rst:4172 +#: library/stdtypes.rst:4321 msgid "" ">>> import array, struct\n" ">>> m = memoryview(array.array('H', [32000, 32001, 32002]))\n" @@ -7340,7 +7610,7 @@ msgstr "" ">>> struct.calcsize('H') == m.itemsize\n" "True" -#: library/stdtypes.rst:4183 +#: library/stdtypes.rst:4332 msgid "" "An integer indicating how many dimensions of a multi-dimensional array the " "memory represents." @@ -7348,7 +7618,7 @@ msgstr "" "Ένα ακέραιος αριθμός που δείχνει πόσες διαστάσεις ενός πολυδιάστατου πίνακα " "αντιπροσωπεύει η μνήμη." -#: library/stdtypes.rst:4188 +#: library/stdtypes.rst:4337 msgid "" "A tuple of integers the length of :attr:`ndim` giving the shape of the " "memory as an N-dimensional array." @@ -7356,11 +7626,11 @@ msgstr "" "Μια πλειάδα (tuple) ακεραίων με μήκος :attr:`ndim` δίνοντας το σχήμα της " "μνήμης ως πίνακα N-διαστάσεων." -#: library/stdtypes.rst:4199 +#: library/stdtypes.rst:4348 msgid "An empty tuple instead of ``None`` when ndim = 0." msgstr "Μια κενή πλειάδα (tuple) αντί για ``None`` όταν ndim = 0." -#: library/stdtypes.rst:4196 +#: library/stdtypes.rst:4345 msgid "" "A tuple of integers the length of :attr:`ndim` giving the size in bytes to " "access each element for each dimension of the array." @@ -7368,29 +7638,29 @@ msgstr "" "Μια πλειάδα ακεραίων με μήκος :attr:`ndim` που δίνει το μέγεθος σε bytes για " "την πρόσβαση σε κάθε στοιχείο για κάθε διάσταση του πίνακα." -#: library/stdtypes.rst:4204 +#: library/stdtypes.rst:4353 msgid "Used internally for PIL-style arrays. The value is informational only." msgstr "" "Χρησιμοποιείται εσωτερικά για συστοιχίες τύπου PIL. Η τιμή είναι μόνο " "ενημερωτική." -#: library/stdtypes.rst:4208 +#: library/stdtypes.rst:4357 msgid "A bool indicating whether the memory is C-:term:`contiguous`." msgstr "Ένα bool που υποδεικνύει εάν η μνήμη είναι C-:term:`contiguous`." -#: library/stdtypes.rst:4214 +#: library/stdtypes.rst:4363 msgid "A bool indicating whether the memory is Fortran :term:`contiguous`." msgstr "Ένα bool που υποδεικνύει εάν η μνήμη είναι Fortran :term:`contiguous`." -#: library/stdtypes.rst:4220 +#: library/stdtypes.rst:4369 msgid "A bool indicating whether the memory is :term:`contiguous`." msgstr "Ένα bool που υποδεικνύει εάν η μνήμη είναι :term:`contiguous`." -#: library/stdtypes.rst:4228 +#: library/stdtypes.rst:4377 msgid "Set Types --- :class:`set`, :class:`frozenset`" msgstr "Τύποι Συνόλου (Set) --- :class:`set`, :class:`frozenset`" -#: library/stdtypes.rst:4232 +#: library/stdtypes.rst:4381 msgid "" "A :dfn:`set` object is an unordered collection of distinct :term:`hashable` " "objects. Common uses include membership testing, removing duplicates from a " @@ -7406,7 +7676,7 @@ msgstr "" "διαφορά. (Για άλλα containers, δείτε τις ενσωματωμένες κλάσεις :class:" "`dict`, :class:`list`, και :class:`tuple` και το module :mod:`collections`)." -#: library/stdtypes.rst:4239 +#: library/stdtypes.rst:4388 msgid "" "Like other collections, sets support ``x in set``, ``len(set)``, and ``for x " "in set``. Being an unordered collection, sets do not record element " @@ -7419,7 +7689,7 @@ msgstr "" "τα σύνολα (sets) δεν υποστηρίζουν λειτουργίες ευρετηριοποίησης, " "τμηματοποίησης ή άλλη συμπεριφορά ακολουθίας." -#: library/stdtypes.rst:4244 +#: library/stdtypes.rst:4393 msgid "" "There are currently two built-in set types, :class:`set` and :class:" "`frozenset`. The :class:`set` type is mutable --- the contents can be " @@ -7440,7 +7710,7 @@ msgstr "" "δεν μπορεί να αλλάξει μετά τη δημιουργία του· μπορεί επομένως να " "χρησιμοποιηθεί ως κλειδί λεξικού ή ως στοιχείο άλλου συνόλου (set)." -#: library/stdtypes.rst:4252 +#: library/stdtypes.rst:4401 msgid "" "Non-empty sets (not frozensets) can be created by placing a comma-separated " "list of elements within braces, for example: ``{'jack', 'sjoerd'}``, in " @@ -7451,11 +7721,11 @@ msgstr "" "παράδειγμα: ``{'jack', 'sjoerd'}``, επιπλέον με τη χρήση του constructor " "του :class:`set`." -#: library/stdtypes.rst:4256 +#: library/stdtypes.rst:4405 msgid "The constructors for both classes work the same:" msgstr "Οι constructors και για τις δύο κλάσεις λειτουργούν το ίδιο:" -#: library/stdtypes.rst:4261 +#: library/stdtypes.rst:4410 msgid "" "Return a new set or frozenset object whose elements are taken from " "*iterable*. The elements of a set must be :term:`hashable`. To represent " @@ -7468,25 +7738,25 @@ msgstr "" "εσωτερικά σύνολα πρέπει να είναι :class:`frozenset` αντικείμενα. Εάν δεν " "έχει καθοριστεί το *iterable*, επιστρέφεται ένα νέο κενό σύνολο." -#: library/stdtypes.rst:4267 +#: library/stdtypes.rst:4416 msgid "Sets can be created by several means:" msgstr "Τα σύνολα μπορούν να δημιουργηθούν με διάφορους τρόπους:" -#: library/stdtypes.rst:4269 +#: library/stdtypes.rst:4418 msgid "" "Use a comma-separated list of elements within braces: ``{'jack', 'sjoerd'}``" msgstr "" "Χρησιμοποιώντας μια λίστα στοιχείων διαχωρισμένη με κόμματα: ``{'jack', " "'sjoerd'}``" -#: library/stdtypes.rst:4270 +#: library/stdtypes.rst:4419 msgid "" "Use a set comprehension: ``{c for c in 'abracadabra' if c not in 'abc'}``" msgstr "" "Χρησιμοποιώντας ένα set comprehension: ``{c for c in 'abracadabra' if c not " "in 'abc'}``" -#: library/stdtypes.rst:4271 +#: library/stdtypes.rst:4420 msgid "" "Use the type constructor: ``set()``, ``set('foobar')``, ``set(['a', 'b', " "'foo'])``" @@ -7494,7 +7764,7 @@ msgstr "" "Χρησιμοποιώντας τον τύπο constructor: ``set()``, ``set('foobar')``, " "``set(['a', 'b', 'foo'])``" -#: library/stdtypes.rst:4273 +#: library/stdtypes.rst:4422 msgid "" "Instances of :class:`set` and :class:`frozenset` provide the following " "operations:" @@ -7502,20 +7772,20 @@ msgstr "" "Τα στιγμιότυπα των :class:`set` και :class:`frozenset` παρέχουν τις " "ακόλουθες λειτουργίες:" -#: library/stdtypes.rst:4278 +#: library/stdtypes.rst:4427 msgid "Return the number of elements in set *s* (cardinality of *s*)." msgstr "" "Επιστρέφει τον αριθμό των στοιχείων στο σύνολο *s* (πληθικότητα του *s*)." -#: library/stdtypes.rst:4282 +#: library/stdtypes.rst:4431 msgid "Test *x* for membership in *s*." msgstr "Ελέγχει αν το *x* είναι μέρος στο *s*." -#: library/stdtypes.rst:4286 +#: library/stdtypes.rst:4435 msgid "Test *x* for non-membership in *s*." msgstr "Ελέγχει αν το *x* δεν είναι μέρος στο *s*." -#: library/stdtypes.rst:4290 +#: library/stdtypes.rst:4439 msgid "" "Return ``True`` if the set has no elements in common with *other*. Sets are " "disjoint if and only if their intersection is the empty set." @@ -7523,11 +7793,11 @@ msgstr "" "Επιστρέφει ``True`` εάν το σύνολο δεν έχει κοινά στοιχεία με το *other*. Τα " "σύνολα είναι ασύνδετα εάν και μόνο εάν η τομή τους είναι το κενό σύνολο." -#: library/stdtypes.rst:4296 +#: library/stdtypes.rst:4445 msgid "Test whether every element in the set is in *other*." msgstr "Ελέγχει εάν κάθε στοιχείο στο σύνολο βρίσκεται στο *other*." -#: library/stdtypes.rst:4300 +#: library/stdtypes.rst:4449 msgid "" "Test whether the set is a proper subset of *other*, that is, ``set <= other " "and set != other``." @@ -7535,11 +7805,11 @@ msgstr "" "Ελέγχει εάν το σύνολο είναι σωστό υποσύνολο του *other*, δηλαδή, ``set <= " "other and set != other``." -#: library/stdtypes.rst:4306 +#: library/stdtypes.rst:4455 msgid "Test whether every element in *other* is in the set." msgstr "Ελέγχει αν κάθε στοιχείο του *other* είναι στο σύνολο." -#: library/stdtypes.rst:4310 +#: library/stdtypes.rst:4459 msgid "" "Test whether the set is a proper superset of *other*, that is, ``set >= " "other and set != other``." @@ -7547,32 +7817,32 @@ msgstr "" "Ελέγχει αν το σύνολο είναι σωστό υπερσύνολο του *other*, δηλαδή, ``set >= " "other and set != other``." -#: library/stdtypes.rst:4316 +#: library/stdtypes.rst:4465 msgid "Return a new set with elements from the set and all others." msgstr "Επιστρέφει ένα νέο σύνολο με στοιχεία από το σύνολο και όλα τα άλλα." -#: library/stdtypes.rst:4321 +#: library/stdtypes.rst:4470 msgid "Return a new set with elements common to the set and all others." msgstr "" "Επιστρέφει ένα νέο σύνολο με στοιχεία κοινά στο σύνολο και σε όλα τα άλλα." -#: library/stdtypes.rst:4326 +#: library/stdtypes.rst:4475 msgid "Return a new set with elements in the set that are not in the others." msgstr "" "Επιστρέφει ένα νέο σύνολο με στοιχεία στο σύνολο που δεν υπάρχουν στα άλλα." -#: library/stdtypes.rst:4331 +#: library/stdtypes.rst:4480 msgid "" "Return a new set with elements in either the set or *other* but not both." msgstr "" "Επιστρέφει ένα νέο σύνολο με στοιχεία είτε στο σύνολο είτε στο *other* αλλά " "όχι και στα δύο." -#: library/stdtypes.rst:4335 +#: library/stdtypes.rst:4484 msgid "Return a shallow copy of the set." msgstr "Επιστρέφει ένα ρηχό αντίγραφο του συνόλου." -#: library/stdtypes.rst:4338 +#: library/stdtypes.rst:4487 msgid "" "Note, the non-operator versions of :meth:`union`, :meth:`intersection`, :" "meth:`difference`, :meth:`symmetric_difference`, :meth:`issubset`, and :meth:" @@ -7589,7 +7859,7 @@ msgstr "" "σφάλματα όπως ``set('abc') & 'cbs'`` υπέρ του πιο ευανάγνωστου ``set('abc')." "intersection('cbs')``." -#: library/stdtypes.rst:4345 +#: library/stdtypes.rst:4494 msgid "" "Both :class:`set` and :class:`frozenset` support set to set comparisons. Two " "sets are equal if and only if every element of each set is contained in the " @@ -7607,7 +7877,7 @@ msgstr "" "είναι σωστό υπερσύνολο του δεύτερου συνόλου (είναι υπερσύνολο αλλά δεν είναι " "ίσο)." -#: library/stdtypes.rst:4352 +#: library/stdtypes.rst:4501 msgid "" "Instances of :class:`set` are compared to instances of :class:`frozenset` " "based on their members. For example, ``set('abc') == frozenset('abc')`` " @@ -7618,7 +7888,7 @@ msgstr "" "frozenset('abc')`` επιστρέφει ``True`` και το ίδιο συμβαίνει και με το " "``set('abc') in set([frozenset('abc')])``." -#: library/stdtypes.rst:4356 +#: library/stdtypes.rst:4505 msgid "" "The subset and equality comparisons do not generalize to a total ordering " "function. For example, any two nonempty disjoint sets are not equal and are " @@ -7630,7 +7900,7 @@ msgstr "" "δεν είναι ίσα και δεν είναι υποσύνολα το ένα του άλλου, επομένως *όλα* τα " "ακόλουθα επιστρέφουν ``False``: ``ab``." -#: library/stdtypes.rst:4361 +#: library/stdtypes.rst:4510 msgid "" "Since sets only define partial ordering (subset relationships), the output " "of the :meth:`list.sort` method is undefined for lists of sets." @@ -7638,13 +7908,13 @@ msgstr "" "Δεδομένου ότι τα σύνολα ορίζουν μόνο μερική σειρά (σχέσεις υποσυνόλων), η " "έξοδος της μεθόδου :meth:`list.sort` δεν έχει οριστεί για λίστες συνόλων." -#: library/stdtypes.rst:4364 +#: library/stdtypes.rst:4513 msgid "Set elements, like dictionary keys, must be :term:`hashable`." msgstr "" "Τα στοιχεία συνόλου, όπως τα κλειδιά λεξικού, πρέπει να είναι :term:" "`hashable`." -#: library/stdtypes.rst:4366 +#: library/stdtypes.rst:4515 msgid "" "Binary operations that mix :class:`set` instances with :class:`frozenset` " "return the type of the first operand. For example: ``frozenset('ab') | " @@ -7655,7 +7925,7 @@ msgstr "" "``frozenset('ab') | set('bc')`` επιστρέφει ένα στιγμιότυπο του :class:" "`frozenset`." -#: library/stdtypes.rst:4370 +#: library/stdtypes.rst:4519 msgid "" "The following table lists operations available for :class:`set` that do not " "apply to immutable instances of :class:`frozenset`:" @@ -7663,32 +7933,32 @@ msgstr "" "Ο παρακάτω πίνακας παραθέτει λειτουργίες που είναι διαθέσιμες για :class:" "`set` που δεν ισχύουν για αμετάβλητα στιγμιότυπα της :class:`frozenset`:" -#: library/stdtypes.rst:4376 +#: library/stdtypes.rst:4525 msgid "Update the set, adding elements from all others." msgstr "Ενημερώνει το σύνολο (set), προσθέτοντας στοιχεία από όλα τα άλλα." -#: library/stdtypes.rst:4381 +#: library/stdtypes.rst:4530 msgid "Update the set, keeping only elements found in it and all others." msgstr "" "Ενημερώνει το σύνολο, διατηρώντας μόνο τα στοιχεία που βρίσκονται σε αυτό " "και όλα τα άλλα." -#: library/stdtypes.rst:4386 +#: library/stdtypes.rst:4535 msgid "Update the set, removing elements found in others." msgstr "Ενημερώνει το σύνολο, αφαιρώντας στοιχεία που βρίσκονται σε άλλα." -#: library/stdtypes.rst:4391 +#: library/stdtypes.rst:4540 msgid "" "Update the set, keeping only elements found in either set, but not in both." msgstr "" "Ενημερώνει το σύνολο, διατηρώντας μόνο τα στοιχεία που βρίσκονται σε κάθε " "σύνολο, αλλά όχι και στα δύο." -#: library/stdtypes.rst:4395 +#: library/stdtypes.rst:4544 msgid "Add element *elem* to the set." msgstr "Προσθέτει το στοιχείο *elem* στο σύνολο." -#: library/stdtypes.rst:4399 +#: library/stdtypes.rst:4548 msgid "" "Remove element *elem* from the set. Raises :exc:`KeyError` if *elem* is not " "contained in the set." @@ -7696,11 +7966,11 @@ msgstr "" "Αφαιρεί το στοιχείο *elem* από το σύνολο. Κάνει raise τη :exc:`KeyError` " "εάν το *elem* δεν περιέχεται στο σύνολο." -#: library/stdtypes.rst:4404 +#: library/stdtypes.rst:4553 msgid "Remove element *elem* from the set if it is present." msgstr "Αφαιρεί το στοιχείο *elem* από το σύνολο εάν υπάρχει." -#: library/stdtypes.rst:4408 +#: library/stdtypes.rst:4557 msgid "" "Remove and return an arbitrary element from the set. Raises :exc:`KeyError` " "if the set is empty." @@ -7708,11 +7978,11 @@ msgstr "" "Αφαιρεί και επιστρέφει ένα αυθαίρετο στοιχείο από το σύνολο. Κάνει raise " "μια :exc:`KeyError` εάν το σύνολο είναι κενό." -#: library/stdtypes.rst:4413 +#: library/stdtypes.rst:4562 msgid "Remove all elements from the set." msgstr "Αφαιρεί όλα τα στοιχεία από το σύνολο (set)." -#: library/stdtypes.rst:4416 +#: library/stdtypes.rst:4565 msgid "" "Note, the non-operator versions of the :meth:`update`, :meth:" "`intersection_update`, :meth:`difference_update`, and :meth:" @@ -7724,7 +7994,7 @@ msgstr "" "`symmetric_difference_update` θα δέχονται οποιοδήποτε επαναλαμβανόμενο " "στοιχείο ως όρισμα." -#: library/stdtypes.rst:4421 +#: library/stdtypes.rst:4570 msgid "" "Note, the *elem* argument to the :meth:`~object.__contains__`, :meth:" "`remove`, and :meth:`discard` methods may be a set. To support searching " @@ -7735,11 +8005,11 @@ msgstr "" "υποστήριξη της αναζήτησης για ένα ισοδύναμο παγωμένο σύνολο (frozenset), ένα " "προσωρινό δημιουργείται από το *elem*." -#: library/stdtypes.rst:4430 +#: library/stdtypes.rst:4579 msgid "Mapping Types --- :class:`dict`" msgstr "Τύποι αντιστοίχισης --- :class:`dict`" -#: library/stdtypes.rst:4440 +#: library/stdtypes.rst:4589 msgid "" "A :term:`mapping` object maps :term:`hashable` values to arbitrary objects. " "Mappings are mutable objects. There is currently only one standard mapping " @@ -7754,7 +8024,7 @@ msgstr "" "class:`list`, :class:`set`, και :class:`tuple` κλάσεις, και το module :mod:" "`collections`.)" -#: library/stdtypes.rst:4446 +#: library/stdtypes.rst:4595 msgid "" "A dictionary's keys are *almost* arbitrary values. Values that are not :" "term:`hashable`, that is, values containing lists, dictionaries or other " @@ -7769,7 +8039,7 @@ msgstr "" "συγκρίνονται ίσες (όπως ``1``, ``1.0``, και ``True``) μπορούν να " "χρησιμοποιηθούν εναλλακτικά για το index της ίδιας καταχώρισης λεξικού." -#: library/stdtypes.rst:4457 +#: library/stdtypes.rst:4606 msgid "" "Return a new dictionary initialized from an optional positional argument and " "a possibly empty set of keyword arguments." @@ -7777,11 +8047,11 @@ msgstr "" "Επιστρέφει ένα νέο λεξικό που έχει αρχικοποιηθεί από ένα προαιρετικό όρισμα " "θέσης και ένα πιθανό κενό σύνολο ορισμάτων λέξεων-κλειδιών." -#: library/stdtypes.rst:4460 +#: library/stdtypes.rst:4609 msgid "Dictionaries can be created by several means:" msgstr "Τα λεξικά μπορούν να δημιουργηθούν με διάφορους τρόπους:" -#: library/stdtypes.rst:4462 +#: library/stdtypes.rst:4611 msgid "" "Use a comma-separated list of ``key: value`` pairs within braces: ``{'jack': " "4098, 'sjoerd': 4127}`` or ``{4098: 'jack', 4127: 'sjoerd'}``" @@ -7790,13 +8060,13 @@ msgstr "" "σε αγκύλες: ``{'jack': 4098, 'sjoerd': 4127}`` or ``{4098: 'jack', 4127: " "'sjoerd'}``" -#: library/stdtypes.rst:4464 +#: library/stdtypes.rst:4613 msgid "Use a dict comprehension: ``{}``, ``{x: x ** 2 for x in range(10)}``" msgstr "" "Χρησιμοποιήστε ένα comprehension λεξικού: ``{}``, ``{x: x ** 2 for x in " "range(10)}``" -#: library/stdtypes.rst:4465 +#: library/stdtypes.rst:4614 msgid "" "Use the type constructor: ``dict()``, ``dict([('foo', 100), ('bar', " "200)])``, ``dict(foo=100, bar=200)``" @@ -7804,7 +8074,7 @@ msgstr "" "Χρησιμοποιήστε τον κατασκευαστή τύπου: ``dict()``, ``dict([('foo', 100), " "('bar', 200)])``, ``dict(foo=100, bar=200)``" -#: library/stdtypes.rst:4468 +#: library/stdtypes.rst:4617 msgid "" "If no positional argument is given, an empty dictionary is created. If a " "positional argument is given and it defines a ``keys()`` method, a " @@ -7826,7 +8096,7 @@ msgstr "" "τιμή. Εάν ένα κλειδί εμφανίζεται περισσότερες από μία φορές, η τελευταία " "τιμή για αυτό το κλειδί γίνεται η αντίστοιχη τιμή στο νέο λεξικό." -#: library/stdtypes.rst:4478 +#: library/stdtypes.rst:4627 msgid "" "If keyword arguments are given, the keyword arguments and their values are " "added to the dictionary created from the positional argument. If a key " @@ -7838,7 +8108,7 @@ msgstr "" "Εάν υπάρχει ήδη ένα κλειδί που προστίθεται, η τιμή από το όρισμα λέξης-" "κλειδιού αντικαθιστά την τιμή από το όρισμα θέσης." -#: library/stdtypes.rst:4483 +#: library/stdtypes.rst:4632 msgid "" "To illustrate, the following examples all return a dictionary equal to " "``{\"one\": 1, \"two\": 2, \"three\": 3}``::" @@ -7846,7 +8116,7 @@ msgstr "" "Για επεξήγηση, τα ακόλουθα παραδείγματα επιστρέφουν όλα ένα λεξικό ίσο με " "``{\"one\": 1, \"two\": 2, \"three\": 3}``::" -#: library/stdtypes.rst:4486 +#: library/stdtypes.rst:4635 msgid "" ">>> a = dict(one=1, two=2, three=3)\n" ">>> b = {'one': 1, 'two': 2, 'three': 3}\n" @@ -7866,7 +8136,7 @@ msgstr "" ">>> a == b == c == d == e == f\n" "True" -#: library/stdtypes.rst:4495 +#: library/stdtypes.rst:4644 msgid "" "Providing keyword arguments as in the first example only works for keys that " "are valid Python identifiers. Otherwise, any valid keys can be used." @@ -7875,7 +8145,7 @@ msgstr "" "για κλειδιά που είναι έγκυρα αναγνωριστικά Python. Διαφορετικά, μπορούν να " "χρησιμοποιηθούν οποιαδήποτε έγκυρα κλειδιά." -#: library/stdtypes.rst:4499 +#: library/stdtypes.rst:4648 msgid "" "These are the operations that dictionaries support (and therefore, custom " "mapping types should support too):" @@ -7883,16 +8153,16 @@ msgstr "" "Αυτές είναι οι λειτουργίες που υποστηρίζουν τα λεξικά (και επομένως, θα " "πρέπει να υποστηρίζουν και προσαρμοσμένους τύπους αντιστοίχισης επίσης):" -#: library/stdtypes.rst:4504 +#: library/stdtypes.rst:4653 msgid "Return a list of all the keys used in the dictionary *d*." msgstr "" "Επιστρέφει μια λίστα με όλα τα κλειδιά που χρησιμοποιούνται στο λεξικό *d*." -#: library/stdtypes.rst:4508 +#: library/stdtypes.rst:4657 msgid "Return the number of items in the dictionary *d*." msgstr "Επιστρέφει τον αριθμό των στοιχείων στο λεξικό *d*." -#: library/stdtypes.rst:4512 +#: library/stdtypes.rst:4661 msgid "" "Return the item of *d* with key *key*. Raises a :exc:`KeyError` if *key* is " "not in the map." @@ -7900,7 +8170,7 @@ msgstr "" "Επιστρέφει το στοιχείο του *d* με το κλειδί *key*. Κάνει raise μια :exc:" "`KeyError` εάν το *key* δεν υπάρχει για να αντιστοιχηθεί." -#: library/stdtypes.rst:4517 +#: library/stdtypes.rst:4666 msgid "" "If a subclass of dict defines a method :meth:`__missing__` and *key* is not " "present, the ``d[key]`` operation calls that method with the key *key* as " @@ -7919,7 +8189,7 @@ msgstr "" "exc:`KeyError`. To :meth:`__missing__` πρέπει να είναι μέθοδος∙ δεν μπορεί " "να είναι ένα στιγμιότυπο μεταβλητής::" -#: library/stdtypes.rst:4525 +#: library/stdtypes.rst:4674 msgid "" ">>> class Counter(dict):\n" "... def __missing__(self, key):\n" @@ -7943,7 +8213,7 @@ msgstr "" ">>> c['red']\n" "1" -#: library/stdtypes.rst:4536 +#: library/stdtypes.rst:4685 msgid "" "The example above shows part of the implementation of :class:`collections." "Counter`. A different ``__missing__`` method is used by :class:`collections." @@ -7953,11 +8223,11 @@ msgstr "" "Counter`. Μια διαφορετική μέθοδος ``__missing__`` χρησιμοποιείται από την :" "class:`collections.defaultdict`." -#: library/stdtypes.rst:4542 +#: library/stdtypes.rst:4691 msgid "Set ``d[key]`` to *value*." msgstr "Ορίζει το ``d[key]`` στο *value*." -#: library/stdtypes.rst:4546 +#: library/stdtypes.rst:4695 msgid "" "Remove ``d[key]`` from *d*. Raises a :exc:`KeyError` if *key* is not in the " "map." @@ -7965,16 +8235,16 @@ msgstr "" "Αφαιρεί το ``d[key]`` από το *d*. Κάνει raise ένα :exc:`KeyError` εάν το " "*key* δεν υπάρχει για αντιστοίχιση." -#: library/stdtypes.rst:4551 +#: library/stdtypes.rst:4700 msgid "Return ``True`` if *d* has a key *key*, else ``False``." msgstr "" "Επιστρέφει ``True`` εάν το *d* έχει ένα κλειδί *key*, διαφορετικά ``False``." -#: library/stdtypes.rst:4555 +#: library/stdtypes.rst:4704 msgid "Equivalent to ``not key in d``." msgstr "Ισοδυναμεί με ``not key in d``." -#: library/stdtypes.rst:4559 +#: library/stdtypes.rst:4708 msgid "" "Return an iterator over the keys of the dictionary. This is a shortcut for " "``iter(d.keys())``." @@ -7982,21 +8252,21 @@ msgstr "" "Επιστρέφει έναν iterator πάνω από τα κλειδιά του λεξικού. Αυτή είναι μια " "συντόμευση για ``iter(d.keys())``." -#: library/stdtypes.rst:4564 +#: library/stdtypes.rst:4713 msgid "Remove all items from the dictionary." msgstr "Αφαιρεί όλα τα στοιχεία από το λεξικό." -#: library/stdtypes.rst:4568 +#: library/stdtypes.rst:4717 msgid "Return a shallow copy of the dictionary." msgstr "Επιστρέφει ένα ρηχό αντίγραφο του λεξικού." -#: library/stdtypes.rst:4572 +#: library/stdtypes.rst:4721 msgid "" "Create a new dictionary with keys from *iterable* and values set to *value*." msgstr "" "Δημιουργεί ένα νέο λεξικό με κλειδιά από το *iterable* και τιμές ως *value*." -#: library/stdtypes.rst:4574 +#: library/stdtypes.rst:4723 msgid "" ":meth:`fromkeys` is a class method that returns a new dictionary. *value* " "defaults to ``None``. All of the values refer to just a single instance, so " @@ -8011,7 +8281,7 @@ msgstr "" "διαφορετικές τιμές, χρησιμοποιήστε αντ' αυτού ένα :ref:`dict comprehension " "`." -#: library/stdtypes.rst:4582 +#: library/stdtypes.rst:4731 msgid "" "Return the value for *key* if *key* is in the dictionary, else *default*. If " "*default* is not given, it defaults to ``None``, so that this method never " @@ -8021,7 +8291,7 @@ msgstr "" "*default*. Εάν το *default* δεν δίνεται, ορίζεται από προεπιλογή σε " "``None``, έτσι ώστε αυτή η μέθοδος να μην κάνει raise μια :exc:`KeyError`." -#: library/stdtypes.rst:4588 +#: library/stdtypes.rst:4737 msgid "" "Return a new view of the dictionary's items (``(key, value)`` pairs). See " "the :ref:`documentation of view objects `." @@ -8029,7 +8299,7 @@ msgstr "" "Επιστρέφει μια νέα όψη των στοιχείων του λεξικού (``(key, value)`` ζεύγη). " "Δείτε την :ref:`documentation of view objects `." -#: library/stdtypes.rst:4593 +#: library/stdtypes.rst:4742 msgid "" "Return a new view of the dictionary's keys. See the :ref:`documentation of " "view objects `." @@ -8037,7 +8307,7 @@ msgstr "" "Επιστρέφει μια νέα όψη των κλειδιών του λεξικού. Δείτε το :ref:" "`documentation of view objects `." -#: library/stdtypes.rst:4598 +#: library/stdtypes.rst:4747 msgid "" "If *key* is in the dictionary, remove it and return its value, else return " "*default*. If *default* is not given and *key* is not in the dictionary, a :" @@ -8047,7 +8317,7 @@ msgstr "" "διαφορετικά επιστρέφει *default*. Εάν *default* δεν δίνεται και το *key* " "δεν είναι στο λεξικό, γίνεται raise ένα :exc:`KeyError`." -#: library/stdtypes.rst:4604 +#: library/stdtypes.rst:4753 msgid "" "Remove and return a ``(key, value)`` pair from the dictionary. Pairs are " "returned in :abbr:`LIFO (last-in, first-out)` order." @@ -8055,7 +8325,7 @@ msgstr "" "Αφαιρεί και επιστρέφει ένα ζεύγος ``(key, value)`` από το λεξικό. Τα ζεύγη " "επιστρέφονται με τη σειρά :abbr:`LIFO (last-in, first-out)`." -#: library/stdtypes.rst:4607 +#: library/stdtypes.rst:4756 msgid "" ":meth:`popitem` is useful to destructively iterate over a dictionary, as " "often used in set algorithms. If the dictionary is empty, calling :meth:" @@ -8065,7 +8335,7 @@ msgstr "" "λεξικό, όπως χρησιμοποιείται συχνά σε αλγόριθμους συνόλου. Εάν το λεξικό " "είναι κενό, η κλήση της :meth:`popitem` κάνει raise ένα :exc:`KeyError`." -#: library/stdtypes.rst:4611 +#: library/stdtypes.rst:4760 msgid "" "LIFO order is now guaranteed. In prior versions, :meth:`popitem` would " "return an arbitrary key/value pair." @@ -8073,7 +8343,7 @@ msgstr "" "Η σειρά LIFO είναι πλέον εγγυημένη. Σε προηγούμενες εκδόσεις, η :meth:" "`popitem` επιστρέφει ένα αυθαίρετο ζεύγος κλειδιού/τιμής." -#: library/stdtypes.rst:4617 +#: library/stdtypes.rst:4766 msgid "" "Return a reverse iterator over the keys of the dictionary. This is a " "shortcut for ``reversed(d.keys())``." @@ -8081,7 +8351,7 @@ msgstr "" "Επιστρέφει έναν αντίστροφο iterator πάνω από τα κλειδιά του λεξικού. Αυτή " "είναι μια συντόμευση για ``reversed(d.keys())``." -#: library/stdtypes.rst:4624 +#: library/stdtypes.rst:4773 msgid "" "If *key* is in the dictionary, return its value. If not, insert *key* with " "a value of *default* and return *default*. *default* defaults to ``None``." @@ -8090,7 +8360,7 @@ msgstr "" "εισάγετε το *key* με τιμή *default* και επιστρέφει *default*. Το *default* " "από προεπιλογή είναι ``None``." -#: library/stdtypes.rst:4630 +#: library/stdtypes.rst:4779 msgid "" "Update the dictionary with the key/value pairs from *other*, overwriting " "existing keys. Return ``None``." @@ -8098,7 +8368,7 @@ msgstr "" "Ενημερώνει το λεξικό με τα ζεύγη κλειδιών/τιμών από το *other*, " "αντικαθιστώντας τα υπάρχοντα κλειδιά. Επιστρέφει ``None``." -#: library/stdtypes.rst:4633 +#: library/stdtypes.rst:4782 msgid "" ":meth:`update` accepts either another object with a ``keys()`` method (in " "which case :meth:`~object.__getitem__` is called with every key returned " @@ -8113,7 +8383,7 @@ msgstr "" "κλειδιών, το λεξικό ενημερώνεται στη συνέχεια με αυτά τα ζεύγη κλειδιών/" "τιμών: ``d.update(red=1, blue=2)``." -#: library/stdtypes.rst:4641 +#: library/stdtypes.rst:4790 msgid "" "Return a new view of the dictionary's values. See the :ref:`documentation " "of view objects `." @@ -8121,7 +8391,7 @@ msgstr "" "Επιστρέφει μια νέα όψη των τιμών του λεξικού. Δείτε την :ref:`documentation " "of view objects `." -#: library/stdtypes.rst:4644 +#: library/stdtypes.rst:4793 msgid "" "An equality comparison between one ``dict.values()`` view and another will " "always return ``False``. This also applies when comparing ``dict.values()`` " @@ -8131,7 +8401,7 @@ msgstr "" "επιστρέφει πάντα ``False``. Αυτό ισχύει επίσης όταν συγκρίνετε το ``dict." "values()`` με τον εαυτό της::" -#: library/stdtypes.rst:4648 +#: library/stdtypes.rst:4797 msgid "" ">>> d = {'a': 1}\n" ">>> d.values() == d.values()\n" @@ -8141,7 +8411,7 @@ msgstr "" ">>> d.values() == d.values()\n" "False" -#: library/stdtypes.rst:4654 +#: library/stdtypes.rst:4803 msgid "" "Create a new dictionary with the merged keys and values of *d* and *other*, " "which must both be dictionaries. The values of *other* take priority when " @@ -8151,7 +8421,7 @@ msgstr "" "και *other*, τα οποία πρέπει να είναι και τα δύο λεξικά. Οι τιμές του " "*other* έχουν προτεραιότητα όταν τα κλειδιά των *d* και *other* είναι κοινά." -#: library/stdtypes.rst:4662 +#: library/stdtypes.rst:4811 msgid "" "Update the dictionary *d* with keys and values from *other*, which may be " "either a :term:`mapping` or an :term:`iterable` of key/value pairs. The " @@ -8162,7 +8432,7 @@ msgstr "" "τιμές του *other* έχουν προτεραιότητα όταν τα κλειδιά των το *d* και *other* " "είναι κοινά." -#: library/stdtypes.rst:4668 +#: library/stdtypes.rst:4817 msgid "" "Dictionaries compare equal if and only if they have the same ``(key, " "value)`` pairs (regardless of ordering). Order comparisons ('<', '<=', '>=', " @@ -8172,7 +8442,7 @@ msgstr "" "value)`` (ανεξάρτητα από τη σειρά). Οι συγκρίσεις διάταξης ('<', '<=', '>=', " "'>') κάνουν raise την :exc:`TypeError`." -#: library/stdtypes.rst:4672 +#: library/stdtypes.rst:4821 msgid "" "Dictionaries preserve insertion order. Note that updating a key does not " "affect the order. Keys added after deletion are inserted at the end. ::" @@ -8181,7 +8451,7 @@ msgstr "" "κλειδιού δεν επηρεάζει τη σειρά. Τα κλειδιά που προστέθηκαν μετά τη " "διαγραφή εισάγονται στο τέλος. ::" -#: library/stdtypes.rst:4675 +#: library/stdtypes.rst:4824 msgid "" ">>> d = {\"one\": 1, \"two\": 2, \"three\": 3, \"four\": 4}\n" ">>> d\n" @@ -8213,7 +8483,7 @@ msgstr "" ">>> d\n" "{'one': 42, 'three': 3, 'four': 4, 'two': None}" -#: library/stdtypes.rst:4690 +#: library/stdtypes.rst:4839 msgid "" "Dictionary order is guaranteed to be insertion order. This behavior was an " "implementation detail of CPython from 3.6." @@ -8221,11 +8491,11 @@ msgstr "" "Η σειρά λεξικού είναι εγγυημένη ότι είναι η σειρά εισαγωγής. Αυτή η " "συμπεριφορά ήταν μια λεπτομέρεια υλοποίηση της CPython από την έκδοση 3.6." -#: library/stdtypes.rst:4694 +#: library/stdtypes.rst:4843 msgid "Dictionaries and dictionary views are reversible. ::" msgstr "Τα λεξικά και οι όψεις λεξικών είναι αναστρέψιμες. ::" -#: library/stdtypes.rst:4696 +#: library/stdtypes.rst:4845 msgid "" ">>> d = {\"one\": 1, \"two\": 2, \"three\": 3, \"four\": 4}\n" ">>> d\n" @@ -8247,11 +8517,11 @@ msgstr "" ">>> list(reversed(d.items()))\n" "[('four', 4), ('three', 3), ('two', 2), ('one', 1)]" -#: library/stdtypes.rst:4706 +#: library/stdtypes.rst:4855 msgid "Dictionaries are now reversible." msgstr "Τα λεξικά είναι πλέον αναστρέψιμα." -#: library/stdtypes.rst:4711 +#: library/stdtypes.rst:4860 msgid "" ":class:`types.MappingProxyType` can be used to create a read-only view of a :" "class:`dict`." @@ -8259,11 +8529,11 @@ msgstr "" "Η :class:`types.MappingProxyType` μπορεί να χρησιμοποιηθεί για τη δημιουργία " "μιας όψης μόνο για ανάγνωση μιας :class:`dict`." -#: library/stdtypes.rst:4718 +#: library/stdtypes.rst:4867 msgid "Dictionary view objects" msgstr "Αντικείμενα όψης λεξικού" -#: library/stdtypes.rst:4720 +#: library/stdtypes.rst:4869 msgid "" "The objects returned by :meth:`dict.keys`, :meth:`dict.values` and :meth:" "`dict.items` are *view objects*. They provide a dynamic view on the " @@ -8275,7 +8545,7 @@ msgstr "" "Παρέχουν μια δυναμική όψη στις εγγραφές του λεξικού, που σημαίνει ότι όταν " "αλλάζει το λεξικό, η όψη αντικατοπτρίζει αυτές τις αλλαγές." -#: library/stdtypes.rst:4725 +#: library/stdtypes.rst:4874 msgid "" "Dictionary views can be iterated over to yield their respective data, and " "support membership tests:" @@ -8283,11 +8553,11 @@ msgstr "" "Οι όψεις λεξικού μπορούν να γίνουν iterate για την απόδοση των αντίστοιχων " "δεδομένων τους και την υποστήριξη ελέγχων για το αν είναι μέρος του:" -#: library/stdtypes.rst:4730 +#: library/stdtypes.rst:4879 msgid "Return the number of entries in the dictionary." msgstr "Επιστρέφει τον αριθμό των καταχωρήσεων στο λεξικό." -#: library/stdtypes.rst:4734 +#: library/stdtypes.rst:4883 msgid "" "Return an iterator over the keys, values or items (represented as tuples of " "``(key, value)``) in the dictionary." @@ -8295,7 +8565,7 @@ msgstr "" "Επιστρέφει έναν iterator πάνω στα κλειδιά, τις τιμές ή τα στοιχεία (που " "αντιπροσωπεύονται ως πλειάδες (tuples) του ``(key, value)`` στο λεξικό." -#: library/stdtypes.rst:4737 +#: library/stdtypes.rst:4886 msgid "" "Keys and values are iterated over in insertion order. This allows the " "creation of ``(value, key)`` pairs using :func:`zip`: ``pairs = zip(d." @@ -8308,7 +8578,7 @@ msgstr "" "δημιουργήσετε την ίδια λίστα είναι ``pairs = [(v, k) for (k, v) in d." "items()]``." -#: library/stdtypes.rst:4742 +#: library/stdtypes.rst:4891 msgid "" "Iterating views while adding or deleting entries in the dictionary may raise " "a :exc:`RuntimeError` or fail to iterate over all entries." @@ -8317,11 +8587,11 @@ msgstr "" "μπορεί να κάνει raise μια :exc:`RuntimeError` ή να αποτύχει το iterate σε " "όλες τις καταχωρήσεις." -#: library/stdtypes.rst:4745 +#: library/stdtypes.rst:4894 msgid "Dictionary order is guaranteed to be insertion order." msgstr "Η σειρά λεξικού είναι εγγυημένη σειρά εισαγωγής." -#: library/stdtypes.rst:4750 +#: library/stdtypes.rst:4899 msgid "" "Return ``True`` if *x* is in the underlying dictionary's keys, values or " "items (in the latter case, *x* should be a ``(key, value)`` tuple)." @@ -8330,7 +8600,7 @@ msgstr "" "ή τα στοιχεία του υποκείμενου λεξικού (στην τελευταία περίπτωση, το *x* θα " "πρέπει να είναι μια ``(key, value)`` πλειάδα (tuple))." -#: library/stdtypes.rst:4755 +#: library/stdtypes.rst:4904 msgid "" "Return a reverse iterator over the keys, values or items of the dictionary. " "The view will be iterated in reverse order of the insertion." @@ -8339,11 +8609,11 @@ msgstr "" "στοιχεία του λεξικού. Η όψη θα γίνει iterate με την αντίστροφη σειρά από την " "εισαγωγή." -#: library/stdtypes.rst:4758 +#: library/stdtypes.rst:4907 msgid "Dictionary views are now reversible." msgstr "Οι όψεις λεξικού είναι πλέον αναστρέψιμες." -#: library/stdtypes.rst:4763 +#: library/stdtypes.rst:4912 msgid "" "Return a :class:`types.MappingProxyType` that wraps the original dictionary " "to which the view refers." @@ -8351,7 +8621,7 @@ msgstr "" "Επιστρέφει μια :class:`types.MappingProxyType` που αναδιπλώνει το αρχικό " "λεξικό στο οποίο αναφέρεται η όψη." -#: library/stdtypes.rst:4768 +#: library/stdtypes.rst:4917 msgid "" "Keys views are set-like since their entries are unique and :term:`hashable`. " "Items views also have set-like operations since the (key, value) pairs are " @@ -8377,11 +8647,11 @@ msgstr "" "όψεις που μοιάζουν με σύνολο δέχονται οποιοδήποτε iterable ως άλλο τελεστή, " "σε αντίθεση με τα σύνολα που δέχονται μόνο σύνολα ως είσοδο." -#: library/stdtypes.rst:4780 +#: library/stdtypes.rst:4929 msgid "An example of dictionary view usage::" msgstr "Ένα παράδειγμα χρήσης όψης λεξικού::" -#: library/stdtypes.rst:4782 +#: library/stdtypes.rst:4931 msgid "" ">>> dishes = {'eggs': 2, 'sausage': 1, 'bacon': 1, 'spam': 500}\n" ">>> keys = dishes.keys()\n" @@ -8459,11 +8729,11 @@ msgstr "" ">>> values.mapping['spam']\n" "500" -#: library/stdtypes.rst:4824 +#: library/stdtypes.rst:4973 msgid "Context Manager Types" msgstr "Τύποι Διαχείρισης Περιεχομένου" -#: library/stdtypes.rst:4831 +#: library/stdtypes.rst:4980 msgid "" "Python's :keyword:`with` statement supports the concept of a runtime context " "defined by a context manager. This is implemented using a pair of methods " @@ -8477,7 +8747,7 @@ msgstr "" "εισάγεται πριν από την εκτέλεση του σώματος της δήλωσης και να κάνει έξοδο " "όταν τερματιστεί η δήλωση:" -#: library/stdtypes.rst:4839 +#: library/stdtypes.rst:4988 msgid "" "Enter the runtime context and return either this object or another object " "related to the runtime context. The value returned by this method is bound " @@ -8489,7 +8759,7 @@ msgstr "" "επιστρέφεται από αυτήν την μέθοδο είναι δεσμευμένη στο αναγνωριστικό στην " "πρόταση :keyword:`!as` των δηλώσεων :keyword:`with` διαχείρισης περιεχομένου." -#: library/stdtypes.rst:4844 +#: library/stdtypes.rst:4993 msgid "" "An example of a context manager that returns itself is a :term:`file " "object`. File objects return themselves from __enter__() to allow :func:" @@ -8500,7 +8770,7 @@ msgstr "" "__enter__() για να επιτρέψουν στο :func:`open` να χρησιμοποιηθεί ως έκφραση " "περιεχομένου σε μια δήλωση :keyword:`with`." -#: library/stdtypes.rst:4848 +#: library/stdtypes.rst:4997 msgid "" "An example of a context manager that returns a related object is the one " "returned by :func:`decimal.localcontext`. These managers set the active " @@ -8517,7 +8787,7 @@ msgstr "" "πλαίσιο στο σώμα της δήλωσης :keyword:`with`, χωρίς να επηρεάζεται ο κώδικας " "εκτός της δήλωσης :keyword:`!with`." -#: library/stdtypes.rst:4858 +#: library/stdtypes.rst:5007 msgid "" "Exit the runtime context and return a Boolean flag indicating if any " "exception that occurred should be suppressed. If an exception occurred while " @@ -8532,7 +8802,7 @@ msgstr "" "και τις πληροφορίες ανίχνευσης. Διαφορετικά, και τα τρία ορίσματα είναι " "``None``." -#: library/stdtypes.rst:4863 +#: library/stdtypes.rst:5012 msgid "" "Returning a true value from this method will cause the :keyword:`with` " "statement to suppress the exception and continue execution with the " @@ -8550,7 +8820,7 @@ msgstr "" "μεθόδου θα αντικαταστήσουν κάθε εξαίρεση που προέκυψε στο σώμα της δήλωσης :" "keyword:`!with`." -#: library/stdtypes.rst:4870 +#: library/stdtypes.rst:5019 msgid "" "The exception passed in should never be reraised explicitly - instead, this " "method should return a false value to indicate that the method completed " @@ -8565,7 +8835,7 @@ msgstr "" "περιεχομένου να εντοπίζει εύκολα εάν μια μέθοδος :meth:`~object.__exit__` " "έχει πράγματι αποτύχει." -#: library/stdtypes.rst:4876 +#: library/stdtypes.rst:5025 msgid "" "Python defines several context managers to support easy thread " "synchronisation, prompt closure of files or other objects, and simpler " @@ -8580,7 +8850,7 @@ msgstr "" "τους πρωτοκόλλου διαχείρισης περιεχομένου. Δείτε το module :mod:`contextlib` " "για μερικά παραδείγματα." -#: library/stdtypes.rst:4882 +#: library/stdtypes.rst:5031 msgid "" "Python's :term:`generator`\\s and the :class:`contextlib.contextmanager` " "decorator provide a convenient way to implement these protocols. If a " @@ -8597,7 +8867,7 @@ msgstr "" "__enter__` και :meth:`~contextmanager.__exit__`, αντί του iterator που " "παράγεται από μια undecorated συνάρτηση γεννήτριας." -#: library/stdtypes.rst:4889 +#: library/stdtypes.rst:5038 msgid "" "Note that there is no specific slot for any of these methods in the type " "structure for Python objects in the Python/C API. Extension types wanting to " @@ -8612,7 +8882,7 @@ msgstr "" "της ρύθμισης στο πλαίσιο του χρόνου εκτέλεσης, η επιβάρυνση μιας απλής " "αναζήτησης κλάσης λεξικού είναι αμελητέα." -#: library/stdtypes.rst:4897 +#: library/stdtypes.rst:5046 msgid "" "Type Annotation Types --- :ref:`Generic Alias `, :ref:" "`Union `" @@ -8620,7 +8890,7 @@ msgstr "" "Τύποι Annotation τύπου --- :ref:`Generic Alias `, :ref:" "`Union `" -#: library/stdtypes.rst:4902 +#: library/stdtypes.rst:5051 msgid "" "The core built-in types for :term:`type annotations ` are :ref:" "`Generic Alias ` and :ref:`Union `." @@ -8629,11 +8899,11 @@ msgstr "" "είναι :ref:`Generic Alias ` και :ref:`Union `." -#: library/stdtypes.rst:4909 +#: library/stdtypes.rst:5058 msgid "Generic Alias Type" msgstr "Τύπος Generic Alias" -#: library/stdtypes.rst:4915 +#: library/stdtypes.rst:5064 msgid "" "``GenericAlias`` objects are generally created by :ref:`subscripting " "` a class. They are most often used with :ref:`container " @@ -8650,7 +8920,7 @@ msgstr "" "Τα αντικείμενα ``GenericAlias`` προορίζονται κυρίως για χρήση με :term:`type " "annotations `." -#: library/stdtypes.rst:4925 +#: library/stdtypes.rst:5074 msgid "" "It is generally only possible to subscript a class if the class implements " "the special method :meth:`~object.__class_getitem__`." @@ -8658,7 +8928,7 @@ msgstr "" "Γενικά είναι δυνατή η εγγραφή μιας κλάσης μόνο εάν η κλάση εφαρμόζει την " "ειδική μέθοδο :meth:`~object.__class_getitem__`." -#: library/stdtypes.rst:4928 +#: library/stdtypes.rst:5077 msgid "" "A ``GenericAlias`` object acts as a proxy for a :term:`generic type`, " "implementing *parameterized generics*." @@ -8666,7 +8936,7 @@ msgstr "" "Ένα αντικείμενο ``GenericAlias`` λειτουργεί ως διακομιστής μεσολάβησης " "(proxy) για έναν :term:`generic type`, υλοποιώντας *parameterized generics*." -#: library/stdtypes.rst:4931 +#: library/stdtypes.rst:5080 msgid "" "For a container class, the argument(s) supplied to a :ref:`subscription " "` of the class may indicate the type(s) of the elements an " @@ -8681,7 +8951,7 @@ msgstr "" "υποδηλώσει ένα :class:`set` στο οποίο όλα τα στοιχεία είναι τύπου :class:" "`bytes`." -#: library/stdtypes.rst:4937 +#: library/stdtypes.rst:5086 msgid "" "For a class which defines :meth:`~object.__class_getitem__` but is not a " "container, the argument(s) supplied to a subscription of the class will " @@ -8696,7 +8966,7 @@ msgstr "" "expressions ` μπορούν να χρησιμοποιηθούν τόσο στον τύπο δεδομένων :class:" "`str` όσο και στον τύπο δεδομένων :class:`bytes`:" -#: library/stdtypes.rst:4943 +#: library/stdtypes.rst:5092 msgid "" "If ``x = re.search('foo', 'foo')``, ``x`` will be a :ref:`re.Match ` object where the return values of ``x.group(0)`` and ``x[0]`` will " @@ -8709,7 +8979,7 @@ msgstr "" "αναπαραστήσουμε αυτό το είδος αντικειμένου σε σχολιασμούς τύπου με το " "``GenericAlias`` ``re.Match[str]``." -#: library/stdtypes.rst:4949 +#: library/stdtypes.rst:5098 msgid "" "If ``y = re.search(b'bar', b'bar')``, (note the ``b`` for :class:`bytes`), " "``y`` will also be an instance of ``re.Match``, but the return values of ``y." @@ -8724,7 +8994,7 @@ msgstr "" "ποικιλία αντικειμένων :ref:`re.Match ` με το ``re." "Match[bytes]``." -#: library/stdtypes.rst:4955 +#: library/stdtypes.rst:5104 msgid "" "``GenericAlias`` objects are instances of the class :class:`types." "GenericAlias`, which can also be used to create ``GenericAlias`` objects " @@ -8734,7 +9004,7 @@ msgstr "" "GenericAlias`, τα οποία μπορούν επίσης να χρησιμοποιηθούν για την δημιουργία " "αντικειμένων ``GenericAlias`` απευθείας." -#: library/stdtypes.rst:4961 +#: library/stdtypes.rst:5110 msgid "" "Creates a ``GenericAlias`` representing a type ``T`` parameterized by types " "*X*, *Y*, and more depending on the ``T`` used. For example, a function " @@ -8745,7 +9015,7 @@ msgstr "" "χρησιμοποιείται. Για παράδειγμα, μια συνάρτηση που αναμένει μια :class:" "`list` που περιέχει στοιχεία της :class:`float`::" -#: library/stdtypes.rst:4966 +#: library/stdtypes.rst:5115 msgid "" "def average(values: list[float]) -> float:\n" " return sum(values) / len(values)" @@ -8753,7 +9023,7 @@ msgstr "" "def average(values: list[float]) -> float:\n" " return sum(values) / len(values)" -#: library/stdtypes.rst:4969 +#: library/stdtypes.rst:5118 msgid "" "Another example for :term:`mapping` objects, using a :class:`dict`, which is " "a generic type expecting two type parameters representing the key type and " @@ -8766,7 +9036,7 @@ msgstr "" "παράδειγμα, η συνάρτηση αναμένει ένα ``dict`` με κλειδιά τύπου :class:`str` " "και τιμές τύπου :class:`int`::" -#: library/stdtypes.rst:4974 +#: library/stdtypes.rst:5123 msgid "" "def send_post_request(url: str, body: dict[str, int]) -> None:\n" " ..." @@ -8774,7 +9044,7 @@ msgstr "" "def send_post_request(url: str, body: dict[str, int]) -> None:\n" " ..." -#: library/stdtypes.rst:4977 +#: library/stdtypes.rst:5126 msgid "" "The builtin functions :func:`isinstance` and :func:`issubclass` do not " "accept ``GenericAlias`` types for their second argument::" @@ -8783,7 +9053,7 @@ msgstr "" "`issubclass` δεν δέχονται τους τύπους ``GenericAlias`` για το δεύτερο όρισμά " "τους::" -#: library/stdtypes.rst:4980 +#: library/stdtypes.rst:5129 msgid "" ">>> isinstance([1, 2], list[str])\n" "Traceback (most recent call last):\n" @@ -8795,7 +9065,7 @@ msgstr "" " File \"\", line 1, in \n" "TypeError: isinstance() argument 2 cannot be a parameterized generic" -#: library/stdtypes.rst:4985 +#: library/stdtypes.rst:5134 msgid "" "The Python runtime does not enforce :term:`type annotations `. " "This extends to generic types and their type parameters. When creating a " @@ -8810,7 +9080,7 @@ msgstr "" "τους. Για παράδειγμα, ο ακόλουθος κώδικας αποθαρρύνεται, αλλά θα εκτελεστεί " "χωρίς σφάλματα::" -#: library/stdtypes.rst:4991 +#: library/stdtypes.rst:5140 msgid "" ">>> t = list[str]\n" ">>> t([1, 2, 3])\n" @@ -8820,7 +9090,7 @@ msgstr "" ">>> t([1, 2, 3])\n" "[1, 2, 3]" -#: library/stdtypes.rst:4995 +#: library/stdtypes.rst:5144 msgid "" "Furthermore, parameterized generics erase type parameters during object " "creation::" @@ -8828,7 +9098,7 @@ msgstr "" "Επιπλέον, τα παραμετροποιημένα generics διαγράφουν τις παραμέτρους τύπου " "κατά τη δημιουργία αντικειμένου::" -#: library/stdtypes.rst:4998 +#: library/stdtypes.rst:5147 msgid "" ">>> t = list[str]\n" ">>> type(t)\n" @@ -8846,7 +9116,7 @@ msgstr "" ">>> type(l)\n" "" -#: library/stdtypes.rst:5006 +#: library/stdtypes.rst:5155 msgid "" "Calling :func:`repr` or :func:`str` on a generic shows the parameterized " "type::" @@ -8854,7 +9124,7 @@ msgstr "" "Η κλήση :func:`repr` ή :func:`str` σε ένα generic δείχνει τον " "παραμετροποιημένο τύπο::" -#: library/stdtypes.rst:5008 +#: library/stdtypes.rst:5157 msgid "" ">>> repr(list[int])\n" "'list[int]'\n" @@ -8868,7 +9138,7 @@ msgstr "" ">>> str(list[int])\n" "'list[int]'" -#: library/stdtypes.rst:5014 +#: library/stdtypes.rst:5163 msgid "" "The :meth:`~object.__getitem__` method of generic containers will raise an " "exception to disallow mistakes like ``dict[str][str]``::" @@ -8876,7 +9146,7 @@ msgstr "" "Η μέθοδος :meth:`~object.__getitem__` των generic containers θα κάνει raise " "μια εξαίρεση για την απαγόρευση λαθών όπως ``dict[str][str]``::" -#: library/stdtypes.rst:5017 +#: library/stdtypes.rst:5166 msgid "" ">>> dict[str][str]\n" "Traceback (most recent call last):\n" @@ -8888,7 +9158,7 @@ msgstr "" " ...\n" "TypeError: dict[str] is not a generic class" -#: library/stdtypes.rst:5022 +#: library/stdtypes.rst:5171 msgid "" "However, such expressions are valid when :ref:`type variables ` " "are used. The index must have as many elements as there are type variable " @@ -8899,7 +9169,7 @@ msgstr "" "στοιχεία όσα και τα στοιχεία μεταβλητής τύπου στο αντικείμενο " "``GenericAlias`` :attr:`~genericalias.__args__`. ::" -#: library/stdtypes.rst:5026 +#: library/stdtypes.rst:5175 msgid "" ">>> from typing import TypeVar\n" ">>> Y = TypeVar('Y')\n" @@ -8911,11 +9181,11 @@ msgstr "" ">>> dict[str, Y][int]\n" "dict[str, int]" -#: library/stdtypes.rst:5033 +#: library/stdtypes.rst:5182 msgid "Standard Generic Classes" msgstr "Τυπικές Γενικές Κλάσεις" -#: library/stdtypes.rst:5035 +#: library/stdtypes.rst:5184 msgid "" "The following standard library classes support parameterized generics. This " "list is non-exhaustive." @@ -8923,245 +9193,245 @@ msgstr "" "Οι ακόλουθες τυπικές κλάσεις βιβλιοθήκης υποστηρίζουν γενικά " "παραμετροποιημένα. Αυτή η λίστα δεν είναι εξαντλητική." -#: library/stdtypes.rst:5038 +#: library/stdtypes.rst:5187 msgid ":class:`tuple`" msgstr ":class:`tuple`" -#: library/stdtypes.rst:5039 +#: library/stdtypes.rst:5188 msgid ":class:`list`" msgstr ":class:`list`" -#: library/stdtypes.rst:5040 +#: library/stdtypes.rst:5189 msgid ":class:`dict`" msgstr ":class:`dict`" -#: library/stdtypes.rst:5041 +#: library/stdtypes.rst:5190 msgid ":class:`set`" msgstr ":class:`set`" -#: library/stdtypes.rst:5042 +#: library/stdtypes.rst:5191 msgid ":class:`frozenset`" msgstr ":class:`frozenset`" -#: library/stdtypes.rst:5043 +#: library/stdtypes.rst:5192 msgid ":class:`type`" msgstr ":class:`type`" -#: library/stdtypes.rst:5044 +#: library/stdtypes.rst:5193 msgid ":class:`asyncio.Future`" msgstr ":class:`asyncio.Future`" -#: library/stdtypes.rst:5045 +#: library/stdtypes.rst:5194 msgid ":class:`asyncio.Task`" msgstr ":class:`asyncio.Task`" -#: library/stdtypes.rst:5046 +#: library/stdtypes.rst:5195 msgid ":class:`collections.deque`" msgstr ":class:`collections.deque`" -#: library/stdtypes.rst:5047 +#: library/stdtypes.rst:5196 msgid ":class:`collections.defaultdict`" msgstr ":class:`collections.defaultdict`" -#: library/stdtypes.rst:5048 +#: library/stdtypes.rst:5197 msgid ":class:`collections.OrderedDict`" msgstr ":class:`collections.OrderedDict`" -#: library/stdtypes.rst:5049 +#: library/stdtypes.rst:5198 msgid ":class:`collections.Counter`" msgstr ":class:`collections.Counter`" -#: library/stdtypes.rst:5050 +#: library/stdtypes.rst:5199 msgid ":class:`collections.ChainMap`" msgstr ":class:`collections.ChainMap`" -#: library/stdtypes.rst:5051 +#: library/stdtypes.rst:5200 msgid ":class:`collections.abc.Awaitable`" msgstr ":class:`collections.abc.Awaitable`" -#: library/stdtypes.rst:5052 +#: library/stdtypes.rst:5201 msgid ":class:`collections.abc.Coroutine`" msgstr ":class:`collections.abc.Coroutine`" -#: library/stdtypes.rst:5053 +#: library/stdtypes.rst:5202 msgid ":class:`collections.abc.AsyncIterable`" msgstr ":class:`collections.abc.AsyncIterable`" -#: library/stdtypes.rst:5054 +#: library/stdtypes.rst:5203 msgid ":class:`collections.abc.AsyncIterator`" msgstr ":class:`collections.abc.AsyncIterator`" -#: library/stdtypes.rst:5055 +#: library/stdtypes.rst:5204 msgid ":class:`collections.abc.AsyncGenerator`" msgstr ":class:`collections.abc.AsyncGenerator`" -#: library/stdtypes.rst:5056 +#: library/stdtypes.rst:5205 msgid ":class:`collections.abc.Iterable`" msgstr ":class:`collections.abc.Iterable`" -#: library/stdtypes.rst:5057 +#: library/stdtypes.rst:5206 msgid ":class:`collections.abc.Iterator`" msgstr ":class:`collections.abc.Iterator`" -#: library/stdtypes.rst:5058 +#: library/stdtypes.rst:5207 msgid ":class:`collections.abc.Generator`" msgstr ":class:`collections.abc.Generator`" -#: library/stdtypes.rst:5059 +#: library/stdtypes.rst:5208 msgid ":class:`collections.abc.Reversible`" msgstr ":class:`collections.abc.Reversible`" -#: library/stdtypes.rst:5060 +#: library/stdtypes.rst:5209 msgid ":class:`collections.abc.Container`" msgstr ":class:`collections.abc.Container`" -#: library/stdtypes.rst:5061 +#: library/stdtypes.rst:5210 msgid ":class:`collections.abc.Collection`" msgstr ":class:`collections.abc.Collection`" -#: library/stdtypes.rst:5062 +#: library/stdtypes.rst:5211 msgid ":class:`collections.abc.Callable`" msgstr ":class:`collections.abc.Callable`" -#: library/stdtypes.rst:5063 +#: library/stdtypes.rst:5212 msgid ":class:`collections.abc.Set`" msgstr ":class:`collections.abc.Set`" -#: library/stdtypes.rst:5064 +#: library/stdtypes.rst:5213 msgid ":class:`collections.abc.MutableSet`" msgstr ":class:`collections.abc.MutableSet`" -#: library/stdtypes.rst:5065 +#: library/stdtypes.rst:5214 msgid ":class:`collections.abc.Mapping`" msgstr ":class:`collections.abc.Mapping`" -#: library/stdtypes.rst:5066 +#: library/stdtypes.rst:5215 msgid ":class:`collections.abc.MutableMapping`" msgstr ":class:`collections.abc.MutableMapping`" -#: library/stdtypes.rst:5067 +#: library/stdtypes.rst:5216 msgid ":class:`collections.abc.Sequence`" msgstr ":class:`collections.abc.Sequence`" -#: library/stdtypes.rst:5068 +#: library/stdtypes.rst:5217 msgid ":class:`collections.abc.MutableSequence`" msgstr ":class:`collections.abc.MutableSequence`" -#: library/stdtypes.rst:5069 +#: library/stdtypes.rst:5218 msgid ":class:`collections.abc.ByteString`" msgstr ":class:`collections.abc.ByteString`" -#: library/stdtypes.rst:5070 +#: library/stdtypes.rst:5219 msgid ":class:`collections.abc.MappingView`" msgstr ":class:`collections.abc.MappingView`" -#: library/stdtypes.rst:5071 +#: library/stdtypes.rst:5220 msgid ":class:`collections.abc.KeysView`" msgstr ":class:`collections.abc.KeysView`" -#: library/stdtypes.rst:5072 +#: library/stdtypes.rst:5221 msgid ":class:`collections.abc.ItemsView`" msgstr ":class:`collections.abc.ItemsView`" -#: library/stdtypes.rst:5073 +#: library/stdtypes.rst:5222 msgid ":class:`collections.abc.ValuesView`" msgstr ":class:`collections.abc.ValuesView`" -#: library/stdtypes.rst:5074 +#: library/stdtypes.rst:5223 msgid ":class:`contextlib.AbstractContextManager`" msgstr ":class:`contextlib.AbstractContextManager`" -#: library/stdtypes.rst:5075 +#: library/stdtypes.rst:5224 msgid ":class:`contextlib.AbstractAsyncContextManager`" msgstr ":class:`contextlib.AbstractAsyncContextManager`" -#: library/stdtypes.rst:5076 +#: library/stdtypes.rst:5225 msgid ":class:`dataclasses.Field`" msgstr ":class:`dataclasses.Field`" -#: library/stdtypes.rst:5077 +#: library/stdtypes.rst:5226 msgid ":class:`functools.cached_property`" msgstr ":class:`functools.cached_property`" -#: library/stdtypes.rst:5078 +#: library/stdtypes.rst:5227 msgid ":class:`functools.partialmethod`" msgstr ":class:`functools.partialmethod`" -#: library/stdtypes.rst:5079 +#: library/stdtypes.rst:5228 msgid ":class:`os.PathLike`" msgstr ":class:`os.PathLike`" -#: library/stdtypes.rst:5080 +#: library/stdtypes.rst:5229 msgid ":class:`queue.LifoQueue`" msgstr ":class:`queue.LifoQueue`" -#: library/stdtypes.rst:5081 +#: library/stdtypes.rst:5230 msgid ":class:`queue.Queue`" msgstr ":class:`queue.Queue`" -#: library/stdtypes.rst:5082 +#: library/stdtypes.rst:5231 msgid ":class:`queue.PriorityQueue`" msgstr ":class:`queue.PriorityQueue`" -#: library/stdtypes.rst:5083 +#: library/stdtypes.rst:5232 msgid ":class:`queue.SimpleQueue`" msgstr ":class:`queue.SimpleQueue`" -#: library/stdtypes.rst:5084 +#: library/stdtypes.rst:5233 msgid ":ref:`re.Pattern `" msgstr ":ref:`re.Pattern `" -#: library/stdtypes.rst:5085 +#: library/stdtypes.rst:5234 msgid ":ref:`re.Match `" msgstr ":ref:`re.Match `" -#: library/stdtypes.rst:5086 +#: library/stdtypes.rst:5235 msgid ":class:`shelve.BsdDbShelf`" msgstr ":class:`shelve.BsdDbShelf`" -#: library/stdtypes.rst:5087 +#: library/stdtypes.rst:5236 msgid ":class:`shelve.DbfilenameShelf`" msgstr ":class:`shelve.DbfilenameShelf`" -#: library/stdtypes.rst:5088 +#: library/stdtypes.rst:5237 msgid ":class:`shelve.Shelf`" msgstr ":class:`shelve.Shelf`" -#: library/stdtypes.rst:5089 +#: library/stdtypes.rst:5238 msgid ":class:`types.MappingProxyType`" msgstr ":class:`types.MappingProxyType`" -#: library/stdtypes.rst:5090 +#: library/stdtypes.rst:5239 msgid ":class:`weakref.WeakKeyDictionary`" msgstr ":class:`weakref.WeakKeyDictionary`" -#: library/stdtypes.rst:5091 +#: library/stdtypes.rst:5240 msgid ":class:`weakref.WeakMethod`" msgstr ":class:`weakref.WeakMethod`" -#: library/stdtypes.rst:5092 +#: library/stdtypes.rst:5241 msgid ":class:`weakref.WeakSet`" msgstr ":class:`weakref.WeakSet`" -#: library/stdtypes.rst:5093 +#: library/stdtypes.rst:5242 msgid ":class:`weakref.WeakValueDictionary`" msgstr ":class:`weakref.WeakValueDictionary`" -#: library/stdtypes.rst:5098 +#: library/stdtypes.rst:5247 msgid "Special Attributes of ``GenericAlias`` objects" msgstr "Ειδικά Χαρακτηριστικά αντικειμένων ``GenericAlias``" -#: library/stdtypes.rst:5100 +#: library/stdtypes.rst:5249 msgid "All parameterized generics implement special read-only attributes." msgstr "" "Όλα τα παραμετροποιημένα generics εφαρμόζουν ειδικά χαρακτηριστικά μόνο για " "ανάγνωση." -#: library/stdtypes.rst:5104 +#: library/stdtypes.rst:5253 msgid "This attribute points at the non-parameterized generic class::" msgstr "Αυτό το χαρακτηριστικό δείχνει στη μη παραμετροποιημένη γενική κλάση::" -#: library/stdtypes.rst:5106 +#: library/stdtypes.rst:5255 msgid "" ">>> list[int].__origin__\n" "" @@ -9169,7 +9439,7 @@ msgstr "" ">>> list[int].__origin__\n" "" -#: library/stdtypes.rst:5112 +#: library/stdtypes.rst:5261 msgid "" "This attribute is a :class:`tuple` (possibly of length 1) of generic types " "passed to the original :meth:`~object.__class_getitem__` of the generic " @@ -9179,7 +9449,7 @@ msgstr "" "τύπων που μεταβιβάστηκαν στο αρχικό :meth:`~object.__class_getitem__` της " "generic κλάσης::" -#: library/stdtypes.rst:5116 +#: library/stdtypes.rst:5265 msgid "" ">>> dict[str, list[int]].__args__\n" "(, list[int])" @@ -9187,7 +9457,7 @@ msgstr "" ">>> dict[str, list[int]].__args__\n" "(, list[int])" -#: library/stdtypes.rst:5122 +#: library/stdtypes.rst:5271 msgid "" "This attribute is a lazily computed tuple (possibly empty) of unique type " "variables found in ``__args__``::" @@ -9195,7 +9465,7 @@ msgstr "" "Αυτό το χαρακτηριστικό είναι μία νωχελικά υπολογισμένη πλειάδα (tuple) " "(πιθανώς κενή) μεταβλητών μοναδικού τύπου που βρίσκονται στο ``__args__``::" -#: library/stdtypes.rst:5125 +#: library/stdtypes.rst:5274 msgid "" ">>> from typing import TypeVar\n" "\n" @@ -9209,7 +9479,7 @@ msgstr "" ">>> list[T].__parameters__\n" "(~T,)" -#: library/stdtypes.rst:5133 +#: library/stdtypes.rst:5282 msgid "" "A ``GenericAlias`` object with :class:`typing.ParamSpec` parameters may not " "have correct ``__parameters__`` after substitution because :class:`typing." @@ -9220,7 +9490,7 @@ msgstr "" "επειδή το :class:`typing.ParamSpec` προορίζεται κυρίως για έλεγχο στατικού " "τύπου." -#: library/stdtypes.rst:5140 +#: library/stdtypes.rst:5289 msgid "" "A boolean that is true if the alias has been unpacked using the ``*`` " "operator (see :data:`~typing.TypeVarTuple`)." @@ -9228,19 +9498,19 @@ msgstr "" "Ένα boolean που ισχύει αν το alias έχει αποσυμπιεστεί χρησιμοποιώντας τον " "τελεστή ``*`` (δείτε το :data:`~typing.TypeVarTuple`)." -#: library/stdtypes.rst:5148 +#: library/stdtypes.rst:5297 msgid ":pep:`484` - Type Hints" msgstr ":pep:`484` - Type Hints" -#: library/stdtypes.rst:5149 +#: library/stdtypes.rst:5298 msgid "Introducing Python's framework for type annotations." msgstr "Παρουσιάζοντας το framework της Python για τύπους annotations." -#: library/stdtypes.rst:5151 +#: library/stdtypes.rst:5300 msgid ":pep:`585` - Type Hinting Generics In Standard Collections" msgstr ":pep:`585` - Τύπος Generics Συμβουλών στις Τυπικές Συλλογές" -#: library/stdtypes.rst:5152 +#: library/stdtypes.rst:5301 msgid "" "Introducing the ability to natively parameterize standard-library classes, " "provided they implement the special class method :meth:`~object." @@ -9250,7 +9520,7 @@ msgstr "" "βιβλιοθήκης, υπό την προϋπόθεση ότι εφαρμόζουν τη μέθοδο ειδικής κλάσης :" "meth:`~object.__class_getitem__`." -#: library/stdtypes.rst:5156 +#: library/stdtypes.rst:5305 msgid "" ":ref:`Generics`, :ref:`user-defined generics ` and :" "class:`typing.Generic`" @@ -9258,7 +9528,7 @@ msgstr "" "Τα :ref:`Generics`, :ref:`user-defined generics ` " "και :class:`typing.Generic`" -#: library/stdtypes.rst:5157 +#: library/stdtypes.rst:5306 msgid "" "Documentation on how to implement generic classes that can be parameterized " "at runtime and understood by static type-checkers." @@ -9267,11 +9537,11 @@ msgstr "" "παραμετροποιηθούν κατά το χρόνο εκτέλεσης και να κατανοηθούν από στατικούς " "ελεγκτές τύπων." -#: library/stdtypes.rst:5166 +#: library/stdtypes.rst:5315 msgid "Union Type" msgstr "Τύπος Ένωσης" -#: library/stdtypes.rst:5172 +#: library/stdtypes.rst:5321 msgid "" "A union object holds the value of the ``|`` (bitwise or) operation on " "multiple :ref:`type objects `. These types are intended " @@ -9285,7 +9555,7 @@ msgstr "" "έκφραση τύπου ένωσης επιτρέπει την καθαρότερη σύνταξη υπόδειξης σε σύγκριση " "με το :data:`typing.Union`." -#: library/stdtypes.rst:5179 +#: library/stdtypes.rst:5328 msgid "" "Defines a union object which holds types *X*, *Y*, and so forth. ``X | Y`` " "means either X or Y. It is equivalent to ``typing.Union[X, Y]``. For " @@ -9297,7 +9567,7 @@ msgstr "" "``typing.Union[X, Y]``. Για παράδειγμα, η ακόλουθη συνάρτηση αναμένει ένα " "όρισμα τύπου :class:`int` or :class:`float`::" -#: library/stdtypes.rst:5184 +#: library/stdtypes.rst:5333 msgid "" "def square(number: int | float) -> int | float:\n" " return number ** 2" @@ -9305,7 +9575,7 @@ msgstr "" "def square(number: int | float) -> int | float:\n" " return number ** 2" -#: library/stdtypes.rst:5189 +#: library/stdtypes.rst:5338 msgid "" "The ``|`` operand cannot be used at runtime to define unions where one or " "more members is a forward reference. For example, ``int | \"Foo\"``, where " @@ -9320,54 +9590,54 @@ msgstr "" "εκτέλεσης. Για ενώσεις που περιλαμβάνουν μπροστινές αναφορές, παρουσιάζει " "ολόκληρη την έκφραση ως συμβολοσειρά, π.χ. ``\"int | Foo\"``." -#: library/stdtypes.rst:5197 +#: library/stdtypes.rst:5346 msgid "" "Union objects can be tested for equality with other union objects. Details:" msgstr "" "Τα αντικείμενα ένωσης μπορούν να ελεγχθούν για ισότητα με άλλα αντικείμενα " "ένωσης. Λεπτομέρειες:" -#: library/stdtypes.rst:5199 +#: library/stdtypes.rst:5348 msgid "Unions of unions are flattened::" msgstr "Οι ενώσεις των ενώσεων ισοπεδώνονται::" -#: library/stdtypes.rst:5201 +#: library/stdtypes.rst:5350 msgid "(int | str) | float == int | str | float" msgstr "(int | str) | float == int | str | float" -#: library/stdtypes.rst:5203 +#: library/stdtypes.rst:5352 msgid "Redundant types are removed::" msgstr "Οι περιττοί τύποι καταργούνται::" -#: library/stdtypes.rst:5205 +#: library/stdtypes.rst:5354 msgid "int | str | int == int | str" msgstr "int | str | int == int | str" -#: library/stdtypes.rst:5207 +#: library/stdtypes.rst:5356 msgid "When comparing unions, the order is ignored::" msgstr "Κατά τη σύγκριση των ενώσεων, η σειρά αγνοείται::" -#: library/stdtypes.rst:5209 +#: library/stdtypes.rst:5358 msgid "int | str == str | int" msgstr "int | str == str | int" -#: library/stdtypes.rst:5211 +#: library/stdtypes.rst:5360 msgid "It is compatible with :data:`typing.Union`::" msgstr "Είναι συμβατό με το :data:`typing.Union`::" -#: library/stdtypes.rst:5213 +#: library/stdtypes.rst:5362 msgid "int | str == typing.Union[int, str]" msgstr "int | str == typing.Union[int, str]" -#: library/stdtypes.rst:5215 +#: library/stdtypes.rst:5364 msgid "Optional types can be spelled as a union with ``None``::" msgstr "Οι προαιρετικοί τύποι μπορούν να γραφτούν ως ένωση με ``None``::" -#: library/stdtypes.rst:5217 +#: library/stdtypes.rst:5366 msgid "str | None == typing.Optional[str]" msgstr "str | None == typing.Optional[str]" -#: library/stdtypes.rst:5222 +#: library/stdtypes.rst:5371 msgid "" "Calls to :func:`isinstance` and :func:`issubclass` are also supported with a " "union object::" @@ -9375,7 +9645,7 @@ msgstr "" "Οι κλήσεις σε :func:`isinstance` και :func:`issubclass` υποστηρίζονται " "επίσης με ένα αντικείμενο ένωσης::" -#: library/stdtypes.rst:5225 +#: library/stdtypes.rst:5374 msgid "" ">>> isinstance(\"\", int | str)\n" "True" @@ -9383,7 +9653,7 @@ msgstr "" ">>> isinstance(\"\", int | str)\n" "True" -#: library/stdtypes.rst:5228 +#: library/stdtypes.rst:5377 msgid "" "However, :ref:`parameterized generics ` in union objects " "cannot be checked::" @@ -9391,7 +9661,7 @@ msgstr "" "Ωστόσο, το :ref:`parameterized generics ` σε αντικείμενα " "ένωσης δεν μπορούν να ελεγχθούν::" -#: library/stdtypes.rst:5231 +#: library/stdtypes.rst:5380 msgid "" ">>> isinstance(1, int | list[int]) # short-circuit evaluation\n" "True\n" @@ -9407,7 +9677,7 @@ msgstr "" " ...\n" "TypeError: isinstance() argument 2 cannot be a parameterized generic" -#: library/stdtypes.rst:5238 +#: library/stdtypes.rst:5387 msgid "" "The user-exposed type for the union object can be accessed from :data:`types." "UnionType` and used for :func:`isinstance` checks. An object cannot be " @@ -9418,7 +9688,7 @@ msgstr "" "ελέγχους :func:`isinstance`. Δεν είναι δυνατή η δημιουργία ενός " "αντικειμένου από τον τύπο::" -#: library/stdtypes.rst:5242 +#: library/stdtypes.rst:5391 msgid "" ">>> import types\n" ">>> isinstance(int | str, types.UnionType)\n" @@ -9436,7 +9706,7 @@ msgstr "" " File \"\", line 1, in \n" "TypeError: cannot create 'types.UnionType' instances" -#: library/stdtypes.rst:5251 +#: library/stdtypes.rst:5400 msgid "" "The :meth:`!__or__` method for type objects was added to support the syntax " "``X | Y``. If a metaclass implements :meth:`!__or__`, the Union may " @@ -9446,7 +9716,7 @@ msgstr "" "υποστηρίξει τη σύνταξη ``X | Y``. Εάν μια μετακλάση υλοποιεί :meth:`!" "__or__`, η Ένωση μπορεί να την παρακάμψει:" -#: library/stdtypes.rst:5255 +#: library/stdtypes.rst:5404 msgid "" ">>> class M(type):\n" "... def __or__(self, other):\n" @@ -9472,16 +9742,16 @@ msgstr "" ">>> int | C\n" "int | C" -#: library/stdtypes.rst:5271 +#: library/stdtypes.rst:5420 msgid ":pep:`604` -- PEP proposing the ``X | Y`` syntax and the Union type." msgstr "" ":pep:`604` -- Το PEP προτείνει τη σύνταξη ``X | Y`` και τον τύπο Ένωση." -#: library/stdtypes.rst:5279 +#: library/stdtypes.rst:5428 msgid "Other Built-in Types" msgstr "Άλλοι Ενσωματωμένοι (built-in) Τύποι" -#: library/stdtypes.rst:5281 +#: library/stdtypes.rst:5430 msgid "" "The interpreter supports several other kinds of objects. Most of these " "support only one or two operations." @@ -9489,11 +9759,11 @@ msgstr "" "Ο διερμηνέας υποστηρίζει πολλά άλλα είδη αντικειμένων. Τα περισσότερα από " "αυτά υποστηρίζουν μόνο μία ή δύο λειτουργίες." -#: library/stdtypes.rst:5288 +#: library/stdtypes.rst:5437 msgid "Modules" msgstr "Modules" -#: library/stdtypes.rst:5290 +#: library/stdtypes.rst:5439 msgid "" "The only special operation on a module is attribute access: ``m.name``, " "where *m* is a module and *name* accesses a name defined in *m*'s symbol " @@ -9511,7 +9781,7 @@ msgstr "" "δεν απαιτεί να υπάρχει ένα αντικείμενο module με το όνομα *foo* αλλά απαιτεί " "έναν (εξωτερικό) *definition* για ένα module που ονομάζεται *foo* κάπου.)" -#: library/stdtypes.rst:5297 +#: library/stdtypes.rst:5446 msgid "" "A special attribute of every module is :attr:`~object.__dict__`. This is the " "dictionary containing the module's symbol table. Modifying this dictionary " @@ -9530,7 +9800,7 @@ msgstr "" "= {}``). Δεν συνίσταται η απευθείας τροποποίηση του :attr:`~object." "__dict__`." -#: library/stdtypes.rst:5305 +#: library/stdtypes.rst:5454 msgid "" "Modules built into the interpreter are written like this: ````. If loaded from a file, they are written as ````. Εάν φορτωθούν από ένα αρχείο, γράφονται ως " "````." -#: library/stdtypes.rst:5313 +#: library/stdtypes.rst:5462 msgid "Classes and Class Instances" msgstr "Κλάσεις και Στιγμιότυπα Κλάσης" -#: library/stdtypes.rst:5315 +#: library/stdtypes.rst:5464 msgid "See :ref:`objects` and :ref:`class` for these." msgstr "Δείτε :ref:`objects` και :ref:`class` για αυτά." -#: library/stdtypes.rst:5321 +#: library/stdtypes.rst:5470 msgid "Functions" msgstr "Συναρτήσεις" -#: library/stdtypes.rst:5323 +#: library/stdtypes.rst:5472 msgid "" "Function objects are created by function definitions. The only operation on " "a function object is to call it: ``func(argument-list)``." @@ -9561,7 +9831,7 @@ msgstr "" "λειτουργία σε ένα αντικείμενο συνάρτησης είναι να το ονομάσουμε: " "``func(argument-list)``." -#: library/stdtypes.rst:5326 +#: library/stdtypes.rst:5475 msgid "" "There are really two flavors of function objects: built-in functions and " "user-defined functions. Both support the same operation (to call the " @@ -9573,15 +9843,15 @@ msgstr "" "υποστηρίζουν την ίδια λειτουργία (για να καλέσετε τη συνάρτηση), αλλά η " "υλοποίηση είναι διαφορετική, εξ ου και οι διαφορετικοί τύποι αντικειμένων." -#: library/stdtypes.rst:5330 +#: library/stdtypes.rst:5479 msgid "See :ref:`function` for more information." msgstr "Δείτε το :ref:`function` για περισσότερες πληροφορίες." -#: library/stdtypes.rst:5336 +#: library/stdtypes.rst:5485 msgid "Methods" msgstr "Μέθοδοι" -#: library/stdtypes.rst:5340 +#: library/stdtypes.rst:5489 msgid "" "Methods are functions that are called using the attribute notation. There " "are two flavors: :ref:`built-in methods ` (such as :meth:" @@ -9594,7 +9864,7 @@ msgstr "" "method `. Οι ενσωματωμένες μέθοδοι περιγράφονται με τους " "τύπους που τις υποστηρίζουν." -#: library/stdtypes.rst:5345 +#: library/stdtypes.rst:5494 msgid "" "If you access a method (a function defined in a class namespace) through an " "instance, you get a special object: a :dfn:`bound method` (also called :ref:" @@ -9617,7 +9887,7 @@ msgstr "" "arg-2, ..., arg-n)`` είναι απολύτως ισοδύναμη με την κλήση του ``m." "__func__(m.__self__, arg-1, arg-2, ..., arg-n)``." -#: library/stdtypes.rst:5356 +#: library/stdtypes.rst:5505 msgid "" "Like :ref:`function objects `, bound method objects " "support getting arbitrary attributes. However, since method attributes are " @@ -9637,7 +9907,7 @@ msgstr "" "χαρακτηριστικό μεθόδου πρέπει να το ορίσετε ρητά στο υποκείμενο αντικείμενο " "συνάρτησης:" -#: library/stdtypes.rst:5364 +#: library/stdtypes.rst:5513 msgid "" ">>> class C:\n" "... def method(self):\n" @@ -9665,15 +9935,15 @@ msgstr "" ">>> c.method.whoami\n" "'my name is method'" -#: library/stdtypes.rst:5379 +#: library/stdtypes.rst:5528 msgid "See :ref:`instance-methods` for more information." msgstr "Δείτε το :ref:`instance-methods` για περισσότερες πληροφορίες." -#: library/stdtypes.rst:5387 +#: library/stdtypes.rst:5536 msgid "Code Objects" msgstr "Αντικείμενα Κώδικα" -#: library/stdtypes.rst:5393 +#: library/stdtypes.rst:5542 msgid "" "Code objects are used by the implementation to represent \"pseudo-compiled\" " "executable Python code such as a function body. They differ from function " @@ -9691,7 +9961,7 @@ msgstr "" "χαρακτηριστικού τους :attr:`~function.__code__`. Δείτε επίσης το module :mod:" "`code`." -#: library/stdtypes.rst:5400 +#: library/stdtypes.rst:5549 msgid "" "Accessing :attr:`~function.__code__` raises an :ref:`auditing event " "` ``object.__getattr__`` with arguments ``obj`` and " @@ -9701,7 +9971,7 @@ msgstr "" "event ` ``object.__getattr__`` με ορίσματα ``obj`` και " "``\"__code__\"``." -#: library/stdtypes.rst:5407 +#: library/stdtypes.rst:5556 msgid "" "A code object can be executed or evaluated by passing it (instead of a " "source string) to the :func:`exec` or :func:`eval` built-in functions." @@ -9710,15 +9980,15 @@ msgstr "" "(αντί για πηγαία συμβολοσειρά) στις ενσωματωμένες συναρτήσεις :func:`exec` " "ή :func:`eval`." -#: library/stdtypes.rst:5410 +#: library/stdtypes.rst:5559 msgid "See :ref:`types` for more information." msgstr "Δείτε :ref:`types` για περισσότερες πληροφορίες." -#: library/stdtypes.rst:5416 +#: library/stdtypes.rst:5565 msgid "Type Objects" msgstr "Τύποι Αντικειμένων" -#: library/stdtypes.rst:5422 +#: library/stdtypes.rst:5571 msgid "" "Type objects represent the various object types. An object's type is " "accessed by the built-in function :func:`type`. There are no special " @@ -9731,15 +10001,15 @@ msgstr "" "(standard) module :mod:`types` ορίζει ονόματα για όλους τους τυπικούς " "ενσωματωμένους τύπους." -#: library/stdtypes.rst:5427 +#: library/stdtypes.rst:5576 msgid "Types are written like this: ````." msgstr "Οι τύποι γράφονται ως εξής: ````." -#: library/stdtypes.rst:5433 +#: library/stdtypes.rst:5582 msgid "The Null Object" msgstr "Το Αντικείμενο Null" -#: library/stdtypes.rst:5435 +#: library/stdtypes.rst:5584 msgid "" "This object is returned by functions that don't explicitly return a value. " "It supports no special operations. There is exactly one null object, named " @@ -9750,15 +10020,15 @@ msgstr "" "μηδενικό αντικείμενο, που ονομάζεται ``None`` (ένα ενσωματωμένο όνομα). Το " "``type(None)()`` παράγει το ίδιο singleton." -#: library/stdtypes.rst:5439 +#: library/stdtypes.rst:5588 msgid "It is written as ``None``." msgstr "Γράφεται ως ``None``." -#: library/stdtypes.rst:5446 +#: library/stdtypes.rst:5595 msgid "The Ellipsis Object" msgstr "Το αντικείμενο Ellipsis" -#: library/stdtypes.rst:5448 +#: library/stdtypes.rst:5597 msgid "" "This object is commonly used by slicing (see :ref:`slicings`). It supports " "no special operations. There is exactly one ellipsis object, named :const:" @@ -9771,15 +10041,15 @@ msgstr "" "ενσωματωμένο όνομα). Το ``type(Ellipsis)()`` παράγει το :const:`Ellipsis` " "singleton." -#: library/stdtypes.rst:5453 +#: library/stdtypes.rst:5602 msgid "It is written as ``Ellipsis`` or ``...``." msgstr "Γράφεται ως ``Ellipsis`` ή ``...``." -#: library/stdtypes.rst:5459 +#: library/stdtypes.rst:5608 msgid "The NotImplemented Object" msgstr "Το NotImplemented Αντικείμενο" -#: library/stdtypes.rst:5461 +#: library/stdtypes.rst:5610 msgid "" "This object is returned from comparisons and binary operations when they are " "asked to operate on types they don't support. See :ref:`comparisons` for " @@ -9792,15 +10062,15 @@ msgstr "" "αντικείμενο :data:`NotImplemented`. Το :code:`type(NotImplemented)()` " "παράγει το στιγμιότυπο singleton." -#: library/stdtypes.rst:5466 +#: library/stdtypes.rst:5615 msgid "It is written as :code:`NotImplemented`." msgstr "Είναι γραμμένο ως :code:`NotImplemented`." -#: library/stdtypes.rst:5472 +#: library/stdtypes.rst:5621 msgid "Internal Objects" msgstr "Εσωτερικά Αντικείμενα" -#: library/stdtypes.rst:5474 +#: library/stdtypes.rst:5623 msgid "" "See :ref:`types` for this information. It describes :ref:`stack frame " "objects `, :ref:`traceback objects `, and " @@ -9810,11 +10080,11 @@ msgstr "" "objects `, :ref:`traceback objects `, και " "αντικείμενα τμηματοποίησης." -#: library/stdtypes.rst:5482 +#: library/stdtypes.rst:5631 msgid "Special Attributes" msgstr "Ειδικά Χαρακτηριστικά" -#: library/stdtypes.rst:5484 +#: library/stdtypes.rst:5633 msgid "" "The implementation adds a few special read-only attributes to several object " "types, where they are relevant. Some of these are not reported by the :func:" @@ -9824,14 +10094,14 @@ msgstr "" "διάφορους τύπους αντικειμένων, όπου είναι σχετικά. Ορισμένα από αυτά δεν " "αναφέρονται από την ενσωματωμένη συνάρτηση :func:`dir`." -#: library/stdtypes.rst:5491 +#: library/stdtypes.rst:5640 msgid "" "The name of the class, function, method, descriptor, or generator instance." msgstr "" "Το όνομα της κλάσης, της συνάρτησης, της μεθόδου, του descriptor ή του " "στιγμιοτύπου generator." -#: library/stdtypes.rst:5497 +#: library/stdtypes.rst:5646 msgid "" "The :term:`qualified name` of the class, function, method, descriptor, or " "generator instance." @@ -9839,18 +10109,18 @@ msgstr "" "Το :term:`qualified name` της κλάσης, της συνάρτησης, της μεθόδου, του " "descriptor, ή του στιγμιοτύπου generator." -#: library/stdtypes.rst:5505 +#: library/stdtypes.rst:5654 msgid "The name of the module in which a class or function was defined." msgstr "Το όνομα του module στο οποίο ορίστηκε μια κλάση ή μια συνάρτηση." -#: library/stdtypes.rst:5510 +#: library/stdtypes.rst:5659 msgid "" "The documentation string of a class or function, or ``None`` if undefined." msgstr "" "Η συμβολοσειρά τεκμηρίωσης μιας κλάσης ή συνάρτησης ή ``None`` εάν δεν έχει " "οριστεί." -#: library/stdtypes.rst:5515 +#: library/stdtypes.rst:5664 msgid "" "The :ref:`type parameters ` of generic classes, functions, and :" "ref:`type aliases `. For classes and functions that are not " @@ -9860,11 +10130,11 @@ msgstr "" "συναρτήσεων και :ref:`type aliases `. Για κλάσεις και " "συναρτήσεις που δεν είναι γενικές, αυτή θα είναι μια κενή πλειάδα." -#: library/stdtypes.rst:5525 +#: library/stdtypes.rst:5674 msgid "Integer string conversion length limitation" msgstr "Περιορισμός μήκους μετατροπής συμβολοσειράς ακέραιου αριθμού" -#: library/stdtypes.rst:5527 +#: library/stdtypes.rst:5676 msgid "" "CPython has a global limit for converting between :class:`int` and :class:" "`str` to mitigate denial of service attacks. This limit *only* applies to " @@ -9877,7 +10147,7 @@ msgstr "" "του δύο. Οι δεξαεξαδικές, οκταδικές, και δυαδικές μετατροπές είναι " "απεριόριστες. Το όριο μπορεί να διαμορφωθεί." -#: library/stdtypes.rst:5532 +#: library/stdtypes.rst:5681 msgid "" "The :class:`int` type in CPython is an arbitrary length number stored in " "binary form (commonly known as a \"bignum\"). There exists no algorithm that " @@ -9895,14 +10165,14 @@ msgstr "" "``int('1' * 500_000)`` μπορεί να διαρκέσει περισσότερο από ένα δευτερόλεπτο " "σε μια γρήγορη CPU." -#: library/stdtypes.rst:5539 +#: library/stdtypes.rst:5688 msgid "" "Limiting conversion size offers a practical way to avoid :cve:`2020-10735`." msgstr "" "Ο περιορισμός του μεγέθους μετατροπής προσφέρει έναν πρακτικό τρόπο αποφυγής " "του :cve:`2020-10735`." -#: library/stdtypes.rst:5541 +#: library/stdtypes.rst:5690 msgid "" "The limit is applied to the number of digit characters in the input or " "output string when a non-linear conversion algorithm would be involved. " @@ -9912,13 +10182,13 @@ msgstr "" "εισόδου ή εξόδου όταν εμπλέκεται ένας μη γραμμικός αλγόριθμος μετατροπής. " "Τα underscores και το πρόσημο δεν υπολογίζονται στο όριο." -#: library/stdtypes.rst:5545 +#: library/stdtypes.rst:5694 msgid "" "When an operation would exceed the limit, a :exc:`ValueError` is raised:" msgstr "" "Όταν μια λειτουργία υπερβαίνει το όριο, γίνεται raise μια :exc:`ValueError`:" -#: library/stdtypes.rst:5547 +#: library/stdtypes.rst:5696 msgid "" ">>> import sys\n" ">>> sys.set_int_max_str_digits(4300) # Illustrative, this is the default.\n" @@ -9962,7 +10232,7 @@ msgstr "" "7144\n" ">>> assert int(hex(i_squared), base=16) == i*i # Hexadecimal is unlimited." -#: library/stdtypes.rst:5567 +#: library/stdtypes.rst:5716 msgid "" "The default limit is 4300 digits as provided in :data:`sys.int_info." "default_max_str_digits `. The lowest limit that can be " @@ -9974,11 +10244,11 @@ msgstr "" "να διαμορφωθεί είναι 640 ψηφία όπως προβλέπεται στο :data:`sys.int_info." "str_digits_check_threshold `." -#: library/stdtypes.rst:5572 +#: library/stdtypes.rst:5721 msgid "Verification:" msgstr "Επαλήθευση:" -#: library/stdtypes.rst:5574 +#: library/stdtypes.rst:5723 msgid "" ">>> import sys\n" ">>> assert sys.int_info.default_max_str_digits == 4300, sys.int_info\n" @@ -9996,11 +10266,11 @@ msgstr "" "... '571186405732').to_bytes(53, 'big')\n" "..." -#: library/stdtypes.rst:5587 +#: library/stdtypes.rst:5736 msgid "Affected APIs" msgstr "Επηρεασμένα APIs" -#: library/stdtypes.rst:5589 +#: library/stdtypes.rst:5738 msgid "" "The limitation only applies to potentially slow conversions between :class:" "`int` and :class:`str` or :class:`bytes`:" @@ -10008,23 +10278,23 @@ msgstr "" "Ο περιορισμός ισχύει μόνο για δυνητικά αργές μετατροπές μεταξύ :class:`int` " "και :class:`str` ή :class:`bytes`:" -#: library/stdtypes.rst:5592 +#: library/stdtypes.rst:5741 msgid "``int(string)`` with default base 10." msgstr "``int(string)`` με default βάση το 10." -#: library/stdtypes.rst:5593 +#: library/stdtypes.rst:5742 msgid "``int(string, base)`` for all bases that are not a power of 2." msgstr "``int(string, base)`` για όλες τις βάσεις που δεν είναι δύναμη του 2." -#: library/stdtypes.rst:5594 +#: library/stdtypes.rst:5743 msgid "``str(integer)``." msgstr "``str(integer)``." -#: library/stdtypes.rst:5595 +#: library/stdtypes.rst:5744 msgid "``repr(integer)``." msgstr "``repr(integer)``." -#: library/stdtypes.rst:5596 +#: library/stdtypes.rst:5745 msgid "" "any other string conversion to base 10, for example ``f\"{integer}\"``, " "``\"{}\".format(integer)``, or ``b\"%d\" % integer``." @@ -10032,40 +10302,40 @@ msgstr "" "οποιαδήποτε άλλη μετατροπή συμβολοσειράς στη βάση 10, για παράδειγμα " "``f\"{integer}\"``, ``\"{}\".format(integer)``, ή ``b\"%d\" % integer``." -#: library/stdtypes.rst:5599 +#: library/stdtypes.rst:5748 msgid "The limitations do not apply to functions with a linear algorithm:" msgstr "Οι περιορισμοί δεν ισχύουν για συναρτήσεις με γραμμικό αλγόριθμο:" -#: library/stdtypes.rst:5601 +#: library/stdtypes.rst:5750 msgid "``int(string, base)`` with base 2, 4, 8, 16, or 32." msgstr "``int(string, base)`` με βάση 2, 4, 8, 16, ή 32." -#: library/stdtypes.rst:5602 +#: library/stdtypes.rst:5751 msgid ":func:`int.from_bytes` and :func:`int.to_bytes`." msgstr ":func:`int.from_bytes` και :func:`int.to_bytes`." -#: library/stdtypes.rst:5603 +#: library/stdtypes.rst:5752 msgid ":func:`hex`, :func:`oct`, :func:`bin`." msgstr ":func:`hex`, :func:`oct`, :func:`bin`." -#: library/stdtypes.rst:5604 +#: library/stdtypes.rst:5753 msgid ":ref:`formatspec` for hex, octal, and binary numbers." msgstr "" ":ref:`formatspec` για δεκαεξαδικούς, οκταδικούς και δυαδικούς αριθμούς." -#: library/stdtypes.rst:5605 +#: library/stdtypes.rst:5754 msgid ":class:`str` to :class:`float`." msgstr ":class:`str` σε :class:`float`." -#: library/stdtypes.rst:5606 +#: library/stdtypes.rst:5755 msgid ":class:`str` to :class:`decimal.Decimal`." msgstr ":class:`str` σε :class:`decimal.Decimal`." -#: library/stdtypes.rst:5609 +#: library/stdtypes.rst:5758 msgid "Configuring the limit" msgstr "Διαμόρφωση ορίου" -#: library/stdtypes.rst:5611 +#: library/stdtypes.rst:5760 msgid "" "Before Python starts up you can use an environment variable or an " "interpreter command line flag to configure the limit:" @@ -10074,7 +10344,7 @@ msgstr "" "περιβάλλοντος ή ένα δείκτη γραμμής εντολών διερμηνέα για να διαμορφώσετε το " "όριο:" -#: library/stdtypes.rst:5614 +#: library/stdtypes.rst:5763 msgid "" ":envvar:`PYTHONINTMAXSTRDIGITS`, e.g. ``PYTHONINTMAXSTRDIGITS=640 python3`` " "to set the limit to 640 or ``PYTHONINTMAXSTRDIGITS=0 python3`` to disable " @@ -10084,7 +10354,7 @@ msgstr "" "για να ορίσετε το όριο σε 640 ή ``PYTHONINTMAXSTRDIGITS=0 python3`` για να " "απενεργοποιήσετε τον περιορισμό." -#: library/stdtypes.rst:5617 +#: library/stdtypes.rst:5766 msgid "" ":option:`-X int_max_str_digits <-X>`, e.g. ``python3 -X " "int_max_str_digits=640``" @@ -10092,7 +10362,7 @@ msgstr "" ":option:`-X int_max_str_digits <-X>`, π.χ. ``python3 -X " "int_max_str_digits=640``" -#: library/stdtypes.rst:5619 +#: library/stdtypes.rst:5768 msgid "" ":data:`sys.flags.int_max_str_digits` contains the value of :envvar:" "`PYTHONINTMAXSTRDIGITS` or :option:`-X int_max_str_digits <-X>`. If both the " @@ -10107,7 +10377,7 @@ msgstr "" "επομένως χρησιμοποιήθηκε μια τιμή :data:`sys.int_info." "default_max_str_digits` κατά την προετοιμασία." -#: library/stdtypes.rst:5625 +#: library/stdtypes.rst:5774 msgid "" "From code, you can inspect the current limit and set a new one using these :" "mod:`sys` APIs:" @@ -10115,7 +10385,7 @@ msgstr "" "Από τον κώδικα, μπορείτε να επιθεωρήσετε το τρέχον όριο και να ορίσετε ένα " "νέο χρησιμοποιώντας αυτά τα :mod:`sys` APIs:" -#: library/stdtypes.rst:5628 +#: library/stdtypes.rst:5777 msgid "" ":func:`sys.get_int_max_str_digits` and :func:`sys.set_int_max_str_digits` " "are a getter and setter for the interpreter-wide limit. Subinterpreters have " @@ -10125,7 +10395,7 @@ msgstr "" "είναι ένας getter και setter για το όριο σε όλο τον διερμηνέα. Οι " "δευτερεύοντες διερμηνείς έχουν το δικό τους όριο." -#: library/stdtypes.rst:5632 +#: library/stdtypes.rst:5781 msgid "" "Information about the default and minimum can be found in :data:`sys." "int_info`:" @@ -10133,7 +10403,7 @@ msgstr "" "Πληροφορίες σχετικά με την προεπιλογή και το ελάχιστο μπορούν να βρεθούν " "στο :data:`sys.int_info`:" -#: library/stdtypes.rst:5634 +#: library/stdtypes.rst:5783 msgid "" ":data:`sys.int_info.default_max_str_digits ` is the compiled-" "in default limit." @@ -10141,7 +10411,7 @@ msgstr "" "Το :data:`sys.int_info.default_max_str_digits ` είναι το " "μεταγλωττισμένο προεπιλεγμένο όριο." -#: library/stdtypes.rst:5636 +#: library/stdtypes.rst:5785 msgid "" ":data:`sys.int_info.str_digits_check_threshold ` is the lowest " "accepted value for the limit (other than 0 which disables it)." @@ -10149,7 +10419,7 @@ msgstr "" "Το :data:`sys.int_info.str_digits_check_threshold ` είναι η " "χαμηλότερη αποδεκτή τιμή για το όριο (εκτός από το 0 που το απενεργοποιεί)." -#: library/stdtypes.rst:5643 +#: library/stdtypes.rst:5792 msgid "" "Setting a low limit *can* lead to problems. While rare, code exists that " "contains integer constants in decimal in their source that exceed the " @@ -10170,7 +10440,7 @@ msgstr "" "τον κώδικα. Μια λύση για τον πηγαίο που περιέχει τόσο μεγάλες σταθερές είναι " "να τις μετατρέψετε σε δεκαεξαδική μορφή ``0x`` καθώς δεν έχει όριο." -#: library/stdtypes.rst:5652 +#: library/stdtypes.rst:5801 msgid "" "Test your application thoroughly if you use a low limit. Ensure your tests " "run with the limit set early via the environment or flag so that it applies " @@ -10184,11 +10454,11 @@ msgstr "" "καλέσει την Python για να μεταγλωττίσει εκ των προτέρων το ``.py`` πηγαίο σε " "αρχεία ``.pyc``." -#: library/stdtypes.rst:5658 +#: library/stdtypes.rst:5807 msgid "Recommended configuration" msgstr "Προτεινόμενη διαμόρφωση" -#: library/stdtypes.rst:5660 +#: library/stdtypes.rst:5809 msgid "" "The default :data:`sys.int_info.default_max_str_digits` is expected to be " "reasonable for most applications. If your application requires a different " @@ -10201,11 +10471,11 @@ msgstr "" "τον συμβατό με τον κώδικα της έκδοσης Python, καθώς αυτά τα API προστέθηκαν " "στην ενημερωμένη έκδοση κώδικα ασφαλείας σε εκδόσεις πριν από την 3.12." -#: library/stdtypes.rst:5665 +#: library/stdtypes.rst:5814 msgid "Example::" msgstr "Παράδειγμα::" -#: library/stdtypes.rst:5667 +#: library/stdtypes.rst:5816 msgid "" ">>> import sys\n" ">>> if hasattr(sys, \"set_int_max_str_digits\"):\n" @@ -10227,15 +10497,15 @@ msgstr "" "... elif current_limit < lower_bound:\n" "... sys.set_int_max_str_digits(lower_bound)" -#: library/stdtypes.rst:5677 +#: library/stdtypes.rst:5826 msgid "If you need to disable it entirely, set it to ``0``." msgstr "Εάν πρέπει να το απενεργοποιήσετε εντελώς, ορίστε το σε ``0``." -#: library/stdtypes.rst:5681 +#: library/stdtypes.rst:5830 msgid "Footnotes" msgstr "Υποσημειώσεις" -#: library/stdtypes.rst:5682 +#: library/stdtypes.rst:5831 msgid "" "Additional information on these special methods may be found in the Python " "Reference Manual (:ref:`customization`)." @@ -10243,7 +10513,7 @@ msgstr "" "Πρόσθετε πληροφορίες σχετικά με αυτές τις ειδικές μεθόδους μπορείτε να " "βρείτε στο Εγχειρίδιο Αναφοράς Python (:ref:`customization`)." -#: library/stdtypes.rst:5685 +#: library/stdtypes.rst:5834 msgid "" "As a consequence, the list ``[1, 2]`` is considered equal to ``[1.0, 2.0]``, " "and similarly for tuples." @@ -10251,12 +10521,12 @@ msgstr "" "Σαν συνέπεια, η λίστα ``[1, 2]`` θεωρείται ίση με ``[1.0, 2.0]``, και ομοίως " "για πλειάδες (tuples)." -#: library/stdtypes.rst:5688 +#: library/stdtypes.rst:5837 msgid "They must have since the parser can't tell the type of the operands." msgstr "" "Πρέπει να έχουν, αφού ο parser δεν μπορεί να ξεχωρίσει τον τύπο των τελεστών." -#: library/stdtypes.rst:5690 +#: library/stdtypes.rst:5839 msgid "" "Cased characters are those with general category property being one of " "\"Lu\" (Letter, uppercase), \"Ll\" (Letter, lowercase), or \"Lt\" (Letter, " @@ -10266,7 +10536,7 @@ msgstr "" "είναι ένας από τους \"Lu\" (Γράμμα, κεφαλαίο), \"Ll\" (Γράμμα, πεζά), ή " "\"Lt\" (Γράμμα, κεφαλαία)." -#: library/stdtypes.rst:5693 +#: library/stdtypes.rst:5842 msgid "" "To format only a tuple you should therefore provide a singleton tuple whose " "only element is the tuple to be formatted." @@ -10280,11 +10550,11 @@ msgid "built-in" msgstr "ενσωματωμένοι (built-in) τύποι" #: library/stdtypes.rst:316 library/stdtypes.rst:950 library/stdtypes.rst:1139 -#: library/stdtypes.rst:4432 library/stdtypes.rst:5418 +#: library/stdtypes.rst:4581 library/stdtypes.rst:5567 msgid "types" msgstr "τύποι" -#: library/stdtypes.rst:1154 library/stdtypes.rst:4432 +#: library/stdtypes.rst:1154 library/stdtypes.rst:4581 msgid "statement" msgstr "statement" @@ -10399,9 +10669,9 @@ msgstr "is not" #: library/stdtypes.rst:208 library/stdtypes.rst:1117 library/stdtypes.rst:1260 #: library/stdtypes.rst:1383 library/stdtypes.rst:1540 -#: library/stdtypes.rst:2542 library/stdtypes.rst:4230 -#: library/stdtypes.rst:4911 library/stdtypes.rst:5338 -#: library/stdtypes.rst:5382 +#: library/stdtypes.rst:2691 library/stdtypes.rst:4379 +#: library/stdtypes.rst:5060 library/stdtypes.rst:5487 +#: library/stdtypes.rst:5531 msgid "object" msgstr "αντικείμενο" @@ -10489,8 +10759,8 @@ msgstr "δυαδικό" msgid "arithmetic" msgstr "αριθμητικό" -#: library/stdtypes.rst:950 library/stdtypes.rst:4432 library/stdtypes.rst:5403 -#: library/stdtypes.rst:5418 +#: library/stdtypes.rst:950 library/stdtypes.rst:4581 library/stdtypes.rst:5552 +#: library/stdtypes.rst:5567 msgid "built-in function" msgstr "ενσωματωμένες (built-in) συναρτήσεις" @@ -10506,7 +10776,7 @@ msgstr "float" msgid "complex" msgstr "complex" -#: library/stdtypes.rst:2399 library/stdtypes.rst:3618 +#: library/stdtypes.rst:2548 library/stdtypes.rst:3767 msgid "+ (plus)" msgstr "+ (συν)" @@ -10518,11 +10788,11 @@ msgstr "τελεστής unary" msgid "binary operator" msgstr "δυαδικός τελεστής" -#: library/stdtypes.rst:2399 library/stdtypes.rst:3618 +#: library/stdtypes.rst:2548 library/stdtypes.rst:3767 msgid "- (minus)" msgstr "- (πλην)" -#: library/stdtypes.rst:2356 library/stdtypes.rst:3575 +#: library/stdtypes.rst:2505 library/stdtypes.rst:3724 msgid "* (asterisk)" msgstr "* (αστερίσκος)" @@ -10534,7 +10804,7 @@ msgstr "/ (κάθετος)" msgid "//" msgstr "//" -#: library/stdtypes.rst:2326 library/stdtypes.rst:3543 +#: library/stdtypes.rst:2469 library/stdtypes.rst:3692 msgid "% (percent)" msgstr "% (τοις εκατό)" @@ -10542,7 +10812,7 @@ msgstr "% (τοις εκατό)" msgid "**" msgstr "**" -#: library/stdtypes.rst:393 library/stdtypes.rst:1154 library/stdtypes.rst:4432 +#: library/stdtypes.rst:393 library/stdtypes.rst:1154 library/stdtypes.rst:4581 msgid "operations on" msgstr "λειτουργίες on" @@ -10550,7 +10820,7 @@ msgstr "λειτουργίες on" msgid "conjugate() (complex number method)" msgstr "conjugate() (μέθοδος μιγαδικών αριθμών)" -#: library/stdtypes.rst:1606 library/stdtypes.rst:5418 +#: library/stdtypes.rst:1606 library/stdtypes.rst:5567 msgid "module" msgstr "module" @@ -10618,7 +10888,7 @@ msgstr "τιμές" msgid "iterator protocol" msgstr "πρωτόκολλο iterator" -#: library/stdtypes.rst:4826 +#: library/stdtypes.rst:4975 msgid "protocol" msgstr "πρωτόκολλο" @@ -10642,7 +10912,7 @@ msgstr "container" msgid "iteration over" msgstr "iteration over" -#: library/stdtypes.rst:4432 +#: library/stdtypes.rst:4581 msgid "len" msgstr "len" @@ -10718,12 +10988,12 @@ msgstr "ευμετάβλητο" msgid "list" msgstr "λίστα" -#: library/stdtypes.rst:2523 library/stdtypes.rst:2721 -#: library/stdtypes.rst:3543 +#: library/stdtypes.rst:2672 library/stdtypes.rst:2870 +#: library/stdtypes.rst:3692 msgid "bytearray" msgstr "bytearray" -#: library/stdtypes.rst:4432 library/stdtypes.rst:5418 +#: library/stdtypes.rst:4581 library/stdtypes.rst:5567 msgid "type" msgstr "τύπος" @@ -10731,7 +11001,7 @@ msgstr "τύπος" msgid "assignment" msgstr "εκχώρηση" -#: library/stdtypes.rst:4432 +#: library/stdtypes.rst:4581 msgid "del" msgstr "del" @@ -10771,7 +11041,8 @@ msgstr "reverse() (μέθοδος ακολουθίας)" msgid "range" msgstr "range" -#: library/stdtypes.rst:1553 library/stdtypes.rst:2326 +#: library/stdtypes.rst:1553 library/stdtypes.rst:2323 +#: library/stdtypes.rst:2469 msgid "string" msgstr "string" @@ -10791,16 +11062,16 @@ msgstr "(βλ. επίσης string)" msgid "io.StringIO" msgstr "io.StringIO" -#: library/stdtypes.rst:2515 +#: library/stdtypes.rst:2664 msgid "buffer protocol" msgstr "πρωτόκολλο buffer" -#: library/stdtypes.rst:2523 library/stdtypes.rst:2721 -#: library/stdtypes.rst:3543 +#: library/stdtypes.rst:2672 library/stdtypes.rst:2870 +#: library/stdtypes.rst:3692 msgid "bytes" msgstr "bytes" -#: library/stdtypes.rst:2721 +#: library/stdtypes.rst:2870 msgid "methods" msgstr "μέθοδοι" @@ -10808,183 +11079,239 @@ msgstr "μέθοδοι" msgid "re" msgstr "re" -#: library/stdtypes.rst:3397 +#: library/stdtypes.rst:3546 msgid "universal newlines" msgstr "καθολικές νέες γραμμές" -#: library/stdtypes.rst:2134 +#: library/stdtypes.rst:2137 msgid "str.splitlines method" msgstr "μέθοδος str.splitlines" -#: library/stdtypes.rst:2326 +#: library/stdtypes.rst:2323 +msgid "! formatted string literal" +msgstr "! μορφοποιημένη συμβολοσειρά κυριολεκτικής μορφής" + +#: library/stdtypes.rst:2323 +msgid "formatted string literals" +msgstr "μορφοποιημένες συμβολοσειρές κυριολεξίας" + +#: library/stdtypes.rst:2323 +msgid "! f-string" +msgstr "! f-string" + +#: library/stdtypes.rst:2323 +msgid "f-strings" +msgstr "string" + +#: library/stdtypes.rst:2323 +msgid "fstring" +msgstr "fstring" + +#: library/stdtypes.rst:2323 +msgid "interpolated string literal" +msgstr "συμβολοσειρά κυριολεξίας με παρεμβολή" + +#: library/stdtypes.rst:2323 +msgid "formatted literal" +msgstr "μορφοποιημένη κυριολεξία" + +#: library/stdtypes.rst:2323 +msgid "interpolated literal" +msgstr "κυριολεκτικό με παρεμβολή" + +#: library/stdtypes.rst:2323 +msgid "{} (curly brackets)" +msgstr "{} (αγκύλες)" + +#: library/stdtypes.rst:2323 +msgid "in formatted string literal" +msgstr "μέσα σε μορφοποιημένη συμβολοσειρά" + +#: library/stdtypes.rst:2323 +msgid "! (exclamation mark)" +msgstr "! (Θαυμαστικό)" + +#: library/stdtypes.rst:2323 +msgid ": (colon)" +msgstr ": (άνω κάτω τελεία)" + +#: library/stdtypes.rst:2323 +msgid "= (equals)" +msgstr "= (ίσο)" + +#: library/stdtypes.rst:2323 +msgid "for help in debugging using string literals" +msgstr "για βοήθεια στην αποσφαλμάτωση μέσω κυριολεκτικών συμβολοσειρών" + +#: library/stdtypes.rst:2469 msgid "formatting, string (%)" msgstr "μορφοποίηση, string (%)" -#: library/stdtypes.rst:2326 +#: library/stdtypes.rst:2469 msgid "interpolation, string (%)" msgstr "παρεμβολή, string (%)" -#: library/stdtypes.rst:2326 +#: library/stdtypes.rst:2469 msgid "formatting, printf" msgstr "μορφοποίηση, printf" -#: library/stdtypes.rst:2326 +#: library/stdtypes.rst:2469 msgid "interpolation, printf" msgstr "παρεμβολή, printf" -#: library/stdtypes.rst:3543 +#: library/stdtypes.rst:3692 msgid "printf-style formatting" msgstr "μορφοποίηση σε στυλ printf" -#: library/stdtypes.rst:3543 +#: library/stdtypes.rst:3692 msgid "sprintf-style formatting" msgstr "μορφοποίηση σε στυλ sprintf" -#: library/stdtypes.rst:3575 +#: library/stdtypes.rst:3724 msgid "() (parentheses)" msgstr "() (παρενθέσεις)" -#: library/stdtypes.rst:2399 library/stdtypes.rst:3618 +#: library/stdtypes.rst:2548 library/stdtypes.rst:3767 msgid "in printf-style formatting" msgstr "σε μορφοποίηση σε στυλ printf" -#: library/stdtypes.rst:3575 +#: library/stdtypes.rst:3724 msgid ". (dot)" msgstr ". (τελεία)" -#: library/stdtypes.rst:3618 +#: library/stdtypes.rst:3767 msgid "# (hash)" msgstr "# (δίεση)" -#: library/stdtypes.rst:3618 +#: library/stdtypes.rst:3767 msgid "space" msgstr "διάστημα" -#: library/stdtypes.rst:2515 +#: library/stdtypes.rst:2664 msgid "binary sequence types" msgstr "τύπος δυαδικών ακολουθιών" -#: library/stdtypes.rst:2523 +#: library/stdtypes.rst:2672 msgid "memoryview" msgstr "memoryview" -#: library/stdtypes.rst:2523 +#: library/stdtypes.rst:2672 msgid "array" msgstr "πίνακας" -#: library/stdtypes.rst:3397 +#: library/stdtypes.rst:3546 msgid "bytes.splitlines method" msgstr "bytes.splitlines μέθοδος" -#: library/stdtypes.rst:3397 +#: library/stdtypes.rst:3546 msgid "bytearray.splitlines method" msgstr "bytearray.splitlines μέθοδος" -#: library/stdtypes.rst:3543 +#: library/stdtypes.rst:3692 msgid "formatting" msgstr "μορφοποίηση" -#: library/stdtypes.rst:3543 +#: library/stdtypes.rst:3692 msgid "bytes (%)" msgstr "bytes (%)" -#: library/stdtypes.rst:3543 +#: library/stdtypes.rst:3692 msgid "bytearray (%)" msgstr "bytearray (%)" -#: library/stdtypes.rst:3543 +#: library/stdtypes.rst:3692 msgid "interpolation" msgstr "μεταβολή" -#: library/stdtypes.rst:4230 +#: library/stdtypes.rst:4379 msgid "set" msgstr "set" -#: library/stdtypes.rst:4432 +#: library/stdtypes.rst:4581 msgid "mapping" msgstr "αντιστοίχιση" -#: library/stdtypes.rst:4432 +#: library/stdtypes.rst:4581 msgid "dictionary" msgstr "λεξικό" -#: library/stdtypes.rst:4515 +#: library/stdtypes.rst:4664 msgid "__missing__()" msgstr "__missing__()" -#: library/stdtypes.rst:4826 +#: library/stdtypes.rst:4975 msgid "context manager" msgstr "διαχειριστής περιεχομένου" -#: library/stdtypes.rst:4826 +#: library/stdtypes.rst:4975 msgid "context management protocol" msgstr "πρωτόκολλο διαχειριστή περιεχομένου" -#: library/stdtypes.rst:4826 +#: library/stdtypes.rst:4975 msgid "context management" msgstr "διαχείριση περιεχομένου" -#: library/stdtypes.rst:4899 +#: library/stdtypes.rst:5048 msgid "annotation" msgstr "annotation" -#: library/stdtypes.rst:4899 +#: library/stdtypes.rst:5048 msgid "type annotation; type hint" msgstr "type annotation; type hint" -#: library/stdtypes.rst:4911 +#: library/stdtypes.rst:5060 msgid "GenericAlias" msgstr "GenericAlias" -#: library/stdtypes.rst:4911 +#: library/stdtypes.rst:5060 msgid "Generic" msgstr "Generic" -#: library/stdtypes.rst:4911 +#: library/stdtypes.rst:5060 msgid "Alias" msgstr "Alias" -#: library/stdtypes.rst:5168 +#: library/stdtypes.rst:5317 msgid "Union" msgstr "Ένωση" -#: library/stdtypes.rst:5168 +#: library/stdtypes.rst:5317 msgid "union" msgstr "ένωση" -#: library/stdtypes.rst:5338 +#: library/stdtypes.rst:5487 msgid "method" msgstr "μέθοδος" -#: library/stdtypes.rst:5382 +#: library/stdtypes.rst:5531 msgid "code" msgstr "κώδικας" -#: library/stdtypes.rst:5382 +#: library/stdtypes.rst:5531 msgid "code object" msgstr "αντικείμενο κώδικα" -#: library/stdtypes.rst:5389 +#: library/stdtypes.rst:5538 msgid "compile" msgstr "compile" -#: library/stdtypes.rst:5389 +#: library/stdtypes.rst:5538 msgid "__code__ (function object attribute)" msgstr "__code__ (χαρακτηριστικό αντικείμενου συνάρτησης)" -#: library/stdtypes.rst:5403 +#: library/stdtypes.rst:5552 msgid "exec" msgstr "exec" -#: library/stdtypes.rst:5403 +#: library/stdtypes.rst:5552 msgid "eval" msgstr "eval" -#: library/stdtypes.rst:5442 +#: library/stdtypes.rst:5591 msgid "..." msgstr "..." -#: library/stdtypes.rst:5442 +#: library/stdtypes.rst:5591 msgid "ellipsis literal" msgstr "ellipsis literal" diff --git a/library/string.po b/library/string.po index 05aeb34a..672f6b3a 100644 --- a/library/string.po +++ b/library/string.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" diff --git a/library/stringprep.po b/library/stringprep.po index 1a31aecb..8cc17863 100644 --- a/library/stringprep.po +++ b/library/stringprep.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" diff --git a/library/struct.po b/library/struct.po index 743f07eb..dc9c40ed 100644 --- a/library/struct.po +++ b/library/struct.po @@ -8,8 +8,8 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" -"PO-Revision-Date: 2025-03-09 16:55+0200\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" +"PO-Revision-Date: 2025-05-05 20:53+0200\n" "Last-Translator: Marios Giannopoulos \n" "Language-Team: PyGreece \n" "Language: \n" @@ -21,11 +21,11 @@ msgstr "" msgid ":mod:`!struct` --- Interpret bytes as packed binary data" msgstr ":mod:`!struct` --- Ερμηνεία bytes ως πακετοποιημένα δυαδικά δεδομένα" -#: library/struct.rst:7 +#: library/struct.rst:11 msgid "**Source code:** :source:`Lib/struct.py`" msgstr "**Πηγαίος κώδικας:** :source:`Lib/struct.py`" -#: library/struct.rst:15 +#: library/struct.rst:19 msgid "" "This module converts between Python values and C structs represented as " "Python :class:`bytes` objects. Compact :ref:`format strings `, which " @@ -203,11 +203,11 @@ msgstr "" "περισσότερους χαρακτήρες μορφοποίησης που περιγράφουν τις πραγματικές τιμές " "δεδομένων και το συμπλήρωμα." -#: library/struct.rst:121 +#: library/struct.rst:125 msgid "Byte Order, Size, and Alignment" msgstr "Διάταξη Byte, Μέγεθος και Στοίχιση" -#: library/struct.rst:123 +#: library/struct.rst:127 msgid "" "By default, C types are represented in the machine's native format and byte " "order, and properly aligned by skipping pad bytes if necessary (according to " @@ -224,7 +224,7 @@ msgstr "" "αντίστοιχης δομής της C. Το αν θα χρησιμοποιηθεί φυσική διάταξη byte και " "γέμισμα ή τυποποιημένες μορφές εξαρτάται από την εφαρμογή." -#: library/struct.rst:139 +#: library/struct.rst:143 msgid "" "Alternatively, the first character of the format string can be used to " "indicate the byte order, size and alignment of the packed data, according to " @@ -234,71 +234,71 @@ msgstr "" "χρησιμοποιηθεί για να υποδείξει τη σειρά byte, το μέγεθος και την " "ευθυγράμμιση των συσκευασμένων δεδομένων, σύμφωνα με το παρακάτω πίνακα: " -#: library/struct.rst:144 +#: library/struct.rst:148 msgid "Character" msgstr "Χαρακτήρας" -#: library/struct.rst:144 +#: library/struct.rst:148 msgid "Byte order" msgstr "Σειρά bytes" -#: library/struct.rst:144 +#: library/struct.rst:148 msgid "Size" msgstr "Μέγεθος" -#: library/struct.rst:144 +#: library/struct.rst:148 msgid "Alignment" msgstr "Στοίχιση" -#: library/struct.rst:146 +#: library/struct.rst:150 msgid "``@``" msgstr "``@``" -#: library/struct.rst:148 +#: library/struct.rst:152 msgid "native" msgstr "native" -#: library/struct.rst:148 +#: library/struct.rst:152 msgid "``=``" msgstr "``=``" -#: library/struct.rst:150 library/struct.rst:154 +#: library/struct.rst:154 library/struct.rst:158 msgid "standard" msgstr "τυπικό" -#: library/struct.rst:150 library/struct.rst:154 +#: library/struct.rst:154 library/struct.rst:158 msgid "none" msgstr "κανένα" -#: library/struct.rst:150 +#: library/struct.rst:154 msgid "``<``" msgstr "``<``" -#: library/struct.rst:150 +#: library/struct.rst:154 msgid "little-endian" msgstr "little-endian" -#: library/struct.rst:152 +#: library/struct.rst:156 msgid "``>``" msgstr "``>``" -#: library/struct.rst:152 +#: library/struct.rst:156 msgid "big-endian" msgstr "big-endian" -#: library/struct.rst:154 +#: library/struct.rst:158 msgid "``!``" msgstr "``!``" -#: library/struct.rst:154 +#: library/struct.rst:158 msgid "network (= big-endian)" msgstr "δίκτυο (= big-endian)" -#: library/struct.rst:157 +#: library/struct.rst:161 msgid "If the first character is not one of these, ``'@'`` is assumed." msgstr "Αν ο πρώτος χαρακτήρας δεν είναι ένας από αυτούς, υποτίθεται ``'@'``." -#: library/struct.rst:161 +#: library/struct.rst:165 msgid "" "The number 1023 (``0x3ff`` in hexadecimal) has the following byte " "representations:" @@ -306,19 +306,19 @@ msgstr "" "Ο αριθμός 1023 (``0x3ff`` σε δεκαεξαδική μορφή) έχει τις ακόλουθες " "αναπαραστάσεις σε byte:" -#: library/struct.rst:163 +#: library/struct.rst:167 msgid "``03 ff`` in big-endian (``>``)" msgstr "``03 ff`` σε big-endian (``>``)" -#: library/struct.rst:164 +#: library/struct.rst:168 msgid "``ff 03`` in little-endian (``<``)" msgstr "``ff 03`` σε little-endian (``<``)" -#: library/struct.rst:166 +#: library/struct.rst:170 msgid "Python example:" msgstr "Παράδειγμα Python:" -#: library/struct.rst:174 +#: library/struct.rst:178 msgid "" "Native byte order is big-endian or little-endian, depending on the host " "system. For example, Intel x86, AMD64 (x86-64), and Apple M1 are little-" @@ -331,7 +331,7 @@ msgstr "" "endian. Χρησιμοποιήστε τη μεταβλητή :data:`sys.byteorder` για να ελέγξετε το " "endianness του συστήματος σας." -#: library/struct.rst:179 +#: library/struct.rst:183 msgid "" "Native size and alignment are determined using the C compiler's ``sizeof`` " "expression. This is always combined with native byte order." @@ -340,7 +340,7 @@ msgstr "" "``sizeof`` του μεταγλωττιστή C. Αυτό συνδυάζεται πάντα με την native σειρά " "byte." -#: library/struct.rst:182 +#: library/struct.rst:186 msgid "" "Standard size depends only on the format character; see the table in the :" "ref:`format-characters` section." @@ -348,7 +348,7 @@ msgstr "" "Το τυπικό μέγεθος εξαρτάται μόνο από τον χαρακτήρα μορφοποίησης· δείτε τον " "πίνακα στην ενότητα :ref:`format-characters`." -#: library/struct.rst:185 +#: library/struct.rst:189 msgid "" "Note the difference between ``'@'`` and ``'='``: both use native byte order, " "but the size and alignment of the latter is standardized." @@ -357,7 +357,7 @@ msgstr "" "χρησιμοποιούν τη native σειρά byte, αλλά το μέγεθος και η στοίχιση του " "τελευταίου είναι τυποποιημένα. " -#: library/struct.rst:188 +#: library/struct.rst:192 msgid "" "The form ``'!'`` represents the network byte order which is always big-" "endian as defined in `IETF RFC 1700 `_." @@ -365,7 +365,7 @@ msgstr "" "Η μορφή ``'!'`` αντιπροσωπεύει τη σειρά byte του δικτύου, η οποία είναι " "πάντα big-endian όπως ορίζεται στο `IETF RFC 1700 `_." -#: library/struct.rst:191 +#: library/struct.rst:195 msgid "" "There is no way to indicate non-native byte order (force byte-swapping); use " "the appropriate choice of ``'<'`` or ``'>'``." @@ -373,11 +373,11 @@ msgstr "" "Δεν υπάρχει τρόπος να δηλωθεί non-native σειρά byte (να επιβληθεί εναλλαγή " "byte). Χρησιμοποιήστε την κατάλληλη επιλογή ``'<'`` ή ``'>'``." -#: library/struct.rst:273 +#: library/struct.rst:277 msgid "Notes:" msgstr "Σημειώσεις:" -#: library/struct.rst:196 +#: library/struct.rst:200 msgid "" "Padding is only automatically added between successive structure members. No " "padding is added at the beginning or the end of the encoded struct." @@ -386,7 +386,7 @@ msgstr "" "της δομής. Δεν προστίθεται συμπλήρωμα στην αρχή ή στο τέλος της " "κωδικοποιημένης δομής. " -#: library/struct.rst:199 +#: library/struct.rst:203 msgid "" "No padding is added when using non-native size and alignment, e.g. with '<', " "'>', '=', and '!'." @@ -394,7 +394,7 @@ msgstr "" "Δεν προστίθεται συμπλήρωμα όταν χρησιμοποιείται non-native μέγεθος και " "στοίχιση, π.χ. με '<','>', '=', και '!'." -#: library/struct.rst:202 +#: library/struct.rst:206 msgid "" "To align the end of a structure to the alignment requirement of a particular " "type, end the format with the code for that type with a repeat count of " @@ -404,11 +404,11 @@ msgstr "" "συγκεκριμένου τύπου, τελειώστε τη μορφή με τον κωδικό για αυτό τον τύπο με " "πλήθος επαναλήψεων μηδέν. Δείτε :ref:`struct-examples`." -#: library/struct.rst:210 +#: library/struct.rst:214 msgid "Format Characters" msgstr "Χαρακτήρες μορφής" -#: library/struct.rst:212 +#: library/struct.rst:216 msgid "" "Format characters have the following meaning; the conversion between C and " "Python values should be obvious given their types. The 'Standard size' " @@ -425,278 +425,278 @@ msgstr "" "native μέγεθος, το μέγεθος της συμπιεσμένης τιμής εξαρτάται από την " "πλατφόρμα." -#: library/struct.rst:220 +#: library/struct.rst:224 msgid "Format" msgstr "Μορφή" -#: library/struct.rst:220 +#: library/struct.rst:224 msgid "C Type" msgstr "Τύπος C" -#: library/struct.rst:220 +#: library/struct.rst:224 msgid "Python type" msgstr "Τύπος Python" -#: library/struct.rst:220 +#: library/struct.rst:224 msgid "Standard size" msgstr "Τυπικό μέγεθος" -#: library/struct.rst:220 +#: library/struct.rst:224 msgid "Notes" msgstr "Σημειώσεις" -#: library/struct.rst:222 +#: library/struct.rst:226 msgid "``x``" msgstr "``x``" -#: library/struct.rst:222 +#: library/struct.rst:226 msgid "pad byte" msgstr "συμπληρωματικό byte" -#: library/struct.rst:222 +#: library/struct.rst:226 msgid "no value" msgstr "καμία τιμή" -#: library/struct.rst:222 +#: library/struct.rst:226 msgid "\\(7)" msgstr "\\(7)" -#: library/struct.rst:224 +#: library/struct.rst:228 msgid "``c``" msgstr "``c``" -#: library/struct.rst:224 +#: library/struct.rst:228 msgid ":c:expr:`char`" msgstr ":c:expr:`char`" -#: library/struct.rst:224 +#: library/struct.rst:228 msgid "bytes of length 1" msgstr "bytes μήκους 1" -#: library/struct.rst:226 library/struct.rst:230 +#: library/struct.rst:230 library/struct.rst:234 msgid "1" msgstr "1" -#: library/struct.rst:226 +#: library/struct.rst:230 msgid "``b``" msgstr "``b``" -#: library/struct.rst:226 +#: library/struct.rst:230 msgid ":c:expr:`signed char`" msgstr ":c:expr:`signed char`" -#: library/struct.rst:228 library/struct.rst:234 library/struct.rst:238 -#: library/struct.rst:242 library/struct.rst:246 library/struct.rst:251 -#: library/struct.rst:263 +#: library/struct.rst:232 library/struct.rst:238 library/struct.rst:242 +#: library/struct.rst:246 library/struct.rst:250 library/struct.rst:255 +#: library/struct.rst:267 msgid "integer" msgstr "integer" -#: library/struct.rst:226 +#: library/struct.rst:230 msgid "\\(1), \\(2)" msgstr "\\(1), \\(2)" -#: library/struct.rst:228 +#: library/struct.rst:232 msgid "``B``" msgstr "``B``" -#: library/struct.rst:228 +#: library/struct.rst:232 msgid ":c:expr:`unsigned char`" msgstr ":c:expr:`unsigned char`" -#: library/struct.rst:232 library/struct.rst:236 library/struct.rst:240 -#: library/struct.rst:244 library/struct.rst:246 +#: library/struct.rst:236 library/struct.rst:240 library/struct.rst:244 +#: library/struct.rst:248 library/struct.rst:250 msgid "\\(2)" msgstr "\\(2)" -#: library/struct.rst:230 +#: library/struct.rst:234 msgid "``?``" msgstr "``?``" -#: library/struct.rst:230 +#: library/struct.rst:234 msgid ":c:expr:`_Bool`" msgstr ":c:expr:`_Bool`" -#: library/struct.rst:230 +#: library/struct.rst:234 msgid "bool" msgstr "bool" -#: library/struct.rst:230 +#: library/struct.rst:234 msgid "\\(1)" msgstr "\\(1)" -#: library/struct.rst:232 +#: library/struct.rst:236 msgid "``h``" msgstr "``h``" -#: library/struct.rst:232 +#: library/struct.rst:236 msgid ":c:expr:`short`" msgstr ":c:expr:`short`" -#: library/struct.rst:234 library/struct.rst:253 +#: library/struct.rst:238 library/struct.rst:257 msgid "2" msgstr "2" -#: library/struct.rst:234 +#: library/struct.rst:238 msgid "``H``" msgstr "``H``" -#: library/struct.rst:234 +#: library/struct.rst:238 msgid ":c:expr:`unsigned short`" msgstr ":c:expr:`unsigned short`" -#: library/struct.rst:236 +#: library/struct.rst:240 msgid "``i``" msgstr "``i``" -#: library/struct.rst:236 +#: library/struct.rst:240 msgid ":c:expr:`int`" msgstr ":c:expr:`int`" -#: library/struct.rst:238 library/struct.rst:242 library/struct.rst:255 +#: library/struct.rst:242 library/struct.rst:246 library/struct.rst:259 msgid "4" msgstr "4" -#: library/struct.rst:238 +#: library/struct.rst:242 msgid "``I``" msgstr "``I``" -#: library/struct.rst:238 +#: library/struct.rst:242 msgid ":c:expr:`unsigned int`" msgstr ":c:expr:`unsigned int`" -#: library/struct.rst:240 +#: library/struct.rst:244 msgid "``l``" msgstr "``l``" -#: library/struct.rst:240 +#: library/struct.rst:244 msgid ":c:expr:`long`" msgstr ":c:expr:`long`" -#: library/struct.rst:242 +#: library/struct.rst:246 msgid "``L``" msgstr "``L``" -#: library/struct.rst:242 +#: library/struct.rst:246 msgid ":c:expr:`unsigned long`" msgstr ":c:expr:`unsigned long`" -#: library/struct.rst:244 +#: library/struct.rst:248 msgid "``q``" msgstr "``q``" -#: library/struct.rst:244 +#: library/struct.rst:248 msgid ":c:expr:`long long`" msgstr ":c:expr:`long long`" -#: library/struct.rst:246 library/struct.rst:257 +#: library/struct.rst:250 library/struct.rst:261 msgid "8" msgstr "8" -#: library/struct.rst:246 +#: library/struct.rst:250 msgid "``Q``" msgstr "``Q``" -#: library/struct.rst:246 +#: library/struct.rst:250 msgid ":c:expr:`unsigned long long`" msgstr ":c:expr:`unsigned long long`" -#: library/struct.rst:249 +#: library/struct.rst:253 msgid "``n``" msgstr "``n``" -#: library/struct.rst:249 +#: library/struct.rst:253 msgid ":c:type:`ssize_t`" msgstr ":c:type:`ssize_t`" -#: library/struct.rst:251 +#: library/struct.rst:255 msgid "\\(3)" msgstr "\\(3)" -#: library/struct.rst:251 +#: library/struct.rst:255 msgid "``N``" msgstr "``N``" -#: library/struct.rst:251 +#: library/struct.rst:255 msgid ":c:type:`size_t`" msgstr ":c:type:`size_t`" -#: library/struct.rst:253 +#: library/struct.rst:257 msgid "``e``" msgstr "``e``" -#: library/struct.rst:253 +#: library/struct.rst:257 msgid "\\(6)" msgstr "\\(6)" -#: library/struct.rst:255 library/struct.rst:257 +#: library/struct.rst:259 library/struct.rst:261 msgid "float" msgstr "float" -#: library/struct.rst:255 library/struct.rst:257 +#: library/struct.rst:259 library/struct.rst:261 msgid "\\(4)" msgstr "\\(4)" -#: library/struct.rst:255 +#: library/struct.rst:259 msgid "``f``" msgstr "``f``" -#: library/struct.rst:255 +#: library/struct.rst:259 msgid ":c:expr:`float`" msgstr ":c:expr:`float`" -#: library/struct.rst:257 +#: library/struct.rst:261 msgid "``d``" msgstr "``d``" -#: library/struct.rst:257 +#: library/struct.rst:261 msgid ":c:expr:`double`" msgstr ":c:expr:`double`" -#: library/struct.rst:259 +#: library/struct.rst:263 msgid "``s``" msgstr "``s``" -#: library/struct.rst:261 +#: library/struct.rst:265 msgid ":c:expr:`char[]`" msgstr ":c:expr:`char[]`" -#: library/struct.rst:261 +#: library/struct.rst:265 msgid "bytes" msgstr "bytes" -#: library/struct.rst:259 +#: library/struct.rst:263 msgid "\\(9)" msgstr "\\(9)" -#: library/struct.rst:261 +#: library/struct.rst:265 msgid "``p``" msgstr "``p``" -#: library/struct.rst:261 +#: library/struct.rst:265 msgid "\\(8)" msgstr "\\(8)" -#: library/struct.rst:263 +#: library/struct.rst:267 msgid "``P``" msgstr "``P``" -#: library/struct.rst:263 +#: library/struct.rst:267 msgid ":c:expr:`void \\*`" msgstr ":c:expr:`void \\*`" -#: library/struct.rst:263 +#: library/struct.rst:267 msgid "\\(5)" msgstr "\\(5)" -#: library/struct.rst:266 +#: library/struct.rst:270 msgid "Added support for the ``'n'`` and ``'N'`` formats." msgstr "Προστέθηκε υποστήριξη για τις μορφές ``'n'`` και ``'N'``." -#: library/struct.rst:269 +#: library/struct.rst:273 msgid "Added support for the ``'e'`` format." msgstr "Προστέθηκε υποστήριξη για τη μορφή ``'e'``." -#: library/struct.rst:278 +#: library/struct.rst:282 msgid "" "The ``'?'`` conversion code corresponds to the :c:expr:`_Bool` type defined " "by C standards since C99. In standard mode, it is represented by one byte." @@ -705,7 +705,7 @@ msgstr "" "ορίζεται από τα πρότυπα C από την έκδοση C99. Σε τυπική λειτουργία, " "αναπαρίσταται από ένα byte." -#: library/struct.rst:283 +#: library/struct.rst:287 msgid "" "When attempting to pack a non-integer using any of the integer conversion " "codes, if the non-integer has a :meth:`~object.__index__` method then that " @@ -716,13 +716,13 @@ msgstr "" "διαθέτει τη μέθοδο :meth:`~object.__index__`, τότε καλείται αυτή η μέθοδος " "για τη μετατροπή του ορίσματος σε ακέραιο πριν από τη συσκευασία." -#: library/struct.rst:287 +#: library/struct.rst:291 msgid "Added use of the :meth:`~object.__index__` method for non-integers." msgstr "" "Προστέθηκε η χρήση της μεθόδου :meth:`~object.__index__` για μη ακέραιους " "αριθμούς." -#: library/struct.rst:291 +#: library/struct.rst:295 msgid "" "The ``'n'`` and ``'N'`` conversion codes are only available for the native " "size (selected as the default or with the ``'@'`` byte order character). For " @@ -734,7 +734,7 @@ msgstr "" "``'@'``). Για το τυπικό μέγεθος, μπορείτε να χρησιμοποιήσετε οποιαδήποτε από " "τις άλλες μορφές ακέραιων που ταιριάζουν στην εφαρμογή σας." -#: library/struct.rst:297 +#: library/struct.rst:301 msgid "" "For the ``'f'``, ``'d'`` and ``'e'`` conversion codes, the packed " "representation uses the IEEE 754 binary32, binary64 or binary16 format (for " @@ -746,7 +746,7 @@ msgstr "" "(αντίστοιχα για ``'f'``, ``'d'`` ή ``'e'``), ανεξάρτητα από τη μορφή κινητής " "υποδιαστολής που χρησιμοποιεί η πλατφόρμα." -#: library/struct.rst:303 +#: library/struct.rst:307 msgid "" "The ``'P'`` format character is only available for the native byte ordering " "(selected as the default or with the ``'@'`` byte order character). The byte " @@ -760,7 +760,7 @@ msgstr "" "με βάση το σύστημα. Το module struct δεν ερμηνεύει αυτό ως native σειρά, " "επομένως η μορφή ``'P'`` δεν είναι διαθέσιμη." -#: library/struct.rst:310 +#: library/struct.rst:314 msgid "" "The IEEE 754 binary16 \"half precision\" type was introduced in the 2008 " "revision of the `IEEE 754 standard `_. It has a sign " @@ -781,11 +781,11 @@ msgstr "" "Δείτε τη σελίδα της Wikipedia για τη `half-precision floating-point format " "`_ για περισσότερες πληροφορίες. " -#: library/struct.rst:320 +#: library/struct.rst:324 msgid "When packing, ``'x'`` inserts one NUL byte." msgstr "Κατά τη συσκευασία, το ``'x'`` εισάγει ένα NUL byte." -#: library/struct.rst:323 +#: library/struct.rst:327 msgid "" "The ``'p'`` format character encodes a \"Pascal string\", meaning a short " "variable-length string stored in a *fixed number of bytes*, given by the " @@ -811,7 +811,7 @@ msgstr "" "συμβολοσειρά που επιστρέφεται δεν μπορεί ποτέ να περιέχει περισσότερα από " "255 byte. " -#: library/struct.rst:335 +#: library/struct.rst:339 msgid "" "For the ``'s'`` format character, the count is interpreted as the length of " "the bytes, not a repeat count like for the other format characters; for " @@ -840,7 +840,7 @@ msgstr "" "περίπτωση, το ``'0s'`` σημαίνει μια μοναδική, κενή συμβολοσειρά (ενώ το " "``'0c'`` σημαίνει 0 χαρακτήρες). " -#: library/struct.rst:348 +#: library/struct.rst:352 msgid "" "A format character may be preceded by an integral repeat count. For " "example, the format string ``'4h'`` means exactly the same as ``'hhhh'``." @@ -849,7 +849,7 @@ msgstr "" "επαναλήψεων. Για παράδειγμα, η συμβολοσειρά μορφοποίησης ``'4h'`` σημαίνει " "ακριβώς το ίδιο με ``'hhhh'``." -#: library/struct.rst:351 +#: library/struct.rst:355 msgid "" "Whitespace characters between formats are ignored; a count and its format " "must not contain whitespace though." @@ -857,7 +857,7 @@ msgstr "" "Οι χαρακτήρες κενού μεταξύ των μορφοποιήσεων αγνοούνται· ωστόσο, ένας " "αριθμός και η μορφή του δεν πρέπει να περιέχουν κενά." -#: library/struct.rst:354 +#: library/struct.rst:358 msgid "" "When packing a value ``x`` using one of the integer formats (``'b'``, " "``'B'``, ``'h'``, ``'H'``, ``'i'``, ``'I'``, ``'l'``, ``'L'``, ``'q'``, " @@ -869,7 +869,7 @@ msgstr "" "``'L'``, ``'q'``, ``'Q'``), εάν το ``x`` είναι εκτός του έγκυρου εύρους για " "αυτήν τη μορφή, γίνεται raise μια εξαίρεση :exc:`struct.error`." -#: library/struct.rst:359 +#: library/struct.rst:363 msgid "" "Previously, some of the integer formats wrapped out-of-range values and " "raised :exc:`DeprecationWarning` instead of :exc:`struct.error`." @@ -877,7 +877,7 @@ msgstr "" "Προηγουμένως, ορισμένες από τις μορφές ακεραίων περιτύλιγαν τιμές εκτός " "εύρους και εμφάνιζαν :exc:`DeprecationWarning` αντί για :exc:`struct.error`." -#: library/struct.rst:365 +#: library/struct.rst:369 msgid "" "For the ``'?'`` format character, the return value is either :const:`True` " "or :const:`False`. When packing, the truth value of the argument object is " @@ -890,11 +890,11 @@ msgstr "" "αναπαράσταση του bool θα συσκευαστούν, και οποιαδήποτε μη μηδενική τιμή θα " "είναι ``True`` κατά την αποσυσκευασία." -#: library/struct.rst:375 +#: library/struct.rst:379 msgid "Examples" msgstr "Παραδείγματα" -#: library/struct.rst:378 +#: library/struct.rst:382 msgid "" "Native byte order examples (designated by the ``'@'`` format prefix or lack " "of any prefix character) may not match what the reader's machine produces as " @@ -905,7 +905,7 @@ msgstr "" "αντιστοιχούν σε αυτά που παράγει η μηχανή του αναγνώστη, καθώς αυτό " "εξαρτάται από την πλατφόρμα και τον μεταγλωττιστή." -#: library/struct.rst:383 +#: library/struct.rst:387 msgid "" "Pack and unpack integers of three different sizes, using big endian " "ordering::" @@ -913,7 +913,7 @@ msgstr "" "Συσκευασία και αποσυσκευασία ακεραίων τριών διαφορετικών μεγεθών, " "χρησιμοποιώντας διάταξη big endian::" -#: library/struct.rst:386 +#: library/struct.rst:390 msgid "" ">>> from struct import *\n" ">>> pack(\">bhl\", 1, 2, 3)\n" @@ -931,13 +931,13 @@ msgstr "" ">>> calcsize('>bhl')\n" "7" -#: library/struct.rst:394 +#: library/struct.rst:398 msgid "Attempt to pack an integer which is too large for the defined field::" msgstr "" "Προσπάθεια συσκευασίας ενός ακεραίου που είναι πολύ μεγάλος για το " "καθορισμένο πεδίο::" -#: library/struct.rst:396 +#: library/struct.rst:400 msgid "" ">>> pack(\">h\", 99999)\n" "Traceback (most recent call last):\n" @@ -949,14 +949,14 @@ msgstr "" " File \"\", line 1, in \n" "struct.error: 'h' format requires -32768 <= number <= 32767" -#: library/struct.rst:401 +#: library/struct.rst:405 msgid "" "Demonstrate the difference between ``'s'`` and ``'c'`` format characters::" msgstr "" "Επιδεικνύει την διαφορά μεταξύ των χαρακτήρων μορφοποίησης ``'s'`` και " "``'c'``::" -#: library/struct.rst:404 +#: library/struct.rst:408 msgid "" ">>> pack(\"@ccc\", b'1', b'2', b'3')\n" "b'123'\n" @@ -968,7 +968,7 @@ msgstr "" ">>> pack(\"@3s\", b'123')\n" "b'123'" -#: library/struct.rst:409 +#: library/struct.rst:413 msgid "" "Unpacked fields can be named by assigning them to variables or by wrapping " "the result in a named tuple::" @@ -976,7 +976,7 @@ msgstr "" "Τα αποσυσκευασμένα πεδία μπορούν να ονομαστούν είτε αναθέτοντάς τα σε " "μεταβλητές είτε περιτυλίγοντάς τα σε μια ονομασμένη πλειάδα::" -#: library/struct.rst:412 +#: library/struct.rst:416 msgid "" ">>> record = b'raymond \\x32\\x12\\x08\\x01\\x08'\n" ">>> name, serialnum, school, gradelevel = unpack('<10sHHb', record)\n" @@ -994,7 +994,7 @@ msgstr "" ">>> Student._make(unpack('<10sHHb', record))\n" "Student(name=b'raymond ', serialnum=4658, school=264, gradelevel=8)" -#: library/struct.rst:420 +#: library/struct.rst:424 msgid "" "The ordering of format characters may have an impact on size in native mode " "since padding is implicit. In standard mode, the user is responsible for " @@ -1012,7 +1012,7 @@ msgstr "" "παράδειγμα, η έξοδος παράχθηκε σε έναν υπολογιστή με little endian " "αρχιτεκτονική::" -#: library/struct.rst:428 +#: library/struct.rst:432 msgid "" ">>> pack('@ci', b'#', 0x12131415)\n" "b'#\\x00\\x00\\x00\\x15\\x14\\x13\\x12'\n" @@ -1032,7 +1032,7 @@ msgstr "" ">>> calcsize('@ic')\n" "5" -#: library/struct.rst:437 +#: library/struct.rst:441 msgid "" "The following format ``'llh0l'`` results in two pad bytes being added at the " "end, assuming the platform's longs are aligned on 4-byte boundaries::" @@ -1041,7 +1041,7 @@ msgstr "" "συμπλήρωσης στο τέλος, υποθέτοντας ότι οι μακροί ακέραιοι (longs) της " "πλατφόρμας ευθυγραμμίζονται σε όρια 4-byte::" -#: library/struct.rst:440 +#: library/struct.rst:444 msgid "" ">>> pack('@llh0l', 1, 2, 3)\n" "b'\\x00\\x00\\x00\\x01\\x00\\x00\\x00\\x02\\x00\\x03\\x00\\x00'" @@ -1049,35 +1049,35 @@ msgstr "" ">>> pack('@llh0l', 1, 2, 3)\n" "b'\\x00\\x00\\x00\\x01\\x00\\x00\\x00\\x02\\x00\\x03\\x00\\x00'" -#: library/struct.rst:446 +#: library/struct.rst:450 msgid "Module :mod:`array`" msgstr "Module :mod:`array`" -#: library/struct.rst:447 +#: library/struct.rst:451 msgid "Packed binary storage of homogeneous data." msgstr "Πακεταρισμένη δυαδική αποθήκευση ομοιογενών δεδομένων." -#: library/struct.rst:449 +#: library/struct.rst:453 msgid "Module :mod:`json`" msgstr "Module :mod:`json`" -#: library/struct.rst:450 +#: library/struct.rst:454 msgid "JSON encoder and decoder." msgstr "Κωδικοποιητής και αποκωδικοποιητής JSON." -#: library/struct.rst:452 +#: library/struct.rst:456 msgid "Module :mod:`pickle`" msgstr "Module :mod:`pickle`" -#: library/struct.rst:453 +#: library/struct.rst:457 msgid "Python object serialization." msgstr "Σειριοποίηση αντικειμένων Python." -#: library/struct.rst:459 +#: library/struct.rst:463 msgid "Applications" msgstr "Εφαρμογές" -#: library/struct.rst:461 +#: library/struct.rst:465 msgid "" "Two main applications for the :mod:`struct` module exist, data interchange " "between Python and C code within an application or another application " @@ -1094,11 +1094,11 @@ msgstr "" "formats`). Γενικά, οι συμβολοσειρές μορφής που " "χρησιμοποιούνται σε αυτούς τους δύο τομείς είναι διαφορετικές." -#: library/struct.rst:472 +#: library/struct.rst:476 msgid "Native Formats" msgstr "Native Μορφές" -#: library/struct.rst:474 +#: library/struct.rst:478 msgid "" "When constructing format strings which mimic native layouts, the compiler " "and machine architecture determine byte ordering and padding. In such cases, " @@ -1117,14 +1117,14 @@ msgstr "" "επανάληψη μηδέν στο τέλος μιας συμβολοσειράς μορφοποίησης για να " "ευθυγραμμιστεί σωστά με τα όρια byte των διαδοχικών τμημάτων δεδομένων." -#: library/struct.rst:482 +#: library/struct.rst:486 msgid "" "Consider these two simple examples (on a 64-bit, little-endian machine)::" msgstr "" "Εξετάστε αυτά τα δύο απλά παραδείγματα (σε έναν 64-bit, little-endian " "υπολογιστή)::" -#: library/struct.rst:485 +#: library/struct.rst:489 msgid "" ">>> calcsize('@lhl')\n" "24\n" @@ -1136,7 +1136,7 @@ msgstr "" ">>> calcsize('@llh')\n" "18" -#: library/struct.rst:490 +#: library/struct.rst:494 msgid "" "Data is not padded to an 8-byte boundary at the end of the second format " "string without the use of extra padding. A zero-repeat format code solves " @@ -1146,7 +1146,7 @@ msgstr "" "συμβολοσειράς μορφοποίησης χωρίς τη χρήση επιπλέον συμπλήρωσης. Ένας κωδικός " "μορφοποίησης με επανάληψη μηδέν λύνει αυτό το πρόβλημα::" -#: library/struct.rst:494 +#: library/struct.rst:498 msgid "" ">>> calcsize('@llh0l')\n" "24" @@ -1154,7 +1154,7 @@ msgstr "" ">>> calcsize('@llh0l')\n" "24" -#: library/struct.rst:497 +#: library/struct.rst:501 msgid "" "The ``'x'`` format code can be used to specify the repeat, but for native " "formats it is better to use a zero-repeat format like ``'0l'``." @@ -1163,7 +1163,7 @@ msgstr "" "επανάληψη, αλλά για native μορφές είναι προτιμότερο να χρησιμοποιείται ένας " "κωδικός μορφοποίησης με επανάληψη μηδέν, όπως ``'0l'``." -#: library/struct.rst:500 +#: library/struct.rst:504 msgid "" "By default, native byte ordering and alignment is used, but it is better to " "be explicit and use the ``'@'`` prefix character." @@ -1172,11 +1172,11 @@ msgstr "" "καλύτερο να είμαστε σαφείς και να χρησιμοποιούμε τον χαρακτήρα πρόθεμα " "``'@'``." -#: library/struct.rst:507 +#: library/struct.rst:511 msgid "Standard Formats" msgstr "Τυπικές μορφές" -#: library/struct.rst:509 +#: library/struct.rst:513 msgid "" "When exchanging data beyond your process such as networking or storage, be " "precise. Specify the exact byte order, size, and alignment. Do not assume " @@ -1202,7 +1202,7 @@ msgstr "" "πρέπει να προσθέτει ρητά byte ``'x'`` όπου απαιτείται. Επανεξετάζοντας τα " "παραδείγματα από την προηγούμενη ενότητα, έχουμε::" -#: library/struct.rst:521 +#: library/struct.rst:525 msgid "" ">>> calcsize('>> pack('@llh0l', 1, 2, 3) == pack('>> calcsize('>> pack('@llh0l', 1, 2, 3) == pack(' (greater)" msgstr "> (μεγαλύτερο)" -#: library/struct.rst:132 +#: library/struct.rst:136 msgid "! (exclamation)" msgstr "! (θαυμαστικό)" -#: library/struct.rst:363 +#: library/struct.rst:367 msgid "? (question mark)" msgstr "? (ερωτηματικό)" diff --git a/library/subprocess.po b/library/subprocess.po index 570a74cf..5d7d73d7 100644 --- a/library/subprocess.po +++ b/library/subprocess.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -49,16 +49,15 @@ msgid ":pep:`324` -- PEP proposing the subprocess module" msgstr "" #: library/subprocess.rst:605 library/subprocess.rst:624 -#: library/subprocess.rst:639 library/subprocess.rst:1566 -#: includes/wasm-notavail.rst:3 +#: library/subprocess.rst:639 library/subprocess.rst:1582 +#: includes/wasm-mobile-notavail.rst:3 msgid "Availability" msgstr "" -#: includes/wasm-notavail.rst:5 +#: includes/wasm-mobile-notavail.rst:5 msgid "" -"This module does not work or is not available on WebAssembly platforms " -"``wasm32-emscripten`` and ``wasm32-wasi``. See :ref:`wasm-availability` for " -"more information." +"This module is not supported on :ref:`mobile platforms ` or :ref:`WebAssembly platforms `." msgstr "" #: library/subprocess.rst:31 @@ -175,8 +174,8 @@ msgid "" "*universal_newlines*. Added the *capture_output* parameter." msgstr "" -#: library/subprocess.rst:506 library/subprocess.rst:1238 -#: library/subprocess.rst:1301 +#: library/subprocess.rst:506 library/subprocess.rst:1254 +#: library/subprocess.rst:1317 msgid "" "Changed Windows shell search order for ``shell=True``. The current directory " "and ``%PATH%`` are replaced with ``%COMSPEC%`` and ``%SystemRoot%" @@ -377,7 +376,7 @@ msgid "" "binary streams. No encoding or line ending conversion is performed." msgstr "" -#: library/subprocess.rst:1553 library/subprocess.rst:1571 +#: library/subprocess.rst:1569 library/subprocess.rst:1587 msgid "Added the *encoding* and *errors* parameters." msgstr "" @@ -832,7 +831,7 @@ msgstr "" msgid "*encoding* and *errors* were added." msgstr "" -#: library/subprocess.rst:1296 +#: library/subprocess.rst:1312 msgid "*text* was added as a more readable alias for *universal_newlines*." msgstr "" @@ -1066,8 +1065,8 @@ msgid "" "create_subprocess_exec`." msgstr "" -#: library/subprocess.rst:852 library/subprocess.rst:1233 -#: library/subprocess.rst:1287 +#: library/subprocess.rst:852 library/subprocess.rst:1249 +#: library/subprocess.rst:1303 msgid "*timeout* was added." msgstr "" @@ -1379,52 +1378,65 @@ msgstr "" #: library/subprocess.rst:1071 msgid "" +"A :attr:`STARTUPINFO.dwFlags` parameter to specify that the *Working in " +"Background* mouse cursor will be displayed while a process is launching. " +"This is the default behavior for GUI processes." +msgstr "" + +#: library/subprocess.rst:1080 +msgid "" +"A :attr:`STARTUPINFO.dwFlags` parameter to specify that the mouse cursor " +"will not be changed when launching a process." +msgstr "" + +#: library/subprocess.rst:1087 +msgid "" "The new process has a new console, instead of inheriting its parent's " "console (the default)." msgstr "" -#: library/subprocess.rst:1076 +#: library/subprocess.rst:1092 msgid "" "A :class:`Popen` ``creationflags`` parameter to specify that a new process " "group will be created. This flag is necessary for using :func:`os.kill` on " "the subprocess." msgstr "" -#: library/subprocess.rst:1080 +#: library/subprocess.rst:1096 msgid "This flag is ignored if :data:`CREATE_NEW_CONSOLE` is specified." msgstr "" -#: library/subprocess.rst:1084 +#: library/subprocess.rst:1100 msgid "" "A :class:`Popen` ``creationflags`` parameter to specify that a new process " "will have an above average priority." msgstr "" -#: library/subprocess.rst:1091 +#: library/subprocess.rst:1107 msgid "" "A :class:`Popen` ``creationflags`` parameter to specify that a new process " "will have a below average priority." msgstr "" -#: library/subprocess.rst:1098 +#: library/subprocess.rst:1114 msgid "" "A :class:`Popen` ``creationflags`` parameter to specify that a new process " "will have a high priority." msgstr "" -#: library/subprocess.rst:1105 +#: library/subprocess.rst:1121 msgid "" "A :class:`Popen` ``creationflags`` parameter to specify that a new process " "will have an idle (lowest) priority." msgstr "" -#: library/subprocess.rst:1112 +#: library/subprocess.rst:1128 msgid "" "A :class:`Popen` ``creationflags`` parameter to specify that a new process " "will have a normal priority. (default)" msgstr "" -#: library/subprocess.rst:1119 +#: library/subprocess.rst:1135 msgid "" "A :class:`Popen` ``creationflags`` parameter to specify that a new process " "will have realtime priority. You should almost never use " @@ -1434,20 +1446,20 @@ msgid "" "perform brief tasks that should have limited interruptions." msgstr "" -#: library/subprocess.rst:1130 +#: library/subprocess.rst:1146 msgid "" "A :class:`Popen` ``creationflags`` parameter to specify that a new process " "will not create a window." msgstr "" -#: library/subprocess.rst:1137 +#: library/subprocess.rst:1153 msgid "" "A :class:`Popen` ``creationflags`` parameter to specify that a new process " "will not inherit its parent's console. This value cannot be used with " "CREATE_NEW_CONSOLE." msgstr "" -#: library/subprocess.rst:1145 +#: library/subprocess.rst:1161 msgid "" "A :class:`Popen` ``creationflags`` parameter to specify that a new process " "does not inherit the error mode of the calling process. Instead, the new " @@ -1455,43 +1467,43 @@ msgid "" "multithreaded shell applications that run with hard errors disabled." msgstr "" -#: library/subprocess.rst:1155 +#: library/subprocess.rst:1171 msgid "" "A :class:`Popen` ``creationflags`` parameter to specify that a new process " "is not associated with the job." msgstr "" -#: library/subprocess.rst:1163 +#: library/subprocess.rst:1179 msgid "Older high-level API" msgstr "" -#: library/subprocess.rst:1165 +#: library/subprocess.rst:1181 msgid "" "Prior to Python 3.5, these three functions comprised the high level API to " "subprocess. You can now use :func:`run` in many cases, but lots of existing " "code calls these functions." msgstr "" -#: library/subprocess.rst:1172 +#: library/subprocess.rst:1188 msgid "" "Run the command described by *args*. Wait for command to complete, then " "return the :attr:`~Popen.returncode` attribute." msgstr "" -#: library/subprocess.rst:1215 +#: library/subprocess.rst:1231 msgid "" "Code needing to capture stdout or stderr should use :func:`run` instead::" msgstr "" -#: library/subprocess.rst:1177 +#: library/subprocess.rst:1193 msgid "run(...).returncode" msgstr "" -#: library/subprocess.rst:1219 +#: library/subprocess.rst:1235 msgid "To suppress stdout or stderr, supply a value of :data:`DEVNULL`." msgstr "" -#: library/subprocess.rst:1221 +#: library/subprocess.rst:1237 msgid "" "The arguments shown above are merely some common ones. The full function " "signature is the same as that of the :class:`Popen` constructor - this " @@ -1499,14 +1511,14 @@ msgid "" "to that interface." msgstr "" -#: library/subprocess.rst:1228 +#: library/subprocess.rst:1244 msgid "" "Do not use ``stdout=PIPE`` or ``stderr=PIPE`` with this function. The child " "process will block if it generates enough output to a pipe to fill up the OS " "pipe buffer as the pipes are not being read from." msgstr "" -#: library/subprocess.rst:1208 +#: library/subprocess.rst:1224 msgid "" "Run command with arguments. Wait for command to complete. If the return " "code was zero then return, otherwise raise :exc:`CalledProcessError`. The :" @@ -1515,15 +1527,15 @@ msgid "" "to start the process it will propagate the exception that was raised." msgstr "" -#: library/subprocess.rst:1217 +#: library/subprocess.rst:1233 msgid "run(..., check=True)" msgstr "" -#: library/subprocess.rst:1250 +#: library/subprocess.rst:1266 msgid "Run command with arguments and return its output." msgstr "" -#: library/subprocess.rst:1252 +#: library/subprocess.rst:1268 msgid "" "If the return code was non-zero it raises a :exc:`CalledProcessError`. The :" "exc:`CalledProcessError` object will have the return code in the :attr:" @@ -1531,15 +1543,15 @@ msgid "" "`~CalledProcessError.output` attribute." msgstr "" -#: library/subprocess.rst:1257 +#: library/subprocess.rst:1273 msgid "This is equivalent to::" msgstr "" -#: library/subprocess.rst:1259 +#: library/subprocess.rst:1275 msgid "run(..., check=True, stdout=PIPE).stdout" msgstr "" -#: library/subprocess.rst:1261 +#: library/subprocess.rst:1277 msgid "" "The arguments shown above are merely some common ones. The full function " "signature is largely the same as that of :func:`run` - most arguments are " @@ -1549,27 +1561,27 @@ msgid "" "using the parent's standard input file handle." msgstr "" -#: library/subprocess.rst:1268 +#: library/subprocess.rst:1284 msgid "" "By default, this function will return the data as encoded bytes. The actual " "encoding of the output data may depend on the command being invoked, so the " "decoding to text will often need to be handled at the application level." msgstr "" -#: library/subprocess.rst:1272 +#: library/subprocess.rst:1288 msgid "" "This behaviour may be overridden by setting *text*, *encoding*, *errors*, or " "*universal_newlines* to ``True`` as described in :ref:`frequently-used-" "arguments` and :func:`run`." msgstr "" -#: library/subprocess.rst:1276 +#: library/subprocess.rst:1292 msgid "" "To also capture standard error in the result, use ``stderr=subprocess." "STDOUT``::" msgstr "" -#: library/subprocess.rst:1279 +#: library/subprocess.rst:1295 msgid "" ">>> subprocess.check_output(\n" "... \"ls non_existent_file; exit 0\",\n" @@ -1578,32 +1590,32 @@ msgid "" "'ls: non_existent_file: No such file or directory\\n'" msgstr "" -#: library/subprocess.rst:1290 +#: library/subprocess.rst:1306 msgid "Support for the *input* keyword argument was added." msgstr "" -#: library/subprocess.rst:1293 +#: library/subprocess.rst:1309 msgid "*encoding* and *errors* were added. See :func:`run` for details." msgstr "" -#: library/subprocess.rst:1311 +#: library/subprocess.rst:1327 msgid "Replacing Older Functions with the :mod:`subprocess` Module" msgstr "" -#: library/subprocess.rst:1313 +#: library/subprocess.rst:1329 msgid "" "In this section, \"a becomes b\" means that b can be used as a replacement " "for a." msgstr "" -#: library/subprocess.rst:1317 +#: library/subprocess.rst:1333 msgid "" "All \"a\" functions in this section fail (more or less) silently if the " "executed program cannot be found; the \"b\" replacements raise :exc:" "`OSError` instead." msgstr "" -#: library/subprocess.rst:1321 +#: library/subprocess.rst:1337 msgid "" "In addition, the replacements using :func:`check_output` will fail with a :" "exc:`CalledProcessError` if the requested operation produces a non-zero " @@ -1611,37 +1623,37 @@ msgid "" "output` attribute of the raised exception." msgstr "" -#: library/subprocess.rst:1326 +#: library/subprocess.rst:1342 msgid "" "In the following examples, we assume that the relevant functions have " "already been imported from the :mod:`subprocess` module." msgstr "" -#: library/subprocess.rst:1331 +#: library/subprocess.rst:1347 msgid "Replacing :program:`/bin/sh` shell command substitution" msgstr "" -#: library/subprocess.rst:1333 +#: library/subprocess.rst:1349 msgid "output=$(mycmd myarg)" msgstr "" -#: library/subprocess.rst:1348 library/subprocess.rst:1365 +#: library/subprocess.rst:1364 library/subprocess.rst:1381 msgid "becomes::" msgstr "" -#: library/subprocess.rst:1339 +#: library/subprocess.rst:1355 msgid "output = check_output([\"mycmd\", \"myarg\"])" msgstr "" -#: library/subprocess.rst:1342 +#: library/subprocess.rst:1358 msgid "Replacing shell pipeline" msgstr "" -#: library/subprocess.rst:1361 +#: library/subprocess.rst:1377 msgid "output=$(dmesg | grep hda)" msgstr "" -#: library/subprocess.rst:1350 +#: library/subprocess.rst:1366 msgid "" "p1 = Popen([\"dmesg\"], stdout=PIPE)\n" "p2 = Popen([\"grep\", \"hda\"], stdin=p1.stdout, stdout=PIPE)\n" @@ -1649,59 +1661,59 @@ msgid "" "output = p2.communicate()[0]" msgstr "" -#: library/subprocess.rst:1355 +#: library/subprocess.rst:1371 msgid "" "The ``p1.stdout.close()`` call after starting the p2 is important in order " "for p1 to receive a SIGPIPE if p2 exits before p1." msgstr "" -#: library/subprocess.rst:1358 +#: library/subprocess.rst:1374 msgid "" "Alternatively, for trusted input, the shell's own pipeline support may still " "be used directly:" msgstr "" -#: library/subprocess.rst:1367 +#: library/subprocess.rst:1383 msgid "output = check_output(\"dmesg | grep hda\", shell=True)" msgstr "" -#: library/subprocess.rst:1371 +#: library/subprocess.rst:1387 msgid "Replacing :func:`os.system`" msgstr "" -#: library/subprocess.rst:1375 +#: library/subprocess.rst:1391 msgid "" "sts = os.system(\"mycmd\" + \" myarg\")\n" "# becomes\n" "retcode = call(\"mycmd\" + \" myarg\", shell=True)" msgstr "" -#: library/subprocess.rst:1379 +#: library/subprocess.rst:1395 msgid "Notes:" msgstr "" -#: library/subprocess.rst:1381 +#: library/subprocess.rst:1397 msgid "Calling the program through the shell is usually not required." msgstr "" -#: library/subprocess.rst:1382 +#: library/subprocess.rst:1398 msgid "" "The :func:`call` return value is encoded differently to that of :func:`os." "system`." msgstr "" -#: library/subprocess.rst:1385 +#: library/subprocess.rst:1401 msgid "" "The :func:`os.system` function ignores SIGINT and SIGQUIT signals while the " "command is running, but the caller must do this separately when using the :" "mod:`subprocess` module." msgstr "" -#: library/subprocess.rst:1389 +#: library/subprocess.rst:1405 msgid "A more realistic example would look like this::" msgstr "" -#: library/subprocess.rst:1391 +#: library/subprocess.rst:1407 msgid "" "try:\n" " retcode = call(\"mycmd\" + \" myarg\", shell=True)\n" @@ -1714,59 +1726,59 @@ msgid "" " print(\"Execution failed:\", e, file=sys.stderr)" msgstr "" -#: library/subprocess.rst:1402 +#: library/subprocess.rst:1418 msgid "Replacing the :func:`os.spawn ` family" msgstr "" -#: library/subprocess.rst:1404 +#: library/subprocess.rst:1420 msgid "P_NOWAIT example::" msgstr "" -#: library/subprocess.rst:1406 +#: library/subprocess.rst:1422 msgid "" "pid = os.spawnlp(os.P_NOWAIT, \"/bin/mycmd\", \"mycmd\", \"myarg\")\n" "==>\n" "pid = Popen([\"/bin/mycmd\", \"myarg\"]).pid" msgstr "" -#: library/subprocess.rst:1410 +#: library/subprocess.rst:1426 msgid "P_WAIT example::" msgstr "" -#: library/subprocess.rst:1412 +#: library/subprocess.rst:1428 msgid "" "retcode = os.spawnlp(os.P_WAIT, \"/bin/mycmd\", \"mycmd\", \"myarg\")\n" "==>\n" "retcode = call([\"/bin/mycmd\", \"myarg\"])" msgstr "" -#: library/subprocess.rst:1416 +#: library/subprocess.rst:1432 msgid "Vector example::" msgstr "" -#: library/subprocess.rst:1418 +#: library/subprocess.rst:1434 msgid "" "os.spawnvp(os.P_NOWAIT, path, args)\n" "==>\n" "Popen([path] + args[1:])" msgstr "" -#: library/subprocess.rst:1422 +#: library/subprocess.rst:1438 msgid "Environment example::" msgstr "" -#: library/subprocess.rst:1424 +#: library/subprocess.rst:1440 msgid "" "os.spawnlpe(os.P_NOWAIT, \"/bin/mycmd\", \"mycmd\", \"myarg\", env)\n" "==>\n" "Popen([\"/bin/mycmd\", \"myarg\"], env={\"PATH\": \"/usr/bin\"})" msgstr "" -#: library/subprocess.rst:1431 +#: library/subprocess.rst:1447 msgid "Replacing :func:`os.popen`, :func:`os.popen2`, :func:`os.popen3`" msgstr "" -#: library/subprocess.rst:1435 +#: library/subprocess.rst:1451 msgid "" "(child_stdin, child_stdout) = os.popen2(cmd, mode, bufsize)\n" "==>\n" @@ -1775,7 +1787,7 @@ msgid "" "(child_stdin, child_stdout) = (p.stdin, p.stdout)" msgstr "" -#: library/subprocess.rst:1443 +#: library/subprocess.rst:1459 msgid "" "(child_stdin,\n" " child_stdout,\n" @@ -1788,7 +1800,7 @@ msgid "" " child_stderr) = (p.stdin, p.stdout, p.stderr)" msgstr "" -#: library/subprocess.rst:1455 +#: library/subprocess.rst:1471 msgid "" "(child_stdin, child_stdout_and_stderr) = os.popen4(cmd, mode, bufsize)\n" "==>\n" @@ -1797,11 +1809,11 @@ msgid "" "(child_stdin, child_stdout_and_stderr) = (p.stdin, p.stdout)" msgstr "" -#: library/subprocess.rst:1461 +#: library/subprocess.rst:1477 msgid "Return code handling translates as follows::" msgstr "" -#: library/subprocess.rst:1463 +#: library/subprocess.rst:1479 msgid "" "pipe = os.popen(cmd, 'w')\n" "...\n" @@ -1816,17 +1828,17 @@ msgid "" " print(\"There were some errors\")" msgstr "" -#: library/subprocess.rst:1477 +#: library/subprocess.rst:1493 msgid "Replacing functions from the :mod:`!popen2` module" msgstr "" -#: library/subprocess.rst:1481 +#: library/subprocess.rst:1497 msgid "" "If the cmd argument to popen2 functions is a string, the command is executed " "through /bin/sh. If it is a list, the command is directly executed." msgstr "" -#: library/subprocess.rst:1486 +#: library/subprocess.rst:1502 msgid "" "(child_stdout, child_stdin) = popen2.popen2(\"somestring\", bufsize, mode)\n" "==>\n" @@ -1835,7 +1847,7 @@ msgid "" "(child_stdout, child_stdin) = (p.stdout, p.stdin)" msgstr "" -#: library/subprocess.rst:1494 +#: library/subprocess.rst:1510 msgid "" "(child_stdout, child_stdin) = popen2.popen2([\"mycmd\", \"myarg\"], bufsize, " "mode)\n" @@ -1845,36 +1857,36 @@ msgid "" "(child_stdout, child_stdin) = (p.stdout, p.stdin)" msgstr "" -#: library/subprocess.rst:1500 +#: library/subprocess.rst:1516 msgid "" ":class:`popen2.Popen3` and :class:`popen2.Popen4` basically work as :class:" "`subprocess.Popen`, except that:" msgstr "" -#: library/subprocess.rst:1503 +#: library/subprocess.rst:1519 msgid ":class:`Popen` raises an exception if the execution fails." msgstr "" -#: library/subprocess.rst:1505 +#: library/subprocess.rst:1521 msgid "The *capturestderr* argument is replaced with the *stderr* argument." msgstr "" -#: library/subprocess.rst:1507 +#: library/subprocess.rst:1523 msgid "``stdin=PIPE`` and ``stdout=PIPE`` must be specified." msgstr "" -#: library/subprocess.rst:1509 +#: library/subprocess.rst:1525 msgid "" "popen2 closes all file descriptors by default, but you have to specify " "``close_fds=True`` with :class:`Popen` to guarantee this behavior on all " "platforms or past Python versions." msgstr "" -#: library/subprocess.rst:1515 +#: library/subprocess.rst:1531 msgid "Legacy Shell Invocation Functions" msgstr "" -#: library/subprocess.rst:1517 +#: library/subprocess.rst:1533 msgid "" "This module also provides the following legacy functions from the 2.x " "``commands`` module. These operations implicitly invoke the system shell and " @@ -1882,11 +1894,11 @@ msgid "" "handling consistency are valid for these functions." msgstr "" -#: library/subprocess.rst:1524 +#: library/subprocess.rst:1540 msgid "Return ``(exitcode, output)`` of executing *cmd* in a shell." msgstr "" -#: library/subprocess.rst:1526 +#: library/subprocess.rst:1542 msgid "" "Execute the string *cmd* in a shell with :meth:`Popen.check_output` and " "return a 2-tuple ``(exitcode, output)``. *encoding* and *errors* are used to " @@ -1894,13 +1906,13 @@ msgid "" "details." msgstr "" -#: library/subprocess.rst:1531 +#: library/subprocess.rst:1547 msgid "" "A trailing newline is stripped from the output. The exit code for the " "command can be interpreted as the return code of subprocess. Example::" msgstr "" -#: library/subprocess.rst:1535 +#: library/subprocess.rst:1551 msgid "" ">>> subprocess.getstatusoutput('ls /bin/ls')\n" "(0, '/bin/ls')\n" @@ -1912,77 +1924,77 @@ msgid "" "(-15, '')" msgstr "" -#: library/subprocess.rst:1546 +#: library/subprocess.rst:1562 msgid "Windows support was added." msgstr "" -#: library/subprocess.rst:1549 +#: library/subprocess.rst:1565 msgid "" "The function now returns (exitcode, output) instead of (status, output) as " "it did in Python 3.3.3 and earlier. exitcode has the same value as :attr:" "`~Popen.returncode`." msgstr "" -#: library/subprocess.rst:1558 +#: library/subprocess.rst:1574 msgid "Return output (stdout and stderr) of executing *cmd* in a shell." msgstr "" -#: library/subprocess.rst:1560 +#: library/subprocess.rst:1576 msgid "" "Like :func:`getstatusoutput`, except the exit code is ignored and the return " "value is a string containing the command's output. Example::" msgstr "" -#: library/subprocess.rst:1563 +#: library/subprocess.rst:1579 msgid "" ">>> subprocess.getoutput('ls /bin/ls')\n" "'/bin/ls'" msgstr "" -#: library/subprocess.rst:1568 +#: library/subprocess.rst:1584 msgid "Windows support added" msgstr "" -#: library/subprocess.rst:1576 +#: library/subprocess.rst:1592 msgid "Notes" msgstr "" -#: library/subprocess.rst:1581 +#: library/subprocess.rst:1597 msgid "Converting an argument sequence to a string on Windows" msgstr "" -#: library/subprocess.rst:1583 +#: library/subprocess.rst:1599 msgid "" "On Windows, an *args* sequence is converted to a string that can be parsed " "using the following rules (which correspond to the rules used by the MS C " "runtime):" msgstr "" -#: library/subprocess.rst:1587 +#: library/subprocess.rst:1603 msgid "" "Arguments are delimited by white space, which is either a space or a tab." msgstr "" -#: library/subprocess.rst:1590 +#: library/subprocess.rst:1606 msgid "" "A string surrounded by double quotation marks is interpreted as a single " "argument, regardless of white space contained within. A quoted string can " "be embedded in an argument." msgstr "" -#: library/subprocess.rst:1595 +#: library/subprocess.rst:1611 msgid "" "A double quotation mark preceded by a backslash is interpreted as a literal " "double quotation mark." msgstr "" -#: library/subprocess.rst:1598 +#: library/subprocess.rst:1614 msgid "" "Backslashes are interpreted literally, unless they immediately precede a " "double quotation mark." msgstr "" -#: library/subprocess.rst:1601 +#: library/subprocess.rst:1617 msgid "" "If backslashes immediately precede a double quotation mark, every pair of " "backslashes is interpreted as a literal backslash. If the number of " @@ -1990,37 +2002,37 @@ msgid "" "mark as described in rule 3." msgstr "" -#: library/subprocess.rst:1610 +#: library/subprocess.rst:1626 msgid ":mod:`shlex`" msgstr "" -#: library/subprocess.rst:1611 +#: library/subprocess.rst:1627 msgid "Module which provides function to parse and escape command lines." msgstr "" -#: library/subprocess.rst:1618 +#: library/subprocess.rst:1634 msgid "Disabling use of ``vfork()`` or ``posix_spawn()``" msgstr "" -#: library/subprocess.rst:1620 +#: library/subprocess.rst:1636 msgid "" "On Linux, :mod:`subprocess` defaults to using the ``vfork()`` system call " "internally when it is safe to do so rather than ``fork()``. This greatly " "improves performance." msgstr "" -#: library/subprocess.rst:1624 +#: library/subprocess.rst:1640 msgid "" "If you ever encounter a presumed highly unusual situation where you need to " "prevent ``vfork()`` from being used by Python, you can set the :const:" "`subprocess._USE_VFORK` attribute to a false value." msgstr "" -#: library/subprocess.rst:1630 +#: library/subprocess.rst:1646 msgid "subprocess._USE_VFORK = False # See CPython issue gh-NNNNNN." msgstr "" -#: library/subprocess.rst:1632 +#: library/subprocess.rst:1648 msgid "" "Setting this has no impact on use of ``posix_spawn()`` which could use " "``vfork()`` internally within its libc implementation. There is a similar :" @@ -2028,11 +2040,11 @@ msgid "" "that." msgstr "" -#: library/subprocess.rst:1639 +#: library/subprocess.rst:1655 msgid "subprocess._USE_POSIX_SPAWN = False # See CPython issue gh-NNNNNN." msgstr "" -#: library/subprocess.rst:1641 +#: library/subprocess.rst:1657 msgid "" "It is safe to set these to false on any Python version. They will have no " "effect on older versions when unsupported. Do not assume the attributes are " @@ -2040,18 +2052,18 @@ msgid "" "the corresponding function will be used, only that it may be." msgstr "" -#: library/subprocess.rst:1646 +#: library/subprocess.rst:1662 msgid "" "Please file issues any time you have to use these private knobs with a way " "to reproduce the issue you were seeing. Link to that issue from a comment in " "your code." msgstr "" -#: library/subprocess.rst:1650 +#: library/subprocess.rst:1666 msgid "``_USE_POSIX_SPAWN``" msgstr "" -#: library/subprocess.rst:1651 +#: library/subprocess.rst:1667 msgid "``_USE_VFORK``" msgstr "" diff --git a/library/sunau.po b/library/sunau.po index 7426fb11..4acc168c 100644 --- a/library/sunau.po +++ b/library/sunau.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -18,339 +18,18 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" #: library/sunau.rst:2 -msgid ":mod:`sunau` --- Read and write Sun AU files" +msgid ":mod:`!sunau` --- Read and write Sun AU files" msgstr "" #: library/sunau.rst:10 -msgid "**Source code:** :source:`Lib/sunau.py`" -msgstr "" - -#: library/sunau.rst:12 -msgid "" -"The :mod:`sunau` module is deprecated (see :pep:`PEP 594 <594#sunau>` for " -"details)." -msgstr "" - -#: library/sunau.rst:18 -msgid "" -"The :mod:`sunau` module provides a convenient interface to the Sun AU sound " -"format. Note that this module is interface-compatible with the modules :mod:" -"`aifc` and :mod:`wave`." -msgstr "" - -#: library/sunau.rst:22 -msgid "" -"An audio file consists of a header followed by the data. The fields of the " -"header are:" -msgstr "" - -#: library/sunau.rst:26 -msgid "Field" -msgstr "" - -#: library/sunau.rst:26 -msgid "Contents" -msgstr "" - -#: library/sunau.rst:28 -msgid "magic word" -msgstr "" - -#: library/sunau.rst:28 -msgid "The four bytes ``.snd``." -msgstr "" - -#: library/sunau.rst:30 -msgid "header size" -msgstr "" - -#: library/sunau.rst:30 -msgid "Size of the header, including info, in bytes." -msgstr "" - -#: library/sunau.rst:32 -msgid "data size" -msgstr "" - -#: library/sunau.rst:32 -msgid "Physical size of the data, in bytes." -msgstr "" - -#: library/sunau.rst:34 -msgid "encoding" -msgstr "" - -#: library/sunau.rst:34 -msgid "Indicates how the audio samples are encoded." -msgstr "" - -#: library/sunau.rst:36 -msgid "sample rate" -msgstr "" - -#: library/sunau.rst:36 -msgid "The sampling rate." -msgstr "" - -#: library/sunau.rst:38 -msgid "# of channels" -msgstr "" - -#: library/sunau.rst:38 -msgid "The number of channels in the samples." -msgstr "" - -#: library/sunau.rst:40 -msgid "info" -msgstr "" - -#: library/sunau.rst:40 -msgid "" -"ASCII string giving a description of the audio file (padded with null bytes)." -msgstr "" - -#: library/sunau.rst:44 -msgid "" -"Apart from the info field, all header fields are 4 bytes in size. They are " -"all 32-bit unsigned integers encoded in big-endian byte order." -msgstr "" - -#: library/sunau.rst:47 -msgid "The :mod:`sunau` module defines the following functions:" -msgstr "" - -#: library/sunau.rst:52 -msgid "" -"If *file* is a string, open the file by that name, otherwise treat it as a " -"seekable file-like object. *mode* can be any of" -msgstr "" - -#: library/sunau.rst:55 -msgid "``'r'``" -msgstr "" - -#: library/sunau.rst:56 -msgid "Read only mode." -msgstr "" - -#: library/sunau.rst:58 -msgid "``'w'``" -msgstr "" - -#: library/sunau.rst:59 -msgid "Write only mode." -msgstr "" - -#: library/sunau.rst:61 -msgid "Note that it does not allow read/write files." -msgstr "" - -#: library/sunau.rst:63 -msgid "" -"A *mode* of ``'r'`` returns an :class:`AU_read` object, while a *mode* of " -"``'w'`` or ``'wb'`` returns an :class:`AU_write` object." -msgstr "" - -#: library/sunau.rst:67 -msgid "The :mod:`sunau` module defines the following exception:" -msgstr "" - -#: library/sunau.rst:71 -msgid "" -"An error raised when something is impossible because of Sun AU specs or " -"implementation deficiency." -msgstr "" - -#: library/sunau.rst:75 -msgid "The :mod:`sunau` module defines the following data items:" -msgstr "" - -#: library/sunau.rst:79 -msgid "" -"An integer every valid Sun AU file begins with, stored in big-endian form. " -"This is the string ``.snd`` interpreted as an integer." -msgstr "" - -#: library/sunau.rst:90 msgid "" -"Values of the encoding field from the AU header which are supported by this " -"module." -msgstr "" - -#: library/sunau.rst:101 -msgid "" -"Additional known values of the encoding field from the AU header, but which " -"are not supported by this module." -msgstr "" - -#: library/sunau.rst:108 -msgid "AU_read Objects" -msgstr "" - -#: library/sunau.rst:110 -msgid "" -"AU_read objects, as returned by :func:`.open` above, have the following " -"methods:" -msgstr "" - -#: library/sunau.rst:115 -msgid "" -"Close the stream, and make the instance unusable. (This is called " -"automatically on deletion.)" -msgstr "" - -#: library/sunau.rst:121 -msgid "Returns number of audio channels (1 for mono, 2 for stereo)." -msgstr "" - -#: library/sunau.rst:126 -msgid "Returns sample width in bytes." -msgstr "" - -#: library/sunau.rst:131 -msgid "Returns sampling frequency." -msgstr "" - -#: library/sunau.rst:136 -msgid "Returns number of audio frames." -msgstr "" - -#: library/sunau.rst:141 -msgid "" -"Returns compression type. Supported compression types are ``'ULAW'``, " -"``'ALAW'`` and ``'NONE'``." -msgstr "" - -#: library/sunau.rst:147 -msgid "" -"Human-readable version of :meth:`getcomptype`. The supported types have the " -"respective names ``'CCITT G.711 u-law'``, ``'CCITT G.711 A-law'`` and ``'not " -"compressed'``." -msgstr "" - -#: library/sunau.rst:154 -msgid "" -"Returns a :func:`~collections.namedtuple` ``(nchannels, sampwidth, " -"framerate, nframes, comptype, compname)``, equivalent to output of the :meth:" -"`get\\*` methods." -msgstr "" - -#: library/sunau.rst:161 -msgid "" -"Reads and returns at most *n* frames of audio, as a :class:`bytes` object. " -"The data will be returned in linear format. If the original data is in u-" -"LAW format, it will be converted." -msgstr "" - -#: library/sunau.rst:168 -msgid "Rewind the file pointer to the beginning of the audio stream." -msgstr "" - -#: library/sunau.rst:170 -msgid "" -"The following two methods define a term \"position\" which is compatible " -"between them, and is otherwise implementation dependent." -msgstr "" - -#: library/sunau.rst:176 -msgid "" -"Set the file pointer to the specified position. Only values returned from :" -"meth:`tell` should be used for *pos*." -msgstr "" - -#: library/sunau.rst:182 -msgid "" -"Return current file pointer position. Note that the returned value has " -"nothing to do with the actual position in the file." -msgstr "" - -#: library/sunau.rst:185 -msgid "" -"The following two functions are defined for compatibility with the :mod:" -"`aifc`, and don't do anything interesting." -msgstr "" - -#: library/sunau.rst:191 -msgid "Returns ``None``." -msgstr "" - -#: library/sunau.rst:196 -msgid "Raise an error." -msgstr "" - -#: library/sunau.rst:202 -msgid "AU_write Objects" -msgstr "" - -#: library/sunau.rst:204 -msgid "" -"AU_write objects, as returned by :func:`.open` above, have the following " -"methods:" -msgstr "" - -#: library/sunau.rst:209 -msgid "Set the number of channels." -msgstr "" - -#: library/sunau.rst:214 -msgid "Set the sample width (in bytes.)" -msgstr "" - -#: library/sunau.rst:216 -msgid "Added support for 24-bit samples." -msgstr "" - -#: library/sunau.rst:222 -msgid "Set the frame rate." -msgstr "" - -#: library/sunau.rst:227 -msgid "" -"Set the number of frames. This can be later changed, when and if more " -"frames are written." -msgstr "" - -#: library/sunau.rst:233 -msgid "" -"Set the compression type and description. Only ``'NONE'`` and ``'ULAW'`` are " -"supported on output." -msgstr "" - -#: library/sunau.rst:239 -msgid "" -"The *tuple* should be ``(nchannels, sampwidth, framerate, nframes, comptype, " -"compname)``, with values valid for the :meth:`set\\*` methods. Set all " -"parameters." -msgstr "" - -#: library/sunau.rst:246 -msgid "" -"Return current position in the file, with the same disclaimer for the :meth:" -"`AU_read.tell` and :meth:`AU_read.setpos` methods." -msgstr "" - -#: library/sunau.rst:252 -msgid "Write audio frames, without correcting *nframes*." -msgstr "" - -#: library/sunau.rst:262 -msgid "Any :term:`bytes-like object` is now accepted." -msgstr "" - -#: library/sunau.rst:260 -msgid "Write audio frames and make sure *nframes* is correct." -msgstr "" - -#: library/sunau.rst:268 -msgid "Make sure *nframes* is correct, and close the file." -msgstr "" - -#: library/sunau.rst:270 -msgid "This method is called upon deletion." +"This module is no longer part of the Python standard library. It was :ref:" +"`removed in Python 3.13 ` after being deprecated in " +"Python 3.11. The removal was decided in :pep:`594`." msgstr "" -#: library/sunau.rst:272 +#: library/sunau.rst:14 msgid "" -"Note that it is invalid to set any parameters after calling :meth:" -"`writeframes` or :meth:`writeframesraw`." +"The last version of Python that provided the :mod:`!sunau` module was " +"`Python 3.12 `_." msgstr "" diff --git a/library/superseded.po b/library/superseded.po index 066ec4b6..387a37ae 100644 --- a/library/superseded.po +++ b/library/superseded.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -23,6 +23,26 @@ msgstr "" #: library/superseded.rst:7 msgid "" -"The modules described in this chapter are deprecated and only kept for " -"backwards compatibility. They have been superseded by other modules." +"The modules described in this chapter have been superseded by other modules " +"for most use cases, and are retained primarily to preserve backwards " +"compatibility." +msgstr "" + +#: library/superseded.rst:10 +msgid "" +"Modules may appear in this chapter because they only cover a limited subset " +"of a problem space, and a more generally applicable solution is available " +"elsewhere in the standard library (for example, :mod:`getopt` covers the " +"very specific task of \"mimic the C :c:func:`!getopt` API in Python\", " +"rather than the broader command line option parsing and argument parsing " +"capabilities offered by :mod:`optparse` and :mod:`argparse`)." +msgstr "" + +#: library/superseded.rst:17 +msgid "" +"Alternatively, modules may appear in this chapter because they are " +"deprecated outright, and awaiting removal in a future release, or they are :" +"term:`soft deprecated` and their use is actively discouraged in new " +"projects. With the removal of various obsolete modules through :pep:`594`, " +"there are currently no modules in this latter category." msgstr "" diff --git a/library/symtable.po b/library/symtable.po index d150b61c..e1f6f8c2 100644 --- a/library/symtable.po +++ b/library/symtable.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -49,28 +49,82 @@ msgid "Examining Symbol Tables" msgstr "" #: library/symtable.rst:36 +msgid "An enumeration indicating the type of a :class:`SymbolTable` object." +msgstr "" + +#: library/symtable.rst:41 +msgid "Used for the symbol table of a module." +msgstr "" + +#: library/symtable.rst:46 +msgid "Used for the symbol table of a function." +msgstr "" + +#: library/symtable.rst:51 +msgid "Used for the symbol table of a class." +msgstr "" + +#: library/symtable.rst:53 +msgid "" +"The following members refer to different flavors of :ref:`annotation scopes " +"`." +msgstr "" + +#: library/symtable.rst:59 +msgid "" +"Used for annotations if ``from __future__ import annotations`` is active." +msgstr "" + +#: library/symtable.rst:64 +msgid "Used for the symbol table of :keyword:`type` constructions." +msgstr "" + +#: library/symtable.rst:69 +msgid "" +"Used for the symbol table of :ref:`generic functions ` " +"or :ref:`generic classes `." +msgstr "" + +#: library/symtable.rst:75 +msgid "" +"Used for the symbol table of the bound, the constraint tuple or the default " +"value of a single type variable in the formal sense, i.e., a TypeVar, a " +"TypeVarTuple or a ParamSpec object (the latter two do not support a bound or " +"a constraint tuple)." +msgstr "" + +#: library/symtable.rst:84 msgid "A namespace table for a block. The constructor is not public." msgstr "" -#: library/symtable.rst:40 +#: library/symtable.rst:88 msgid "" -"Return the type of the symbol table. Possible values are ``'class'``, " -"``'module'``, ``'function'``, ``'annotation'``, ``'TypeVar bound'``, ``'type " -"alias'``, and ``'type parameter'``. The latter four refer to different " -"flavors of :ref:`annotation scopes `." +"Return the type of the symbol table. Possible values are members of the :" +"class:`SymbolTableType` enumeration." msgstr "" -#: library/symtable.rst:45 +#: library/symtable.rst:91 msgid "" "Added ``'annotation'``, ``'TypeVar bound'``, ``'type alias'``, and ``'type " "parameter'`` as possible return values." msgstr "" -#: library/symtable.rst:51 +#: library/symtable.rst:95 +msgid "Return values are members of the :class:`SymbolTableType` enumeration." +msgstr "" + +#: library/symtable.rst:98 +msgid "" +"The exact values of the returned string may change in the future, and thus, " +"it is recommended to use :class:`SymbolTableType` members instead of hard-" +"coded strings." +msgstr "" + +#: library/symtable.rst:104 msgid "Return the table's identifier." msgstr "" -#: library/symtable.rst:55 +#: library/symtable.rst:108 msgid "" "Return the table's name. This is the name of the class if the table is for " "a class, the name of the function if the table is for a function, or " @@ -81,168 +135,172 @@ msgid "" "`~typing.TypeVar` bound scopes, it is the name of the ``TypeVar``." msgstr "" -#: library/symtable.rst:65 +#: library/symtable.rst:118 msgid "Return the number of the first line in the block this table represents." msgstr "" -#: library/symtable.rst:69 +#: library/symtable.rst:122 msgid "Return ``True`` if the locals in this table can be optimized." msgstr "" -#: library/symtable.rst:73 +#: library/symtable.rst:126 msgid "Return ``True`` if the block is a nested class or function." msgstr "" -#: library/symtable.rst:77 +#: library/symtable.rst:130 msgid "" "Return ``True`` if the block has nested namespaces within it. These can be " "obtained with :meth:`get_children`." msgstr "" -#: library/symtable.rst:82 +#: library/symtable.rst:135 msgid "" "Return a view object containing the names of symbols in the table. See the :" "ref:`documentation of view objects `." msgstr "" -#: library/symtable.rst:87 +#: library/symtable.rst:140 msgid "Lookup *name* in the table and return a :class:`Symbol` instance." msgstr "" -#: library/symtable.rst:91 +#: library/symtable.rst:144 msgid "Return a list of :class:`Symbol` instances for names in the table." msgstr "" -#: library/symtable.rst:95 +#: library/symtable.rst:148 msgid "Return a list of the nested symbol tables." msgstr "" -#: library/symtable.rst:100 +#: library/symtable.rst:153 msgid "" "A namespace for a function or method. This class inherits from :class:" "`SymbolTable`." msgstr "" -#: library/symtable.rst:105 +#: library/symtable.rst:158 msgid "Return a tuple containing names of parameters to this function." msgstr "" -#: library/symtable.rst:109 +#: library/symtable.rst:162 msgid "Return a tuple containing names of locals in this function." msgstr "" -#: library/symtable.rst:113 +#: library/symtable.rst:166 msgid "Return a tuple containing names of globals in this function." msgstr "" -#: library/symtable.rst:117 -msgid "Return a tuple containing names of nonlocals in this function." +#: library/symtable.rst:170 +msgid "" +"Return a tuple containing names of explicitly declared nonlocals in this " +"function." msgstr "" -#: library/symtable.rst:121 -msgid "Return a tuple containing names of free variables in this function." +#: library/symtable.rst:174 +msgid "" +"Return a tuple containing names of :term:`free (closure) variables ` in this function." msgstr "" -#: library/symtable.rst:126 +#: library/symtable.rst:180 msgid "A namespace of a class. This class inherits from :class:`SymbolTable`." msgstr "" -#: library/symtable.rst:130 +#: library/symtable.rst:184 msgid "" "Return a tuple containing the names of method-like functions declared in the " "class." msgstr "" -#: library/symtable.rst:133 +#: library/symtable.rst:187 msgid "" "Here, the term 'method' designates *any* function defined in the class body " "via :keyword:`def` or :keyword:`async def`." msgstr "" -#: library/symtable.rst:136 +#: library/symtable.rst:190 msgid "" "Functions defined in a deeper scope (e.g., in an inner class) are not picked " "up by :meth:`get_methods`." msgstr "" -#: library/symtable.rst:139 +#: library/symtable.rst:193 msgid "For example:" msgstr "" -#: library/symtable.rst:161 +#: library/symtable.rst:215 msgid "" "Although ``A().f()`` raises :exc:`TypeError` at runtime, ``A.f`` is still " "considered as a method-like function." msgstr "" -#: library/symtable.rst:166 +#: library/symtable.rst:220 msgid "" "An entry in a :class:`SymbolTable` corresponding to an identifier in the " "source. The constructor is not public." msgstr "" -#: library/symtable.rst:171 +#: library/symtable.rst:225 msgid "Return the symbol's name." msgstr "" -#: library/symtable.rst:175 +#: library/symtable.rst:229 msgid "Return ``True`` if the symbol is used in its block." msgstr "" -#: library/symtable.rst:179 +#: library/symtable.rst:233 msgid "Return ``True`` if the symbol is created from an import statement." msgstr "" -#: library/symtable.rst:183 +#: library/symtable.rst:237 msgid "Return ``True`` if the symbol is a parameter." msgstr "" -#: library/symtable.rst:187 +#: library/symtable.rst:241 msgid "Return ``True`` if the symbol is global." msgstr "" -#: library/symtable.rst:191 +#: library/symtable.rst:245 msgid "Return ``True`` if the symbol is nonlocal." msgstr "" -#: library/symtable.rst:195 +#: library/symtable.rst:249 msgid "" "Return ``True`` if the symbol is declared global with a global statement." msgstr "" -#: library/symtable.rst:199 +#: library/symtable.rst:253 msgid "Return ``True`` if the symbol is local to its block." msgstr "" -#: library/symtable.rst:203 +#: library/symtable.rst:257 msgid "Return ``True`` if the symbol is annotated." msgstr "" -#: library/symtable.rst:209 +#: library/symtable.rst:263 msgid "" "Return ``True`` if the symbol is referenced in its block, but not assigned " "to." msgstr "" -#: library/symtable.rst:214 +#: library/symtable.rst:268 msgid "Return ``True`` if the symbol is assigned to in its block." msgstr "" -#: library/symtable.rst:218 +#: library/symtable.rst:272 msgid "Return ``True`` if name binding introduces new namespace." msgstr "" -#: library/symtable.rst:220 +#: library/symtable.rst:274 msgid "" "If the name is used as the target of a function or class statement, this " "will be true." msgstr "" -#: library/symtable.rst:223 +#: library/symtable.rst:277 msgid "For example::" msgstr "" -#: library/symtable.rst:225 +#: library/symtable.rst:279 msgid "" ">>> table = symtable.symtable(\"def some_func(): pass\", \"string\", " "\"exec\")\n" @@ -250,19 +308,38 @@ msgid "" "True" msgstr "" -#: library/symtable.rst:229 +#: library/symtable.rst:283 msgid "" "Note that a single name can be bound to multiple objects. If the result is " "``True``, the name may also be bound to other objects, like an int or list, " "that does not introduce a new namespace." msgstr "" -#: library/symtable.rst:235 +#: library/symtable.rst:289 msgid "Return a list of namespaces bound to this name." msgstr "" -#: library/symtable.rst:239 +#: library/symtable.rst:293 msgid "" "Return the namespace bound to this name. If more than one or no namespace is " "bound to this name, a :exc:`ValueError` is raised." msgstr "" + +#: library/symtable.rst:300 +msgid "Command-Line Usage" +msgstr "" + +#: library/symtable.rst:304 +msgid "" +"The :mod:`symtable` module can be executed as a script from the command line." +msgstr "" + +#: library/symtable.rst:306 +msgid "python -m symtable [infile...]" +msgstr "" + +#: library/symtable.rst:310 +msgid "" +"Symbol tables are generated for the specified Python source files and dumped " +"to stdout. If no input file is specified, the content is read from stdin." +msgstr "" diff --git a/library/sys.monitoring.po b/library/sys.monitoring.po index e07108f6..68a0a7b8 100644 --- a/library/sys.monitoring.po +++ b/library/sys.monitoring.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -118,206 +118,199 @@ msgid "" "sys.monitoring.OPTIMIZER_ID = 5" msgstr "" -#: library/sys.monitoring.rst:78 -msgid "" -"There is no obligation to set an ID, nor is there anything preventing a tool " -"from using an ID even it is already in use. However, tools are encouraged to " -"use a unique ID and respect other tools." -msgstr "" - -#: library/sys.monitoring.rst:83 +#: library/sys.monitoring.rst:80 msgid "Events" msgstr "" -#: library/sys.monitoring.rst:85 +#: library/sys.monitoring.rst:82 msgid "The following events are supported:" msgstr "" -#: library/sys.monitoring.rst:89 +#: library/sys.monitoring.rst:86 msgid "A conditional branch is taken (or not)." msgstr "" -#: library/sys.monitoring.rst:93 +#: library/sys.monitoring.rst:90 msgid "A call in Python code (event occurs before the call)." msgstr "" -#: library/sys.monitoring.rst:97 +#: library/sys.monitoring.rst:94 msgid "" "An exception raised from any callable, except for Python functions (event " "occurs after the exit)." msgstr "" -#: library/sys.monitoring.rst:101 +#: library/sys.monitoring.rst:98 msgid "" "Return from any callable, except for Python functions (event occurs after " "the return)." msgstr "" -#: library/sys.monitoring.rst:105 +#: library/sys.monitoring.rst:102 msgid "An exception is handled." msgstr "" -#: library/sys.monitoring.rst:109 +#: library/sys.monitoring.rst:106 msgid "A VM instruction is about to be executed." msgstr "" -#: library/sys.monitoring.rst:113 +#: library/sys.monitoring.rst:110 msgid "An unconditional jump in the control flow graph is made." msgstr "" -#: library/sys.monitoring.rst:117 +#: library/sys.monitoring.rst:114 msgid "" "An instruction is about to be executed that has a different line number from " "the preceding instruction." msgstr "" -#: library/sys.monitoring.rst:121 +#: library/sys.monitoring.rst:118 msgid "" "Resumption of a Python function (for generator and coroutine functions), " "except for ``throw()`` calls." msgstr "" -#: library/sys.monitoring.rst:125 +#: library/sys.monitoring.rst:122 msgid "" "Return from a Python function (occurs immediately before the return, the " "callee's frame will be on the stack)." msgstr "" -#: library/sys.monitoring.rst:129 +#: library/sys.monitoring.rst:126 msgid "" "Start of a Python function (occurs immediately after the call, the callee's " "frame will be on the stack)" msgstr "" -#: library/sys.monitoring.rst:133 +#: library/sys.monitoring.rst:130 msgid "A Python function is resumed by a ``throw()`` call." msgstr "" -#: library/sys.monitoring.rst:137 +#: library/sys.monitoring.rst:134 msgid "Exit from a Python function during exception unwinding." msgstr "" -#: library/sys.monitoring.rst:141 +#: library/sys.monitoring.rst:138 msgid "" "Yield from a Python function (occurs immediately before the yield, the " "callee's frame will be on the stack)." msgstr "" -#: library/sys.monitoring.rst:145 +#: library/sys.monitoring.rst:142 msgid "" "An exception is raised, except those that cause a :monitoring-event:" "`STOP_ITERATION` event." msgstr "" -#: library/sys.monitoring.rst:149 +#: library/sys.monitoring.rst:146 msgid "" "An exception is re-raised, for example at the end of a :keyword:`finally` " "block." msgstr "" -#: library/sys.monitoring.rst:153 +#: library/sys.monitoring.rst:150 msgid "" "An artificial :exc:`StopIteration` is raised; see `the STOP_ITERATION " "event`_." msgstr "" -#: library/sys.monitoring.rst:156 +#: library/sys.monitoring.rst:153 msgid "More events may be added in the future." msgstr "" -#: library/sys.monitoring.rst:158 +#: library/sys.monitoring.rst:155 msgid "" "These events are attributes of the :mod:`!sys.monitoring.events` namespace. " "Each event is represented as a power-of-2 integer constant. To define a set " -"of events, simply bitwise or the individual events together. For example, to " +"of events, simply bitwise OR the individual events together. For example, to " "specify both :monitoring-event:`PY_RETURN` and :monitoring-event:`PY_START` " "events, use the expression ``PY_RETURN | PY_START``." msgstr "" -#: library/sys.monitoring.rst:166 +#: library/sys.monitoring.rst:163 msgid "An alias for ``0`` so users can do explicit comparisons like::" msgstr "" -#: library/sys.monitoring.rst:168 +#: library/sys.monitoring.rst:165 msgid "" "if get_events(DEBUGGER_ID) == NO_EVENTS:\n" " ..." msgstr "" -#: library/sys.monitoring.rst:171 +#: library/sys.monitoring.rst:168 msgid "Events are divided into three groups:" msgstr "" -#: library/sys.monitoring.rst:174 +#: library/sys.monitoring.rst:173 msgid "Local events" msgstr "" -#: library/sys.monitoring.rst:176 +#: library/sys.monitoring.rst:175 msgid "" "Local events are associated with normal execution of the program and happen " "at clearly defined locations. All local events can be disabled. The local " "events are:" msgstr "" -#: library/sys.monitoring.rst:180 +#: library/sys.monitoring.rst:179 msgid ":monitoring-event:`PY_START`" msgstr "" -#: library/sys.monitoring.rst:181 +#: library/sys.monitoring.rst:180 msgid ":monitoring-event:`PY_RESUME`" msgstr "" -#: library/sys.monitoring.rst:182 +#: library/sys.monitoring.rst:181 msgid ":monitoring-event:`PY_RETURN`" msgstr "" -#: library/sys.monitoring.rst:183 +#: library/sys.monitoring.rst:182 msgid ":monitoring-event:`PY_YIELD`" msgstr "" -#: library/sys.monitoring.rst:184 +#: library/sys.monitoring.rst:183 msgid ":monitoring-event:`CALL`" msgstr "" -#: library/sys.monitoring.rst:185 +#: library/sys.monitoring.rst:184 msgid ":monitoring-event:`LINE`" msgstr "" -#: library/sys.monitoring.rst:186 +#: library/sys.monitoring.rst:185 msgid ":monitoring-event:`INSTRUCTION`" msgstr "" -#: library/sys.monitoring.rst:187 +#: library/sys.monitoring.rst:186 msgid ":monitoring-event:`JUMP`" msgstr "" -#: library/sys.monitoring.rst:188 +#: library/sys.monitoring.rst:187 msgid ":monitoring-event:`BRANCH`" msgstr "" -#: library/sys.monitoring.rst:189 +#: library/sys.monitoring.rst:188 msgid ":monitoring-event:`STOP_ITERATION`" msgstr "" -#: library/sys.monitoring.rst:192 +#: library/sys.monitoring.rst:191 msgid "Ancillary events" msgstr "" -#: library/sys.monitoring.rst:194 +#: library/sys.monitoring.rst:193 msgid "" "Ancillary events can be monitored like other events, but are controlled by " "another event:" msgstr "" -#: library/sys.monitoring.rst:197 +#: library/sys.monitoring.rst:196 msgid ":monitoring-event:`C_RAISE`" msgstr "" -#: library/sys.monitoring.rst:198 +#: library/sys.monitoring.rst:197 msgid ":monitoring-event:`C_RETURN`" msgstr "" -#: library/sys.monitoring.rst:200 +#: library/sys.monitoring.rst:199 msgid "" "The :monitoring-event:`C_RETURN` and :monitoring-event:`C_RAISE` events are " "controlled by the :monitoring-event:`CALL` event. :monitoring-event:" @@ -325,41 +318,41 @@ msgid "" "corresponding :monitoring-event:`CALL` event is being monitored." msgstr "" -#: library/sys.monitoring.rst:206 +#: library/sys.monitoring.rst:205 msgid "Other events" msgstr "" -#: library/sys.monitoring.rst:208 +#: library/sys.monitoring.rst:207 msgid "" "Other events are not necessarily tied to a specific location in the program " "and cannot be individually disabled." msgstr "" -#: library/sys.monitoring.rst:211 +#: library/sys.monitoring.rst:210 msgid "The other events that can be monitored are:" msgstr "" -#: library/sys.monitoring.rst:213 +#: library/sys.monitoring.rst:212 msgid ":monitoring-event:`PY_THROW`" msgstr "" -#: library/sys.monitoring.rst:214 +#: library/sys.monitoring.rst:213 msgid ":monitoring-event:`PY_UNWIND`" msgstr "" -#: library/sys.monitoring.rst:215 +#: library/sys.monitoring.rst:214 msgid ":monitoring-event:`RAISE`" msgstr "" -#: library/sys.monitoring.rst:216 +#: library/sys.monitoring.rst:215 msgid ":monitoring-event:`EXCEPTION_HANDLED`" msgstr "" -#: library/sys.monitoring.rst:220 +#: library/sys.monitoring.rst:219 msgid "The STOP_ITERATION event" msgstr "" -#: library/sys.monitoring.rst:222 +#: library/sys.monitoring.rst:221 msgid "" ":pep:`PEP 380 <380#use-of-stopiteration-to-return-values>` specifies that a :" "exc:`StopIteration` exception is raised when returning a value from a " @@ -368,7 +361,7 @@ msgid "" "an exception unless it would be visible to other code." msgstr "" -#: library/sys.monitoring.rst:228 +#: library/sys.monitoring.rst:227 msgid "" "To allow tools to monitor for real exceptions without slowing down " "generators and coroutines, the :monitoring-event:`STOP_ITERATION` event is " @@ -376,83 +369,87 @@ msgid "" "unlike :monitoring-event:`RAISE`." msgstr "" -#: library/sys.monitoring.rst:234 +#: library/sys.monitoring.rst:233 msgid "Turning events on and off" msgstr "" -#: library/sys.monitoring.rst:236 +#: library/sys.monitoring.rst:235 msgid "" "In order to monitor an event, it must be turned on and a corresponding " "callback must be registered. Events can be turned on or off by setting the " "events either globally or for a particular code object." msgstr "" -#: library/sys.monitoring.rst:243 +#: library/sys.monitoring.rst:242 msgid "Setting events globally" msgstr "" -#: library/sys.monitoring.rst:245 +#: library/sys.monitoring.rst:244 msgid "" "Events can be controlled globally by modifying the set of events being " "monitored." msgstr "" -#: library/sys.monitoring.rst:249 +#: library/sys.monitoring.rst:248 msgid "Returns the ``int`` representing all the active events." msgstr "" -#: library/sys.monitoring.rst:253 +#: library/sys.monitoring.rst:252 msgid "" "Activates all events which are set in *event_set*. Raises a :exc:" "`ValueError` if *tool_id* is not in use." msgstr "" -#: library/sys.monitoring.rst:256 +#: library/sys.monitoring.rst:255 msgid "No events are active by default." msgstr "" -#: library/sys.monitoring.rst:259 +#: library/sys.monitoring.rst:258 msgid "Per code object events" msgstr "" -#: library/sys.monitoring.rst:261 -msgid "Events can also be controlled on a per code object basis." +#: library/sys.monitoring.rst:260 +msgid "" +"Events can also be controlled on a per code object basis. The functions " +"defined below which accept a :class:`types.CodeType` should be prepared to " +"accept a look-alike object from functions which are not defined in Python " +"(see :ref:`c-api-monitoring`)." msgstr "" -#: library/sys.monitoring.rst:265 +#: library/sys.monitoring.rst:267 msgid "Returns all the local events for *code*" msgstr "" -#: library/sys.monitoring.rst:269 +#: library/sys.monitoring.rst:271 msgid "" "Activates all the local events for *code* which are set in *event_set*. " "Raises a :exc:`ValueError` if *tool_id* is not in use." msgstr "" -#: library/sys.monitoring.rst:272 +#: library/sys.monitoring.rst:274 msgid "" "Local events add to global events, but do not mask them. In other words, all " "global events will trigger for a code object, regardless of the local events." msgstr "" -#: library/sys.monitoring.rst:278 +#: library/sys.monitoring.rst:280 msgid "Disabling events" msgstr "" -#: library/sys.monitoring.rst:282 +#: library/sys.monitoring.rst:284 msgid "" "A special value that can be returned from a callback function to disable " "events for the current code location." msgstr "" -#: library/sys.monitoring.rst:285 +#: library/sys.monitoring.rst:287 msgid "" "Local events can be disabled for a specific code location by returning :data:" "`sys.monitoring.DISABLE` from a callback function. This does not change " "which events are set, or any other code locations for the same event." msgstr "" -#: library/sys.monitoring.rst:289 +#: library/sys.monitoring.rst:291 msgid "" "Disabling events for specific locations is very important for high " "performance monitoring. For example, a program can be run under a debugger " @@ -460,137 +457,137 @@ msgid "" "breakpoints." msgstr "" -#: library/sys.monitoring.rst:296 +#: library/sys.monitoring.rst:298 msgid "" "Enable all the events that were disabled by :data:`sys.monitoring.DISABLE` " "for all tools." msgstr "" -#: library/sys.monitoring.rst:303 +#: library/sys.monitoring.rst:305 msgid "Registering callback functions" msgstr "" -#: library/sys.monitoring.rst:305 +#: library/sys.monitoring.rst:307 msgid "To register a callable for events call" msgstr "" -#: library/sys.monitoring.rst:309 +#: library/sys.monitoring.rst:311 msgid "Registers the callable *func* for the *event* with the given *tool_id*" msgstr "" -#: library/sys.monitoring.rst:311 +#: library/sys.monitoring.rst:313 msgid "" "If another callback was registered for the given *tool_id* and *event*, it " "is unregistered and returned. Otherwise :func:`register_callback` returns " "``None``." msgstr "" -#: library/sys.monitoring.rst:316 +#: library/sys.monitoring.rst:318 msgid "" "Functions can be unregistered by calling ``sys.monitoring." "register_callback(tool_id, event, None)``." msgstr "" -#: library/sys.monitoring.rst:319 +#: library/sys.monitoring.rst:321 msgid "Callback functions can be registered and unregistered at any time." msgstr "" -#: library/sys.monitoring.rst:321 +#: library/sys.monitoring.rst:323 msgid "" "Registering or unregistering a callback function will generate a :func:`sys." "audit` event." msgstr "" -#: library/sys.monitoring.rst:325 +#: library/sys.monitoring.rst:327 msgid "Callback function arguments" msgstr "" -#: library/sys.monitoring.rst:329 +#: library/sys.monitoring.rst:331 msgid "" "A special value that is passed to a callback function to indicate that there " "are no arguments to the call." msgstr "" -#: library/sys.monitoring.rst:332 +#: library/sys.monitoring.rst:334 msgid "" "When an active event occurs, the registered callback function is called. " "Different events will provide the callback function with different " "arguments, as follows:" msgstr "" -#: library/sys.monitoring.rst:335 +#: library/sys.monitoring.rst:337 msgid ":monitoring-event:`PY_START` and :monitoring-event:`PY_RESUME`::" msgstr "" -#: library/sys.monitoring.rst:368 +#: library/sys.monitoring.rst:370 msgid "func(code: CodeType, instruction_offset: int) -> DISABLE | Any" msgstr "" -#: library/sys.monitoring.rst:339 +#: library/sys.monitoring.rst:341 msgid ":monitoring-event:`PY_RETURN` and :monitoring-event:`PY_YIELD`::" msgstr "" -#: library/sys.monitoring.rst:341 +#: library/sys.monitoring.rst:343 msgid "" "func(code: CodeType, instruction_offset: int, retval: object) -> DISABLE | " "Any" msgstr "" -#: library/sys.monitoring.rst:343 +#: library/sys.monitoring.rst:345 msgid "" ":monitoring-event:`CALL`, :monitoring-event:`C_RAISE` and :monitoring-event:" "`C_RETURN`::" msgstr "" -#: library/sys.monitoring.rst:345 +#: library/sys.monitoring.rst:347 msgid "" "func(code: CodeType, instruction_offset: int, callable: object, arg0: object " "| MISSING) -> DISABLE | Any" msgstr "" -#: library/sys.monitoring.rst:347 +#: library/sys.monitoring.rst:349 msgid "" "If there are no arguments, *arg0* is set to :data:`sys.monitoring.MISSING`." msgstr "" -#: library/sys.monitoring.rst:349 +#: library/sys.monitoring.rst:351 msgid "" ":monitoring-event:`RAISE`, :monitoring-event:`RERAISE`, :monitoring-event:" "`EXCEPTION_HANDLED`, :monitoring-event:`PY_UNWIND`, :monitoring-event:" "`PY_THROW` and :monitoring-event:`STOP_ITERATION`::" msgstr "" -#: library/sys.monitoring.rst:352 +#: library/sys.monitoring.rst:354 msgid "" "func(code: CodeType, instruction_offset: int, exception: BaseException) -> " "DISABLE | Any" msgstr "" -#: library/sys.monitoring.rst:354 +#: library/sys.monitoring.rst:356 msgid ":monitoring-event:`LINE`::" msgstr "" -#: library/sys.monitoring.rst:356 +#: library/sys.monitoring.rst:358 msgid "func(code: CodeType, line_number: int) -> DISABLE | Any" msgstr "" -#: library/sys.monitoring.rst:358 +#: library/sys.monitoring.rst:360 msgid ":monitoring-event:`BRANCH` and :monitoring-event:`JUMP`::" msgstr "" -#: library/sys.monitoring.rst:360 +#: library/sys.monitoring.rst:362 msgid "" "func(code: CodeType, instruction_offset: int, destination_offset: int) -> " "DISABLE | Any" msgstr "" -#: library/sys.monitoring.rst:362 +#: library/sys.monitoring.rst:364 msgid "" "Note that the *destination_offset* is where the code will next execute. For " "an untaken branch this will be the offset of the instruction following the " "branch." msgstr "" -#: library/sys.monitoring.rst:366 +#: library/sys.monitoring.rst:368 msgid ":monitoring-event:`INSTRUCTION`::" msgstr "" diff --git a/library/sys.po b/library/sys.po index d5b296d6..df406d57 100644 --- a/library/sys.po +++ b/library/sys.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -41,8 +41,8 @@ msgid "" "removed)." msgstr "" -#: library/sys.rst:288 library/sys.rst:747 library/sys.rst:1007 -#: library/sys.rst:1736 library/sys.rst:1759 library/sys.rst:2011 +#: library/sys.rst:299 library/sys.rst:760 library/sys.rst:1020 +#: library/sys.rst:1763 library/sys.rst:1786 library/sys.rst:2046 msgid "Availability" msgstr "" @@ -238,12 +238,22 @@ msgid "" "during reference leak debugging." msgstr "" -#: library/sys.rst:212 library/sys.rst:225 +#: library/sys.rst:223 library/sys.rst:236 msgid "" "This function should be used for internal and specialized purposes only." msgstr "" -#: library/sys.rst:201 +#: library/sys.rst:198 +msgid "Use the more general :func:`_clear_internal_caches` function instead." +msgstr "" + +#: library/sys.rst:204 +msgid "" +"Clear all internal performance-related caches. Use this function *only* to " +"release unnecessary references and memory blocks when hunting for leaks." +msgstr "" + +#: library/sys.rst:212 msgid "" "Return a dictionary mapping each thread's identifier to the topmost stack " "frame currently active in that thread at the time the function is called. " @@ -251,7 +261,7 @@ msgid "" "given such a frame." msgstr "" -#: library/sys.rst:206 +#: library/sys.rst:217 msgid "" "This is most useful for debugging deadlock: this function does not require " "the deadlocked threads' cooperation, and such threads' call stacks are " @@ -260,13 +270,13 @@ msgid "" "by the time calling code examines the frame." msgstr "" -#: library/sys.rst:214 +#: library/sys.rst:225 msgid "" "Raises an :ref:`auditing event ` ``sys._current_frames`` with no " "arguments." msgstr "" -#: library/sys.rst:218 +#: library/sys.rst:229 msgid "" "Return a dictionary mapping each thread's identifier to the topmost " "exception currently active in that thread at the time the function is " @@ -274,30 +284,30 @@ msgid "" "included in the result dictionary." msgstr "" -#: library/sys.rst:223 +#: library/sys.rst:234 msgid "This is most useful for statistical profiling." msgstr "" -#: library/sys.rst:227 +#: library/sys.rst:238 msgid "" "Raises an :ref:`auditing event ` ``sys._current_exceptions`` with " "no arguments." msgstr "" -#: library/sys.rst:229 +#: library/sys.rst:240 msgid "" "Each value in the dictionary is now a single exception instance, rather than " "a 3-tuple as returned from ``sys.exc_info()``." msgstr "" -#: library/sys.rst:235 +#: library/sys.rst:246 msgid "" "This hook function is called by built-in :func:`breakpoint`. By default, it " "drops you into the :mod:`pdb` debugger, but it can be set to any other " "function so that you can choose which debugger gets used." msgstr "" -#: library/sys.rst:239 +#: library/sys.rst:250 msgid "" "The signature of this function is dependent on what it calls. For example, " "the default binding (e.g. ``pdb.set_trace()``) expects no arguments, but you " @@ -307,7 +317,7 @@ msgid "" "returns is returned from ``breakpoint()``." msgstr "" -#: library/sys.rst:246 +#: library/sys.rst:257 msgid "" "The default implementation first consults the environment variable :envvar:" "`PYTHONBREAKPOINT`. If that is set to ``\"0\"`` then this function returns " @@ -321,43 +331,43 @@ msgid "" "breakpointhook()`` returns to the built-in :func:`breakpoint` function." msgstr "" -#: library/sys.rst:258 +#: library/sys.rst:269 msgid "" "Note that if anything goes wrong while importing the callable named by :" "envvar:`PYTHONBREAKPOINT`, a :exc:`RuntimeWarning` is reported and the " "breakpoint is ignored." msgstr "" -#: library/sys.rst:262 +#: library/sys.rst:273 msgid "" "Also note that if ``sys.breakpointhook()`` is overridden programmatically, :" "envvar:`PYTHONBREAKPOINT` is *not* consulted." msgstr "" -#: library/sys.rst:269 +#: library/sys.rst:280 msgid "" "Print low-level information to stderr about the state of CPython's memory " "allocator." msgstr "" -#: library/sys.rst:272 +#: library/sys.rst:283 msgid "" "If Python is :ref:`built in debug mode ` (:option:`configure --" "with-pydebug option <--with-pydebug>`), it also performs some expensive " "internal consistency checks." msgstr "" -#: library/sys.rst:280 +#: library/sys.rst:291 msgid "" "This function is specific to CPython. The exact output format is not " "defined here, and may change." msgstr "" -#: library/sys.rst:286 +#: library/sys.rst:297 msgid "Integer specifying the handle of the Python DLL." msgstr "" -#: library/sys.rst:293 +#: library/sys.rst:304 msgid "" "If *value* is not ``None``, this function prints ``repr(value)`` to ``sys." "stdout``, and saves *value* in ``builtins._``. If ``repr(value)`` is not " @@ -366,7 +376,7 @@ msgid "" "encoding`` with ``'backslashreplace'`` error handler." msgstr "" -#: library/sys.rst:299 +#: library/sys.rst:310 msgid "" "``sys.displayhook`` is called on the result of evaluating an :term:" "`expression` entered in an interactive Python session. The display of these " @@ -374,11 +384,11 @@ msgid "" "displayhook``." msgstr "" -#: library/sys.rst:303 +#: library/sys.rst:314 msgid "Pseudo-code::" msgstr "" -#: library/sys.rst:305 +#: library/sys.rst:316 msgid "" "def displayhook(value):\n" " if value is None:\n" @@ -399,11 +409,11 @@ msgid "" " builtins._ = value" msgstr "" -#: library/sys.rst:323 +#: library/sys.rst:334 msgid "Use ``'backslashreplace'`` error handler on :exc:`UnicodeEncodeError`." msgstr "" -#: library/sys.rst:329 +#: library/sys.rst:340 msgid "" "If this is true, Python won't try to write ``.pyc`` files on the import of " "source modules. This value is initially set to ``True`` or ``False`` " @@ -412,34 +422,34 @@ msgid "" "to control bytecode file generation." msgstr "" -#: library/sys.rst:338 +#: library/sys.rst:349 msgid "" "A :term:`named tuple` holding information about the environment on the " "*wasm32-emscripten* platform. The named tuple is provisional and may change " "in the future." msgstr "" -#: library/sys.rst:344 +#: library/sys.rst:355 msgid "" "Emscripten version as tuple of ints (major, minor, micro), e.g. ``(3, 1, " "8)``." msgstr "" -#: library/sys.rst:348 +#: library/sys.rst:359 msgid "" "Runtime string, e.g. browser user agent, ``'Node.js v14.18.2'``, or " "``'UNKNOWN'``." msgstr "" -#: library/sys.rst:352 +#: library/sys.rst:363 msgid "``True`` if Python is compiled with Emscripten pthreads support." msgstr "" -#: library/sys.rst:356 +#: library/sys.rst:367 msgid "``True`` if Python is compiled with shared memory support." msgstr "" -#: library/sys.rst:365 +#: library/sys.rst:376 msgid "" "If this is set (not ``None``), Python will write bytecode-cache ``.pyc`` " "files to (and read them from) a parallel directory tree rooted at this " @@ -450,12 +460,12 @@ msgid "" "with the same pycache prefix (if any) that you will use at runtime." msgstr "" -#: library/sys.rst:373 +#: library/sys.rst:384 msgid "" "A relative path is interpreted relative to the current working directory." msgstr "" -#: library/sys.rst:375 +#: library/sys.rst:386 msgid "" "This value is initially set based on the value of the :option:`-X` " "``pycache_prefix=PATH`` command-line option or the :envvar:" @@ -463,12 +473,12 @@ msgid "" "If neither are set, it is ``None``." msgstr "" -#: library/sys.rst:385 +#: library/sys.rst:396 msgid "" "This function prints out a given traceback and exception to ``sys.stderr``." msgstr "" -#: library/sys.rst:387 +#: library/sys.rst:398 msgid "" "When an exception other than :exc:`SystemExit` is raised and uncaught, the " "interpreter calls ``sys.excepthook`` with three arguments, the exception " @@ -479,7 +489,7 @@ msgid "" "argument function to ``sys.excepthook``." msgstr "" -#: library/sys.rst:396 +#: library/sys.rst:407 msgid "" "Raise an auditing event ``sys.excepthook`` with arguments ``hook``, " "``type``, ``value``, ``traceback`` when an uncaught exception occurs. If no " @@ -489,14 +499,14 @@ msgid "" "excepthook`` will be called." msgstr "" -#: library/sys.rst:405 +#: library/sys.rst:416 msgid "" "The :func:`sys.unraisablehook` function handles unraisable exceptions and " "the :func:`threading.excepthook` function handles exception raised by :func:" "`threading.Thread.run`." msgstr "" -#: library/sys.rst:415 +#: library/sys.rst:426 msgid "" "These objects contain the original values of ``breakpointhook``, " "``displayhook``, ``excepthook``, and ``unraisablehook`` at the start of the " @@ -505,15 +515,15 @@ msgid "" "get replaced with broken or alternative objects." msgstr "" -#: library/sys.rst:421 +#: library/sys.rst:432 msgid "__breakpointhook__" msgstr "" -#: library/sys.rst:424 +#: library/sys.rst:435 msgid "__unraisablehook__" msgstr "" -#: library/sys.rst:430 +#: library/sys.rst:441 msgid "" "This function, when called while an exception handler is executing (such as " "an ``except`` or ``except*`` clause), returns the exception instance that " @@ -521,11 +531,11 @@ msgid "" "another, only the exception handled by the innermost handler is accessible." msgstr "" -#: library/sys.rst:435 +#: library/sys.rst:446 msgid "If no exception handler is executing, this function returns ``None``." msgstr "" -#: library/sys.rst:442 +#: library/sys.rst:453 msgid "" "This function returns the old-style representation of the handled exception. " "If an exception ``e`` is currently handled (so :func:`exception` would " @@ -536,13 +546,13 @@ msgid "" "stack at the point where the exception last occurred." msgstr "" -#: library/sys.rst:453 +#: library/sys.rst:464 msgid "" "If no exception is being handled anywhere on the stack, this function return " "a tuple containing three ``None`` values." msgstr "" -#: library/sys.rst:456 +#: library/sys.rst:467 msgid "" "The ``type`` and ``traceback`` fields are now derived from the ``value`` " "(the exception instance), so when an exception is modified while it is being " @@ -550,7 +560,7 @@ msgid "" "func:`exc_info`." msgstr "" -#: library/sys.rst:464 +#: library/sys.rst:475 msgid "" "A string giving the site-specific directory prefix where the platform-" "dependent Python files are installed; by default, this is also ``'/usr/" @@ -562,7 +572,7 @@ msgid "" "is the version number of Python, for example ``3.2``." msgstr "" -#: library/sys.rst:475 +#: library/sys.rst:486 msgid "" "If a :ref:`virtual environment ` is in effect, this value will be " "changed in ``site.py`` to point to the virtual environment. The value for " @@ -570,7 +580,7 @@ msgid "" "`base_exec_prefix`." msgstr "" -#: library/sys.rst:483 +#: library/sys.rst:494 msgid "" "A string giving the absolute path of the executable binary for the Python " "interpreter, on systems where this makes sense. If Python is unable to " @@ -578,13 +588,13 @@ msgid "" "empty string or ``None``." msgstr "" -#: library/sys.rst:491 +#: library/sys.rst:502 msgid "" "Raise a :exc:`SystemExit` exception, signaling an intention to exit the " "interpreter." msgstr "" -#: library/sys.rst:493 +#: library/sys.rst:504 msgid "" "The optional argument *arg* can be an integer giving the exit status " "(defaulting to zero), or another type of object. If it is an integer, zero " @@ -600,7 +610,7 @@ msgid "" "way to exit a program when an error occurs." msgstr "" -#: library/sys.rst:506 +#: library/sys.rst:517 msgid "" "Since :func:`exit` ultimately \"only\" raises an exception, it will only " "exit the process when called from the main thread, and the exception is not " @@ -609,127 +619,127 @@ msgid "" "an outer level." msgstr "" -#: library/sys.rst:511 +#: library/sys.rst:522 msgid "" "If an error occurs in the cleanup after the Python interpreter has caught :" "exc:`SystemExit` (such as an error flushing buffered data in the standard " "streams), the exit status is changed to 120." msgstr "" -#: library/sys.rst:519 +#: library/sys.rst:530 msgid "" "The :term:`named tuple` *flags* exposes the status of command line flags. " "The attributes are read only." msgstr "" -#: library/sys.rst:525 +#: library/sys.rst:536 msgid ":option:`-d`" msgstr "" -#: library/sys.rst:531 +#: library/sys.rst:542 msgid ":option:`-i`" msgstr "" -#: library/sys.rst:534 +#: library/sys.rst:545 msgid ":option:`-I`" msgstr "" -#: library/sys.rst:537 +#: library/sys.rst:548 msgid ":option:`-O` or :option:`-OO`" msgstr "" -#: library/sys.rst:540 +#: library/sys.rst:551 msgid ":option:`-B`" msgstr "" -#: library/sys.rst:543 +#: library/sys.rst:554 msgid ":option:`-s`" msgstr "" -#: library/sys.rst:546 +#: library/sys.rst:557 msgid ":option:`-S`" msgstr "" -#: library/sys.rst:549 +#: library/sys.rst:560 msgid ":option:`-E`" msgstr "" -#: library/sys.rst:552 +#: library/sys.rst:563 msgid ":option:`-v`" msgstr "" -#: library/sys.rst:555 +#: library/sys.rst:566 msgid ":option:`-b`" msgstr "" -#: library/sys.rst:558 +#: library/sys.rst:569 msgid ":option:`-q`" msgstr "" -#: library/sys.rst:561 +#: library/sys.rst:572 msgid ":option:`-R`" msgstr "" -#: library/sys.rst:564 +#: library/sys.rst:575 msgid ":option:`-X dev <-X>` (:ref:`Python Development Mode `)" msgstr "" -#: library/sys.rst:567 +#: library/sys.rst:578 msgid ":option:`-X utf8 <-X>`" msgstr "" -#: library/sys.rst:570 +#: library/sys.rst:581 msgid ":option:`-P`" msgstr "" -#: library/sys.rst:573 +#: library/sys.rst:584 msgid "" ":option:`-X int_max_str_digits <-X>` (:ref:`integer string conversion length " "limitation `)" msgstr "" -#: library/sys.rst:577 +#: library/sys.rst:588 msgid ":option:`-X warn_default_encoding <-X>`" msgstr "" -#: library/sys.rst:579 +#: library/sys.rst:590 msgid "Added ``quiet`` attribute for the new :option:`-q` flag." msgstr "" -#: library/sys.rst:582 +#: library/sys.rst:593 msgid "The ``hash_randomization`` attribute." msgstr "" -#: library/sys.rst:585 +#: library/sys.rst:596 msgid "Removed obsolete ``division_warning`` attribute." msgstr "" -#: library/sys.rst:588 +#: library/sys.rst:599 msgid "Added ``isolated`` attribute for :option:`-I` ``isolated`` flag." msgstr "" -#: library/sys.rst:591 +#: library/sys.rst:602 msgid "" "Added the ``dev_mode`` attribute for the new :ref:`Python Development Mode " "` and the ``utf8_mode`` attribute for the new :option:`-X` " "``utf8`` flag." msgstr "" -#: library/sys.rst:596 +#: library/sys.rst:607 msgid "" "Added ``warn_default_encoding`` attribute for :option:`-X` " "``warn_default_encoding`` flag." msgstr "" -#: library/sys.rst:599 +#: library/sys.rst:610 msgid "Added the ``safe_path`` attribute for :option:`-P` option." msgstr "" -#: library/sys.rst:602 +#: library/sys.rst:613 msgid "Added the ``int_max_str_digits`` attribute." msgstr "" -#: library/sys.rst:608 +#: library/sys.rst:619 msgid "" "A :term:`named tuple` holding information about the float type. It contains " "low level information about the precision and internal representation. The " @@ -739,161 +749,161 @@ msgid "" "floating types', for details." msgstr "" -#: library/sys.rst:615 +#: library/sys.rst:626 msgid "Attributes of the :data:`!float_info` :term:`named tuple`" msgstr "" -#: library/sys.rst:618 +#: library/sys.rst:629 msgid "attribute" msgstr "" -#: library/sys.rst:619 +#: library/sys.rst:630 msgid "float.h macro" msgstr "" -#: library/sys.rst:620 +#: library/sys.rst:631 msgid "explanation" msgstr "" -#: library/sys.rst:623 +#: library/sys.rst:634 msgid ":c:macro:`!DBL_EPSILON`" msgstr "" -#: library/sys.rst:624 +#: library/sys.rst:635 msgid "" "difference between 1.0 and the least value greater than 1.0 that is " "representable as a float." msgstr "" -#: library/sys.rst:627 +#: library/sys.rst:638 msgid "See also :func:`math.ulp`." msgstr "" -#: library/sys.rst:630 +#: library/sys.rst:641 msgid ":c:macro:`!DBL_DIG`" msgstr "" -#: library/sys.rst:631 +#: library/sys.rst:642 msgid "" "The maximum number of decimal digits that can be faithfully represented in a " "float; see below." msgstr "" -#: library/sys.rst:635 +#: library/sys.rst:646 msgid ":c:macro:`!DBL_MANT_DIG`" msgstr "" -#: library/sys.rst:636 +#: library/sys.rst:647 msgid "" "Float precision: the number of base-``radix`` digits in the significand of a " "float." msgstr "" -#: library/sys.rst:640 +#: library/sys.rst:651 msgid ":c:macro:`!DBL_MAX`" msgstr "" -#: library/sys.rst:641 +#: library/sys.rst:652 msgid "The maximum representable positive finite float." msgstr "" -#: library/sys.rst:644 +#: library/sys.rst:655 msgid ":c:macro:`!DBL_MAX_EXP`" msgstr "" -#: library/sys.rst:645 +#: library/sys.rst:656 msgid "" "The maximum integer *e* such that ``radix**(e-1)`` is a representable finite " "float." msgstr "" -#: library/sys.rst:649 +#: library/sys.rst:660 msgid ":c:macro:`!DBL_MAX_10_EXP`" msgstr "" -#: library/sys.rst:650 +#: library/sys.rst:661 msgid "" "The maximum integer *e* such that ``10**e`` is in the range of representable " "finite floats." msgstr "" -#: library/sys.rst:654 +#: library/sys.rst:665 msgid ":c:macro:`!DBL_MIN`" msgstr "" -#: library/sys.rst:655 +#: library/sys.rst:666 msgid "The minimum representable positive *normalized* float." msgstr "" -#: library/sys.rst:657 +#: library/sys.rst:668 msgid "" "Use :func:`math.ulp(0.0) ` to get the smallest positive " "*denormalized* representable float." msgstr "" -#: library/sys.rst:661 +#: library/sys.rst:672 msgid ":c:macro:`!DBL_MIN_EXP`" msgstr "" -#: library/sys.rst:662 +#: library/sys.rst:673 msgid "" "The minimum integer *e* such that ``radix**(e-1)`` is a normalized float." msgstr "" -#: library/sys.rst:666 +#: library/sys.rst:677 msgid ":c:macro:`!DBL_MIN_10_EXP`" msgstr "" -#: library/sys.rst:667 +#: library/sys.rst:678 msgid "The minimum integer *e* such that ``10**e`` is a normalized float." msgstr "" -#: library/sys.rst:670 +#: library/sys.rst:681 msgid ":c:macro:`!FLT_RADIX`" msgstr "" -#: library/sys.rst:671 +#: library/sys.rst:682 msgid "The radix of exponent representation." msgstr "" -#: library/sys.rst:674 +#: library/sys.rst:685 msgid ":c:macro:`!FLT_ROUNDS`" msgstr "" -#: library/sys.rst:675 +#: library/sys.rst:686 msgid "" "An integer representing the rounding mode for floating-point arithmetic. " "This reflects the value of the system :c:macro:`!FLT_ROUNDS` macro at " "interpreter startup time:" msgstr "" -#: library/sys.rst:679 +#: library/sys.rst:690 msgid "``-1``: indeterminable" msgstr "" -#: library/sys.rst:680 +#: library/sys.rst:691 msgid "``0``: toward zero" msgstr "" -#: library/sys.rst:681 +#: library/sys.rst:692 msgid "``1``: to nearest" msgstr "" -#: library/sys.rst:682 +#: library/sys.rst:693 msgid "``2``: toward positive infinity" msgstr "" -#: library/sys.rst:683 +#: library/sys.rst:694 msgid "``3``: toward negative infinity" msgstr "" -#: library/sys.rst:685 +#: library/sys.rst:696 msgid "" "All other values for :c:macro:`!FLT_ROUNDS` characterize implementation-" "defined rounding behavior." msgstr "" -#: library/sys.rst:688 +#: library/sys.rst:699 msgid "" "The attribute :attr:`sys.float_info.dig` needs further explanation. If " "``s`` is any string representing a decimal number with at most :attr:`!sys." @@ -901,7 +911,7 @@ msgid "" "back again will recover a string representing the same decimal value::" msgstr "" -#: library/sys.rst:694 +#: library/sys.rst:705 msgid "" ">>> import sys\n" ">>> sys.float_info.dig\n" @@ -911,20 +921,20 @@ msgid "" "'3.14159265358979'" msgstr "" -#: library/sys.rst:701 +#: library/sys.rst:712 msgid "" "But for strings with more than :attr:`sys.float_info.dig` significant " "digits, this isn't always true::" msgstr "" -#: library/sys.rst:704 +#: library/sys.rst:715 msgid "" ">>> s = '9876543211234567' # 16 significant digits is too many!\n" ">>> format(float(s), '.16g') # conversion changes value\n" "'9876543211234568'" msgstr "" -#: library/sys.rst:710 +#: library/sys.rst:721 msgid "" "A string indicating how the :func:`repr` function behaves for floats. If " "the string has value ``'short'`` then for a finite float ``x``, ``repr(x)`` " @@ -934,43 +944,47 @@ msgid "" "same way as it did in versions of Python prior to 3.1." msgstr "" -#: library/sys.rst:723 +#: library/sys.rst:734 msgid "" "Return the number of memory blocks currently allocated by the interpreter, " "regardless of their size. This function is mainly useful for tracking and " "debugging memory leaks. Because of the interpreter's internal caches, the " "result can vary from call to call; you may have to call :func:" -"`_clear_type_cache` and :func:`gc.collect` to get more predictable results." +"`_clear_internal_caches` and :func:`gc.collect` to get more predictable " +"results." msgstr "" -#: library/sys.rst:730 +#: library/sys.rst:741 msgid "" "If a Python build or implementation cannot reasonably compute this " "information, :func:`getallocatedblocks` is allowed to return 0 instead." msgstr "" -#: library/sys.rst:738 +#: library/sys.rst:749 msgid "Return the number of unicode objects that have been interned." msgstr "" -#: library/sys.rst:745 -msgid "Return the build time API version of Android as an integer." +#: library/sys.rst:756 +msgid "" +"Return the build-time API level of Android as an integer. This represents " +"the minimum version of Android this build of Python can run on. For runtime " +"version information, see :func:`platform.android_ver`." msgstr "" -#: library/sys.rst:754 +#: library/sys.rst:767 msgid "" "Return ``'utf-8'``. This is the name of the default string encoding, used in " "methods like :meth:`str.encode`." msgstr "" -#: library/sys.rst:760 +#: library/sys.rst:773 msgid "" "Return the current value of the flags that are used for :c:func:`dlopen` " "calls. Symbolic names for the flag values can be found in the :mod:`os` " "module (:samp:`RTLD_{xxx}` constants, e.g. :const:`os.RTLD_LAZY`)." msgstr "" -#: library/sys.rst:770 +#: library/sys.rst:783 msgid "" "Get the :term:`filesystem encoding `: " "the encoding used with the :term:`filesystem error handler ` is enabled." msgstr "" -#: library/sys.rst:803 +#: library/sys.rst:816 msgid "" "Get the :term:`filesystem error handler `: the error handler used with the :term:`filesystem encoding " @@ -1025,35 +1039,35 @@ msgid "" "func:`getfilesystemencoding`." msgstr "" -#: library/sys.rst:821 +#: library/sys.rst:834 msgid "" "Returns the current value for the :ref:`integer string conversion length " "limitation `. See also :func:`set_int_max_str_digits`." msgstr "" -#: library/sys.rst:828 +#: library/sys.rst:841 msgid "" "Return the reference count of the *object*. The count returned is generally " "one higher than you might expect, because it includes the (temporary) " "reference as an argument to :func:`getrefcount`." msgstr "" -#: library/sys.rst:832 +#: library/sys.rst:845 msgid "" "Note that the returned value may not actually reflect how many references to " -"the object are actually held. For example, some objects are \"immortal\" " -"and have a very high refcount that does not reflect the actual number of " -"references. Consequently, do not rely on the returned value to be accurate, " -"other than a value of 0 or 1." +"the object are actually held. For example, some objects are :term:" +"`immortal` and have a very high refcount that does not reflect the actual " +"number of references. Consequently, do not rely on the returned value to be " +"accurate, other than a value of 0 or 1." msgstr "" -#: library/sys.rst:838 +#: library/sys.rst:851 msgid "" "Immortal objects have very large refcounts that do not match the actual " "number of references to the object." msgstr "" -#: library/sys.rst:844 +#: library/sys.rst:857 msgid "" "Return the current value of the recursion limit, the maximum depth of the " "Python interpreter stack. This limit prevents infinite recursion from " @@ -1061,33 +1075,33 @@ msgid "" "func:`setrecursionlimit`." msgstr "" -#: library/sys.rst:852 +#: library/sys.rst:865 msgid "" "Return the size of an object in bytes. The object can be any type of object. " "All built-in objects will return correct results, but this does not have to " "hold true for third-party extensions as it is implementation specific." msgstr "" -#: library/sys.rst:857 +#: library/sys.rst:870 msgid "" "Only the memory consumption directly attributed to the object is accounted " "for, not the memory consumption of objects it refers to." msgstr "" -#: library/sys.rst:860 +#: library/sys.rst:873 msgid "" "If given, *default* will be returned if the object does not provide means to " "retrieve the size. Otherwise a :exc:`TypeError` will be raised." msgstr "" -#: library/sys.rst:863 +#: library/sys.rst:876 msgid "" ":func:`getsizeof` calls the object's ``__sizeof__`` method and adds an " "additional garbage collector overhead if the object is managed by the " "garbage collector." msgstr "" -#: library/sys.rst:867 +#: library/sys.rst:880 msgid "" "See `recursive sizeof recipe `_ for an example of " @@ -1095,13 +1109,13 @@ msgid "" "their contents." msgstr "" -#: library/sys.rst:873 +#: library/sys.rst:886 msgid "" "Return the interpreter's \"thread switch interval\" in seconds; see :func:" "`setswitchinterval`." msgstr "" -#: library/sys.rst:881 +#: library/sys.rst:894 msgid "" "Return a frame object from the call stack. If optional integer *depth* is " "given, return the frame object that many calls below the top of the stack. " @@ -1110,19 +1124,19 @@ msgid "" "stack." msgstr "" -#: library/sys.rst:886 +#: library/sys.rst:899 msgid "" "Raises an :ref:`auditing event ` ``sys._getframe`` with argument " "``frame``." msgstr "" -#: library/sys.rst:906 +#: library/sys.rst:919 msgid "" "This function should be used for internal and specialized purposes only. It " "is not guaranteed to exist in all implementations of Python." msgstr "" -#: library/sys.rst:896 +#: library/sys.rst:909 msgid "" "Return the name of a module from the call stack. If optional integer " "*depth* is given, return the module that many calls below the top of the " @@ -1131,26 +1145,26 @@ msgid "" "returning the module at the top of the call stack." msgstr "" -#: library/sys.rst:902 +#: library/sys.rst:915 msgid "" "Raises an :ref:`auditing event ` ``sys._getframemodulename`` with " "argument ``depth``." msgstr "" -#: library/sys.rst:912 +#: library/sys.rst:925 msgid "" "This function only exists if CPython was built using the specialized " "configure option :option:`--with-trace-refs`. It is intended only for " "debugging garbage-collection issues." msgstr "" -#: library/sys.rst:916 +#: library/sys.rst:929 msgid "" "Return a list of up to *limit* dynamically allocated Python objects. If " "*type* is given, only objects of that exact type (not subtypes) are included." msgstr "" -#: library/sys.rst:920 +#: library/sys.rst:933 msgid "" "Objects from the list are not safe to use. Specifically, the result will " "include objects from all interpreters that share their object allocator " @@ -1160,25 +1174,25 @@ msgid "" "different interpreters may lead to crashes or other unexpected behavior." msgstr "" -#: library/sys.rst:931 +#: library/sys.rst:944 msgid "" "This function should be used for specialized purposes only. It is not " "guaranteed to exist in all implementations of Python." msgstr "" -#: library/sys.rst:936 +#: library/sys.rst:949 msgid "The result may include objects from other interpreters." msgstr "" -#: library/sys.rst:945 +#: library/sys.rst:958 msgid "Get the profiler function as set by :func:`setprofile`." msgstr "" -#: library/sys.rst:954 +#: library/sys.rst:967 msgid "Get the trace function as set by :func:`settrace`." msgstr "" -#: library/sys.rst:958 +#: library/sys.rst:971 msgid "" "The :func:`gettrace` function is intended only for implementing debuggers, " "profilers, coverage tools and the like. Its behavior is part of the " @@ -1186,7 +1200,7 @@ msgid "" "thus may not be available in all Python implementations." msgstr "" -#: library/sys.rst:966 +#: library/sys.rst:979 msgid "" "Return a named tuple describing the Windows version currently running. The " "named elements are *major*, *minor*, *build*, *platform*, *service_pack*, " @@ -1198,54 +1212,54 @@ msgid "" "first 5 elements are retrievable by indexing." msgstr "" -#: library/sys.rst:977 +#: library/sys.rst:990 msgid "*platform* will be ``2`` (VER_PLATFORM_WIN32_NT)." msgstr "" -#: library/sys.rst:979 +#: library/sys.rst:992 msgid "*product_type* may be one of the following values:" msgstr "" -#: library/sys.rst:982 +#: library/sys.rst:995 msgid "Constant" msgstr "" -#: library/sys.rst:982 +#: library/sys.rst:995 msgid "Meaning" msgstr "" -#: library/sys.rst:984 +#: library/sys.rst:997 msgid "``1`` (VER_NT_WORKSTATION)" msgstr "" -#: library/sys.rst:984 +#: library/sys.rst:997 msgid "The system is a workstation." msgstr "" -#: library/sys.rst:986 +#: library/sys.rst:999 msgid "``2`` (VER_NT_DOMAIN_CONTROLLER)" msgstr "" -#: library/sys.rst:986 +#: library/sys.rst:999 msgid "The system is a domain controller." msgstr "" -#: library/sys.rst:989 +#: library/sys.rst:1002 msgid "``3`` (VER_NT_SERVER)" msgstr "" -#: library/sys.rst:989 +#: library/sys.rst:1002 msgid "The system is a server, but not a domain controller." msgstr "" -#: library/sys.rst:993 +#: library/sys.rst:1006 msgid "" "This function wraps the Win32 :c:func:`!GetVersionEx` function; see the " "Microsoft documentation on :c:func:`!OSVERSIONINFOEX` for more information " "about these fields." msgstr "" -#: library/sys.rst:997 +#: library/sys.rst:1010 msgid "" "*platform_version* returns the major version, minor version and build number " "of the current operating system, rather than the version that is being " @@ -1253,24 +1267,24 @@ msgid "" "feature detection." msgstr "" -#: library/sys.rst:1003 +#: library/sys.rst:1016 msgid "" "*platform_version* derives the version from kernel32.dll which can be of a " "different version than the OS version. Please use :mod:`platform` module for " "achieving accurate OS version." msgstr "" -#: library/sys.rst:1009 +#: library/sys.rst:1022 msgid "" "Changed to a named tuple and added *service_pack_minor*, " "*service_pack_major*, *suite_mask*, and *product_type*." msgstr "" -#: library/sys.rst:1013 +#: library/sys.rst:1026 msgid "Added *platform_version*" msgstr "" -#: library/sys.rst:1019 +#: library/sys.rst:1032 msgid "" "Returns an *asyncgen_hooks* object, which is similar to a :class:" "`~collections.namedtuple` of the form ``(firstiter, finalizer)``, where " @@ -1280,71 +1294,71 @@ msgid "" "loop." msgstr "" -#: library/sys.rst:1026 +#: library/sys.rst:1039 msgid "See :pep:`525` for more details." msgstr "" -#: library/sys.rst:1707 +#: library/sys.rst:1734 msgid "" "This function has been added on a provisional basis (see :pep:`411` for " "details.)" msgstr "" -#: library/sys.rst:1036 +#: library/sys.rst:1049 msgid "" "Get the current coroutine origin tracking depth, as set by :func:" "`set_coroutine_origin_tracking_depth`." msgstr "" -#: library/sys.rst:1728 +#: library/sys.rst:1755 msgid "" "This function has been added on a provisional basis (see :pep:`411` for " "details.) Use it only for debugging purposes." msgstr "" -#: library/sys.rst:1048 +#: library/sys.rst:1061 msgid "" "A :term:`named tuple` giving parameters of the numeric hash implementation. " "For more details about hashing of numeric types, see :ref:`numeric-hash`." msgstr "" -#: library/sys.rst:1054 +#: library/sys.rst:1067 msgid "The width in bits used for hash values" msgstr "" -#: library/sys.rst:1058 +#: library/sys.rst:1071 msgid "The prime modulus P used for numeric hash scheme" msgstr "" -#: library/sys.rst:1062 +#: library/sys.rst:1075 msgid "The hash value returned for a positive infinity" msgstr "" -#: library/sys.rst:1066 +#: library/sys.rst:1079 msgid "(This attribute is no longer used)" msgstr "" -#: library/sys.rst:1070 +#: library/sys.rst:1083 msgid "The multiplier used for the imaginary part of a complex number" msgstr "" -#: library/sys.rst:1074 +#: library/sys.rst:1087 msgid "The name of the algorithm for hashing of str, bytes, and memoryview" msgstr "" -#: library/sys.rst:1078 +#: library/sys.rst:1091 msgid "The internal output size of the hash algorithm" msgstr "" -#: library/sys.rst:1082 +#: library/sys.rst:1095 msgid "The size of the seed key of the hash algorithm" msgstr "" -#: library/sys.rst:1086 +#: library/sys.rst:1099 msgid "Added *algorithm*, *hash_bits* and *seed_bits*" msgstr "" -#: library/sys.rst:1092 +#: library/sys.rst:1105 msgid "" "The version number encoded as a single integer. This is guaranteed to " "increase with each version, including proper support for non-production " @@ -1352,7 +1366,7 @@ msgid "" "version 1.5.2, use::" msgstr "" -#: library/sys.rst:1096 +#: library/sys.rst:1109 msgid "" "if sys.hexversion >= 0x010502F0:\n" " # use some advanced feature\n" @@ -1362,7 +1376,7 @@ msgid "" " ..." msgstr "" -#: library/sys.rst:1103 +#: library/sys.rst:1116 msgid "" "This is called ``hexversion`` since it only really looks meaningful when " "viewed as the result of passing it to the built-in :func:`hex` function. " @@ -1370,25 +1384,25 @@ msgid "" "human-friendly encoding of the same information." msgstr "" -#: library/sys.rst:1108 +#: library/sys.rst:1121 msgid "More details of ``hexversion`` can be found at :ref:`apiabiversion`." msgstr "" -#: library/sys.rst:1113 +#: library/sys.rst:1126 msgid "" "An object containing information about the implementation of the currently " "running Python interpreter. The following attributes are required to exist " "in all Python implementations." msgstr "" -#: library/sys.rst:1117 +#: library/sys.rst:1130 msgid "" "*name* is the implementation's identifier, e.g. ``'cpython'``. The actual " "string is defined by the Python implementation, but it is guaranteed to be " "lower case." msgstr "" -#: library/sys.rst:1121 +#: library/sys.rst:1134 msgid "" "*version* is a named tuple, in the same format as :data:`sys.version_info`. " "It represents the version of the Python *implementation*. This has a " @@ -1400,13 +1414,13 @@ msgid "" "the same value, since it is the reference implementation." msgstr "" -#: library/sys.rst:1131 +#: library/sys.rst:1144 msgid "" "*hexversion* is the implementation version in hexadecimal format, like :data:" "`sys.hexversion`." msgstr "" -#: library/sys.rst:1134 +#: library/sys.rst:1147 msgid "" "*cache_tag* is the tag used by the import machinery in the filenames of " "cached modules. By convention, it would be a composite of the " @@ -1415,7 +1429,7 @@ msgid "" "set to ``None``, it indicates that module caching should be disabled." msgstr "" -#: library/sys.rst:1141 +#: library/sys.rst:1154 msgid "" ":data:`sys.implementation` may contain additional attributes specific to the " "Python implementation. These non-standard attributes must start with an " @@ -1425,47 +1439,47 @@ msgid "" "versions, however.) See :pep:`421` for more information." msgstr "" -#: library/sys.rst:1152 +#: library/sys.rst:1165 msgid "" "The addition of new required attributes must go through the normal PEP " "process. See :pep:`421` for more information." msgstr "" -#: library/sys.rst:1157 +#: library/sys.rst:1170 msgid "" "A :term:`named tuple` that holds information about Python's internal " "representation of integers. The attributes are read only." msgstr "" -#: library/sys.rst:1162 +#: library/sys.rst:1175 msgid "" "The number of bits held in each digit. Python integers are stored internally " "in base ``2**int_info.bits_per_digit``." msgstr "" -#: library/sys.rst:1167 +#: library/sys.rst:1180 msgid "The size in bytes of the C type used to represent a digit." msgstr "" -#: library/sys.rst:1171 +#: library/sys.rst:1184 msgid "" "The default value for :func:`sys.get_int_max_str_digits` when it is not " "otherwise explicitly configured." msgstr "" -#: library/sys.rst:1176 +#: library/sys.rst:1189 msgid "" "The minimum non-zero value for :func:`sys.set_int_max_str_digits`, :envvar:" "`PYTHONINTMAXSTRDIGITS`, or :option:`-X int_max_str_digits <-X>`." msgstr "" -#: library/sys.rst:1183 +#: library/sys.rst:1196 msgid "" "Added :attr:`~int_info.default_max_str_digits` and :attr:`~int_info." "str_digits_check_threshold`." msgstr "" -#: library/sys.rst:1189 +#: library/sys.rst:1202 msgid "" "When this attribute exists, its value is automatically called (with no " "arguments) when the interpreter is launched in :ref:`interactive mode `." msgstr "" -#: library/sys.rst:1197 +#: library/sys.rst:1210 msgid "" "Raises an :ref:`auditing event ` ``cpython.run_interactivehook`` " "with the hook object as the argument when the hook is called on startup." msgstr "" -#: library/sys.rst:1206 +#: library/sys.rst:1219 msgid "" "Enter *string* in the table of \"interned\" strings and return the interned " "string -- which is *string* itself or a copy. Interning strings is useful to " @@ -1492,19 +1506,33 @@ msgid "" "attributes have interned keys." msgstr "" -#: library/sys.rst:1214 +#: library/sys.rst:1227 msgid "" -"Interned strings are not immortal; you must keep a reference to the return " -"value of :func:`intern` around to benefit from it." +"Interned strings are not :term:`immortal`; you must keep a reference to the " +"return value of :func:`intern` around to benefit from it." msgstr "" -#: library/sys.rst:1220 +#: library/sys.rst:1233 msgid "" -"Return :const:`True` if the Python interpreter is :term:`shutting down " -"`, :const:`False` otherwise." +"Return :const:`True` if the :term:`GIL` is enabled and :const:`False` if it " +"is disabled." msgstr "" -#: library/sys.rst:1227 +#: library/sys.rst:1272 +msgid "It is not guaranteed to exist in all implementations of Python." +msgstr "" + +#: library/sys.rst:1244 +msgid "" +"Return :const:`True` if the main Python interpreter is :term:`shutting down " +"`. Return :const:`False` otherwise." +msgstr "" + +#: library/sys.rst:1247 +msgid "See also the :exc:`PythonFinalizationError` exception." +msgstr "" + +#: library/sys.rst:1253 msgid "" "This variable is not always defined; it is set to the exception instance " "when an exception is not handled and the interpreter prints an error message " @@ -1515,34 +1543,40 @@ msgid "" "more information.)" msgstr "" -#: library/sys.rst:1241 +#: library/sys.rst:1265 +msgid "" +"Return :const:`True` if the given string is \"interned\", :const:`False` " +"otherwise." +msgstr "" + +#: library/sys.rst:1279 msgid "" "These three variables are deprecated; use :data:`sys.last_exc` instead. They " "hold the legacy representation of ``sys.last_exc``, as returned from :func:" "`exc_info` above." msgstr "" -#: library/sys.rst:1247 +#: library/sys.rst:1285 msgid "" "An integer giving the maximum value a variable of type :c:type:`Py_ssize_t` " "can take. It's usually ``2**31 - 1`` on a 32-bit platform and ``2**63 - 1`` " "on a 64-bit platform." msgstr "" -#: library/sys.rst:1254 +#: library/sys.rst:1292 msgid "" "An integer giving the value of the largest Unicode code point, i.e. " "``1114111`` (``0x10FFFF`` in hexadecimal)." msgstr "" -#: library/sys.rst:1257 +#: library/sys.rst:1295 msgid "" "Before :pep:`393`, ``sys.maxunicode`` used to be either ``0xFFFF`` or " "``0x10FFFF``, depending on the configuration option that specified whether " "Unicode characters were stored as UCS-2 or UCS-4." msgstr "" -#: library/sys.rst:1265 +#: library/sys.rst:1303 msgid "" "A list of :term:`meta path finder` objects that have their :meth:`~importlib." "abc.MetaPathFinder.find_spec` methods called to see if one of the objects " @@ -1555,40 +1589,40 @@ msgid "" "``None`` if the module cannot be found." msgstr "" -#: library/sys.rst:1278 +#: library/sys.rst:1316 msgid ":class:`importlib.abc.MetaPathFinder`" msgstr "" -#: library/sys.rst:1279 +#: library/sys.rst:1317 msgid "" "The abstract base class defining the interface of finder objects on :data:" "`meta_path`." msgstr "" -#: library/sys.rst:1281 +#: library/sys.rst:1319 msgid ":class:`importlib.machinery.ModuleSpec`" msgstr "" -#: library/sys.rst:1282 +#: library/sys.rst:1320 msgid "" "The concrete class which :meth:`~importlib.abc.MetaPathFinder.find_spec` " "should return instances of." msgstr "" -#: library/sys.rst:1288 +#: library/sys.rst:1326 msgid "" ":term:`Module specs ` were introduced in Python 3.4, by :pep:" "`451`." msgstr "" -#: library/sys.rst:1293 +#: library/sys.rst:1331 msgid "" "Removed the fallback that looked for a :meth:`!find_module` method if a :" "data:`meta_path` entry didn't have a :meth:`~importlib.abc.MetaPathFinder." "find_spec` method." msgstr "" -#: library/sys.rst:1299 +#: library/sys.rst:1337 msgid "" "This is a dictionary that maps module names to modules which have already " "been loaded. This can be manipulated to force reloading of modules and " @@ -1600,13 +1634,13 @@ msgid "" "other threads." msgstr "" -#: library/sys.rst:1311 +#: library/sys.rst:1349 msgid "" "The list of the original command line arguments passed to the Python " "executable." msgstr "" -#: library/sys.rst:1314 +#: library/sys.rst:1352 msgid "" "The elements of :data:`sys.orig_argv` are the arguments to the Python " "interpreter, while the elements of :data:`sys.argv` are the arguments to the " @@ -1614,68 +1648,68 @@ msgid "" "in :data:`sys.orig_argv` and missing from :data:`sys.argv`." msgstr "" -#: library/sys.rst:1326 +#: library/sys.rst:1364 msgid "" "A list of strings that specifies the search path for modules. Initialized " "from the environment variable :envvar:`PYTHONPATH`, plus an installation-" "dependent default." msgstr "" -#: library/sys.rst:1330 +#: library/sys.rst:1368 msgid "" "By default, as initialized upon program startup, a potentially unsafe path " "is prepended to :data:`sys.path` (*before* the entries inserted as a result " "of :envvar:`PYTHONPATH`):" msgstr "" -#: library/sys.rst:1334 +#: library/sys.rst:1372 msgid "" "``python -m module`` command line: prepend the current working directory." msgstr "" -#: library/sys.rst:1336 +#: library/sys.rst:1374 msgid "" "``python script.py`` command line: prepend the script's directory. If it's a " "symbolic link, resolve symbolic links." msgstr "" -#: library/sys.rst:1338 +#: library/sys.rst:1376 msgid "" "``python -c code`` and ``python`` (REPL) command lines: prepend an empty " "string, which means the current working directory." msgstr "" -#: library/sys.rst:1341 +#: library/sys.rst:1379 msgid "" "To not prepend this potentially unsafe path, use the :option:`-P` command " "line option or the :envvar:`PYTHONSAFEPATH` environment variable." msgstr "" -#: library/sys.rst:1344 +#: library/sys.rst:1382 msgid "" "A program is free to modify this list for its own purposes. Only strings " "should be added to :data:`sys.path`; all other data types are ignored during " "import." msgstr "" -#: library/sys.rst:1350 +#: library/sys.rst:1388 msgid "" "Module :mod:`site` This describes how to use .pth files to extend :data:`sys." "path`." msgstr "" -#: library/sys.rst:1355 +#: library/sys.rst:1393 msgid "" "A list of callables that take a path argument to try to create a :term:" "`finder` for the path. If a finder can be created, it is to be returned by " "the callable, else raise :exc:`ImportError`." msgstr "" -#: library/sys.rst:1370 +#: library/sys.rst:1408 msgid "Originally specified in :pep:`302`." msgstr "" -#: library/sys.rst:1364 +#: library/sys.rst:1402 msgid "" "A dictionary acting as a cache for :term:`finder` objects. The keys are " "paths that have been passed to :data:`sys.path_hooks` and the values are the " @@ -1683,166 +1717,174 @@ msgid "" "is found on :data:`sys.path_hooks` then ``None`` is stored." msgstr "" -#: library/sys.rst:1375 -msgid "" -"This string contains a platform identifier that can be used to append " -"platform-specific components to :data:`sys.path`, for instance." -msgstr "" - -#: library/sys.rst:1378 -msgid "" -"For Unix systems, except on Linux and AIX, this is the lowercased OS name as " -"returned by ``uname -s`` with the first part of the version as returned by " -"``uname -r`` appended, e.g. ``'sunos5'`` or ``'freebsd8'``, *at the time " -"when Python was built*. Unless you want to test for a specific system " -"version, it is therefore recommended to use the following idiom::" -msgstr "" - -#: library/sys.rst:1384 -msgid "" -"if sys.platform.startswith('freebsd'):\n" -" # FreeBSD-specific code here...\n" -"elif sys.platform.startswith('linux'):\n" -" # Linux-specific code here...\n" -"elif sys.platform.startswith('aix'):\n" -" # AIX-specific code here..." -msgstr "" - -#: library/sys.rst:1391 -msgid "For other systems, the values are:" +#: library/sys.rst:1413 +msgid "A string containing a platform identifier. Known values are:" msgstr "" -#: library/sys.rst:1394 +#: library/sys.rst:1416 msgid "System" msgstr "" -#: library/sys.rst:1394 +#: library/sys.rst:1416 msgid "``platform`` value" msgstr "" -#: library/sys.rst:1396 +#: library/sys.rst:1418 msgid "AIX" msgstr "" -#: library/sys.rst:1396 +#: library/sys.rst:1418 msgid "``'aix'``" msgstr "" -#: library/sys.rst:1397 +#: library/sys.rst:1419 +msgid "Android" +msgstr "" + +#: library/sys.rst:1419 +msgid "``'android'``" +msgstr "" + +#: library/sys.rst:1420 msgid "Emscripten" msgstr "" -#: library/sys.rst:1397 +#: library/sys.rst:1420 msgid "``'emscripten'``" msgstr "" -#: library/sys.rst:1398 +#: library/sys.rst:1421 +msgid "iOS" +msgstr "" + +#: library/sys.rst:1421 +msgid "``'ios'``" +msgstr "" + +#: library/sys.rst:1422 msgid "Linux" msgstr "" -#: library/sys.rst:1398 +#: library/sys.rst:1422 msgid "``'linux'``" msgstr "" -#: library/sys.rst:1399 -msgid "WASI" +#: library/sys.rst:1423 +msgid "macOS" msgstr "" -#: library/sys.rst:1399 -msgid "``'wasi'``" +#: library/sys.rst:1423 +msgid "``'darwin'``" msgstr "" -#: library/sys.rst:1400 +#: library/sys.rst:1424 msgid "Windows" msgstr "" -#: library/sys.rst:1400 +#: library/sys.rst:1424 msgid "``'win32'``" msgstr "" -#: library/sys.rst:1401 +#: library/sys.rst:1425 msgid "Windows/Cygwin" msgstr "" -#: library/sys.rst:1401 +#: library/sys.rst:1425 msgid "``'cygwin'``" msgstr "" -#: library/sys.rst:1402 -msgid "macOS" +#: library/sys.rst:1426 +msgid "WASI" msgstr "" -#: library/sys.rst:1402 -msgid "``'darwin'``" +#: library/sys.rst:1426 +msgid "``'wasi'``" +msgstr "" + +#: library/sys.rst:1429 +msgid "" +"On Unix systems not listed in the table, the value is the lowercased OS name " +"as returned by ``uname -s``, with the first part of the version as returned " +"by ``uname -r`` appended, e.g. ``'sunos5'`` or ``'freebsd8'``, *at the time " +"when Python was built*. Unless you want to test for a specific system " +"version, it is therefore recommended to use the following idiom::" msgstr "" -#: library/sys.rst:1405 +#: library/sys.rst:1435 +msgid "" +"if sys.platform.startswith('freebsd'):\n" +" # FreeBSD-specific code here..." +msgstr "" + +#: library/sys.rst:1438 msgid "" "On Linux, :data:`sys.platform` doesn't contain the major version anymore. It " -"is always ``'linux'``, instead of ``'linux2'`` or ``'linux3'``. Since older " -"Python versions include the version number, it is recommended to always use " -"the ``startswith`` idiom presented above." +"is always ``'linux'``, instead of ``'linux2'`` or ``'linux3'``." msgstr "" -#: library/sys.rst:1411 +#: library/sys.rst:1442 msgid "" "On AIX, :data:`sys.platform` doesn't contain the major version anymore. It " -"is always ``'aix'``, instead of ``'aix5'`` or ``'aix7'``. Since older " -"Python versions include the version number, it is recommended to always use " -"the ``startswith`` idiom presented above." +"is always ``'aix'``, instead of ``'aix5'`` or ``'aix7'``." msgstr "" -#: library/sys.rst:1419 +#: library/sys.rst:1446 +msgid "" +"On Android, :data:`sys.platform` now returns ``'android'`` rather than " +"``'linux'``." +msgstr "" + +#: library/sys.rst:1452 msgid "" ":data:`os.name` has a coarser granularity. :func:`os.uname` gives system-" "dependent version information." msgstr "" -#: library/sys.rst:1422 +#: library/sys.rst:1455 msgid "" "The :mod:`platform` module provides detailed checks for the system's " "identity." msgstr "" -#: library/sys.rst:1428 +#: library/sys.rst:1461 msgid "" "Name of the platform-specific library directory. It is used to build the " "path of standard library and the paths of installed extension modules." msgstr "" -#: library/sys.rst:1431 +#: library/sys.rst:1464 msgid "" "It is equal to ``\"lib\"`` on most platforms. On Fedora and SuSE, it is " "equal to ``\"lib64\"`` on 64-bit platforms which gives the following ``sys." "path`` paths (where ``X.Y`` is the Python ``major.minor`` version):" msgstr "" -#: library/sys.rst:1435 +#: library/sys.rst:1468 msgid "" "``/usr/lib64/pythonX.Y/``: Standard library (like ``os.py`` of the :mod:`os` " "module)" msgstr "" -#: library/sys.rst:1437 +#: library/sys.rst:1470 msgid "" "``/usr/lib64/pythonX.Y/lib-dynload/``: C extension modules of the standard " "library (like the :mod:`errno` module, the exact filename is platform " "specific)" msgstr "" -#: library/sys.rst:1440 +#: library/sys.rst:1473 msgid "" "``/usr/lib/pythonX.Y/site-packages/`` (always use ``lib``, not :data:`sys." "platlibdir`): Third-party modules" msgstr "" -#: library/sys.rst:1442 +#: library/sys.rst:1475 msgid "" "``/usr/lib64/pythonX.Y/site-packages/``: C extension modules of third-party " "packages" msgstr "" -#: library/sys.rst:1450 +#: library/sys.rst:1483 msgid "" "A string giving the site-specific directory prefix where the platform " "independent Python files are installed; on Unix, the default is :file:`/usr/" @@ -1851,14 +1893,14 @@ msgid "" "derived paths." msgstr "" -#: library/sys.rst:1456 +#: library/sys.rst:1489 msgid "" "If a :ref:`virtual environment ` is in effect, this value will be " "changed in ``site.py`` to point to the virtual environment. The value for " "the Python installation will still be available, via :data:`base_prefix`." msgstr "" -#: library/sys.rst:1471 +#: library/sys.rst:1504 msgid "" "Strings specifying the primary and secondary prompt of the interpreter. " "These are only defined if the interpreter is in interactive mode. Their " @@ -1868,7 +1910,7 @@ msgid "" "used to implement a dynamic prompt." msgstr "" -#: library/sys.rst:1481 +#: library/sys.rst:1514 msgid "" "Set the flags used by the interpreter for :c:func:`dlopen` calls, such as " "when the interpreter loads extension modules. Among other things, this will " @@ -1879,14 +1921,14 @@ msgid "" "g. :const:`os.RTLD_LAZY`)." msgstr "" -#: library/sys.rst:1493 +#: library/sys.rst:1526 msgid "" "Set the :ref:`integer string conversion length limitation " "` used by this interpreter. See also :func:" "`get_int_max_str_digits`." msgstr "" -#: library/sys.rst:1505 +#: library/sys.rst:1538 msgid "" "Set the system's profile function, which allows you to implement a Python " "source code profiler in Python. See chapter :ref:`profile` for more " @@ -1901,14 +1943,14 @@ msgid "" "in the profile function will cause itself unset." msgstr "" -#: library/sys.rst:1517 +#: library/sys.rst:1550 msgid "" "The same tracing mechanism is used for :func:`!setprofile` as :func:" "`settrace`. To trace calls with :func:`!setprofile` inside a tracing " "function (e.g. in a debugger breakpoint), see :func:`call_tracing`." msgstr "" -#: library/sys.rst:1521 +#: library/sys.rst:1554 msgid "" "Profile functions should have three arguments: *frame*, *event*, and *arg*. " "*frame* is the current stack frame. *event* is a string: ``'call'``, " @@ -1916,71 +1958,71 @@ msgid "" "depends on the event type." msgstr "" -#: library/sys.rst:1613 +#: library/sys.rst:1646 msgid "The events have the following meaning:" msgstr "" -#: library/sys.rst:1615 +#: library/sys.rst:1648 msgid "``'call'``" msgstr "" -#: library/sys.rst:1529 +#: library/sys.rst:1562 msgid "" "A function is called (or some other code block entered). The profile " "function is called; *arg* is ``None``." msgstr "" -#: library/sys.rst:1630 +#: library/sys.rst:1663 msgid "``'return'``" msgstr "" -#: library/sys.rst:1533 +#: library/sys.rst:1566 msgid "" "A function (or other code block) is about to return. The profile function " "is called; *arg* is the value that will be returned, or ``None`` if the " "event is caused by an exception being raised." msgstr "" -#: library/sys.rst:1537 +#: library/sys.rst:1570 msgid "``'c_call'``" msgstr "" -#: library/sys.rst:1538 +#: library/sys.rst:1571 msgid "" "A C function is about to be called. This may be an extension function or a " "built-in. *arg* is the C function object." msgstr "" -#: library/sys.rst:1541 +#: library/sys.rst:1574 msgid "``'c_return'``" msgstr "" -#: library/sys.rst:1542 +#: library/sys.rst:1575 msgid "A C function has returned. *arg* is the C function object." msgstr "" -#: library/sys.rst:1544 +#: library/sys.rst:1577 msgid "``'c_exception'``" msgstr "" -#: library/sys.rst:1545 +#: library/sys.rst:1578 msgid "A C function has raised an exception. *arg* is the C function object." msgstr "" -#: library/sys.rst:1547 +#: library/sys.rst:1580 msgid "" "Raises an :ref:`auditing event ` ``sys.setprofile`` with no " "arguments." msgstr "" -#: library/sys.rst:1552 +#: library/sys.rst:1585 msgid "" "Set the maximum depth of the Python interpreter stack to *limit*. This " "limit prevents infinite recursion from causing an overflow of the C stack " "and crashing Python." msgstr "" -#: library/sys.rst:1556 +#: library/sys.rst:1589 msgid "" "The highest possible limit is platform-dependent. A user may need to set " "the limit higher when they have a program that requires deep recursion and a " @@ -1988,19 +2030,19 @@ msgid "" "because a too-high limit can lead to a crash." msgstr "" -#: library/sys.rst:1561 +#: library/sys.rst:1594 msgid "" "If the new limit is too low at the current recursion depth, a :exc:" "`RecursionError` exception is raised." msgstr "" -#: library/sys.rst:1564 +#: library/sys.rst:1597 msgid "" "A :exc:`RecursionError` exception is now raised if the new limit is too low " "at the current recursion depth." msgstr "" -#: library/sys.rst:1571 +#: library/sys.rst:1604 msgid "" "Set the interpreter's thread switch interval (in seconds). This floating-" "point value determines the ideal duration of the \"timeslices\" allocated to " @@ -2011,7 +2053,7 @@ msgid "" "scheduler." msgstr "" -#: library/sys.rst:1588 +#: library/sys.rst:1621 msgid "" "Set the system's trace function, which allows you to implement a Python " "source code debugger in Python. The function is thread-specific; for a " @@ -2020,7 +2062,7 @@ msgid "" "`threading.settrace`." msgstr "" -#: library/sys.rst:1593 +#: library/sys.rst:1626 msgid "" "Trace functions should have three arguments: *frame*, *event*, and *arg*. " "*frame* is the current stack frame. *event* is a string: ``'call'``, " @@ -2028,7 +2070,7 @@ msgid "" "the event type." msgstr "" -#: library/sys.rst:1598 +#: library/sys.rst:1631 msgid "" "The trace function is invoked (with *event* set to ``'call'``) whenever a " "new local scope is entered; it should return a reference to a local trace " @@ -2036,36 +2078,36 @@ msgid "" "traced." msgstr "" -#: library/sys.rst:1603 +#: library/sys.rst:1636 msgid "" "The local trace function should return a reference to itself, or to another " "function which would then be used as the local trace function for the scope." msgstr "" -#: library/sys.rst:1606 +#: library/sys.rst:1639 msgid "" "If there is any error occurred in the trace function, it will be unset, just " "like ``settrace(None)`` is called." msgstr "" -#: library/sys.rst:1610 +#: library/sys.rst:1643 msgid "" "Tracing is disabled while calling the trace function (e.g. a function set " "by :func:`!settrace`). For recursive tracing see :func:`call_tracing`." msgstr "" -#: library/sys.rst:1616 +#: library/sys.rst:1649 msgid "" "A function is called (or some other code block entered). The global trace " "function is called; *arg* is ``None``; the return value specifies the local " "trace function." msgstr "" -#: library/sys.rst:1620 +#: library/sys.rst:1653 msgid "``'line'``" msgstr "" -#: library/sys.rst:1621 +#: library/sys.rst:1654 msgid "" "The interpreter is about to execute a new line of code or re-execute the " "condition of a loop. The local trace function is called; *arg* is ``None``; " @@ -2075,7 +2117,7 @@ msgid "" "to :const:`False` on that :ref:`frame `." msgstr "" -#: library/sys.rst:1631 +#: library/sys.rst:1664 msgid "" "A function (or other code block) is about to return. The local trace " "function is called; *arg* is the value that will be returned, or ``None`` if " @@ -2083,22 +2125,22 @@ msgid "" "return value is ignored." msgstr "" -#: library/sys.rst:1636 +#: library/sys.rst:1669 msgid "``'exception'``" msgstr "" -#: library/sys.rst:1637 +#: library/sys.rst:1670 msgid "" "An exception has occurred. The local trace function is called; *arg* is a " "tuple ``(exception, value, traceback)``; the return value specifies the new " "local trace function." msgstr "" -#: library/sys.rst:1641 +#: library/sys.rst:1674 msgid "``'opcode'``" msgstr "" -#: library/sys.rst:1642 +#: library/sys.rst:1675 msgid "" "The interpreter is about to execute a new opcode (see :mod:`dis` for opcode " "details). The local trace function is called; *arg* is ``None``; the return " @@ -2108,13 +2150,13 @@ msgid "" "objects>`." msgstr "" -#: library/sys.rst:1649 +#: library/sys.rst:1682 msgid "" "Note that as an exception is propagated down the chain of callers, an " "``'exception'`` event is generated at each level." msgstr "" -#: library/sys.rst:1652 +#: library/sys.rst:1685 msgid "" "For more fine-grained usage, it's possible to set a trace function by " "assigning ``frame.f_trace = tracefunc`` explicitly, rather than relying on " @@ -2128,17 +2170,17 @@ msgid "" "on each frame)." msgstr "" -#: library/sys.rst:1663 +#: library/sys.rst:1696 msgid "For more information on code and frame objects, refer to :ref:`types`." msgstr "" -#: library/sys.rst:1665 +#: library/sys.rst:1698 msgid "" "Raises an :ref:`auditing event ` ``sys.settrace`` with no " "arguments." msgstr "" -#: library/sys.rst:1669 +#: library/sys.rst:1702 msgid "" "The :func:`settrace` function is intended only for implementing debuggers, " "profilers, coverage tools and the like. Its behavior is part of the " @@ -2146,21 +2188,13 @@ msgid "" "thus may not be available in all Python implementations." msgstr "" -#: library/sys.rst:1676 +#: library/sys.rst:1709 msgid "" "``'opcode'`` event type added; :attr:`~frame.f_trace_lines` and :attr:" "`~frame.f_trace_opcodes` attributes added to frames" msgstr "" -#: library/sys.rst:1679 -msgid "" -"``'opcode'`` event will only be emitted if :attr:`~frame.f_trace_opcodes` of " -"at least one frame has been set to :const:`True` before :func:`settrace` is " -"called. This behavior will be changed back in 3.13 to be consistent with " -"previous versions." -msgstr "" - -#: library/sys.rst:1687 +#: library/sys.rst:1714 msgid "" "Accepts two optional keyword arguments which are callables that accept an :" "term:`asynchronous generator iterator` as an argument. The *firstiter* " @@ -2169,32 +2203,32 @@ msgid "" "about to be garbage collected." msgstr "" -#: library/sys.rst:1693 +#: library/sys.rst:1720 msgid "" "Raises an :ref:`auditing event ` ``sys." "set_asyncgen_hooks_firstiter`` with no arguments." msgstr "" -#: library/sys.rst:1695 +#: library/sys.rst:1722 msgid "" "Raises an :ref:`auditing event ` ``sys." "set_asyncgen_hooks_finalizer`` with no arguments." msgstr "" -#: library/sys.rst:1697 +#: library/sys.rst:1724 msgid "" "Two auditing events are raised because the underlying API consists of two " "calls, each of which must raise its own event." msgstr "" -#: library/sys.rst:1700 +#: library/sys.rst:1727 msgid "" "See :pep:`525` for more details, and for a reference example of a " "*finalizer* method see the implementation of ``asyncio.Loop." "shutdown_asyncgens`` in :source:`Lib/asyncio/base_events.py`" msgstr "" -#: library/sys.rst:1712 +#: library/sys.rst:1739 msgid "" "Allows enabling or disabling coroutine origin tracking. When enabled, the " "``cr_origin`` attribute on coroutine objects will contain a tuple of " @@ -2203,100 +2237,111 @@ msgid "" "disabled, ``cr_origin`` will be ``None``." msgstr "" -#: library/sys.rst:1719 +#: library/sys.rst:1746 msgid "" "To enable, pass a *depth* value greater than zero; this sets the number of " "frames whose information will be captured. To disable, pass set *depth* to " "zero." msgstr "" -#: library/sys.rst:1723 +#: library/sys.rst:1750 msgid "This setting is thread-specific." msgstr "" -#: library/sys.rst:1733 +#: library/sys.rst:1760 msgid "" "Activate the stack profiler trampoline *backend*. The only supported backend " "is ``\"perf\"``." msgstr "" -#: library/sys.rst:1742 +#: library/sys.rst:1769 msgid ":ref:`perf_profiling`" msgstr "" -#: library/sys.rst:1743 +#: library/sys.rst:1770 msgid "https://perf.wiki.kernel.org" msgstr "" -#: library/sys.rst:1747 +#: library/sys.rst:1774 msgid "Deactivate the current stack profiler trampoline backend." msgstr "" -#: library/sys.rst:1749 +#: library/sys.rst:1776 msgid "If no stack profiler is activated, this function has no effect." msgstr "" -#: library/sys.rst:1757 +#: library/sys.rst:1784 msgid "Return ``True`` if a stack profiler trampoline is active." msgstr "" -#: library/sys.rst:1765 +#: library/sys.rst:1792 msgid "" "Changes the :term:`filesystem encoding and error handler` to 'mbcs' and " "'replace' respectively, for consistency with versions of Python prior to 3.6." msgstr "" -#: library/sys.rst:1769 +#: library/sys.rst:1796 msgid "" "This is equivalent to defining the :envvar:`PYTHONLEGACYWINDOWSFSENCODING` " "environment variable before launching Python." msgstr "" -#: library/sys.rst:1772 +#: library/sys.rst:1799 msgid "" "See also :func:`sys.getfilesystemencoding` and :func:`sys." "getfilesystemencodeerrors`." msgstr "" -#: library/sys.rst:1777 +#: library/sys.rst:1805 +msgid "" +"Changing the filesystem encoding after Python startup is risky because the " +"old fsencoding or paths encoded by the old fsencoding may be cached " +"somewhere. Use :envvar:`PYTHONLEGACYWINDOWSFSENCODING` instead." +msgstr "" + +#: library/sys.rst:1809 msgid "See :pep:`529` for more details." msgstr "" -#: library/sys.rst:1784 +#: library/sys.rst:1812 +msgid "Use :envvar:`PYTHONLEGACYWINDOWSFSENCODING` instead." +msgstr "" + +#: library/sys.rst:1819 msgid "" ":term:`File objects ` used by the interpreter for standard " "input, output and errors:" msgstr "" -#: library/sys.rst:1787 +#: library/sys.rst:1822 msgid "" "``stdin`` is used for all interactive input (including calls to :func:" "`input`);" msgstr "" -#: library/sys.rst:1789 +#: library/sys.rst:1824 msgid "" "``stdout`` is used for the output of :func:`print` and :term:`expression` " "statements and for the prompts of :func:`input`;" msgstr "" -#: library/sys.rst:1791 +#: library/sys.rst:1826 msgid "The interpreter's own prompts and its error messages go to ``stderr``." msgstr "" -#: library/sys.rst:1793 +#: library/sys.rst:1828 msgid "" "These streams are regular :term:`text files ` like those returned " "by the :func:`open` function. Their parameters are chosen as follows:" msgstr "" -#: library/sys.rst:1797 +#: library/sys.rst:1832 msgid "" "The encoding and error handling are is initialized from :c:member:`PyConfig." "stdio_encoding` and :c:member:`PyConfig.stdio_errors`." msgstr "" -#: library/sys.rst:1800 +#: library/sys.rst:1835 msgid "" "On Windows, UTF-8 is used for the console device. Non-character devices " "such as disk files and pipes use the system locale encoding (i.e. the ANSI " @@ -2307,14 +2352,14 @@ msgid "" "initially attached to a console." msgstr "" -#: library/sys.rst:1809 +#: library/sys.rst:1844 msgid "" "The special behaviour of the console can be overridden by setting the " "environment variable PYTHONLEGACYWINDOWSSTDIO before starting Python. In " "that case, the console codepages are used as for any other character device." msgstr "" -#: library/sys.rst:1814 +#: library/sys.rst:1849 msgid "" "Under all platforms, you can override the character encoding by setting the :" "envvar:`PYTHONIOENCODING` environment variable before starting Python or by " @@ -2323,7 +2368,7 @@ msgid "" "only applies when :envvar:`PYTHONLEGACYWINDOWSSTDIO` is also set." msgstr "" -#: library/sys.rst:1821 +#: library/sys.rst:1856 msgid "" "When interactive, the ``stdout`` stream is line-buffered. Otherwise, it is " "block-buffered like regular text files. The ``stderr`` stream is line-" @@ -2332,19 +2377,19 @@ msgid "" "`PYTHONUNBUFFERED` environment variable." msgstr "" -#: library/sys.rst:1827 +#: library/sys.rst:1862 msgid "" "Non-interactive ``stderr`` is now line-buffered instead of fully buffered." msgstr "" -#: library/sys.rst:1833 +#: library/sys.rst:1868 msgid "" "To write or read binary data from/to the standard streams, use the " "underlying binary :data:`~io.TextIOBase.buffer` object. For example, to " "write bytes to :data:`stdout`, use ``sys.stdout.buffer.write(b'abc')``." msgstr "" -#: library/sys.rst:1837 +#: library/sys.rst:1872 msgid "" "However, if you are writing a library (and do not control in which context " "its code will be executed), be aware that the standard streams may be " @@ -2352,7 +2397,7 @@ msgid "" "support the :attr:`!buffer` attribute." msgstr "" -#: library/sys.rst:1847 +#: library/sys.rst:1882 msgid "" "These objects contain the original values of ``stdin``, ``stderr`` and " "``stdout`` at the start of the program. They are used during finalization, " @@ -2360,7 +2405,7 @@ msgid "" "``sys.std*`` object has been redirected." msgstr "" -#: library/sys.rst:1852 +#: library/sys.rst:1887 msgid "" "It can also be used to restore the actual files to known working file " "objects in case they have been overwritten with a broken object. However, " @@ -2368,7 +2413,7 @@ msgid "" "before replacing it, and restore the saved object." msgstr "" -#: library/sys.rst:1858 +#: library/sys.rst:1893 msgid "" "Under some conditions ``stdin``, ``stdout`` and ``stderr`` as well as the " "original values ``__stdin__``, ``__stdout__`` and ``__stderr__`` can be " @@ -2376,12 +2421,12 @@ msgid "" "to a console and Python apps started with :program:`pythonw`." msgstr "" -#: library/sys.rst:1866 +#: library/sys.rst:1901 msgid "" "A frozenset of strings containing the names of standard library modules." msgstr "" -#: library/sys.rst:1868 +#: library/sys.rst:1903 msgid "" "It is the same on all platforms. Modules which are not available on some " "platforms and modules disabled at Python build are also listed. All module " @@ -2389,7 +2434,7 @@ msgid "" "modules are excluded." msgstr "" -#: library/sys.rst:1873 +#: library/sys.rst:1908 msgid "" "For packages, only the main package is listed: sub-packages and sub-modules " "are not listed. For example, the ``email`` package is listed, but the " @@ -2397,60 +2442,60 @@ msgid "" "listed." msgstr "" -#: library/sys.rst:1878 +#: library/sys.rst:1913 msgid "See also the :data:`sys.builtin_module_names` list." msgstr "" -#: library/sys.rst:1885 +#: library/sys.rst:1920 msgid "" "A :term:`named tuple` holding information about the thread implementation." msgstr "" -#: library/sys.rst:1890 +#: library/sys.rst:1925 msgid "The name of the thread implementation:" msgstr "" -#: library/sys.rst:1892 +#: library/sys.rst:1927 msgid "``\"nt\"``: Windows threads" msgstr "" -#: library/sys.rst:1893 +#: library/sys.rst:1928 msgid "``\"pthread\"``: POSIX threads" msgstr "" -#: library/sys.rst:1894 +#: library/sys.rst:1929 msgid "" "``\"pthread-stubs\"``: stub POSIX threads (on WebAssembly platforms without " "threading support)" msgstr "" -#: library/sys.rst:1896 +#: library/sys.rst:1931 msgid "``\"solaris\"``: Solaris threads" msgstr "" -#: library/sys.rst:1900 +#: library/sys.rst:1935 msgid "The name of the lock implementation:" msgstr "" -#: library/sys.rst:1902 +#: library/sys.rst:1937 msgid "``\"semaphore\"``: a lock uses a semaphore" msgstr "" -#: library/sys.rst:1903 +#: library/sys.rst:1938 msgid "``\"mutex+cond\"``: a lock uses a mutex and a condition variable" msgstr "" -#: library/sys.rst:1904 +#: library/sys.rst:1939 msgid "``None`` if this information is unknown" msgstr "" -#: library/sys.rst:1908 +#: library/sys.rst:1943 msgid "" "The name and version of the thread library. It is a string, or ``None`` if " "this information is unknown." msgstr "" -#: library/sys.rst:1916 +#: library/sys.rst:1951 msgid "" "When this variable is set to an integer value, it determines the maximum " "number of levels of traceback information printed when an unhandled " @@ -2459,73 +2504,73 @@ msgid "" "are printed." msgstr "" -#: library/sys.rst:1924 +#: library/sys.rst:1959 msgid "Handle an unraisable exception." msgstr "" -#: library/sys.rst:1926 +#: library/sys.rst:1961 msgid "" "Called when an exception has occurred but there is no way for Python to " "handle it. For example, when a destructor raises an exception or during " "garbage collection (:func:`gc.collect`)." msgstr "" -#: library/sys.rst:1930 +#: library/sys.rst:1965 msgid "The *unraisable* argument has the following attributes:" msgstr "" -#: library/sys.rst:1932 +#: library/sys.rst:1967 msgid ":attr:`!exc_type`: Exception type." msgstr "" -#: library/sys.rst:1933 +#: library/sys.rst:1968 msgid ":attr:`!exc_value`: Exception value, can be ``None``." msgstr "" -#: library/sys.rst:1934 +#: library/sys.rst:1969 msgid ":attr:`!exc_traceback`: Exception traceback, can be ``None``." msgstr "" -#: library/sys.rst:1935 +#: library/sys.rst:1970 msgid ":attr:`!err_msg`: Error message, can be ``None``." msgstr "" -#: library/sys.rst:1936 +#: library/sys.rst:1971 msgid ":attr:`!object`: Object causing the exception, can be ``None``." msgstr "" -#: library/sys.rst:1938 +#: library/sys.rst:1973 msgid "" "The default hook formats :attr:`!err_msg` and :attr:`!object` as: " "``f'{err_msg}: {object!r}'``; use \"Exception ignored in\" error message if :" "attr:`!err_msg` is ``None``." msgstr "" -#: library/sys.rst:1942 +#: library/sys.rst:1977 msgid "" ":func:`sys.unraisablehook` can be overridden to control how unraisable " "exceptions are handled." msgstr "" -#: library/sys.rst:1947 +#: library/sys.rst:1982 msgid ":func:`excepthook` which handles uncaught exceptions." msgstr "" -#: library/sys.rst:1951 +#: library/sys.rst:1986 msgid "" "Storing :attr:`!exc_value` using a custom hook can create a reference cycle. " "It should be cleared explicitly to break the reference cycle when the " "exception is no longer needed." msgstr "" -#: library/sys.rst:1955 +#: library/sys.rst:1990 msgid "" "Storing :attr:`!object` using a custom hook can resurrect it if it is set to " "an object which is being finalized. Avoid storing :attr:`!object` after the " "custom hook completes to avoid resurrecting objects." msgstr "" -#: library/sys.rst:1961 +#: library/sys.rst:1996 msgid "" "Raise an auditing event ``sys.unraisablehook`` with arguments *hook*, " "*unraisable* when an exception that cannot be handled occurs. The " @@ -2533,7 +2578,7 @@ msgid "" "hook has been set, *hook* may be ``None``." msgstr "" -#: library/sys.rst:1970 +#: library/sys.rst:2005 msgid "" "A string containing the version number of the Python interpreter plus " "additional information on the build number and compiler used. This string " @@ -2542,13 +2587,13 @@ msgid "" "functions provided by the :mod:`platform` module." msgstr "" -#: library/sys.rst:1979 +#: library/sys.rst:2014 msgid "" "The C API version for this interpreter. Programmers may find this useful " "when debugging version conflicts between Python and extension modules." msgstr "" -#: library/sys.rst:1985 +#: library/sys.rst:2020 msgid "" "A tuple containing the five components of the version number: *major*, " "*minor*, *micro*, *releaselevel*, and *serial*. All values except " @@ -2559,18 +2604,18 @@ msgid "" "version_info.major`` and so on." msgstr "" -#: library/sys.rst:1993 +#: library/sys.rst:2028 msgid "Added named component attributes." msgstr "" -#: library/sys.rst:1998 +#: library/sys.rst:2033 msgid "" "This is an implementation detail of the warnings framework; do not modify " "this value. Refer to the :mod:`warnings` module for more information on the " "warnings framework." msgstr "" -#: library/sys.rst:2005 +#: library/sys.rst:2040 msgid "" "The version number used to form registry keys on Windows platforms. This is " "stored as string resource 1000 in the Python DLL. The value is normally the " @@ -2579,20 +2624,20 @@ msgid "" "has no effect on the registry keys used by Python." msgstr "" -#: library/sys.rst:2017 +#: library/sys.rst:2052 msgid "" "Namespace containing functions and constants for register callbacks and " "controlling monitoring events. See :mod:`sys.monitoring` for details." msgstr "" -#: library/sys.rst:2023 +#: library/sys.rst:2058 msgid "" "A dictionary of the various implementation-specific flags passed through " "the :option:`-X` command-line option. Option names are either mapped to " "their values, if given explicitly, or to :const:`True`. Example:" msgstr "" -#: library/sys.rst:2027 +#: library/sys.rst:2062 msgid "" "$ ./python -Xa=b -Xc\n" "Python 3.2a3+ (py3k, Oct 16 2010, 20:14:50)\n" @@ -2604,18 +2649,18 @@ msgid "" "{'a': 'b', 'c': True}" msgstr "" -#: library/sys.rst:2039 +#: library/sys.rst:2074 msgid "" "This is a CPython-specific way of accessing options passed through :option:`-" "X`. Other implementations may export them through other means, or not at " "all." msgstr "" -#: library/sys.rst:2047 +#: library/sys.rst:2082 msgid "Citations" msgstr "" -#: library/sys.rst:2048 +#: library/sys.rst:2083 msgid "" "ISO/IEC 9899:1999. \"Programming languages -- C.\" A public draft of this " "standard is available at https://www.open-std.org/jtc1/sc22/wg14/www/docs/" @@ -2626,58 +2671,58 @@ msgstr "" msgid "auditing" msgstr "" -#: library/sys.rst:451 +#: library/sys.rst:462 msgid "object" msgstr "" -#: library/sys.rst:451 +#: library/sys.rst:462 msgid "traceback" msgstr "" -#: library/sys.rst:1501 +#: library/sys.rst:1534 msgid "profile function" msgstr "" -#: library/sys.rst:1501 +#: library/sys.rst:1534 msgid "profiler" msgstr "" -#: library/sys.rst:1584 +#: library/sys.rst:1617 msgid "trace function" msgstr "" -#: library/sys.rst:1584 +#: library/sys.rst:1617 msgid "debugger" msgstr "" -#: library/sys.rst:1324 +#: library/sys.rst:1362 msgid "module" msgstr "" -#: library/sys.rst:1324 +#: library/sys.rst:1362 msgid "search" msgstr "" -#: library/sys.rst:1324 +#: library/sys.rst:1362 msgid "path" msgstr "" -#: library/sys.rst:1465 +#: library/sys.rst:1498 msgid "interpreter prompts" msgstr "" -#: library/sys.rst:1465 +#: library/sys.rst:1498 msgid "prompts, interpreter" msgstr "" -#: library/sys.rst:1465 +#: library/sys.rst:1498 msgid ">>>" msgstr "" -#: library/sys.rst:1465 +#: library/sys.rst:1498 msgid "interpreter prompt" msgstr "" -#: library/sys.rst:1465 +#: library/sys.rst:1498 msgid "..." msgstr "" diff --git a/library/sys_path_init.po b/library/sys_path_init.po index f4d824d9..4bcdacc5 100644 --- a/library/sys_path_init.po +++ b/library/sys_path_init.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -171,14 +171,13 @@ msgid "" "If Python is embedded within another application :c:func:" "`Py_InitializeFromConfig` and the :c:type:`PyConfig` structure can be used " "to initialize Python. The path specific details are described at :ref:`init-" -"path-config`. Alternatively the older :c:func:`Py_SetPath` can be used to " -"bypass the initialization of the module search path." +"path-config`." msgstr "" -#: library/sys_path_init.rst:107 +#: library/sys_path_init.rst:106 msgid ":ref:`windows_finding_modules` for detailed Windows notes." msgstr "" -#: library/sys_path_init.rst:108 +#: library/sys_path_init.rst:107 msgid ":ref:`using-on-unix` for Unix details." msgstr "" diff --git a/library/sysconfig.po b/library/sysconfig.po index ceb42264..df5f1f13 100644 --- a/library/sysconfig.po +++ b/library/sysconfig.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -23,7 +23,7 @@ msgid "" msgstr "" #: library/sysconfig.rst:12 -msgid "**Source code:** :source:`Lib/sysconfig.py`" +msgid "**Source code:** :source:`Lib/sysconfig`" msgstr "" #: library/sysconfig.rst:19 @@ -710,15 +710,15 @@ msgstr "" msgid "Return the path of :file:`Makefile`." msgstr "" -#: library/sysconfig.rst:434 -msgid "Using :mod:`sysconfig` as a script" +#: library/sysconfig.rst:435 +msgid "Command-line usage" msgstr "" -#: library/sysconfig.rst:436 +#: library/sysconfig.rst:437 msgid "You can use :mod:`sysconfig` as a script with Python's *-m* option:" msgstr "" -#: library/sysconfig.rst:438 +#: library/sysconfig.rst:439 msgid "" "$ python -m sysconfig\n" "Platform: \"macosx-10.4-i386\"\n" @@ -743,7 +743,7 @@ msgid "" " ..." msgstr "" -#: library/sysconfig.rst:462 +#: library/sysconfig.rst:463 msgid "" "This call will print in the standard output the information returned by :" "func:`get_platform`, :func:`get_python_version`, :func:`get_path` and :func:" diff --git a/library/syslog.po b/library/syslog.po index 86c82eeb..5f47200a 100644 --- a/library/syslog.po +++ b/library/syslog.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -36,7 +36,7 @@ msgstr "" msgid "" "This module wraps the system ``syslog`` family of routines. A pure Python " "library that can speak to a syslog server is available in the :mod:`logging." -"handlers` module as :class:`SysLogHandler`." +"handlers` module as :class:`~logging.handlers.SysLogHandler`." msgstr "" #: library/syslog.rst:20 @@ -157,53 +157,42 @@ msgstr "" msgid "The module defines the following constants:" msgstr "" -#: library/syslog.rst:110 -msgid "Priority levels (high to low):" +#: library/syslog.rst:120 +msgid "Priority levels (high to low)." msgstr "" -#: library/syslog.rst:111 +#: library/syslog.rst:149 msgid "" -":const:`LOG_EMERG`, :const:`LOG_ALERT`, :const:`LOG_CRIT`, :const:" -"`LOG_ERR`, :const:`LOG_WARNING`, :const:`LOG_NOTICE`, :const:`LOG_INFO`, :" -"const:`LOG_DEBUG`." +"Facilities, depending on availability in ```` for :const:" +"`LOG_AUTHPRIV`, :const:`LOG_FTP`, :const:`LOG_NETINFO`, :const:" +"`LOG_REMOTEAUTH`, :const:`LOG_INSTALL` and :const:`LOG_RAS`." msgstr "" -#: library/syslog.rst:115 -msgid "Facilities:" -msgstr "" - -#: library/syslog.rst:116 +#: library/syslog.rst:153 msgid "" -":const:`LOG_KERN`, :const:`LOG_USER`, :const:`LOG_MAIL`, :const:" -"`LOG_DAEMON`, :const:`LOG_AUTH`, :const:`LOG_LPR`, :const:`LOG_NEWS`, :const:" -"`LOG_UUCP`, :const:`LOG_CRON`, :const:`LOG_SYSLOG`, :const:`LOG_LOCAL0` to :" -"const:`LOG_LOCAL7`, and, if defined in ````, :const:`LOG_AUTHPRIV`." -msgstr "" - -#: library/syslog.rst:122 -msgid "Log options:" +"Added :const:`LOG_FTP`, :const:`LOG_NETINFO`, :const:`LOG_REMOTEAUTH`, :" +"const:`LOG_INSTALL`, :const:`LOG_RAS`, and :const:`LOG_LAUNCHD`." msgstr "" -#: library/syslog.rst:123 +#: library/syslog.rst:164 msgid "" -":const:`LOG_PID`, :const:`LOG_CONS`, :const:`LOG_NDELAY`, and, if defined in " -"````, :const:`LOG_ODELAY`, :const:`LOG_NOWAIT`, and :const:" -"`LOG_PERROR`." +"Log options, depending on availability in ```` for :const:" +"`LOG_ODELAY`, :const:`LOG_NOWAIT` and :const:`LOG_PERROR`." msgstr "" -#: library/syslog.rst:129 +#: library/syslog.rst:169 msgid "Examples" msgstr "" -#: library/syslog.rst:132 +#: library/syslog.rst:172 msgid "Simple example" msgstr "" -#: library/syslog.rst:134 +#: library/syslog.rst:174 msgid "A simple set of examples::" msgstr "" -#: library/syslog.rst:136 +#: library/syslog.rst:176 msgid "" "import syslog\n" "\n" @@ -212,14 +201,14 @@ msgid "" " syslog.syslog(syslog.LOG_ERR, 'Processing started')" msgstr "" -#: library/syslog.rst:142 +#: library/syslog.rst:182 msgid "" "An example of setting some log options, these would include the process ID " "in logged messages, and write the messages to the destination facility used " "for mail logging::" msgstr "" -#: library/syslog.rst:146 +#: library/syslog.rst:186 msgid "" "syslog.openlog(logoption=syslog.LOG_PID, facility=syslog.LOG_MAIL)\n" "syslog.syslog('E-mail processing initiated...')" diff --git a/library/tabnanny.po b/library/tabnanny.po index 94ed96ff..3e0c3b48 100644 --- a/library/tabnanny.po +++ b/library/tabnanny.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" diff --git a/library/tarfile.po b/library/tarfile.po index c099d600..61b619b8 100644 --- a/library/tarfile.po +++ b/library/tarfile.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -342,11 +342,11 @@ msgstr "" msgid "Open an lzma compressed *stream* for writing." msgstr "" -#: library/tarfile.rst:422 +#: library/tarfile.rst:425 msgid "The ``'x'`` (exclusive creation) mode was added." msgstr "" -#: library/tarfile.rst:425 library/tarfile.rst:660 +#: library/tarfile.rst:428 library/tarfile.rst:673 msgid "The *name* parameter accepts a :term:`path-like object`." msgstr "" @@ -666,41 +666,51 @@ msgid "" "be added as a pax global header if *format* is :const:`PAX_FORMAT`." msgstr "" -#: library/tarfile.rst:729 +#: library/tarfile.rst:419 +msgid "" +"If *stream* is set to :const:`True` then while reading the archive info " +"about files in the archive are not cached, saving memory." +msgstr "" + +#: library/tarfile.rst:742 msgid "Use ``'surrogateescape'`` as the default for the *errors* argument." msgstr "" #: library/tarfile.rst:431 +msgid "Add the *stream* parameter." +msgstr "" + +#: library/tarfile.rst:436 msgid "" "Alternative constructor. The :func:`tarfile.open` function is actually a " "shortcut to this classmethod." msgstr "" -#: library/tarfile.rst:437 +#: library/tarfile.rst:442 msgid "" "Return a :class:`TarInfo` object for member *name*. If *name* can not be " "found in the archive, :exc:`KeyError` is raised." msgstr "" -#: library/tarfile.rst:442 +#: library/tarfile.rst:447 msgid "" "If a member occurs more than once in the archive, its last occurrence is " "assumed to be the most up-to-date version." msgstr "" -#: library/tarfile.rst:448 +#: library/tarfile.rst:453 msgid "" "Return the members of the archive as a list of :class:`TarInfo` objects. The " "list has the same order as the members in the archive." msgstr "" -#: library/tarfile.rst:454 +#: library/tarfile.rst:459 msgid "" "Return the members as a list of their names. It has the same order as the " "list returned by :meth:`getmembers`." msgstr "" -#: library/tarfile.rst:460 +#: library/tarfile.rst:465 msgid "" "Print a table of contents to ``sys.stdout``. If *verbose* is :const:`False`, " "only the names of the members are printed. If it is :const:`True`, output " @@ -708,18 +718,18 @@ msgid "" "given, it must be a subset of the list returned by :meth:`getmembers`." msgstr "" -#: library/tarfile.rst:465 +#: library/tarfile.rst:470 msgid "Added the *members* parameter." msgstr "" -#: library/tarfile.rst:471 +#: library/tarfile.rst:476 msgid "" "Return the next member of the archive as a :class:`TarInfo` object, when :" "class:`TarFile` is opened for reading. Return :const:`None` if there is no " "more available." msgstr "" -#: library/tarfile.rst:478 +#: library/tarfile.rst:483 msgid "" "Extract all members from the archive to the current working directory or " "directory *path*. If optional *members* is given, it must be a subset of the " @@ -731,14 +741,14 @@ msgid "" "fail." msgstr "" -#: library/tarfile.rst:486 +#: library/tarfile.rst:491 msgid "" "If *numeric_owner* is :const:`True`, the uid and gid numbers from the " "tarfile are used to set the owner/group for the extracted files. Otherwise, " "the named values from the tarfile are used." msgstr "" -#: library/tarfile.rst:490 +#: library/tarfile.rst:495 msgid "" "The *filter* argument specifies how ``members`` are modified or rejected " "before extraction. See :ref:`tarfile-extraction-filter` for details. It is " @@ -746,7 +756,7 @@ msgid "" "need to support." msgstr "" -#: library/tarfile.rst:498 +#: library/tarfile.rst:503 msgid "" "Never extract archives from untrusted sources without prior inspection. It " "is possible that files are created outside of *path*, e.g. members that have " @@ -754,25 +764,25 @@ msgid "" "\"``." msgstr "" -#: library/tarfile.rst:536 +#: library/tarfile.rst:541 msgid "" "Set ``filter='data'`` to prevent the most dangerous security issues, and " "read the :ref:`tarfile-extraction-filter` section for details." msgstr "" -#: library/tarfile.rst:542 +#: library/tarfile.rst:547 msgid "Added the *numeric_owner* parameter." msgstr "" -#: library/tarfile.rst:545 +#: library/tarfile.rst:550 msgid "The *path* parameter accepts a :term:`path-like object`." msgstr "" -#: library/tarfile.rst:548 library/tarfile.rst:626 +#: library/tarfile.rst:553 library/tarfile.rst:635 msgid "Added the *filter* parameter." msgstr "" -#: library/tarfile.rst:518 +#: library/tarfile.rst:523 msgid "" "Extract a member from the archive to the current working directory, using " "its full name. Its file information is extracted as accurately as possible. " @@ -781,27 +791,27 @@ msgid "" "File attributes (owner, mtime, mode) are set unless *set_attrs* is false." msgstr "" -#: library/tarfile.rst:524 +#: library/tarfile.rst:529 msgid "" "The *numeric_owner* and *filter* arguments are the same as for :meth:" "`extractall`." msgstr "" -#: library/tarfile.rst:529 +#: library/tarfile.rst:534 msgid "" "The :meth:`extract` method does not take care of several extraction issues. " "In most cases you should consider using the :meth:`extractall` method." msgstr "" -#: library/tarfile.rst:534 +#: library/tarfile.rst:539 msgid "See the warning for :meth:`extractall`." msgstr "" -#: library/tarfile.rst:539 +#: library/tarfile.rst:544 msgid "Added the *set_attrs* parameter." msgstr "" -#: library/tarfile.rst:554 +#: library/tarfile.rst:559 msgid "" "Extract a member from the archive as a file object. *member* may be a " "filename or a :class:`TarInfo` object. If *member* is a regular file or a " @@ -810,11 +820,17 @@ msgid "" "the archive, :exc:`KeyError` is raised." msgstr "" -#: library/tarfile.rst:560 +#: library/tarfile.rst:565 msgid "Return an :class:`io.BufferedReader` object." msgstr "" -#: library/tarfile.rst:566 +#: library/tarfile.rst:568 +msgid "" +"The returned :class:`io.BufferedReader` object has the :attr:`!mode` " +"attribute which is always equal to ``'rb'``." +msgstr "" + +#: library/tarfile.rst:575 msgid "" "If *errorlevel* is ``0``, errors are ignored when using :meth:`TarFile." "extract` and :meth:`TarFile.extractall`. Nevertheless, they appear as error " @@ -824,39 +840,39 @@ msgid "" "exc:`TarError` exceptions as well." msgstr "" -#: library/tarfile.rst:574 +#: library/tarfile.rst:583 msgid "" "Some exceptions, e.g. ones caused by wrong argument types or data " "corruption, are always raised." msgstr "" -#: library/tarfile.rst:577 +#: library/tarfile.rst:586 msgid "" "Custom :ref:`extraction filters ` should raise :" "exc:`FilterError` for *fatal* errors and :exc:`ExtractError` for *non-fatal* " "ones." msgstr "" -#: library/tarfile.rst:581 +#: library/tarfile.rst:590 msgid "" "Note that when an exception is raised, the archive may be partially " "extracted. It is the user’s responsibility to clean up." msgstr "" -#: library/tarfile.rst:588 +#: library/tarfile.rst:597 msgid "" "The :ref:`extraction filter ` used as a default " "for the *filter* argument of :meth:`~TarFile.extract` and :meth:`~TarFile." "extractall`." msgstr "" -#: library/tarfile.rst:592 +#: library/tarfile.rst:601 msgid "" "The attribute may be ``None`` or a callable. String names are not allowed " "for this attribute, unlike the *filter* argument to :meth:`~TarFile.extract`." msgstr "" -#: library/tarfile.rst:596 +#: library/tarfile.rst:605 msgid "" "If ``extraction_filter`` is ``None`` (the default), calling an extraction " "method without a *filter* argument will raise a ``DeprecationWarning``, and " @@ -864,13 +880,13 @@ msgid "" "dangerous behavior matches previous versions of Python." msgstr "" -#: library/tarfile.rst:602 +#: library/tarfile.rst:611 msgid "" "In Python 3.14+, leaving ``extraction_filter=None`` will cause extraction " "methods to use the :func:`data ` filter by default." msgstr "" -#: library/tarfile.rst:605 +#: library/tarfile.rst:614 msgid "" "The attribute may be set on instances or overridden in subclasses. It also " "is possible to set it on the ``TarFile`` class itself to set a global " @@ -880,7 +896,7 @@ msgid "" "wrapped in :func:`staticmethod` to prevent injection of a ``self`` argument." msgstr "" -#: library/tarfile.rst:615 +#: library/tarfile.rst:624 msgid "" "Add the file *name* to the archive. *name* may be any type of file " "(directory, fifo, symbolic link, etc.). If given, *arcname* specifies an " @@ -893,19 +909,24 @@ msgid "" "ref:`tar-examples` for an example." msgstr "" -#: library/tarfile.rst:629 +#: library/tarfile.rst:638 msgid "Recursion adds entries in sorted order." msgstr "" -#: library/tarfile.rst:635 +#: library/tarfile.rst:644 msgid "" -"Add the :class:`TarInfo` object *tarinfo* to the archive. If *fileobj* is " -"given, it should be a :term:`binary file`, and ``tarinfo.size`` bytes are " -"read from it and added to the archive. You can create :class:`TarInfo` " -"objects directly, or by using :meth:`gettarinfo`." +"Add the :class:`TarInfo` object *tarinfo* to the archive. If *tarinfo* " +"represents a non zero-size regular file, the *fileobj* argument should be a :" +"term:`binary file`, and ``tarinfo.size`` bytes are read from it and added to " +"the archive. You can create :class:`TarInfo` objects directly, or by using :" +"meth:`gettarinfo`." msgstr "" -#: library/tarfile.rst:643 +#: library/tarfile.rst:651 +msgid "*fileobj* must be given for non-zero-sized regular files." +msgstr "" + +#: library/tarfile.rst:656 msgid "" "Create a :class:`TarInfo` object from the result of :func:`os.stat` or " "equivalent on an existing file. The file is either named by *name*, or " @@ -916,7 +937,7 @@ msgid "" "The name should be a text string." msgstr "" -#: library/tarfile.rst:652 +#: library/tarfile.rst:665 msgid "" "You can modify some of the :class:`TarInfo`’s attributes before you add it " "using :meth:`addfile`. If the file object is not an ordinary file object " @@ -926,21 +947,21 @@ msgid "" "case *arcname* could be a dummy string." msgstr "" -#: library/tarfile.rst:666 +#: library/tarfile.rst:679 msgid "" "Close the :class:`TarFile`. In write mode, two finishing zero blocks are " "appended to the archive." msgstr "" -#: library/tarfile.rst:673 +#: library/tarfile.rst:686 msgid "A dictionary containing key-value pairs of pax global headers." msgstr "" -#: library/tarfile.rst:680 +#: library/tarfile.rst:693 msgid "TarInfo Objects" msgstr "" -#: library/tarfile.rst:682 +#: library/tarfile.rst:695 msgid "" "A :class:`TarInfo` object represents one member in a :class:`TarFile`. Aside " "from storing all required attributes of a file (like file type, size, time, " @@ -948,14 +969,14 @@ msgid "" "type. It does *not* contain the file's data itself." msgstr "" -#: library/tarfile.rst:687 +#: library/tarfile.rst:700 msgid "" ":class:`TarInfo` objects are returned by :class:`TarFile`'s methods :meth:" "`~TarFile.getmember`, :meth:`~TarFile.getmembers` and :meth:`~TarFile." "gettarinfo`." msgstr "" -#: library/tarfile.rst:691 +#: library/tarfile.rst:704 msgid "" "Modifying the objects returned by :meth:`~TarFile.getmember` or :meth:" "`~TarFile.getmembers` will affect all subsequent operations on the archive. " @@ -964,80 +985,80 @@ msgid "" "step." msgstr "" -#: library/tarfile.rst:697 +#: library/tarfile.rst:710 msgid "" "Several attributes can be set to ``None`` to indicate that a piece of " "metadata is unused or unknown. Different :class:`TarInfo` methods handle " "``None`` differently:" msgstr "" -#: library/tarfile.rst:701 +#: library/tarfile.rst:714 msgid "" "The :meth:`~TarFile.extract` or :meth:`~TarFile.extractall` methods will " "ignore the corresponding metadata, leaving it set to a default." msgstr "" -#: library/tarfile.rst:703 +#: library/tarfile.rst:716 msgid ":meth:`~TarFile.addfile` will fail." msgstr "" -#: library/tarfile.rst:704 +#: library/tarfile.rst:717 msgid ":meth:`~TarFile.list` will print a placeholder string." msgstr "" -#: library/tarfile.rst:708 +#: library/tarfile.rst:721 msgid "Create a :class:`TarInfo` object." msgstr "" -#: library/tarfile.rst:713 +#: library/tarfile.rst:726 msgid "Create and return a :class:`TarInfo` object from string buffer *buf*." msgstr "" -#: library/tarfile.rst:715 +#: library/tarfile.rst:728 msgid "Raises :exc:`HeaderError` if the buffer is invalid." msgstr "" -#: library/tarfile.rst:720 +#: library/tarfile.rst:733 msgid "" "Read the next member from the :class:`TarFile` object *tarfile* and return " "it as a :class:`TarInfo` object." msgstr "" -#: library/tarfile.rst:726 +#: library/tarfile.rst:739 msgid "" "Create a string buffer from a :class:`TarInfo` object. For information on " "the arguments see the constructor of the :class:`TarFile` class." msgstr "" -#: library/tarfile.rst:733 +#: library/tarfile.rst:746 msgid "A ``TarInfo`` object has the following public data attributes:" msgstr "" -#: library/tarfile.rst:739 +#: library/tarfile.rst:752 msgid "Name of the archive member." msgstr "" -#: library/tarfile.rst:745 +#: library/tarfile.rst:758 msgid "Size in bytes." msgstr "" -#: library/tarfile.rst:751 +#: library/tarfile.rst:764 msgid "" "Time of last modification in seconds since the :ref:`epoch `, as in :" "attr:`os.stat_result.st_mtime`." msgstr "" -#: library/tarfile.rst:767 library/tarfile.rst:810 library/tarfile.rst:832 +#: library/tarfile.rst:780 library/tarfile.rst:823 library/tarfile.rst:845 msgid "" "Can be set to ``None`` for :meth:`~TarFile.extract` and :meth:`~TarFile." "extractall`, causing extraction to skip applying this attribute." msgstr "" -#: library/tarfile.rst:763 +#: library/tarfile.rst:776 msgid "Permission bits, as for :func:`os.chmod`." msgstr "" -#: library/tarfile.rst:773 +#: library/tarfile.rst:786 msgid "" "File type. *type* is usually one of these constants: :const:`REGTYPE`, :" "const:`AREGTYPE`, :const:`LNKTYPE`, :const:`SYMTYPE`, :const:`DIRTYPE`, :" @@ -1046,128 +1067,128 @@ msgid "" "more conveniently, use the ``is*()`` methods below." msgstr "" -#: library/tarfile.rst:783 +#: library/tarfile.rst:796 msgid "" "Name of the target file name, which is only present in :class:`TarInfo` " "objects of type :const:`LNKTYPE` and :const:`SYMTYPE`." msgstr "" -#: library/tarfile.rst:786 +#: library/tarfile.rst:799 msgid "" "For symbolic links (``SYMTYPE``), the *linkname* is relative to the " "directory that contains the link. For hard links (``LNKTYPE``), the " "*linkname* is relative to the root of the archive." msgstr "" -#: library/tarfile.rst:795 +#: library/tarfile.rst:808 msgid "User ID of the user who originally stored this member." msgstr "" -#: library/tarfile.rst:806 +#: library/tarfile.rst:819 msgid "Group ID of the user who originally stored this member." msgstr "" -#: library/tarfile.rst:817 +#: library/tarfile.rst:830 msgid "User name." msgstr "" -#: library/tarfile.rst:828 +#: library/tarfile.rst:841 msgid "Group name." msgstr "" -#: library/tarfile.rst:839 +#: library/tarfile.rst:852 msgid "Header checksum." msgstr "" -#: library/tarfile.rst:845 +#: library/tarfile.rst:858 msgid "Device major number." msgstr "" -#: library/tarfile.rst:851 +#: library/tarfile.rst:864 msgid "Device minor number." msgstr "" -#: library/tarfile.rst:857 +#: library/tarfile.rst:870 msgid "The tar header starts here." msgstr "" -#: library/tarfile.rst:863 +#: library/tarfile.rst:876 msgid "The file's data starts here." msgstr "" -#: library/tarfile.rst:868 +#: library/tarfile.rst:881 msgid "Sparse member information." msgstr "" -#: library/tarfile.rst:874 +#: library/tarfile.rst:887 msgid "" "A dictionary containing key-value pairs of an associated pax extended header." msgstr "" -#: library/tarfile.rst:882 +#: library/tarfile.rst:895 msgid "" "Return a *new* copy of the :class:`!TarInfo` object with the given " "attributes changed. For example, to return a ``TarInfo`` with the group name " "set to ``'staff'``, use::" msgstr "" -#: library/tarfile.rst:886 +#: library/tarfile.rst:899 msgid "new_tarinfo = old_tarinfo.replace(gname='staff')" msgstr "" -#: library/tarfile.rst:888 +#: library/tarfile.rst:901 msgid "" "By default, a deep copy is made. If *deep* is false, the copy is shallow, i." "e. ``pax_headers`` and any custom attributes are shared with the original " "``TarInfo`` object." msgstr "" -#: library/tarfile.rst:892 +#: library/tarfile.rst:905 msgid "A :class:`TarInfo` object also provides some convenient query methods:" msgstr "" -#: library/tarfile.rst:897 +#: library/tarfile.rst:910 msgid "Return :const:`True` if the :class:`TarInfo` object is a regular file." msgstr "" -#: library/tarfile.rst:902 +#: library/tarfile.rst:915 msgid "Same as :meth:`isfile`." msgstr "" -#: library/tarfile.rst:907 +#: library/tarfile.rst:920 msgid "Return :const:`True` if it is a directory." msgstr "" -#: library/tarfile.rst:912 +#: library/tarfile.rst:925 msgid "Return :const:`True` if it is a symbolic link." msgstr "" -#: library/tarfile.rst:917 +#: library/tarfile.rst:930 msgid "Return :const:`True` if it is a hard link." msgstr "" -#: library/tarfile.rst:922 +#: library/tarfile.rst:935 msgid "Return :const:`True` if it is a character device." msgstr "" -#: library/tarfile.rst:927 +#: library/tarfile.rst:940 msgid "Return :const:`True` if it is a block device." msgstr "" -#: library/tarfile.rst:932 +#: library/tarfile.rst:945 msgid "Return :const:`True` if it is a FIFO." msgstr "" -#: library/tarfile.rst:937 +#: library/tarfile.rst:950 msgid "" "Return :const:`True` if it is one of character device, block device or FIFO." msgstr "" -#: library/tarfile.rst:943 +#: library/tarfile.rst:956 msgid "Extraction filters" msgstr "" -#: library/tarfile.rst:947 +#: library/tarfile.rst:960 msgid "" "The *tar* format is designed to capture all details of a UNIX-like " "filesystem, which makes it very powerful. Unfortunately, the features make " @@ -1177,66 +1198,66 @@ msgid "" "components, or symlinks that affect later members)." msgstr "" -#: library/tarfile.rst:955 +#: library/tarfile.rst:968 msgid "" "In most cases, the full functionality is not needed. Therefore, *tarfile* " "supports extraction filters: a mechanism to limit functionality, and thus " "mitigate some of the security issues." msgstr "" -#: library/tarfile.rst:961 +#: library/tarfile.rst:974 msgid ":pep:`706`" msgstr "" -#: library/tarfile.rst:962 +#: library/tarfile.rst:975 msgid "Contains further motivation and rationale behind the design." msgstr "" -#: library/tarfile.rst:964 +#: library/tarfile.rst:977 msgid "" "The *filter* argument to :meth:`TarFile.extract` or :meth:`~TarFile." "extractall` can be:" msgstr "" -#: library/tarfile.rst:967 +#: library/tarfile.rst:980 msgid "" "the string ``'fully_trusted'``: Honor all metadata as specified in the " "archive. Should be used if the user trusts the archive completely, or " "implements their own complex verification." msgstr "" -#: library/tarfile.rst:972 +#: library/tarfile.rst:985 msgid "" "the string ``'tar'``: Honor most *tar*-specific features (i.e. features of " "UNIX-like filesystems), but block features that are very likely to be " "surprising or malicious. See :func:`tar_filter` for details." msgstr "" -#: library/tarfile.rst:976 +#: library/tarfile.rst:989 msgid "" "the string ``'data'``: Ignore or block most features specific to UNIX-like " "filesystems. Intended for extracting cross-platform data archives. See :func:" "`data_filter` for details." msgstr "" -#: library/tarfile.rst:980 +#: library/tarfile.rst:993 msgid "``None`` (default): Use :attr:`TarFile.extraction_filter`." msgstr "" -#: library/tarfile.rst:982 +#: library/tarfile.rst:995 msgid "" "If that is also ``None`` (the default), raise a ``DeprecationWarning``, and " "fall back to the ``'fully_trusted'`` filter, whose dangerous behavior " "matches previous versions of Python." msgstr "" -#: library/tarfile.rst:986 +#: library/tarfile.rst:999 msgid "" "In Python 3.14, the ``'data'`` filter will become the default instead. It's " "possible to switch earlier; see :attr:`TarFile.extraction_filter`." msgstr "" -#: library/tarfile.rst:989 +#: library/tarfile.rst:1002 msgid "" "A callable which will be called for each extracted member with a :ref:" "`TarInfo ` describing the member and the destination path " @@ -1244,27 +1265,27 @@ msgid "" "members)::" msgstr "" -#: library/tarfile.rst:994 +#: library/tarfile.rst:1007 msgid "filter(member: TarInfo, path: str, /) -> TarInfo | None" msgstr "" -#: library/tarfile.rst:996 +#: library/tarfile.rst:1009 msgid "" "The callable is called just before each member is extracted, so it can take " "the current state of the disk into account. It can:" msgstr "" -#: library/tarfile.rst:1000 +#: library/tarfile.rst:1013 msgid "" "return a :class:`TarInfo` object which will be used instead of the metadata " "in the archive, or" msgstr "" -#: library/tarfile.rst:1002 +#: library/tarfile.rst:1015 msgid "return ``None``, in which case the member will be skipped, or" msgstr "" -#: library/tarfile.rst:1003 +#: library/tarfile.rst:1016 msgid "" "raise an exception to abort the operation or skip the member, depending on :" "attr:`~TarFile.errorlevel`. Note that when extraction is aborted, :meth:" @@ -1272,118 +1293,118 @@ msgid "" "attempt to clean up." msgstr "" -#: library/tarfile.rst:1009 +#: library/tarfile.rst:1022 msgid "Default named filters" msgstr "" -#: library/tarfile.rst:1011 +#: library/tarfile.rst:1024 msgid "" "The pre-defined, named filters are available as functions, so they can be " "reused in custom filters:" msgstr "" -#: library/tarfile.rst:1016 +#: library/tarfile.rst:1029 msgid "Return *member* unchanged." msgstr "" -#: library/tarfile.rst:1018 +#: library/tarfile.rst:1031 msgid "This implements the ``'fully_trusted'`` filter." msgstr "" -#: library/tarfile.rst:1022 +#: library/tarfile.rst:1035 msgid "Implements the ``'tar'`` filter." msgstr "" -#: library/tarfile.rst:1024 +#: library/tarfile.rst:1037 msgid "Strip leading slashes (``/`` and :data:`os.sep`) from filenames." msgstr "" -#: library/tarfile.rst:1025 +#: library/tarfile.rst:1038 msgid "" ":ref:`Refuse ` to extract files with absolute " "paths (in case the name is absolute even after stripping slashes, e.g. ``C:/" "foo`` on Windows). This raises :class:`~tarfile.AbsolutePathError`." msgstr "" -#: library/tarfile.rst:1029 +#: library/tarfile.rst:1042 msgid "" ":ref:`Refuse ` to extract files whose absolute " "path (after following symlinks) would end up outside the destination. This " "raises :class:`~tarfile.OutsideDestinationError`." msgstr "" -#: library/tarfile.rst:1032 +#: library/tarfile.rst:1045 msgid "" "Clear high mode bits (setuid, setgid, sticky) and group/other write bits (:" "const:`~stat.S_IWGRP` | :const:`~stat.S_IWOTH`)." msgstr "" -#: library/tarfile.rst:1068 +#: library/tarfile.rst:1081 msgid "Return the modified ``TarInfo`` member." msgstr "" -#: library/tarfile.rst:1039 +#: library/tarfile.rst:1052 msgid "" "Implements the ``'data'`` filter. In addition to what ``tar_filter`` does:" msgstr "" -#: library/tarfile.rst:1042 +#: library/tarfile.rst:1055 msgid "" ":ref:`Refuse ` to extract links (hard or soft) " "that link to absolute paths, or ones that link outside the destination." msgstr "" -#: library/tarfile.rst:1045 +#: library/tarfile.rst:1058 msgid "" "This raises :class:`~tarfile.AbsoluteLinkError` or :class:`~tarfile." "LinkOutsideDestinationError`." msgstr "" -#: library/tarfile.rst:1048 +#: library/tarfile.rst:1061 msgid "" "Note that such files are refused even on platforms that do not support " "symbolic links." msgstr "" -#: library/tarfile.rst:1051 +#: library/tarfile.rst:1064 msgid "" ":ref:`Refuse ` to extract device files (including " "pipes). This raises :class:`~tarfile.SpecialFileError`." msgstr "" -#: library/tarfile.rst:1055 +#: library/tarfile.rst:1068 msgid "For regular files, including hard links:" msgstr "" -#: library/tarfile.rst:1057 +#: library/tarfile.rst:1070 msgid "" "Set the owner read and write permissions (:const:`~stat.S_IRUSR` | :const:" "`~stat.S_IWUSR`)." msgstr "" -#: library/tarfile.rst:1059 +#: library/tarfile.rst:1072 msgid "" "Remove the group & other executable permission (:const:`~stat.S_IXGRP` | :" "const:`~stat.S_IXOTH`) if the owner doesn’t have it (:const:`~stat.S_IXUSR`)." msgstr "" -#: library/tarfile.rst:1063 +#: library/tarfile.rst:1076 msgid "" "For other files (directories), set ``mode`` to ``None``, so that extraction " "methods skip applying permission bits." msgstr "" -#: library/tarfile.rst:1065 +#: library/tarfile.rst:1078 msgid "" "Set user and group info (``uid``, ``gid``, ``uname``, ``gname``) to " "``None``, so that extraction methods skip setting it." msgstr "" -#: library/tarfile.rst:1074 +#: library/tarfile.rst:1087 msgid "Filter errors" msgstr "" -#: library/tarfile.rst:1076 +#: library/tarfile.rst:1089 msgid "" "When a filter refuses to extract a file, it will raise an appropriate " "exception, a subclass of :class:`~tarfile.FilterError`. This will abort the " @@ -1392,11 +1413,11 @@ msgid "" "continue." msgstr "" -#: library/tarfile.rst:1084 +#: library/tarfile.rst:1097 msgid "Hints for further verification" msgstr "" -#: library/tarfile.rst:1086 +#: library/tarfile.rst:1099 msgid "" "Even with ``filter='data'``, *tarfile* is not suited for extracting " "untrusted files without prior inspection. Among other issues, the pre-" @@ -1404,69 +1425,69 @@ msgid "" "additional checks." msgstr "" -#: library/tarfile.rst:1091 +#: library/tarfile.rst:1104 msgid "Here is an incomplete list of things to consider:" msgstr "" -#: library/tarfile.rst:1093 +#: library/tarfile.rst:1106 msgid "" "Extract to a :func:`new temporary directory ` to prevent e." "g. exploiting pre-existing links, and to make it easier to clean up after a " "failed extraction." msgstr "" -#: library/tarfile.rst:1096 +#: library/tarfile.rst:1109 msgid "" "When working with untrusted data, use external (e.g. OS-level) limits on " "disk, memory and CPU usage." msgstr "" -#: library/tarfile.rst:1098 +#: library/tarfile.rst:1111 msgid "" "Check filenames against an allow-list of characters (to filter out control " "characters, confusables, foreign path separators, etc.)." msgstr "" -#: library/tarfile.rst:1101 +#: library/tarfile.rst:1114 msgid "" "Check that filenames have expected extensions (discouraging files that " "execute when you “click on them”, or extension-less files like Windows " "special device names)." msgstr "" -#: library/tarfile.rst:1103 +#: library/tarfile.rst:1116 msgid "" "Limit the number of extracted files, total size of extracted data, filename " "length (including symlink length), and size of individual files." msgstr "" -#: library/tarfile.rst:1105 +#: library/tarfile.rst:1118 msgid "Check for files that would be shadowed on case-insensitive filesystems." msgstr "" -#: library/tarfile.rst:1107 +#: library/tarfile.rst:1120 msgid "Also note that:" msgstr "" -#: library/tarfile.rst:1109 +#: library/tarfile.rst:1122 msgid "" "Tar files may contain multiple versions of the same file. Later ones are " "expected to overwrite any earlier ones. This feature is crucial to allow " "updating tape archives, but can be abused maliciously." msgstr "" -#: library/tarfile.rst:1113 +#: library/tarfile.rst:1126 msgid "" "*tarfile* does not protect against issues with “live” data, e.g. an attacker " "tinkering with the destination (or source) directory while extraction (or " "archiving) is in progress." msgstr "" -#: library/tarfile.rst:1119 +#: library/tarfile.rst:1132 msgid "Supporting older Python versions" msgstr "" -#: library/tarfile.rst:1121 +#: library/tarfile.rst:1134 msgid "" "Extraction filters were added to Python 3.12, but may be backported to older " "versions as security updates. To check whether the feature is available, use " @@ -1474,59 +1495,59 @@ msgid "" "version." msgstr "" -#: library/tarfile.rst:1126 +#: library/tarfile.rst:1139 msgid "" "The following examples show how to support Python versions with and without " "the feature. Note that setting ``extraction_filter`` will affect any " "subsequent operations." msgstr "" -#: library/tarfile.rst:1130 +#: library/tarfile.rst:1143 msgid "Fully trusted archive::" msgstr "" -#: library/tarfile.rst:1132 +#: library/tarfile.rst:1145 msgid "" "my_tarfile.extraction_filter = (lambda member, path: member)\n" "my_tarfile.extractall()" msgstr "" -#: library/tarfile.rst:1135 +#: library/tarfile.rst:1148 msgid "" "Use the ``'data'`` filter if available, but revert to Python 3.11 behavior " "(``'fully_trusted'``) if this feature is not available::" msgstr "" -#: library/tarfile.rst:1138 +#: library/tarfile.rst:1151 msgid "" "my_tarfile.extraction_filter = getattr(tarfile, 'data_filter',\n" " (lambda member, path: member))\n" "my_tarfile.extractall()" msgstr "" -#: library/tarfile.rst:1142 +#: library/tarfile.rst:1155 msgid "Use the ``'data'`` filter; *fail* if it is not available::" msgstr "" -#: library/tarfile.rst:1144 +#: library/tarfile.rst:1157 msgid "my_tarfile.extractall(filter=tarfile.data_filter)" msgstr "" -#: library/tarfile.rst:1146 +#: library/tarfile.rst:1159 msgid "or::" msgstr "" -#: library/tarfile.rst:1148 +#: library/tarfile.rst:1161 msgid "" "my_tarfile.extraction_filter = tarfile.data_filter\n" "my_tarfile.extractall()" msgstr "" -#: library/tarfile.rst:1151 +#: library/tarfile.rst:1164 msgid "Use the ``'data'`` filter; *warn* if it is not available::" msgstr "" -#: library/tarfile.rst:1153 +#: library/tarfile.rst:1166 msgid "" "if hasattr(tarfile, 'data_filter'):\n" " my_tarfile.extractall(filter='data')\n" @@ -1536,28 +1557,28 @@ msgid "" " my_tarfile.extractall()" msgstr "" -#: library/tarfile.rst:1162 +#: library/tarfile.rst:1175 msgid "Stateful extraction filter example" msgstr "" -#: library/tarfile.rst:1164 +#: library/tarfile.rst:1177 msgid "" "While *tarfile*'s extraction methods take a simple *filter* callable, custom " "filters may be more complex objects with an internal state. It may be useful " "to write these as context managers, to be used like this::" msgstr "" -#: library/tarfile.rst:1168 +#: library/tarfile.rst:1181 msgid "" "with StatefulFilter() as filter_func:\n" " tar.extractall(path, filter=filter_func)" msgstr "" -#: library/tarfile.rst:1171 +#: library/tarfile.rst:1184 msgid "Such a filter can be written as, for example::" msgstr "" -#: library/tarfile.rst:1173 +#: library/tarfile.rst:1186 msgid "" "class StatefulFilter:\n" " def __init__(self):\n" @@ -1574,103 +1595,103 @@ msgid "" " print(f'{self.file_count} files extracted')" msgstr "" -#: library/tarfile.rst:1193 +#: library/tarfile.rst:1206 msgid "Command-Line Interface" msgstr "" -#: library/tarfile.rst:1197 +#: library/tarfile.rst:1210 msgid "" "The :mod:`tarfile` module provides a simple command-line interface to " "interact with tar archives." msgstr "" -#: library/tarfile.rst:1200 +#: library/tarfile.rst:1213 msgid "" "If you want to create a new tar archive, specify its name after the :option:" "`-c` option and then list the filename(s) that should be included:" msgstr "" -#: library/tarfile.rst:1203 +#: library/tarfile.rst:1216 msgid "$ python -m tarfile -c monty.tar spam.txt eggs.txt" msgstr "" -#: library/tarfile.rst:1207 +#: library/tarfile.rst:1220 msgid "Passing a directory is also acceptable:" msgstr "" -#: library/tarfile.rst:1209 +#: library/tarfile.rst:1222 msgid "$ python -m tarfile -c monty.tar life-of-brian_1979/" msgstr "" -#: library/tarfile.rst:1213 +#: library/tarfile.rst:1226 msgid "" "If you want to extract a tar archive into the current directory, use the :" "option:`-e` option:" msgstr "" -#: library/tarfile.rst:1216 +#: library/tarfile.rst:1229 msgid "$ python -m tarfile -e monty.tar" msgstr "" -#: library/tarfile.rst:1220 +#: library/tarfile.rst:1233 msgid "" "You can also extract a tar archive into a different directory by passing the " "directory's name:" msgstr "" -#: library/tarfile.rst:1223 +#: library/tarfile.rst:1236 msgid "$ python -m tarfile -e monty.tar other-dir/" msgstr "" -#: library/tarfile.rst:1227 +#: library/tarfile.rst:1240 msgid "For a list of the files in a tar archive, use the :option:`-l` option:" msgstr "" -#: library/tarfile.rst:1229 +#: library/tarfile.rst:1242 msgid "$ python -m tarfile -l monty.tar" msgstr "" -#: library/tarfile.rst:1235 +#: library/tarfile.rst:1248 msgid "Command-line options" msgstr "" -#: library/tarfile.rst:1240 +#: library/tarfile.rst:1253 msgid "List files in a tarfile." msgstr "" -#: library/tarfile.rst:1245 +#: library/tarfile.rst:1258 msgid "Create tarfile from source files." msgstr "" -#: library/tarfile.rst:1250 +#: library/tarfile.rst:1263 msgid "" "Extract tarfile into the current directory if *output_dir* is not specified." msgstr "" -#: library/tarfile.rst:1255 +#: library/tarfile.rst:1268 msgid "Test whether the tarfile is valid or not." msgstr "" -#: library/tarfile.rst:1259 +#: library/tarfile.rst:1272 msgid "Verbose output." msgstr "" -#: library/tarfile.rst:1263 +#: library/tarfile.rst:1276 msgid "" "Specifies the *filter* for ``--extract``. See :ref:`tarfile-extraction-" "filter` for details. Only string names are accepted (that is, " "``fully_trusted``, ``tar``, and ``data``)." msgstr "" -#: library/tarfile.rst:1271 +#: library/tarfile.rst:1284 msgid "Examples" msgstr "" -#: library/tarfile.rst:1273 +#: library/tarfile.rst:1286 msgid "How to extract an entire tar archive to the current working directory::" msgstr "" -#: library/tarfile.rst:1275 +#: library/tarfile.rst:1288 msgid "" "import tarfile\n" "tar = tarfile.open(\"sample.tar.gz\")\n" @@ -1678,13 +1699,13 @@ msgid "" "tar.close()" msgstr "" -#: library/tarfile.rst:1280 +#: library/tarfile.rst:1293 msgid "" "How to extract a subset of a tar archive with :meth:`TarFile.extractall` " "using a generator function instead of a list::" msgstr "" -#: library/tarfile.rst:1283 +#: library/tarfile.rst:1296 msgid "" "import os\n" "import tarfile\n" @@ -1699,11 +1720,11 @@ msgid "" "tar.close()" msgstr "" -#: library/tarfile.rst:1295 +#: library/tarfile.rst:1308 msgid "How to create an uncompressed tar archive from a list of filenames::" msgstr "" -#: library/tarfile.rst:1297 +#: library/tarfile.rst:1310 msgid "" "import tarfile\n" "tar = tarfile.open(\"sample.tar\", \"w\")\n" @@ -1712,11 +1733,11 @@ msgid "" "tar.close()" msgstr "" -#: library/tarfile.rst:1303 +#: library/tarfile.rst:1316 msgid "The same example using the :keyword:`with` statement::" msgstr "" -#: library/tarfile.rst:1305 +#: library/tarfile.rst:1318 msgid "" "import tarfile\n" "with tarfile.open(\"sample.tar\", \"w\") as tar:\n" @@ -1724,13 +1745,13 @@ msgid "" " tar.add(name)" msgstr "" -#: library/tarfile.rst:1310 +#: library/tarfile.rst:1323 msgid "" "How to read a gzip compressed tar archive and display some member " "information::" msgstr "" -#: library/tarfile.rst:1312 +#: library/tarfile.rst:1325 msgid "" "import tarfile\n" "tar = tarfile.open(\"sample.tar.gz\", \"r:gz\")\n" @@ -1746,13 +1767,13 @@ msgid "" "tar.close()" msgstr "" -#: library/tarfile.rst:1324 +#: library/tarfile.rst:1337 msgid "" "How to create an archive and reset the user information using the *filter* " "parameter in :meth:`TarFile.add`::" msgstr "" -#: library/tarfile.rst:1327 +#: library/tarfile.rst:1340 msgid "" "import tarfile\n" "def reset(tarinfo):\n" @@ -1764,17 +1785,17 @@ msgid "" "tar.close()" msgstr "" -#: library/tarfile.rst:1340 +#: library/tarfile.rst:1353 msgid "Supported tar formats" msgstr "" -#: library/tarfile.rst:1342 +#: library/tarfile.rst:1355 msgid "" "There are three tar formats that can be created with the :mod:`tarfile` " "module:" msgstr "" -#: library/tarfile.rst:1344 +#: library/tarfile.rst:1357 msgid "" "The POSIX.1-1988 ustar format (:const:`USTAR_FORMAT`). It supports filenames " "up to a length of at best 256 characters and linknames up to 100 characters. " @@ -1782,7 +1803,7 @@ msgid "" "supported format." msgstr "" -#: library/tarfile.rst:1349 +#: library/tarfile.rst:1362 msgid "" "The GNU tar format (:const:`GNU_FORMAT`). It supports long filenames and " "linknames, files bigger than 8 GiB and sparse files. It is the de facto " @@ -1790,7 +1811,7 @@ msgid "" "extensions for long names, sparse file support is read-only." msgstr "" -#: library/tarfile.rst:1354 +#: library/tarfile.rst:1367 msgid "" "The POSIX.1-2001 pax format (:const:`PAX_FORMAT`). It is the most flexible " "format with virtually no limits. It supports long filenames and linknames, " @@ -1801,7 +1822,7 @@ msgid "" "*ustar* format. It is the current default format for new archives." msgstr "" -#: library/tarfile.rst:1362 +#: library/tarfile.rst:1375 msgid "" "It extends the existing *ustar* format with extra headers for information " "that cannot be stored otherwise. There are two flavours of pax headers: " @@ -1810,13 +1831,13 @@ msgid "" "in a pax header is encoded in *UTF-8* for portability reasons." msgstr "" -#: library/tarfile.rst:1368 +#: library/tarfile.rst:1381 msgid "" "There are some more variants of the tar format which can be read, but not " "created:" msgstr "" -#: library/tarfile.rst:1371 +#: library/tarfile.rst:1384 msgid "" "The ancient V7 format. This is the first tar format from Unix Seventh " "Edition, storing only regular files and directories. Names must not be " @@ -1825,17 +1846,17 @@ msgid "" "ASCII characters." msgstr "" -#: library/tarfile.rst:1376 +#: library/tarfile.rst:1389 msgid "" "The SunOS tar extended format. This format is a variant of the POSIX.1-2001 " "pax format, but is not compatible." msgstr "" -#: library/tarfile.rst:1382 +#: library/tarfile.rst:1395 msgid "Unicode issues" msgstr "" -#: library/tarfile.rst:1384 +#: library/tarfile.rst:1397 msgid "" "The tar format was originally conceived to make backups on tape drives with " "the main focus on preserving file system information. Nowadays tar archives " @@ -1850,13 +1871,13 @@ msgid "" "It stores non-ASCII metadata using the universal character encoding *UTF-8*." msgstr "" -#: library/tarfile.rst:1396 +#: library/tarfile.rst:1409 msgid "" "The details of character conversion in :mod:`tarfile` are controlled by the " "*encoding* and *errors* keyword arguments of the :class:`TarFile` class." msgstr "" -#: library/tarfile.rst:1399 +#: library/tarfile.rst:1412 msgid "" "*encoding* defines the character encoding to use for the metadata in the " "archive. The default value is :func:`sys.getfilesystemencoding` or " @@ -1865,7 +1886,7 @@ msgid "" "not set appropriately, this conversion may fail." msgstr "" -#: library/tarfile.rst:1405 +#: library/tarfile.rst:1418 msgid "" "The *errors* argument defines how characters are treated that cannot be " "converted. Possible values are listed in section :ref:`error-handlers`. The " @@ -1873,7 +1894,7 @@ msgid "" "system calls, see :ref:`os-filenames`." msgstr "" -#: library/tarfile.rst:1410 +#: library/tarfile.rst:1423 msgid "" "For :const:`PAX_FORMAT` archives (the default), *encoding* is generally not " "needed because all the metadata is stored using *UTF-8*. *encoding* is only " diff --git a/library/telnetlib.po b/library/telnetlib.po index 10e37a9c..7b3592cb 100644 --- a/library/telnetlib.po +++ b/library/telnetlib.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -18,320 +18,25 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" #: library/telnetlib.rst:2 -msgid ":mod:`telnetlib` --- Telnet client" +msgid ":mod:`!telnetlib` --- Telnet client" msgstr "" #: library/telnetlib.rst:10 -msgid "**Source code:** :source:`Lib/telnetlib.py`" -msgstr "" - -#: library/telnetlib.rst:14 -msgid "" -"The :mod:`telnetlib` module is deprecated (see :pep:`PEP 594 " -"<594#telnetlib>` for details and alternatives)." -msgstr "" - -#: library/telnetlib.rst:20 -msgid "" -"The :mod:`telnetlib` module provides a :class:`Telnet` class that implements " -"the Telnet protocol. See :rfc:`854` for details about the protocol. In " -"addition, it provides symbolic constants for the protocol characters (see " -"below), and for the telnet options. The symbolic names of the telnet options " -"follow the definitions in ``arpa/telnet.h``, with the leading ``TELOPT_`` " -"removed. For symbolic names of options which are traditionally not included " -"in ``arpa/telnet.h``, see the module source itself." -msgstr "" - -#: library/telnetlib.rst:28 -msgid "" -"The symbolic constants for the telnet commands are: IAC, DONT, DO, WONT, " -"WILL, SE (Subnegotiation End), NOP (No Operation), DM (Data Mark), BRK " -"(Break), IP (Interrupt process), AO (Abort output), AYT (Are You There), EC " -"(Erase Character), EL (Erase Line), GA (Go Ahead), SB (Subnegotiation Begin)." -msgstr "" - -#: includes/wasm-notavail.rst:3 -msgid "Availability" -msgstr "" - -#: includes/wasm-notavail.rst:5 -msgid "" -"This module does not work or is not available on WebAssembly platforms " -"``wasm32-emscripten`` and ``wasm32-wasi``. See :ref:`wasm-availability` for " -"more information." -msgstr "" - -#: library/telnetlib.rst:37 -msgid "" -":class:`Telnet` represents a connection to a Telnet server. The instance is " -"initially not connected by default; the :meth:`~Telnet.open` method must be " -"used to establish a connection. Alternatively, the host name and optional " -"port number can be passed to the constructor too, in which case the " -"connection to the server will be established before the constructor " -"returns. The optional *timeout* parameter specifies a timeout in seconds " -"for blocking operations like the connection attempt (if not specified, the " -"global default timeout setting will be used)." -msgstr "" - -#: library/telnetlib.rst:46 -msgid "Do not reopen an already connected instance." -msgstr "" - -#: library/telnetlib.rst:48 -msgid "" -"This class has many :meth:`read_\\*` methods. Note that some of them " -"raise :exc:`EOFError` when the end of the connection is read, because they " -"can return an empty string for other reasons. See the individual " -"descriptions below." -msgstr "" - -#: library/telnetlib.rst:52 -msgid "" -"A :class:`Telnet` object is a context manager and can be used in a :keyword:" -"`with` statement. When the :keyword:`!with` block ends, the :meth:`close` " -"method is called::" -msgstr "" - -#: library/telnetlib.rst:56 msgid "" -">>> from telnetlib import Telnet\n" -">>> with Telnet('localhost', 23) as tn:\n" -"... tn.interact()\n" -"..." -msgstr "" - -#: library/telnetlib.rst:61 -msgid "Context manager support added" -msgstr "" - -#: library/telnetlib.rst:66 -msgid ":rfc:`854` - Telnet Protocol Specification" -msgstr "" - -#: library/telnetlib.rst:67 -msgid "Definition of the Telnet protocol." -msgstr "" - -#: library/telnetlib.rst:73 -msgid "Telnet Objects" -msgstr "" - -#: library/telnetlib.rst:75 -msgid ":class:`Telnet` instances have the following methods:" -msgstr "" - -#: library/telnetlib.rst:80 -msgid "" -"Read until a given byte string, *expected*, is encountered or until " -"*timeout* seconds have passed." -msgstr "" - -#: library/telnetlib.rst:83 -msgid "" -"When no match is found, return whatever is available instead, possibly empty " -"bytes. Raise :exc:`EOFError` if the connection is closed and no cooked data " -"is available." -msgstr "" - -#: library/telnetlib.rst:90 -msgid "Read all data until EOF as bytes; block until connection closed." -msgstr "" - -#: library/telnetlib.rst:95 -msgid "" -"Read at least one byte of cooked data unless EOF is hit. Return ``b''`` if " -"EOF is hit. Block if no data is immediately available." -msgstr "" - -#: library/telnetlib.rst:101 -msgid "Read everything that can be without blocking in I/O (eager)." -msgstr "" - -#: library/telnetlib.rst:112 -msgid "" -"Raise :exc:`EOFError` if connection closed and no cooked data available. " -"Return ``b''`` if no cooked data available otherwise. Do not block unless in " -"the midst of an IAC sequence." -msgstr "" - -#: library/telnetlib.rst:110 -msgid "Read readily available data." -msgstr "" - -#: library/telnetlib.rst:119 -msgid "Process and return data already in the queues (lazy)." -msgstr "" - -#: library/telnetlib.rst:121 -msgid "" -"Raise :exc:`EOFError` if connection closed and no data available. Return " -"``b''`` if no cooked data available otherwise. Do not block unless in the " -"midst of an IAC sequence." -msgstr "" - -#: library/telnetlib.rst:128 -msgid "Return any data available in the cooked queue (very lazy)." +"This module is no longer part of the Python standard library. It was :ref:" +"`removed in Python 3.13 ` after being deprecated in " +"Python 3.11. The removal was decided in :pep:`594`." msgstr "" -#: library/telnetlib.rst:130 -msgid "" -"Raise :exc:`EOFError` if connection closed and no data available. Return " -"``b''`` if no cooked data available otherwise. This method never blocks." -msgstr "" - -#: library/telnetlib.rst:136 -msgid "" -"Return the data collected between a SB/SE pair (suboption begin/end). The " -"callback should access these data when it was invoked with a ``SE`` command. " -"This method never blocks." -msgstr "" - -#: library/telnetlib.rst:143 -msgid "" -"Connect to a host. The optional second argument is the port number, which " -"defaults to the standard Telnet port (23). The optional *timeout* parameter " -"specifies a timeout in seconds for blocking operations like the connection " -"attempt (if not specified, the global default timeout setting will be used)." -msgstr "" - -#: library/telnetlib.rst:148 -msgid "Do not try to reopen an already connected instance." -msgstr "" - -#: library/telnetlib.rst:150 -msgid "" -"Raises an :ref:`auditing event ` ``telnetlib.Telnet.open`` with " -"arguments ``self``, ``host``, ``port``." -msgstr "" - -#: library/telnetlib.rst:155 -msgid "" -"Print a debug message when the debug level is ``>`` 0. If extra arguments " -"are present, they are substituted in the message using the standard string " -"formatting operator." -msgstr "" - -#: library/telnetlib.rst:162 -msgid "" -"Set the debug level. The higher the value of *debuglevel*, the more debug " -"output you get (on ``sys.stdout``)." -msgstr "" - -#: library/telnetlib.rst:168 -msgid "Close the connection." -msgstr "" - -#: library/telnetlib.rst:173 -msgid "Return the socket object used internally." -msgstr "" - -#: library/telnetlib.rst:178 -msgid "Return the file descriptor of the socket object used internally." -msgstr "" - -#: library/telnetlib.rst:183 -msgid "" -"Write a byte string to the socket, doubling any IAC characters. This can " -"block if the connection is blocked. May raise :exc:`OSError` if the " -"connection is closed." -msgstr "" - -#: library/telnetlib.rst:187 -msgid "" -"Raises an :ref:`auditing event ` ``telnetlib.Telnet.write`` with " -"arguments ``self``, ``buffer``." -msgstr "" - -#: library/telnetlib.rst:189 -msgid "" -"This method used to raise :exc:`socket.error`, which is now an alias of :exc:" -"`OSError`." -msgstr "" - -#: library/telnetlib.rst:196 -msgid "Interaction function, emulates a very dumb Telnet client." -msgstr "" - -#: library/telnetlib.rst:201 -msgid "Multithreaded version of :meth:`interact`." -msgstr "" - -#: library/telnetlib.rst:206 -msgid "Read until one from a list of a regular expressions matches." -msgstr "" - -#: library/telnetlib.rst:208 -msgid "" -"The first argument is a list of regular expressions, either compiled (:ref:" -"`regex objects `) or uncompiled (byte strings). The optional " -"second argument is a timeout, in seconds; the default is to block " -"indefinitely." -msgstr "" - -#: library/telnetlib.rst:213 -msgid "" -"Return a tuple of three items: the index in the list of the first regular " -"expression that matches; the match object returned; and the bytes read up " -"till and including the match." -msgstr "" - -#: library/telnetlib.rst:217 -msgid "" -"If end of file is found and no bytes were read, raise :exc:`EOFError`. " -"Otherwise, when nothing matches, return ``(-1, None, data)`` where *data* is " -"the bytes received so far (may be empty bytes if a timeout happened)." -msgstr "" - -#: library/telnetlib.rst:221 +#: library/telnetlib.rst:14 msgid "" -"If a regular expression ends with a greedy match (such as ``.*``) or if more " -"than one expression can match the same input, the results are non-" -"deterministic, and may depend on the I/O timing." +"Possible replacements are third-party libraries from PyPI: :pypi:" +"`telnetlib3` or :pypi:`Exscript`. These are not supported or maintained by " +"the Python core team." msgstr "" -#: library/telnetlib.rst:228 +#: library/telnetlib.rst:18 msgid "" -"Each time a telnet option is read on the input flow, this *callback* (if " -"set) is called with the following parameters: callback(telnet socket, " -"command (DO/DONT/WILL/WONT), option). No other action is done afterwards by " -"telnetlib." -msgstr "" - -#: library/telnetlib.rst:236 -msgid "Telnet Example" -msgstr "" - -#: library/telnetlib.rst:241 -msgid "A simple example illustrating typical use::" -msgstr "" - -#: library/telnetlib.rst:243 -msgid "" -"import getpass\n" -"import telnetlib\n" -"\n" -"HOST = \"localhost\"\n" -"user = input(\"Enter your remote account: \")\n" -"password = getpass.getpass()\n" -"\n" -"tn = telnetlib.Telnet(HOST)\n" -"\n" -"tn.read_until(b\"login: \")\n" -"tn.write(user.encode('ascii') + b\"\\n\")\n" -"if password:\n" -" tn.read_until(b\"Password: \")\n" -" tn.write(password.encode('ascii') + b\"\\n\")\n" -"\n" -"tn.write(b\"ls\\n\")\n" -"tn.write(b\"exit\\n\")\n" -"\n" -"print(tn.read_all().decode('ascii'))" -msgstr "" - -#: library/telnetlib.rst:12 -msgid "protocol" -msgstr "" - -#: library/telnetlib.rst:12 -msgid "Telnet" +"The last version of Python that provided the :mod:`!telnetlib` module was " +"`Python 3.12 `_." msgstr "" diff --git a/library/tempfile.po b/library/tempfile.po index 40d96e18..1c202e95 100644 --- a/library/tempfile.po +++ b/library/tempfile.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" diff --git a/library/termios.po b/library/termios.po index f4e12932..3b4694a4 100644 --- a/library/termios.po +++ b/library/termios.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" diff --git a/library/test.po b/library/test.po index ce1b7c39..caf551c2 100644 --- a/library/test.po +++ b/library/test.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -744,7 +744,7 @@ msgstr "" msgid "Context manager to swap out an attribute with a new object." msgstr "" -#: library/test.rst:625 library/test.rst:1326 +#: library/test.rst:625 library/test.rst:1332 msgid "Usage::" msgstr "" @@ -883,54 +883,60 @@ msgid "" msgstr "" #: library/test.rst:736 +msgid "" +"Decorator for skipping tests on the free-threaded build. If the :term:`GIL` " +"is disabled, the test is skipped." +msgstr "" + +#: library/test.rst:742 msgid "Decorator for skipping tests on non-IEEE 754 platforms." msgstr "" -#: library/test.rst:741 +#: library/test.rst:747 msgid "Decorator for skipping tests if :mod:`zlib` doesn't exist." msgstr "" -#: library/test.rst:746 +#: library/test.rst:752 msgid "Decorator for skipping tests if :mod:`gzip` doesn't exist." msgstr "" -#: library/test.rst:751 +#: library/test.rst:757 msgid "Decorator for skipping tests if :mod:`bz2` doesn't exist." msgstr "" -#: library/test.rst:756 +#: library/test.rst:762 msgid "Decorator for skipping tests if :mod:`lzma` doesn't exist." msgstr "" -#: library/test.rst:761 +#: library/test.rst:767 msgid "Decorator for skipping tests if *resource* is not available." msgstr "" -#: library/test.rst:766 +#: library/test.rst:772 msgid "Decorator for only running the test if :data:`HAVE_DOCSTRINGS`." msgstr "" -#: library/test.rst:771 +#: library/test.rst:777 msgid "" "Decorator for only running the test if :ref:`Limited C API ` " "is available." msgstr "" -#: library/test.rst:777 +#: library/test.rst:783 msgid "Decorator for tests only applicable to CPython." msgstr "" -#: library/test.rst:782 +#: library/test.rst:788 msgid "" "Decorator for invoking :func:`check_impl_detail` on *guards*. If that " "returns ``False``, then uses *msg* as the reason for skipping the test." msgstr "" -#: library/test.rst:788 +#: library/test.rst:794 msgid "Decorator to temporarily turn off tracing for the duration of the test." msgstr "" -#: library/test.rst:793 +#: library/test.rst:799 msgid "" "Decorator for tests which involve reference counting. The decorator does " "not run the test if it is not run by CPython. Any trace function is unset " @@ -938,11 +944,11 @@ msgid "" "trace function." msgstr "" -#: library/test.rst:801 +#: library/test.rst:807 msgid "Decorator for bigmem tests." msgstr "" -#: library/test.rst:803 +#: library/test.rst:809 msgid "" "*size* is a requested size for the test (in arbitrary, test-interpreted " "units.) *memuse* is the number of bytes per unit for the test, or a good " @@ -950,7 +956,7 @@ msgid "" "each, could be decorated with ``@bigmemtest(size=_4G, memuse=2)``." msgstr "" -#: library/test.rst:808 +#: library/test.rst:814 msgid "" "The *size* argument is normally passed to the decorated test method as an " "extra argument. If *dry_run* is ``True``, the value passed to the test " @@ -958,11 +964,11 @@ msgid "" "means the test doesn't support dummy runs when ``-M`` is not specified." msgstr "" -#: library/test.rst:816 +#: library/test.rst:822 msgid "Decorator for tests that fill the address space." msgstr "" -#: library/test.rst:821 +#: library/test.rst:827 msgid "" "Test for syntax errors in *statement* by attempting to compile *statement*. " "*testcase* is the :mod:`unittest` instance for the test. *errtext* is the " @@ -972,44 +978,44 @@ msgid "" "of the exception." msgstr "" -#: library/test.rst:831 +#: library/test.rst:837 msgid "Open *url*. If open fails, raises :exc:`TestFailed`." msgstr "" -#: library/test.rst:836 +#: library/test.rst:842 msgid "" "Use this at the end of ``test_main`` whenever sub-processes are started. " "This will help ensure that no extra children (zombies) stick around to hog " "resources and create problems when looking for refleaks." msgstr "" -#: library/test.rst:843 +#: library/test.rst:849 msgid "" "Get an attribute, raising :exc:`unittest.SkipTest` if :exc:`AttributeError` " "is raised." msgstr "" -#: library/test.rst:849 +#: library/test.rst:855 msgid "" "Context manager catching unraisable exception using :func:`sys." "unraisablehook`." msgstr "" -#: library/test.rst:852 +#: library/test.rst:858 msgid "" "Storing the exception value (``cm.unraisable.exc_value``) creates a " "reference cycle. The reference cycle is broken explicitly when the context " "manager exits." msgstr "" -#: library/test.rst:856 +#: library/test.rst:862 msgid "" "Storing the object (``cm.unraisable.object``) can resurrect it if it is set " "to an object which is being finalized. Exiting the context manager clears " "the stored object." msgstr "" -#: library/test.rst:862 +#: library/test.rst:868 msgid "" "with support.catch_unraisable_exception() as cm:\n" " # code creating an \"unraisable exception\"\n" @@ -1022,7 +1028,7 @@ msgid "" "# (to break a reference cycle)" msgstr "" -#: library/test.rst:877 +#: library/test.rst:883 msgid "" "Generic implementation of the :mod:`unittest` ``load_tests`` protocol for " "use in test packages. *pkg_dir* is the root directory of the package; " @@ -1031,7 +1037,7 @@ msgid "" "the following::" msgstr "" -#: library/test.rst:883 +#: library/test.rst:889 msgid "" "import os\n" "from test.support import load_package_tests\n" @@ -1040,55 +1046,55 @@ msgid "" " return load_package_tests(os.path.dirname(__file__), *args)" msgstr "" -#: library/test.rst:892 +#: library/test.rst:898 msgid "" "Returns the set of attributes, functions or methods of *ref_api* not found " "on *other_api*, except for a defined list of items to be ignored in this " "check specified in *ignore*." msgstr "" -#: library/test.rst:896 +#: library/test.rst:902 msgid "" "By default this skips private attributes beginning with '_' but includes all " "magic methods, i.e. those starting and ending in '__'." msgstr "" -#: library/test.rst:904 +#: library/test.rst:910 msgid "" "Override *object_to_patch.attr_name* with *new_value*. Also add cleanup " "procedure to *test_instance* to restore *object_to_patch* for *attr_name*. " "The *attr_name* should be a valid attribute for *object_to_patch*." msgstr "" -#: library/test.rst:912 +#: library/test.rst:918 msgid "" "Run *code* in subinterpreter. Raise :exc:`unittest.SkipTest` if :mod:" "`tracemalloc` is enabled." msgstr "" -#: library/test.rst:918 +#: library/test.rst:924 msgid "Assert instances of *cls* are deallocated after iterating." msgstr "" -#: library/test.rst:923 +#: library/test.rst:929 msgid "" "Check for the existence of the compiler executables whose names are listed " "in *cmd_names* or all the compiler executables when *cmd_names* is empty and " "return the first missing executable or ``None`` when none is found missing." msgstr "" -#: library/test.rst:931 +#: library/test.rst:937 msgid "" "Assert that the ``__all__`` variable of *module* contains all public names." msgstr "" -#: library/test.rst:933 +#: library/test.rst:939 msgid "" "The module's public names (its API) are detected automatically based on " "whether they match the public name convention and were defined in *module*." msgstr "" -#: library/test.rst:937 +#: library/test.rst:943 msgid "" "The *name_of_module* argument can specify (as a string or tuple thereof) " "what module(s) an API could be defined in order to be detected as a public " @@ -1096,7 +1102,7 @@ msgid "" "other modules, possibly a C backend (like ``csv`` and its ``_csv``)." msgstr "" -#: library/test.rst:942 +#: library/test.rst:948 msgid "" "The *extra* argument can be a set of names that wouldn't otherwise be " "automatically detected as \"public\", like objects without a proper :attr:" @@ -1104,17 +1110,17 @@ msgid "" "automatically detected ones." msgstr "" -#: library/test.rst:946 +#: library/test.rst:952 msgid "" "The *not_exported* argument can be a set of names that must not be treated " "as part of the public API even though their names indicate otherwise." msgstr "" -#: library/test.rst:1576 +#: library/test.rst:1582 msgid "Example use::" msgstr "" -#: library/test.rst:951 +#: library/test.rst:957 msgid "" "import bar\n" "import foo\n" @@ -1134,18 +1140,18 @@ msgid "" " extra=extra, not_exported=not_exported)" msgstr "" -#: library/test.rst:972 +#: library/test.rst:978 msgid "" "Skip tests if the :mod:`multiprocessing.synchronize` module is missing, if " "there is no available semaphore implementation, or if creating a lock raises " "an :exc:`OSError`." msgstr "" -#: library/test.rst:981 +#: library/test.rst:987 msgid "Assert that type *tp* cannot be instantiated using *args* and *kwds*." msgstr "" -#: library/test.rst:988 +#: library/test.rst:994 msgid "" "This function returns a context manager that will change the global :func:" "`sys.set_int_max_str_digits` setting for the duration of the context to " @@ -1153,73 +1159,73 @@ msgid "" "digits when converting between an integer and string." msgstr "" -#: library/test.rst:996 +#: library/test.rst:1002 msgid "The :mod:`test.support` module defines the following classes:" msgstr "" -#: library/test.rst:1001 +#: library/test.rst:1007 msgid "" "A context manager used to try to prevent crash dialog popups on tests that " "are expected to crash a subprocess." msgstr "" -#: library/test.rst:1004 +#: library/test.rst:1010 msgid "" "On Windows, it disables Windows Error Reporting dialogs using `SetErrorMode " "`_." msgstr "" -#: library/test.rst:1007 +#: library/test.rst:1013 msgid "" "On UNIX, :func:`resource.setrlimit` is used to set :const:`resource." "RLIMIT_CORE`'s soft limit to 0 to prevent coredump file creation." msgstr "" -#: library/test.rst:1011 +#: library/test.rst:1017 msgid "" "On both platforms, the old value is restored by :meth:`~object.__exit__`." msgstr "" -#: library/test.rst:1016 +#: library/test.rst:1022 msgid "" "Class to save and restore signal handlers registered by the Python signal " "handler." msgstr "" -#: library/test.rst:1021 +#: library/test.rst:1027 msgid "" "Save the signal handlers to a dictionary mapping signal numbers to the " "current signal handler." msgstr "" -#: library/test.rst:1026 +#: library/test.rst:1032 msgid "" "Set the signal numbers from the :meth:`save` dictionary to the saved handler." msgstr "" -#: library/test.rst:1034 +#: library/test.rst:1040 msgid "Try to match a single dict with the supplied arguments." msgstr "" -#: library/test.rst:1039 +#: library/test.rst:1045 msgid "Try to match a single stored value (*dv*) with a supplied value (*v*)." msgstr "" -#: library/test.rst:1043 +#: library/test.rst:1049 msgid ":mod:`test.support.socket_helper` --- Utilities for socket tests" msgstr "" -#: library/test.rst:1049 +#: library/test.rst:1055 msgid "" "The :mod:`test.support.socket_helper` module provides support for socket " "tests." msgstr "" -#: library/test.rst:1056 +#: library/test.rst:1062 msgid "Set to ``True`` if IPv6 is enabled on this host, ``False`` otherwise." msgstr "" -#: library/test.rst:1061 +#: library/test.rst:1067 msgid "" "Returns an unused port that should be suitable for binding. This is " "achieved by creating a temporary socket with the same family and type as the " @@ -1230,7 +1236,7 @@ msgid "" "port is returned." msgstr "" -#: library/test.rst:1070 +#: library/test.rst:1076 msgid "" "Either this method or :func:`bind_port` should be used for any tests where a " "server socket needs to be bound to a particular port for the duration of the " @@ -1243,7 +1249,7 @@ msgid "" "simultaneously, which is a problem for buildbots." msgstr "" -#: library/test.rst:1084 +#: library/test.rst:1090 msgid "" "Bind the socket to a free port and return the port number. Relies on " "ephemeral ports in order to ensure we are using an unbound port. This is " @@ -1256,7 +1262,7 @@ msgid "" "testing multicasting via multiple UDP sockets." msgstr "" -#: library/test.rst:1095 +#: library/test.rst:1101 msgid "" "Additionally, if the :const:`~socket.SO_EXCLUSIVEADDRUSE` socket option is " "available (i.e. on Windows), it will be set on the socket. This will " @@ -1264,58 +1270,58 @@ msgid "" "test." msgstr "" -#: library/test.rst:1103 +#: library/test.rst:1109 msgid "" "Bind a Unix socket, raising :exc:`unittest.SkipTest` if :exc:" "`PermissionError` is raised." msgstr "" -#: library/test.rst:1109 +#: library/test.rst:1115 msgid "" "A decorator for running tests that require a functional ``bind()`` for Unix " "sockets." msgstr "" -#: library/test.rst:1115 +#: library/test.rst:1121 msgid "" "A context manager that raises :exc:`~test.support.ResourceDenied` when " "various issues with the internet connection manifest themselves as " "exceptions." msgstr "" -#: library/test.rst:1121 +#: library/test.rst:1127 msgid "" ":mod:`test.support.script_helper` --- Utilities for the Python execution " "tests" msgstr "" -#: library/test.rst:1127 +#: library/test.rst:1133 msgid "" "The :mod:`test.support.script_helper` module provides support for Python's " "script execution tests." msgstr "" -#: library/test.rst:1132 +#: library/test.rst:1138 msgid "" "Return ``True`` if ``sys.executable interpreter`` requires environment " "variables in order to be able to run at all." msgstr "" -#: library/test.rst:1135 +#: library/test.rst:1141 msgid "" "This is designed to be used with ``@unittest.skipIf()`` to annotate tests " "that need to use an ``assert_python*()`` function to launch an isolated mode " "(``-I``) or no environment mode (``-E``) sub-interpreter process." msgstr "" -#: library/test.rst:1139 +#: library/test.rst:1145 msgid "" "A normal build & test does not run into this situation but it can happen " "when trying to run the standard library test suite from an interpreter that " "doesn't have an obvious home with Python's current home finding logic." msgstr "" -#: library/test.rst:1143 +#: library/test.rst:1149 msgid "" "Setting :envvar:`PYTHONHOME` is one way to get most of the testsuite to run " "in that situation. :envvar:`PYTHONPATH` or :envvar:`PYTHONUSERSITE` are " @@ -1323,84 +1329,84 @@ msgid "" "interpreter can start." msgstr "" -#: library/test.rst:1151 +#: library/test.rst:1157 msgid "" "Set up the environment based on *env_vars* for running the interpreter in a " "subprocess. The values can include ``__isolated``, ``__cleanenv``, " "``__cwd``, and ``TERM``." msgstr "" -#: library/test.rst:1171 library/test.rst:1183 +#: library/test.rst:1177 library/test.rst:1189 msgid "The function no longer strips whitespaces from *stderr*." msgstr "" -#: library/test.rst:1161 +#: library/test.rst:1167 msgid "" "Assert that running the interpreter with *args* and optional environment " "variables *env_vars* succeeds (``rc == 0``) and return a ``(return code, " "stdout, stderr)`` tuple." msgstr "" -#: library/test.rst:1165 +#: library/test.rst:1171 msgid "" "If the *__cleanenv* keyword-only parameter is set, *env_vars* is used as a " "fresh environment." msgstr "" -#: library/test.rst:1168 +#: library/test.rst:1174 msgid "" "Python is started in isolated mode (command line option ``-I``), except if " "the *__isolated* keyword-only parameter is set to ``False``." msgstr "" -#: library/test.rst:1177 +#: library/test.rst:1183 msgid "" "Assert that running the interpreter with *args* and optional environment " "variables *env_vars* fails (``rc != 0``) and return a ``(return code, " "stdout, stderr)`` tuple." msgstr "" -#: library/test.rst:1181 +#: library/test.rst:1187 msgid "See :func:`assert_python_ok` for more options." msgstr "" -#: library/test.rst:1189 +#: library/test.rst:1195 msgid "Run a Python subprocess with the given arguments." msgstr "" -#: library/test.rst:1191 +#: library/test.rst:1197 msgid "" "*kw* is extra keyword args to pass to :func:`subprocess.Popen`. Returns a :" "class:`subprocess.Popen` object." msgstr "" -#: library/test.rst:1197 +#: library/test.rst:1203 msgid "" "Run the given :class:`subprocess.Popen` process until completion and return " "stdout." msgstr "" -#: library/test.rst:1203 +#: library/test.rst:1209 msgid "" "Create script containing *source* in path *script_dir* and " "*script_basename*. If *omit_suffix* is ``False``, append ``.py`` to the " "name. Return the full script path." msgstr "" -#: library/test.rst:1210 +#: library/test.rst:1216 msgid "" "Create zip file at *zip_dir* and *zip_basename* with extension ``zip`` which " "contains the files in *script_name*. *name_in_zip* is the archive name. " "Return a tuple containing ``(full path, full path of archive name)``." msgstr "" -#: library/test.rst:1217 +#: library/test.rst:1223 msgid "" "Create a directory named *pkg_dir* containing an ``__init__`` file with " "*init_source* as its contents." msgstr "" -#: library/test.rst:1224 +#: library/test.rst:1230 msgid "" "Create a zip package directory with a path of *zip_dir* and *zip_basename* " "containing an empty ``__init__`` file and a file *script_basename* " @@ -1409,60 +1415,60 @@ msgid "" "path and the archive name for the zip file." msgstr "" -#: library/test.rst:1232 +#: library/test.rst:1238 msgid "" ":mod:`test.support.bytecode_helper` --- Support tools for testing correct " "bytecode generation" msgstr "" -#: library/test.rst:1237 +#: library/test.rst:1243 msgid "" "The :mod:`test.support.bytecode_helper` module provides support for testing " "and inspecting bytecode generation." msgstr "" -#: library/test.rst:1242 +#: library/test.rst:1248 msgid "The module defines the following class:" msgstr "" -#: library/test.rst:1246 +#: library/test.rst:1252 msgid "This class has custom assertion methods for inspecting bytecode." msgstr "" -#: library/test.rst:1250 +#: library/test.rst:1256 msgid "Return the disassembly of *co* as string." msgstr "" -#: library/test.rst:1255 +#: library/test.rst:1261 msgid "" "Return instr if *opname* is found, otherwise throws :exc:`AssertionError`." msgstr "" -#: library/test.rst:1260 +#: library/test.rst:1266 msgid "Throws :exc:`AssertionError` if *opname* is found." msgstr "" -#: library/test.rst:1264 +#: library/test.rst:1270 msgid ":mod:`test.support.threading_helper` --- Utilities for threading tests" msgstr "" -#: library/test.rst:1269 +#: library/test.rst:1275 msgid "" "The :mod:`test.support.threading_helper` module provides support for " "threading tests." msgstr "" -#: library/test.rst:1276 +#: library/test.rst:1282 msgid "" "Join a *thread* within *timeout*. Raise an :exc:`AssertionError` if thread " "is still alive after *timeout* seconds." msgstr "" -#: library/test.rst:1282 +#: library/test.rst:1288 msgid "Decorator to ensure the threads are cleaned up even if the test fails." msgstr "" -#: library/test.rst:1287 +#: library/test.rst:1293 msgid "" "Context manager to start *threads*, which is a sequence of threads. *unlock* " "is a function called after the threads are started, even if an exception was " @@ -1470,57 +1476,57 @@ msgid "" "will attempt to join the started threads upon exit." msgstr "" -#: library/test.rst:1295 +#: library/test.rst:1301 msgid "" "Cleanup up threads not specified in *original_values*. Designed to emit a " "warning if a test leaves running threads in the background." msgstr "" -#: library/test.rst:1301 +#: library/test.rst:1307 msgid "Return current thread count and copy of dangling threads." msgstr "" -#: library/test.rst:1306 +#: library/test.rst:1312 msgid "" "Context manager to wait until all threads created in the ``with`` statement " "exit." msgstr "" -#: library/test.rst:1312 +#: library/test.rst:1318 msgid "" "Context manager catching :class:`threading.Thread` exception using :func:" "`threading.excepthook`." msgstr "" -#: library/test.rst:1315 +#: library/test.rst:1321 msgid "Attributes set when an exception is caught:" msgstr "" -#: library/test.rst:1317 +#: library/test.rst:1323 msgid "``exc_type``" msgstr "" -#: library/test.rst:1318 +#: library/test.rst:1324 msgid "``exc_value``" msgstr "" -#: library/test.rst:1319 +#: library/test.rst:1325 msgid "``exc_traceback``" msgstr "" -#: library/test.rst:1320 +#: library/test.rst:1326 msgid "``thread``" msgstr "" -#: library/test.rst:1322 +#: library/test.rst:1328 msgid "See :func:`threading.excepthook` documentation." msgstr "" -#: library/test.rst:1324 +#: library/test.rst:1330 msgid "These attributes are deleted at the context manager exit." msgstr "" -#: library/test.rst:1328 +#: library/test.rst:1334 msgid "" "with threading_helper.catch_threading_exception() as cm:\n" " # code spawning a thread which raises an exception\n" @@ -1535,29 +1541,29 @@ msgid "" "# (to avoid reference cycles)" msgstr "" -#: library/test.rst:1344 +#: library/test.rst:1350 msgid ":mod:`test.support.os_helper` --- Utilities for os tests" msgstr "" -#: library/test.rst:1349 +#: library/test.rst:1355 msgid "The :mod:`test.support.os_helper` module provides support for os tests." msgstr "" -#: library/test.rst:1356 +#: library/test.rst:1362 msgid "A non-ASCII character encodable by :func:`os.fsencode`." msgstr "" -#: library/test.rst:1361 +#: library/test.rst:1367 msgid "Set to :func:`os.getcwd`." msgstr "" -#: library/test.rst:1366 +#: library/test.rst:1372 msgid "" "Set to a name that is safe to use as the name of a temporary file. Any " "temporary file that is created should be closed and unlinked (removed)." msgstr "" -#: library/test.rst:1372 +#: library/test.rst:1378 msgid "" "Set to a filename containing the :data:`FS_NONASCII` character, if it " "exists. This guarantees that if the filename exists, it can be encoded and " @@ -1565,25 +1571,25 @@ msgid "" "a non-ASCII filename to be easily skipped on platforms where they can't work." msgstr "" -#: library/test.rst:1380 +#: library/test.rst:1386 msgid "" "Set to a filename (str type) that should not be able to be encoded by file " "system encoding in strict mode. It may be ``None`` if it's not possible to " "generate such a filename." msgstr "" -#: library/test.rst:1387 +#: library/test.rst:1393 msgid "" "Set to a filename (bytes type) that should not be able to be decoded by file " "system encoding in strict mode. It may be ``None`` if it's not possible to " "generate such a filename." msgstr "" -#: library/test.rst:1394 +#: library/test.rst:1400 msgid "Set to a non-ASCII name for a temporary file." msgstr "" -#: library/test.rst:1399 +#: library/test.rst:1405 msgid "" "Class used to temporarily set or unset environment variables. Instances can " "be used as a context manager and have a complete dictionary interface for " @@ -1592,75 +1598,75 @@ msgid "" "instance will be rolled back." msgstr "" -#: library/test.rst:1405 +#: library/test.rst:1411 msgid "Added dictionary interface." msgstr "" -#: library/test.rst:1411 +#: library/test.rst:1417 msgid "" "Simple :term:`path-like object`. It implements the :meth:`~os.PathLike." "__fspath__` method which just returns the *path* argument. If *path* is an " "exception, it will be raised in :meth:`!__fspath__`." msgstr "" -#: library/test.rst:1419 +#: library/test.rst:1425 msgid "" "Temporarily set the environment variable ``envvar`` to the value of " "``value``." msgstr "" -#: library/test.rst:1425 +#: library/test.rst:1431 msgid "Temporarily unset the environment variable ``envvar``." msgstr "" -#: library/test.rst:1430 +#: library/test.rst:1436 msgid "Return ``True`` if the OS supports symbolic links, ``False`` otherwise." msgstr "" -#: library/test.rst:1436 +#: library/test.rst:1442 msgid "Return ``True`` if the OS supports xattr, ``False`` otherwise." msgstr "" -#: library/test.rst:1442 +#: library/test.rst:1448 msgid "" "A context manager that temporarily changes the current working directory to " "*path* and yields the directory." msgstr "" -#: library/test.rst:1445 +#: library/test.rst:1451 msgid "" "If *quiet* is ``False``, the context manager raises an exception on error. " "Otherwise, it issues only a warning and keeps the current working directory " "the same." msgstr "" -#: library/test.rst:1452 +#: library/test.rst:1458 msgid "" "Create an empty file with *filename*. If it already exists, truncate it." msgstr "" -#: library/test.rst:1457 +#: library/test.rst:1463 msgid "Count the number of open file descriptors." msgstr "" -#: library/test.rst:1462 +#: library/test.rst:1468 msgid "Return ``True`` if the file system for *directory* is case-insensitive." msgstr "" -#: library/test.rst:1467 +#: library/test.rst:1473 msgid "" "Create an invalid file descriptor by opening and closing a temporary file, " "and returning its descriptor." msgstr "" -#: library/test.rst:1473 +#: library/test.rst:1479 msgid "" "Call :func:`os.rmdir` on *filename*. On Windows platforms, this is wrapped " "with a wait loop that checks for the existence of the file, which is needed " "due to antivirus programs that can hold files open and prevent deletion." msgstr "" -#: library/test.rst:1481 +#: library/test.rst:1487 msgid "" "Call :func:`shutil.rmtree` on *path* or call :func:`os.lstat` and :func:`os." "rmdir` to remove a path and its contents. As with :func:`rmdir`, on Windows " @@ -1668,21 +1674,21 @@ msgid "" "the files." msgstr "" -#: library/test.rst:1489 +#: library/test.rst:1495 msgid "A decorator for running tests that require support for symbolic links." msgstr "" -#: library/test.rst:1494 +#: library/test.rst:1500 msgid "A decorator for running tests that require support for xattr." msgstr "" -#: library/test.rst:1499 +#: library/test.rst:1505 msgid "" "A context manager that temporarily creates a new directory and changes the " "current working directory (CWD)." msgstr "" -#: library/test.rst:1502 +#: library/test.rst:1508 msgid "" "The context manager creates a temporary directory in the current directory " "with name *name* before temporarily changing the current working directory. " @@ -1690,20 +1696,20 @@ msgid "" "`tempfile.mkdtemp`." msgstr "" -#: library/test.rst:1507 +#: library/test.rst:1513 msgid "" "If *quiet* is ``False`` and it is not possible to create or change the CWD, " "an error is raised. Otherwise, only a warning is raised and the original " "CWD is used." msgstr "" -#: library/test.rst:1514 +#: library/test.rst:1520 msgid "" "A context manager that creates a temporary directory at *path* and yields " "the directory." msgstr "" -#: library/test.rst:1517 +#: library/test.rst:1523 msgid "" "If *path* is ``None``, the temporary directory is created using :func:" "`tempfile.mkdtemp`. If *quiet* is ``False``, the context manager raises an " @@ -1711,34 +1717,34 @@ msgid "" "created, only a warning is issued." msgstr "" -#: library/test.rst:1525 +#: library/test.rst:1531 msgid "A context manager that temporarily sets the process umask." msgstr "" -#: library/test.rst:1530 +#: library/test.rst:1536 msgid "" "Call :func:`os.unlink` on *filename*. As with :func:`rmdir`, on Windows " "platforms, this is wrapped with a wait loop that checks for the existence of " "the file." msgstr "" -#: library/test.rst:1536 +#: library/test.rst:1542 msgid ":mod:`test.support.import_helper` --- Utilities for import tests" msgstr "" -#: library/test.rst:1541 +#: library/test.rst:1547 msgid "" "The :mod:`test.support.import_helper` module provides support for import " "tests." msgstr "" -#: library/test.rst:1548 +#: library/test.rst:1554 msgid "" "Remove the module named *module_name* from ``sys.modules`` and delete any " "byte-compiled files of the module." msgstr "" -#: library/test.rst:1554 +#: library/test.rst:1560 msgid "" "This function imports and returns a fresh copy of the named Python module by " "removing the named module from ``sys.modules`` before doing the import. Note " @@ -1746,39 +1752,39 @@ msgid "" "operation." msgstr "" -#: library/test.rst:1559 +#: library/test.rst:1565 msgid "" "*fresh* is an iterable of additional module names that are also removed from " "the ``sys.modules`` cache before doing the import." msgstr "" -#: library/test.rst:1562 +#: library/test.rst:1568 msgid "" "*blocked* is an iterable of module names that are replaced with ``None`` in " "the module cache during the import to ensure that attempts to import them " "raise :exc:`ImportError`." msgstr "" -#: library/test.rst:1566 +#: library/test.rst:1572 msgid "" "The named module and any modules named in the *fresh* and *blocked* " "parameters are saved before starting the import and then reinserted into " "``sys.modules`` when the fresh import is complete." msgstr "" -#: library/test.rst:1570 +#: library/test.rst:1576 msgid "" "Module and package deprecation messages are suppressed during this import if " "*deprecated* is ``True``." msgstr "" -#: library/test.rst:1573 +#: library/test.rst:1579 msgid "" "This function will raise :exc:`ImportError` if the named module cannot be " "imported." msgstr "" -#: library/test.rst:1578 +#: library/test.rst:1584 msgid "" "# Get copies of the warnings module for testing without affecting the\n" "# version being used by the rest of the test suite. One copy uses the\n" @@ -1788,14 +1794,14 @@ msgid "" "c_warnings = import_fresh_module('warnings', fresh=['_warnings'])" msgstr "" -#: library/test.rst:1590 +#: library/test.rst:1596 msgid "" "This function imports and returns the named module. Unlike a normal import, " "this function raises :exc:`unittest.SkipTest` if the module cannot be " "imported." msgstr "" -#: library/test.rst:1594 +#: library/test.rst:1600 msgid "" "Module and package deprecation messages are suppressed during this import if " "*deprecated* is ``True``. If a module is required on a platform but " @@ -1803,21 +1809,21 @@ msgid "" "which will be compared against :data:`sys.platform`." msgstr "" -#: library/test.rst:1604 +#: library/test.rst:1610 msgid "Return a copy of :data:`sys.modules`." msgstr "" -#: library/test.rst:1609 +#: library/test.rst:1615 msgid "" "Remove modules except for *oldmodules* and ``encodings`` in order to " "preserve internal cache." msgstr "" -#: library/test.rst:1615 +#: library/test.rst:1621 msgid "Delete *name* from ``sys.modules``." msgstr "" -#: library/test.rst:1620 +#: library/test.rst:1626 msgid "" "Move a :pep:`3147`/:pep:`488` pyc file to its legacy pyc location and return " "the file system path to the legacy pyc file. The *source* value is the file " @@ -1825,48 +1831,48 @@ msgid "" "3147/488 pyc file must exist." msgstr "" -#: library/test.rst:1628 +#: library/test.rst:1634 msgid "" "A context manager to force import to return a new module reference. This is " "useful for testing module-level behaviors, such as the emission of a :exc:" "`DeprecationWarning` on import. Example usage::" msgstr "" -#: library/test.rst:1632 +#: library/test.rst:1638 msgid "" "with CleanImport('foo'):\n" " importlib.import_module('foo') # New reference." msgstr "" -#: library/test.rst:1638 +#: library/test.rst:1644 msgid "A context manager to temporarily add directories to :data:`sys.path`." msgstr "" -#: library/test.rst:1640 +#: library/test.rst:1646 msgid "" "This makes a copy of :data:`sys.path`, appends any directories given as " "positional arguments, then reverts :data:`sys.path` to the copied settings " "when the context ends." msgstr "" -#: library/test.rst:1644 +#: library/test.rst:1650 msgid "" "Note that *all* :data:`sys.path` modifications in the body of the context " "manager, including replacement of the object, will be reverted at the end of " "the block." msgstr "" -#: library/test.rst:1650 +#: library/test.rst:1656 msgid ":mod:`test.support.warnings_helper` --- Utilities for warnings tests" msgstr "" -#: library/test.rst:1655 +#: library/test.rst:1661 msgid "" "The :mod:`test.support.warnings_helper` module provides support for warnings " "tests." msgstr "" -#: library/test.rst:1662 +#: library/test.rst:1668 msgid "" "Suppress warnings that are instances of *category*, which must be :exc:" "`Warning` or a subclass. Roughly equivalent to :func:`warnings." @@ -1874,21 +1880,21 @@ msgid "" "category=category) `. For example::" msgstr "" -#: library/test.rst:1668 +#: library/test.rst:1674 msgid "" "@warning_helper.ignore_warnings(category=DeprecationWarning)\n" "def test_suppress_warning():\n" " # do something" msgstr "" -#: library/test.rst:1677 +#: library/test.rst:1683 msgid "" "Context manager to check that no :exc:`ResourceWarning` was raised. You " "must remove the object which may emit :exc:`ResourceWarning` before the end " "of the context manager." msgstr "" -#: library/test.rst:1684 +#: library/test.rst:1690 msgid "" "Test for syntax warning in *statement* by attempting to compile *statement*. " "Test also that the :exc:`SyntaxWarning` is emitted only once, and that it " @@ -1900,7 +1906,7 @@ msgid "" "``None``, compares to the offset of the exception." msgstr "" -#: library/test.rst:1698 +#: library/test.rst:1704 msgid "" "A convenience wrapper for :func:`warnings.catch_warnings` that makes it " "easier to test that a warning was correctly raised. It is approximately " @@ -1909,7 +1915,7 @@ msgid "" "automatically validate the results that are recorded." msgstr "" -#: library/test.rst:1704 +#: library/test.rst:1710 msgid "" "``check_warnings`` accepts 2-tuples of the form ``(\"message regexp\", " "WarningCategory)`` as positional arguments. If one or more *filters* are " @@ -1921,19 +1927,19 @@ msgid "" "*quiet* to ``True``." msgstr "" -#: library/test.rst:1713 +#: library/test.rst:1719 msgid "If no arguments are specified, it defaults to::" msgstr "" -#: library/test.rst:1715 +#: library/test.rst:1721 msgid "check_warnings((\"\", Warning), quiet=True)" msgstr "" -#: library/test.rst:1717 +#: library/test.rst:1723 msgid "In this case all warnings are caught and no errors are raised." msgstr "" -#: library/test.rst:1719 +#: library/test.rst:1725 msgid "" "On entry to the context manager, a :class:`WarningRecorder` instance is " "returned. The underlying warnings list from :func:`~warnings.catch_warnings` " @@ -1945,17 +1951,17 @@ msgid "" "return ``None``." msgstr "" -#: library/test.rst:1728 +#: library/test.rst:1734 msgid "" "The recorder object also has a :meth:`reset` method, which clears the " "warnings list." msgstr "" -#: library/test.rst:1731 +#: library/test.rst:1737 msgid "The context manager is designed to be used like this::" msgstr "" -#: library/test.rst:1733 +#: library/test.rst:1739 msgid "" "with check_warnings((\"assertion is always true\", SyntaxWarning),\n" " (\"\", UserWarning)):\n" @@ -1963,19 +1969,19 @@ msgid "" " warnings.warn(UserWarning(\"Hide me!\"))" msgstr "" -#: library/test.rst:1738 +#: library/test.rst:1744 msgid "" "In this case if either warning was not raised, or some other warning was " "raised, :func:`check_warnings` would raise an error." msgstr "" -#: library/test.rst:1741 +#: library/test.rst:1747 msgid "" "When a test needs to look more deeply into the warnings, rather than just " "checking whether or not they occurred, code like this can be used::" msgstr "" -#: library/test.rst:1744 +#: library/test.rst:1750 msgid "" "with check_warnings(quiet=True) as w:\n" " warnings.warn(\"foo\")\n" @@ -1988,17 +1994,17 @@ msgid "" " assert len(w.warnings) == 0" msgstr "" -#: library/test.rst:1755 +#: library/test.rst:1761 msgid "" "Here all warnings will be caught, and the test code tests the captured " "warnings directly." msgstr "" -#: library/test.rst:1758 +#: library/test.rst:1764 msgid "New optional arguments *filters* and *quiet*." msgstr "" -#: library/test.rst:1764 +#: library/test.rst:1770 msgid "" "Class used to record warnings for unit tests. See documentation of :func:" "`check_warnings` above for more details." diff --git a/library/text.po b/library/text.po index 2351ecc6..45c6e235 100644 --- a/library/text.po +++ b/library/text.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" diff --git a/library/textwrap.po b/library/textwrap.po index 863f215a..2f49579d 100644 --- a/library/textwrap.po +++ b/library/textwrap.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" diff --git a/library/threading.po b/library/threading.po index ee29904e..91a7f0cb 100644 --- a/library/threading.po +++ b/library/threading.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -73,15 +73,14 @@ msgid "" "appropriate model if you want to run multiple I/O-bound tasks simultaneously." msgstr "" -#: library/threading.rst:226 includes/wasm-notavail.rst:3 +#: library/threading.rst:229 includes/wasm-notavail.rst:3 msgid "Availability" msgstr "" #: includes/wasm-notavail.rst:5 msgid "" -"This module does not work or is not available on WebAssembly platforms " -"``wasm32-emscripten`` and ``wasm32-wasi``. See :ref:`wasm-availability` for " -"more information." +"This module does not work or is not available on WebAssembly. See :ref:`wasm-" +"availability` for more information." msgstr "" #: library/threading.rst:50 @@ -194,7 +193,11 @@ msgid "" "after which the value may be recycled by the OS)." msgstr "" -#: library/threading.rst:137 +#: library/threading.rst:134 +msgid "Added support for GNU/kFreeBSD." +msgstr "" + +#: library/threading.rst:140 msgid "" "Return a list of all :class:`Thread` objects currently active. The list " "includes daemonic threads and dummy thread objects created by :func:" @@ -203,59 +206,59 @@ msgid "" "even when terminated." msgstr "" -#: library/threading.rst:146 +#: library/threading.rst:149 msgid "" "Return the main :class:`Thread` object. In normal conditions, the main " "thread is the thread from which the Python interpreter was started." msgstr "" -#: library/threading.rst:157 +#: library/threading.rst:160 msgid "" "Set a trace function for all threads started from the :mod:`threading` " "module. The *func* will be passed to :func:`sys.settrace` for each thread, " "before its :meth:`~Thread.run` method is called." msgstr "" -#: library/threading.rst:163 +#: library/threading.rst:166 msgid "" "Set a trace function for all threads started from the :mod:`threading` " "module and all Python threads that are currently executing." msgstr "" -#: library/threading.rst:166 +#: library/threading.rst:169 msgid "" "The *func* will be passed to :func:`sys.settrace` for each thread, before " "its :meth:`~Thread.run` method is called." msgstr "" -#: library/threading.rst:177 +#: library/threading.rst:180 msgid "Get the trace function as set by :func:`settrace`." msgstr "" -#: library/threading.rst:186 +#: library/threading.rst:189 msgid "" "Set a profile function for all threads started from the :mod:`threading` " "module. The *func* will be passed to :func:`sys.setprofile` for each " "thread, before its :meth:`~Thread.run` method is called." msgstr "" -#: library/threading.rst:192 +#: library/threading.rst:195 msgid "" "Set a profile function for all threads started from the :mod:`threading` " "module and all Python threads that are currently executing." msgstr "" -#: library/threading.rst:195 +#: library/threading.rst:198 msgid "" "The *func* will be passed to :func:`sys.setprofile` for each thread, before " "its :meth:`~Thread.run` method is called." msgstr "" -#: library/threading.rst:204 +#: library/threading.rst:207 msgid "Get the profiler function as set by :func:`setprofile`." msgstr "" -#: library/threading.rst:211 +#: library/threading.rst:214 msgid "" "Return the thread stack size used when creating new threads. The optional " "*size* argument specifies the stack size to be used for subsequently created " @@ -274,15 +277,15 @@ msgid "" "information)." msgstr "" -#: library/threading.rst:228 +#: library/threading.rst:231 msgid "Unix platforms with POSIX threads support." msgstr "" -#: library/threading.rst:231 +#: library/threading.rst:234 msgid "This module also defines the following constant:" msgstr "" -#: library/threading.rst:235 +#: library/threading.rst:238 msgid "" "The maximum value allowed for the *timeout* parameter of blocking functions " "(:meth:`Lock.acquire`, :meth:`RLock.acquire`, :meth:`Condition.wait`, etc.). " @@ -290,13 +293,13 @@ msgid "" "`OverflowError`." msgstr "" -#: library/threading.rst:243 +#: library/threading.rst:246 msgid "" "This module defines a number of classes, which are detailed in the sections " "below." msgstr "" -#: library/threading.rst:246 +#: library/threading.rst:249 msgid "" "The design of this module is loosely based on Java's threading model. " "However, where Java makes locks and condition variables basic behavior of " @@ -307,46 +310,46 @@ msgid "" "Thread class, when implemented, are mapped to module-level functions." msgstr "" -#: library/threading.rst:254 +#: library/threading.rst:257 msgid "All of the methods described below are executed atomically." msgstr "" -#: library/threading.rst:258 +#: library/threading.rst:261 msgid "Thread-Local Data" msgstr "" -#: library/threading.rst:260 +#: library/threading.rst:263 msgid "" "Thread-local data is data whose values are thread specific. To manage " "thread-local data, just create an instance of :class:`local` (or a subclass) " "and store attributes on it::" msgstr "" -#: library/threading.rst:264 +#: library/threading.rst:267 msgid "" "mydata = threading.local()\n" "mydata.x = 1" msgstr "" -#: library/threading.rst:267 +#: library/threading.rst:270 msgid "The instance's values will be different for separate threads." msgstr "" -#: library/threading.rst:272 +#: library/threading.rst:275 msgid "A class that represents thread-local data." msgstr "" -#: library/threading.rst:274 +#: library/threading.rst:277 msgid "" "For more details and extensive examples, see the documentation string of " "the :mod:`!_threading_local` module: :source:`Lib/_threading_local.py`." msgstr "" -#: library/threading.rst:281 +#: library/threading.rst:284 msgid "Thread Objects" msgstr "" -#: library/threading.rst:283 +#: library/threading.rst:286 msgid "" "The :class:`Thread` class represents an activity that is run in a separate " "thread of control. There are two ways to specify the activity: by passing a " @@ -356,14 +359,14 @@ msgid "" "``__init__()`` and :meth:`~Thread.run` methods of this class." msgstr "" -#: library/threading.rst:290 +#: library/threading.rst:293 msgid "" "Once a thread object is created, its activity must be started by calling the " "thread's :meth:`~Thread.start` method. This invokes the :meth:`~Thread.run` " "method in a separate thread of control." msgstr "" -#: library/threading.rst:294 +#: library/threading.rst:297 msgid "" "Once the thread's activity is started, the thread is considered 'alive'. It " "stops being alive when its :meth:`~Thread.run` method terminates -- either " @@ -371,27 +374,27 @@ msgid "" "is_alive` method tests whether the thread is alive." msgstr "" -#: library/threading.rst:299 +#: library/threading.rst:302 msgid "" "Other threads can call a thread's :meth:`~Thread.join` method. This blocks " "the calling thread until the thread whose :meth:`~Thread.join` method is " "called is terminated." msgstr "" -#: library/threading.rst:303 +#: library/threading.rst:306 msgid "" "A thread has a name. The name can be passed to the constructor, and read or " "changed through the :attr:`~Thread.name` attribute." msgstr "" -#: library/threading.rst:306 +#: library/threading.rst:309 msgid "" "If the :meth:`~Thread.run` method raises an exception, :func:`threading." "excepthook` is called to handle it. By default, :func:`threading.excepthook` " "ignores silently :exc:`SystemExit`." msgstr "" -#: library/threading.rst:310 +#: library/threading.rst:313 msgid "" "A thread can be flagged as a \"daemon thread\". The significance of this " "flag is that the entire Python program exits when only daemon threads are " @@ -400,7 +403,7 @@ msgid "" "constructor argument." msgstr "" -#: library/threading.rst:317 +#: library/threading.rst:320 msgid "" "Daemon threads are abruptly stopped at shutdown. Their resources (such as " "open files, database transactions, etc.) may not be released properly. If " @@ -408,13 +411,13 @@ msgid "" "suitable signalling mechanism such as an :class:`Event`." msgstr "" -#: library/threading.rst:322 +#: library/threading.rst:325 msgid "" "There is a \"main thread\" object; this corresponds to the initial thread of " "control in the Python program. It is not a daemon thread." msgstr "" -#: library/threading.rst:325 +#: library/threading.rst:328 msgid "" "There is the possibility that \"dummy thread objects\" are created. These " "are thread objects corresponding to \"alien threads\", which are threads of " @@ -425,25 +428,25 @@ msgid "" "threads." msgstr "" -#: library/threading.rst:336 +#: library/threading.rst:339 msgid "" "This constructor should always be called with keyword arguments. Arguments " "are:" msgstr "" -#: library/threading.rst:339 +#: library/threading.rst:342 msgid "" "*group* should be ``None``; reserved for future extension when a :class:`!" "ThreadGroup` class is implemented." msgstr "" -#: library/threading.rst:342 +#: library/threading.rst:345 msgid "" "*target* is the callable object to be invoked by the :meth:`run` method. " "Defaults to ``None``, meaning nothing is called." msgstr "" -#: library/threading.rst:345 +#: library/threading.rst:348 msgid "" "*name* is the thread name. By default, a unique name is constructed of the " "form \"Thread-*N*\" where *N* is a small decimal number, or \"Thread-*N* " @@ -451,62 +454,62 @@ msgid "" "is specified." msgstr "" -#: library/threading.rst:350 +#: library/threading.rst:353 msgid "" "*args* is a list or tuple of arguments for the target invocation. Defaults " "to ``()``." msgstr "" -#: library/threading.rst:352 +#: library/threading.rst:355 msgid "" "*kwargs* is a dictionary of keyword arguments for the target invocation. " "Defaults to ``{}``." msgstr "" -#: library/threading.rst:355 +#: library/threading.rst:358 msgid "" "If not ``None``, *daemon* explicitly sets whether the thread is daemonic. If " "``None`` (the default), the daemonic property is inherited from the current " "thread." msgstr "" -#: library/threading.rst:359 +#: library/threading.rst:362 msgid "" "If the subclass overrides the constructor, it must make sure to invoke the " "base class constructor (``Thread.__init__()``) before doing anything else to " "the thread." msgstr "" -#: library/threading.rst:363 +#: library/threading.rst:366 msgid "Added the *daemon* parameter." msgstr "" -#: library/threading.rst:366 +#: library/threading.rst:369 msgid "Use the *target* name if *name* argument is omitted." msgstr "" -#: library/threading.rst:371 +#: library/threading.rst:374 msgid "Start the thread's activity." msgstr "" -#: library/threading.rst:373 +#: library/threading.rst:376 msgid "" "It must be called at most once per thread object. It arranges for the " "object's :meth:`~Thread.run` method to be invoked in a separate thread of " "control." msgstr "" -#: library/threading.rst:377 +#: library/threading.rst:380 msgid "" "This method will raise a :exc:`RuntimeError` if called more than once on the " "same thread object." msgstr "" -#: library/threading.rst:382 +#: library/threading.rst:385 msgid "Method representing the thread's activity." msgstr "" -#: library/threading.rst:384 +#: library/threading.rst:387 msgid "" "You may override this method in a subclass. The standard :meth:`run` method " "invokes the callable object passed to the object's constructor as the " @@ -514,17 +517,17 @@ msgid "" "the *args* and *kwargs* arguments, respectively." msgstr "" -#: library/threading.rst:389 +#: library/threading.rst:392 msgid "" "Using list or tuple as the *args* argument which passed to the :class:" "`Thread` could achieve the same effect." msgstr "" -#: library/threading.rst:392 +#: library/threading.rst:395 msgid "Example::" msgstr "" -#: library/threading.rst:394 +#: library/threading.rst:397 msgid "" ">>> from threading import Thread\n" ">>> t = Thread(target=print, args=[1])\n" @@ -535,7 +538,7 @@ msgid "" "1" msgstr "" -#: library/threading.rst:406 +#: library/threading.rst:409 msgid "" "Wait until the thread terminates. This blocks the calling thread until the " "thread whose :meth:`~Thread.join` method is called terminates -- either " @@ -543,7 +546,7 @@ msgid "" "occurs." msgstr "" -#: library/threading.rst:411 +#: library/threading.rst:414 msgid "" "When the *timeout* argument is present and not ``None``, it should be a " "floating-point number specifying a timeout for the operation in seconds (or " @@ -553,17 +556,17 @@ msgid "" "`~Thread.join` call timed out." msgstr "" -#: library/threading.rst:418 +#: library/threading.rst:421 msgid "" "When the *timeout* argument is not present or ``None``, the operation will " "block until the thread terminates." msgstr "" -#: library/threading.rst:421 +#: library/threading.rst:424 msgid "A thread can be joined many times." msgstr "" -#: library/threading.rst:423 +#: library/threading.rst:426 msgid "" ":meth:`~Thread.join` raises a :exc:`RuntimeError` if an attempt is made to " "join the current thread as that would cause a deadlock. It is also an error " @@ -571,20 +574,20 @@ msgid "" "do so raise the same exception." msgstr "" -#: library/threading.rst:430 +#: library/threading.rst:433 msgid "" "A string used for identification purposes only. It has no semantics. " "Multiple threads may be given the same name. The initial name is set by the " "constructor." msgstr "" -#: library/threading.rst:437 +#: library/threading.rst:440 msgid "" "Deprecated getter/setter API for :attr:`~Thread.name`; use it directly as a " "property instead." msgstr "" -#: library/threading.rst:444 +#: library/threading.rst:447 msgid "" "The 'thread identifier' of this thread or ``None`` if the thread has not " "been started. This is a nonzero integer. See the :func:`get_ident` " @@ -593,7 +596,7 @@ msgid "" "thread has exited." msgstr "" -#: library/threading.rst:452 +#: library/threading.rst:455 msgid "" "The Thread ID (``TID``) of this thread, as assigned by the OS (kernel). This " "is a non-negative integer, or ``None`` if the thread has not been started. " @@ -602,25 +605,25 @@ msgid "" "after which the value may be recycled by the OS)." msgstr "" -#: library/threading.rst:461 +#: library/threading.rst:464 msgid "" "Similar to Process IDs, Thread IDs are only valid (guaranteed unique system-" "wide) from the time the thread is created until the thread has been " "terminated." msgstr "" -#: library/threading.rst:471 +#: library/threading.rst:474 msgid "Return whether the thread is alive." msgstr "" -#: library/threading.rst:473 +#: library/threading.rst:476 msgid "" "This method returns ``True`` just before the :meth:`~Thread.run` method " "starts until just after the :meth:`~Thread.run` method terminates. The " "module function :func:`.enumerate` returns a list of all alive threads." msgstr "" -#: library/threading.rst:479 +#: library/threading.rst:482 msgid "" "A boolean value indicating whether this thread is a daemon thread (``True``) " "or not (``False``). This must be set before :meth:`~Thread.start` is " @@ -630,22 +633,22 @@ msgid "" "`~Thread.daemon` = ``False``." msgstr "" -#: library/threading.rst:486 +#: library/threading.rst:489 msgid "" "The entire Python program exits when no alive non-daemon threads are left." msgstr "" -#: library/threading.rst:491 +#: library/threading.rst:494 msgid "" "Deprecated getter/setter API for :attr:`~Thread.daemon`; use it directly as " "a property instead." msgstr "" -#: library/threading.rst:500 +#: library/threading.rst:503 msgid "Lock Objects" msgstr "" -#: library/threading.rst:502 +#: library/threading.rst:505 msgid "" "A primitive lock is a synchronization primitive that is not owned by a " "particular thread when locked. In Python, it is currently the lowest level " @@ -653,7 +656,7 @@ msgid "" "`_thread` extension module." msgstr "" -#: library/threading.rst:507 +#: library/threading.rst:510 msgid "" "A primitive lock is in one of two states, \"locked\" or \"unlocked\". It is " "created in the unlocked state. It has two basic methods, :meth:`~Lock." @@ -667,11 +670,11 @@ msgid "" "an unlocked lock, a :exc:`RuntimeError` will be raised." msgstr "" -#: library/threading.rst:518 +#: library/threading.rst:521 msgid "Locks also support the :ref:`context management protocol `." msgstr "" -#: library/threading.rst:520 +#: library/threading.rst:523 msgid "" "When more than one thread is blocked in :meth:`~Lock.acquire` waiting for " "the state to turn to unlocked, only one thread proceeds when a :meth:`~Lock." @@ -679,42 +682,41 @@ msgid "" "proceeds is not defined, and may vary across implementations." msgstr "" -#: library/threading.rst:525 +#: library/threading.rst:528 msgid "All methods are executed atomically." msgstr "" -#: library/threading.rst:530 +#: library/threading.rst:533 msgid "" "The class implementing primitive lock objects. Once a thread has acquired a " "lock, subsequent attempts to acquire it block, until it is released; any " "thread may release it." msgstr "" -#: library/threading.rst:534 +#: library/threading.rst:537 msgid "" -"Note that ``Lock`` is actually a factory function which returns an instance " -"of the most efficient version of the concrete Lock class that is supported " -"by the platform." +"``Lock`` is now a class. In earlier Pythons, ``Lock`` was a factory function " +"which returned an instance of the underlying private lock type." msgstr "" -#: library/threading.rst:632 +#: library/threading.rst:636 msgid "Acquire a lock, blocking or non-blocking." msgstr "" -#: library/threading.rst:543 +#: library/threading.rst:547 msgid "" "When invoked with the *blocking* argument set to ``True`` (the default), " "block until the lock is unlocked, then set it to locked and return ``True``." msgstr "" -#: library/threading.rst:546 +#: library/threading.rst:550 msgid "" "When invoked with the *blocking* argument set to ``False``, do not block. If " "a call with *blocking* set to ``True`` would block, return ``False`` " "immediately; otherwise, set the lock to locked and return ``True``." msgstr "" -#: library/threading.rst:550 +#: library/threading.rst:554 msgid "" "When invoked with the floating-point *timeout* argument set to a positive " "value, block for at most the number of seconds specified by *timeout* and as " @@ -723,52 +725,52 @@ msgid "" "*blocking* is ``False``." msgstr "" -#: library/threading.rst:556 +#: library/threading.rst:560 msgid "" "The return value is ``True`` if the lock is acquired successfully, ``False`` " "if not (for example if the *timeout* expired)." msgstr "" -#: library/threading.rst:670 library/threading.rst:917 +#: library/threading.rst:674 library/threading.rst:921 msgid "The *timeout* parameter is new." msgstr "" -#: library/threading.rst:562 +#: library/threading.rst:566 msgid "" "Lock acquisition can now be interrupted by signals on POSIX if the " "underlying threading implementation supports it." msgstr "" -#: library/threading.rst:569 +#: library/threading.rst:573 msgid "" "Release a lock. This can be called from any thread, not only the thread " "which has acquired the lock." msgstr "" -#: library/threading.rst:572 +#: library/threading.rst:576 msgid "" "When the lock is locked, reset it to unlocked, and return. If any other " "threads are blocked waiting for the lock to become unlocked, allow exactly " "one of them to proceed." msgstr "" -#: library/threading.rst:576 +#: library/threading.rst:580 msgid "When invoked on an unlocked lock, a :exc:`RuntimeError` is raised." msgstr "" -#: library/threading.rst:686 +#: library/threading.rst:690 msgid "There is no return value." msgstr "" -#: library/threading.rst:582 +#: library/threading.rst:586 msgid "Return ``True`` if the lock is acquired." msgstr "" -#: library/threading.rst:589 +#: library/threading.rst:593 msgid "RLock Objects" msgstr "" -#: library/threading.rst:591 +#: library/threading.rst:595 msgid "" "A reentrant lock is a synchronization primitive that may be acquired " "multiple times by the same thread. Internally, it uses the concepts of " @@ -777,13 +779,13 @@ msgid "" "lock; in the unlocked state, no thread owns it." msgstr "" -#: library/threading.rst:597 +#: library/threading.rst:601 msgid "" "Threads call a lock's :meth:`~RLock.acquire` method to lock it, and its :" "meth:`~Lock.release` method to unlock it." msgstr "" -#: library/threading.rst:602 +#: library/threading.rst:606 msgid "" "Reentrant locks support the :ref:`context management protocol `, " "so it is recommended to use :keyword:`with` instead of manually calling :" @@ -791,7 +793,7 @@ msgid "" "releasing the lock for a block of code." msgstr "" -#: library/threading.rst:607 +#: library/threading.rst:611 msgid "" "RLock's :meth:`~RLock.acquire`/:meth:`~RLock.release` call pairs may be " "nested, unlike Lock's :meth:`~Lock.acquire`/:meth:`~Lock.release`. Only the " @@ -800,7 +802,7 @@ msgid "" "in :meth:`~RLock.acquire` to proceed." msgstr "" -#: library/threading.rst:613 +#: library/threading.rst:617 msgid "" ":meth:`~RLock.acquire`/:meth:`~RLock.release` must be used in pairs: each " "acquire must have a release in the thread that has acquired the lock. " @@ -808,7 +810,7 @@ msgid "" "deadlock." msgstr "" -#: library/threading.rst:620 +#: library/threading.rst:624 msgid "" "This class implements reentrant lock objects. A reentrant lock must be " "released by the thread that acquired it. Once a thread has acquired a " @@ -816,39 +818,39 @@ msgid "" "thread must release it once for each time it has acquired it." msgstr "" -#: library/threading.rst:625 +#: library/threading.rst:629 msgid "" "Note that ``RLock`` is actually a factory function which returns an instance " "of the most efficient version of the concrete RLock class that is supported " "by the platform." msgstr "" -#: library/threading.rst:636 +#: library/threading.rst:640 msgid ":ref:`Using RLock as a context manager `" msgstr "" -#: library/threading.rst:637 +#: library/threading.rst:641 msgid "" "Recommended over manual :meth:`!acquire` and :meth:`release` calls whenever " "practical." msgstr "" -#: library/threading.rst:641 +#: library/threading.rst:645 msgid "" "When invoked with the *blocking* argument set to ``True`` (the default):" msgstr "" -#: library/threading.rst:655 +#: library/threading.rst:659 msgid "If no thread owns the lock, acquire the lock and return immediately." msgstr "" -#: library/threading.rst:645 +#: library/threading.rst:649 msgid "" "If another thread owns the lock, block until we are able to acquire lock, or " "*timeout*, if set to a positive float value." msgstr "" -#: library/threading.rst:648 +#: library/threading.rst:652 msgid "" "If the same thread owns the lock, acquire the lock again, and return " "immediately. This is the difference between :class:`Lock` and :class:`!" @@ -856,35 +858,35 @@ msgid "" "until the lock can be acquired." msgstr "" -#: library/threading.rst:653 +#: library/threading.rst:657 msgid "When invoked with the *blocking* argument set to ``False``:" msgstr "" -#: library/threading.rst:657 +#: library/threading.rst:661 msgid "If another thread owns the lock, return immediately." msgstr "" -#: library/threading.rst:659 +#: library/threading.rst:663 msgid "" "If the same thread owns the lock, acquire the lock again and return " "immediately." msgstr "" -#: library/threading.rst:662 +#: library/threading.rst:666 msgid "" "In all cases, if the thread was able to acquire the lock, return ``True``. " "If the thread was unable to acquire the lock (i.e. if not blocking or the " "timeout was reached) return ``False``." msgstr "" -#: library/threading.rst:666 +#: library/threading.rst:670 msgid "" "If called multiple times, failing to call :meth:`~RLock.release` as many " "times may lead to deadlock. Consider using :class:`!RLock` as a context " "manager rather than calling acquire/release directly." msgstr "" -#: library/threading.rst:676 +#: library/threading.rst:680 msgid "" "Release a lock, decrementing the recursion level. If after the decrement it " "is zero, reset the lock to unlocked (not owned by any thread), and if any " @@ -893,18 +895,18 @@ msgid "" "is still nonzero, the lock remains locked and owned by the calling thread." msgstr "" -#: library/threading.rst:682 +#: library/threading.rst:686 msgid "" "Only call this method when the calling thread owns the lock. A :exc:" "`RuntimeError` is raised if this method is called when the lock is not " "acquired." msgstr "" -#: library/threading.rst:692 +#: library/threading.rst:696 msgid "Condition Objects" msgstr "" -#: library/threading.rst:694 +#: library/threading.rst:698 msgid "" "A condition variable is always associated with some kind of lock; this can " "be passed in or one will be created by default. Passing one in is useful " @@ -912,7 +914,7 @@ msgid "" "of the condition object: you don't have to track it separately." msgstr "" -#: library/threading.rst:699 +#: library/threading.rst:703 msgid "" "A condition variable obeys the :ref:`context management protocol `: using the ``with`` statement acquires the associated lock for the " @@ -921,7 +923,7 @@ msgid "" "associated lock." msgstr "" -#: library/threading.rst:705 +#: library/threading.rst:709 msgid "" "Other methods must be called with the associated lock held. The :meth:" "`~Condition.wait` method releases the lock, and then blocks until another " @@ -930,14 +932,14 @@ msgid "" "and returns. It is also possible to specify a timeout." msgstr "" -#: library/threading.rst:711 +#: library/threading.rst:715 msgid "" "The :meth:`~Condition.notify` method wakes up one of the threads waiting for " "the condition variable, if any are waiting. The :meth:`~Condition." "notify_all` method wakes up all threads waiting for the condition variable." msgstr "" -#: library/threading.rst:715 +#: library/threading.rst:719 msgid "" "Note: the :meth:`~Condition.notify` and :meth:`~Condition.notify_all` " "methods don't release the lock; this means that the thread or threads " @@ -946,7 +948,7 @@ msgid "" "or :meth:`~Condition.notify_all` finally relinquishes ownership of the lock." msgstr "" -#: library/threading.rst:721 +#: library/threading.rst:725 msgid "" "The typical programming style using condition variables uses the lock to " "synchronize access to some shared state; threads that are interested in a " @@ -958,7 +960,7 @@ msgid "" "situation with unlimited buffer capacity::" msgstr "" -#: library/threading.rst:730 +#: library/threading.rst:734 msgid "" "# Consume one item\n" "with cv:\n" @@ -972,7 +974,7 @@ msgid "" " cv.notify()" msgstr "" -#: library/threading.rst:741 +#: library/threading.rst:745 msgid "" "The ``while`` loop checking for the application's condition is necessary " "because :meth:`~Condition.wait` can return after an arbitrary long time, and " @@ -982,7 +984,7 @@ msgid "" "checking, and eases the computation of timeouts::" msgstr "" -#: library/threading.rst:748 +#: library/threading.rst:752 msgid "" "# Consume an item\n" "with cv:\n" @@ -990,7 +992,7 @@ msgid "" " get_an_available_item()" msgstr "" -#: library/threading.rst:753 +#: library/threading.rst:757 msgid "" "To choose between :meth:`~Condition.notify` and :meth:`~Condition." "notify_all`, consider whether one state change can be interesting for only " @@ -999,44 +1001,44 @@ msgid "" "thread." msgstr "" -#: library/threading.rst:761 +#: library/threading.rst:765 msgid "" "This class implements condition variable objects. A condition variable " "allows one or more threads to wait until they are notified by another thread." msgstr "" -#: library/threading.rst:764 +#: library/threading.rst:768 msgid "" "If the *lock* argument is given and not ``None``, it must be a :class:`Lock` " "or :class:`RLock` object, and it is used as the underlying lock. Otherwise, " "a new :class:`RLock` object is created and used as the underlying lock." msgstr "" -#: library/threading.rst:892 library/threading.rst:990 -#: library/threading.rst:1058 +#: library/threading.rst:896 library/threading.rst:994 +#: library/threading.rst:1062 msgid "changed from a factory function to a class." msgstr "" -#: library/threading.rst:773 +#: library/threading.rst:777 msgid "" "Acquire the underlying lock. This method calls the corresponding method on " "the underlying lock; the return value is whatever that method returns." msgstr "" -#: library/threading.rst:778 +#: library/threading.rst:782 msgid "" "Release the underlying lock. This method calls the corresponding method on " "the underlying lock; there is no return value." msgstr "" -#: library/threading.rst:783 +#: library/threading.rst:787 msgid "" "Wait until notified or until a timeout occurs. If the calling thread has not " "acquired the lock when this method is called, a :exc:`RuntimeError` is " "raised." msgstr "" -#: library/threading.rst:787 +#: library/threading.rst:791 msgid "" "This method releases the underlying lock, and then blocks until it is " "awakened by a :meth:`notify` or :meth:`notify_all` call for the same " @@ -1044,14 +1046,14 @@ msgid "" "Once awakened or timed out, it re-acquires the lock and returns." msgstr "" -#: library/threading.rst:792 +#: library/threading.rst:796 msgid "" "When the *timeout* argument is present and not ``None``, it should be a " "floating-point number specifying a timeout for the operation in seconds (or " "fractions thereof)." msgstr "" -#: library/threading.rst:796 +#: library/threading.rst:800 msgid "" "When the underlying lock is an :class:`RLock`, it is not released using its :" "meth:`release` method, since this may not actually unlock the lock when it " @@ -1061,24 +1063,24 @@ msgid "" "used to restore the recursion level when the lock is reacquired." msgstr "" -#: library/threading.rst:804 +#: library/threading.rst:808 msgid "" "The return value is ``True`` unless a given *timeout* expired, in which case " "it is ``False``." msgstr "" -#: library/threading.rst:1023 +#: library/threading.rst:1027 msgid "Previously, the method always returned ``None``." msgstr "" -#: library/threading.rst:812 +#: library/threading.rst:816 msgid "" "Wait until a condition evaluates to true. *predicate* should be a callable " "which result will be interpreted as a boolean value. A *timeout* may be " "provided giving the maximum time to wait." msgstr "" -#: library/threading.rst:816 +#: library/threading.rst:820 msgid "" "This utility method may call :meth:`wait` repeatedly until the predicate is " "satisfied, or until a timeout occurs. The return value is the last return " @@ -1086,39 +1088,39 @@ msgid "" "out." msgstr "" -#: library/threading.rst:821 +#: library/threading.rst:825 msgid "" "Ignoring the timeout feature, calling this method is roughly equivalent to " "writing::" msgstr "" -#: library/threading.rst:824 +#: library/threading.rst:828 msgid "" "while not predicate():\n" " cv.wait()" msgstr "" -#: library/threading.rst:827 +#: library/threading.rst:831 msgid "" "Therefore, the same rules apply as with :meth:`wait`: The lock must be held " "when called and is re-acquired on return. The predicate is evaluated with " "the lock held." msgstr "" -#: library/threading.rst:835 +#: library/threading.rst:839 msgid "" "By default, wake up one thread waiting on this condition, if any. If the " "calling thread has not acquired the lock when this method is called, a :exc:" "`RuntimeError` is raised." msgstr "" -#: library/threading.rst:839 +#: library/threading.rst:843 msgid "" "This method wakes up at most *n* of the threads waiting for the condition " "variable; it is a no-op if no threads are waiting." msgstr "" -#: library/threading.rst:842 +#: library/threading.rst:846 msgid "" "The current implementation wakes up exactly *n* threads, if at least *n* " "threads are waiting. However, it's not safe to rely on this behavior. A " @@ -1126,14 +1128,14 @@ msgid "" "threads." msgstr "" -#: library/threading.rst:847 +#: library/threading.rst:851 msgid "" "Note: an awakened thread does not actually return from its :meth:`wait` call " "until it can reacquire the lock. Since :meth:`notify` does not release the " "lock, its caller should." msgstr "" -#: library/threading.rst:853 +#: library/threading.rst:857 msgid "" "Wake up all threads waiting on this condition. This method acts like :meth:" "`notify`, but wakes up all waiting threads instead of one. If the calling " @@ -1141,15 +1143,15 @@ msgid "" "`RuntimeError` is raised." msgstr "" -#: library/threading.rst:858 +#: library/threading.rst:862 msgid "The method ``notifyAll`` is a deprecated alias for this method." msgstr "" -#: library/threading.rst:864 +#: library/threading.rst:868 msgid "Semaphore Objects" msgstr "" -#: library/threading.rst:866 +#: library/threading.rst:870 msgid "" "This is one of the oldest synchronization primitives in the history of " "computer science, invented by the early Dutch computer scientist Edsger W. " @@ -1157,7 +1159,7 @@ msgid "" "acquire` and :meth:`~Semaphore.release`)." msgstr "" -#: library/threading.rst:871 +#: library/threading.rst:875 msgid "" "A semaphore manages an internal counter which is decremented by each :meth:" "`~Semaphore.acquire` call and incremented by each :meth:`~Semaphore.release` " @@ -1166,12 +1168,12 @@ msgid "" "meth:`~Semaphore.release`." msgstr "" -#: library/threading.rst:877 +#: library/threading.rst:881 msgid "" "Semaphores also support the :ref:`context management protocol `." msgstr "" -#: library/threading.rst:882 +#: library/threading.rst:886 msgid "" "This class implements semaphore objects. A semaphore manages an atomic " "counter representing the number of :meth:`release` calls minus the number " @@ -1180,28 +1182,28 @@ msgid "" "If not given, *value* defaults to 1." msgstr "" -#: library/threading.rst:888 +#: library/threading.rst:892 msgid "" "The optional argument gives the initial *value* for the internal counter; it " "defaults to ``1``. If the *value* given is less than 0, :exc:`ValueError` is " "raised." msgstr "" -#: library/threading.rst:897 +#: library/threading.rst:901 msgid "Acquire a semaphore." msgstr "" -#: library/threading.rst:899 +#: library/threading.rst:903 msgid "When invoked without arguments:" msgstr "" -#: library/threading.rst:901 +#: library/threading.rst:905 msgid "" "If the internal counter is larger than zero on entry, decrement it by one " "and return ``True`` immediately." msgstr "" -#: library/threading.rst:903 +#: library/threading.rst:907 msgid "" "If the internal counter is zero on entry, block until awoken by a call to :" "meth:`~Semaphore.release`. Once awoken (and the counter is greater than 0), " @@ -1210,32 +1212,32 @@ msgid "" "threads are awoken should not be relied on." msgstr "" -#: library/threading.rst:909 +#: library/threading.rst:913 msgid "" "When invoked with *blocking* set to ``False``, do not block. If a call " "without an argument would block, return ``False`` immediately; otherwise, do " "the same thing as when called without arguments, and return ``True``." msgstr "" -#: library/threading.rst:913 +#: library/threading.rst:917 msgid "" "When invoked with a *timeout* other than ``None``, it will block for at most " "*timeout* seconds. If acquire does not complete successfully in that " "interval, return ``False``. Return ``True`` otherwise." msgstr "" -#: library/threading.rst:922 +#: library/threading.rst:926 msgid "" "Release a semaphore, incrementing the internal counter by *n*. When it was " "zero on entry and other threads are waiting for it to become larger than " "zero again, wake up *n* of those threads." msgstr "" -#: library/threading.rst:926 +#: library/threading.rst:930 msgid "Added the *n* parameter to release multiple waiting threads at once." msgstr "" -#: library/threading.rst:932 +#: library/threading.rst:936 msgid "" "Class implementing bounded semaphore objects. A bounded semaphore checks to " "make sure its current value doesn't exceed its initial value. If it does, :" @@ -1244,11 +1246,11 @@ msgid "" "times it's a sign of a bug. If not given, *value* defaults to 1." msgstr "" -#: library/threading.rst:945 +#: library/threading.rst:949 msgid ":class:`Semaphore` Example" msgstr "" -#: library/threading.rst:947 +#: library/threading.rst:951 msgid "" "Semaphores are often used to guard resources with limited capacity, for " "example, a database server. In any situation where the size of the resource " @@ -1256,20 +1258,20 @@ msgid "" "threads, your main thread would initialize the semaphore::" msgstr "" -#: library/threading.rst:952 +#: library/threading.rst:956 msgid "" "maxconnections = 5\n" "# ...\n" "pool_sema = BoundedSemaphore(value=maxconnections)" msgstr "" -#: library/threading.rst:956 +#: library/threading.rst:960 msgid "" "Once spawned, worker threads call the semaphore's acquire and release " "methods when they need to connect to the server::" msgstr "" -#: library/threading.rst:959 +#: library/threading.rst:963 msgid "" "with pool_sema:\n" " conn = connectdb()\n" @@ -1279,31 +1281,31 @@ msgid "" " conn.close()" msgstr "" -#: library/threading.rst:966 +#: library/threading.rst:970 msgid "" "The use of a bounded semaphore reduces the chance that a programming error " "which causes the semaphore to be released more than it's acquired will go " "undetected." msgstr "" -#: library/threading.rst:973 +#: library/threading.rst:977 msgid "Event Objects" msgstr "" -#: library/threading.rst:975 +#: library/threading.rst:979 msgid "" "This is one of the simplest mechanisms for communication between threads: " "one thread signals an event and other threads wait for it." msgstr "" -#: library/threading.rst:978 +#: library/threading.rst:982 msgid "" "An event object manages an internal flag that can be set to true with the :" "meth:`~Event.set` method and reset to false with the :meth:`~Event.clear` " "method. The :meth:`~Event.wait` method blocks until the flag is true." msgstr "" -#: library/threading.rst:985 +#: library/threading.rst:989 msgid "" "Class implementing event objects. An event manages a flag that can be set " "to true with the :meth:`~Event.set` method and reset to false with the :meth:" @@ -1311,29 +1313,29 @@ msgid "" "flag is initially false." msgstr "" -#: library/threading.rst:995 +#: library/threading.rst:999 msgid "Return ``True`` if and only if the internal flag is true." msgstr "" -#: library/threading.rst:997 +#: library/threading.rst:1001 msgid "The method ``isSet`` is a deprecated alias for this method." msgstr "" -#: library/threading.rst:1001 +#: library/threading.rst:1005 msgid "" "Set the internal flag to true. All threads waiting for it to become true are " "awakened. Threads that call :meth:`wait` once the flag is true will not " "block at all." msgstr "" -#: library/threading.rst:1007 +#: library/threading.rst:1011 msgid "" "Reset the internal flag to false. Subsequently, threads calling :meth:`wait` " "will block until :meth:`.set` is called to set the internal flag to true " "again." msgstr "" -#: library/threading.rst:1013 +#: library/threading.rst:1017 msgid "" "Block as long as the internal flag is false and the timeout, if given, has " "not expired. The return value represents the reason that this blocking " @@ -1342,18 +1344,18 @@ msgid "" "become true within the given wait time." msgstr "" -#: library/threading.rst:1019 +#: library/threading.rst:1023 msgid "" "When the timeout argument is present and not ``None``, it should be a " "floating-point number specifying a timeout for the operation in seconds, or " "fractions thereof." msgstr "" -#: library/threading.rst:1030 +#: library/threading.rst:1034 msgid "Timer Objects" msgstr "" -#: library/threading.rst:1032 +#: library/threading.rst:1036 msgid "" "This class represents an action that should be run only after a certain " "amount of time has passed --- a timer. :class:`Timer` is a subclass of :" @@ -1361,7 +1363,7 @@ msgid "" "threads." msgstr "" -#: library/threading.rst:1036 +#: library/threading.rst:1040 msgid "" "Timers are started, as with threads, by calling their :meth:`Timer.start " "` method. The timer can be stopped (before its action has " @@ -1370,11 +1372,11 @@ msgid "" "interval specified by the user." msgstr "" -#: library/threading.rst:1042 +#: library/threading.rst:1046 msgid "For example::" msgstr "" -#: library/threading.rst:1044 +#: library/threading.rst:1048 msgid "" "def hello():\n" " print(\"hello, world\")\n" @@ -1383,7 +1385,7 @@ msgid "" "t.start() # after 30 seconds, \"hello, world\" will be printed" msgstr "" -#: library/threading.rst:1053 +#: library/threading.rst:1057 msgid "" "Create a timer that will run *function* with arguments *args* and keyword " "arguments *kwargs*, after *interval* seconds have passed. If *args* is " @@ -1391,17 +1393,17 @@ msgid "" "``None`` (the default) then an empty dict will be used." msgstr "" -#: library/threading.rst:1063 +#: library/threading.rst:1067 msgid "" "Stop the timer, and cancel the execution of the timer's action. This will " "only work if the timer is still in its waiting stage." msgstr "" -#: library/threading.rst:1068 +#: library/threading.rst:1072 msgid "Barrier Objects" msgstr "" -#: library/threading.rst:1072 +#: library/threading.rst:1076 msgid "" "This class provides a simple synchronization primitive for use by a fixed " "number of threads that need to wait for each other. Each of the threads " @@ -1410,18 +1412,18 @@ msgid "" "calls. At this point, the threads are released simultaneously." msgstr "" -#: library/threading.rst:1078 +#: library/threading.rst:1082 msgid "" "The barrier can be reused any number of times for the same number of threads." msgstr "" -#: library/threading.rst:1080 +#: library/threading.rst:1084 msgid "" "As an example, here is a simple way to synchronize a client and server " "thread::" msgstr "" -#: library/threading.rst:1082 +#: library/threading.rst:1086 msgid "" "b = Barrier(2, timeout=5)\n" "\n" @@ -1439,7 +1441,7 @@ msgid "" " process_client_connection(connection)" msgstr "" -#: library/threading.rst:1100 +#: library/threading.rst:1104 msgid "" "Create a barrier object for *parties* number of threads. An *action*, when " "provided, is a callable to be called by one of the threads when they are " @@ -1447,7 +1449,7 @@ msgid "" "the :meth:`wait` method." msgstr "" -#: library/threading.rst:1107 +#: library/threading.rst:1111 msgid "" "Pass the barrier. When all the threads party to the barrier have called " "this function, they are all released simultaneously. If a *timeout* is " @@ -1455,14 +1457,14 @@ msgid "" "constructor." msgstr "" -#: library/threading.rst:1112 +#: library/threading.rst:1116 msgid "" "The return value is an integer in the range 0 to *parties* -- 1, different " "for each thread. This can be used to select a thread to do some special " "housekeeping, e.g.::" msgstr "" -#: library/threading.rst:1116 +#: library/threading.rst:1120 msgid "" "i = barrier.wait()\n" "if i == 0:\n" @@ -1470,37 +1472,37 @@ msgid "" " print(\"passed the barrier\")" msgstr "" -#: library/threading.rst:1121 +#: library/threading.rst:1125 msgid "" "If an *action* was provided to the constructor, one of the threads will have " "called it prior to being released. Should this call raise an error, the " "barrier is put into the broken state." msgstr "" -#: library/threading.rst:1125 +#: library/threading.rst:1129 msgid "If the call times out, the barrier is put into the broken state." msgstr "" -#: library/threading.rst:1127 +#: library/threading.rst:1131 msgid "" "This method may raise a :class:`BrokenBarrierError` exception if the barrier " "is broken or reset while a thread is waiting." msgstr "" -#: library/threading.rst:1132 +#: library/threading.rst:1136 msgid "" "Return the barrier to the default, empty state. Any threads waiting on it " "will receive the :class:`BrokenBarrierError` exception." msgstr "" -#: library/threading.rst:1135 +#: library/threading.rst:1139 msgid "" "Note that using this function may require some external synchronization if " "there are other threads whose state is unknown. If a barrier is broken it " "may be better to just leave it and create a new one." msgstr "" -#: library/threading.rst:1141 +#: library/threading.rst:1145 msgid "" "Put the barrier into a broken state. This causes any active or future calls " "to :meth:`wait` to fail with the :class:`BrokenBarrierError`. Use this for " @@ -1508,36 +1510,36 @@ msgid "" "application." msgstr "" -#: library/threading.rst:1146 +#: library/threading.rst:1150 msgid "" "It may be preferable to simply create the barrier with a sensible *timeout* " "value to automatically guard against one of the threads going awry." msgstr "" -#: library/threading.rst:1152 +#: library/threading.rst:1156 msgid "The number of threads required to pass the barrier." msgstr "" -#: library/threading.rst:1156 +#: library/threading.rst:1160 msgid "The number of threads currently waiting in the barrier." msgstr "" -#: library/threading.rst:1160 +#: library/threading.rst:1164 msgid "A boolean that is ``True`` if the barrier is in the broken state." msgstr "" -#: library/threading.rst:1165 +#: library/threading.rst:1169 msgid "" "This exception, a subclass of :exc:`RuntimeError`, is raised when the :class:" "`Barrier` object is reset or broken." msgstr "" -#: library/threading.rst:1172 +#: library/threading.rst:1176 msgid "" "Using locks, conditions, and semaphores in the :keyword:`!with` statement" msgstr "" -#: library/threading.rst:1174 +#: library/threading.rst:1178 msgid "" "All of the objects provided by this module that have ``acquire`` and " "``release`` methods can be used as context managers for a :keyword:`with` " @@ -1546,17 +1548,17 @@ msgid "" "following snippet::" msgstr "" -#: library/threading.rst:1180 +#: library/threading.rst:1184 msgid "" "with some_lock:\n" " # do something..." msgstr "" -#: library/threading.rst:1183 +#: library/threading.rst:1187 msgid "is equivalent to::" msgstr "" -#: library/threading.rst:1185 +#: library/threading.rst:1189 msgid "" "some_lock.acquire()\n" "try:\n" @@ -1565,21 +1567,21 @@ msgid "" " some_lock.release()" msgstr "" -#: library/threading.rst:1191 +#: library/threading.rst:1195 msgid "" "Currently, :class:`Lock`, :class:`RLock`, :class:`Condition`, :class:" "`Semaphore`, and :class:`BoundedSemaphore` objects may be used as :keyword:" "`with` statement context managers." msgstr "" -#: library/threading.rst:173 +#: library/threading.rst:176 msgid "trace function" msgstr "" -#: library/threading.rst:173 +#: library/threading.rst:176 msgid "debugger" msgstr "" -#: library/threading.rst:202 +#: library/threading.rst:205 msgid "profile function" msgstr "" diff --git a/library/time.po b/library/time.po index 9d90e069..0c78f155 100644 --- a/library/time.po +++ b/library/time.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -216,9 +216,9 @@ msgid "" msgstr "" #: library/time.rst:165 library/time.rst:187 library/time.rst:209 -#: library/time.rst:742 library/time.rst:849 library/time.rst:869 -#: library/time.rst:887 library/time.rst:906 library/time.rst:928 -#: library/time.rst:941 +#: library/time.rst:771 library/time.rst:878 library/time.rst:898 +#: library/time.rst:916 library/time.rst:936 library/time.rst:955 +#: library/time.rst:975 library/time.rst:988 msgid "Availability" msgstr "" @@ -380,25 +380,51 @@ msgid "" "only the difference between the results of two calls is valid." msgstr "" -#: library/time.rst:294 +#: library/time.rst:713 +msgid "Clock:" +msgstr "" + +#: library/time.rst:296 +msgid "" +"On Windows, call ``QueryPerformanceCounter()`` and " +"``QueryPerformanceFrequency()``." +msgstr "" + +#: library/time.rst:298 +msgid "On macOS, call ``mach_absolute_time()`` and ``mach_timebase_info()``." +msgstr "" + +#: library/time.rst:299 +msgid "On HP-UX, call ``gethrtime()``." +msgstr "" + +#: library/time.rst:300 +msgid "Call ``clock_gettime(CLOCK_HIGHRES)`` if available." +msgstr "" + +#: library/time.rst:301 +msgid "Otherwise, call ``clock_gettime(CLOCK_MONOTONIC)``." +msgstr "" + +#: library/time.rst:303 msgid "" "Use :func:`monotonic_ns` to avoid the precision loss caused by the :class:" "`float` type." msgstr "" -#: library/time.rst:299 +#: library/time.rst:308 msgid "The function is now always available and always system-wide." msgstr "" -#: library/time.rst:302 +#: library/time.rst:311 msgid "On macOS, the function is now system-wide." msgstr "" -#: library/time.rst:308 +#: library/time.rst:317 msgid "Similar to :func:`monotonic`, but return time as nanoseconds." msgstr "" -#: library/time.rst:317 +#: library/time.rst:326 msgid "" "Return the value (in fractional seconds) of a performance counter, i.e. a " "clock with the highest available resolution to measure a short duration. It " @@ -407,21 +433,31 @@ msgid "" "between the results of two calls is valid." msgstr "" -#: library/time.rst:323 +#: library/time.rst:334 +msgid "" +"On CPython, use the same clock as :func:`time.monotonic` and is a monotonic " +"clock, i.e. a clock that cannot go backwards." +msgstr "" + +#: library/time.rst:337 msgid "" "Use :func:`perf_counter_ns` to avoid the precision loss caused by the :class:" "`float` type." msgstr "" -#: library/time.rst:328 +#: library/time.rst:342 msgid "On Windows, the function is now system-wide." msgstr "" -#: library/time.rst:333 +#: library/time.rst:345 +msgid "Use the same clock as :func:`time.monotonic`." +msgstr "" + +#: library/time.rst:351 msgid "Similar to :func:`perf_counter`, but return time as nanoseconds." msgstr "" -#: library/time.rst:345 +#: library/time.rst:363 msgid "" "Return the value (in fractional seconds) of the sum of the system and user " "CPU time of the current process. It does not include time elapsed during " @@ -430,40 +466,40 @@ msgid "" "of two calls is valid." msgstr "" -#: library/time.rst:351 +#: library/time.rst:369 msgid "" "Use :func:`process_time_ns` to avoid the precision loss caused by the :class:" "`float` type." msgstr "" -#: library/time.rst:358 +#: library/time.rst:376 msgid "Similar to :func:`process_time` but return time as nanoseconds." msgstr "" -#: library/time.rst:364 +#: library/time.rst:382 msgid "" "Suspend execution of the calling thread for the given number of seconds. The " "argument may be a floating-point number to indicate a more precise sleep " "time." msgstr "" -#: library/time.rst:368 +#: library/time.rst:386 msgid "" "If the sleep is interrupted by a signal and no exception is raised by the " "signal handler, the sleep is restarted with a recomputed timeout." msgstr "" -#: library/time.rst:371 +#: library/time.rst:389 msgid "" "The suspension time may be longer than requested by an arbitrary amount, " "because of the scheduling of other activity in the system." msgstr "" -#: library/time.rst:375 +#: library/time.rst:393 msgid "Windows implementation" msgstr "" -#: library/time.rst:376 +#: library/time.rst:394 msgid "" "On Windows, if *secs* is zero, the thread relinquishes the remainder of its " "time slice to any other thread that is ready to run. If there are no other " @@ -474,47 +510,57 @@ msgid "" "nanoseconds. If *secs* is zero, ``Sleep(0)`` is used." msgstr "" -#: library/time.rst:385 +#: library/time.rst:403 msgid "Unix implementation" msgstr "" -#: library/time.rst:386 +#: library/time.rst:404 msgid "Use ``clock_nanosleep()`` if available (resolution: 1 nanosecond);" msgstr "" -#: library/time.rst:387 +#: library/time.rst:405 msgid "Or use ``nanosleep()`` if available (resolution: 1 nanosecond);" msgstr "" -#: library/time.rst:388 +#: library/time.rst:406 msgid "Or use ``select()`` (resolution: 1 microsecond)." msgstr "" -#: library/time.rst:392 +#: library/time.rst:410 msgid "" "To emulate a \"no-op\", use :keyword:`pass` instead of ``time.sleep(0)``." msgstr "" -#: library/time.rst:394 +#: library/time.rst:412 msgid "" "To voluntarily relinquish the CPU, specify a real-time :ref:`scheduling " "policy ` and use :func:`os.sched_yield` instead." msgstr "" -#: library/time.rst:397 +#: library/time.rst:415 +msgid "" +"Raises an :ref:`auditing event ` ``time.sleep`` with argument " +"``secs``." +msgstr "" + +#: library/time.rst:417 msgid "" "The function now sleeps at least *secs* even if the sleep is interrupted by " "a signal, except if the signal handler raises an exception (see :pep:`475` " "for the rationale)." msgstr "" -#: library/time.rst:402 +#: library/time.rst:422 msgid "" "On Unix, the ``clock_nanosleep()`` and ``nanosleep()`` functions are now " "used if available. On Windows, a waitable timer is now used." msgstr "" -#: library/time.rst:411 +#: library/time.rst:426 +msgid "Raises an auditing event." +msgstr "" + +#: library/time.rst:434 msgid "" "Convert a tuple or :class:`struct_time` representing a time as returned by :" "func:`gmtime` or :func:`localtime` to a string as specified by the *format* " @@ -523,287 +569,287 @@ msgid "" "raised if any field in *t* is outside of the allowed range." msgstr "" -#: library/time.rst:417 +#: library/time.rst:440 msgid "" "0 is a legal argument for any position in the time tuple; if it is normally " "illegal the value is forced to a correct one." msgstr "" -#: library/time.rst:420 +#: library/time.rst:443 msgid "" "The following directives can be embedded in the *format* string. They are " "shown without the optional field width and precision specification, and are " "replaced by the indicated characters in the :func:`strftime` result:" msgstr "" -#: library/time.rst:425 +#: library/time.rst:448 msgid "Directive" msgstr "" -#: library/time.rst:425 +#: library/time.rst:448 msgid "Meaning" msgstr "" -#: library/time.rst:425 +#: library/time.rst:448 msgid "Notes" msgstr "" -#: library/time.rst:427 +#: library/time.rst:450 msgid "``%a``" msgstr "" -#: library/time.rst:427 +#: library/time.rst:450 msgid "Locale's abbreviated weekday name." msgstr "" -#: library/time.rst:430 +#: library/time.rst:453 msgid "``%A``" msgstr "" -#: library/time.rst:430 +#: library/time.rst:453 msgid "Locale's full weekday name." msgstr "" -#: library/time.rst:432 +#: library/time.rst:455 msgid "``%b``" msgstr "" -#: library/time.rst:432 +#: library/time.rst:455 msgid "Locale's abbreviated month name." msgstr "" -#: library/time.rst:435 +#: library/time.rst:458 msgid "``%B``" msgstr "" -#: library/time.rst:435 +#: library/time.rst:458 msgid "Locale's full month name." msgstr "" -#: library/time.rst:437 +#: library/time.rst:460 msgid "``%c``" msgstr "" -#: library/time.rst:437 +#: library/time.rst:460 msgid "Locale's appropriate date and time representation." msgstr "" -#: library/time.rst:440 +#: library/time.rst:463 msgid "``%d``" msgstr "" -#: library/time.rst:440 +#: library/time.rst:463 msgid "Day of the month as a decimal number [01,31]." msgstr "" -#: library/time.rst:443 +#: library/time.rst:466 msgid "``%f``" msgstr "" -#: library/time.rst:443 +#: library/time.rst:466 msgid "Microseconds as a decimal number" msgstr "" -#: library/time.rst:444 +#: library/time.rst:467 msgid "[000000,999999]." msgstr "" -#: library/time.rst:443 +#: library/time.rst:466 msgid "\\(1)" msgstr "" -#: library/time.rst:447 +#: library/time.rst:470 msgid "``%H``" msgstr "" -#: library/time.rst:447 +#: library/time.rst:470 msgid "Hour (24-hour clock) as a decimal number [00,23]." msgstr "" -#: library/time.rst:450 +#: library/time.rst:473 msgid "``%I``" msgstr "" -#: library/time.rst:450 +#: library/time.rst:473 msgid "Hour (12-hour clock) as a decimal number [01,12]." msgstr "" -#: library/time.rst:453 +#: library/time.rst:476 msgid "``%j``" msgstr "" -#: library/time.rst:453 +#: library/time.rst:476 msgid "Day of the year as a decimal number [001,366]." msgstr "" -#: library/time.rst:456 +#: library/time.rst:479 msgid "``%m``" msgstr "" -#: library/time.rst:456 +#: library/time.rst:479 msgid "Month as a decimal number [01,12]." msgstr "" -#: library/time.rst:459 +#: library/time.rst:482 msgid "``%M``" msgstr "" -#: library/time.rst:459 +#: library/time.rst:482 msgid "Minute as a decimal number [00,59]." msgstr "" -#: library/time.rst:462 +#: library/time.rst:485 msgid "``%p``" msgstr "" -#: library/time.rst:462 +#: library/time.rst:485 msgid "Locale's equivalent of either AM or PM." msgstr "" -#: library/time.rst:462 +#: library/time.rst:485 msgid "\\(2)" msgstr "" -#: library/time.rst:465 +#: library/time.rst:488 msgid "``%S``" msgstr "" -#: library/time.rst:465 +#: library/time.rst:488 msgid "Second as a decimal number [00,61]." msgstr "" -#: library/time.rst:465 +#: library/time.rst:488 msgid "\\(3)" msgstr "" -#: library/time.rst:468 +#: library/time.rst:491 msgid "``%U``" msgstr "" -#: library/time.rst:468 +#: library/time.rst:491 msgid "" "Week number of the year (Sunday as the first day of the week) as a decimal " "number [00,53]. All days in a new year preceding the first Sunday are " "considered to be in week 0." msgstr "" -#: library/time.rst:482 +#: library/time.rst:505 msgid "\\(4)" msgstr "" -#: library/time.rst:476 +#: library/time.rst:499 msgid "``%u``" msgstr "" -#: library/time.rst:476 +#: library/time.rst:499 msgid "Day of the week (Monday is 1; Sunday is 7) as a decimal number [1, 7]." msgstr "" -#: library/time.rst:479 +#: library/time.rst:502 msgid "``%w``" msgstr "" -#: library/time.rst:479 +#: library/time.rst:502 msgid "Weekday as a decimal number [0(Sunday),6]." msgstr "" -#: library/time.rst:482 +#: library/time.rst:505 msgid "``%W``" msgstr "" -#: library/time.rst:482 +#: library/time.rst:505 msgid "" "Week number of the year (Monday as the first day of the week) as a decimal " "number [00,53]. All days in a new year preceding the first Monday are " "considered to be in week 0." msgstr "" -#: library/time.rst:490 +#: library/time.rst:513 msgid "``%x``" msgstr "" -#: library/time.rst:490 +#: library/time.rst:513 msgid "Locale's appropriate date representation." msgstr "" -#: library/time.rst:493 +#: library/time.rst:516 msgid "``%X``" msgstr "" -#: library/time.rst:493 +#: library/time.rst:516 msgid "Locale's appropriate time representation." msgstr "" -#: library/time.rst:496 +#: library/time.rst:519 msgid "``%y``" msgstr "" -#: library/time.rst:496 +#: library/time.rst:519 msgid "Year without century as a decimal number [00,99]." msgstr "" -#: library/time.rst:499 +#: library/time.rst:522 msgid "``%Y``" msgstr "" -#: library/time.rst:499 +#: library/time.rst:522 msgid "Year with century as a decimal number." msgstr "" -#: library/time.rst:502 +#: library/time.rst:525 msgid "``%z``" msgstr "" -#: library/time.rst:502 +#: library/time.rst:525 msgid "" "Time zone offset indicating a positive or negative time difference from UTC/" "GMT of the form +HHMM or -HHMM, where H represents decimal hour digits and M " "represents decimal minute digits [-23:59, +23:59]. [1]_" msgstr "" -#: library/time.rst:508 +#: library/time.rst:531 msgid "``%Z``" msgstr "" -#: library/time.rst:508 +#: library/time.rst:531 msgid "Time zone name (no characters if no time zone exists). Deprecated. [1]_" msgstr "" -#: library/time.rst:511 +#: library/time.rst:534 msgid "``%G``" msgstr "" -#: library/time.rst:511 +#: library/time.rst:534 msgid "" "ISO 8601 year (similar to ``%Y`` but follows the rules for the ISO 8601 " "calendar year). The year starts with the week that contains the first " "Thursday of the calendar year." msgstr "" -#: library/time.rst:516 +#: library/time.rst:539 msgid "``%V``" msgstr "" -#: library/time.rst:516 +#: library/time.rst:539 msgid "" "ISO 8601 week number (as a decimal number [01,53]). The first week of the " "year is the one that contains the first Thursday of the year. Weeks start on " "Monday." msgstr "" -#: library/time.rst:521 +#: library/time.rst:544 msgid "``%%``" msgstr "" -#: library/time.rst:521 +#: library/time.rst:544 msgid "A literal ``'%'`` character." msgstr "" -#: library/time.rst:524 +#: library/time.rst:547 msgid "Notes:" msgstr "" -#: library/time.rst:527 +#: library/time.rst:550 msgid "" "The ``%f`` format directive only applies to :func:`strptime`, not to :func:" "`strftime`. However, see also :meth:`datetime.datetime.strptime` and :meth:" @@ -811,40 +857,40 @@ msgid "" "to microseconds `." msgstr "" -#: library/time.rst:533 +#: library/time.rst:556 msgid "" "When used with the :func:`strptime` function, the ``%p`` directive only " "affects the output hour field if the ``%I`` directive is used to parse the " "hour." msgstr "" -#: library/time.rst:539 +#: library/time.rst:562 msgid "" "The range really is ``0`` to ``61``; value ``60`` is valid in timestamps " "representing `leap seconds`_ and value ``61`` is supported for historical " "reasons." msgstr "" -#: library/time.rst:544 +#: library/time.rst:567 msgid "" "When used with the :func:`strptime` function, ``%U`` and ``%W`` are only " "used in calculations when the day of the week and the year are specified." msgstr "" -#: library/time.rst:547 +#: library/time.rst:570 msgid "" "Here is an example, a format for dates compatible with that specified in " "the :rfc:`2822` Internet email standard. [1]_ ::" msgstr "" -#: library/time.rst:550 +#: library/time.rst:573 msgid "" ">>> from time import gmtime, strftime\n" ">>> strftime(\"%a, %d %b %Y %H:%M:%S +0000\", gmtime())\n" "'Thu, 28 Jun 2001 14:17:15 +0000'" msgstr "" -#: library/time.rst:554 +#: library/time.rst:577 msgid "" "Additional directives may be supported on certain platforms, but only the " "ones listed here have a meaning standardized by ANSI C. To see the full set " @@ -852,7 +898,7 @@ msgid "" "`strftime(3)` documentation." msgstr "" -#: library/time.rst:559 +#: library/time.rst:582 msgid "" "On some platforms, an optional field width and precision specification can " "immediately follow the initial ``'%'`` of a directive in the following " @@ -860,13 +906,13 @@ msgid "" "``%j`` where it is 3." msgstr "" -#: library/time.rst:570 +#: library/time.rst:593 msgid "" "Parse a string representing a time according to a format. The return value " "is a :class:`struct_time` as returned by :func:`gmtime` or :func:`localtime`." msgstr "" -#: library/time.rst:574 +#: library/time.rst:597 msgid "" "The *format* parameter uses the same directives as those used by :func:" "`strftime`; it defaults to ``\"%a %b %d %H:%M:%S %Y\"`` which matches the " @@ -877,11 +923,11 @@ msgid "" "Both *string* and *format* must be strings." msgstr "" -#: library/time.rst:582 +#: library/time.rst:605 msgid "For example:" msgstr "" -#: library/time.rst:589 +#: library/time.rst:612 msgid "" "Support for the ``%Z`` directive is based on the values contained in " "``tzname`` and whether ``daylight`` is true. Because of this, it is " @@ -889,7 +935,7 @@ msgid "" "(and are considered to be non-daylight savings timezones)." msgstr "" -#: library/time.rst:594 +#: library/time.rst:617 msgid "" "Only the directives specified in the documentation are supported. Because " "``strftime()`` is implemented per platform it can sometimes offer more " @@ -898,7 +944,7 @@ msgid "" "are not documented as supported." msgstr "" -#: library/time.rst:603 +#: library/time.rst:626 msgid "" "The type of the time value sequence returned by :func:`gmtime`, :func:" "`localtime`, and :func:`strptime`. It is an object with a :term:`named " @@ -906,109 +952,109 @@ msgid "" "The following values are present:" msgstr "" -#: library/time.rst:610 +#: library/time.rst:633 msgid "Index" msgstr "" -#: library/time.rst:611 +#: library/time.rst:634 msgid "Attribute" msgstr "" -#: library/time.rst:612 +#: library/time.rst:635 msgid "Values" msgstr "" -#: library/time.rst:614 +#: library/time.rst:637 msgid "0" msgstr "" -#: library/time.rst:616 +#: library/time.rst:639 msgid "(for example, 1993)" msgstr "" -#: library/time.rst:618 +#: library/time.rst:641 msgid "1" msgstr "" -#: library/time.rst:620 +#: library/time.rst:643 msgid "range [1, 12]" msgstr "" -#: library/time.rst:622 +#: library/time.rst:645 msgid "2" msgstr "" -#: library/time.rst:624 +#: library/time.rst:647 msgid "range [1, 31]" msgstr "" -#: library/time.rst:626 +#: library/time.rst:649 msgid "3" msgstr "" -#: library/time.rst:628 +#: library/time.rst:651 msgid "range [0, 23]" msgstr "" -#: library/time.rst:630 +#: library/time.rst:653 msgid "4" msgstr "" -#: library/time.rst:632 +#: library/time.rst:655 msgid "range [0, 59]" msgstr "" -#: library/time.rst:634 +#: library/time.rst:657 msgid "5" msgstr "" -#: library/time.rst:636 +#: library/time.rst:659 msgid "range [0, 61]; see :ref:`Note (2) ` in :func:`strftime`" msgstr "" -#: library/time.rst:638 +#: library/time.rst:661 msgid "6" msgstr "" -#: library/time.rst:640 +#: library/time.rst:663 msgid "range [0, 6]; Monday is 0" msgstr "" -#: library/time.rst:642 +#: library/time.rst:665 msgid "7" msgstr "" -#: library/time.rst:644 +#: library/time.rst:667 msgid "range [1, 366]" msgstr "" -#: library/time.rst:646 +#: library/time.rst:669 msgid "8" msgstr "" -#: library/time.rst:648 +#: library/time.rst:671 msgid "0, 1 or -1; see below" msgstr "" -#: library/time.rst:654 +#: library/time.rst:677 msgid "N/A" msgstr "" -#: library/time.rst:652 +#: library/time.rst:675 msgid "abbreviation of timezone name" msgstr "" -#: library/time.rst:656 +#: library/time.rst:679 msgid "offset east of UTC in seconds" msgstr "" -#: library/time.rst:658 +#: library/time.rst:681 msgid "" "Note that unlike the C structure, the month value is a range of [1, 12], not " "[0, 11]." msgstr "" -#: library/time.rst:661 +#: library/time.rst:684 msgid "" "In calls to :func:`mktime`, :attr:`tm_isdst` may be set to 1 when daylight " "savings time is in effect, and 0 when it is not. A value of -1 indicates " @@ -1016,14 +1062,14 @@ msgid "" "filled in." msgstr "" -#: library/time.rst:665 +#: library/time.rst:688 msgid "" "When a tuple with an incorrect length is passed to a function expecting a :" "class:`struct_time`, or having elements of the wrong type, a :exc:" "`TypeError` is raised." msgstr "" -#: library/time.rst:671 +#: library/time.rst:694 msgid "" "Return the time in seconds since the epoch_ as a floating-point number. The " "handling of `leap seconds`_ is platform dependent. On Windows and most Unix " @@ -1032,7 +1078,7 @@ msgid "" "org/wiki/Unix_time>`_." msgstr "" -#: library/time.rst:677 +#: library/time.rst:700 msgid "" "Note that even though the time is always returned as a floating-point " "number, not all systems provide time with a better precision than 1 second. " @@ -1041,7 +1087,7 @@ msgid "" "between the two calls." msgstr "" -#: library/time.rst:683 +#: library/time.rst:706 msgid "" "The number returned by :func:`.time` may be converted into a more common " "time format (i.e. year, month, day, hour, etc...) in UTC by passing it to :" @@ -1051,19 +1097,31 @@ msgid "" "attributes." msgstr "" -#: library/time.rst:690 +#: library/time.rst:715 +msgid "On Windows, call ``GetSystemTimeAsFileTime()``." +msgstr "" + +#: library/time.rst:716 +msgid "Call ``clock_gettime(CLOCK_REALTIME)`` if available." +msgstr "" + +#: library/time.rst:717 +msgid "Otherwise, call ``gettimeofday()``." +msgstr "" + +#: library/time.rst:719 msgid "" "Use :func:`time_ns` to avoid the precision loss caused by the :class:`float` " "type." msgstr "" -#: library/time.rst:696 +#: library/time.rst:725 msgid "" "Similar to :func:`~time.time` but returns time as an integer number of " "nanoseconds since the epoch_." msgstr "" -#: library/time.rst:709 +#: library/time.rst:738 msgid "" "Return the value (in fractional seconds) of the sum of the system and user " "CPU time of the current thread. It does not include time elapsed during " @@ -1072,21 +1130,21 @@ msgid "" "of two calls in the same thread is valid." msgstr "" -#: library/time.rst:715 +#: library/time.rst:744 msgid "" "Use :func:`thread_time_ns` to avoid the precision loss caused by the :class:" "`float` type." msgstr "" -#: library/time.rst:720 +#: library/time.rst:749 msgid "Unix systems supporting ``CLOCK_THREAD_CPUTIME_ID``." msgstr "" -#: library/time.rst:727 +#: library/time.rst:756 msgid "Similar to :func:`thread_time` but return time as nanoseconds." msgstr "" -#: library/time.rst:734 +#: library/time.rst:763 msgid "" "Reset the time conversion rules used by the library routines. The " "environment variable :envvar:`TZ` specifies how this is done. It will also " @@ -1097,46 +1155,46 @@ msgid "" "when daylight saving time applies)." msgstr "" -#: library/time.rst:746 +#: library/time.rst:775 msgid "" "Although in many cases, changing the :envvar:`TZ` environment variable may " "affect the output of functions like :func:`localtime` without calling :func:" "`tzset`, this behavior should not be relied on." msgstr "" -#: library/time.rst:750 +#: library/time.rst:779 msgid "The :envvar:`TZ` environment variable should contain no whitespace." msgstr "" -#: library/time.rst:752 +#: library/time.rst:781 msgid "" "The standard format of the :envvar:`TZ` environment variable is (whitespace " "added for clarity)::" msgstr "" -#: library/time.rst:755 +#: library/time.rst:784 msgid "std offset [dst [offset [,start[/time], end[/time]]]]" msgstr "" -#: library/time.rst:757 +#: library/time.rst:786 msgid "Where the components are:" msgstr "" -#: library/time.rst:759 +#: library/time.rst:788 msgid "``std`` and ``dst``" msgstr "" -#: library/time.rst:760 +#: library/time.rst:789 msgid "" "Three or more alphanumerics giving the timezone abbreviations. These will be " "propagated into time.tzname" msgstr "" -#: library/time.rst:763 +#: library/time.rst:792 msgid "``offset``" msgstr "" -#: library/time.rst:764 +#: library/time.rst:793 msgid "" "The offset has the form: ``± hh[:mm[:ss]]``. This indicates the value added " "the local time to arrive at UTC. If preceded by a '-', the timezone is east " @@ -1144,41 +1202,41 @@ msgid "" "summer time is assumed to be one hour ahead of standard time." msgstr "" -#: library/time.rst:769 +#: library/time.rst:798 msgid "``start[/time], end[/time]``" msgstr "" -#: library/time.rst:770 +#: library/time.rst:799 msgid "" "Indicates when to change to and back from DST. The format of the start and " "end dates are one of the following:" msgstr "" -#: library/time.rst:773 +#: library/time.rst:802 msgid ":samp:`J{n}`" msgstr "" -#: library/time.rst:774 +#: library/time.rst:803 msgid "" "The Julian day *n* (1 <= *n* <= 365). Leap days are not counted, so in all " "years February 28 is day 59 and March 1 is day 60." msgstr "" -#: library/time.rst:777 +#: library/time.rst:806 msgid ":samp:`{n}`" msgstr "" -#: library/time.rst:778 +#: library/time.rst:807 msgid "" "The zero-based Julian day (0 <= *n* <= 365). Leap days are counted, and it " "is possible to refer to February 29." msgstr "" -#: library/time.rst:781 +#: library/time.rst:810 msgid ":samp:`M{m}.{n}.{d}`" msgstr "" -#: library/time.rst:782 +#: library/time.rst:811 msgid "" "The *d*'th day (0 <= *d* <= 6) of week *n* of month *m* of the year (1 <= " "*n* <= 5, 1 <= *m* <= 12, where week 5 means \"the last *d* day in month " @@ -1186,13 +1244,13 @@ msgid "" "first week in which the *d*'th day occurs. Day zero is a Sunday." msgstr "" -#: library/time.rst:788 +#: library/time.rst:817 msgid "" "``time`` has the same format as ``offset`` except that no leading sign ('-' " "or '+') is allowed. The default, if time is not given, is 02:00:00." msgstr "" -#: library/time.rst:793 +#: library/time.rst:822 msgid "" ">>> os.environ['TZ'] = 'EST+05EDT,M4.1.0,M10.5.0'\n" ">>> time.tzset()\n" @@ -1204,7 +1262,7 @@ msgid "" "'16:08:12 05/08/03 AEST'" msgstr "" -#: library/time.rst:802 +#: library/time.rst:831 msgid "" "On many Unix systems (including \\*BSD, Linux, Solaris, and Darwin), it is " "more convenient to use the system's zoneinfo (:manpage:`tzfile(5)`) " @@ -1215,7 +1273,7 @@ msgid "" "``'Australia/Melbourne'``, ``'Egypt'`` or ``'Europe/Amsterdam'``. ::" msgstr "" -#: library/time.rst:810 +#: library/time.rst:839 msgid "" ">>> os.environ['TZ'] = 'US/Eastern'\n" ">>> time.tzset()\n" @@ -1227,23 +1285,23 @@ msgid "" "('EET', 'EEST')" msgstr "" -#: library/time.rst:823 +#: library/time.rst:852 msgid "Clock ID Constants" msgstr "" -#: library/time.rst:825 +#: library/time.rst:854 msgid "" "These constants are used as parameters for :func:`clock_getres` and :func:" "`clock_gettime`." msgstr "" -#: library/time.rst:830 +#: library/time.rst:859 msgid "" "Identical to :data:`CLOCK_MONOTONIC`, except it also includes any time that " "the system is suspended." msgstr "" -#: library/time.rst:833 +#: library/time.rst:862 msgid "" "This allows applications to get a suspend-aware monotonic clock without " "having to deal with the complications of :data:`CLOCK_REALTIME`, which may " @@ -1251,75 +1309,87 @@ msgid "" "similar." msgstr "" -#: library/time.rst:845 +#: library/time.rst:874 msgid "" "The Solaris OS has a ``CLOCK_HIGHRES`` timer that attempts to use an optimal " "hardware source, and may give close to nanosecond resolution. " "``CLOCK_HIGHRES`` is the nonadjustable, high-resolution clock." msgstr "" -#: library/time.rst:856 +#: library/time.rst:885 msgid "" "Clock that cannot be set and represents monotonic time since some " "unspecified starting point." msgstr "" -#: library/time.rst:866 +#: library/time.rst:895 msgid "" "Similar to :data:`CLOCK_MONOTONIC`, but provides access to a raw hardware-" "based time that is not subject to NTP adjustments." msgstr "" -#: library/time.rst:885 +#: library/time.rst:904 +msgid "" +"Similar to :data:`CLOCK_MONOTONIC_RAW`, but reads a value cached by the " +"system at context switch and hence has less accuracy." +msgstr "" + +#: library/time.rst:923 msgid "High-resolution per-process timer from the CPU." msgstr "" -#: library/time.rst:893 +#: library/time.rst:931 msgid "" "`International Atomic Time `_" msgstr "" -#: library/time.rst:895 +#: library/time.rst:933 msgid "" "The system must have a current leap second table in order for this to give " "the correct answer. PTP or NTP software can maintain a leap second table." msgstr "" -#: library/time.rst:904 +#: library/time.rst:942 msgid "Thread-specific CPU-time clock." msgstr "" -#: library/time.rst:913 +#: library/time.rst:951 msgid "" "Time whose absolute value is the time the system has been running and not " "suspended, providing accurate uptime measurement, both absolute and interval." msgstr "" -#: library/time.rst:924 +#: library/time.rst:962 msgid "" "Clock that increments monotonically, tracking the time since an arbitrary " "point, unaffected by frequency or time adjustments and not incremented while " "the system is asleep." msgstr "" -#: library/time.rst:932 +#: library/time.rst:972 +msgid "" +"Like :data:`CLOCK_UPTIME_RAW`, but the value is cached by the system at " +"context switches and therefore has less accuracy." +msgstr "" + +#: library/time.rst:979 msgid "" "The following constant is the only parameter that can be sent to :func:" "`clock_settime`." msgstr "" -#: library/time.rst:938 +#: library/time.rst:985 msgid "" "System-wide real-time clock. Setting this clock requires appropriate " "privileges." msgstr "" -#: library/time.rst:949 +#: library/time.rst:996 msgid "Timezone Constants" msgstr "" -#: library/time.rst:953 +#: library/time.rst:1000 msgid "" "The offset of the local DST timezone, in seconds west of UTC, if one is " "defined. This is negative if the local DST timezone is east of UTC (as in " @@ -1327,25 +1397,25 @@ msgid "" "nonzero. See note below." msgstr "" -#: library/time.rst:959 +#: library/time.rst:1006 msgid "Nonzero if a DST timezone is defined. See note below." msgstr "" -#: library/time.rst:963 +#: library/time.rst:1010 msgid "" "The offset of the local (non-DST) timezone, in seconds west of UTC (negative " "in most of Western Europe, positive in the US, zero in the UK). See note " "below." msgstr "" -#: library/time.rst:968 +#: library/time.rst:1015 msgid "" "A tuple of two strings: the first is the name of the local non-DST timezone, " "the second is the name of the local DST timezone. If no DST timezone is " "defined, the second string should not be used. See note below." msgstr "" -#: library/time.rst:974 +#: library/time.rst:1021 msgid "" "For the above Timezone constants (:data:`altzone`, :data:`daylight`, :data:" "`timezone`, and :data:`tzname`), the value is determined by the timezone " @@ -1355,40 +1425,40 @@ msgid "" "func:`localtime` to obtain timezone information." msgstr "" -#: library/time.rst:983 +#: library/time.rst:1030 msgid "Module :mod:`datetime`" msgstr "" -#: library/time.rst:984 +#: library/time.rst:1031 msgid "More object-oriented interface to dates and times." msgstr "" -#: library/time.rst:986 +#: library/time.rst:1033 msgid "Module :mod:`locale`" msgstr "" -#: library/time.rst:987 +#: library/time.rst:1034 msgid "" "Internationalization services. The locale setting affects the " "interpretation of many format specifiers in :func:`strftime` and :func:" "`strptime`." msgstr "" -#: library/time.rst:990 +#: library/time.rst:1037 msgid "Module :mod:`calendar`" msgstr "" -#: library/time.rst:991 +#: library/time.rst:1038 msgid "" "General calendar-related functions. :func:`~calendar.timegm` is the " "inverse of :func:`gmtime` from this module." msgstr "" -#: library/time.rst:995 +#: library/time.rst:1042 msgid "Footnotes" msgstr "" -#: library/time.rst:996 +#: library/time.rst:1043 msgid "" "The use of ``%Z`` is now deprecated, but the ``%z`` escape that expands to " "the preferred hour/minute offset is not supported by all ANSI C libraries. " @@ -1427,22 +1497,22 @@ msgstr "" msgid "Daylight Saving Time" msgstr "" -#: library/time.rst:340 library/time.rst:704 +#: library/time.rst:358 library/time.rst:733 msgid "benchmarking" msgstr "" -#: library/time.rst:704 +#: library/time.rst:733 msgid "CPU time" msgstr "" -#: library/time.rst:704 +#: library/time.rst:733 msgid "processor time" msgstr "" -#: library/time.rst:565 +#: library/time.rst:588 msgid "% (percent)" msgstr "" -#: library/time.rst:565 +#: library/time.rst:588 msgid "datetime format" msgstr "" diff --git a/library/timeit.po b/library/timeit.po index 389b0763..afe34550 100644 --- a/library/timeit.po +++ b/library/timeit.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" diff --git a/library/tk.po b/library/tk.po index 2e3fc9a4..a3cb7762 100644 --- a/library/tk.po +++ b/library/tk.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -26,10 +26,10 @@ msgid "" "Tk/Tcl has long been an integral part of Python. It provides a robust and " "platform independent windowing toolkit, that is available to Python " "programmers using the :mod:`tkinter` package, and its extension, the :mod:" -"`tkinter.tix` and the :mod:`tkinter.ttk` modules." +"`tkinter.ttk` module." msgstr "" -#: library/tk.rst:18 +#: library/tk.rst:17 msgid "" "The :mod:`tkinter` package is a thin object-oriented layer on top of Tcl/Tk. " "To use :mod:`tkinter`, you don't need to write Tcl code, but you will need " @@ -38,7 +38,7 @@ msgid "" "classes." msgstr "" -#: library/tk.rst:24 +#: library/tk.rst:23 msgid "" ":mod:`tkinter`'s chief virtues are that it is fast, and that it usually " "comes bundled with Python. Although its standard documentation is weak, good " diff --git a/library/tkinter.colorchooser.po b/library/tkinter.colorchooser.po index 6118e92b..61c9153a 100644 --- a/library/tkinter.colorchooser.po +++ b/library/tkinter.colorchooser.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" diff --git a/library/tkinter.dnd.po b/library/tkinter.dnd.po index ac804e9b..ac11cb2b 100644 --- a/library/tkinter.dnd.po +++ b/library/tkinter.dnd.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" diff --git a/library/tkinter.font.po b/library/tkinter.font.po index 42e3c408..1900f37c 100644 --- a/library/tkinter.font.po +++ b/library/tkinter.font.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" diff --git a/library/tkinter.messagebox.po b/library/tkinter.messagebox.po index 4386b397..3492e83e 100644 --- a/library/tkinter.messagebox.po +++ b/library/tkinter.messagebox.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" diff --git a/library/tkinter.po b/library/tkinter.po index bfba2aeb..ee2bd398 100644 --- a/library/tkinter.po +++ b/library/tkinter.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -182,7 +182,7 @@ msgid "" "difference (see `Threading model`_ for details)." msgstr "" -#: library/tkinter.rst:911 +#: library/tkinter.rst:907 msgid "Tk" msgstr "" @@ -493,28 +493,18 @@ msgid "" msgstr "" #: library/tkinter.rst:258 -msgid ":mod:`tkinter.tix`" -msgstr "" - -#: library/tkinter.rst:259 -msgid "" -"(deprecated) An older third-party Tcl/Tk package that adds several new " -"widgets. Better alternatives for most can be found in :mod:`tkinter.ttk`." -msgstr "" - -#: library/tkinter.rst:262 msgid ":mod:`turtle`" msgstr "" -#: library/tkinter.rst:263 +#: library/tkinter.rst:259 msgid "Turtle graphics in a Tk window." msgstr "" -#: library/tkinter.rst:267 +#: library/tkinter.rst:263 msgid "Tkinter Life Preserver" msgstr "" -#: library/tkinter.rst:269 +#: library/tkinter.rst:265 msgid "" "This section is not designed to be an exhaustive tutorial on either Tk or " "Tkinter. For that, refer to one of the external resources noted earlier. " @@ -523,7 +513,7 @@ msgid "" "how the Tkinter wrapper is structured." msgstr "" -#: library/tkinter.rst:275 +#: library/tkinter.rst:271 msgid "" "The remainder of this section will help you to identify the classes, " "methods, and options you'll need in your Tkinter application, and where to " @@ -531,18 +521,18 @@ msgid "" "reference manual." msgstr "" -#: library/tkinter.rst:282 +#: library/tkinter.rst:278 msgid "A Hello World Program" msgstr "" -#: library/tkinter.rst:284 +#: library/tkinter.rst:280 msgid "" "We'll start by walking through a \"Hello World\" application in Tkinter. " "This isn't the smallest one we could write, but has enough to illustrate " "some key concepts you'll need to know." msgstr "" -#: library/tkinter.rst:290 +#: library/tkinter.rst:286 msgid "" "from tkinter import *\n" "from tkinter import ttk\n" @@ -554,7 +544,7 @@ msgid "" "root.mainloop()" msgstr "" -#: library/tkinter.rst:300 +#: library/tkinter.rst:296 msgid "" "After the imports, the next line creates an instance of the :class:`Tk` " "class, which initializes Tk and creates its associated Tcl interpreter. It " @@ -562,56 +552,56 @@ msgid "" "the main window of the application." msgstr "" -#: library/tkinter.rst:305 +#: library/tkinter.rst:301 msgid "" "The following line creates a frame widget, which in this case will contain a " "label and a button we'll create next. The frame is fit inside the root " "window." msgstr "" -#: library/tkinter.rst:309 +#: library/tkinter.rst:305 msgid "" "The next line creates a label widget holding a static text string. The :meth:" "`grid` method is used to specify the relative layout (position) of the label " "within its containing frame widget, similar to how tables in HTML work." msgstr "" -#: library/tkinter.rst:313 +#: library/tkinter.rst:309 msgid "" "A button widget is then created, and placed to the right of the label. When " "pressed, it will call the :meth:`destroy` method of the root window." msgstr "" -#: library/tkinter.rst:316 +#: library/tkinter.rst:312 msgid "" "Finally, the :meth:`mainloop` method puts everything on the display, and " "responds to user input until the program terminates." msgstr "" -#: library/tkinter.rst:322 +#: library/tkinter.rst:318 msgid "Important Tk Concepts" msgstr "" -#: library/tkinter.rst:324 +#: library/tkinter.rst:320 msgid "Even this simple program illustrates the following key Tk concepts:" msgstr "" -#: library/tkinter.rst:326 +#: library/tkinter.rst:322 msgid "widgets" msgstr "" -#: library/tkinter.rst:327 +#: library/tkinter.rst:323 msgid "" "A Tkinter user interface is made up of individual *widgets*. Each widget is " "represented as a Python object, instantiated from classes like :class:`ttk." "Frame`, :class:`ttk.Label`, and :class:`ttk.Button`." msgstr "" -#: library/tkinter.rst:331 +#: library/tkinter.rst:327 msgid "widget hierarchy" msgstr "" -#: library/tkinter.rst:332 +#: library/tkinter.rst:328 msgid "" "Widgets are arranged in a *hierarchy*. The label and button were contained " "within a frame, which in turn was contained within the root window. When " @@ -619,44 +609,44 @@ msgid "" "argument to the widget constructor." msgstr "" -#: library/tkinter.rst:337 +#: library/tkinter.rst:333 msgid "configuration options" msgstr "" -#: library/tkinter.rst:338 +#: library/tkinter.rst:334 msgid "" "Widgets have *configuration options*, which modify their appearance and " "behavior, such as the text to display in a label or button. Different " "classes of widgets will have different sets of options." msgstr "" -#: library/tkinter.rst:342 +#: library/tkinter.rst:338 msgid "geometry management" msgstr "" -#: library/tkinter.rst:343 +#: library/tkinter.rst:339 msgid "" "Widgets aren't automatically added to the user interface when they are " "created. A *geometry manager* like ``grid`` controls where in the user " "interface they are placed." msgstr "" -#: library/tkinter.rst:347 +#: library/tkinter.rst:343 msgid "event loop" msgstr "" -#: library/tkinter.rst:348 +#: library/tkinter.rst:344 msgid "" "Tkinter reacts to user input, changes from your program, and even refreshes " "the display only when actively running an *event loop*. If your program " "isn't running the event loop, your user interface won't update." msgstr "" -#: library/tkinter.rst:354 +#: library/tkinter.rst:350 msgid "Understanding How Tkinter Wraps Tcl/Tk" msgstr "" -#: library/tkinter.rst:356 +#: library/tkinter.rst:352 msgid "" "When your application uses Tkinter's classes and methods, internally Tkinter " "is assembling strings representing Tcl/Tk commands, and executing those " @@ -664,7 +654,7 @@ msgid "" "instance." msgstr "" -#: library/tkinter.rst:361 +#: library/tkinter.rst:357 msgid "" "Whether it's trying to navigate reference documentation, trying to find the " "right method or option, adapting some existing code, or debugging your " @@ -672,13 +662,13 @@ msgid "" "what those underlying Tcl/Tk commands look like." msgstr "" -#: library/tkinter.rst:366 +#: library/tkinter.rst:362 msgid "" "To illustrate, here is the Tcl/Tk equivalent of the main part of the Tkinter " "script above." msgstr "" -#: library/tkinter.rst:371 +#: library/tkinter.rst:367 msgid "" "ttk::frame .frm -padding 10\n" "grid .frm\n" @@ -687,7 +677,7 @@ msgid "" "row 0" msgstr "" -#: library/tkinter.rst:377 +#: library/tkinter.rst:373 msgid "" "Tcl's syntax is similar to many shell languages, where the first word is the " "command to be executed, with arguments to that command following it, " @@ -695,25 +685,25 @@ msgid "" "following:" msgstr "" -#: library/tkinter.rst:381 +#: library/tkinter.rst:377 msgid "" "The commands used to create widgets (like ``ttk::frame``) correspond to " "widget classes in Tkinter." msgstr "" -#: library/tkinter.rst:384 +#: library/tkinter.rst:380 msgid "" "Tcl widget options (like ``-text``) correspond to keyword arguments in " "Tkinter." msgstr "" -#: library/tkinter.rst:387 +#: library/tkinter.rst:383 msgid "" "Widgets are referred to by a *pathname* in Tcl (like ``.frm.btn``), whereas " "Tkinter doesn't use names but object references." msgstr "" -#: library/tkinter.rst:390 +#: library/tkinter.rst:386 msgid "" "A widget's place in the widget hierarchy is encoded in its (hierarchical) " "pathname, which uses a ``.`` (dot) as a path separator. The pathname for the " @@ -721,7 +711,7 @@ msgid "" "pathname but by specifying the parent widget when creating each child widget." msgstr "" -#: library/tkinter.rst:396 +#: library/tkinter.rst:392 msgid "" "Operations which are implemented as separate *commands* in Tcl (like " "``grid`` or ``destroy``) are represented as *methods* on Tkinter widget " @@ -730,18 +720,18 @@ msgid "" "in Tkinter." msgstr "" -#: library/tkinter.rst:404 +#: library/tkinter.rst:400 msgid "How do I...? What option does...?" msgstr "" -#: library/tkinter.rst:406 +#: library/tkinter.rst:402 msgid "" "If you're not sure how to do something in Tkinter, and you can't immediately " "find it in the tutorial or reference documentation you're using, there are a " "few strategies that can be helpful." msgstr "" -#: library/tkinter.rst:410 +#: library/tkinter.rst:406 msgid "" "First, remember that the details of how individual widgets work may vary " "across different versions of both Tkinter and Tcl/Tk. If you're searching " @@ -749,7 +739,7 @@ msgid "" "installed on your system." msgstr "" -#: library/tkinter.rst:415 +#: library/tkinter.rst:411 msgid "" "When searching for how to use an API, it helps to know the exact name of the " "class, option, or method that you're using. Introspection, either in an " @@ -757,7 +747,7 @@ msgid "" "you need." msgstr "" -#: library/tkinter.rst:420 +#: library/tkinter.rst:416 msgid "" "To find out what configuration options are available on any widget, call " "its :meth:`configure` method, which returns a dictionary containing a " @@ -765,13 +755,13 @@ msgid "" "values. Use :meth:`keys` to get just the names of each option." msgstr "" -#: library/tkinter.rst:427 +#: library/tkinter.rst:423 msgid "" "btn = ttk.Button(frm, ...)\n" "print(btn.configure().keys())" msgstr "" -#: library/tkinter.rst:430 +#: library/tkinter.rst:426 msgid "" "As most widgets have many configuration options in common, it can be useful " "to find out which are specific to a particular widget class. Comparing the " @@ -779,11 +769,11 @@ msgid "" "that." msgstr "" -#: library/tkinter.rst:437 +#: library/tkinter.rst:433 msgid "print(set(btn.configure().keys()) - set(frm.configure().keys()))" msgstr "" -#: library/tkinter.rst:439 +#: library/tkinter.rst:435 msgid "" "Similarly, you can find the available methods for a widget object using the " "standard :func:`dir` function. If you try it, you'll see there are over 200 " @@ -791,17 +781,17 @@ msgid "" "is helpful." msgstr "" -#: library/tkinter.rst:446 +#: library/tkinter.rst:442 msgid "" "print(dir(btn))\n" "print(set(dir(btn)) - set(dir(frm)))" msgstr "" -#: library/tkinter.rst:451 +#: library/tkinter.rst:447 msgid "Navigating the Tcl/Tk Reference Manual" msgstr "" -#: library/tkinter.rst:453 +#: library/tkinter.rst:449 msgid "" "As noted, the official `Tk commands `_ reference manual (man pages) is often the most accurate " @@ -810,7 +800,7 @@ msgid "" "places to look." msgstr "" -#: library/tkinter.rst:458 +#: library/tkinter.rst:454 msgid "" "While all operations in Tkinter are implemented as method calls on widget " "objects, you've seen that many Tcl/Tk operations appear as commands that " @@ -818,13 +808,13 @@ msgid "" "parameters, e.g." msgstr "" -#: library/tkinter.rst:465 +#: library/tkinter.rst:461 msgid "" "destroy .\n" "grid .frm.btn -column 0 -row 0" msgstr "" -#: library/tkinter.rst:468 +#: library/tkinter.rst:464 msgid "" "Others, however, look more like methods called on a widget object (in fact, " "when you create a widget in Tcl/Tk, it creates a Tcl command with the name " @@ -832,13 +822,13 @@ msgid "" "name of a method to call)." msgstr "" -#: library/tkinter.rst:475 +#: library/tkinter.rst:471 msgid "" ".frm.btn invoke\n" ".frm.lbl configure -text \"Goodbye\"" msgstr "" -#: library/tkinter.rst:479 +#: library/tkinter.rst:475 msgid "" "In the official Tcl/Tk reference documentation, you'll find most operations " "that look like method calls on the man page for a specific widget (e.g., " @@ -848,7 +838,7 @@ msgid "" "www.tcl.tk/man/tcl8.6/TkCmd/grid.htm>`_)." msgstr "" -#: library/tkinter.rst:487 +#: library/tkinter.rst:483 msgid "" "You'll find many common options and methods in the `options `_ or `ttk::widget `_ man page." msgstr "" -#: library/tkinter.rst:498 +#: library/tkinter.rst:494 msgid "" "Somewhat confusingly, there are also methods on all Tkinter widgets that " "don't actually operate on the widget, but operate at a global scope, " @@ -873,17 +863,17 @@ msgid "" "class:`Widget` class that all Tkinter widgets inherit from)." msgstr "" -#: library/tkinter.rst:507 +#: library/tkinter.rst:503 msgid "Threading model" msgstr "" -#: library/tkinter.rst:509 +#: library/tkinter.rst:505 msgid "" "Python and Tcl/Tk have very different threading models, which :mod:`tkinter` " "tries to bridge. If you use threads, you may need to be aware of this." msgstr "" -#: library/tkinter.rst:512 +#: library/tkinter.rst:508 msgid "" "A Python interpreter may have many threads associated with it. In Tcl, " "multiple threads can be created, but each thread has a separate Tcl " @@ -892,7 +882,7 @@ msgid "" "by the one thread that created it." msgstr "" -#: library/tkinter.rst:517 +#: library/tkinter.rst:513 msgid "" "Each :class:`Tk` object created by :mod:`tkinter` contains a Tcl " "interpreter. It also keeps track of which thread created that interpreter. " @@ -902,7 +892,7 @@ msgid "" "executed, the result is returned to the calling Python thread." msgstr "" -#: library/tkinter.rst:524 +#: library/tkinter.rst:520 msgid "" "Tcl/Tk applications are normally event-driven, meaning that after " "initialization, the interpreter runs an event loop (i.e. :func:`Tk." @@ -915,18 +905,18 @@ msgid "" "event handlers." msgstr "" -#: library/tkinter.rst:533 +#: library/tkinter.rst:529 msgid "" "If the Tcl interpreter is not running the event loop and processing events, " "any :mod:`tkinter` calls made from threads other than the one running the " "Tcl interpreter will fail." msgstr "" -#: library/tkinter.rst:537 +#: library/tkinter.rst:533 msgid "A number of special cases exist:" msgstr "" -#: library/tkinter.rst:539 +#: library/tkinter.rst:535 msgid "" "Tcl/Tk libraries can be built so they are not thread-aware. In this case, :" "mod:`tkinter` calls the library from the originating Python thread, even if " @@ -934,7 +924,7 @@ msgid "" "lock ensures only one call occurs at a time." msgstr "" -#: library/tkinter.rst:544 +#: library/tkinter.rst:540 msgid "" "While :mod:`tkinter` allows you to create more than one instance of a :class:" "`Tk` object (with its own interpreter), all interpreters that are part of " @@ -944,7 +934,7 @@ msgid "" "running a thread-aware Tcl/Tk build." msgstr "" -#: library/tkinter.rst:550 +#: library/tkinter.rst:546 msgid "" "Blocking event handlers are not the only way to prevent the Tcl interpreter " "from reentering the event loop. It is even possible to run multiple nested " @@ -952,61 +942,61 @@ msgid "" "tricky when it comes to events or threads, be aware of these possibilities." msgstr "" -#: library/tkinter.rst:555 +#: library/tkinter.rst:551 msgid "" "There are a few select :mod:`tkinter` functions that presently work only " "when called from the thread that created the Tcl interpreter." msgstr "" -#: library/tkinter.rst:560 +#: library/tkinter.rst:556 msgid "Handy Reference" msgstr "" -#: library/tkinter.rst:566 +#: library/tkinter.rst:562 msgid "Setting Options" msgstr "" -#: library/tkinter.rst:568 +#: library/tkinter.rst:564 msgid "" "Options control things like the color and border width of a widget. Options " "can be set in three ways:" msgstr "" -#: library/tkinter.rst:571 +#: library/tkinter.rst:567 msgid "At object creation time, using keyword arguments" msgstr "" -#: library/tkinter.rst:574 +#: library/tkinter.rst:570 msgid "fred = Button(self, fg=\"red\", bg=\"blue\")" msgstr "" -#: library/tkinter.rst:576 +#: library/tkinter.rst:572 msgid "After object creation, treating the option name like a dictionary index" msgstr "" -#: library/tkinter.rst:579 +#: library/tkinter.rst:575 msgid "" "fred[\"fg\"] = \"red\"\n" "fred[\"bg\"] = \"blue\"" msgstr "" -#: library/tkinter.rst:582 +#: library/tkinter.rst:578 msgid "" "Use the config() method to update multiple attrs subsequent to object " "creation" msgstr "" -#: library/tkinter.rst:585 +#: library/tkinter.rst:581 msgid "fred.config(fg=\"red\", bg=\"blue\")" msgstr "" -#: library/tkinter.rst:587 +#: library/tkinter.rst:583 msgid "" "For a complete explanation of a given option and its behavior, see the Tk " "man pages for the widget in question." msgstr "" -#: library/tkinter.rst:590 +#: library/tkinter.rst:586 msgid "" "Note that the man pages list \"STANDARD OPTIONS\" and \"WIDGET SPECIFIC " "OPTIONS\" for each widget. The former is a list of options that are common " @@ -1015,7 +1005,7 @@ msgid "" "`options(3)` man page." msgstr "" -#: library/tkinter.rst:596 +#: library/tkinter.rst:592 msgid "" "No distinction between standard and widget-specific options is made in this " "document. Some options don't apply to some kinds of widgets. Whether a " @@ -1023,7 +1013,7 @@ msgid "" "widget; buttons have a ``command`` option, labels do not." msgstr "" -#: library/tkinter.rst:601 +#: library/tkinter.rst:597 msgid "" "The options supported by a given widget are listed in that widget's man " "page, or can be queried at runtime by calling the :meth:`config` method " @@ -1032,7 +1022,7 @@ msgid "" "option as a string (for example, ``'relief'``) and whose values are 5-tuples." msgstr "" -#: library/tkinter.rst:607 +#: library/tkinter.rst:603 msgid "" "Some options, like ``bg`` are synonyms for common options with long names " "(``bg`` is shorthand for \"background\"). Passing the ``config()`` method " @@ -1041,95 +1031,95 @@ msgid "" "option (such as ``('bg', 'background')``)." msgstr "" -#: library/tkinter.rst:614 +#: library/tkinter.rst:610 msgid "Index" msgstr "" -#: library/tkinter.rst:614 +#: library/tkinter.rst:610 msgid "Meaning" msgstr "" -#: library/tkinter.rst:614 +#: library/tkinter.rst:610 msgid "Example" msgstr "" -#: library/tkinter.rst:616 +#: library/tkinter.rst:612 msgid "0" msgstr "" -#: library/tkinter.rst:616 +#: library/tkinter.rst:612 msgid "option name" msgstr "" -#: library/tkinter.rst:618 +#: library/tkinter.rst:614 msgid "``'relief'``" msgstr "" -#: library/tkinter.rst:618 +#: library/tkinter.rst:614 msgid "1" msgstr "" -#: library/tkinter.rst:618 +#: library/tkinter.rst:614 msgid "option name for database lookup" msgstr "" -#: library/tkinter.rst:620 +#: library/tkinter.rst:616 msgid "2" msgstr "" -#: library/tkinter.rst:620 +#: library/tkinter.rst:616 msgid "option class for database lookup" msgstr "" -#: library/tkinter.rst:620 +#: library/tkinter.rst:616 msgid "``'Relief'``" msgstr "" -#: library/tkinter.rst:623 +#: library/tkinter.rst:619 msgid "3" msgstr "" -#: library/tkinter.rst:623 +#: library/tkinter.rst:619 msgid "default value" msgstr "" -#: library/tkinter.rst:623 +#: library/tkinter.rst:619 msgid "``'raised'``" msgstr "" -#: library/tkinter.rst:625 +#: library/tkinter.rst:621 msgid "4" msgstr "" -#: library/tkinter.rst:625 +#: library/tkinter.rst:621 msgid "current value" msgstr "" -#: library/tkinter.rst:625 +#: library/tkinter.rst:621 msgid "``'groove'``" msgstr "" -#: library/tkinter.rst:628 +#: library/tkinter.rst:624 msgid "Example::" msgstr "" -#: library/tkinter.rst:630 +#: library/tkinter.rst:626 msgid "" ">>> print(fred.config())\n" "{'relief': ('relief', 'relief', 'Relief', 'raised', 'groove')}" msgstr "" -#: library/tkinter.rst:633 +#: library/tkinter.rst:629 msgid "" "Of course, the dictionary printed will include all the options available and " "their values. This is meant only as an example." msgstr "" -#: library/tkinter.rst:638 +#: library/tkinter.rst:634 msgid "The Packer" msgstr "" -#: library/tkinter.rst:642 +#: library/tkinter.rst:638 msgid "" "The packer is one of Tk's geometry-management mechanisms. Geometry " "managers are used to specify the relative positioning of widgets within " @@ -1140,7 +1130,7 @@ msgid "" "coordinates for you." msgstr "" -#: library/tkinter.rst:649 +#: library/tkinter.rst:645 msgid "" "The size of any *master* widget is determined by the size of the \"slave " "widgets\" inside. The packer is used to control where slave widgets appear " @@ -1150,7 +1140,7 @@ msgid "" "accommodate incremental changes to the configuration, once it is packed." msgstr "" -#: library/tkinter.rst:656 +#: library/tkinter.rst:652 msgid "" "Note that widgets do not appear until they have had their geometry specified " "with a geometry manager. It's a common early mistake to leave out the " @@ -1159,86 +1149,86 @@ msgid "" "the packer's :meth:`pack` method applied to it." msgstr "" -#: library/tkinter.rst:662 +#: library/tkinter.rst:658 msgid "" "The pack() method can be called with keyword-option/value pairs that control " "where the widget is to appear within its container, and how it is to behave " "when the main application window is resized. Here are some examples::" msgstr "" -#: library/tkinter.rst:666 +#: library/tkinter.rst:662 msgid "" "fred.pack() # defaults to side = \"top\"\n" "fred.pack(side=\"left\")\n" "fred.pack(expand=1)" msgstr "" -#: library/tkinter.rst:672 +#: library/tkinter.rst:668 msgid "Packer Options" msgstr "" -#: library/tkinter.rst:674 +#: library/tkinter.rst:670 msgid "" "For more extensive information on the packer and the options that it can " "take, see the man pages and page 183 of John Ousterhout's book." msgstr "" -#: library/tkinter.rst:796 +#: library/tkinter.rst:792 msgid "anchor" msgstr "" -#: library/tkinter.rst:678 +#: library/tkinter.rst:674 msgid "" "Anchor type. Denotes where the packer is to place each slave in its parcel." msgstr "" -#: library/tkinter.rst:680 +#: library/tkinter.rst:676 msgid "expand" msgstr "" -#: library/tkinter.rst:681 +#: library/tkinter.rst:677 msgid "Boolean, ``0`` or ``1``." msgstr "" -#: library/tkinter.rst:683 +#: library/tkinter.rst:679 msgid "fill" msgstr "" -#: library/tkinter.rst:684 +#: library/tkinter.rst:680 msgid "Legal values: ``'x'``, ``'y'``, ``'both'``, ``'none'``." msgstr "" -#: library/tkinter.rst:686 +#: library/tkinter.rst:682 msgid "ipadx and ipady" msgstr "" -#: library/tkinter.rst:687 +#: library/tkinter.rst:683 msgid "" "A distance - designating internal padding on each side of the slave widget." msgstr "" -#: library/tkinter.rst:689 +#: library/tkinter.rst:685 msgid "padx and pady" msgstr "" -#: library/tkinter.rst:690 +#: library/tkinter.rst:686 msgid "" "A distance - designating external padding on each side of the slave widget." msgstr "" -#: library/tkinter.rst:692 +#: library/tkinter.rst:688 msgid "side" msgstr "" -#: library/tkinter.rst:693 +#: library/tkinter.rst:689 msgid "Legal values are: ``'left'``, ``'right'``, ``'top'``, ``'bottom'``." msgstr "" -#: library/tkinter.rst:697 +#: library/tkinter.rst:693 msgid "Coupling Widget Variables" msgstr "" -#: library/tkinter.rst:699 +#: library/tkinter.rst:695 msgid "" "The current-value setting of some widgets (like text entry widgets) can be " "connected directly to application variables by using special options. These " @@ -1248,7 +1238,7 @@ msgid "" "value." msgstr "" -#: library/tkinter.rst:705 +#: library/tkinter.rst:701 msgid "" "Unfortunately, in the current implementation of :mod:`tkinter` it is not " "possible to hand over an arbitrary Python variable to a widget through a " @@ -1257,7 +1247,7 @@ msgid "" "Variable, defined in :mod:`tkinter`." msgstr "" -#: library/tkinter.rst:711 +#: library/tkinter.rst:707 msgid "" "There are many useful subclasses of Variable already defined: :class:" "`StringVar`, :class:`IntVar`, :class:`DoubleVar`, and :class:`BooleanVar`. " @@ -1267,11 +1257,11 @@ msgid "" "no further intervention on your part." msgstr "" -#: library/tkinter.rst:898 +#: library/tkinter.rst:894 msgid "For example::" msgstr "" -#: library/tkinter.rst:720 +#: library/tkinter.rst:716 msgid "" "import tkinter as tk\n" "\n" @@ -1304,11 +1294,11 @@ msgid "" "myapp.mainloop()" msgstr "" -#: library/tkinter.rst:751 +#: library/tkinter.rst:747 msgid "The Window Manager" msgstr "" -#: library/tkinter.rst:755 +#: library/tkinter.rst:751 msgid "" "In Tk, there is a utility command, ``wm``, for interacting with the window " "manager. Options to the ``wm`` command allow you to control things like " @@ -1318,7 +1308,7 @@ msgid "" "the :class:`Wm` methods directly." msgstr "" -#: library/tkinter.rst:762 +#: library/tkinter.rst:758 msgid "" "To get at the toplevel window that contains a given widget, you can often " "just refer to the widget's master. Of course if the widget has been packed " @@ -1329,11 +1319,11 @@ msgid "" "to Tk functionality." msgstr "" -#: library/tkinter.rst:769 +#: library/tkinter.rst:765 msgid "Here are some examples of typical usage::" msgstr "" -#: library/tkinter.rst:771 +#: library/tkinter.rst:767 msgid "" "import tkinter as tk\n" "\n" @@ -1355,22 +1345,22 @@ msgid "" "myapp.mainloop()" msgstr "" -#: library/tkinter.rst:794 +#: library/tkinter.rst:790 msgid "Tk Option Data Types" msgstr "" -#: library/tkinter.rst:797 +#: library/tkinter.rst:793 msgid "" "Legal values are points of the compass: ``\"n\"``, ``\"ne\"``, ``\"e\"``, " "``\"se\"``, ``\"s\"``, ``\"sw\"``, ``\"w\"``, ``\"nw\"``, and also " "``\"center\"``." msgstr "" -#: library/tkinter.rst:800 +#: library/tkinter.rst:796 msgid "bitmap" msgstr "" -#: library/tkinter.rst:801 +#: library/tkinter.rst:797 msgid "" "There are eight built-in, named bitmaps: ``'error'``, ``'gray25'``, " "``'gray50'``, ``'hourglass'``, ``'info'``, ``'questhead'``, ``'question'``, " @@ -1378,34 +1368,34 @@ msgid "" "file, preceded with an ``@``, as in ``\"@/usr/contrib/bitmap/gumby.bit\"``." msgstr "" -#: library/tkinter.rst:806 +#: library/tkinter.rst:802 msgid "boolean" msgstr "" -#: library/tkinter.rst:807 +#: library/tkinter.rst:803 msgid "You can pass integers 0 or 1 or the strings ``\"yes\"`` or ``\"no\"``." msgstr "" -#: library/tkinter.rst:809 +#: library/tkinter.rst:805 msgid "callback" msgstr "" -#: library/tkinter.rst:810 +#: library/tkinter.rst:806 msgid "This is any Python function that takes no arguments. For example::" msgstr "" -#: library/tkinter.rst:812 +#: library/tkinter.rst:808 msgid "" "def print_it():\n" " print(\"hi there\")\n" "fred[\"command\"] = print_it" msgstr "" -#: library/tkinter.rst:816 +#: library/tkinter.rst:812 msgid "color" msgstr "" -#: library/tkinter.rst:817 +#: library/tkinter.rst:813 msgid "" "Colors can be given as the names of X colors in the rgb.txt file, or as " "strings representing RGB values in 4 bit: ``\"#RGB\"``, 8 bit: " @@ -1414,11 +1404,11 @@ msgid "" "digit. See page 160 of Ousterhout's book for details." msgstr "" -#: library/tkinter.rst:822 +#: library/tkinter.rst:818 msgid "cursor" msgstr "" -#: library/tkinter.rst:823 +#: library/tkinter.rst:819 msgid "" "The standard X cursor names from :file:`cursorfont.h` can be used, without " "the ``XC_`` prefix. For example to get a hand cursor (:const:`XC_hand2`), " @@ -1426,11 +1416,11 @@ msgid "" "of your own. See page 179 of Ousterhout's book." msgstr "" -#: library/tkinter.rst:828 +#: library/tkinter.rst:824 msgid "distance" msgstr "" -#: library/tkinter.rst:829 +#: library/tkinter.rst:825 msgid "" "Screen distances can be specified in either pixels or absolute distances. " "Pixels are given as numbers and absolute distances as strings, with the " @@ -1439,124 +1429,124 @@ msgid "" "is expressed as ``\"3.5i\"``." msgstr "" -#: library/tkinter.rst:835 +#: library/tkinter.rst:831 msgid "font" msgstr "" -#: library/tkinter.rst:836 +#: library/tkinter.rst:832 msgid "" "Tk uses a list font name format, such as ``{courier 10 bold}``. Font sizes " "with positive numbers are measured in points; sizes with negative numbers " "are measured in pixels." msgstr "" -#: library/tkinter.rst:840 +#: library/tkinter.rst:836 msgid "geometry" msgstr "" -#: library/tkinter.rst:841 +#: library/tkinter.rst:837 msgid "" "This is a string of the form ``widthxheight``, where width and height are " "measured in pixels for most widgets (in characters for widgets displaying " "text). For example: ``fred[\"geometry\"] = \"200x100\"``." msgstr "" -#: library/tkinter.rst:845 +#: library/tkinter.rst:841 msgid "justify" msgstr "" -#: library/tkinter.rst:846 +#: library/tkinter.rst:842 msgid "" "Legal values are the strings: ``\"left\"``, ``\"center\"``, ``\"right\"``, " "and ``\"fill\"``." msgstr "" -#: library/tkinter.rst:849 +#: library/tkinter.rst:845 msgid "region" msgstr "" -#: library/tkinter.rst:850 +#: library/tkinter.rst:846 msgid "" "This is a string with four space-delimited elements, each of which is a " "legal distance (see above). For example: ``\"2 3 4 5\"`` and ``\"3i 2i 4.5i " "2i\"`` and ``\"3c 2c 4c 10.43c\"`` are all legal regions." msgstr "" -#: library/tkinter.rst:854 +#: library/tkinter.rst:850 msgid "relief" msgstr "" -#: library/tkinter.rst:855 +#: library/tkinter.rst:851 msgid "" "Determines what the border style of a widget will be. Legal values are: " "``\"raised\"``, ``\"sunken\"``, ``\"flat\"``, ``\"groove\"``, and " "``\"ridge\"``." msgstr "" -#: library/tkinter.rst:858 +#: library/tkinter.rst:854 msgid "scrollcommand" msgstr "" -#: library/tkinter.rst:859 +#: library/tkinter.rst:855 msgid "" "This is almost always the :meth:`!set` method of some scrollbar widget, but " "can be any widget method that takes a single argument." msgstr "" -#: library/tkinter.rst:862 +#: library/tkinter.rst:858 msgid "wrap" msgstr "" -#: library/tkinter.rst:863 +#: library/tkinter.rst:859 msgid "Must be one of: ``\"none\"``, ``\"char\"``, or ``\"word\"``." msgstr "" -#: library/tkinter.rst:868 +#: library/tkinter.rst:864 msgid "Bindings and Events" msgstr "" -#: library/tkinter.rst:874 +#: library/tkinter.rst:870 msgid "" "The bind method from the widget command allows you to watch for certain " "events and to have a callback function trigger when that event type occurs. " "The form of the bind method is::" msgstr "" -#: library/tkinter.rst:878 +#: library/tkinter.rst:874 msgid "def bind(self, sequence, func, add=''):" msgstr "" -#: library/tkinter.rst:880 +#: library/tkinter.rst:876 msgid "where:" msgstr "" -#: library/tkinter.rst:882 +#: library/tkinter.rst:878 msgid "sequence" msgstr "" -#: library/tkinter.rst:883 +#: library/tkinter.rst:879 msgid "" "is a string that denotes the target kind of event. (See the :manpage:" "`bind(3tk)` man page, and page 201 of John Ousterhout's book, :title-" "reference:`Tcl and the Tk Toolkit (2nd edition)`, for details)." msgstr "" -#: library/tkinter.rst:887 +#: library/tkinter.rst:883 msgid "func" msgstr "" -#: library/tkinter.rst:888 +#: library/tkinter.rst:884 msgid "" "is a Python function, taking one argument, to be invoked when the event " "occurs. An Event instance will be passed as the argument. (Functions " "deployed this way are commonly known as *callbacks*.)" msgstr "" -#: library/tkinter.rst:892 +#: library/tkinter.rst:888 msgid "add" msgstr "" -#: library/tkinter.rst:893 +#: library/tkinter.rst:889 msgid "" "is optional, either ``''`` or ``'+'``. Passing an empty string denotes that " "this binding is to replace any other bindings that this event is associated " @@ -1564,7 +1554,7 @@ msgid "" "of functions bound to this event type." msgstr "" -#: library/tkinter.rst:900 +#: library/tkinter.rst:896 msgid "" "def turn_red(self, event):\n" " event.widget[\"activeforeground\"] = \"red\"\n" @@ -1572,7 +1562,7 @@ msgid "" "self.button.bind(\"\", self.turn_red)" msgstr "" -#: library/tkinter.rst:905 +#: library/tkinter.rst:901 msgid "" "Notice how the widget field of the event is being accessed in the " "``turn_red()`` callback. This field contains the widget that caught the X " @@ -1581,209 +1571,209 @@ msgid "" "pages." msgstr "" -#: library/tkinter.rst:911 +#: library/tkinter.rst:907 msgid "Tkinter Event Field" msgstr "" -#: library/tkinter.rst:913 +#: library/tkinter.rst:909 msgid "%f" msgstr "" -#: library/tkinter.rst:913 +#: library/tkinter.rst:909 msgid "focus" msgstr "" -#: library/tkinter.rst:913 +#: library/tkinter.rst:909 msgid "%A" msgstr "" -#: library/tkinter.rst:913 +#: library/tkinter.rst:909 msgid "char" msgstr "" -#: library/tkinter.rst:915 +#: library/tkinter.rst:911 msgid "%h" msgstr "" -#: library/tkinter.rst:915 +#: library/tkinter.rst:911 msgid "height" msgstr "" -#: library/tkinter.rst:915 +#: library/tkinter.rst:911 msgid "%E" msgstr "" -#: library/tkinter.rst:915 +#: library/tkinter.rst:911 msgid "send_event" msgstr "" -#: library/tkinter.rst:917 +#: library/tkinter.rst:913 msgid "%k" msgstr "" -#: library/tkinter.rst:917 +#: library/tkinter.rst:913 msgid "keycode" msgstr "" -#: library/tkinter.rst:917 +#: library/tkinter.rst:913 msgid "%K" msgstr "" -#: library/tkinter.rst:917 +#: library/tkinter.rst:913 msgid "keysym" msgstr "" -#: library/tkinter.rst:919 +#: library/tkinter.rst:915 msgid "%s" msgstr "" -#: library/tkinter.rst:919 +#: library/tkinter.rst:915 msgid "state" msgstr "" -#: library/tkinter.rst:919 +#: library/tkinter.rst:915 msgid "%N" msgstr "" -#: library/tkinter.rst:919 +#: library/tkinter.rst:915 msgid "keysym_num" msgstr "" -#: library/tkinter.rst:921 +#: library/tkinter.rst:917 msgid "%t" msgstr "" -#: library/tkinter.rst:921 +#: library/tkinter.rst:917 msgid "time" msgstr "" -#: library/tkinter.rst:921 +#: library/tkinter.rst:917 msgid "%T" msgstr "" -#: library/tkinter.rst:921 +#: library/tkinter.rst:917 msgid "type" msgstr "" -#: library/tkinter.rst:923 +#: library/tkinter.rst:919 msgid "%w" msgstr "" -#: library/tkinter.rst:923 +#: library/tkinter.rst:919 msgid "width" msgstr "" -#: library/tkinter.rst:923 +#: library/tkinter.rst:919 msgid "%W" msgstr "" -#: library/tkinter.rst:923 +#: library/tkinter.rst:919 msgid "widget" msgstr "" -#: library/tkinter.rst:925 +#: library/tkinter.rst:921 msgid "%x" msgstr "" -#: library/tkinter.rst:925 +#: library/tkinter.rst:921 msgid "x" msgstr "" -#: library/tkinter.rst:925 +#: library/tkinter.rst:921 msgid "%X" msgstr "" -#: library/tkinter.rst:925 +#: library/tkinter.rst:921 msgid "x_root" msgstr "" -#: library/tkinter.rst:927 +#: library/tkinter.rst:923 msgid "%y" msgstr "" -#: library/tkinter.rst:927 +#: library/tkinter.rst:923 msgid "y" msgstr "" -#: library/tkinter.rst:927 +#: library/tkinter.rst:923 msgid "%Y" msgstr "" -#: library/tkinter.rst:927 +#: library/tkinter.rst:923 msgid "y_root" msgstr "" -#: library/tkinter.rst:932 +#: library/tkinter.rst:928 msgid "The index Parameter" msgstr "" -#: library/tkinter.rst:934 +#: library/tkinter.rst:930 msgid "" "A number of widgets require \"index\" parameters to be passed. These are " "used to point at a specific place in a Text widget, or to particular " "characters in an Entry widget, or to particular menu items in a Menu widget." msgstr "" -#: library/tkinter.rst:938 +#: library/tkinter.rst:934 msgid "Entry widget indexes (index, view index, etc.)" msgstr "" -#: library/tkinter.rst:939 +#: library/tkinter.rst:935 msgid "" "Entry widgets have options that refer to character positions in the text " "being displayed. You can use these :mod:`tkinter` functions to access these " "special points in text widgets:" msgstr "" -#: library/tkinter.rst:943 +#: library/tkinter.rst:939 msgid "Text widget indexes" msgstr "" -#: library/tkinter.rst:944 +#: library/tkinter.rst:940 msgid "" "The index notation for Text widgets is very rich and is best described in " "the Tk man pages." msgstr "" -#: library/tkinter.rst:947 +#: library/tkinter.rst:943 msgid "Menu indexes (menu.invoke(), menu.entryconfig(), etc.)" msgstr "" -#: library/tkinter.rst:948 +#: library/tkinter.rst:944 msgid "" "Some options and methods for menus manipulate specific menu entries. Anytime " "a menu index is needed for an option or a parameter, you may pass in:" msgstr "" -#: library/tkinter.rst:951 +#: library/tkinter.rst:947 msgid "" "an integer which refers to the numeric position of the entry in the widget, " "counted from the top, starting with 0;" msgstr "" -#: library/tkinter.rst:954 +#: library/tkinter.rst:950 msgid "" "the string ``\"active\"``, which refers to the menu position that is " "currently under the cursor;" msgstr "" -#: library/tkinter.rst:957 +#: library/tkinter.rst:953 msgid "the string ``\"last\"`` which refers to the last menu item;" msgstr "" -#: library/tkinter.rst:959 +#: library/tkinter.rst:955 msgid "" "An integer preceded by ``@``, as in ``@6``, where the integer is interpreted " "as a y pixel coordinate in the menu's coordinate system;" msgstr "" -#: library/tkinter.rst:962 +#: library/tkinter.rst:958 msgid "" "the string ``\"none\"``, which indicates no menu entry at all, most often " "used with menu.activate() to deactivate all entries, and finally," msgstr "" -#: library/tkinter.rst:965 +#: library/tkinter.rst:961 msgid "" "a text string that is pattern matched against the label of the menu entry, " "as scanned from the top of the menu to the bottom. Note that this index " @@ -1792,33 +1782,42 @@ msgid "" "above literals, instead." msgstr "" -#: library/tkinter.rst:973 +#: library/tkinter.rst:969 msgid "Images" msgstr "" -#: library/tkinter.rst:975 +#: library/tkinter.rst:971 msgid "" "Images of different formats can be created through the corresponding " "subclass of :class:`tkinter.Image`:" msgstr "" -#: library/tkinter.rst:978 +#: library/tkinter.rst:974 msgid ":class:`BitmapImage` for images in XBM format." msgstr "" -#: library/tkinter.rst:980 +#: library/tkinter.rst:976 msgid "" ":class:`PhotoImage` for images in PGM, PPM, GIF and PNG formats. The latter " "is supported starting with Tk 8.6." msgstr "" -#: library/tkinter.rst:983 +#: library/tkinter.rst:979 msgid "" "Either type of image is created through either the ``file`` or the ``data`` " "option (other options are available as well)." msgstr "" -#: library/tkinter.rst:986 +#: library/tkinter.rst:982 +msgid "" +"Added the :class:`!PhotoImage` method :meth:`!copy_replace` to copy a region " +"from one image to other image, possibly with pixel zooming and/or " +"subsampling. Add *from_coords* parameter to :class:`!PhotoImage` methods :" +"meth:`!copy`, :meth:`!zoom` and :meth:`!subsample`. Add *zoom* and " +"*subsample* parameters to :class:`!PhotoImage` method :meth:`!copy`." +msgstr "" + +#: library/tkinter.rst:991 msgid "" "The image object can then be used wherever an ``image`` option is supported " "by some widget (e.g. labels, buttons, menus). In these cases, Tk will not " @@ -1827,24 +1826,24 @@ msgid "" "empty box wherever the image was used." msgstr "" -#: library/tkinter.rst:994 +#: library/tkinter.rst:999 msgid "" "The `Pillow `_ package adds support for formats " "such as BMP, JPEG, TIFF, and WebP, among others." msgstr "" -#: library/tkinter.rst:1000 +#: library/tkinter.rst:1005 msgid "File Handlers" msgstr "" -#: library/tkinter.rst:1002 +#: library/tkinter.rst:1007 msgid "" "Tk allows you to register and unregister a callback function which will be " "called from the Tk mainloop when I/O is possible on a file descriptor. Only " "one handler may be registered per file descriptor. Example code::" msgstr "" -#: library/tkinter.rst:1006 +#: library/tkinter.rst:1011 msgid "" "import tkinter\n" "widget = tkinter.Tk()\n" @@ -1854,11 +1853,11 @@ msgid "" "widget.tk.deletefilehandler(file)" msgstr "" -#: library/tkinter.rst:1013 +#: library/tkinter.rst:1018 msgid "This feature is not available on Windows." msgstr "" -#: library/tkinter.rst:1015 +#: library/tkinter.rst:1020 msgid "" "Since you don't know how many bytes are available for reading, you may not " "want to use the :class:`~io.BufferedIOBase` or :class:`~io.TextIOBase` :meth:" @@ -1869,7 +1868,7 @@ msgid "" "maxbytecount)``." msgstr "" -#: library/tkinter.rst:1026 +#: library/tkinter.rst:1031 msgid "" "Registers the file handler callback function *func*. The *file* argument may " "either be an object with a :meth:`~io.IOBase.fileno` method (such as a file " @@ -1878,30 +1877,30 @@ msgid "" "as follows::" msgstr "" -#: library/tkinter.rst:1032 +#: library/tkinter.rst:1037 msgid "callback(file, mask)" msgstr "" -#: library/tkinter.rst:1037 +#: library/tkinter.rst:1042 msgid "Unregisters a file handler." msgstr "" -#: library/tkinter.rst:1044 +#: library/tkinter.rst:1049 msgid "Constants used in the *mask* arguments." msgstr "" -#: library/tkinter.rst:640 +#: library/tkinter.rst:636 msgid "packing (widgets)" msgstr "" -#: library/tkinter.rst:753 +#: library/tkinter.rst:749 msgid "window manager (widgets)" msgstr "" -#: library/tkinter.rst:870 +#: library/tkinter.rst:866 msgid "bind (widgets)" msgstr "" -#: library/tkinter.rst:870 +#: library/tkinter.rst:866 msgid "events (widgets)" msgstr "" diff --git a/library/tkinter.scrolledtext.po b/library/tkinter.scrolledtext.po index 32ae741f..abcf01fc 100644 --- a/library/tkinter.scrolledtext.po +++ b/library/tkinter.scrolledtext.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" diff --git a/library/tkinter.ttk.po b/library/tkinter.ttk.po index 50984372..3c28fc23 100644 --- a/library/tkinter.ttk.po +++ b/library/tkinter.ttk.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -1512,7 +1512,7 @@ msgid "" "Otherwise, sets the options to the corresponding values." msgstr "" -#: library/tkinter.ttk.rst:1042 library/tkinter.ttk.rst:1520 +#: library/tkinter.ttk.rst:1042 library/tkinter.ttk.rst:1578 msgid "The valid options/values are:" msgstr "" @@ -2049,71 +2049,72 @@ msgstr "" #: library/tkinter.ttk.rst:1393 msgid "" "Create a new element in the current theme, of the given *etype* which is " -"expected to be either \"image\" or \"from\"." +"expected to be either \"image\", \"from\" or \"vsapi\". The latter is only " +"available in Tk 8.6 on Windows." msgstr "" -#: library/tkinter.ttk.rst:1396 +#: library/tkinter.ttk.rst:1397 msgid "" "If \"image\" is used, *args* should contain the default image name followed " "by statespec/value pairs (this is the imagespec), and *kw* may have the " "following options:" msgstr "" -#: library/tkinter.ttk.rst:1400 +#: library/tkinter.ttk.rst:1401 msgid "border=padding" msgstr "" -#: library/tkinter.ttk.rst:1401 +#: library/tkinter.ttk.rst:1402 msgid "" "padding is a list of up to four integers, specifying the left, top, right, " "and bottom borders, respectively." msgstr "" -#: library/tkinter.ttk.rst:1404 +#: library/tkinter.ttk.rst:1479 msgid "height=height" msgstr "" -#: library/tkinter.ttk.rst:1405 +#: library/tkinter.ttk.rst:1406 msgid "" "Specifies a minimum height for the element. If less than zero, the base " "image's height is used as a default." msgstr "" -#: library/tkinter.ttk.rst:1408 +#: library/tkinter.ttk.rst:1453 msgid "padding=padding" msgstr "" -#: library/tkinter.ttk.rst:1409 +#: library/tkinter.ttk.rst:1410 msgid "" "Specifies the element's interior padding. Defaults to border's value if not " "specified." msgstr "" -#: library/tkinter.ttk.rst:1412 +#: library/tkinter.ttk.rst:1413 msgid "sticky=spec" msgstr "" -#: library/tkinter.ttk.rst:1413 +#: library/tkinter.ttk.rst:1414 msgid "" "Specifies how the image is placed within the final parcel. spec contains " "zero or more characters \"n\", \"s\", \"w\", or \"e\"." msgstr "" -#: library/tkinter.ttk.rst:1416 +#: library/tkinter.ttk.rst:1471 msgid "width=width" msgstr "" -#: library/tkinter.ttk.rst:1417 +#: library/tkinter.ttk.rst:1418 msgid "" "Specifies a minimum width for the element. If less than zero, the base " "image's width is used as a default." msgstr "" -#: library/tkinter.ttk.rst:1437 +#: library/tkinter.ttk.rst:1438 library/tkinter.ttk.rst:1483 msgid "Example::" msgstr "" -#: library/tkinter.ttk.rst:1422 +#: library/tkinter.ttk.rst:1423 msgid "" "img1 = tkinter.PhotoImage(master=root, file='button.png')\n" "img1 = tkinter.PhotoImage(master=root, file='button-pressed.png')\n" @@ -2124,7 +2125,7 @@ msgid "" " border=(2, 4), sticky='we')" msgstr "" -#: library/tkinter.ttk.rst:1430 +#: library/tkinter.ttk.rst:1431 msgid "" "If \"from\" is used as the value of *etype*, :meth:`element_create` will " "clone an existing element. *args* is expected to contain a themename, from " @@ -2133,25 +2134,91 @@ msgid "" "used. *kw* is discarded." msgstr "" -#: library/tkinter.ttk.rst:1439 +#: library/tkinter.ttk.rst:1440 msgid "" "style = ttk.Style(root)\n" "style.element_create('plain.background', 'from', 'default')" msgstr "" -#: library/tkinter.ttk.rst:1445 +#: library/tkinter.ttk.rst:1443 +msgid "" +"If \"vsapi\" is used as the value of *etype*, :meth:`element_create` will " +"create a new element in the current theme whose visual appearance is drawn " +"using the Microsoft Visual Styles API which is responsible for the themed " +"styles on Windows XP and Vista. *args* is expected to contain the Visual " +"Styles class and part as given in the Microsoft documentation followed by an " +"optional sequence of tuples of ttk states and the corresponding Visual " +"Styles API state value. *kw* may have the following options:" +msgstr "" + +#: library/tkinter.ttk.rst:1454 +msgid "" +"Specify the element's interior padding. *padding* is a list of up to four " +"integers specifying the left, top, right and bottom padding quantities " +"respectively. If fewer than four elements are specified, bottom defaults to " +"top, right defaults to left, and top defaults to left. In other words, a " +"list of three numbers specify the left, vertical, and right padding; a list " +"of two numbers specify the horizontal and the vertical padding; a single " +"number specifies the same padding all the way around the widget. This option " +"may not be mixed with any other options." +msgstr "" + +#: library/tkinter.ttk.rst:1465 +msgid "margins=padding" +msgstr "" + +#: library/tkinter.ttk.rst:1466 +msgid "" +"Specifies the elements exterior padding. *padding* is a list of up to four " +"integers specifying the left, top, right and bottom padding quantities " +"respectively. This option may not be mixed with any other options." +msgstr "" + +#: library/tkinter.ttk.rst:1472 +msgid "" +"Specifies the width for the element. If this option is set then the Visual " +"Styles API will not be queried for the recommended size or the part. If this " +"option is set then *height* should also be set. The *width* and *height* " +"options cannot be mixed with the *padding* or *margins* options." +msgstr "" + +#: library/tkinter.ttk.rst:1480 +msgid "Specifies the height of the element. See the comments for *width*." +msgstr "" + +#: library/tkinter.ttk.rst:1485 +msgid "" +"style = ttk.Style(root)\n" +"style.element_create('pin', 'vsapi', 'EXPLORERBAR', 3, [\n" +" ('pressed', '!selected', 3),\n" +" ('active', '!selected', 2),\n" +" ('pressed', 'selected', 6),\n" +" ('active', 'selected', 5),\n" +" ('selected', 4),\n" +" ('', 1)])\n" +"style.layout('Explorer.Pin',\n" +" [('Explorer.Pin.pin', {'sticky': 'news'})])\n" +"pin = ttk.Checkbutton(style='Explorer.Pin')\n" +"pin.pack(expand=True, fill='both')" +msgstr "" + +#: library/tkinter.ttk.rst:1498 +msgid "Added support of the \"vsapi\" element factory." +msgstr "" + +#: library/tkinter.ttk.rst:1503 msgid "Returns the list of elements defined in the current theme." msgstr "" -#: library/tkinter.ttk.rst:1450 +#: library/tkinter.ttk.rst:1508 msgid "Returns the list of *elementname*'s options." msgstr "" -#: library/tkinter.ttk.rst:1455 +#: library/tkinter.ttk.rst:1513 msgid "Create a new theme." msgstr "" -#: library/tkinter.ttk.rst:1457 +#: library/tkinter.ttk.rst:1515 msgid "" "It is an error if *themename* already exists. If *parent* is specified, the " "new theme will inherit styles, elements and layouts from the parent theme. " @@ -2159,13 +2226,13 @@ msgid "" "for :meth:`theme_settings`." msgstr "" -#: library/tkinter.ttk.rst:1465 +#: library/tkinter.ttk.rst:1523 msgid "" "Temporarily sets the current theme to *themename*, apply specified " "*settings* and then restore the previous theme." msgstr "" -#: library/tkinter.ttk.rst:1468 +#: library/tkinter.ttk.rst:1526 msgid "" "Each key in *settings* is a style and each value may contain the keys " "'configure', 'map', 'layout' and 'element create' and they are expected to " @@ -2174,11 +2241,11 @@ msgid "" "respectively." msgstr "" -#: library/tkinter.ttk.rst:1474 +#: library/tkinter.ttk.rst:1532 msgid "As an example, let's change the Combobox for the default theme a bit::" msgstr "" -#: library/tkinter.ttk.rst:1476 +#: library/tkinter.ttk.rst:1534 msgid "" "from tkinter import ttk\n" "import tkinter\n" @@ -2204,22 +2271,22 @@ msgid "" "root.mainloop()" msgstr "" -#: library/tkinter.ttk.rst:1502 +#: library/tkinter.ttk.rst:1560 msgid "Returns a list of all known themes." msgstr "" -#: library/tkinter.ttk.rst:1507 +#: library/tkinter.ttk.rst:1565 msgid "" "If *themename* is not given, returns the theme in use. Otherwise, sets the " "current theme to *themename*, refreshes all widgets and emits a " "<> event." msgstr "" -#: library/tkinter.ttk.rst:1513 +#: library/tkinter.ttk.rst:1571 msgid "Layouts" msgstr "" -#: library/tkinter.ttk.rst:1515 +#: library/tkinter.ttk.rst:1573 msgid "" "A layout can be just ``None``, if it takes no options, or a dict of options " "specifying how to arrange the element. The layout mechanism uses a " @@ -2227,40 +2294,40 @@ msgid "" "each element is allocated a parcel." msgstr "" -#: library/tkinter.ttk.rst:1522 +#: library/tkinter.ttk.rst:1580 msgid "*side*: whichside" msgstr "" -#: library/tkinter.ttk.rst:1523 +#: library/tkinter.ttk.rst:1581 msgid "" "Specifies which side of the cavity to place the element; one of top, right, " "bottom or left. If omitted, the element occupies the entire cavity." msgstr "" -#: library/tkinter.ttk.rst:1527 +#: library/tkinter.ttk.rst:1585 msgid "*sticky*: nswe" msgstr "" -#: library/tkinter.ttk.rst:1528 +#: library/tkinter.ttk.rst:1586 msgid "Specifies where the element is placed inside its allocated parcel." msgstr "" -#: library/tkinter.ttk.rst:1530 +#: library/tkinter.ttk.rst:1588 msgid "*unit*: 0 or 1" msgstr "" -#: library/tkinter.ttk.rst:1531 +#: library/tkinter.ttk.rst:1589 msgid "" "If set to 1, causes the element and all of its descendants to be treated as " "a single element for the purposes of :meth:`Widget.identify` et al. It's " "used for things like scrollbar thumbs with grips." msgstr "" -#: library/tkinter.ttk.rst:1535 +#: library/tkinter.ttk.rst:1593 msgid "*children*: [sublayout... ]" msgstr "" -#: library/tkinter.ttk.rst:1536 +#: library/tkinter.ttk.rst:1594 msgid "" "Specifies a list of elements to place inside the element. Each element is a " "tuple (or other sequence type) where the first item is the layout name, and " diff --git a/library/token.po b/library/token.po index 42eaf08d..3b29b3b0 100644 --- a/library/token.po +++ b/library/token.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -40,276 +40,436 @@ msgid "" "functions. The functions mirror definitions in the Python C header files." msgstr "" -#: library/token.rst:25 +#: library/token.rst:22 +msgid "" +"Note that a token's value may depend on tokenizer options. For example, a " +"``\"+\"`` token may be reported as either :data:`PLUS` or :data:`OP`, or a " +"``\"match\"`` token may be either :data:`NAME` or :data:`SOFT_KEYWORD`." +msgstr "" + +#: library/token.rst:29 msgid "" "Dictionary mapping the numeric values of the constants defined in this " "module back to name strings, allowing more human-readable representation of " "parse trees to be generated." msgstr "" -#: library/token.rst:32 +#: library/token.rst:36 msgid "Return ``True`` for terminal token values." msgstr "" -#: library/token.rst:37 +#: library/token.rst:41 msgid "Return ``True`` for non-terminal token values." msgstr "" -#: library/token.rst:42 +#: library/token.rst:46 msgid "Return ``True`` if *x* is the marker indicating the end of input." msgstr "" -#: library/token.rst:45 +#: library/token.rst:49 msgid "The token constants are:" msgstr "" -#: library/token-list.inc:18 -msgid "Token value for ``\"(\"``." +#: library/token.rst:53 +msgid "" +"Token value that indicates an :ref:`identifier `. Note that " +"keywords are also initially tokenized an ``NAME`` tokens." msgstr "" -#: library/token-list.inc:22 -msgid "Token value for ``\")\"``." +#: library/token.rst:58 +msgid "Token value that indicates a :ref:`numeric literal `" msgstr "" -#: library/token-list.inc:26 -msgid "Token value for ``\"[\"``." +#: library/token.rst:62 +msgid "" +"Token value that indicates a :ref:`string or byte literal `, " +"excluding :ref:`formatted string literals `. The token string is " +"not interpreted: it includes the surrounding quotation marks and the prefix " +"(if given); backslashes are included literally, without processing escape " +"sequences." msgstr "" -#: library/token-list.inc:30 -msgid "Token value for ``\"]\"``." +#: library/token.rst:70 +msgid "" +"A generic token value that indicates an :ref:`operator ` or :ref:" +"`delimiter `." msgstr "" -#: library/token-list.inc:34 -msgid "Token value for ``\":\"``." +#: library/token.rst:75 +msgid "" +"This value is only reported by the :mod:`tokenize` module. Internally, the " +"tokenizer uses :ref:`exact token types ` instead." msgstr "" -#: library/token-list.inc:38 -msgid "Token value for ``\",\"``." +#: library/token.rst:81 +msgid "" +"Token value used to indicate a comment. The parser ignores :data:`!COMMENT` " +"tokens." msgstr "" -#: library/token-list.inc:42 -msgid "Token value for ``\";\"``." +#: library/token.rst:86 +msgid "" +"Token value that indicates the end of a :ref:`logical line `." msgstr "" -#: library/token-list.inc:46 -msgid "Token value for ``\"+\"``." +#: library/token.rst:90 +msgid "" +"Token value used to indicate a non-terminating newline. :data:`!NL` tokens " +"are generated when a logical line of code is continued over multiple " +"physical lines. The parser ignores :data:`!NL` tokens." msgstr "" -#: library/token-list.inc:50 -msgid "Token value for ``\"-\"``." +#: library/token.rst:96 +msgid "" +"Token value used at the beginning of a :ref:`logical line ` " +"to indicate the start of an :ref:`indented block `." msgstr "" -#: library/token-list.inc:54 -msgid "Token value for ``\"*\"``." +#: library/token.rst:101 +msgid "" +"Token value used at the beginning of a :ref:`logical line ` " +"to indicate the end of an :ref:`indented block `." msgstr "" -#: library/token-list.inc:58 -msgid "Token value for ``\"/\"``." +#: library/token.rst:106 +msgid "" +"Token value used to indicate the beginning of an :ref:`f-string literal `." msgstr "" -#: library/token-list.inc:62 -msgid "Token value for ``\"|\"``." +#: library/token.rst:111 +msgid "" +"The token string includes the prefix and the opening quote(s), but none of " +"the contents of the literal." msgstr "" -#: library/token-list.inc:66 -msgid "Token value for ``\"&\"``." +#: library/token.rst:116 +msgid "" +"Token value used for literal text inside an :ref:`f-string literal `, including format specifications." msgstr "" -#: library/token-list.inc:70 -msgid "Token value for ``\"<\"``." +#: library/token.rst:121 +msgid "" +"Replacement fields (that is, the non-literal parts of f-strings) use the " +"same tokens as other expressions, and are delimited by :data:`LBRACE`, :data:" +"`RBRACE`, :data:`EXCLAMATION` and :data:`COLON` tokens." msgstr "" -#: library/token-list.inc:74 -msgid "Token value for ``\">\"``." +#: library/token.rst:128 +msgid "Token value used to indicate the end of a :ref:`f-string `." msgstr "" -#: library/token-list.inc:78 -msgid "Token value for ``\"=\"``." +#: library/token.rst:132 +msgid "The token string contains the closing quote(s)." msgstr "" -#: library/token-list.inc:82 -msgid "Token value for ``\".\"``." +#: library/token.rst:136 +msgid "Token value that indicates the end of input." msgstr "" -#: library/token-list.inc:86 -msgid "Token value for ``\"%\"``." +#: library/token.rst:140 +msgid "" +"Token value that indicates the encoding used to decode the source bytes into " +"text. The first token returned by :func:`tokenize.tokenize` will always be " +"an ``ENCODING`` token." msgstr "" -#: library/token-list.inc:90 -msgid "Token value for ``\"{\"``." +#: library/token.rst:146 +msgid "" +"This token type isn't used by the C tokenizer but is needed for the :mod:" +"`tokenize` module." msgstr "" -#: library/token-list.inc:94 -msgid "Token value for ``\"}\"``." +#: library/token.rst:150 +msgid "" +"The following token types are not produced by the :mod:`tokenize` module, " +"and are defined for special uses in the tokenizer or parser:" msgstr "" -#: library/token-list.inc:98 -msgid "Token value for ``\"==\"``." +#: library/token.rst:155 +msgid "" +"Token value indicating that a ``type: ignore`` comment was recognized. Such " +"tokens are produced instead of regular :data:`COMMENT` tokens only with the :" +"data:`~ast.PyCF_TYPE_COMMENTS` flag." msgstr "" -#: library/token-list.inc:102 -msgid "Token value for ``\"!=\"``." +#: library/token.rst:161 +msgid "" +"Token value indicating that a type comment was recognized. Such tokens are " +"produced instead of regular :data:`COMMENT` tokens only with the :data:`~ast." +"PyCF_TYPE_COMMENTS` flag." msgstr "" -#: library/token-list.inc:106 -msgid "Token value for ``\"<=\"``." +#: library/token.rst:167 +msgid "Token value indicating a :ref:`soft keyword `." msgstr "" -#: library/token-list.inc:110 -msgid "Token value for ``\">=\"``." +#: library/token.rst:169 +msgid "" +"The tokenizer never produces this value. To check for a soft keyword, pass " +"a :data:`NAME` token's string to :func:`keyword.issoftkeyword`." msgstr "" -#: library/token-list.inc:114 -msgid "Token value for ``\"~\"``." +#: library/token.rst:175 +msgid "Token value used to indicate wrong input." msgstr "" -#: library/token-list.inc:118 -msgid "Token value for ``\"^\"``." +#: library/token.rst:177 +msgid "" +"The :mod:`tokenize` module generally indicates errors by raising exceptions " +"instead of emitting this token. It can also emit tokens such as :data:`OP` " +"or :data:`NAME` with strings that are later rejected by the parser." msgstr "" -#: library/token-list.inc:122 -msgid "Token value for ``\"<<\"``." +#: library/token.rst:185 +msgid "" +"The remaining tokens represent specific :ref:`operators ` and :" +"ref:`delimiters `. (The :mod:`tokenize` module reports these as :" +"data:`OP`; see ``exact_type`` in the :mod:`tokenize` documentation for " +"details.)" msgstr "" -#: library/token-list.inc:126 -msgid "Token value for ``\">>\"``." +#: library/token-list.inc:7 +msgid "Token" msgstr "" -#: library/token-list.inc:130 -msgid "Token value for ``\"**\"``." +#: library/token-list.inc:8 +msgid "Value" msgstr "" -#: library/token-list.inc:134 -msgid "Token value for ``\"+=\"``." +#: library/token-list.inc:10 +msgid "``\"(\"``" msgstr "" -#: library/token-list.inc:138 -msgid "Token value for ``\"-=\"``." +#: library/token-list.inc:12 +msgid "``\")\"``" msgstr "" -#: library/token-list.inc:142 -msgid "Token value for ``\"*=\"``." +#: library/token-list.inc:14 +msgid "``\"[\"``" msgstr "" -#: library/token-list.inc:146 -msgid "Token value for ``\"/=\"``." +#: library/token-list.inc:16 +msgid "``\"]\"``" msgstr "" -#: library/token-list.inc:150 -msgid "Token value for ``\"%=\"``." +#: library/token-list.inc:18 +msgid "``\":\"``" msgstr "" -#: library/token-list.inc:154 -msgid "Token value for ``\"&=\"``." +#: library/token-list.inc:20 +msgid "``\",\"``" msgstr "" -#: library/token-list.inc:158 -msgid "Token value for ``\"|=\"``." +#: library/token-list.inc:22 +msgid "``\";\"``" msgstr "" -#: library/token-list.inc:162 -msgid "Token value for ``\"^=\"``." +#: library/token-list.inc:24 +msgid "``\"+\"``" msgstr "" -#: library/token-list.inc:166 -msgid "Token value for ``\"<<=\"``." +#: library/token-list.inc:26 +msgid "``\"-\"``" msgstr "" -#: library/token-list.inc:170 -msgid "Token value for ``\">>=\"``." +#: library/token-list.inc:28 +msgid "``\"*\"``" msgstr "" -#: library/token-list.inc:174 -msgid "Token value for ``\"**=\"``." +#: library/token-list.inc:30 +msgid "``\"/\"``" msgstr "" -#: library/token-list.inc:178 -msgid "Token value for ``\"//\"``." +#: library/token-list.inc:32 +msgid "``\"|\"``" msgstr "" -#: library/token-list.inc:182 -msgid "Token value for ``\"//=\"``." +#: library/token-list.inc:34 +msgid "``\"&\"``" msgstr "" -#: library/token-list.inc:186 -msgid "Token value for ``\"@\"``." +#: library/token-list.inc:36 +msgid "``\"<\"``" msgstr "" -#: library/token-list.inc:190 -msgid "Token value for ``\"@=\"``." +#: library/token-list.inc:38 +msgid "``\">\"``" msgstr "" -#: library/token-list.inc:194 -msgid "Token value for ``\"->\"``." +#: library/token-list.inc:40 +msgid "``\"=\"``" msgstr "" -#: library/token-list.inc:198 -msgid "Token value for ``\"...\"``." +#: library/token-list.inc:42 +msgid "``\".\"``" msgstr "" -#: library/token-list.inc:202 -msgid "Token value for ``\":=\"``." +#: library/token-list.inc:44 +msgid "``\"%\"``" msgstr "" -#: library/token-list.inc:206 -msgid "Token value for ``\"!\"``." +#: library/token-list.inc:46 +msgid "``\"{\"``" msgstr "" -#: library/token.rst:49 -msgid "" -"The following token type values aren't used by the C tokenizer but are " -"needed for the :mod:`tokenize` module." +#: library/token-list.inc:48 +msgid "``\"}\"``" msgstr "" -#: library/token.rst:55 -msgid "Token value used to indicate a comment." +#: library/token-list.inc:50 +msgid "``\"==\"``" msgstr "" -#: library/token.rst:61 -msgid "" -"Token value used to indicate a non-terminating newline. The :data:`NEWLINE` " -"token indicates the end of a logical line of Python code; ``NL`` tokens are " -"generated when a logical line of code is continued over multiple physical " -"lines." +#: library/token-list.inc:52 +msgid "``\"!=\"``" msgstr "" -#: library/token.rst:69 -msgid "" -"Token value that indicates the encoding used to decode the source bytes into " -"text. The first token returned by :func:`tokenize.tokenize` will always be " -"an ``ENCODING`` token." +#: library/token-list.inc:54 +msgid "``\"<=\"``" msgstr "" -#: library/token.rst:77 -msgid "" -"Token value indicating that a type comment was recognized. Such tokens are " -"only produced when :func:`ast.parse` is invoked with ``type_comments=True``." +#: library/token-list.inc:56 +msgid "``\">=\"``" msgstr "" -#: library/token.rst:84 +#: library/token-list.inc:58 +msgid "``\"~\"``" +msgstr "" + +#: library/token-list.inc:60 +msgid "``\"^\"``" +msgstr "" + +#: library/token-list.inc:62 +msgid "``\"<<\"``" +msgstr "" + +#: library/token-list.inc:64 +msgid "``\">>\"``" +msgstr "" + +#: library/token-list.inc:66 +msgid "``\"**\"``" +msgstr "" + +#: library/token-list.inc:68 +msgid "``\"+=\"``" +msgstr "" + +#: library/token-list.inc:70 +msgid "``\"-=\"``" +msgstr "" + +#: library/token-list.inc:72 +msgid "``\"*=\"``" +msgstr "" + +#: library/token-list.inc:74 +msgid "``\"/=\"``" +msgstr "" + +#: library/token-list.inc:76 +msgid "``\"%=\"``" +msgstr "" + +#: library/token-list.inc:78 +msgid "``\"&=\"``" +msgstr "" + +#: library/token-list.inc:80 +msgid "``\"|=\"``" +msgstr "" + +#: library/token-list.inc:82 +msgid "``\"^=\"``" +msgstr "" + +#: library/token-list.inc:84 +msgid "``\"<<=\"``" +msgstr "" + +#: library/token-list.inc:86 +msgid "``\">>=\"``" +msgstr "" + +#: library/token-list.inc:88 +msgid "``\"**=\"``" +msgstr "" + +#: library/token-list.inc:90 +msgid "``\"//\"``" +msgstr "" + +#: library/token-list.inc:92 +msgid "``\"//=\"``" +msgstr "" + +#: library/token-list.inc:94 +msgid "``\"@\"``" +msgstr "" + +#: library/token-list.inc:96 +msgid "``\"@=\"``" +msgstr "" + +#: library/token-list.inc:98 +msgid "``\"->\"``" +msgstr "" + +#: library/token-list.inc:100 +msgid "``\"...\"``" +msgstr "" + +#: library/token-list.inc:102 +msgid "``\":=\"``" +msgstr "" + +#: library/token-list.inc:104 +msgid "``\"!\"``" +msgstr "" + +#: library/token.rst:193 +msgid "The following non-token constants are provided:" +msgstr "" + +#: library/token.rst:197 +msgid "The number of token types defined in this module." +msgstr "" + +#: library/token.rst:204 msgid "" "A dictionary mapping the string representation of a token to its numeric " "code." msgstr "" -#: library/token.rst:89 -msgid "Added :data:`AWAIT` and :data:`ASYNC` tokens." +#: library/token.rst:209 +msgid "Added :data:`!AWAIT` and :data:`!ASYNC` tokens." msgstr "" -#: library/token.rst:92 +#: library/token.rst:212 msgid "Added :data:`COMMENT`, :data:`NL` and :data:`ENCODING` tokens." msgstr "" -#: library/token.rst:95 +#: library/token.rst:215 msgid "" -"Removed :data:`AWAIT` and :data:`ASYNC` tokens. \"async\" and \"await\" are " -"now tokenized as :data:`NAME` tokens." +"Removed :data:`!AWAIT` and :data:`!ASYNC` tokens. \"async\" and \"await\" " +"are now tokenized as :data:`NAME` tokens." msgstr "" -#: library/token.rst:99 +#: library/token.rst:219 msgid "" "Added :data:`TYPE_COMMENT`, :data:`TYPE_IGNORE`, :data:`COLONEQUAL`. Added :" -"data:`AWAIT` and :data:`ASYNC` tokens back (they're needed to support " +"data:`!AWAIT` and :data:`!ASYNC` tokens back (they're needed to support " "parsing older Python versions for :func:`ast.parse` with ``feature_version`` " "set to 6 or lower)." msgstr "" + +#: library/token.rst:225 +msgid "Added :data:`EXCLAMATION`." +msgstr "" + +#: library/token.rst:228 +msgid "Removed :data:`!AWAIT` and :data:`!ASYNC` tokens again." +msgstr "" diff --git a/library/tokenize.po b/library/tokenize.po index f27b18a5..3f0f76d0 100644 --- a/library/tokenize.po +++ b/library/tokenize.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" diff --git a/library/tomllib.po b/library/tomllib.po index 9ba6d425..bd55d585 100644 --- a/library/tomllib.po +++ b/library/tomllib.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" diff --git a/library/trace.po b/library/trace.po index 38f35bfd..21ed4586 100644 --- a/library/trace.po +++ b/library/trace.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -231,7 +231,7 @@ msgstr "" msgid "Merge in data from another :class:`CoverageResults` object." msgstr "" -#: library/trace.rst:192 +#: library/trace.rst:193 msgid "" "Write coverage results. Set *show_missing* to show lines that had no hits. " "Set *summary* to include in the output the coverage summary per module. " @@ -240,11 +240,22 @@ msgid "" "directory." msgstr "" -#: library/trace.rst:198 +#: library/trace.rst:199 +msgid "" +"If *ignore_missing_files* is ``True``, coverage counts for files that no " +"longer exist are silently ignored. Otherwise, a missing file will raise a :" +"exc:`FileNotFoundError`." +msgstr "" + +#: library/trace.rst:203 +msgid "Added *ignore_missing_files* parameter." +msgstr "" + +#: library/trace.rst:206 msgid "A simple example demonstrating the use of the programmatic interface::" msgstr "" -#: library/trace.rst:200 +#: library/trace.rst:208 msgid "" "import sys\n" "import trace\n" diff --git a/library/traceback.po b/library/traceback.po index 7b8a3c4e..abaeacca 100644 --- a/library/traceback.po +++ b/library/traceback.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -149,11 +149,11 @@ msgid "" "when printing an unhandled exception." msgstr "" -#: library/traceback.rst:208 +#: library/traceback.rst:215 msgid "The *etype* argument is ignored and inferred from the type of *value*." msgstr "" -#: library/traceback.rst:191 +#: library/traceback.rst:195 msgid "" "The *etype* parameter has been renamed to *exc* and is now positional-only." msgstr "" @@ -237,13 +237,24 @@ msgid "" "ignored in order to provide backwards compatibility." msgstr "" -#: library/traceback.rst:195 +#: library/traceback.rst:422 +msgid "" +"When *show_group* is ``True``, and the exception is an instance of :exc:" +"`BaseExceptionGroup`, the nested exceptions are included as well, " +"recursively, with indentation relative to their nesting depth." +msgstr "" + +#: library/traceback.rst:199 msgid "" "The returned list now includes any :attr:`notes ` " "attached to the exception." msgstr "" -#: library/traceback.rst:202 +#: library/traceback.rst:203 +msgid "*show_group* parameter was added." +msgstr "" + +#: library/traceback.rst:209 msgid "" "Format a stack trace and the exception information. The arguments have the " "same meaning as the corresponding arguments to :func:`print_exception`. The " @@ -252,52 +263,52 @@ msgid "" "printed, exactly the same text is printed as does :func:`print_exception`." msgstr "" -#: library/traceback.rst:211 +#: library/traceback.rst:218 msgid "" "This function's behavior and signature were modified to match :func:" "`print_exception`." msgstr "" -#: library/traceback.rst:218 +#: library/traceback.rst:225 msgid "" "This is like ``print_exc(limit)`` but returns a string instead of printing " "to a file." msgstr "" -#: library/traceback.rst:224 +#: library/traceback.rst:231 msgid "A shorthand for ``format_list(extract_tb(tb, limit))``." msgstr "" -#: library/traceback.rst:229 +#: library/traceback.rst:236 msgid "A shorthand for ``format_list(extract_stack(f, limit))``." msgstr "" -#: library/traceback.rst:233 +#: library/traceback.rst:240 msgid "" "Clears the local variables of all the stack frames in a :ref:`traceback " "` *tb* by calling the :meth:`~frame.clear` method of " "each :ref:`frame object `." msgstr "" -#: library/traceback.rst:242 +#: library/traceback.rst:249 msgid "" "Walk a stack following :attr:`f.f_back ` from the given frame, " "yielding the frame and line number for each frame. If *f* is ``None``, the " "current stack is used. This helper is used with :meth:`StackSummary.extract`." msgstr "" -#: library/traceback.rst:251 +#: library/traceback.rst:258 msgid "" "Walk a traceback following :attr:`~traceback.tb_next` yielding the frame and " "line number for each frame. This helper is used with :meth:`StackSummary." "extract`." msgstr "" -#: library/traceback.rst:259 +#: library/traceback.rst:266 msgid ":class:`!TracebackException` Objects" msgstr "" -#: library/traceback.rst:263 +#: library/traceback.rst:270 msgid "" ":class:`!TracebackException` objects are created from actual exceptions to " "capture data for later printing. They offer a more lightweight method of " @@ -307,14 +318,14 @@ msgid "" "module-level functions described above." msgstr "" -#: library/traceback.rst:272 +#: library/traceback.rst:279 msgid "" "Capture an exception for later rendering. The meaning of *limit*, " "*lookup_lines* and *capture_locals* are as for the :class:`StackSummary` " "class." msgstr "" -#: library/traceback.rst:276 +#: library/traceback.rst:283 msgid "" "If *compact* is true, only data that is required by :class:`!" "TracebackException`'s :meth:`format` method is saved in the class " @@ -322,12 +333,12 @@ msgid "" "if :attr:`__cause__` is ``None`` and :attr:`__suppress_context__` is false." msgstr "" -#: library/traceback.rst:375 +#: library/traceback.rst:390 msgid "" "Note that when locals are captured, they are also shown in the traceback." msgstr "" -#: library/traceback.rst:284 +#: library/traceback.rst:291 msgid "" "*max_group_width* and *max_group_depth* control the formatting of exception " "groups (see :exc:`BaseExceptionGroup`). The depth refers to the nesting " @@ -336,153 +347,162 @@ msgid "" "limit is exceeded." msgstr "" -#: library/traceback.rst:290 +#: library/traceback.rst:297 msgid "Added the *compact* parameter." msgstr "" -#: library/traceback.rst:293 +#: library/traceback.rst:300 msgid "Added the *max_group_width* and *max_group_depth* parameters." msgstr "" -#: library/traceback.rst:298 +#: library/traceback.rst:305 msgid "" "A :class:`!TracebackException` of the original :attr:`~BaseException." "__cause__`." msgstr "" -#: library/traceback.rst:303 +#: library/traceback.rst:310 msgid "" "A :class:`!TracebackException` of the original :attr:`~BaseException." "__context__`." msgstr "" -#: library/traceback.rst:308 +#: library/traceback.rst:315 msgid "" "If ``self`` represents an :exc:`ExceptionGroup`, this field holds a list of :" "class:`!TracebackException` instances representing the nested exceptions. " "Otherwise it is ``None``." msgstr "" -#: library/traceback.rst:316 +#: library/traceback.rst:323 msgid "" "The :attr:`~BaseException.__suppress_context__` value from the original " "exception." msgstr "" -#: library/traceback.rst:321 +#: library/traceback.rst:328 msgid "" "The :attr:`~BaseException.__notes__` value from the original exception, or " "``None`` if the exception does not have any notes. If it is not ``None`` is " "it formatted in the traceback after the exception string." msgstr "" -#: library/traceback.rst:330 +#: library/traceback.rst:337 msgid "A :class:`StackSummary` representing the traceback." msgstr "" -#: library/traceback.rst:334 +#: library/traceback.rst:341 msgid "The class of the original traceback." msgstr "" -#: library/traceback.rst:338 +#: library/traceback.rst:347 +msgid "String display of the class of the original exception." +msgstr "" + +#: library/traceback.rst:353 msgid "For syntax errors - the file name where the error occurred." msgstr "" -#: library/traceback.rst:342 +#: library/traceback.rst:357 msgid "For syntax errors - the line number where the error occurred." msgstr "" -#: library/traceback.rst:346 +#: library/traceback.rst:361 msgid "" "For syntax errors - the end line number where the error occurred. Can be " "``None`` if not present." msgstr "" -#: library/traceback.rst:353 +#: library/traceback.rst:368 msgid "For syntax errors - the text where the error occurred." msgstr "" -#: library/traceback.rst:357 +#: library/traceback.rst:372 msgid "For syntax errors - the offset into the text where the error occurred." msgstr "" -#: library/traceback.rst:361 +#: library/traceback.rst:376 msgid "" "For syntax errors - the end offset into the text where the error occurred. " "Can be ``None`` if not present." msgstr "" -#: library/traceback.rst:368 +#: library/traceback.rst:383 msgid "For syntax errors - the compiler error message." msgstr "" -#: library/traceback.rst:372 +#: library/traceback.rst:387 msgid "" "Capture an exception for later rendering. *limit*, *lookup_lines* and " "*capture_locals* are as for the :class:`StackSummary` class." msgstr "" -#: library/traceback.rst:379 +#: library/traceback.rst:394 msgid "" "Print to *file* (default ``sys.stderr``) the exception information returned " "by :meth:`format`." msgstr "" -#: library/traceback.rst:386 +#: library/traceback.rst:401 msgid "Format the exception." msgstr "" -#: library/traceback.rst:388 +#: library/traceback.rst:403 msgid "" "If *chain* is not ``True``, :attr:`__cause__` and :attr:`__context__` will " "not be formatted." msgstr "" -#: library/traceback.rst:391 +#: library/traceback.rst:406 msgid "" "The return value is a generator of strings, each ending in a newline and " "some containing internal newlines. :func:`~traceback.print_exception` is a " "wrapper around this method which just prints the lines to a file." msgstr "" -#: library/traceback.rst:397 +#: library/traceback.rst:412 msgid "Format the exception part of the traceback." msgstr "" -#: library/traceback.rst:399 +#: library/traceback.rst:414 msgid "The return value is a generator of strings, each ending in a newline." msgstr "" -#: library/traceback.rst:401 +#: library/traceback.rst:416 msgid "" -"The generator emits the exception's message followed by its notes (if it has " -"any). The exception message is normally a single string; however, for :exc:" -"`SyntaxError` exceptions, it consists of several lines that (when printed) " -"display detailed information about where the syntax error occurred." +"When *show_group* is ``False``, the generator emits the exception's message " +"followed by its notes (if it has any). The exception message is normally a " +"single string; however, for :exc:`SyntaxError` exceptions, it consists of " +"several lines that (when printed) display detailed information about where " +"the syntax error occurred." msgstr "" -#: library/traceback.rst:407 +#: library/traceback.rst:426 msgid "" "The exception's :attr:`notes ` are now included in " "the output." msgstr "" -#: library/traceback.rst:414 +#: library/traceback.rst:430 +msgid "Added the *show_group* parameter." +msgstr "" + +#: library/traceback.rst:435 msgid ":class:`!StackSummary` Objects" msgstr "" -#: library/traceback.rst:418 +#: library/traceback.rst:439 msgid "" ":class:`!StackSummary` objects represent a call stack ready for formatting." msgstr "" -#: library/traceback.rst:424 +#: library/traceback.rst:445 msgid "" "Construct a :class:`!StackSummary` object from a frame generator (such as is " "returned by :func:`~traceback.walk_stack` or :func:`~traceback.walk_tb`)." msgstr "" -#: library/traceback.rst:428 +#: library/traceback.rst:449 msgid "" "If *limit* is supplied, only this many frames are taken from *frame_gen*. If " "*lookup_lines* is ``False``, the returned :class:`FrameSummary` objects will " @@ -492,20 +512,20 @@ msgid "" "class:`!FrameSummary` are captured as object representations." msgstr "" -#: library/traceback.rst:436 +#: library/traceback.rst:457 msgid "" "Exceptions raised from :func:`repr` on a local variable (when " "*capture_locals* is ``True``) are no longer propagated to the caller." msgstr "" -#: library/traceback.rst:442 +#: library/traceback.rst:463 msgid "" "Construct a :class:`!StackSummary` object from a supplied list of :class:" "`FrameSummary` objects or old-style list of tuples. Each tuple should be a " "4-tuple with *filename*, *lineno*, *name*, *line* as the elements." msgstr "" -#: library/traceback.rst:449 +#: library/traceback.rst:470 msgid "" "Returns a list of strings ready for printing. Each string in the resulting " "list corresponds to a single :ref:`frame ` from the stack. " @@ -513,18 +533,18 @@ msgid "" "well, for those items with source text lines." msgstr "" -#: library/traceback.rst:455 +#: library/traceback.rst:476 msgid "" "For long sequences of the same frame and line, the first few repetitions are " "shown, followed by a summary line stating the exact number of further " "repetitions." msgstr "" -#: library/traceback.rst:459 +#: library/traceback.rst:480 msgid "Long sequences of repeated frames are now abbreviated." msgstr "" -#: library/traceback.rst:464 +#: library/traceback.rst:485 msgid "" "Returns a string for printing one of the :ref:`frames ` " "involved in the stack. This method is called for each :class:`FrameSummary` " @@ -532,17 +552,17 @@ msgid "" "the frame is omitted from the output." msgstr "" -#: library/traceback.rst:474 +#: library/traceback.rst:495 msgid ":class:`!FrameSummary` Objects" msgstr "" -#: library/traceback.rst:478 +#: library/traceback.rst:499 msgid "" "A :class:`!FrameSummary` object represents a single :ref:`frame ` in a :ref:`traceback `." msgstr "" -#: library/traceback.rst:485 +#: library/traceback.rst:506 msgid "" "Represents a single :ref:`frame ` in the :ref:`traceback " "` or stack that is being formatted or printed. It may " @@ -551,61 +571,65 @@ msgid "" "class:`!FrameSummary` has the :attr:`~FrameSummary.line` attribute accessed " "(which also happens when casting it to a :class:`tuple`). :attr:" "`~FrameSummary.line` may be directly provided, and will prevent line lookups " -"happening at all. *locals* is an optional local variable dictionary, and if " +"happening at all. *locals* is an optional local variable mapping, and if " "supplied the variable representations are stored in the summary for later " "display." msgstr "" -#: library/traceback.rst:496 +#: library/traceback.rst:517 msgid ":class:`!FrameSummary` instances have the following attributes:" msgstr "" -#: library/traceback.rst:500 +#: library/traceback.rst:521 msgid "" "The filename of the source code for this frame. Equivalent to accessing :" "attr:`f.f_code.co_filename ` on a :ref:`frame object " "` *f*." msgstr "" -#: library/traceback.rst:506 +#: library/traceback.rst:527 msgid "The line number of the source code for this frame." msgstr "" -#: library/traceback.rst:510 +#: library/traceback.rst:531 msgid "" "Equivalent to accessing :attr:`f.f_code.co_name ` on a :" "ref:`frame object ` *f*." msgstr "" -#: library/traceback.rst:515 +#: library/traceback.rst:536 msgid "" "A string representing the source code for this frame, with leading and " "trailing whitespace stripped. If the source is not available, it is ``None``." msgstr "" -#: library/traceback.rst:521 +#: library/traceback.rst:542 msgid "" "The last line number of the source code for this frame. By default, it is " -"set to ``None`` and indexation starts from 1." +"set to ``lineno`` and indexation starts from 1." msgstr "" -#: library/traceback.rst:526 +#: library/traceback.rst:545 +msgid "The default value changed from ``None`` to ``lineno``." +msgstr "" + +#: library/traceback.rst:550 msgid "" "The column number of the source code for this frame. By default, it is " "``None`` and indexation starts from 0." msgstr "" -#: library/traceback.rst:531 +#: library/traceback.rst:555 msgid "" "The last column number of the source code for this frame. By default, it is " "``None`` and indexation starts from 0." msgstr "" -#: library/traceback.rst:538 +#: library/traceback.rst:562 msgid "Examples of Using the Module-Level Functions" msgstr "" -#: library/traceback.rst:540 +#: library/traceback.rst:564 msgid "" "This simple example implements a basic read-eval-print loop, similar to (but " "less useful than) the standard Python interactive interpreter loop. For a " @@ -613,7 +637,7 @@ msgid "" "`code` module. ::" msgstr "" -#: library/traceback.rst:545 +#: library/traceback.rst:569 msgid "" "import sys, traceback\n" "\n" @@ -632,13 +656,13 @@ msgid "" " run_user_code(envdir)" msgstr "" -#: library/traceback.rst:562 +#: library/traceback.rst:586 msgid "" "The following example demonstrates the different ways to print and format " "the exception and traceback:" msgstr "" -#: library/traceback.rst:565 +#: library/traceback.rst:589 msgid "" "import sys, traceback\n" "\n" @@ -670,28 +694,33 @@ msgid "" " print(\"*** tb_lineno:\", exc.__traceback__.tb_lineno)" msgstr "" -#: library/traceback.rst:596 +#: library/traceback.rst:620 msgid "The output for the example would look similar to this:" msgstr "" -#: library/traceback.rst:598 +#: library/traceback.rst:622 msgid "" "*** print_tb:\n" " File \"\", line 10, in \n" " lumberjack()\n" +" ~~~~~~~~~~^^\n" "*** print_exception:\n" "Traceback (most recent call last):\n" " File \"\", line 10, in \n" " lumberjack()\n" +" ~~~~~~~~~~^^\n" " File \"\", line 4, in lumberjack\n" " bright_side_of_life()\n" +" ~~~~~~~~~~~~~~~~~~~^^\n" "IndexError: tuple index out of range\n" "*** print_exc:\n" "Traceback (most recent call last):\n" " File \"\", line 10, in \n" " lumberjack()\n" +" ~~~~~~~~~~^^\n" " File \"\", line 4, in lumberjack\n" " bright_side_of_life()\n" +" ~~~~~~~~~~~~~~~~~~~^^\n" "IndexError: tuple index out of range\n" "*** format_exc, first and last line:\n" "Traceback (most recent call last):\n" @@ -699,9 +728,9 @@ msgid "" "*** format_exception:\n" "['Traceback (most recent call last):\\n',\n" " ' File \"\", line 10, in \\n " -"lumberjack()\\n',\n" +"lumberjack()\\n ~~~~~~~~~~^^\\n',\n" " ' File \"\", line 4, in lumberjack\\n " -"bright_side_of_life()\\n',\n" +"bright_side_of_life()\\n ~~~~~~~~~~~~~~~~~~~^^\\n',\n" " ' File \"\", line 7, in bright_side_of_life\\n " "return tuple()[0]\\n ~~~~~~~^^^\\n',\n" " 'IndexError: tuple index out of range\\n']\n" @@ -711,21 +740,21 @@ msgid "" " , line 7 in bright_side_of_life>]\n" "*** format_tb:\n" "[' File \"\", line 10, in \\n " -"lumberjack()\\n',\n" +"lumberjack()\\n ~~~~~~~~~~^^\\n',\n" " ' File \"\", line 4, in lumberjack\\n " -"bright_side_of_life()\\n',\n" +"bright_side_of_life()\\n ~~~~~~~~~~~~~~~~~~~^^\\n',\n" " ' File \"\", line 7, in bright_side_of_life\\n " "return tuple()[0]\\n ~~~~~~~^^^\\n']\n" "*** tb_lineno: 10" msgstr "" -#: library/traceback.rst:638 +#: library/traceback.rst:667 msgid "" "The following example shows the different ways to print and format the " "stack::" msgstr "" -#: library/traceback.rst:640 +#: library/traceback.rst:669 msgid "" ">>> import traceback\n" ">>> def another_function():\n" @@ -753,11 +782,11 @@ msgid "" "format_stack()))\\n']" msgstr "" -#: library/traceback.rst:664 +#: library/traceback.rst:693 msgid "This last example demonstrates the final few formatting functions:" msgstr "" -#: library/traceback.rst:666 +#: library/traceback.rst:695 msgid "" ">>> import traceback\n" ">>> traceback.format_list([('spam.py', 3, '', 'spam.eggs()'),\n" @@ -769,15 +798,15 @@ msgid "" "['IndexError: tuple index out of range\\n']" msgstr "" -#: library/traceback.rst:680 +#: library/traceback.rst:709 msgid "Examples of Using :class:`TracebackException`" msgstr "" -#: library/traceback.rst:682 +#: library/traceback.rst:711 msgid "With the helper class, we have more options::" msgstr "" -#: library/traceback.rst:684 +#: library/traceback.rst:713 msgid "" ">>> import sys\n" ">>> from traceback import TracebackException\n" diff --git a/library/tracemalloc.po b/library/tracemalloc.po index ad82d615..e190b35e 100644 --- a/library/tracemalloc.po +++ b/library/tracemalloc.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" diff --git a/library/tty.po b/library/tty.po index 266ffb8a..2849cfc0 100644 --- a/library/tty.po +++ b/library/tty.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" diff --git a/library/turtle.po b/library/turtle.po index 6adc8032..9db9a49a 100644 --- a/library/turtle.po +++ b/library/turtle.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -18,7 +18,7 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" #: library/turtle.rst:3 -msgid ":mod:`turtle` --- Turtle graphics" +msgid ":mod:`!turtle` --- Turtle graphics" msgstr "" #: library/turtle.rst:10 @@ -37,25 +37,38 @@ msgid "" msgstr "" #: library/turtle.rst:29 +msgid "Get started" +msgstr "" + +#: library/turtle.rst:31 +msgid "" +"Imagine a robotic turtle starting at (0, 0) in the x-y plane. After an " +"``import turtle``, give it the command ``turtle.forward(15)``, and it moves " +"(on-screen!) 15 pixels in the direction it is facing, drawing a line as it " +"moves. Give it the command ``turtle.right(25)``, and it rotates in-place 25 " +"degrees clockwise." +msgstr "" + +#: library/turtle.rst:38 msgid "" "Turtle can draw intricate shapes using programs that repeat simple moves." msgstr "" -#: library/turtle.rst:35 +#: library/turtle.rst:44 msgid "" "In Python, turtle graphics provides a representation of a physical " "\"turtle\" (a little robot with a pen) that draws on a sheet of paper on the " "floor." msgstr "" -#: library/turtle.rst:38 +#: library/turtle.rst:47 msgid "" "It's an effective and well-proven way for learners to encounter programming " "concepts and interaction with software, as it provides instant, visible " "feedback. It also provides convenient access to graphical output in general." msgstr "" -#: library/turtle.rst:43 +#: library/turtle.rst:52 msgid "" "Turtle drawing was originally created as an educational tool, to be used by " "teachers in the classroom. For the programmer who needs to produce some " @@ -63,142 +76,142 @@ msgid "" "introducing more complex or external libraries into their work." msgstr "" -#: library/turtle.rst:52 +#: library/turtle.rst:61 msgid "Tutorial" msgstr "" -#: library/turtle.rst:54 +#: library/turtle.rst:63 msgid "" "New users should start here. In this tutorial we'll explore some of the " "basics of turtle drawing." msgstr "" -#: library/turtle.rst:59 +#: library/turtle.rst:68 msgid "Starting a turtle environment" msgstr "" -#: library/turtle.rst:61 +#: library/turtle.rst:70 msgid "In a Python shell, import all the objects of the ``turtle`` module::" msgstr "" -#: library/turtle.rst:63 +#: library/turtle.rst:72 msgid "from turtle import *" msgstr "" -#: library/turtle.rst:65 +#: library/turtle.rst:74 msgid "" "If you run into a ``No module named '_tkinter'`` error, you'll have to " "install the :mod:`Tk interface package ` on your system." msgstr "" -#: library/turtle.rst:70 +#: library/turtle.rst:79 msgid "Basic drawing" msgstr "" -#: library/turtle.rst:72 +#: library/turtle.rst:81 msgid "Send the turtle forward 100 steps::" msgstr "" -#: library/turtle.rst:74 +#: library/turtle.rst:83 msgid "forward(100)" msgstr "" -#: library/turtle.rst:76 +#: library/turtle.rst:85 msgid "" "You should see (most likely, in a new window on your display) a line drawn " "by the turtle, heading East. Change the direction of the turtle, so that it " "turns 120 degrees left (anti-clockwise)::" msgstr "" -#: library/turtle.rst:80 +#: library/turtle.rst:89 msgid "left(120)" msgstr "" -#: library/turtle.rst:82 +#: library/turtle.rst:91 msgid "Let's continue by drawing a triangle::" msgstr "" -#: library/turtle.rst:84 +#: library/turtle.rst:93 msgid "" "forward(100)\n" "left(120)\n" "forward(100)" msgstr "" -#: library/turtle.rst:88 +#: library/turtle.rst:97 msgid "" "Notice how the turtle, represented by an arrow, points in different " "directions as you steer it." msgstr "" -#: library/turtle.rst:91 +#: library/turtle.rst:100 msgid "" "Experiment with those commands, and also with ``backward()`` and ``right()``." msgstr "" -#: library/turtle.rst:325 library/turtle.rst:1016 +#: library/turtle.rst:334 library/turtle.rst:1024 msgid "Pen control" msgstr "" -#: library/turtle.rst:98 +#: library/turtle.rst:107 msgid "" "Try changing the color - for example, ``color('blue')`` - and width of the " "line - for example, ``width(3)`` - and then drawing again." msgstr "" -#: library/turtle.rst:101 +#: library/turtle.rst:110 msgid "" "You can also move the turtle around without drawing, by lifting up the pen: " "``up()`` before moving. To start drawing again, use ``down()``." msgstr "" -#: library/turtle.rst:106 +#: library/turtle.rst:115 msgid "The turtle's position" msgstr "" -#: library/turtle.rst:108 +#: library/turtle.rst:117 msgid "" "Send your turtle back to its starting-point (useful if it has disappeared " "off-screen)::" msgstr "" -#: library/turtle.rst:111 +#: library/turtle.rst:120 msgid "home()" msgstr "" -#: library/turtle.rst:113 +#: library/turtle.rst:122 msgid "" "The home position is at the center of the turtle's screen. If you ever need " "to know them, get the turtle's x-y coordinates with::" msgstr "" -#: library/turtle.rst:116 +#: library/turtle.rst:125 msgid "pos()" msgstr "" -#: library/turtle.rst:118 +#: library/turtle.rst:127 msgid "Home is at ``(0, 0)``." msgstr "" -#: library/turtle.rst:120 +#: library/turtle.rst:129 msgid "" "And after a while, it will probably help to clear the window so we can start " "anew::" msgstr "" -#: library/turtle.rst:123 +#: library/turtle.rst:132 msgid "clearscreen()" msgstr "" -#: library/turtle.rst:127 +#: library/turtle.rst:136 msgid "Making algorithmic patterns" msgstr "" -#: library/turtle.rst:129 +#: library/turtle.rst:138 msgid "Using loops, it's possible to build up geometric patterns::" msgstr "" -#: library/turtle.rst:131 +#: library/turtle.rst:140 msgid "" "for steps in range(100):\n" " for c in ('blue', 'red', 'green'):\n" @@ -207,37 +220,37 @@ msgid "" " right(30)" msgstr "" -#: library/turtle.rst:138 +#: library/turtle.rst:147 msgid "\\ - which of course, are limited only by the imagination!" msgstr "" -#: library/turtle.rst:140 +#: library/turtle.rst:149 msgid "" "Let's draw the star shape at the top of this page. We want red lines, filled " "in with yellow::" msgstr "" -#: library/turtle.rst:143 +#: library/turtle.rst:152 msgid "" "color('red')\n" "fillcolor('yellow')" msgstr "" -#: library/turtle.rst:146 +#: library/turtle.rst:155 msgid "" "Just as ``up()`` and ``down()`` determine whether lines will be drawn, " "filling can be turned on and off::" msgstr "" -#: library/turtle.rst:149 +#: library/turtle.rst:158 msgid "begin_fill()" msgstr "" -#: library/turtle.rst:151 +#: library/turtle.rst:160 msgid "Next we'll create a loop::" msgstr "" -#: library/turtle.rst:153 +#: library/turtle.rst:162 msgid "" "while True:\n" " forward(200)\n" @@ -246,39 +259,39 @@ msgid "" " break" msgstr "" -#: library/turtle.rst:159 +#: library/turtle.rst:168 msgid "" "``abs(pos()) < 1`` is a good way to know when the turtle is back at its home " "position." msgstr "" -#: library/turtle.rst:162 +#: library/turtle.rst:171 msgid "Finally, complete the filling::" msgstr "" -#: library/turtle.rst:164 +#: library/turtle.rst:173 msgid "end_fill()" msgstr "" -#: library/turtle.rst:166 +#: library/turtle.rst:175 msgid "" "(Note that filling only actually takes place when you give the " "``end_fill()`` command.)" msgstr "" -#: library/turtle.rst:173 +#: library/turtle.rst:182 msgid "How to..." msgstr "" -#: library/turtle.rst:175 +#: library/turtle.rst:184 msgid "This section covers some typical turtle use-cases and approaches." msgstr "" -#: library/turtle.rst:179 +#: library/turtle.rst:188 msgid "Get started as quickly as possible" msgstr "" -#: library/turtle.rst:181 +#: library/turtle.rst:190 msgid "" "One of the joys of turtle graphics is the immediate, visual feedback that's " "available from simple commands - it's an excellent way to introduce children " @@ -286,21 +299,21 @@ msgid "" "course)." msgstr "" -#: library/turtle.rst:186 +#: library/turtle.rst:195 msgid "" "The turtle module makes this possible by exposing all its basic " "functionality as functions, available with ``from turtle import *``. The :" "ref:`turtle graphics tutorial ` covers this approach." msgstr "" -#: library/turtle.rst:190 +#: library/turtle.rst:199 msgid "" "It's worth noting that many of the turtle commands also have even more terse " "equivalents, such as ``fd()`` for :func:`forward`. These are especially " "useful when working with learners for whom typing is not a skill." msgstr "" -#: library/turtle.rst:196 +#: library/turtle.rst:205 msgid "" "You'll need to have the :mod:`Tk interface package ` installed on " "your system for turtle graphics to work. Be warned that this is not always " @@ -308,11 +321,11 @@ msgid "" "graphics with a learner." msgstr "" -#: library/turtle.rst:203 +#: library/turtle.rst:212 msgid "Use the ``turtle`` module namespace" msgstr "" -#: library/turtle.rst:205 +#: library/turtle.rst:214 msgid "" "Using ``from turtle import *`` is convenient - but be warned that it imports " "a rather large collection of objects, and if you're doing anything but " @@ -321,7 +334,7 @@ msgid "" "might be imported)." msgstr "" -#: library/turtle.rst:211 +#: library/turtle.rst:220 msgid "" "The solution is to use ``import turtle`` - ``fd()`` becomes ``turtle.fd()``, " "``width()`` becomes ``turtle.width()`` and so on. (If typing \"turtle\" over " @@ -329,17 +342,17 @@ msgid "" "instead.)" msgstr "" -#: library/turtle.rst:218 +#: library/turtle.rst:227 msgid "Use turtle graphics in a script" msgstr "" -#: library/turtle.rst:220 +#: library/turtle.rst:229 msgid "" "It's recommended to use the ``turtle`` module namespace as described " "immediately above, for example::" msgstr "" -#: library/turtle.rst:223 +#: library/turtle.rst:232 msgid "" "import turtle as t\n" "from random import random\n" @@ -351,33 +364,33 @@ msgid "" " t.fd(steps)" msgstr "" -#: library/turtle.rst:232 +#: library/turtle.rst:241 msgid "" "Another step is also required though - as soon as the script ends, Python " "will also close the turtle's window. Add::" msgstr "" -#: library/turtle.rst:235 +#: library/turtle.rst:244 msgid "t.mainloop()" msgstr "" -#: library/turtle.rst:237 +#: library/turtle.rst:246 msgid "" "to the end of the script. The script will now wait to be dismissed and will " "not exit until it is terminated, for example by closing the turtle graphics " "window." msgstr "" -#: library/turtle.rst:243 +#: library/turtle.rst:252 msgid "Use object-oriented turtle graphics" msgstr "" -#: library/turtle.rst:245 +#: library/turtle.rst:254 msgid "" ":ref:`Explanation of the object-oriented interface `" msgstr "" -#: library/turtle.rst:247 +#: library/turtle.rst:256 msgid "" "Other than for very basic introductory purposes, or for trying things out as " "quickly as possible, it's more usual and much more powerful to use the " @@ -385,18 +398,18 @@ msgid "" "multiple turtles on screen at once." msgstr "" -#: library/turtle.rst:252 +#: library/turtle.rst:261 msgid "" "In this approach, the various turtle commands are methods of objects (mostly " "of ``Turtle`` objects). You *can* use the object-oriented approach in the " "shell, but it would be more typical in a Python script." msgstr "" -#: library/turtle.rst:256 +#: library/turtle.rst:265 msgid "The example above then becomes::" msgstr "" -#: library/turtle.rst:258 +#: library/turtle.rst:267 msgid "" "from turtle import Turtle\n" "from random import random\n" @@ -411,43 +424,43 @@ msgid "" "t.screen.mainloop()" msgstr "" -#: library/turtle.rst:270 +#: library/turtle.rst:279 msgid "" "Note the last line. ``t.screen`` is an instance of the :class:`Screen` that " "a Turtle instance exists on; it's created automatically along with the " "turtle." msgstr "" -#: library/turtle.rst:274 +#: library/turtle.rst:283 msgid "The turtle's screen can be customised, for example::" msgstr "" -#: library/turtle.rst:276 +#: library/turtle.rst:285 msgid "" "t.screen.title('Object-oriented turtle demo')\n" "t.screen.bgcolor(\"orange\")" msgstr "" -#: library/turtle.rst:281 +#: library/turtle.rst:290 msgid "Turtle graphics reference" msgstr "" -#: library/turtle.rst:285 +#: library/turtle.rst:294 msgid "" "In the following documentation the argument list for functions is given. " "Methods, of course, have the additional first argument *self* which is " "omitted here." msgstr "" -#: library/turtle.rst:291 +#: library/turtle.rst:300 msgid "Turtle methods" msgstr "" -#: library/turtle.rst:433 +#: library/turtle.rst:441 msgid "Turtle motion" msgstr "" -#: library/turtle.rst:294 +#: library/turtle.rst:303 msgid "Move and draw" msgstr "" @@ -491,7 +504,7 @@ msgstr "" msgid ":func:`home`" msgstr "" -#: library/turtle.rst:2723 +#: library/turtle.rst:2709 msgid ":func:`circle`" msgstr "" @@ -499,7 +512,7 @@ msgstr "" msgid ":func:`dot`" msgstr "" -#: library/turtle.rst:2701 +#: library/turtle.rst:2687 msgid ":func:`stamp`" msgstr "" @@ -519,7 +532,7 @@ msgstr "" msgid ":func:`speed`" msgstr "" -#: library/turtle.rst:865 +#: library/turtle.rst:873 msgid "Tell Turtle's state" msgstr "" @@ -547,7 +560,7 @@ msgstr "" msgid ":func:`distance`" msgstr "" -#: library/turtle.rst:321 +#: library/turtle.rst:330 msgid "Setting and measurement" msgstr "" @@ -559,7 +572,7 @@ msgstr "" msgid ":func:`radians`" msgstr "" -#: library/turtle.rst:1019 +#: library/turtle.rst:1027 msgid "Drawing state" msgstr "" @@ -583,7 +596,7 @@ msgstr "" msgid ":func:`isdown`" msgstr "" -#: library/turtle.rst:1111 +#: library/turtle.rst:1119 msgid "Color control" msgstr "" @@ -599,7 +612,7 @@ msgstr "" msgid ":func:`fillcolor`" msgstr "" -#: library/turtle.rst:1243 +#: library/turtle.rst:1251 msgid "Filling" msgstr "" @@ -615,7 +628,7 @@ msgstr "" msgid ":func:`end_fill`" msgstr "" -#: library/turtle.rst:1290 +#: library/turtle.rst:1298 msgid "More drawing control" msgstr "" @@ -631,11 +644,11 @@ msgstr "" msgid ":func:`write`" msgstr "" -#: library/turtle.rst:1336 +#: library/turtle.rst:1344 msgid "Turtle state" msgstr "" -#: library/turtle.rst:1339 +#: library/turtle.rst:1347 msgid "Visibility" msgstr "" @@ -651,7 +664,7 @@ msgstr "" msgid ":func:`isvisible`" msgstr "" -#: library/turtle.rst:1378 +#: library/turtle.rst:1386 msgid "Appearance" msgstr "" @@ -671,10 +684,6 @@ msgstr "" msgid ":func:`shearfactor`" msgstr "" -#: library/turtle.rst:0 -msgid ":func:`settiltangle`" -msgstr "" - #: library/turtle.rst:0 msgid ":func:`tiltangle`" msgstr "" @@ -691,11 +700,11 @@ msgstr "" msgid ":func:`get_shapepoly`" msgstr "" -#: library/turtle.rst:1583 +#: library/turtle.rst:1569 msgid "Using events" msgstr "" -#: library/turtle.rst:2695 +#: library/turtle.rst:2681 msgid ":func:`onclick`" msgstr "" @@ -703,11 +712,11 @@ msgstr "" msgid ":func:`onrelease`" msgstr "" -#: library/turtle.rst:2678 +#: library/turtle.rst:2664 msgid ":func:`ondrag`" msgstr "" -#: library/turtle.rst:1657 +#: library/turtle.rst:1643 msgid "Special Turtle methods" msgstr "" @@ -723,7 +732,7 @@ msgstr "" msgid ":func:`get_poly`" msgstr "" -#: library/turtle.rst:2717 +#: library/turtle.rst:2703 msgid ":func:`clone`" msgstr "" @@ -743,11 +752,11 @@ msgstr "" msgid ":func:`undobufferentries`" msgstr "" -#: library/turtle.rst:382 +#: library/turtle.rst:390 msgid "Methods of TurtleScreen/Screen" msgstr "" -#: library/turtle.rst:1811 +#: library/turtle.rst:1797 msgid "Window control" msgstr "" @@ -775,7 +784,7 @@ msgstr "" msgid ":func:`setworldcoordinates`" msgstr "" -#: library/turtle.rst:1934 +#: library/turtle.rst:1920 msgid "Animation control" msgstr "" @@ -791,7 +800,7 @@ msgstr "" msgid ":func:`update`" msgstr "" -#: library/turtle.rst:1987 +#: library/turtle.rst:1973 msgid "Using screen events" msgstr "" @@ -819,7 +828,7 @@ msgstr "" msgid ":func:`mainloop` | :func:`done`" msgstr "" -#: library/turtle.rst:2132 +#: library/turtle.rst:2118 msgid "Settings and special methods" msgstr "" @@ -855,7 +864,7 @@ msgstr "" msgid ":func:`window_width`" msgstr "" -#: library/turtle.rst:2096 +#: library/turtle.rst:2082 msgid "Input methods" msgstr "" @@ -867,7 +876,7 @@ msgstr "" msgid ":func:`numinput`" msgstr "" -#: library/turtle.rst:419 +#: library/turtle.rst:427 msgid "Methods specific to Screen" msgstr "" @@ -887,11 +896,11 @@ msgstr "" msgid ":func:`title`" msgstr "" -#: library/turtle.rst:427 +#: library/turtle.rst:435 msgid "Methods of RawTurtle/Turtle and corresponding functions" msgstr "" -#: library/turtle.rst:429 +#: library/turtle.rst:437 msgid "" "Most of the examples in this section refer to a Turtle instance called " "``turtle``." @@ -901,17 +910,17 @@ msgstr "" msgid "Parameters" msgstr "" -#: library/turtle.rst:483 library/turtle.rst:606 library/turtle.rst:652 +#: library/turtle.rst:491 library/turtle.rst:614 library/turtle.rst:660 msgid "a number (integer or float)" msgstr "" -#: library/turtle.rst:440 +#: library/turtle.rst:448 msgid "" "Move the turtle forward by the specified *distance*, in the direction the " "turtle is headed." msgstr "" -#: library/turtle.rst:443 +#: library/turtle.rst:451 msgid "" ">>> turtle.position()\n" "(0.00,0.00)\n" @@ -923,17 +932,17 @@ msgid "" "(-50.00,0.00)" msgstr "" -#: library/turtle.rst:702 library/turtle.rst:1477 library/turtle.rst:1496 +#: library/turtle.rst:710 library/turtle.rst:1485 msgid "a number" msgstr "" -#: library/turtle.rst:462 +#: library/turtle.rst:470 msgid "" "Move the turtle backward by *distance*, opposite to the direction the turtle " "is headed. Do not change the turtle's heading." msgstr "" -#: library/turtle.rst:470 +#: library/turtle.rst:478 msgid "" ">>> turtle.position()\n" "(0.00,0.00)\n" @@ -942,14 +951,14 @@ msgid "" "(-30.00,0.00)" msgstr "" -#: library/turtle.rst:485 +#: library/turtle.rst:493 msgid "" "Turn turtle right by *angle* units. (Units are by default degrees, but can " "be set via the :func:`degrees` and :func:`radians` functions.) Angle " "orientation depends on the turtle mode, see :func:`mode`." msgstr "" -#: library/turtle.rst:495 +#: library/turtle.rst:503 msgid "" ">>> turtle.heading()\n" "22.0\n" @@ -958,14 +967,14 @@ msgid "" "337.0" msgstr "" -#: library/turtle.rst:510 +#: library/turtle.rst:518 msgid "" "Turn turtle left by *angle* units. (Units are by default degrees, but can " "be set via the :func:`degrees` and :func:`radians` functions.) Angle " "orientation depends on the turtle mode, see :func:`mode`." msgstr "" -#: library/turtle.rst:520 +#: library/turtle.rst:528 msgid "" ">>> turtle.heading()\n" "22.0\n" @@ -974,27 +983,27 @@ msgid "" "67.0" msgstr "" -#: library/turtle.rst:534 +#: library/turtle.rst:542 msgid "a number or a pair/vector of numbers" msgstr "" -#: library/turtle.rst:568 library/turtle.rst:569 +#: library/turtle.rst:576 library/turtle.rst:577 msgid "a number or ``None``" msgstr "" -#: library/turtle.rst:537 +#: library/turtle.rst:545 msgid "" "If *y* is ``None``, *x* must be a pair of coordinates or a :class:`Vec2D` (e." "g. as returned by :func:`pos`)." msgstr "" -#: library/turtle.rst:540 +#: library/turtle.rst:548 msgid "" "Move turtle to an absolute position. If the pen is down, draw line. Do not " "change the turtle's orientation." msgstr "" -#: library/turtle.rst:549 +#: library/turtle.rst:557 msgid "" ">>> tp = turtle.pos()\n" ">>> tp\n" @@ -1010,11 +1019,11 @@ msgid "" "(0.00,0.00)" msgstr "" -#: library/turtle.rst:570 +#: library/turtle.rst:578 msgid "a boolean" msgstr "" -#: library/turtle.rst:572 +#: library/turtle.rst:580 msgid "" "Move turtle to an absolute position. Unlike goto(x, y), a line will not be " "drawn. The turtle's orientation does not change. If currently filling, the " @@ -1024,7 +1033,7 @@ msgid "" "barrier like in goto(x, y)." msgstr "" -#: library/turtle.rst:585 +#: library/turtle.rst:593 msgid "" ">>> tp = turtle.pos()\n" ">>> tp\n" @@ -1040,12 +1049,12 @@ msgid "" "(20.00,30.00)" msgstr "" -#: library/turtle.rst:608 +#: library/turtle.rst:616 msgid "" "Set the turtle's first coordinate to *x*, leave second coordinate unchanged." msgstr "" -#: library/turtle.rst:617 +#: library/turtle.rst:625 msgid "" ">>> turtle.position()\n" "(0.00,240.00)\n" @@ -1054,12 +1063,12 @@ msgid "" "(10.00,240.00)" msgstr "" -#: library/turtle.rst:631 +#: library/turtle.rst:639 msgid "" "Set the turtle's second coordinate to *y*, leave first coordinate unchanged." msgstr "" -#: library/turtle.rst:639 +#: library/turtle.rst:647 msgid "" ">>> turtle.position()\n" "(0.00,40.00)\n" @@ -1068,66 +1077,66 @@ msgid "" "(0.00,-10.00)" msgstr "" -#: library/turtle.rst:654 +#: library/turtle.rst:662 msgid "" "Set the orientation of the turtle to *to_angle*. Here are some common " "directions in degrees:" msgstr "" -#: library/turtle.rst:658 +#: library/turtle.rst:666 msgid "standard mode" msgstr "" -#: library/turtle.rst:658 +#: library/turtle.rst:666 msgid "logo mode" msgstr "" -#: library/turtle.rst:660 +#: library/turtle.rst:668 msgid "0 - east" msgstr "" -#: library/turtle.rst:660 +#: library/turtle.rst:668 msgid "0 - north" msgstr "" -#: library/turtle.rst:661 +#: library/turtle.rst:669 msgid "90 - north" msgstr "" -#: library/turtle.rst:661 +#: library/turtle.rst:669 msgid "90 - east" msgstr "" -#: library/turtle.rst:662 +#: library/turtle.rst:670 msgid "180 - west" msgstr "" -#: library/turtle.rst:662 +#: library/turtle.rst:670 msgid "180 - south" msgstr "" -#: library/turtle.rst:663 +#: library/turtle.rst:671 msgid "270 - south" msgstr "" -#: library/turtle.rst:663 +#: library/turtle.rst:671 msgid "270 - west" msgstr "" -#: library/turtle.rst:666 +#: library/turtle.rst:674 msgid "" ">>> turtle.setheading(90)\n" ">>> turtle.heading()\n" "90.0" msgstr "" -#: library/turtle.rst:676 +#: library/turtle.rst:684 msgid "" "Move turtle to the origin -- coordinates (0,0) -- and set its heading to its " "start-orientation (which depends on the mode, see :func:`mode`)." msgstr "" -#: library/turtle.rst:686 +#: library/turtle.rst:694 msgid "" ">>> turtle.heading()\n" "90.0\n" @@ -1140,15 +1149,15 @@ msgid "" "0.0" msgstr "" -#: library/turtle.rst:703 +#: library/turtle.rst:711 msgid "a number (or ``None``)" msgstr "" -#: library/turtle.rst:797 +#: library/turtle.rst:805 msgid "an integer (or ``None``)" msgstr "" -#: library/turtle.rst:706 +#: library/turtle.rst:714 msgid "" "Draw a circle with given *radius*. The center is *radius* units left of the " "turtle; *extent* -- an angle -- determines which part of the circle is " @@ -1159,14 +1168,14 @@ msgid "" "changed by the amount of *extent*." msgstr "" -#: library/turtle.rst:714 +#: library/turtle.rst:722 msgid "" "As the circle is approximated by an inscribed regular polygon, *steps* " "determines the number of steps to use. If not given, it will be calculated " "automatically. May be used to draw regular polygons." msgstr "" -#: library/turtle.rst:718 +#: library/turtle.rst:726 msgid "" ">>> turtle.home()\n" ">>> turtle.position()\n" @@ -1185,21 +1194,21 @@ msgid "" "180.0" msgstr "" -#: library/turtle.rst:740 +#: library/turtle.rst:748 msgid "an integer >= 1 (if given)" msgstr "" -#: library/turtle.rst:741 +#: library/turtle.rst:749 msgid "a colorstring or a numeric color tuple" msgstr "" -#: library/turtle.rst:743 +#: library/turtle.rst:751 msgid "" "Draw a circular dot with diameter *size*, using *color*. If *size* is not " "given, the maximum of pensize+4 and 2*pensize is used." msgstr "" -#: library/turtle.rst:747 +#: library/turtle.rst:755 msgid "" ">>> turtle.home()\n" ">>> turtle.dot()\n" @@ -1210,29 +1219,29 @@ msgid "" "0.0" msgstr "" -#: library/turtle.rst:761 +#: library/turtle.rst:769 msgid "" "Stamp a copy of the turtle shape onto the canvas at the current turtle " "position. Return a stamp_id for that stamp, which can be used to delete it " "by calling ``clearstamp(stamp_id)``." msgstr "" -#: library/turtle.rst:765 +#: library/turtle.rst:773 msgid "" ">>> turtle.color(\"blue\")\n" ">>> stamp_id = turtle.stamp()\n" ">>> turtle.fd(50)" msgstr "" -#: library/turtle.rst:775 +#: library/turtle.rst:783 msgid "an integer, must be return value of previous :func:`stamp` call" msgstr "" -#: library/turtle.rst:778 +#: library/turtle.rst:786 msgid "Delete stamp with given *stampid*." msgstr "" -#: library/turtle.rst:780 +#: library/turtle.rst:788 msgid "" ">>> turtle.position()\n" "(150.00,-0.00)\n" @@ -1246,14 +1255,14 @@ msgid "" "(200.00,-0.00)" msgstr "" -#: library/turtle.rst:799 +#: library/turtle.rst:807 msgid "" "Delete all or first/last *n* of turtle's stamps. If *n* is ``None``, delete " "all stamps, if *n* > 0 delete first *n* stamps, else if *n* < 0 delete last " "*n* stamps." msgstr "" -#: library/turtle.rst:803 +#: library/turtle.rst:811 msgid "" ">>> for i in range(8):\n" "... unused_stamp_id = turtle.stamp()\n" @@ -1263,13 +1272,13 @@ msgid "" ">>> turtle.clearstamps()" msgstr "" -#: library/turtle.rst:815 +#: library/turtle.rst:823 msgid "" "Undo (repeatedly) the last turtle action(s). Number of available undo " "actions is determined by the size of the undobuffer." msgstr "" -#: library/turtle.rst:818 +#: library/turtle.rst:826 msgid "" ">>> for i in range(4):\n" "... turtle.fd(50); turtle.lt(80)\n" @@ -1278,55 +1287,55 @@ msgid "" "... turtle.undo()" msgstr "" -#: library/turtle.rst:830 +#: library/turtle.rst:838 msgid "an integer in the range 0..10 or a speedstring (see below)" msgstr "" -#: library/turtle.rst:832 +#: library/turtle.rst:840 msgid "" "Set the turtle's speed to an integer value in the range 0..10. If no " "argument is given, return current speed." msgstr "" -#: library/turtle.rst:835 +#: library/turtle.rst:843 msgid "" "If input is a number greater than 10 or smaller than 0.5, speed is set to " "0. Speedstrings are mapped to speedvalues as follows:" msgstr "" -#: library/turtle.rst:838 +#: library/turtle.rst:846 msgid "\"fastest\": 0" msgstr "" -#: library/turtle.rst:839 +#: library/turtle.rst:847 msgid "\"fast\": 10" msgstr "" -#: library/turtle.rst:840 +#: library/turtle.rst:848 msgid "\"normal\": 6" msgstr "" -#: library/turtle.rst:841 +#: library/turtle.rst:849 msgid "\"slow\": 3" msgstr "" -#: library/turtle.rst:842 +#: library/turtle.rst:850 msgid "\"slowest\": 1" msgstr "" -#: library/turtle.rst:844 +#: library/turtle.rst:852 msgid "" "Speeds from 1 to 10 enforce increasingly faster animation of line drawing " "and turtle turning." msgstr "" -#: library/turtle.rst:847 +#: library/turtle.rst:855 msgid "" "Attention: *speed* = 0 means that *no* animation takes place. forward/back " "makes turtle jump and likewise left/right make the turtle turn instantly." msgstr "" -#: library/turtle.rst:851 +#: library/turtle.rst:859 msgid "" ">>> turtle.speed()\n" "3\n" @@ -1338,26 +1347,26 @@ msgid "" "9" msgstr "" -#: library/turtle.rst:870 +#: library/turtle.rst:878 msgid "" "Return the turtle's current location (x,y) (as a :class:`Vec2D` vector)." msgstr "" -#: library/turtle.rst:872 +#: library/turtle.rst:880 msgid "" ">>> turtle.pos()\n" "(440.00,-0.00)" msgstr "" -#: library/turtle.rst:944 +#: library/turtle.rst:952 msgid "a number or a pair/vector of numbers or a turtle instance" msgstr "" -#: library/turtle.rst:945 +#: library/turtle.rst:953 msgid "a number if *x* is a number, else ``None``" msgstr "" -#: library/turtle.rst:884 +#: library/turtle.rst:892 msgid "" "Return the angle between the line from turtle position to position specified " "by (x,y), the vector or the other turtle. This depends on the turtle's " @@ -1365,18 +1374,18 @@ msgid "" "\"logo\"." msgstr "" -#: library/turtle.rst:888 +#: library/turtle.rst:896 msgid "" ">>> turtle.goto(10, 10)\n" ">>> turtle.towards(0,0)\n" "225.0" msgstr "" -#: library/turtle.rst:898 +#: library/turtle.rst:906 msgid "Return the turtle's x coordinate." msgstr "" -#: library/turtle.rst:900 +#: library/turtle.rst:908 msgid "" ">>> turtle.home()\n" ">>> turtle.left(50)\n" @@ -1387,11 +1396,11 @@ msgid "" "64.27876" msgstr "" -#: library/turtle.rst:914 +#: library/turtle.rst:922 msgid "Return the turtle's y coordinate." msgstr "" -#: library/turtle.rst:916 +#: library/turtle.rst:924 msgid "" ">>> turtle.home()\n" ">>> turtle.left(60)\n" @@ -1402,13 +1411,13 @@ msgid "" "86.60254" msgstr "" -#: library/turtle.rst:930 +#: library/turtle.rst:938 msgid "" "Return the turtle's current heading (value depends on the turtle mode, see :" "func:`mode`)." msgstr "" -#: library/turtle.rst:933 +#: library/turtle.rst:941 msgid "" ">>> turtle.home()\n" ">>> turtle.left(67)\n" @@ -1416,13 +1425,13 @@ msgid "" "67.0" msgstr "" -#: library/turtle.rst:947 +#: library/turtle.rst:955 msgid "" "Return the distance from the turtle to (x,y), the given vector, or the given " "other turtle, in turtle step units." msgstr "" -#: library/turtle.rst:950 +#: library/turtle.rst:958 msgid "" ">>> turtle.home()\n" ">>> turtle.distance(30,40)\n" @@ -1435,17 +1444,17 @@ msgid "" "77.0" msgstr "" -#: library/turtle.rst:965 +#: library/turtle.rst:973 msgid "Settings for measurement" msgstr "" -#: library/turtle.rst:971 +#: library/turtle.rst:979 msgid "" "Set angle measurement units, i.e. set number of \"degrees\" for a full " "circle. Default value is 360 degrees." msgstr "" -#: library/turtle.rst:974 +#: library/turtle.rst:982 msgid "" ">>> turtle.home()\n" ">>> turtle.left(90)\n" @@ -1462,13 +1471,13 @@ msgid "" "90.0" msgstr "" -#: library/turtle.rst:994 +#: library/turtle.rst:1002 msgid "" "Set the angle measurement units to radians. Equivalent to ``degrees(2*math." "pi)``." msgstr "" -#: library/turtle.rst:997 +#: library/turtle.rst:1005 msgid "" ">>> turtle.home()\n" ">>> turtle.left(90)\n" @@ -1479,87 +1488,87 @@ msgid "" "1.5707963267948966" msgstr "" -#: library/turtle.rst:1025 +#: library/turtle.rst:1033 msgid "Pull the pen down -- drawing when moving." msgstr "" -#: library/turtle.rst:1032 +#: library/turtle.rst:1040 msgid "Pull the pen up -- no drawing when moving." msgstr "" -#: library/turtle.rst:1038 +#: library/turtle.rst:1046 msgid "a positive number" msgstr "" -#: library/turtle.rst:1040 +#: library/turtle.rst:1048 msgid "" "Set the line thickness to *width* or return it. If resizemode is set to " "\"auto\" and turtleshape is a polygon, that polygon is drawn with the same " "line thickness. If no argument is given, the current pensize is returned." msgstr "" -#: library/turtle.rst:1044 +#: library/turtle.rst:1052 msgid "" ">>> turtle.pensize()\n" "1\n" ">>> turtle.pensize(10) # from here on lines of width 10 are drawn" msgstr "" -#: library/turtle.rst:1054 +#: library/turtle.rst:1062 msgid "a dictionary with some or all of the below listed keys" msgstr "" -#: library/turtle.rst:1055 +#: library/turtle.rst:1063 msgid "one or more keyword-arguments with the below listed keys as keywords" msgstr "" -#: library/turtle.rst:1057 +#: library/turtle.rst:1065 msgid "" "Return or set the pen's attributes in a \"pen-dictionary\" with the " "following key/value pairs:" msgstr "" -#: library/turtle.rst:1060 +#: library/turtle.rst:1068 msgid "\"shown\": True/False" msgstr "" -#: library/turtle.rst:1061 +#: library/turtle.rst:1069 msgid "\"pendown\": True/False" msgstr "" -#: library/turtle.rst:1062 +#: library/turtle.rst:1070 msgid "\"pencolor\": color-string or color-tuple" msgstr "" -#: library/turtle.rst:1063 +#: library/turtle.rst:1071 msgid "\"fillcolor\": color-string or color-tuple" msgstr "" -#: library/turtle.rst:1064 +#: library/turtle.rst:1072 msgid "\"pensize\": positive number" msgstr "" -#: library/turtle.rst:1065 +#: library/turtle.rst:1073 msgid "\"speed\": number in range 0..10" msgstr "" -#: library/turtle.rst:1066 +#: library/turtle.rst:1074 msgid "\"resizemode\": \"auto\" or \"user\" or \"noresize\"" msgstr "" -#: library/turtle.rst:1067 +#: library/turtle.rst:1075 msgid "\"stretchfactor\": (positive number, positive number)" msgstr "" -#: library/turtle.rst:1068 +#: library/turtle.rst:1076 msgid "\"outline\": positive number" msgstr "" -#: library/turtle.rst:1069 +#: library/turtle.rst:1077 msgid "\"tilt\": number" msgstr "" -#: library/turtle.rst:1071 +#: library/turtle.rst:1079 msgid "" "This dictionary can be used as argument for a subsequent call to :func:`pen` " "to restore the former pen-state. Moreover one or more of these attributes " @@ -1567,7 +1576,7 @@ msgid "" "attributes in one statement." msgstr "" -#: library/turtle.rst:1076 +#: library/turtle.rst:1084 msgid "" ">>> turtle.pen(fillcolor=\"black\", pencolor=\"red\", pensize=10)\n" ">>> sorted(turtle.pen().items())\n" @@ -1585,11 +1594,11 @@ msgid "" "[('fillcolor', 'green'), ('outline', 1), ('pencolor', 'red')]" msgstr "" -#: library/turtle.rst:1097 +#: library/turtle.rst:1105 msgid "Return ``True`` if pen is down, ``False`` if it's up." msgstr "" -#: library/turtle.rst:1099 +#: library/turtle.rst:1107 msgid "" ">>> turtle.penup()\n" ">>> turtle.isdown()\n" @@ -1599,62 +1608,62 @@ msgid "" "True" msgstr "" -#: library/turtle.rst:1115 +#: library/turtle.rst:1123 msgid "Return or set the pencolor." msgstr "" -#: library/turtle.rst:1166 +#: library/turtle.rst:1174 msgid "Four input formats are allowed:" msgstr "" -#: library/turtle.rst:1119 +#: library/turtle.rst:1127 msgid "``pencolor()``" msgstr "" -#: library/turtle.rst:1120 +#: library/turtle.rst:1128 msgid "" "Return the current pencolor as color specification string or as a tuple (see " "example). May be used as input to another color/pencolor/fillcolor call." msgstr "" -#: library/turtle.rst:1124 +#: library/turtle.rst:1132 msgid "``pencolor(colorstring)``" msgstr "" -#: library/turtle.rst:1125 +#: library/turtle.rst:1133 msgid "" "Set pencolor to *colorstring*, which is a Tk color specification string, " "such as ``\"red\"``, ``\"yellow\"``, or ``\"#33cc8c\"``." msgstr "" -#: library/turtle.rst:1128 +#: library/turtle.rst:1136 msgid "``pencolor((r, g, b))``" msgstr "" -#: library/turtle.rst:1129 +#: library/turtle.rst:1137 msgid "" "Set pencolor to the RGB color represented by the tuple of *r*, *g*, and " "*b*. Each of *r*, *g*, and *b* must be in the range 0..colormode, where " "colormode is either 1.0 or 255 (see :func:`colormode`)." msgstr "" -#: library/turtle.rst:1133 +#: library/turtle.rst:1141 msgid "``pencolor(r, g, b)``" msgstr "" -#: library/turtle.rst:1134 +#: library/turtle.rst:1142 msgid "" "Set pencolor to the RGB color represented by *r*, *g*, and *b*. Each of " "*r*, *g*, and *b* must be in the range 0..colormode." msgstr "" -#: library/turtle.rst:1137 +#: library/turtle.rst:1145 msgid "" "If turtleshape is a polygon, the outline of that polygon is drawn with the " "newly set pencolor." msgstr "" -#: library/turtle.rst:1140 +#: library/turtle.rst:1148 msgid "" ">>> colormode()\n" "1.0\n" @@ -1675,59 +1684,59 @@ msgid "" "(50.0, 193.0, 143.0)" msgstr "" -#: library/turtle.rst:1164 +#: library/turtle.rst:1172 msgid "Return or set the fillcolor." msgstr "" -#: library/turtle.rst:1168 +#: library/turtle.rst:1176 msgid "``fillcolor()``" msgstr "" -#: library/turtle.rst:1169 +#: library/turtle.rst:1177 msgid "" "Return the current fillcolor as color specification string, possibly in " "tuple format (see example). May be used as input to another color/pencolor/" "fillcolor call." msgstr "" -#: library/turtle.rst:1173 +#: library/turtle.rst:1181 msgid "``fillcolor(colorstring)``" msgstr "" -#: library/turtle.rst:1174 +#: library/turtle.rst:1182 msgid "" "Set fillcolor to *colorstring*, which is a Tk color specification string, " "such as ``\"red\"``, ``\"yellow\"``, or ``\"#33cc8c\"``." msgstr "" -#: library/turtle.rst:1177 +#: library/turtle.rst:1185 msgid "``fillcolor((r, g, b))``" msgstr "" -#: library/turtle.rst:1178 +#: library/turtle.rst:1186 msgid "" "Set fillcolor to the RGB color represented by the tuple of *r*, *g*, and " "*b*. Each of *r*, *g*, and *b* must be in the range 0..colormode, where " "colormode is either 1.0 or 255 (see :func:`colormode`)." msgstr "" -#: library/turtle.rst:1182 +#: library/turtle.rst:1190 msgid "``fillcolor(r, g, b)``" msgstr "" -#: library/turtle.rst:1183 +#: library/turtle.rst:1191 msgid "" "Set fillcolor to the RGB color represented by *r*, *g*, and *b*. Each of " "*r*, *g*, and *b* must be in the range 0..colormode." msgstr "" -#: library/turtle.rst:1186 +#: library/turtle.rst:1194 msgid "" "If turtleshape is a polygon, the interior of that polygon is drawn with the " "newly set fillcolor." msgstr "" -#: library/turtle.rst:1189 +#: library/turtle.rst:1197 msgid "" ">>> turtle.fillcolor(\"violet\")\n" ">>> turtle.fillcolor()\n" @@ -1742,54 +1751,54 @@ msgid "" "(255.0, 255.0, 255.0)" msgstr "" -#: library/turtle.rst:1207 +#: library/turtle.rst:1215 msgid "Return or set pencolor and fillcolor." msgstr "" -#: library/turtle.rst:1209 +#: library/turtle.rst:1217 msgid "" "Several input formats are allowed. They use 0 to 3 arguments as follows:" msgstr "" -#: library/turtle.rst:1212 +#: library/turtle.rst:1220 msgid "``color()``" msgstr "" -#: library/turtle.rst:1213 +#: library/turtle.rst:1221 msgid "" "Return the current pencolor and the current fillcolor as a pair of color " "specification strings or tuples as returned by :func:`pencolor` and :func:" "`fillcolor`." msgstr "" -#: library/turtle.rst:1217 +#: library/turtle.rst:1225 msgid "``color(colorstring)``, ``color((r,g,b))``, ``color(r,g,b)``" msgstr "" -#: library/turtle.rst:1218 +#: library/turtle.rst:1226 msgid "" "Inputs as in :func:`pencolor`, set both, fillcolor and pencolor, to the " "given value." msgstr "" -#: library/turtle.rst:1221 +#: library/turtle.rst:1229 msgid "" "``color(colorstring1, colorstring2)``, ``color((r1,g1,b1), (r2,g2,b2))``" msgstr "" -#: library/turtle.rst:1222 +#: library/turtle.rst:1230 msgid "" "Equivalent to ``pencolor(colorstring1)`` and ``fillcolor(colorstring2)`` and " "analogously if the other input format is used." msgstr "" -#: library/turtle.rst:1225 +#: library/turtle.rst:1233 msgid "" "If turtleshape is a polygon, outline and interior of that polygon is drawn " "with the newly set colors." msgstr "" -#: library/turtle.rst:1228 +#: library/turtle.rst:1236 msgid "" ">>> turtle.color(\"red\", \"green\")\n" ">>> turtle.color()\n" @@ -1799,15 +1808,15 @@ msgid "" "((40.0, 80.0, 120.0), (160.0, 200.0, 240.0))" msgstr "" -#: library/turtle.rst:1239 +#: library/turtle.rst:1247 msgid "See also: Screen method :func:`colormode`." msgstr "" -#: library/turtle.rst:1253 +#: library/turtle.rst:1261 msgid "Return fillstate (``True`` if filling, ``False`` else)." msgstr "" -#: library/turtle.rst:1255 +#: library/turtle.rst:1263 msgid "" ">>> turtle.begin_fill()\n" ">>> if turtle.filling():\n" @@ -1816,15 +1825,15 @@ msgid "" "... turtle.pensize(3)" msgstr "" -#: library/turtle.rst:1268 +#: library/turtle.rst:1276 msgid "To be called just before drawing a shape to be filled." msgstr "" -#: library/turtle.rst:1273 +#: library/turtle.rst:1281 msgid "Fill the shape drawn after the last call to :func:`begin_fill`." msgstr "" -#: library/turtle.rst:1275 +#: library/turtle.rst:1283 msgid "" "Whether or not overlap regions for self-intersecting polygons or multiple " "shapes are filled depends on the operating system graphics, type of overlap, " @@ -1832,7 +1841,7 @@ msgid "" "all yellow or have some white regions." msgstr "" -#: library/turtle.rst:1280 +#: library/turtle.rst:1288 msgid "" ">>> turtle.color(\"black\", \"red\")\n" ">>> turtle.begin_fill()\n" @@ -1840,13 +1849,13 @@ msgid "" ">>> turtle.end_fill()" msgstr "" -#: library/turtle.rst:1294 +#: library/turtle.rst:1302 msgid "" "Delete the turtle's drawings from the screen, re-center the turtle and set " "variables to the default values." msgstr "" -#: library/turtle.rst:1297 +#: library/turtle.rst:1305 msgid "" ">>> turtle.goto(0,-22)\n" ">>> turtle.left(100)\n" @@ -1861,30 +1870,30 @@ msgid "" "0.0" msgstr "" -#: library/turtle.rst:1315 +#: library/turtle.rst:1323 msgid "" "Delete the turtle's drawings from the screen. Do not move turtle. State " "and position of the turtle as well as drawings of other turtles are not " "affected." msgstr "" -#: library/turtle.rst:1321 +#: library/turtle.rst:1329 msgid "object to be written to the TurtleScreen" msgstr "" -#: library/turtle.rst:1322 +#: library/turtle.rst:1330 msgid "True/False" msgstr "" -#: library/turtle.rst:1323 +#: library/turtle.rst:1331 msgid "one of the strings \"left\", \"center\" or right\"" msgstr "" -#: library/turtle.rst:1324 +#: library/turtle.rst:1332 msgid "a triple (fontname, fontsize, fonttype)" msgstr "" -#: library/turtle.rst:1326 +#: library/turtle.rst:1334 msgid "" "Write text - the string representation of *arg* - at the current turtle " "position according to *align* (\"left\", \"center\" or \"right\") and with " @@ -1892,34 +1901,34 @@ msgid "" "corner of the text. By default, *move* is ``False``." msgstr "" -#: library/turtle.rst:1344 +#: library/turtle.rst:1352 msgid "" "Make the turtle invisible. It's a good idea to do this while you're in the " "middle of doing some complex drawing, because hiding the turtle speeds up " "the drawing observably." msgstr "" -#: library/turtle.rst:1348 +#: library/turtle.rst:1356 msgid ">>> turtle.hideturtle()" msgstr "" -#: library/turtle.rst:1357 +#: library/turtle.rst:1365 msgid "Make the turtle visible." msgstr "" -#: library/turtle.rst:1359 +#: library/turtle.rst:1367 msgid ">>> turtle.showturtle()" msgstr "" -#: library/turtle.rst:1367 +#: library/turtle.rst:1375 msgid "Return ``True`` if the Turtle is shown, ``False`` if it's hidden." msgstr "" -#: library/turtle.rst:1382 +#: library/turtle.rst:1390 msgid "a string which is a valid shapename" msgstr "" -#: library/turtle.rst:1384 +#: library/turtle.rst:1392 msgid "" "Set turtle shape to shape with given *name* or, if name is not given, return " "name of current shape. Shape with *name* must exist in the TurtleScreen's " @@ -1929,7 +1938,7 @@ msgid "" "`register_shape`." msgstr "" -#: library/turtle.rst:1390 +#: library/turtle.rst:1398 msgid "" ">>> turtle.shape()\n" "'classic'\n" @@ -1938,40 +1947,40 @@ msgid "" "'turtle'" msgstr "" -#: library/turtle.rst:1402 +#: library/turtle.rst:1410 msgid "one of the strings \"auto\", \"user\", \"noresize\"" msgstr "" -#: library/turtle.rst:1404 +#: library/turtle.rst:1412 msgid "" "Set resizemode to one of the values: \"auto\", \"user\", \"noresize\". If " "*rmode* is not given, return current resizemode. Different resizemodes have " "the following effects:" msgstr "" -#: library/turtle.rst:1408 +#: library/turtle.rst:1416 msgid "" "\"auto\": adapts the appearance of the turtle corresponding to the value of " "pensize." msgstr "" -#: library/turtle.rst:1409 +#: library/turtle.rst:1417 msgid "" "\"user\": adapts the appearance of the turtle according to the values of " "stretchfactor and outlinewidth (outline), which are set by :func:`shapesize`." msgstr "" -#: library/turtle.rst:1412 +#: library/turtle.rst:1420 msgid "\"noresize\": no adaption of the turtle's appearance takes place." msgstr "" -#: library/turtle.rst:1414 +#: library/turtle.rst:1422 msgid "" "``resizemode(\"user\")`` is called by :func:`shapesize` when used with " "arguments." msgstr "" -#: library/turtle.rst:1416 +#: library/turtle.rst:1424 msgid "" ">>> turtle.resizemode()\n" "'noresize'\n" @@ -1980,11 +1989,11 @@ msgid "" "'auto'" msgstr "" -#: library/turtle.rst:1430 library/turtle.rst:1431 +#: library/turtle.rst:1438 library/turtle.rst:1439 msgid "positive number" msgstr "" -#: library/turtle.rst:1433 +#: library/turtle.rst:1441 msgid "" "Return or set the pen's attributes x/y-stretchfactors and/or outline. Set " "resizemode to \"user\". If and only if resizemode is set to \"user\", the " @@ -1994,7 +2003,7 @@ msgid "" "determines the width of the shape's outline." msgstr "" -#: library/turtle.rst:1440 +#: library/turtle.rst:1448 msgid "" ">>> turtle.shapesize()\n" "(1.0, 1.0, 1)\n" @@ -2007,11 +2016,11 @@ msgid "" "(5, 5, 8)" msgstr "" -#: library/turtle.rst:2115 library/turtle.rst:2117 +#: library/turtle.rst:2101 library/turtle.rst:2103 msgid "number (optional)" msgstr "" -#: library/turtle.rst:1458 +#: library/turtle.rst:1466 msgid "" "Set or return the current shearfactor. Shear the turtleshape according to " "the given shearfactor shear, which is the tangent of the shear angle. Do " @@ -2020,7 +2029,7 @@ msgid "" "by which lines parallel to the heading of the turtle are sheared." msgstr "" -#: library/turtle.rst:1465 +#: library/turtle.rst:1473 msgid "" ">>> turtle.shape(\"circle\")\n" ">>> turtle.shapesize(5,2)\n" @@ -2029,13 +2038,13 @@ msgid "" "0.5" msgstr "" -#: library/turtle.rst:1479 +#: library/turtle.rst:1487 msgid "" "Rotate the turtleshape by *angle* from its current tilt-angle, but do *not* " "change the turtle's heading (direction of movement)." msgstr "" -#: library/turtle.rst:1482 +#: library/turtle.rst:1490 msgid "" ">>> turtle.reset()\n" ">>> turtle.shape(\"circle\")\n" @@ -2046,29 +2055,11 @@ msgid "" ">>> turtle.fd(50)" msgstr "" -#: library/turtle.rst:1498 -msgid "" -"Rotate the turtleshape to point in the direction specified by *angle*, " -"regardless of its current tilt-angle. *Do not* change the turtle's heading " -"(direction of movement)." -msgstr "" - -#: library/turtle.rst:1502 -msgid "" -">>> turtle.reset()\n" -">>> turtle.shape(\"circle\")\n" -">>> turtle.shapesize(5,2)\n" -">>> turtle.settiltangle(45)\n" -">>> turtle.fd(50)\n" -">>> turtle.settiltangle(-45)\n" -">>> turtle.fd(50)" -msgstr "" - -#: library/turtle.rst:1541 library/turtle.rst:1543 library/turtle.rst:1544 +#: library/turtle.rst:1527 library/turtle.rst:1529 library/turtle.rst:1530 msgid "a number (optional)" msgstr "" -#: library/turtle.rst:1520 +#: library/turtle.rst:1506 msgid "" "Set or return the current tilt-angle. If angle is given, rotate the " "turtleshape to point in the direction specified by angle, regardless of its " @@ -2078,7 +2069,7 @@ msgid "" "turtle (its direction of movement)." msgstr "" -#: library/turtle.rst:1528 +#: library/turtle.rst:1514 msgid "" ">>> turtle.reset()\n" ">>> turtle.shape(\"circle\")\n" @@ -2088,11 +2079,11 @@ msgid "" "45.0" msgstr "" -#: library/turtle.rst:1546 +#: library/turtle.rst:1532 msgid "Set or return the current transformation matrix of the turtle shape." msgstr "" -#: library/turtle.rst:1548 +#: library/turtle.rst:1534 msgid "" "If none of the matrix elements are given, return the transformation matrix " "as a tuple of 4 elements. Otherwise set the given elements and transform the " @@ -2102,7 +2093,7 @@ msgid "" "tiltangle according to the given matrix." msgstr "" -#: library/turtle.rst:1557 +#: library/turtle.rst:1543 msgid "" ">>> turtle = Turtle()\n" ">>> turtle.shape(\"square\")\n" @@ -2112,13 +2103,13 @@ msgid "" "(4.0, -1.0, -0.0, 2.0)" msgstr "" -#: library/turtle.rst:1570 +#: library/turtle.rst:1556 msgid "" "Return the current shape polygon as tuple of coordinate pairs. This can be " "used to define a new shape or components of a compound shape." msgstr "" -#: library/turtle.rst:1573 +#: library/turtle.rst:1559 msgid "" ">>> turtle.shape(\"square\")\n" ">>> turtle.shapetransform(4, -1, 0, 2)\n" @@ -2126,30 +2117,30 @@ msgid "" "((50, -20), (30, 20), (-50, 20), (-30, -20))" msgstr "" -#: library/turtle.rst:1610 library/turtle.rst:2039 +#: library/turtle.rst:1596 library/turtle.rst:2025 msgid "" "a function with two arguments which will be called with the coordinates of " "the clicked point on the canvas" msgstr "" -#: library/turtle.rst:1612 library/turtle.rst:2041 +#: library/turtle.rst:1598 library/turtle.rst:2027 msgid "number of the mouse-button, defaults to 1 (left mouse button)" msgstr "" -#: library/turtle.rst:1613 library/turtle.rst:2042 +#: library/turtle.rst:1599 library/turtle.rst:2028 msgid "" "``True`` or ``False`` -- if ``True``, a new binding will be added, otherwise " "it will replace a former binding" msgstr "" -#: library/turtle.rst:1594 +#: library/turtle.rst:1580 msgid "" "Bind *fun* to mouse-click events on this turtle. If *fun* is ``None``, " "existing bindings are removed. Example for the anonymous turtle, i.e. the " "procedural way:" msgstr "" -#: library/turtle.rst:1598 +#: library/turtle.rst:1584 msgid "" ">>> def turn(x, y):\n" "... left(180)\n" @@ -2158,13 +2149,13 @@ msgid "" ">>> onclick(None) # event-binding will be removed" msgstr "" -#: library/turtle.rst:1616 +#: library/turtle.rst:1602 msgid "" "Bind *fun* to mouse-button-release events on this turtle. If *fun* is " "``None``, existing bindings are removed." msgstr "" -#: library/turtle.rst:1619 +#: library/turtle.rst:1605 msgid "" ">>> class MyTurtle(Turtle):\n" "... def glow(self,x,y):\n" @@ -2178,45 +2169,45 @@ msgid "" ">>> turtle.onrelease(turtle.unglow) # releasing turns it to transparent." msgstr "" -#: library/turtle.rst:1641 +#: library/turtle.rst:1627 msgid "" "Bind *fun* to mouse-move events on this turtle. If *fun* is ``None``, " "existing bindings are removed." msgstr "" -#: library/turtle.rst:1644 +#: library/turtle.rst:1630 msgid "" "Remark: Every sequence of mouse-move-events on a turtle is preceded by a " "mouse-click event on that turtle." msgstr "" -#: library/turtle.rst:1647 +#: library/turtle.rst:1633 msgid ">>> turtle.ondrag(turtle.goto)" msgstr "" -#: library/turtle.rst:1652 +#: library/turtle.rst:1638 msgid "" "Subsequently, clicking and dragging the Turtle will move it across the " "screen thereby producing handdrawings (if pen is down)." msgstr "" -#: library/turtle.rst:1661 +#: library/turtle.rst:1647 msgid "" "Start recording the vertices of a polygon. Current turtle position is first " "vertex of polygon." msgstr "" -#: library/turtle.rst:1667 +#: library/turtle.rst:1653 msgid "" "Stop recording the vertices of a polygon. Current turtle position is last " "vertex of polygon. This will be connected with the first vertex." msgstr "" -#: library/turtle.rst:1673 +#: library/turtle.rst:1659 msgid "Return the last recorded polygon." msgstr "" -#: library/turtle.rst:1675 +#: library/turtle.rst:1661 msgid "" ">>> turtle.home()\n" ">>> turtle.begin_poly()\n" @@ -2230,25 +2221,25 @@ msgid "" ">>> register_shape(\"myFavouriteShape\", p)" msgstr "" -#: library/turtle.rst:1692 +#: library/turtle.rst:1678 msgid "" "Create and return a clone of the turtle with same position, heading and " "turtle properties." msgstr "" -#: library/turtle.rst:1695 +#: library/turtle.rst:1681 msgid "" ">>> mick = Turtle()\n" ">>> joe = mick.clone()" msgstr "" -#: library/turtle.rst:1705 +#: library/turtle.rst:1691 msgid "" "Return the Turtle object itself. Only reasonable use: as a function to " "return the \"anonymous turtle\":" msgstr "" -#: library/turtle.rst:1708 +#: library/turtle.rst:1694 msgid "" ">>> pet = getturtle()\n" ">>> pet.fd(50)\n" @@ -2256,13 +2247,13 @@ msgid "" "" msgstr "" -#: library/turtle.rst:1719 +#: library/turtle.rst:1705 msgid "" "Return the :class:`TurtleScreen` object the turtle is drawing on. " "TurtleScreen methods can then be called for that object." msgstr "" -#: library/turtle.rst:1722 +#: library/turtle.rst:1708 msgid "" ">>> ts = turtle.getscreen()\n" ">>> ts\n" @@ -2270,11 +2261,11 @@ msgid "" ">>> ts.bgcolor(\"pink\")" msgstr "" -#: library/turtle.rst:1733 +#: library/turtle.rst:1719 msgid "an integer or ``None``" msgstr "" -#: library/turtle.rst:1735 +#: library/turtle.rst:1721 msgid "" "Set or disable undobuffer. If *size* is an integer, an empty undobuffer of " "given size is installed. *size* gives the maximum number of turtle actions " @@ -2282,46 +2273,46 @@ msgid "" "``None``, the undobuffer is disabled." msgstr "" -#: library/turtle.rst:1740 +#: library/turtle.rst:1726 msgid ">>> turtle.setundobuffer(42)" msgstr "" -#: library/turtle.rst:1748 +#: library/turtle.rst:1734 msgid "Return number of entries in the undobuffer." msgstr "" -#: library/turtle.rst:1750 +#: library/turtle.rst:1736 msgid "" ">>> while undobufferentries():\n" "... undo()" msgstr "" -#: library/turtle.rst:1761 +#: library/turtle.rst:1747 msgid "Compound shapes" msgstr "" -#: library/turtle.rst:1763 +#: library/turtle.rst:1749 msgid "" "To use compound turtle shapes, which consist of several polygons of " "different color, you must use the helper class :class:`Shape` explicitly as " "described below:" msgstr "" -#: library/turtle.rst:1767 +#: library/turtle.rst:1753 msgid "Create an empty Shape object of type \"compound\"." msgstr "" -#: library/turtle.rst:1768 +#: library/turtle.rst:1754 msgid "" "Add as many components to this object as desired, using the :meth:`~Shape." "addcomponent` method." msgstr "" -#: library/turtle.rst:1771 +#: library/turtle.rst:1757 msgid "For example:" msgstr "" -#: library/turtle.rst:1773 +#: library/turtle.rst:1759 msgid "" ">>> s = Shape(\"compound\")\n" ">>> poly1 = ((0,0),(10,-5),(0,10),(-10,-5))\n" @@ -2330,44 +2321,44 @@ msgid "" ">>> s.addcomponent(poly2, \"blue\", \"red\")" msgstr "" -#: library/turtle.rst:1782 +#: library/turtle.rst:1768 msgid "Now add the Shape to the Screen's shapelist and use it:" msgstr "" -#: library/turtle.rst:1784 +#: library/turtle.rst:1770 msgid "" ">>> register_shape(\"myshape\", s)\n" ">>> shape(\"myshape\")" msgstr "" -#: library/turtle.rst:1793 +#: library/turtle.rst:1779 msgid "" "The :class:`Shape` class is used internally by the :func:`register_shape` " "method in different ways. The application programmer has to deal with the " "Shape class *only* when using compound shapes like shown above!" msgstr "" -#: library/turtle.rst:1799 +#: library/turtle.rst:1785 msgid "Methods of TurtleScreen/Screen and corresponding functions" msgstr "" -#: library/turtle.rst:1801 +#: library/turtle.rst:1787 msgid "" "Most of the examples in this section refer to a TurtleScreen instance called " "``screen``." msgstr "" -#: library/turtle.rst:1815 +#: library/turtle.rst:1801 msgid "" "a color string or three numbers in the range 0..colormode or a 3-tuple of " "such numbers" msgstr "" -#: library/turtle.rst:1819 +#: library/turtle.rst:1805 msgid "Set or return background color of the TurtleScreen." msgstr "" -#: library/turtle.rst:1821 +#: library/turtle.rst:1807 msgid "" ">>> screen.bgcolor(\"orange\")\n" ">>> screen.bgcolor()\n" @@ -2377,11 +2368,11 @@ msgid "" "(128.0, 0.0, 128.0)" msgstr "" -#: library/turtle.rst:1834 +#: library/turtle.rst:1820 msgid "a string, name of a gif-file or ``\"nopic\"``, or ``None``" msgstr "" -#: library/turtle.rst:1836 +#: library/turtle.rst:1822 msgid "" "Set background image or return name of current backgroundimage. If " "*picname* is a filename, set the corresponding image as background. If " @@ -2389,7 +2380,7 @@ msgid "" "*picname* is ``None``, return the filename of the current backgroundimage. ::" msgstr "" -#: library/turtle.rst:1841 +#: library/turtle.rst:1827 msgid "" ">>> screen.bgpic()\n" "'nopic'\n" @@ -2398,44 +2389,44 @@ msgid "" "\"landscape.gif\"" msgstr "" -#: library/turtle.rst:1852 +#: library/turtle.rst:1838 msgid "" "This TurtleScreen method is available as a global function only under the " "name ``clearscreen``. The global function ``clear`` is a different one " "derived from the Turtle method ``clear``." msgstr "" -#: library/turtle.rst:1859 +#: library/turtle.rst:1845 msgid "" "Delete all drawings and all turtles from the TurtleScreen. Reset the now " "empty TurtleScreen to its initial state: white background, no background " "image, no event bindings and tracing on." msgstr "" -#: library/turtle.rst:1868 +#: library/turtle.rst:1854 msgid "" "This TurtleScreen method is available as a global function only under the " "name ``resetscreen``. The global function ``reset`` is another one derived " "from the Turtle method ``reset``." msgstr "" -#: library/turtle.rst:1875 +#: library/turtle.rst:1861 msgid "Reset all Turtles on the Screen to their initial state." msgstr "" -#: library/turtle.rst:1880 +#: library/turtle.rst:1866 msgid "positive integer, new width of canvas in pixels" msgstr "" -#: library/turtle.rst:1881 +#: library/turtle.rst:1867 msgid "positive integer, new height of canvas in pixels" msgstr "" -#: library/turtle.rst:1882 +#: library/turtle.rst:1868 msgid "colorstring or color-tuple, new background color" msgstr "" -#: library/turtle.rst:1884 +#: library/turtle.rst:1870 msgid "" "If no arguments are given, return current (canvaswidth, canvasheight). Else " "resize the canvas the turtles are drawing on. Do not alter the drawing " @@ -2444,40 +2435,40 @@ msgid "" "outside the canvas before." msgstr "" -#: library/turtle.rst:1896 +#: library/turtle.rst:1882 msgid "e.g. to search for an erroneously escaped turtle ;-)" msgstr "" -#: library/turtle.rst:1901 +#: library/turtle.rst:1887 msgid "a number, x-coordinate of lower left corner of canvas" msgstr "" -#: library/turtle.rst:1902 +#: library/turtle.rst:1888 msgid "a number, y-coordinate of lower left corner of canvas" msgstr "" -#: library/turtle.rst:1903 +#: library/turtle.rst:1889 msgid "a number, x-coordinate of upper right corner of canvas" msgstr "" -#: library/turtle.rst:1904 +#: library/turtle.rst:1890 msgid "a number, y-coordinate of upper right corner of canvas" msgstr "" -#: library/turtle.rst:1906 +#: library/turtle.rst:1892 msgid "" "Set up user-defined coordinate system and switch to mode \"world\" if " "necessary. This performs a ``screen.reset()``. If mode \"world\" is " "already active, all drawings are redrawn according to the new coordinates." msgstr "" -#: library/turtle.rst:1910 +#: library/turtle.rst:1896 msgid "" "**ATTENTION**: in user-defined coordinate systems angles may appear " "distorted." msgstr "" -#: library/turtle.rst:1913 +#: library/turtle.rst:1899 msgid "" ">>> screen.reset()\n" ">>> screen.setworldcoordinates(-50,-7.5,50,7.5)\n" @@ -2488,22 +2479,22 @@ msgid "" "... left(45); fd(2) # a regular octagon" msgstr "" -#: library/turtle.rst:1938 +#: library/turtle.rst:1924 msgid "positive integer" msgstr "" -#: library/turtle.rst:1940 +#: library/turtle.rst:1926 msgid "" "Set or return the drawing *delay* in milliseconds. (This is approximately " "the time interval between two consecutive canvas updates.) The longer the " "drawing delay, the slower the animation." msgstr "" -#: library/turtle.rst:1944 +#: library/turtle.rst:1930 msgid "Optional argument:" msgstr "" -#: library/turtle.rst:1946 +#: library/turtle.rst:1932 msgid "" ">>> screen.delay()\n" "10\n" @@ -2512,11 +2503,11 @@ msgid "" "5" msgstr "" -#: library/turtle.rst:1959 +#: library/turtle.rst:1945 msgid "nonnegative integer" msgstr "" -#: library/turtle.rst:1961 +#: library/turtle.rst:1947 msgid "" "Turn turtle animation on/off and set delay for update drawings. If *n* is " "given, only each n-th regular screen update is really performed. (Can be " @@ -2525,7 +2516,7 @@ msgid "" "delay value (see :func:`delay`)." msgstr "" -#: library/turtle.rst:1968 +#: library/turtle.rst:1954 msgid "" ">>> screen.tracer(8, 25)\n" ">>> dist = 2\n" @@ -2535,37 +2526,37 @@ msgid "" "... dist += 2" msgstr "" -#: library/turtle.rst:1981 +#: library/turtle.rst:1967 msgid "Perform a TurtleScreen update. To be used when tracer is turned off." msgstr "" -#: library/turtle.rst:1983 +#: library/turtle.rst:1969 msgid "See also the RawTurtle/Turtle method :func:`speed`." msgstr "" -#: library/turtle.rst:1991 +#: library/turtle.rst:1977 msgid "" "Set focus on TurtleScreen (in order to collect key-events). Dummy arguments " "are provided in order to be able to pass :func:`listen` to the onclick " "method." msgstr "" -#: library/turtle.rst:2018 +#: library/turtle.rst:2004 msgid "a function with no arguments or ``None``" msgstr "" -#: library/turtle.rst:2019 +#: library/turtle.rst:2005 msgid "a string: key (e.g. \"a\") or key-symbol (e.g. \"space\")" msgstr "" -#: library/turtle.rst:2001 +#: library/turtle.rst:1987 msgid "" "Bind *fun* to key-release event of key. If *fun* is ``None``, event " "bindings are removed. Remark: in order to be able to register key-events, " "TurtleScreen must have the focus. (See method :func:`listen`.)" msgstr "" -#: library/turtle.rst:2005 +#: library/turtle.rst:1991 msgid "" ">>> def f():\n" "... fd(50)\n" @@ -2575,14 +2566,14 @@ msgid "" ">>> screen.listen()" msgstr "" -#: library/turtle.rst:2021 +#: library/turtle.rst:2007 msgid "" "Bind *fun* to key-press event of key if key is given, or to any key-press-" "event if no key is given. Remark: in order to be able to register key-" "events, TurtleScreen must have focus. (See method :func:`listen`.)" msgstr "" -#: library/turtle.rst:2026 +#: library/turtle.rst:2012 msgid "" ">>> def f():\n" "... fd(50)\n" @@ -2591,19 +2582,19 @@ msgid "" ">>> screen.listen()" msgstr "" -#: library/turtle.rst:2045 +#: library/turtle.rst:2031 msgid "" "Bind *fun* to mouse-click events on this screen. If *fun* is ``None``, " "existing bindings are removed." msgstr "" -#: library/turtle.rst:2048 +#: library/turtle.rst:2034 msgid "" "Example for a TurtleScreen instance named ``screen`` and a Turtle instance " "named ``turtle``:" msgstr "" -#: library/turtle.rst:2051 +#: library/turtle.rst:2037 msgid "" ">>> screen.onclick(turtle.goto) # Subsequently clicking into the " "TurtleScreen will\n" @@ -2612,26 +2603,26 @@ msgid "" ">>> screen.onclick(None) # remove event binding again" msgstr "" -#: library/turtle.rst:2059 +#: library/turtle.rst:2045 msgid "" "This TurtleScreen method is available as a global function only under the " "name ``onscreenclick``. The global function ``onclick`` is another one " "derived from the Turtle method ``onclick``." msgstr "" -#: library/turtle.rst:2066 +#: library/turtle.rst:2052 msgid "a function with no arguments" msgstr "" -#: library/turtle.rst:2067 +#: library/turtle.rst:2053 msgid "a number >= 0" msgstr "" -#: library/turtle.rst:2069 +#: library/turtle.rst:2055 msgid "Install a timer that calls *fun* after *t* milliseconds." msgstr "" -#: library/turtle.rst:2071 +#: library/turtle.rst:2057 msgid "" ">>> running = True\n" ">>> def f():\n" @@ -2643,7 +2634,7 @@ msgid "" ">>> running = False" msgstr "" -#: library/turtle.rst:2087 +#: library/turtle.rst:2073 msgid "" "Starts event loop - calling Tkinter's mainloop function. Must be the last " "statement in a turtle graphics program. Must *not* be used if a script is " @@ -2651,15 +2642,15 @@ msgid "" "turtle graphics. ::" msgstr "" -#: library/turtle.rst:2092 +#: library/turtle.rst:2078 msgid ">>> screen.mainloop()" msgstr "" -#: library/turtle.rst:2101 library/turtle.rst:2114 +#: library/turtle.rst:2087 library/turtle.rst:2100 msgid "string" msgstr "" -#: library/turtle.rst:2103 +#: library/turtle.rst:2089 msgid "" "Pop up a dialog window for input of a string. Parameter title is the title " "of the dialog window, prompt is a text mostly describing what information to " @@ -2667,11 +2658,11 @@ msgid "" "``None``. ::" msgstr "" -#: library/turtle.rst:2108 +#: library/turtle.rst:2094 msgid ">>> screen.textinput(\"NIM\", \"Name of first player:\")" msgstr "" -#: library/turtle.rst:2119 +#: library/turtle.rst:2105 msgid "" "Pop up a dialog window for input of a number. title is the title of the " "dialog window, prompt is a text mostly describing what numerical information " @@ -2682,23 +2673,23 @@ msgid "" "return ``None``. ::" msgstr "" -#: library/turtle.rst:2128 +#: library/turtle.rst:2114 msgid "" ">>> screen.numinput(\"Poker\", \"Your stakes:\", 1000, minval=10, " "maxval=10000)" msgstr "" -#: library/turtle.rst:2136 +#: library/turtle.rst:2122 msgid "one of the strings \"standard\", \"logo\" or \"world\"" msgstr "" -#: library/turtle.rst:2138 +#: library/turtle.rst:2124 msgid "" "Set turtle mode (\"standard\", \"logo\" or \"world\") and perform reset. If " "mode is not given, current mode is returned." msgstr "" -#: library/turtle.rst:2141 +#: library/turtle.rst:2127 msgid "" "Mode \"standard\" is compatible with old :mod:`turtle`. Mode \"logo\" is " "compatible with most Logo turtle graphics. Mode \"world\" uses user-defined " @@ -2706,60 +2697,60 @@ msgid "" "if ``x/y`` unit-ratio doesn't equal 1." msgstr "" -#: library/turtle.rst:2147 +#: library/turtle.rst:2133 msgid "Mode" msgstr "" -#: library/turtle.rst:2147 +#: library/turtle.rst:2133 msgid "Initial turtle heading" msgstr "" -#: library/turtle.rst:2147 +#: library/turtle.rst:2133 msgid "positive angles" msgstr "" -#: library/turtle.rst:2149 +#: library/turtle.rst:2135 msgid "\"standard\"" msgstr "" -#: library/turtle.rst:2149 +#: library/turtle.rst:2135 msgid "to the right (east)" msgstr "" -#: library/turtle.rst:2149 +#: library/turtle.rst:2135 msgid "counterclockwise" msgstr "" -#: library/turtle.rst:2150 +#: library/turtle.rst:2136 msgid "\"logo\"" msgstr "" -#: library/turtle.rst:2150 +#: library/turtle.rst:2136 msgid "upward (north)" msgstr "" -#: library/turtle.rst:2150 +#: library/turtle.rst:2136 msgid "clockwise" msgstr "" -#: library/turtle.rst:2153 +#: library/turtle.rst:2139 msgid "" ">>> mode(\"logo\") # resets turtle heading to north\n" ">>> mode()\n" "'logo'" msgstr "" -#: library/turtle.rst:2163 +#: library/turtle.rst:2149 msgid "one of the values 1.0 or 255" msgstr "" -#: library/turtle.rst:2165 +#: library/turtle.rst:2151 msgid "" "Return the colormode or set it to 1.0 or 255. Subsequently *r*, *g*, *b* " "values of color triples have to be in the range 0..*cmode*." msgstr "" -#: library/turtle.rst:2168 +#: library/turtle.rst:2154 msgid "" ">>> screen.colormode(1)\n" ">>> turtle.pencolor(240, 160, 80)\n" @@ -2774,114 +2765,114 @@ msgid "" ">>> turtle.pencolor(240,160,80)" msgstr "" -#: library/turtle.rst:2186 +#: library/turtle.rst:2172 msgid "" "Return the Canvas of this TurtleScreen. Useful for insiders who know what " "to do with a Tkinter Canvas." msgstr "" -#: library/turtle.rst:2189 +#: library/turtle.rst:2175 msgid "" ">>> cv = screen.getcanvas()\n" ">>> cv\n" "" msgstr "" -#: library/turtle.rst:2199 +#: library/turtle.rst:2185 msgid "Return a list of names of all currently available turtle shapes." msgstr "" -#: library/turtle.rst:2201 +#: library/turtle.rst:2187 msgid "" ">>> screen.getshapes()\n" "['arrow', 'blank', 'circle', ..., 'turtle']" msgstr "" -#: library/turtle.rst:2211 +#: library/turtle.rst:2197 msgid "There are three different ways to call this function:" msgstr "" -#: library/turtle.rst:2213 +#: library/turtle.rst:2199 msgid "" "*name* is the name of a gif-file and *shape* is ``None``: Install the " "corresponding image shape. ::" msgstr "" -#: library/turtle.rst:2216 +#: library/turtle.rst:2202 msgid ">>> screen.register_shape(\"turtle.gif\")" msgstr "" -#: library/turtle.rst:2219 +#: library/turtle.rst:2205 msgid "" "Image shapes *do not* rotate when turning the turtle, so they do not display " "the heading of the turtle!" msgstr "" -#: library/turtle.rst:2222 +#: library/turtle.rst:2208 msgid "" "*name* is an arbitrary string and *shape* is a tuple of pairs of " "coordinates: Install the corresponding polygon shape." msgstr "" -#: library/turtle.rst:2225 +#: library/turtle.rst:2211 msgid ">>> screen.register_shape(\"triangle\", ((5,-3), (0,5), (-5,-3)))" msgstr "" -#: library/turtle.rst:2230 +#: library/turtle.rst:2216 msgid "" "*name* is an arbitrary string and *shape* is a (compound) :class:`Shape` " "object: Install the corresponding compound shape." msgstr "" -#: library/turtle.rst:2233 +#: library/turtle.rst:2219 msgid "" "Add a turtle shape to TurtleScreen's shapelist. Only thusly registered " "shapes can be used by issuing the command ``shape(shapename)``." msgstr "" -#: library/turtle.rst:2239 +#: library/turtle.rst:2225 msgid "Return the list of turtles on the screen." msgstr "" -#: library/turtle.rst:2241 +#: library/turtle.rst:2227 msgid "" ">>> for turtle in screen.turtles():\n" "... turtle.color(\"red\")" msgstr "" -#: library/turtle.rst:2250 +#: library/turtle.rst:2236 msgid "Return the height of the turtle window. ::" msgstr "" -#: library/turtle.rst:2252 +#: library/turtle.rst:2238 msgid "" ">>> screen.window_height()\n" "480" msgstr "" -#: library/turtle.rst:2258 +#: library/turtle.rst:2244 msgid "Return the width of the turtle window. ::" msgstr "" -#: library/turtle.rst:2260 +#: library/turtle.rst:2246 msgid "" ">>> screen.window_width()\n" "640" msgstr "" -#: library/turtle.rst:2267 +#: library/turtle.rst:2253 msgid "Methods specific to Screen, not inherited from TurtleScreen" msgstr "" -#: library/turtle.rst:2271 +#: library/turtle.rst:2257 msgid "Shut the turtlegraphics window." msgstr "" -#: library/turtle.rst:2276 +#: library/turtle.rst:2262 msgid "Bind ``bye()`` method to mouse clicks on the Screen." msgstr "" -#: library/turtle.rst:2279 +#: library/turtle.rst:2265 msgid "" "If the value \"using_IDLE\" in the configuration dictionary is ``False`` " "(default value), also enter mainloop. Remark: If IDLE with the ``-n`` " @@ -2890,38 +2881,38 @@ msgid "" "client script." msgstr "" -#: library/turtle.rst:2288 +#: library/turtle.rst:2274 msgid "" "Set the size and position of the main window. Default values of arguments " "are stored in the configuration dictionary and can be changed via a :file:" "`turtle.cfg` file." msgstr "" -#: library/turtle.rst:2292 +#: library/turtle.rst:2278 msgid "" "if an integer, a size in pixels, if a float, a fraction of the screen; " "default is 50% of screen" msgstr "" -#: library/turtle.rst:2294 +#: library/turtle.rst:2280 msgid "" "if an integer, the height in pixels, if a float, a fraction of the screen; " "default is 75% of screen" msgstr "" -#: library/turtle.rst:2296 +#: library/turtle.rst:2282 msgid "" "if positive, starting position in pixels from the left edge of the screen, " "if negative from the right edge, if ``None``, center window horizontally" msgstr "" -#: library/turtle.rst:2299 +#: library/turtle.rst:2285 msgid "" "if positive, starting position in pixels from the top edge of the screen, if " "negative from the bottom edge, if ``None``, center window vertically" msgstr "" -#: library/turtle.rst:2303 +#: library/turtle.rst:2289 msgid "" ">>> screen.setup (width=200, height=200, startx=0, starty=0)\n" ">>> # sets window to 200x200 pixels, in upper left of screen\n" @@ -2929,128 +2920,128 @@ msgid "" ">>> # sets window to 75% of screen by 50% of screen and centers" msgstr "" -#: library/turtle.rst:2314 +#: library/turtle.rst:2300 msgid "a string that is shown in the titlebar of the turtle graphics window" msgstr "" -#: library/turtle.rst:2317 +#: library/turtle.rst:2303 msgid "Set title of turtle window to *titlestring*." msgstr "" -#: library/turtle.rst:2319 +#: library/turtle.rst:2305 msgid ">>> screen.title(\"Welcome to the turtle zoo!\")" msgstr "" -#: library/turtle.rst:2326 +#: library/turtle.rst:2312 msgid "Public classes" msgstr "" -#: library/turtle.rst:2332 +#: library/turtle.rst:2318 msgid "" "a :class:`!tkinter.Canvas`, a :class:`ScrolledCanvas` or a :class:" "`TurtleScreen`" msgstr "" -#: library/turtle.rst:2335 +#: library/turtle.rst:2321 msgid "" "Create a turtle. The turtle has all methods described above as \"methods of " "Turtle/RawTurtle\"." msgstr "" -#: library/turtle.rst:2341 +#: library/turtle.rst:2327 msgid "" "Subclass of RawTurtle, has the same interface but draws on a default :class:" "`Screen` object created automatically when needed for the first time." msgstr "" -#: library/turtle.rst:2347 +#: library/turtle.rst:2333 msgid "a :class:`!tkinter.Canvas`" msgstr "" -#: library/turtle.rst:2349 +#: library/turtle.rst:2335 msgid "" "Provides screen oriented methods like :func:`bgcolor` etc. that are " "described above." msgstr "" -#: library/turtle.rst:2354 +#: library/turtle.rst:2340 msgid "" "Subclass of TurtleScreen, with :ref:`four methods added `." msgstr "" -#: library/turtle.rst:2359 +#: library/turtle.rst:2345 msgid "" "some Tkinter widget to contain the ScrolledCanvas, i.e. a Tkinter-canvas " "with scrollbars added" msgstr "" -#: library/turtle.rst:2362 +#: library/turtle.rst:2348 msgid "" "Used by class Screen, which thus automatically provides a ScrolledCanvas as " "playground for the turtles." msgstr "" -#: library/turtle.rst:2367 +#: library/turtle.rst:2353 msgid "one of the strings \"polygon\", \"image\", \"compound\"" msgstr "" -#: library/turtle.rst:2369 +#: library/turtle.rst:2355 msgid "" "Data structure modeling shapes. The pair ``(type_, data)`` must follow this " "specification:" msgstr "" -#: library/turtle.rst:2374 +#: library/turtle.rst:2360 msgid "*type_*" msgstr "" -#: library/turtle.rst:2374 +#: library/turtle.rst:2360 msgid "*data*" msgstr "" -#: library/turtle.rst:2376 +#: library/turtle.rst:2362 msgid "\"polygon\"" msgstr "" -#: library/turtle.rst:2376 +#: library/turtle.rst:2362 msgid "a polygon-tuple, i.e. a tuple of pairs of coordinates" msgstr "" -#: library/turtle.rst:2377 +#: library/turtle.rst:2363 msgid "\"image\"" msgstr "" -#: library/turtle.rst:2377 +#: library/turtle.rst:2363 msgid "an image (in this form only used internally!)" msgstr "" -#: library/turtle.rst:2378 +#: library/turtle.rst:2364 msgid "\"compound\"" msgstr "" -#: library/turtle.rst:2378 +#: library/turtle.rst:2364 msgid "" "``None`` (a compound shape has to be constructed using the :meth:" "`addcomponent` method)" msgstr "" -#: library/turtle.rst:2384 +#: library/turtle.rst:2370 msgid "a polygon, i.e. a tuple of pairs of numbers" msgstr "" -#: library/turtle.rst:2385 +#: library/turtle.rst:2371 msgid "a color the *poly* will be filled with" msgstr "" -#: library/turtle.rst:2386 +#: library/turtle.rst:2372 msgid "a color for the poly's outline (if given)" msgstr "" -#: library/turtle.rst:2388 +#: library/turtle.rst:2374 msgid "Example:" msgstr "" -#: library/turtle.rst:2390 +#: library/turtle.rst:2376 msgid "" ">>> poly = ((0,0),(10,-5),(0,10),(-10,-5))\n" ">>> s = Shape(\"compound\")\n" @@ -3058,63 +3049,63 @@ msgid "" ">>> # ... add more components and then use register_shape()" msgstr "" -#: library/turtle.rst:2398 +#: library/turtle.rst:2384 msgid "See :ref:`compoundshapes`." msgstr "" -#: library/turtle.rst:2403 +#: library/turtle.rst:2389 msgid "" "A two-dimensional vector class, used as a helper class for implementing " "turtle graphics. May be useful for turtle graphics programs too. Derived " "from tuple, so a vector is a tuple!" msgstr "" -#: library/turtle.rst:2407 +#: library/turtle.rst:2393 msgid "Provides (for *a*, *b* vectors, *k* number):" msgstr "" -#: library/turtle.rst:2409 +#: library/turtle.rst:2395 msgid "``a + b`` vector addition" msgstr "" -#: library/turtle.rst:2410 +#: library/turtle.rst:2396 msgid "``a - b`` vector subtraction" msgstr "" -#: library/turtle.rst:2411 +#: library/turtle.rst:2397 msgid "``a * b`` inner product" msgstr "" -#: library/turtle.rst:2412 +#: library/turtle.rst:2398 msgid "``k * a`` and ``a * k`` multiplication with scalar" msgstr "" -#: library/turtle.rst:2413 +#: library/turtle.rst:2399 msgid "``abs(a)`` absolute value of a" msgstr "" -#: library/turtle.rst:2414 +#: library/turtle.rst:2400 msgid "``a.rotate(angle)`` rotation" msgstr "" -#: library/turtle.rst:2420 +#: library/turtle.rst:2406 msgid "Explanation" msgstr "" -#: library/turtle.rst:2422 +#: library/turtle.rst:2408 msgid "" "A turtle object draws on a screen object, and there a number of key classes " "in the turtle object-oriented interface that can be used to create them and " "relate them to each other." msgstr "" -#: library/turtle.rst:2426 +#: library/turtle.rst:2412 msgid "" "A :class:`Turtle` instance will automatically create a :class:`Screen` " "instance if one is not already present." msgstr "" -#: library/turtle.rst:2429 +#: library/turtle.rst:2415 msgid "" "``Turtle`` is a subclass of :class:`RawTurtle`, which *doesn't* " "automatically create a drawing surface - a *canvas* will need to be provided " @@ -3122,7 +3113,7 @@ msgid "" "`ScrolledCanvas` or :class:`TurtleScreen`." msgstr "" -#: library/turtle.rst:2435 +#: library/turtle.rst:2421 msgid "" ":class:`TurtleScreen` is the basic drawing surface for a turtle. :class:" "`Screen` is a subclass of ``TurtleScreen``, and includes :ref:`some " @@ -3131,7 +3122,7 @@ msgid "" "`!tkinter.Canvas` or a :class:`ScrolledCanvas` as an argument." msgstr "" -#: library/turtle.rst:2442 +#: library/turtle.rst:2428 msgid "" "The functional interface for turtle graphics uses the various methods of " "``Turtle`` and ``TurtleScreen``/``Screen``. Behind the scenes, a screen " @@ -3140,38 +3131,38 @@ msgid "" "created whenever any of the functions derived from a Turtle method is called." msgstr "" -#: library/turtle.rst:2448 +#: library/turtle.rst:2434 msgid "" "To use multiple turtles on a screen, the object-oriented interface must be " "used." msgstr "" -#: library/turtle.rst:2453 +#: library/turtle.rst:2439 msgid "Help and configuration" msgstr "" -#: library/turtle.rst:2456 +#: library/turtle.rst:2442 msgid "How to use help" msgstr "" -#: library/turtle.rst:2458 +#: library/turtle.rst:2444 msgid "" "The public methods of the Screen and Turtle classes are documented " "extensively via docstrings. So these can be used as online-help via the " "Python help facilities:" msgstr "" -#: library/turtle.rst:2462 +#: library/turtle.rst:2448 msgid "" "When using IDLE, tooltips show the signatures and first lines of the " "docstrings of typed in function-/method calls." msgstr "" -#: library/turtle.rst:2465 +#: library/turtle.rst:2451 msgid "Calling :func:`help` on methods or functions displays the docstrings::" msgstr "" -#: library/turtle.rst:2467 +#: library/turtle.rst:2453 msgid "" ">>> help(Screen.bgcolor)\n" "Help on method bgcolor in module turtle:\n" @@ -3203,13 +3194,13 @@ msgid "" " >>> turtle.penup()" msgstr "" -#: library/turtle.rst:2496 +#: library/turtle.rst:2482 msgid "" "The docstrings of the functions which are derived from methods have a " "modified form::" msgstr "" -#: library/turtle.rst:2499 +#: library/turtle.rst:2485 msgid "" ">>> help(bgcolor)\n" "Help on function bgcolor in module turtle:\n" @@ -3243,28 +3234,28 @@ msgid "" " >>> penup()" msgstr "" -#: library/turtle.rst:2530 +#: library/turtle.rst:2516 msgid "" "These modified docstrings are created automatically together with the " "function definitions that are derived from the methods at import time." msgstr "" -#: library/turtle.rst:2535 +#: library/turtle.rst:2521 msgid "Translation of docstrings into different languages" msgstr "" -#: library/turtle.rst:2537 +#: library/turtle.rst:2523 msgid "" "There is a utility to create a dictionary the keys of which are the method " "names and the values of which are the docstrings of the public methods of " "the classes Screen and Turtle." msgstr "" -#: library/turtle.rst:2543 +#: library/turtle.rst:2529 msgid "a string, used as filename" msgstr "" -#: library/turtle.rst:2545 +#: library/turtle.rst:2531 msgid "" "Create and write docstring-dictionary to a Python script with the given " "filename. This function has to be called explicitly (it is not used by the " @@ -3273,37 +3264,37 @@ msgid "" "for translation of the docstrings into different languages." msgstr "" -#: library/turtle.rst:2551 +#: library/turtle.rst:2537 msgid "" "If you (or your students) want to use :mod:`turtle` with online help in your " "native language, you have to translate the docstrings and save the resulting " "file as e.g. :file:`turtle_docstringdict_german.py`." msgstr "" -#: library/turtle.rst:2555 +#: library/turtle.rst:2541 msgid "" "If you have an appropriate entry in your :file:`turtle.cfg` file this " "dictionary will be read in at import time and will replace the original " "English docstrings." msgstr "" -#: library/turtle.rst:2558 +#: library/turtle.rst:2544 msgid "" "At the time of this writing there are docstring dictionaries in German and " "in Italian. (Requests please to glingl@aon.at.)" msgstr "" -#: library/turtle.rst:2564 +#: library/turtle.rst:2550 msgid "How to configure Screen and Turtles" msgstr "" -#: library/turtle.rst:2566 +#: library/turtle.rst:2552 msgid "" "The built-in default configuration mimics the appearance and behaviour of " "the old turtle module in order to retain best possible compatibility with it." msgstr "" -#: library/turtle.rst:2569 +#: library/turtle.rst:2555 msgid "" "If you want to use a different configuration which better reflects the " "features of this module or which better fits to your needs, e.g. for use in " @@ -3312,12 +3303,12 @@ msgid "" "settings." msgstr "" -#: library/turtle.rst:2574 +#: library/turtle.rst:2560 msgid "" "The built in configuration would correspond to the following ``turtle.cfg``:" msgstr "" -#: library/turtle.rst:2576 +#: library/turtle.rst:2562 msgid "" "width = 0.5\n" "height = 0.75\n" @@ -3341,49 +3332,49 @@ msgid "" "using_IDLE = False" msgstr "" -#: library/turtle.rst:2599 +#: library/turtle.rst:2585 msgid "Short explanation of selected entries:" msgstr "" -#: library/turtle.rst:2601 +#: library/turtle.rst:2587 msgid "" "The first four lines correspond to the arguments of the :func:`Screen.setup " "` method." msgstr "" -#: library/turtle.rst:2603 +#: library/turtle.rst:2589 msgid "" "Line 5 and 6 correspond to the arguments of the method :func:`Screen." "screensize `." msgstr "" -#: library/turtle.rst:2605 +#: library/turtle.rst:2591 msgid "" "*shape* can be any of the built-in shapes, e.g: arrow, turtle, etc. For " "more info try ``help(shape)``." msgstr "" -#: library/turtle.rst:2607 +#: library/turtle.rst:2593 msgid "" "If you want to use no fill color (i.e. make the turtle transparent), you " "have to write ``fillcolor = \"\"`` (but all nonempty strings must not have " "quotes in the cfg file)." msgstr "" -#: library/turtle.rst:2610 +#: library/turtle.rst:2596 msgid "" "If you want to reflect the turtle its state, you have to use ``resizemode = " "auto``." msgstr "" -#: library/turtle.rst:2612 +#: library/turtle.rst:2598 msgid "" "If you set e.g. ``language = italian`` the docstringdict :file:" "`turtle_docstringdict_italian.py` will be loaded at import time (if present " "on the import path, e.g. in the same directory as :mod:`turtle`)." msgstr "" -#: library/turtle.rst:2615 +#: library/turtle.rst:2601 msgid "" "The entries *exampleturtle* and *examplescreen* define the names of these " "objects as they occur in the docstrings. The transformation of method-" @@ -3391,309 +3382,309 @@ msgid "" "docstrings." msgstr "" -#: library/turtle.rst:2619 +#: library/turtle.rst:2605 msgid "" "*using_IDLE*: Set this to ``True`` if you regularly work with IDLE and its " "``-n`` switch (\"no subprocess\"). This will prevent :func:`exitonclick` to " "enter the mainloop." msgstr "" -#: library/turtle.rst:2623 +#: library/turtle.rst:2609 msgid "" "There can be a :file:`turtle.cfg` file in the directory where :mod:`turtle` " "is stored and an additional one in the current working directory. The " "latter will override the settings of the first one." msgstr "" -#: library/turtle.rst:2627 +#: library/turtle.rst:2613 msgid "" "The :file:`Lib/turtledemo` directory contains a :file:`turtle.cfg` file. " "You can study it as an example and see its effects when running the demos " "(preferably not from within the demo-viewer)." msgstr "" -#: library/turtle.rst:2633 +#: library/turtle.rst:2619 msgid ":mod:`turtledemo` --- Demo scripts" msgstr "" -#: library/turtle.rst:2638 +#: library/turtle.rst:2624 msgid "" "The :mod:`turtledemo` package includes a set of demo scripts. These scripts " "can be run and viewed using the supplied demo viewer as follows::" msgstr "" -#: library/turtle.rst:2641 +#: library/turtle.rst:2627 msgid "python -m turtledemo" msgstr "" -#: library/turtle.rst:2643 +#: library/turtle.rst:2629 msgid "" "Alternatively, you can run the demo scripts individually. For example, ::" msgstr "" -#: library/turtle.rst:2645 +#: library/turtle.rst:2631 msgid "python -m turtledemo.bytedesign" msgstr "" -#: library/turtle.rst:2647 +#: library/turtle.rst:2633 msgid "The :mod:`turtledemo` package directory contains:" msgstr "" -#: library/turtle.rst:2649 +#: library/turtle.rst:2635 msgid "" "A demo viewer :file:`__main__.py` which can be used to view the sourcecode " "of the scripts and run them at the same time." msgstr "" -#: library/turtle.rst:2651 +#: library/turtle.rst:2637 msgid "" "Multiple scripts demonstrating different features of the :mod:`turtle` " "module. Examples can be accessed via the Examples menu. They can also be " "run standalone." msgstr "" -#: library/turtle.rst:2654 +#: library/turtle.rst:2640 msgid "" "A :file:`turtle.cfg` file which serves as an example of how to write and use " "such files." msgstr "" -#: library/turtle.rst:2657 +#: library/turtle.rst:2643 msgid "The demo scripts are:" msgstr "" -#: library/turtle.rst:2664 +#: library/turtle.rst:2650 msgid "Name" msgstr "" -#: library/turtle.rst:2664 +#: library/turtle.rst:2650 msgid "Description" msgstr "" -#: library/turtle.rst:2664 +#: library/turtle.rst:2650 msgid "Features" msgstr "" -#: library/turtle.rst:2666 +#: library/turtle.rst:2652 msgid "bytedesign" msgstr "" -#: library/turtle.rst:2666 +#: library/turtle.rst:2652 msgid "complex classical turtle graphics pattern" msgstr "" -#: library/turtle.rst:2666 +#: library/turtle.rst:2652 msgid ":func:`tracer`, delay, :func:`update`" msgstr "" -#: library/turtle.rst:2669 +#: library/turtle.rst:2655 msgid "chaos" msgstr "" -#: library/turtle.rst:2669 +#: library/turtle.rst:2655 msgid "" "graphs Verhulst dynamics, shows that computer's computations can generate " "results sometimes against the common sense expectations" msgstr "" -#: library/turtle.rst:2669 +#: library/turtle.rst:2655 msgid "world coordinates" msgstr "" -#: library/turtle.rst:2675 +#: library/turtle.rst:2661 msgid "clock" msgstr "" -#: library/turtle.rst:2675 +#: library/turtle.rst:2661 msgid "analog clock showing time of your computer" msgstr "" -#: library/turtle.rst:2675 +#: library/turtle.rst:2661 msgid "turtles as clock's hands, ontimer" msgstr "" -#: library/turtle.rst:2678 +#: library/turtle.rst:2664 msgid "colormixer" msgstr "" -#: library/turtle.rst:2678 +#: library/turtle.rst:2664 msgid "experiment with r, g, b" msgstr "" -#: library/turtle.rst:2680 +#: library/turtle.rst:2666 msgid "forest" msgstr "" -#: library/turtle.rst:2680 +#: library/turtle.rst:2666 msgid "3 breadth-first trees" msgstr "" -#: library/turtle.rst:2680 +#: library/turtle.rst:2666 msgid "randomization" msgstr "" -#: library/turtle.rst:2682 +#: library/turtle.rst:2668 msgid "fractalcurves" msgstr "" -#: library/turtle.rst:2682 +#: library/turtle.rst:2668 msgid "Hilbert & Koch curves" msgstr "" -#: library/turtle.rst:2682 +#: library/turtle.rst:2668 msgid "recursion" msgstr "" -#: library/turtle.rst:2684 +#: library/turtle.rst:2670 msgid "lindenmayer" msgstr "" -#: library/turtle.rst:2684 +#: library/turtle.rst:2670 msgid "ethnomathematics (indian kolams)" msgstr "" -#: library/turtle.rst:2684 +#: library/turtle.rst:2670 msgid "L-System" msgstr "" -#: library/turtle.rst:2687 +#: library/turtle.rst:2673 msgid "minimal_hanoi" msgstr "" -#: library/turtle.rst:2687 +#: library/turtle.rst:2673 msgid "Towers of Hanoi" msgstr "" -#: library/turtle.rst:2687 +#: library/turtle.rst:2673 msgid "Rectangular Turtles as Hanoi discs (shape, shapesize)" msgstr "" -#: library/turtle.rst:2691 +#: library/turtle.rst:2677 msgid "nim" msgstr "" -#: library/turtle.rst:2691 +#: library/turtle.rst:2677 msgid "" "play the classical nim game with three heaps of sticks against the computer." msgstr "" -#: library/turtle.rst:2691 +#: library/turtle.rst:2677 msgid "turtles as nimsticks, event driven (mouse, keyboard)" msgstr "" -#: library/turtle.rst:2695 +#: library/turtle.rst:2681 msgid "paint" msgstr "" -#: library/turtle.rst:2695 +#: library/turtle.rst:2681 msgid "super minimalistic drawing program" msgstr "" -#: library/turtle.rst:2698 +#: library/turtle.rst:2684 msgid "peace" msgstr "" -#: library/turtle.rst:2698 +#: library/turtle.rst:2684 msgid "elementary" msgstr "" -#: library/turtle.rst:2698 +#: library/turtle.rst:2684 msgid "turtle: appearance and animation" msgstr "" -#: library/turtle.rst:2701 +#: library/turtle.rst:2687 msgid "penrose" msgstr "" -#: library/turtle.rst:2701 +#: library/turtle.rst:2687 msgid "aperiodic tiling with kites and darts" msgstr "" -#: library/turtle.rst:2704 +#: library/turtle.rst:2690 msgid "planet_and_moon" msgstr "" -#: library/turtle.rst:2704 +#: library/turtle.rst:2690 msgid "simulation of gravitational system" msgstr "" -#: library/turtle.rst:2704 +#: library/turtle.rst:2690 msgid "compound shapes, :class:`Vec2D`" msgstr "" -#: library/turtle.rst:2707 +#: library/turtle.rst:2693 msgid "rosette" msgstr "" -#: library/turtle.rst:2707 +#: library/turtle.rst:2693 msgid "a pattern from the wikipedia article on turtle graphics" msgstr "" -#: library/turtle.rst:2707 +#: library/turtle.rst:2693 msgid ":func:`clone`, :func:`undo`" msgstr "" -#: library/turtle.rst:2710 +#: library/turtle.rst:2696 msgid "round_dance" msgstr "" -#: library/turtle.rst:2710 +#: library/turtle.rst:2696 msgid "dancing turtles rotating pairwise in opposite direction" msgstr "" -#: library/turtle.rst:2710 +#: library/turtle.rst:2696 msgid "compound shapes, clone shapesize, tilt, get_shapepoly, update" msgstr "" -#: library/turtle.rst:2714 +#: library/turtle.rst:2700 msgid "sorting_animate" msgstr "" -#: library/turtle.rst:2714 +#: library/turtle.rst:2700 msgid "visual demonstration of different sorting methods" msgstr "" -#: library/turtle.rst:2714 +#: library/turtle.rst:2700 msgid "simple alignment, randomization" msgstr "" -#: library/turtle.rst:2717 +#: library/turtle.rst:2703 msgid "tree" msgstr "" -#: library/turtle.rst:2717 +#: library/turtle.rst:2703 msgid "a (graphical) breadth first tree (using generators)" msgstr "" -#: library/turtle.rst:2720 +#: library/turtle.rst:2706 msgid "two_canvases" msgstr "" -#: library/turtle.rst:2720 +#: library/turtle.rst:2706 msgid "simple design" msgstr "" -#: library/turtle.rst:2720 +#: library/turtle.rst:2706 msgid "turtles on two canvases" msgstr "" -#: library/turtle.rst:2723 +#: library/turtle.rst:2709 msgid "yinyang" msgstr "" -#: library/turtle.rst:2723 +#: library/turtle.rst:2709 msgid "another elementary example" msgstr "" -#: library/turtle.rst:2726 +#: library/turtle.rst:2712 msgid "Have fun!" msgstr "" -#: library/turtle.rst:2730 +#: library/turtle.rst:2716 msgid "Changes since Python 2.6" msgstr "" -#: library/turtle.rst:2732 +#: library/turtle.rst:2718 msgid "" "The methods :func:`Turtle.tracer `, :func:`Turtle.window_width " "` and :func:`Turtle.window_height ` have been " @@ -3704,14 +3695,14 @@ msgid "" "methods.)" msgstr "" -#: library/turtle.rst:2740 +#: library/turtle.rst:2726 msgid "" "The method :func:`!Turtle.fill` has been eliminated. The behaviour of :func:" "`begin_fill` and :func:`end_fill` have changed slightly: now every filling " "process must be completed with an ``end_fill()`` call." msgstr "" -#: library/turtle.rst:2745 +#: library/turtle.rst:2731 msgid "" "A method :func:`Turtle.filling ` has been added. It returns a " "boolean value: ``True`` if a filling process is under way, ``False`` " @@ -3719,41 +3710,41 @@ msgid "" "in Python 2.6." msgstr "" -#: library/turtle.rst:2751 +#: library/turtle.rst:2737 msgid "Changes since Python 3.0" msgstr "" -#: library/turtle.rst:2753 +#: library/turtle.rst:2739 msgid "" "The :class:`Turtle` methods :func:`shearfactor`, :func:`shapetransform` and :" "func:`get_shapepoly` have been added. Thus the full range of regular linear " "transforms is now available for transforming turtle shapes. :func:" "`tiltangle` has been enhanced in functionality: it now can be used to get or " -"set the tilt angle. :func:`settiltangle` has been deprecated." +"set the tilt angle." msgstr "" -#: library/turtle.rst:2760 +#: library/turtle.rst:2745 msgid "" "The :class:`Screen` method :func:`onkeypress` has been added as a complement " "to :func:`onkey`. As the latter binds actions to the key release event, an " "alias: :func:`onkeyrelease` was also added for it." msgstr "" -#: library/turtle.rst:2764 +#: library/turtle.rst:2749 msgid "" "The method :func:`Screen.mainloop ` has been added, so there is no " "longer a need to use the standalone :func:`mainloop` function when working " "with :class:`Screen` and :class:`Turtle` objects." msgstr "" -#: library/turtle.rst:2768 +#: library/turtle.rst:2753 msgid "" "Two input methods have been added: :func:`Screen.textinput ` and :" "func:`Screen.numinput `. These pop up input dialogs and return " "strings and numbers respectively." msgstr "" -#: library/turtle.rst:2772 +#: library/turtle.rst:2757 msgid "" "Two example scripts :file:`tdemo_nim.py` and :file:`tdemo_round_dance.py` " "have been added to the :file:`Lib/turtledemo` directory." diff --git a/library/types.po b/library/types.po index 79aa950d..796e3110 100644 --- a/library/types.po +++ b/library/types.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -270,7 +270,7 @@ msgstr "" #: library/types.rst:201 msgid "" "The type for cell objects: such objects are used as containers for a " -"function's free variables." +"function's :term:`closure variables `." msgstr "" #: library/types.rst:209 @@ -509,30 +509,45 @@ msgid "Return a hash of the underlying mapping." msgstr "" #: library/types.rst:426 +msgid "The type of :ref:`capsule objects `." +msgstr "" + +#: library/types.rst:432 msgid "Additional Utility Classes and Functions" msgstr "" -#: library/types.rst:430 +#: library/types.rst:436 msgid "" "A simple :class:`object` subclass that provides attribute access to its " "namespace, as well as a meaningful repr." msgstr "" -#: library/types.rst:433 +#: library/types.rst:439 +msgid "" +"Unlike :class:`object`, with :class:`!SimpleNamespace` you can add and " +"remove attributes." +msgstr "" + +#: library/types.rst:442 msgid "" -"Unlike :class:`object`, with ``SimpleNamespace`` you can add and remove " -"attributes. If a ``SimpleNamespace`` object is initialized with keyword " -"arguments, those are directly added to the underlying namespace." +":py:class:`SimpleNamespace` objects may be initialized in the same way as :" +"class:`dict`: either with keyword arguments, with a single positional " +"argument, or with both. When initialized with keyword arguments, those are " +"directly added to the underlying namespace. Alternatively, when initialized " +"with a positional argument, the underlying namespace will be updated with " +"key-value pairs from that argument (either a mapping object or an :term:" +"`iterable` object producing key-value pairs). All such keys must be strings." msgstr "" -#: library/types.rst:437 +#: library/types.rst:453 msgid "The type is roughly equivalent to the following code::" msgstr "" -#: library/types.rst:439 +#: library/types.rst:455 msgid "" "class SimpleNamespace:\n" -" def __init__(self, /, **kwargs):\n" +" def __init__(self, mapping_or_iterable=(), /, **kwargs):\n" +" self.__dict__.update(mapping_or_iterable)\n" " self.__dict__.update(kwargs)\n" "\n" " def __repr__(self):\n" @@ -546,24 +561,33 @@ msgid "" " return NotImplemented" msgstr "" -#: library/types.rst:452 +#: library/types.rst:469 msgid "" "``SimpleNamespace`` may be useful as a replacement for ``class NS: pass``. " "However, for a structured record type use :func:`~collections.namedtuple` " "instead." msgstr "" -#: library/types.rst:458 +#: library/types.rst:473 +msgid "" +":class:`!SimpleNamespace` objects are supported by :func:`copy.replace`." +msgstr "" + +#: library/types.rst:477 msgid "" "Attribute order in the repr changed from alphabetical to insertion (like " "``dict``)." msgstr "" -#: library/types.rst:464 +#: library/types.rst:481 +msgid "Added support for an optional positional argument." +msgstr "" + +#: library/types.rst:486 msgid "Route attribute access on a class to __getattr__." msgstr "" -#: library/types.rst:466 +#: library/types.rst:488 msgid "" "This is a descriptor, used to define attributes that act differently when " "accessed through an instance and through a class. Instance access remains " @@ -571,18 +595,18 @@ msgid "" "class's __getattr__ method; this is done by raising AttributeError." msgstr "" -#: library/types.rst:471 +#: library/types.rst:493 msgid "" "This allows one to have properties active on an instance, and have virtual " "attributes on the class with the same name (see :class:`enum.Enum` for an " "example)." msgstr "" -#: library/types.rst:478 +#: library/types.rst:500 msgid "Coroutine Utility Functions" msgstr "" -#: library/types.rst:482 +#: library/types.rst:504 msgid "" "This function transforms a :term:`generator` function into a :term:" "`coroutine function` which returns a generator-based coroutine. The " @@ -592,11 +616,11 @@ msgid "" "method." msgstr "" -#: library/types.rst:489 +#: library/types.rst:511 msgid "If *gen_func* is a generator function, it will be modified in-place." msgstr "" -#: library/types.rst:491 +#: library/types.rst:513 msgid "" "If *gen_func* is not a generator function, it will be wrapped. If it returns " "an instance of :class:`collections.abc.Generator`, the instance will be " diff --git a/library/typing.po b/library/typing.po index bd14c969..db0ba122 100644 --- a/library/typing.po +++ b/library/typing.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -18,7 +18,7 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" #: library/typing.rst:3 -msgid ":mod:`typing` --- Support for type hints" +msgid ":mod:`!typing` --- Support for type hints" msgstr "" #: library/typing.rst:16 @@ -326,7 +326,7 @@ msgid "" "of type :class:`int` and returns a :class:`str`." msgstr "" -#: library/typing.rst:2907 library/typing.rst:3055 +#: library/typing.rst:3121 library/typing.rst:3301 msgid "For example:" msgstr "" @@ -415,7 +415,7 @@ msgid "" "ReturnType]`` respectively." msgstr "" -#: library/typing.rst:3534 +#: library/typing.rst:3791 msgid "" "``Callable`` now supports :class:`ParamSpec` and :data:`Concatenate`. See :" "pep:`612` for more details." @@ -665,11 +665,22 @@ msgstr "" #: library/typing.rst:464 msgid "" -"If your generator will only yield values, set the ``SendType`` and " -"``ReturnType`` to ``None``::" +"The ``SendType`` and ``ReturnType`` parameters default to :const:`!None`::" msgstr "" -#: library/typing.rst:467 +#: library/typing.rst:466 +msgid "" +"def infinite_stream(start: int) -> Generator[int]:\n" +" while True:\n" +" yield start\n" +" start += 1" +msgstr "" + +#: library/typing.rst:471 +msgid "It is also possible to set these types explicitly::" +msgstr "" + +#: library/typing.rst:473 msgid "" "def infinite_stream(start: int) -> Generator[int, None, None]:\n" " while True:\n" @@ -677,13 +688,14 @@ msgid "" " start += 1" msgstr "" -#: library/typing.rst:472 +#: library/typing.rst:478 msgid "" -"Alternatively, annotate your generator as having a return type of either " -"``Iterable[YieldType]`` or ``Iterator[YieldType]``::" +"Simple generators that only ever yield values can also be annotated as " +"having a return type of either :class:`Iterable[YieldType] ` or :class:`Iterator[YieldType] `::" msgstr "" -#: library/typing.rst:475 +#: library/typing.rst:483 msgid "" "def infinite_stream(start: int) -> Iterator[int]:\n" " while True:\n" @@ -691,29 +703,35 @@ msgid "" " start += 1" msgstr "" -#: library/typing.rst:480 +#: library/typing.rst:488 msgid "" "Async generators are handled in a similar fashion, but don't expect a " "``ReturnType`` type argument (:class:`AsyncGenerator[YieldType, SendType] " -"`)::" +"`). The ``SendType`` argument defaults to :" +"const:`!None`, so the following definitions are equivalent::" msgstr "" -#: library/typing.rst:484 +#: library/typing.rst:494 msgid "" +"async def infinite_stream(start: int) -> AsyncGenerator[int]:\n" +" while True:\n" +" yield start\n" +" start = await increment(start)\n" +"\n" "async def infinite_stream(start: int) -> AsyncGenerator[int, None]:\n" " while True:\n" " yield start\n" " start = await increment(start)" msgstr "" -#: library/typing.rst:489 +#: library/typing.rst:504 msgid "" "As in the synchronous case, :class:`AsyncIterable[YieldType] ` and :class:`AsyncIterator[YieldType] ` are available as well::" msgstr "" -#: library/typing.rst:494 +#: library/typing.rst:509 msgid "" "async def infinite_stream(start: int) -> AsyncIterator[int]:\n" " while True:\n" @@ -721,14 +739,14 @@ msgid "" " start = await increment(start)" msgstr "" -#: library/typing.rst:499 +#: library/typing.rst:514 msgid "" "Coroutines can be annotated using :class:`Coroutine[YieldType, SendType, " "ReturnType] `. Generic arguments correspond to " "those of :class:`~collections.abc.Generator`, for example::" msgstr "" -#: library/typing.rst:504 +#: library/typing.rst:519 msgid "" "from collections.abc import Coroutine\n" "c: Coroutine[list[str], str, int] # Some coroutine defined elsewhere\n" @@ -737,15 +755,15 @@ msgid "" " y = await c # Inferred type of 'y' is int" msgstr "" -#: library/typing.rst:513 +#: library/typing.rst:528 msgid "User-defined generic types" msgstr "" -#: library/typing.rst:515 +#: library/typing.rst:530 msgid "A user-defined class can be defined as a generic class." msgstr "" -#: library/typing.rst:519 +#: library/typing.rst:534 msgid "" "from logging import Logger\n" "\n" @@ -767,21 +785,21 @@ msgid "" " self.logger.info('%s: %s', self.name, message)" msgstr "" -#: library/typing.rst:538 +#: library/typing.rst:553 msgid "" "This syntax indicates that the class ``LoggedVar`` is parameterised around a " "single :ref:`type variable ` ``T`` . This also makes ``T`` valid as " "a type within the class body." msgstr "" -#: library/typing.rst:542 +#: library/typing.rst:557 msgid "" "Generic classes implicitly inherit from :class:`Generic`. For compatibility " "with Python 3.11 and lower, it is also possible to inherit explicitly from :" "class:`Generic` to indicate a generic class::" msgstr "" -#: library/typing.rst:546 +#: library/typing.rst:561 msgid "" "from typing import TypeVar, Generic\n" "\n" @@ -791,13 +809,13 @@ msgid "" " ..." msgstr "" -#: library/typing.rst:553 +#: library/typing.rst:568 msgid "" "Generic classes have :meth:`~object.__class_getitem__` methods, meaning they " "can be parameterised at runtime (e.g. ``LoggedVar[int]`` below)::" msgstr "" -#: library/typing.rst:556 +#: library/typing.rst:571 msgid "" "from collections.abc import Iterable\n" "\n" @@ -806,13 +824,13 @@ msgid "" " var.set(0)" msgstr "" -#: library/typing.rst:562 +#: library/typing.rst:577 msgid "" "A generic type can have any number of type variables. All varieties of :" "class:`TypeVar` are permissible as parameters for a generic type::" msgstr "" -#: library/typing.rst:565 +#: library/typing.rst:580 msgid "" "from typing import TypeVar, Generic, Sequence\n" "\n" @@ -827,13 +845,13 @@ msgid "" " ..." msgstr "" -#: library/typing.rst:577 +#: library/typing.rst:592 msgid "" "Each type variable argument to :class:`Generic` must be distinct. This is " "thus invalid::" msgstr "" -#: library/typing.rst:580 +#: library/typing.rst:595 msgid "" "from typing import TypeVar, Generic\n" "...\n" @@ -847,11 +865,11 @@ msgid "" " ..." msgstr "" -#: library/typing.rst:591 +#: library/typing.rst:606 msgid "Generic classes can also inherit from other classes::" msgstr "" -#: library/typing.rst:593 +#: library/typing.rst:608 msgid "" "from collections.abc import Sized\n" "\n" @@ -859,12 +877,12 @@ msgid "" " ..." msgstr "" -#: library/typing.rst:598 +#: library/typing.rst:613 msgid "" "When inheriting from generic classes, some type parameters could be fixed::" msgstr "" -#: library/typing.rst:600 +#: library/typing.rst:615 msgid "" "from collections.abc import Mapping\n" "\n" @@ -872,18 +890,18 @@ msgid "" " ..." msgstr "" -#: library/typing.rst:605 +#: library/typing.rst:620 msgid "In this case ``MyDict`` has a single parameter, ``T``." msgstr "" -#: library/typing.rst:607 +#: library/typing.rst:622 msgid "" "Using a generic class without specifying type parameters assumes :data:`Any` " "for each position. In the following example, ``MyIterable`` is not generic " "but implicitly inherits from ``Iterable[Any]``:" msgstr "" -#: library/typing.rst:611 +#: library/typing.rst:626 msgid "" "from collections.abc import Iterable\n" "\n" @@ -891,11 +909,11 @@ msgid "" " ..." msgstr "" -#: library/typing.rst:618 +#: library/typing.rst:633 msgid "User-defined generic type aliases are also supported. Examples::" msgstr "" -#: library/typing.rst:620 +#: library/typing.rst:635 msgid "" "from collections.abc import Iterable\n" "\n" @@ -912,13 +930,13 @@ msgid "" " return sum(x*y for x, y in v)" msgstr "" -#: library/typing.rst:633 +#: library/typing.rst:648 msgid "" "For backward compatibility, generic type aliases can also be created through " "a simple assignment::" msgstr "" -#: library/typing.rst:636 +#: library/typing.rst:651 msgid "" "from collections.abc import Iterable\n" "from typing import TypeVar\n" @@ -927,28 +945,28 @@ msgid "" "Response = Iterable[S] | int" msgstr "" -#: library/typing.rst:642 +#: library/typing.rst:657 msgid ":class:`Generic` no longer has a custom metaclass." msgstr "" -#: library/typing.rst:645 +#: library/typing.rst:660 msgid "" "Syntactic support for generics and type aliases is new in version 3.12. " "Previously, generic classes had to explicitly inherit from :class:`Generic` " "or contain a type variable in one of their bases." msgstr "" -#: library/typing.rst:650 +#: library/typing.rst:665 msgid "" "User-defined generics for parameter expressions are also supported via " "parameter specification variables in the form ``[**P]``. The behavior is " "consistent with type variables' described above as parameter specification " -"variables are treated by the typing module as a specialized type variable. " -"The one exception to this is that a list of types can be used to substitute " -"a :class:`ParamSpec`::" +"variables are treated by the :mod:`!typing` module as a specialized type " +"variable. The one exception to this is that a list of types can be used to " +"substitute a :class:`ParamSpec`::" msgstr "" -#: library/typing.rst:656 +#: library/typing.rst:671 msgid "" ">>> class Z[T, **P]: ... # T is a TypeVar; P is a ParamSpec\n" "...\n" @@ -956,13 +974,13 @@ msgid "" "__main__.Z[int, [dict, float]]" msgstr "" -#: library/typing.rst:661 +#: library/typing.rst:676 msgid "" "Classes generic over a :class:`ParamSpec` can also be created using explicit " "inheritance from :class:`Generic`. In this case, ``**`` is not used::" msgstr "" -#: library/typing.rst:664 +#: library/typing.rst:679 msgid "" "from typing import ParamSpec, Generic\n" "\n" @@ -972,7 +990,7 @@ msgid "" " ..." msgstr "" -#: library/typing.rst:671 +#: library/typing.rst:686 msgid "" "Another difference between :class:`TypeVar` and :class:`ParamSpec` is that a " "generic with only one parameter specification variable will accept parameter " @@ -981,7 +999,7 @@ msgid "" "the former, so the following are equivalent::" msgstr "" -#: library/typing.rst:677 +#: library/typing.rst:692 msgid "" ">>> class X[**P]: ...\n" "...\n" @@ -991,45 +1009,45 @@ msgid "" "__main__.X[[int, str]]" msgstr "" -#: library/typing.rst:684 +#: library/typing.rst:699 msgid "" "Note that generics with :class:`ParamSpec` may not have correct " "``__parameters__`` after substitution in some cases because they are " "intended primarily for static type checking." msgstr "" -#: library/typing.rst:688 +#: library/typing.rst:703 msgid "" ":class:`Generic` can now be parameterized over parameter expressions. See :" "class:`ParamSpec` and :pep:`612` for more details." msgstr "" -#: library/typing.rst:692 +#: library/typing.rst:707 msgid "" "A user-defined generic class can have ABCs as base classes without a " "metaclass conflict. Generic metaclasses are not supported. The outcome of " -"parameterizing generics is cached, and most types in the typing module are :" -"term:`hashable` and comparable for equality." +"parameterizing generics is cached, and most types in the :mod:`!typing` " +"module are :term:`hashable` and comparable for equality." msgstr "" -#: library/typing.rst:699 +#: library/typing.rst:714 msgid "The :data:`Any` type" msgstr "" -#: library/typing.rst:701 +#: library/typing.rst:716 msgid "" "A special kind of type is :data:`Any`. A static type checker will treat " "every type as being compatible with :data:`Any` and :data:`Any` as being " "compatible with every type." msgstr "" -#: library/typing.rst:705 +#: library/typing.rst:720 msgid "" "This means that it is possible to perform any operation or method call on a " "value of type :data:`Any` and assign it to any variable::" msgstr "" -#: library/typing.rst:708 +#: library/typing.rst:723 msgid "" "from typing import Any\n" "\n" @@ -1047,7 +1065,7 @@ msgid "" " ..." msgstr "" -#: library/typing.rst:723 +#: library/typing.rst:738 msgid "" "Notice that no type checking is performed when assigning a value of type :" "data:`Any` to a more precise type. For example, the static type checker did " @@ -1056,13 +1074,13 @@ msgid "" "runtime!" msgstr "" -#: library/typing.rst:729 +#: library/typing.rst:744 msgid "" "Furthermore, all functions without a return type or parameter types will " "implicitly default to using :data:`Any`::" msgstr "" -#: library/typing.rst:732 +#: library/typing.rst:747 msgid "" "def legacy_parser(text):\n" " ...\n" @@ -1075,13 +1093,13 @@ msgid "" " return data" msgstr "" -#: library/typing.rst:742 +#: library/typing.rst:757 msgid "" "This behavior allows :data:`Any` to be used as an *escape hatch* when you " "need to mix dynamically and statically typed code." msgstr "" -#: library/typing.rst:745 +#: library/typing.rst:760 msgid "" "Contrast the behavior of :data:`Any` with the behavior of :class:`object`. " "Similar to :data:`Any`, every type is a subtype of :class:`object`. However, " @@ -1089,7 +1107,7 @@ msgid "" "subtype of every other type." msgstr "" -#: library/typing.rst:750 +#: library/typing.rst:765 msgid "" "That means when the type of a value is :class:`object`, a type checker will " "reject almost all operations on it, and assigning it to a variable (or using " @@ -1097,7 +1115,7 @@ msgid "" "example::" msgstr "" -#: library/typing.rst:754 +#: library/typing.rst:769 msgid "" "def hash_a(item: object) -> int:\n" " # Fails type checking; an object does not have a 'magic' method.\n" @@ -1118,24 +1136,24 @@ msgid "" "hash_b(\"foo\")" msgstr "" -#: library/typing.rst:772 +#: library/typing.rst:787 msgid "" "Use :class:`object` to indicate that a value could be any type in a typesafe " "manner. Use :data:`Any` to indicate that a value is dynamically typed." msgstr "" -#: library/typing.rst:777 +#: library/typing.rst:792 msgid "Nominal vs structural subtyping" msgstr "" -#: library/typing.rst:779 +#: library/typing.rst:794 msgid "" "Initially :pep:`484` defined the Python static type system as using *nominal " "subtyping*. This means that a class ``A`` is allowed where a class ``B`` is " "expected if and only if ``A`` is a subclass of ``B``." msgstr "" -#: library/typing.rst:783 +#: library/typing.rst:798 msgid "" "This requirement previously also applied to abstract base classes, such as :" "class:`~collections.abc.Iterable`. The problem with this approach is that a " @@ -1144,7 +1162,7 @@ msgid "" "code. For example, this conforms to :pep:`484`::" msgstr "" -#: library/typing.rst:789 +#: library/typing.rst:804 msgid "" "from collections.abc import Sized, Iterable, Iterator\n" "\n" @@ -1154,7 +1172,7 @@ msgid "" " def __iter__(self) -> Iterator[int]: ..." msgstr "" -#: library/typing.rst:796 +#: library/typing.rst:811 msgid "" ":pep:`544` allows to solve this problem by allowing users to write the above " "code without explicit base classes in the class definition, allowing " @@ -1163,7 +1181,7 @@ msgid "" "subtyping* (or static duck-typing)::" msgstr "" -#: library/typing.rst:802 +#: library/typing.rst:817 msgid "" "from collections.abc import Iterator, Iterable\n" "\n" @@ -1176,80 +1194,80 @@ msgid "" "result = collect(Bucket()) # Passes type check" msgstr "" -#: library/typing.rst:812 +#: library/typing.rst:827 msgid "" "Moreover, by subclassing a special class :class:`Protocol`, a user can " "define new custom protocols to fully enjoy structural subtyping (see " "examples below)." msgstr "" -#: library/typing.rst:817 +#: library/typing.rst:832 msgid "Module contents" msgstr "" -#: library/typing.rst:819 +#: library/typing.rst:834 msgid "" "The ``typing`` module defines the following classes, functions and " "decorators." msgstr "" -#: library/typing.rst:822 +#: library/typing.rst:837 msgid "Special typing primitives" msgstr "" -#: library/typing.rst:825 +#: library/typing.rst:840 msgid "Special types" msgstr "" -#: library/typing.rst:827 +#: library/typing.rst:842 msgid "" "These can be used as types in annotations. They do not support subscription " "using ``[]``." msgstr "" -#: library/typing.rst:832 +#: library/typing.rst:847 msgid "Special type indicating an unconstrained type." msgstr "" -#: library/typing.rst:834 +#: library/typing.rst:849 msgid "Every type is compatible with :data:`Any`." msgstr "" -#: library/typing.rst:835 +#: library/typing.rst:850 msgid ":data:`Any` is compatible with every type." msgstr "" -#: library/typing.rst:837 +#: library/typing.rst:852 msgid "" ":data:`Any` can now be used as a base class. This can be useful for avoiding " "type checker errors with classes that can duck type anywhere or are highly " "dynamic." msgstr "" -#: library/typing.rst:844 +#: library/typing.rst:859 msgid "A :ref:`constrained type variable `." msgstr "" -#: library/typing.rst:846 +#: library/typing.rst:861 msgid "Definition::" msgstr "" -#: library/typing.rst:848 +#: library/typing.rst:863 msgid "AnyStr = TypeVar('AnyStr', str, bytes)" msgstr "" -#: library/typing.rst:850 +#: library/typing.rst:865 msgid "" "``AnyStr`` is meant to be used for functions that may accept :class:`str` " "or :class:`bytes` arguments but cannot allow the two to mix." msgstr "" -#: library/typing.rst:961 library/typing.rst:1184 library/typing.rst:1453 -#: library/typing.rst:2847 +#: library/typing.rst:986 library/typing.rst:1209 library/typing.rst:1312 +#: library/typing.rst:1574 library/typing.rst:3286 msgid "For example::" msgstr "" -#: library/typing.rst:855 +#: library/typing.rst:870 msgid "" "def concat(a: AnyStr, b: AnyStr) -> AnyStr:\n" " return a + b\n" @@ -1259,14 +1277,14 @@ msgid "" "concat(\"foo\", b\"bar\") # Error, cannot mix str and bytes" msgstr "" -#: library/typing.rst:862 +#: library/typing.rst:877 msgid "" "Note that, despite its name, ``AnyStr`` has nothing to do with the :class:" "`Any` type, nor does it mean \"any string\". In particular, ``AnyStr`` and " "``str | bytes`` are different from each other and have different use cases::" msgstr "" -#: library/typing.rst:867 +#: library/typing.rst:882 msgid "" "# Invalid use of AnyStr:\n" "# The type variable is used only once in the function signature,\n" @@ -1279,11 +1297,26 @@ msgid "" " return \"hi there!\" if cond else b\"greetings!\"" msgstr "" -#: library/typing.rst:879 +#: library/typing.rst:892 +msgid "" +"Deprecated in favor of the new :ref:`type parameter syntax `. " +"Use ``class A[T: (str, bytes)]: ...`` instead of importing ``AnyStr``. See :" +"pep:`695` for more details." +msgstr "" + +#: library/typing.rst:897 +msgid "" +"In Python 3.16, ``AnyStr`` will be removed from ``typing.__all__``, and " +"deprecation warnings will be emitted at runtime when it is accessed or " +"imported from ``typing``. ``AnyStr`` will be removed from ``typing`` in " +"Python 3.18." +msgstr "" + +#: library/typing.rst:904 msgid "Special type that includes only literal strings." msgstr "" -#: library/typing.rst:881 +#: library/typing.rst:906 msgid "" "Any string literal is compatible with ``LiteralString``, as is another " "``LiteralString``. However, an object typed as just ``str`` is not. A string " @@ -1291,11 +1324,11 @@ msgid "" "``LiteralString``." msgstr "" -#: library/typing.rst:1968 +#: library/typing.rst:2145 msgid "Example:" msgstr "" -#: library/typing.rst:889 +#: library/typing.rst:914 msgid "" "def run_query(sql: LiteralString) -> None:\n" " ...\n" @@ -1310,7 +1343,7 @@ msgid "" " )" msgstr "" -#: library/typing.rst:903 +#: library/typing.rst:928 msgid "" "``LiteralString`` is useful for sensitive APIs where arbitrary user-" "generated strings could generate problems. For example, the two cases above " @@ -1318,23 +1351,23 @@ msgid "" "attack." msgstr "" -#: library/typing.rst:908 +#: library/typing.rst:933 msgid "See :pep:`675` for more details." msgstr "" -#: library/typing.rst:915 +#: library/typing.rst:940 msgid "" ":data:`!Never` and :data:`!NoReturn` represent the `bottom type `_, a type that has no members." msgstr "" -#: library/typing.rst:919 +#: library/typing.rst:944 msgid "" "They can be used to indicate that a function never returns, such as :func:" "`sys.exit`::" msgstr "" -#: library/typing.rst:922 +#: library/typing.rst:947 msgid "" "from typing import Never # or NoReturn\n" "\n" @@ -1342,13 +1375,13 @@ msgid "" " raise RuntimeError('no way')" msgstr "" -#: library/typing.rst:927 +#: library/typing.rst:952 msgid "" "Or to define a function that should never be called, as there are no valid " "arguments, such as :func:`assert_never`::" msgstr "" -#: library/typing.rst:931 +#: library/typing.rst:956 msgid "" "from typing import Never # or NoReturn\n" "\n" @@ -1366,25 +1399,25 @@ msgid "" " never_call_me(arg) # OK, arg is of type Never (or NoReturn)" msgstr "" -#: library/typing.rst:946 +#: library/typing.rst:971 msgid "" ":data:`!Never` and :data:`!NoReturn` have the same meaning in the type " "system and static type checkers treat both equivalently." msgstr "" -#: library/typing.rst:951 +#: library/typing.rst:976 msgid "Added :data:`NoReturn`." msgstr "" -#: library/typing.rst:955 +#: library/typing.rst:980 msgid "Added :data:`Never`." msgstr "" -#: library/typing.rst:959 +#: library/typing.rst:984 msgid "Special type to represent the current enclosed class." msgstr "" -#: library/typing.rst:963 +#: library/typing.rst:988 msgid "" "from typing import Self, reveal_type\n" "\n" @@ -1400,13 +1433,13 @@ msgid "" "\"SubclassOfFoo\"" msgstr "" -#: library/typing.rst:975 +#: library/typing.rst:1000 msgid "" "This annotation is semantically equivalent to the following, albeit in a " "more succinct fashion::" msgstr "" -#: library/typing.rst:978 +#: library/typing.rst:1003 msgid "" "from typing import TypeVar\n" "\n" @@ -1418,7 +1451,7 @@ msgid "" " return self" msgstr "" -#: library/typing.rst:987 +#: library/typing.rst:1012 msgid "" "In general, if something returns ``self``, as in the above examples, you " "should use ``Self`` as the return annotation. If ``Foo.return_self`` was " @@ -1427,27 +1460,27 @@ msgid "" "rather than ``SubclassOfFoo``." msgstr "" -#: library/typing.rst:993 +#: library/typing.rst:1018 msgid "Other common use cases include:" msgstr "" -#: library/typing.rst:995 +#: library/typing.rst:1020 msgid "" ":class:`classmethod`\\s that are used as alternative constructors and return " "instances of the ``cls`` parameter." msgstr "" -#: library/typing.rst:997 +#: library/typing.rst:1022 msgid "Annotating an :meth:`~object.__enter__` method which returns self." msgstr "" -#: library/typing.rst:999 +#: library/typing.rst:1024 msgid "" "You should not use ``Self`` as the return annotation if the method is not " "guaranteed to return an instance of a subclass when the class is subclassed::" msgstr "" -#: library/typing.rst:1003 +#: library/typing.rst:1028 msgid "" "class Eggs:\n" " # Self would be an incorrect return annotation here,\n" @@ -1457,31 +1490,31 @@ msgid "" " return Eggs()" msgstr "" -#: library/typing.rst:1010 +#: library/typing.rst:1035 msgid "See :pep:`673` for more details." msgstr "" -#: library/typing.rst:1016 +#: library/typing.rst:1041 msgid "" "Special annotation for explicitly declaring a :ref:`type alias `." msgstr "" -#: library/typing.rst:1020 +#: library/typing.rst:1045 msgid "" "from typing import TypeAlias\n" "\n" "Factors: TypeAlias = list[int]" msgstr "" -#: library/typing.rst:1024 +#: library/typing.rst:1049 msgid "" "``TypeAlias`` is particularly useful on older Python versions for annotating " "aliases that make use of forward references, as it can be hard for type " "checkers to distinguish these from normal variable assignments:" msgstr "" -#: library/typing.rst:1028 +#: library/typing.rst:1053 msgid "" "from typing import Generic, TypeAlias, TypeVar\n" "\n" @@ -1499,11 +1532,11 @@ msgid "" " def make_box_of_strings(cls) -> BoxOfStrings: ..." msgstr "" -#: library/typing.rst:1044 +#: library/typing.rst:1069 msgid "See :pep:`613` for more details." msgstr "" -#: library/typing.rst:1048 +#: library/typing.rst:1073 msgid "" ":data:`TypeAlias` is deprecated in favor of the :keyword:`type` statement, " "which creates instances of :class:`TypeAliasType` and which natively " @@ -1514,87 +1547,87 @@ msgid "" "to :keyword:`type` statements." msgstr "" -#: library/typing.rst:1059 +#: library/typing.rst:1084 msgid "Special forms" msgstr "" -#: library/typing.rst:1061 +#: library/typing.rst:1086 msgid "" "These can be used as types in annotations. They all support subscription " "using ``[]``, but each has a unique syntax." msgstr "" -#: library/typing.rst:1066 +#: library/typing.rst:1091 msgid "" "Union type; ``Union[X, Y]`` is equivalent to ``X | Y`` and means either X or " "Y." msgstr "" -#: library/typing.rst:1068 +#: library/typing.rst:1093 msgid "" "To define a union, use e.g. ``Union[int, str]`` or the shorthand ``int | " "str``. Using that shorthand is recommended. Details:" msgstr "" -#: library/typing.rst:1070 +#: library/typing.rst:1095 msgid "The arguments must be types and there must be at least one." msgstr "" -#: library/typing.rst:1072 +#: library/typing.rst:1097 msgid "Unions of unions are flattened, e.g.::" msgstr "" -#: library/typing.rst:1074 +#: library/typing.rst:1099 msgid "Union[Union[int, str], float] == Union[int, str, float]" msgstr "" -#: library/typing.rst:1076 +#: library/typing.rst:1101 msgid "Unions of a single argument vanish, e.g.::" msgstr "" -#: library/typing.rst:1078 +#: library/typing.rst:1103 msgid "Union[int] == int # The constructor actually returns int" msgstr "" -#: library/typing.rst:1080 +#: library/typing.rst:1105 msgid "Redundant arguments are skipped, e.g.::" msgstr "" -#: library/typing.rst:1082 +#: library/typing.rst:1107 msgid "Union[int, str, int] == Union[int, str] == int | str" msgstr "" -#: library/typing.rst:1084 +#: library/typing.rst:1109 msgid "When comparing unions, the argument order is ignored, e.g.::" msgstr "" -#: library/typing.rst:1086 +#: library/typing.rst:1111 msgid "Union[int, str] == Union[str, int]" msgstr "" -#: library/typing.rst:1088 +#: library/typing.rst:1113 msgid "You cannot subclass or instantiate a ``Union``." msgstr "" -#: library/typing.rst:1090 +#: library/typing.rst:1115 msgid "You cannot write ``Union[X][Y]``." msgstr "" -#: library/typing.rst:1092 +#: library/typing.rst:1117 msgid "Don't remove explicit subclasses from unions at runtime." msgstr "" -#: library/typing.rst:1095 +#: library/typing.rst:1120 msgid "" "Unions can now be written as ``X | Y``. See :ref:`union type " "expressions`." msgstr "" -#: library/typing.rst:1101 +#: library/typing.rst:1126 msgid "``Optional[X]`` is equivalent to ``X | None`` (or ``Union[X, None]``)." msgstr "" -#: library/typing.rst:1103 +#: library/typing.rst:1128 msgid "" "Note that this is not the same concept as an optional argument, which is one " "that has a default. An optional argument with a default does not require " @@ -1602,36 +1635,36 @@ msgid "" "optional. For example::" msgstr "" -#: library/typing.rst:1108 +#: library/typing.rst:1133 msgid "" "def foo(arg: int = 0) -> None:\n" " ..." msgstr "" -#: library/typing.rst:1111 +#: library/typing.rst:1136 msgid "" "On the other hand, if an explicit value of ``None`` is allowed, the use of " "``Optional`` is appropriate, whether the argument is optional or not. For " "example::" msgstr "" -#: library/typing.rst:1115 +#: library/typing.rst:1140 msgid "" "def foo(arg: Optional[int] = None) -> None:\n" " ..." msgstr "" -#: library/typing.rst:1118 +#: library/typing.rst:1143 msgid "" "Optional can now be written as ``X | None``. See :ref:`union type " "expressions`." msgstr "" -#: library/typing.rst:1124 +#: library/typing.rst:1149 msgid "Special form for annotating higher-order functions." msgstr "" -#: library/typing.rst:1126 +#: library/typing.rst:1151 msgid "" "``Concatenate`` can be used in conjunction with :ref:`Callable ` and :class:`ParamSpec` to annotate a higher-order callable which " @@ -1642,7 +1675,7 @@ msgid "" "``Concatenate`` must be a :class:`ParamSpec` or ellipsis (``...``)." msgstr "" -#: library/typing.rst:1135 +#: library/typing.rst:1160 msgid "" "For example, to annotate a decorator ``with_lock`` which provides a :class:" "`threading.Lock` to the decorated function, ``Concatenate`` can be used to " @@ -1653,7 +1686,7 @@ msgid "" "passed in::" msgstr "" -#: library/typing.rst:1143 +#: library/typing.rst:1168 msgid "" "from collections.abc import Callable\n" "from threading import Lock\n" @@ -1681,31 +1714,31 @@ msgid "" "sum_threadsafe([1.1, 2.2, 3.3])" msgstr "" -#: library/typing.rst:1936 +#: library/typing.rst:2113 msgid "" ":pep:`612` -- Parameter Specification Variables (the PEP which introduced " "``ParamSpec`` and ``Concatenate``)" msgstr "" -#: library/typing.rst:1173 +#: library/typing.rst:1198 msgid ":class:`ParamSpec`" msgstr "" -#: library/typing.rst:1939 +#: library/typing.rst:2116 msgid ":ref:`annotating-callables`" msgstr "" -#: library/typing.rst:1178 +#: library/typing.rst:1203 msgid "Special typing form to define \"literal types\"." msgstr "" -#: library/typing.rst:1180 +#: library/typing.rst:1205 msgid "" "``Literal`` can be used to indicate to type checkers that the annotated " "object has a value equivalent to one of the provided literals." msgstr "" -#: library/typing.rst:1186 +#: library/typing.rst:1211 msgid "" "def validate_simple(data: Any) -> Literal[True]: # always returns True\n" " ...\n" @@ -1718,14 +1751,14 @@ msgid "" "open_helper('/other/path', 'typo') # Error in type checker" msgstr "" -#: library/typing.rst:1196 +#: library/typing.rst:1221 msgid "" "``Literal[...]`` cannot be subclassed. At runtime, an arbitrary value is " "allowed as type argument to ``Literal[...]``, but type checkers may impose " "restrictions. See :pep:`586` for more details about literal types." msgstr "" -#: library/typing.rst:1202 +#: library/typing.rst:1227 msgid "" "``Literal`` now de-duplicates parameters. Equality comparisons of " "``Literal`` objects are no longer order dependent. ``Literal`` objects will " @@ -1733,29 +1766,29 @@ msgid "" "their parameters are not :term:`hashable`." msgstr "" -#: library/typing.rst:1210 +#: library/typing.rst:1235 msgid "Special type construct to mark class variables." msgstr "" -#: library/typing.rst:1212 +#: library/typing.rst:1237 msgid "" "As introduced in :pep:`526`, a variable annotation wrapped in ClassVar " "indicates that a given attribute is intended to be used as a class variable " "and should not be set on instances of that class. Usage::" msgstr "" -#: library/typing.rst:1216 +#: library/typing.rst:1241 msgid "" "class Starship:\n" " stats: ClassVar[dict[str, int]] = {} # class variable\n" " damage: int = 10 # instance variable" msgstr "" -#: library/typing.rst:1220 +#: library/typing.rst:1245 msgid ":data:`ClassVar` accepts only types and cannot be further subscribed." msgstr "" -#: library/typing.rst:1222 +#: library/typing.rst:1247 msgid "" ":data:`ClassVar` is not a class itself, and should not be used with :func:" "`isinstance` or :func:`issubclass`. :data:`ClassVar` does not change Python " @@ -1763,24 +1796,28 @@ msgid "" "example, a type checker might flag the following code as an error::" msgstr "" -#: library/typing.rst:1228 +#: library/typing.rst:1253 msgid "" "enterprise_d = Starship(3000)\n" "enterprise_d.stats = {} # Error, setting class variable on instance\n" "Starship.stats = {} # This is OK" msgstr "" -#: library/typing.rst:1236 +#: library/typing.rst:1261 +msgid ":data:`ClassVar` can now be nested in :data:`Final` and vice versa." +msgstr "" + +#: library/typing.rst:1265 msgid "Special typing construct to indicate final names to type checkers." msgstr "" -#: library/typing.rst:1238 +#: library/typing.rst:1267 msgid "" "Final names cannot be reassigned in any scope. Final names declared in class " "scopes cannot be overridden in subclasses." msgstr "" -#: library/typing.rst:1243 +#: library/typing.rst:1272 msgid "" "MAX_SIZE: Final = 9000\n" "MAX_SIZE += 1 # Error reported by type checker\n" @@ -1792,37 +1829,66 @@ msgid "" " TIMEOUT = 1 # Error reported by type checker" msgstr "" -#: library/typing.rst:2863 +#: library/typing.rst:3074 msgid "" "There is no runtime checking of these properties. See :pep:`591` for more " "details." msgstr "" -#: library/typing.rst:1259 +#: library/typing.rst:1288 +msgid ":data:`Final` can now be nested in :data:`ClassVar` and vice versa." +msgstr "" + +#: library/typing.rst:1292 msgid "Special typing construct to mark a :class:`TypedDict` key as required." msgstr "" -#: library/typing.rst:1261 +#: library/typing.rst:1294 msgid "" "This is mainly useful for ``total=False`` TypedDicts. See :class:`TypedDict` " "and :pep:`655` for more details." msgstr "" -#: library/typing.rst:1268 +#: library/typing.rst:1301 msgid "" "Special typing construct to mark a :class:`TypedDict` key as potentially " "missing." msgstr "" -#: library/typing.rst:1271 +#: library/typing.rst:1304 msgid "See :class:`TypedDict` and :pep:`655` for more details." msgstr "" -#: library/typing.rst:1277 +#: library/typing.rst:1310 +msgid "" +"A special typing construct to mark an item of a :class:`TypedDict` as read-" +"only." +msgstr "" + +#: library/typing.rst:1314 +msgid "" +"class Movie(TypedDict):\n" +" title: ReadOnly[str]\n" +" year: int\n" +"\n" +"def mutate_movie(m: Movie) -> None:\n" +" m[\"year\"] = 1999 # allowed\n" +" m[\"title\"] = \"The Matrix\" # typechecker error" +msgstr "" + +#: library/typing.rst:1322 +msgid "There is no runtime checking for this property." +msgstr "" + +#: library/typing.rst:1324 +msgid "See :class:`TypedDict` and :pep:`705` for more details." +msgstr "" + +#: library/typing.rst:1330 msgid "Special typing form to add context-specific metadata to an annotation." msgstr "" -#: library/typing.rst:1279 +#: library/typing.rst:1332 msgid "" "Add metadata ``x`` to a given type ``T`` by using the annotation " "``Annotated[T, x]``. Metadata added using ``Annotated`` can be used by " @@ -1830,7 +1896,7 @@ msgid "" "a :attr:`!__metadata__` attribute." msgstr "" -#: library/typing.rst:1284 +#: library/typing.rst:1337 msgid "" "If a library or tool encounters an annotation ``Annotated[T, x]`` and has no " "special logic for the metadata, it should ignore the metadata and simply " @@ -1839,7 +1905,7 @@ msgid "" "system." msgstr "" -#: library/typing.rst:1290 +#: library/typing.rst:1343 msgid "" "Using ``Annotated[T, x]`` as an annotation still allows for static " "typechecking of ``T``, as type checkers will simply ignore the metadata " @@ -1849,7 +1915,7 @@ msgid "" "for a function or class." msgstr "" -#: library/typing.rst:1297 +#: library/typing.rst:1350 msgid "" "The responsibility of how to interpret the metadata lies with the tool or " "library encountering an ``Annotated`` annotation. A tool or library " @@ -1857,13 +1923,13 @@ msgid "" "determine if they are of interest (e.g., using :func:`isinstance`)." msgstr "" -#: library/typing.rst:1305 +#: library/typing.rst:1358 msgid "" "Here is an example of how you might use ``Annotated`` to add metadata to " "type annotations if you were doing range analysis:" msgstr "" -#: library/typing.rst:1308 +#: library/typing.rst:1361 msgid "" "@dataclass\n" "class ValueRange:\n" @@ -1874,14 +1940,14 @@ msgid "" "T2 = Annotated[T1, ValueRange(-20, 3)]" msgstr "" -#: library/typing.rst:1318 +#: library/typing.rst:1371 msgid "" "The first argument to ``Annotated`` must be a valid type. Multiple metadata " "elements can be supplied as ``Annotated`` supports variadic arguments. The " "order of the metadata elements is preserved and matters for equality checks::" msgstr "" -#: library/typing.rst:1322 +#: library/typing.rst:1375 msgid "" "@dataclass\n" "class ctype:\n" @@ -1893,20 +1959,20 @@ msgid "" "assert a1 != a2 # Order matters" msgstr "" -#: library/typing.rst:1331 +#: library/typing.rst:1384 msgid "" "It is up to the tool consuming the annotations to decide whether the client " "is allowed to add multiple metadata elements to one annotation and how to " "merge those annotations." msgstr "" -#: library/typing.rst:1335 +#: library/typing.rst:1388 msgid "" "Nested ``Annotated`` types are flattened. The order of the metadata elements " "starts with the innermost annotation::" msgstr "" -#: library/typing.rst:1338 +#: library/typing.rst:1391 msgid "" "assert Annotated[Annotated[int, ValueRange(3, 10)], ctype(\"char\")] == " "Annotated[\n" @@ -1914,22 +1980,22 @@ msgid "" "]" msgstr "" -#: library/typing.rst:1342 +#: library/typing.rst:1395 msgid "Duplicated metadata elements are not removed::" msgstr "" -#: library/typing.rst:1344 +#: library/typing.rst:1397 msgid "" "assert Annotated[int, ValueRange(3, 10)] != Annotated[\n" " int, ValueRange(3, 10), ValueRange(3, 10)\n" "]" msgstr "" -#: library/typing.rst:1348 +#: library/typing.rst:1401 msgid "``Annotated`` can be used with nested and generic aliases:" msgstr "" -#: library/typing.rst:1350 +#: library/typing.rst:1403 msgid "" "@dataclass\n" "class MaxLen:\n" @@ -1943,29 +2009,29 @@ msgid "" "type V = Vec[int]" msgstr "" -#: library/typing.rst:1362 +#: library/typing.rst:1415 msgid "``Annotated`` cannot be used with an unpacked :class:`TypeVarTuple`::" msgstr "" -#: library/typing.rst:1364 +#: library/typing.rst:1417 msgid "" "type Variadic[*Ts] = Annotated[*Ts, Ann1] = Annotated[T1, T2, T3, ..., " "Ann1] # NOT valid" msgstr "" -#: library/typing.rst:1366 +#: library/typing.rst:1419 msgid "" "where ``T1``, ``T2``, ... are :class:`TypeVars `. This is invalid " "as only one type should be passed to Annotated." msgstr "" -#: library/typing.rst:1369 +#: library/typing.rst:1422 msgid "" "By default, :func:`get_type_hints` strips the metadata from annotations. " "Pass ``include_extras=True`` to have the metadata preserved:" msgstr "" -#: library/typing.rst:1372 +#: library/typing.rst:1425 msgid "" ">>> from typing import Annotated, get_type_hints\n" ">>> def func(x: Annotated[int, \"metadata\"]) -> None: pass\n" @@ -1976,13 +2042,13 @@ msgid "" "{'x': typing.Annotated[int, 'metadata'], 'return': }" msgstr "" -#: library/typing.rst:1382 +#: library/typing.rst:1435 msgid "" "At runtime, the metadata associated with an ``Annotated`` type can be " "retrieved via the :attr:`!__metadata__` attribute:" msgstr "" -#: library/typing.rst:1385 +#: library/typing.rst:1438 msgid "" ">>> from typing import Annotated\n" ">>> X = Annotated[int, \"very\", \"important\", \"metadata\"]\n" @@ -1992,13 +2058,13 @@ msgid "" "('very', 'important', 'metadata')" msgstr "" -#: library/typing.rst:1394 +#: library/typing.rst:1447 msgid "" "If you want to retrieve the original type wrapped by ``Annotated``, use the :" "attr:`!__origin__` attribute:" msgstr "" -#: library/typing.rst:1397 +#: library/typing.rst:1450 msgid "" ">>> from typing import Annotated, get_origin\n" ">>> Password = Annotated[str, \"secret\"]\n" @@ -2006,48 +2072,51 @@ msgid "" "" msgstr "" -#: library/typing.rst:1404 +#: library/typing.rst:1457 msgid "Note that using :func:`get_origin` will return ``Annotated`` itself:" msgstr "" -#: library/typing.rst:1406 +#: library/typing.rst:1459 msgid "" ">>> get_origin(Password)\n" -"" +"typing.Annotated" msgstr "" -#: library/typing.rst:1413 +#: library/typing.rst:1466 msgid ":pep:`593` - Flexible function and variable annotations" msgstr "" -#: library/typing.rst:1414 +#: library/typing.rst:1467 msgid "The PEP introducing ``Annotated`` to the standard library." msgstr "" -#: library/typing.rst:1421 -msgid "Special typing construct for marking user-defined type guard functions." +#: library/typing.rst:1558 +msgid "" +"Special typing construct for marking user-defined type predicate functions." msgstr "" -#: library/typing.rst:1423 +#: library/typing.rst:1476 msgid "" -"``TypeGuard`` can be used to annotate the return type of a user-defined type " -"guard function. ``TypeGuard`` only accepts a single type argument. At " -"runtime, functions marked this way should return a boolean." +"``TypeIs`` can be used to annotate the return type of a user-defined type " +"predicate function. ``TypeIs`` only accepts a single type argument. At " +"runtime, functions marked this way should return a boolean and take at least " +"one positional argument." msgstr "" -#: library/typing.rst:1427 +#: library/typing.rst:1481 msgid "" -"``TypeGuard`` aims to benefit *type narrowing* -- a technique used by static " +"``TypeIs`` aims to benefit *type narrowing* -- a technique used by static " "type checkers to determine a more precise type of an expression within a " "program's code flow. Usually type narrowing is done by analyzing " "conditional code flow and applying the narrowing to a block of code. The " -"conditional expression here is sometimes referred to as a \"type guard\"::" +"conditional expression here is sometimes referred to as a \"type " +"predicate\"::" msgstr "" -#: library/typing.rst:1433 +#: library/typing.rst:1487 msgid "" "def is_str(val: str | float):\n" -" # \"isinstance\" type guard\n" +" # \"isinstance\" type predicate\n" " if isinstance(val, str):\n" " # Type of ``val`` is narrowed to ``str``\n" " ...\n" @@ -2056,30 +2125,119 @@ msgid "" " ..." msgstr "" -#: library/typing.rst:1442 +#: library/typing.rst:1496 msgid "" "Sometimes it would be convenient to use a user-defined boolean function as a " -"type guard. Such a function should use ``TypeGuard[...]`` as its return " -"type to alert static type checkers to this intention." +"type predicate. Such a function should use ``TypeIs[...]`` or :data:" +"`TypeGuard` as its return type to alert static type checkers to this " +"intention. ``TypeIs`` usually has more intuitive behavior than " +"``TypeGuard``, but it cannot be used when the input and output types are " +"incompatible (e.g., ``list[object]`` to ``list[int]``) or when the function " +"does not return ``True`` for all instances of the narrowed type." msgstr "" -#: library/typing.rst:1446 +#: library/typing.rst:1504 msgid "" -"Using ``-> TypeGuard`` tells the static type checker that for a given " -"function:" +"Using ``-> TypeIs[NarrowedType]`` tells the static type checker that for a " +"given function:" msgstr "" -#: library/typing.rst:1449 +#: library/typing.rst:1568 msgid "The return value is a boolean." msgstr "" -#: library/typing.rst:1450 +#: library/typing.rst:1508 +msgid "" +"If the return value is ``True``, the type of its argument is the " +"intersection of the argument's original type and ``NarrowedType``." +msgstr "" + +#: library/typing.rst:1510 +msgid "" +"If the return value is ``False``, the type of its argument is narrowed to " +"exclude ``NarrowedType``." +msgstr "" + +#: library/typing.rst:1515 +msgid "" +"from typing import assert_type, final, TypeIs\n" +"\n" +"class Parent: pass\n" +"class Child(Parent): pass\n" +"@final\n" +"class Unrelated: pass\n" +"\n" +"def is_parent(val: object) -> TypeIs[Parent]:\n" +" return isinstance(val, Parent)\n" +"\n" +"def run(arg: Child | Unrelated):\n" +" if is_parent(arg):\n" +" # Type of ``arg`` is narrowed to the intersection\n" +" # of ``Parent`` and ``Child``, which is equivalent to\n" +" # ``Child``.\n" +" assert_type(arg, Child)\n" +" else:\n" +" # Type of ``arg`` is narrowed to exclude ``Parent``,\n" +" # so only ``Unrelated`` is left.\n" +" assert_type(arg, Unrelated)" +msgstr "" + +#: library/typing.rst:1536 +msgid "" +"The type inside ``TypeIs`` must be consistent with the type of the " +"function's argument; if it is not, static type checkers will raise an " +"error. An incorrectly written ``TypeIs`` function can lead to unsound " +"behavior in the type system; it is the user's responsibility to write such " +"functions in a type-safe manner." +msgstr "" + +#: library/typing.rst:1542 +msgid "" +"If a ``TypeIs`` function is a class or instance method, then the type in " +"``TypeIs`` maps to the type of the second parameter (after ``cls`` or " +"``self``)." +msgstr "" + +#: library/typing.rst:1546 +msgid "" +"In short, the form ``def foo(arg: TypeA) -> TypeIs[TypeB]: ...``, means that " +"if ``foo(arg)`` returns ``True``, then ``arg`` is an instance of ``TypeB``, " +"and if it returns ``False``, it is not an instance of ``TypeB``." +msgstr "" + +#: library/typing.rst:1550 +msgid "" +"``TypeIs`` also works with type variables. For more information, see :pep:" +"`742` (Narrowing types with ``TypeIs``)." +msgstr "" + +#: library/typing.rst:1560 +msgid "" +"Type predicate functions are user-defined functions that return whether " +"their argument is an instance of a particular type. ``TypeGuard`` works " +"similarly to :data:`TypeIs`, but has subtly different effects on type " +"checking behavior (see below)." +msgstr "" + +#: library/typing.rst:1565 +msgid "" +"Using ``-> TypeGuard`` tells the static type checker that for a given " +"function:" +msgstr "" + +#: library/typing.rst:1569 msgid "" "If the return value is ``True``, the type of its argument is the type inside " "``TypeGuard``." msgstr "" -#: library/typing.rst:1455 +#: library/typing.rst:1572 +msgid "" +"``TypeGuard`` also works with type variables. See :pep:`647` for more " +"details." +msgstr "" + +#: library/typing.rst:1576 msgid "" "def is_str_list(val: list[object]) -> TypeGuard[list[str]]:\n" " '''Determines whether all objects in the list are strings'''\n" @@ -2094,47 +2252,47 @@ msgid "" " print(\"Not a list of strings!\")" msgstr "" -#: library/typing.rst:1467 -msgid "" -"If ``is_str_list`` is a class or instance method, then the type in " -"``TypeGuard`` maps to the type of the second parameter (after ``cls`` or " -"``self``)." +#: library/typing.rst:1588 +msgid "``TypeIs`` and ``TypeGuard`` differ in the following ways:" msgstr "" -#: library/typing.rst:1471 +#: library/typing.rst:1590 msgid "" -"In short, the form ``def foo(arg: TypeA) -> TypeGuard[TypeB]: ...``, means " -"that if ``foo(arg)`` returns ``True``, then ``arg`` narrows from ``TypeA`` " -"to ``TypeB``." +"``TypeIs`` requires the narrowed type to be a subtype of the input type, " +"while ``TypeGuard`` does not. The main reason is to allow for things like " +"narrowing ``list[object]`` to ``list[str]`` even though the latter is not a " +"subtype of the former, since ``list`` is invariant." msgstr "" -#: library/typing.rst:1477 +#: library/typing.rst:1594 msgid "" -"``TypeB`` need not be a narrower form of ``TypeA`` -- it can even be a wider " -"form. The main reason is to allow for things like narrowing ``list[object]`` " -"to ``list[str]`` even though the latter is not a subtype of the former, " -"since ``list`` is invariant. The responsibility of writing type-safe type " -"guards is left to the user." +"When a ``TypeGuard`` function returns ``True``, type checkers narrow the " +"type of the variable to exactly the ``TypeGuard`` type. When a ``TypeIs`` " +"function returns ``True``, type checkers can infer a more precise type " +"combining the previously known type of the variable with the ``TypeIs`` " +"type. (Technically, this is known as an intersection type.)" msgstr "" -#: library/typing.rst:1483 +#: library/typing.rst:1598 msgid "" -"``TypeGuard`` also works with type variables. See :pep:`647` for more " -"details." +"When a ``TypeGuard`` function returns ``False``, type checkers cannot narrow " +"the type of the variable at all. When a ``TypeIs`` function returns " +"``False``, type checkers can narrow the type of the variable to exclude the " +"``TypeIs`` type." msgstr "" -#: library/typing.rst:1490 +#: library/typing.rst:1607 msgid "Typing operator to conceptually mark an object as having been unpacked." msgstr "" -#: library/typing.rst:1492 +#: library/typing.rst:1609 msgid "" "For example, using the unpack operator ``*`` on a :ref:`type variable tuple " "` is equivalent to using ``Unpack`` to mark the type variable " "tuple as having been unpacked::" msgstr "" -#: library/typing.rst:1496 +#: library/typing.rst:1613 msgid "" "Ts = TypeVarTuple('Ts')\n" "tup: tuple[*Ts]\n" @@ -2142,7 +2300,7 @@ msgid "" "tup: tuple[Unpack[Ts]]" msgstr "" -#: library/typing.rst:1501 +#: library/typing.rst:1618 msgid "" "In fact, ``Unpack`` can be used interchangeably with ``*`` in the context " "of :class:`typing.TypeVarTuple ` and :class:`builtins.tuple " @@ -2150,7 +2308,7 @@ msgid "" "versions of Python, where ``*`` couldn't be used in certain places::" msgstr "" -#: library/typing.rst:1507 +#: library/typing.rst:1624 msgid "" "# In older versions of Python, TypeVarTuple and Unpack\n" "# are located in the `typing_extensions` backports package.\n" @@ -2161,13 +2319,13 @@ msgid "" "tup: tuple[Unpack[Ts]] # Semantically equivalent, and backwards-compatible" msgstr "" -#: library/typing.rst:1515 +#: library/typing.rst:1632 msgid "" "``Unpack`` can also be used along with :class:`typing.TypedDict` for typing " "``**kwargs`` in a function signature::" msgstr "" -#: library/typing.rst:1518 +#: library/typing.rst:1635 msgid "" "from typing import TypedDict, Unpack\n" "\n" @@ -2180,23 +2338,23 @@ msgid "" "def foo(**kwargs: Unpack[Movie]): ..." msgstr "" -#: library/typing.rst:1528 +#: library/typing.rst:1645 msgid "" "See :pep:`692` for more details on using ``Unpack`` for ``**kwargs`` typing." msgstr "" -#: library/typing.rst:1533 +#: library/typing.rst:1650 msgid "Building generic types and type aliases" msgstr "" -#: library/typing.rst:1535 +#: library/typing.rst:1652 msgid "" "The following classes should not be used directly as annotations. Their " "intended purpose is to be building blocks for creating generic types and " "type aliases." msgstr "" -#: library/typing.rst:1539 +#: library/typing.rst:1656 msgid "" "These objects can be created through special syntax (:ref:`type parameter " "lists ` and the :keyword:`type` statement). For compatibility " @@ -2204,17 +2362,17 @@ msgid "" "syntax, as documented below." msgstr "" -#: library/typing.rst:1546 +#: library/typing.rst:1663 msgid "Abstract base class for generic types." msgstr "" -#: library/typing.rst:1548 +#: library/typing.rst:1665 msgid "" "A generic type is typically declared by adding a list of type parameters " "after the class name::" msgstr "" -#: library/typing.rst:1551 +#: library/typing.rst:1668 msgid "" "class Mapping[KT, VT]:\n" " def __getitem__(self, key: KT) -> VT:\n" @@ -2222,17 +2380,17 @@ msgid "" " # Etc." msgstr "" -#: library/typing.rst:1556 +#: library/typing.rst:1673 msgid "" "Such a class implicitly inherits from ``Generic``. The runtime semantics of " "this syntax are discussed in the :ref:`Language Reference `." msgstr "" -#: library/typing.rst:1560 +#: library/typing.rst:1677 msgid "This class can then be used as follows::" msgstr "" -#: library/typing.rst:1562 +#: library/typing.rst:1679 msgid "" "def lookup_name[X, Y](mapping: Mapping[X, Y], key: X, default: Y) -> Y:\n" " try:\n" @@ -2241,20 +2399,20 @@ msgid "" " return default" msgstr "" -#: library/typing.rst:1568 +#: library/typing.rst:1685 msgid "" "Here the brackets after the function name indicate a :ref:`generic function " "`." msgstr "" -#: library/typing.rst:1571 +#: library/typing.rst:1688 msgid "" "For backwards compatibility, generic classes can also be declared by " "explicitly inheriting from ``Generic``. In this case, the type parameters " "must be declared separately::" msgstr "" -#: library/typing.rst:1576 +#: library/typing.rst:1693 msgid "" "KT = TypeVar('KT')\n" "VT = TypeVar('VT')\n" @@ -2265,30 +2423,30 @@ msgid "" " # Etc." msgstr "" -#: library/typing.rst:1588 +#: library/typing.rst:1705 msgid "Type variable." msgstr "" -#: library/typing.rst:1590 +#: library/typing.rst:1707 msgid "" "The preferred way to construct a type variable is via the dedicated syntax " "for :ref:`generic functions `, :ref:`generic classes " "`, and :ref:`generic type aliases `::" msgstr "" -#: library/typing.rst:1595 +#: library/typing.rst:1712 msgid "" "class Sequence[T]: # T is a TypeVar\n" " ..." msgstr "" -#: library/typing.rst:1598 +#: library/typing.rst:1715 msgid "" "This syntax can also be used to create bounded and constrained type " "variables::" msgstr "" -#: library/typing.rst:1601 +#: library/typing.rst:1718 msgid "" "class StrSequence[S: str]: # S is a TypeVar with a `str` upper bound;\n" " ... # we can say that S is \"bounded by `str`\"\n" @@ -2299,20 +2457,20 @@ msgid "" " ..." msgstr "" -#: library/typing.rst:1608 +#: library/typing.rst:1725 msgid "" "However, if desired, reusable type variables can also be constructed " "manually, like so::" msgstr "" -#: library/typing.rst:1610 +#: library/typing.rst:1727 msgid "" "T = TypeVar('T') # Can be anything\n" "S = TypeVar('S', bound=str) # Can be any subtype of str\n" "A = TypeVar('A', str, bytes) # Must be exactly str or bytes" msgstr "" -#: library/typing.rst:1614 +#: library/typing.rst:1731 msgid "" "Type variables exist primarily for the benefit of static type checkers. " "They serve as the parameters for generic types as well as for generic " @@ -2320,7 +2478,7 @@ msgid "" "information on generic types. Generic functions work as follows::" msgstr "" -#: library/typing.rst:1620 +#: library/typing.rst:1737 msgid "" "def repeat[T](x: T, n: int) -> Sequence[T]:\n" " \"\"\"Return a list containing n references to x.\"\"\"\n" @@ -2338,13 +2496,13 @@ msgid "" " return x + y" msgstr "" -#: library/typing.rst:1635 +#: library/typing.rst:1752 msgid "" "Note that type variables can be *bounded*, *constrained*, or neither, but " "cannot be both bounded *and* constrained." msgstr "" -#: library/typing.rst:1638 +#: library/typing.rst:1755 msgid "" "The variance of type variables is inferred by type checkers when they are " "created through the :ref:`type parameter syntax ` or when " @@ -2354,14 +2512,14 @@ msgid "" "invariant. See :pep:`484` and :pep:`695` for more details." msgstr "" -#: library/typing.rst:1646 +#: library/typing.rst:1763 msgid "" "Bounded type variables and constrained type variables have different " "semantics in several important ways. Using a *bounded* type variable means " "that the ``TypeVar`` will be solved using the most specific type possible::" msgstr "" -#: library/typing.rst:1650 +#: library/typing.rst:1767 msgid "" "x = print_capitalized('a string')\n" "reveal_type(x) # revealed type is str\n" @@ -2375,13 +2533,13 @@ msgid "" "z = print_capitalized(45) # error: int is not a subtype of str" msgstr "" -#: library/typing.rst:1661 +#: library/typing.rst:1778 msgid "" "The upper bound of a type variable can be a concrete type, abstract type " "(ABC or Protocol), or even a union of types::" msgstr "" -#: library/typing.rst:1664 +#: library/typing.rst:1781 msgid "" "# Can be anything with an __abs__ method\n" "def print_abs[T: SupportsAbs](arg: T) -> None:\n" @@ -2392,13 +2550,13 @@ msgid "" "V = TypeVar('V', bound=SupportsAbs) # Can be anything with an __abs__ method" msgstr "" -#: library/typing.rst:1673 +#: library/typing.rst:1790 msgid "" "Using a *constrained* type variable, however, means that the ``TypeVar`` can " "only ever be solved as being exactly one of the constraints given::" msgstr "" -#: library/typing.rst:1676 +#: library/typing.rst:1793 msgid "" "a = concatenate('one', 'two')\n" "reveal_type(a) # revealed type is str\n" @@ -2411,80 +2569,98 @@ msgid "" "or bytes in a function call, but not both" msgstr "" -#: library/typing.rst:1684 +#: library/typing.rst:1801 msgid "At runtime, ``isinstance(x, T)`` will raise :exc:`TypeError`." msgstr "" -#: library/typing.rst:1688 +#: library/typing.rst:1805 msgid "The name of the type variable." msgstr "" -#: library/typing.rst:1692 +#: library/typing.rst:1809 msgid "Whether the type var has been explicitly marked as covariant." msgstr "" -#: library/typing.rst:1696 +#: library/typing.rst:1813 msgid "Whether the type var has been explicitly marked as contravariant." msgstr "" -#: library/typing.rst:1700 +#: library/typing.rst:1817 msgid "" "Whether the type variable's variance should be inferred by type checkers." msgstr "" -#: library/typing.rst:1706 +#: library/typing.rst:1823 msgid "The upper bound of the type variable, if any." msgstr "" -#: library/typing.rst:1710 +#: library/typing.rst:1827 msgid "" "For type variables created through :ref:`type parameter syntax `, the bound is evaluated only when the attribute is accessed, not " "when the type variable is created (see :ref:`lazy-evaluation`)." msgstr "" -#: library/typing.rst:1716 +#: library/typing.rst:1833 msgid "A tuple containing the constraints of the type variable, if any." msgstr "" -#: library/typing.rst:1720 +#: library/typing.rst:1837 msgid "" "For type variables created through :ref:`type parameter syntax `, the constraints are evaluated only when the attribute is accessed, " "not when the type variable is created (see :ref:`lazy-evaluation`)." msgstr "" -#: library/typing.rst:1726 +#: library/typing.rst:1843 +msgid "" +"The default value of the type variable, or :data:`typing.NoDefault` if it " +"has no default." +msgstr "" + +#: library/typing.rst:1850 +msgid "" +"Return whether or not the type variable has a default value. This is " +"equivalent to checking whether :attr:`__default__` is not the :data:`typing." +"NoDefault` singleton, except that it does not force evaluation of the :ref:" +"`lazily evaluated ` default value." +msgstr "" + +#: library/typing.rst:1859 msgid "" "Type variables can now be declared using the :ref:`type parameter ` syntax introduced by :pep:`695`. The ``infer_variance`` parameter " "was added." msgstr "" -#: library/typing.rst:1734 +#: library/typing.rst:2004 library/typing.rst:2106 +msgid "Support for default values was added." +msgstr "" + +#: library/typing.rst:1871 msgid "" "Type variable tuple. A specialized form of :ref:`type variable ` " "that enables *variadic* generics." msgstr "" -#: library/typing.rst:1737 +#: library/typing.rst:1874 msgid "" "Type variable tuples can be declared in :ref:`type parameter lists ` using a single asterisk (``*``) before the name::" msgstr "" -#: library/typing.rst:1740 +#: library/typing.rst:1877 msgid "" "def move_first_element_to_last[T, *Ts](tup: tuple[T, *Ts]) -> tuple[*Ts, " "T]:\n" " return (*tup[1:], tup[0])" msgstr "" -#: library/typing.rst:1743 +#: library/typing.rst:1880 msgid "Or by explicitly invoking the ``TypeVarTuple`` constructor::" msgstr "" -#: library/typing.rst:1745 +#: library/typing.rst:1882 msgid "" "T = TypeVar(\"T\")\n" "Ts = TypeVarTuple(\"Ts\")\n" @@ -2493,7 +2669,7 @@ msgid "" " return (*tup[1:], tup[0])" msgstr "" -#: library/typing.rst:1751 +#: library/typing.rst:1888 msgid "" "A normal type variable enables parameterization with a single type. A type " "variable tuple, in contrast, allows parameterization with an *arbitrary* " @@ -2501,7 +2677,7 @@ msgid "" "wrapped in a tuple. For example::" msgstr "" -#: library/typing.rst:1756 +#: library/typing.rst:1893 msgid "" "# T is bound to int, Ts is bound to ()\n" "# Return value is (1,), which has type tuple[int]\n" @@ -2521,7 +2697,7 @@ msgid "" "move_first_element_to_last(tup=())" msgstr "" -#: library/typing.rst:1773 +#: library/typing.rst:1910 msgid "" "Note the use of the unpacking operator ``*`` in ``tuple[T, *Ts]``. " "Conceptually, you can think of ``Ts`` as a tuple of type variables ``(T1, " @@ -2531,26 +2707,26 @@ msgid "" "` instead, as ``Unpack[Ts]``.)" msgstr "" -#: library/typing.rst:1781 +#: library/typing.rst:1918 msgid "" "Type variable tuples must *always* be unpacked. This helps distinguish type " "variable tuples from normal type variables::" msgstr "" -#: library/typing.rst:1784 +#: library/typing.rst:1921 msgid "" "x: Ts # Not valid\n" "x: tuple[Ts] # Not valid\n" "x: tuple[*Ts] # The correct way to do it" msgstr "" -#: library/typing.rst:1788 +#: library/typing.rst:1925 msgid "" "Type variable tuples can be used in the same contexts as normal type " "variables. For example, in class definitions, arguments, and return types::" msgstr "" -#: library/typing.rst:1791 +#: library/typing.rst:1928 msgid "" "class Array[*Shape]:\n" " def __getitem__(self, key: tuple[*Shape]) -> float: ...\n" @@ -2558,12 +2734,12 @@ msgid "" " def get_shape(self) -> tuple[*Shape]: ..." msgstr "" -#: library/typing.rst:1796 +#: library/typing.rst:1933 msgid "" "Type variable tuples can be happily combined with normal type variables:" msgstr "" -#: library/typing.rst:1798 +#: library/typing.rst:1935 msgid "" "class Array[DType, *Shape]: # This is fine\n" " pass\n" @@ -2578,26 +2754,26 @@ msgid "" "int_array_2d: Array[int, Height, Width] = Array() # Yup, fine too" msgstr "" -#: library/typing.rst:1812 +#: library/typing.rst:1949 msgid "" "However, note that at most one type variable tuple may appear in a single " "list of type arguments or type parameters::" msgstr "" -#: library/typing.rst:1815 +#: library/typing.rst:1952 msgid "" "x: tuple[*Ts, *Ts] # Not valid\n" "class Array[*Shape, *Shape]: # Not valid\n" " pass" msgstr "" -#: library/typing.rst:1819 +#: library/typing.rst:1956 msgid "" "Finally, an unpacked type variable tuple can be used as the type annotation " "of ``*args``::" msgstr "" -#: library/typing.rst:1822 +#: library/typing.rst:1959 msgid "" "def call_soon[*Ts](\n" " callback: Callable[[*Ts], None],\n" @@ -2607,7 +2783,7 @@ msgid "" " callback(*args)" msgstr "" -#: library/typing.rst:1829 +#: library/typing.rst:1966 msgid "" "In contrast to non-unpacked annotations of ``*args`` - e.g. ``*args: int``, " "which would specify that *all* arguments are ``int`` - ``*args: *Ts`` " @@ -2616,47 +2792,61 @@ msgid "" "``call_soon`` match the types of the (positional) arguments of ``callback``." msgstr "" -#: library/typing.rst:1836 +#: library/typing.rst:1973 msgid "See :pep:`646` for more details on type variable tuples." msgstr "" -#: library/typing.rst:1840 +#: library/typing.rst:1977 msgid "The name of the type variable tuple." msgstr "" -#: library/typing.rst:1846 +#: library/typing.rst:1981 +msgid "" +"The default value of the type variable tuple, or :data:`typing.NoDefault` if " +"it has no default." +msgstr "" + +#: library/typing.rst:1988 +msgid "" +"Return whether or not the type variable tuple has a default value. This is " +"equivalent to checking whether :attr:`__default__` is not the :data:`typing." +"NoDefault` singleton, except that it does not force evaluation of the :ref:" +"`lazily evaluated ` default value." +msgstr "" + +#: library/typing.rst:1999 msgid "" "Type variable tuples can now be declared using the :ref:`type parameter " "` syntax introduced by :pep:`695`." msgstr "" -#: library/typing.rst:1851 +#: library/typing.rst:2008 msgid "" "Parameter specification variable. A specialized version of :ref:`type " "variables `." msgstr "" -#: library/typing.rst:1854 +#: library/typing.rst:2011 msgid "" "In :ref:`type parameter lists `, parameter specifications can " "be declared with two asterisks (``**``)::" msgstr "" -#: library/typing.rst:1857 +#: library/typing.rst:2014 msgid "type IntFunc[**P] = Callable[P, int]" msgstr "" -#: library/typing.rst:1859 +#: library/typing.rst:2016 msgid "" "For compatibility with Python 3.11 and earlier, ``ParamSpec`` objects can " "also be created as follows::" msgstr "" -#: library/typing.rst:1862 +#: library/typing.rst:2019 msgid "P = ParamSpec('P')" msgstr "" -#: library/typing.rst:1864 +#: library/typing.rst:2021 msgid "" "Parameter specification variables exist primarily for the benefit of static " "type checkers. They are used to forward the parameter types of one callable " @@ -2666,7 +2856,7 @@ msgid "" "See :class:`Generic` for more information on generic types." msgstr "" -#: library/typing.rst:1871 +#: library/typing.rst:2028 msgid "" "For example, to add basic logging to a function, one can create a decorator " "``add_logging`` to log function calls. The parameter specification variable " @@ -2674,7 +2864,7 @@ msgid "" "new callable returned by it have inter-dependent type parameters::" msgstr "" -#: library/typing.rst:1876 +#: library/typing.rst:2033 msgid "" "from collections.abc import Callable\n" "import logging\n" @@ -2692,27 +2882,27 @@ msgid "" " return x + y" msgstr "" -#: library/typing.rst:1891 +#: library/typing.rst:2048 msgid "" "Without ``ParamSpec``, the simplest way to annotate this previously was to " "use a :class:`TypeVar` with upper bound ``Callable[..., Any]``. However " "this causes two problems:" msgstr "" -#: library/typing.rst:1895 +#: library/typing.rst:2052 msgid "" "The type checker can't type check the ``inner`` function because ``*args`` " "and ``**kwargs`` have to be typed :data:`Any`." msgstr "" -#: library/typing.rst:1897 +#: library/typing.rst:2054 msgid "" ":func:`~cast` may be required in the body of the ``add_logging`` decorator " "when returning the ``inner`` function, or the static type checker must be " "told to ignore the ``return inner``." msgstr "" -#: library/typing.rst:1904 +#: library/typing.rst:2061 msgid "" "Since ``ParamSpec`` captures both positional and keyword parameters, ``P." "args`` and ``P.kwargs`` can be used to split a ``ParamSpec`` into its " @@ -2725,11 +2915,25 @@ msgid "" "`ParamSpecKwargs`." msgstr "" -#: library/typing.rst:1916 +#: library/typing.rst:2073 msgid "The name of the parameter specification." msgstr "" -#: library/typing.rst:1918 +#: library/typing.rst:2077 +msgid "" +"The default value of the parameter specification, or :data:`typing." +"NoDefault` if it has no default." +msgstr "" + +#: library/typing.rst:2084 +msgid "" +"Return whether or not the parameter specification has a default value. This " +"is equivalent to checking whether :attr:`__default__` is not the :data:" +"`typing.NoDefault` singleton, except that it does not force evaluation of " +"the :ref:`lazily evaluated ` default value." +msgstr "" + +#: library/typing.rst:2091 msgid "" "Parameter specification variables created with ``covariant=True`` or " "``contravariant=True`` can be used to declare covariant or contravariant " @@ -2738,23 +2942,23 @@ msgid "" "decided." msgstr "" -#: library/typing.rst:1928 +#: library/typing.rst:2101 msgid "" "Parameter specifications can now be declared using the :ref:`type parameter " "` syntax introduced by :pep:`695`." msgstr "" -#: library/typing.rst:1932 +#: library/typing.rst:2109 msgid "" "Only parameter specification variables defined in global scope can be " "pickled." msgstr "" -#: library/typing.rst:1938 +#: library/typing.rst:2115 msgid ":data:`Concatenate`" msgstr "" -#: library/typing.rst:1944 +#: library/typing.rst:2121 msgid "" "Arguments and keyword arguments attributes of a :class:`ParamSpec`. The ``P." "args`` attribute of a ``ParamSpec`` is an instance of ``ParamSpecArgs``, and " @@ -2762,13 +2966,13 @@ msgid "" "runtime introspection and have no special meaning to static type checkers." msgstr "" -#: library/typing.rst:1949 +#: library/typing.rst:2126 msgid "" "Calling :func:`get_origin` on either of these objects will return the " "original ``ParamSpec``:" msgstr "" -#: library/typing.rst:1952 +#: library/typing.rst:2129 msgid "" ">>> from typing import ParamSpec, get_origin\n" ">>> P = ParamSpec(\"P\")\n" @@ -2778,46 +2982,46 @@ msgid "" "True" msgstr "" -#: library/typing.rst:1966 +#: library/typing.rst:2143 msgid "The type of type aliases created through the :keyword:`type` statement." msgstr "" -#: library/typing.rst:1970 +#: library/typing.rst:2147 msgid "" ">>> type Alias = int\n" ">>> type(Alias)\n" "" msgstr "" -#: library/typing.rst:1980 +#: library/typing.rst:2157 msgid "The name of the type alias:" msgstr "" -#: library/typing.rst:1982 +#: library/typing.rst:2159 msgid "" ">>> type Alias = int\n" ">>> Alias.__name__\n" "'Alias'" msgstr "" -#: library/typing.rst:1990 +#: library/typing.rst:2167 msgid "The module in which the type alias was defined::" msgstr "" -#: library/typing.rst:1992 +#: library/typing.rst:2169 msgid "" ">>> type Alias = int\n" ">>> Alias.__module__\n" "'__main__'" msgstr "" -#: library/typing.rst:1998 +#: library/typing.rst:2175 msgid "" "The type parameters of the type alias, or an empty tuple if the alias is not " "generic:" msgstr "" -#: library/typing.rst:2001 +#: library/typing.rst:2178 msgid "" ">>> type ListOrSet[T] = list[T] | set[T]\n" ">>> ListOrSet.__type_params__\n" @@ -2827,14 +3031,14 @@ msgid "" "()" msgstr "" -#: library/typing.rst:2012 +#: library/typing.rst:2189 msgid "" "The type alias's value. This is :ref:`lazily evaluated `, " "so names used in the definition of the alias are not resolved until the " "``__value__`` attribute is accessed:" msgstr "" -#: library/typing.rst:2016 +#: library/typing.rst:2193 msgid "" ">>> type Mutually = Recursive\n" ">>> type Recursive = Mutually\n" @@ -2848,46 +3052,46 @@ msgid "" "Mutually" msgstr "" -#: library/typing.rst:2030 +#: library/typing.rst:2207 msgid "Other special directives" msgstr "" -#: library/typing.rst:2032 +#: library/typing.rst:2209 msgid "" "These functions and classes should not be used directly as annotations. " "Their intended purpose is to be building blocks for creating and declaring " "types." msgstr "" -#: library/typing.rst:2038 +#: library/typing.rst:2215 msgid "Typed version of :func:`collections.namedtuple`." msgstr "" -#: library/typing.rst:2119 library/typing.rst:3095 +#: library/typing.rst:2309 library/typing.rst:3357 msgid "Usage::" msgstr "" -#: library/typing.rst:2042 +#: library/typing.rst:2219 msgid "" "class Employee(NamedTuple):\n" " name: str\n" " id: int" msgstr "" -#: library/typing.rst:2046 +#: library/typing.rst:2223 msgid "This is equivalent to::" msgstr "" -#: library/typing.rst:2048 +#: library/typing.rst:2225 msgid "Employee = collections.namedtuple('Employee', ['name', 'id'])" msgstr "" -#: library/typing.rst:2050 +#: library/typing.rst:2227 msgid "" "To give a field a default value, you can assign to it in the class body::" msgstr "" -#: library/typing.rst:2052 +#: library/typing.rst:2229 msgid "" "class Employee(NamedTuple):\n" " name: str\n" @@ -2897,12 +3101,12 @@ msgid "" "assert employee.id == 3" msgstr "" -#: library/typing.rst:2059 +#: library/typing.rst:2236 msgid "" "Fields with a default value must come after any fields without a default." msgstr "" -#: library/typing.rst:2061 +#: library/typing.rst:2238 msgid "" "The resulting class has an extra attribute ``__annotations__`` giving a dict " "that maps the field names to the field types. (The field names are in the " @@ -2911,11 +3115,11 @@ msgid "" "API.)" msgstr "" -#: library/typing.rst:2067 +#: library/typing.rst:2244 msgid "``NamedTuple`` subclasses can also have docstrings and methods::" msgstr "" -#: library/typing.rst:2069 +#: library/typing.rst:2246 msgid "" "class Employee(NamedTuple):\n" " \"\"\"Represents an employee.\"\"\"\n" @@ -2926,22 +3130,22 @@ msgid "" " return f''" msgstr "" -#: library/typing.rst:2077 +#: library/typing.rst:2254 msgid "``NamedTuple`` subclasses can be generic::" msgstr "" -#: library/typing.rst:2079 +#: library/typing.rst:2256 msgid "" "class Group[T](NamedTuple):\n" " key: T\n" " group: list[T]" msgstr "" -#: library/typing.rst:2083 +#: library/typing.rst:2260 msgid "Backward-compatible usage::" msgstr "" -#: library/typing.rst:2085 +#: library/typing.rst:2262 msgid "" "# For creating a generic NamedTuple on Python 3.11\n" "T = TypeVar(\"T\")\n" @@ -2954,85 +3158,102 @@ msgid "" "Employee = NamedTuple('Employee', [('name', str), ('id', int)])" msgstr "" -#: library/typing.rst:2095 +#: library/typing.rst:2272 msgid "Added support for :pep:`526` variable annotation syntax." msgstr "" -#: library/typing.rst:2098 +#: library/typing.rst:2275 msgid "Added support for default values, methods, and docstrings." msgstr "" -#: library/typing.rst:2101 +#: library/typing.rst:2278 msgid "" "The ``_field_types`` and ``__annotations__`` attributes are now regular " "dictionaries instead of instances of ``OrderedDict``." msgstr "" -#: library/typing.rst:2105 +#: library/typing.rst:2282 msgid "" "Removed the ``_field_types`` attribute in favor of the more standard " "``__annotations__`` attribute which has the same information." msgstr "" -#: library/typing.rst:2109 +#: library/typing.rst:2286 msgid "Added support for generic namedtuples." msgstr "" -#: library/typing.rst:2114 +#: library/typing.rst:2289 +msgid "" +"The undocumented keyword argument syntax for creating NamedTuple classes " +"(``NT = NamedTuple(\"NT\", x=int)``) is deprecated, and will be disallowed " +"in 3.15. Use the class-based syntax or the functional syntax instead." +msgstr "" + +#: library/typing.rst:2294 +msgid "" +"When using the functional syntax to create a NamedTuple class, failing to " +"pass a value to the 'fields' parameter (``NT = NamedTuple(\"NT\")``) is " +"deprecated. Passing ``None`` to the 'fields' parameter (``NT = " +"NamedTuple(\"NT\", None)``) is also deprecated. Both will be disallowed in " +"Python 3.15. To create a NamedTuple class with 0 fields, use ``class " +"NT(NamedTuple): pass`` or ``NT = NamedTuple(\"NT\", [])``." +msgstr "" + +#: library/typing.rst:2304 msgid "Helper class to create low-overhead :ref:`distinct types `." msgstr "" -#: library/typing.rst:2116 +#: library/typing.rst:2306 msgid "" "A ``NewType`` is considered a distinct type by a typechecker. At runtime, " "however, calling a ``NewType`` returns its argument unchanged." msgstr "" -#: library/typing.rst:2121 +#: library/typing.rst:2311 msgid "" "UserId = NewType('UserId', int) # Declare the NewType \"UserId\"\n" "first_user = UserId(1) # \"UserId\" returns the argument unchanged at " "runtime" msgstr "" -#: library/typing.rst:2126 +#: library/typing.rst:2316 msgid "The module in which the new type is defined." msgstr "" -#: library/typing.rst:2130 +#: library/typing.rst:2320 msgid "The name of the new type." msgstr "" -#: library/typing.rst:2134 +#: library/typing.rst:2324 msgid "The type that the new type is based on." msgstr "" -#: library/typing.rst:2138 +#: library/typing.rst:2328 msgid "``NewType`` is now a class rather than a function." msgstr "" -#: library/typing.rst:2143 +#: library/typing.rst:2333 msgid "Base class for protocol classes." msgstr "" -#: library/typing.rst:2145 +#: library/typing.rst:2335 msgid "Protocol classes are defined like this::" msgstr "" -#: library/typing.rst:2147 +#: library/typing.rst:2337 msgid "" "class Proto(Protocol):\n" " def meth(self) -> int:\n" " ..." msgstr "" -#: library/typing.rst:2151 +#: library/typing.rst:2341 msgid "" "Such classes are primarily used with static type checkers that recognize " "structural subtyping (static duck-typing), for example::" msgstr "" -#: library/typing.rst:2154 +#: library/typing.rst:2344 msgid "" "class C:\n" " def meth(self) -> int:\n" @@ -3044,32 +3265,33 @@ msgid "" "func(C()) # Passes static type check" msgstr "" -#: library/typing.rst:2163 +#: library/typing.rst:2353 msgid "" "See :pep:`544` for more details. Protocol classes decorated with :func:" "`runtime_checkable` (described later) act as simple-minded runtime protocols " "that check only the presence of given attributes, ignoring their type " -"signatures." +"signatures. Protocol classes without this decorator cannot be used as the " +"second argument to :func:`isinstance` or :func:`issubclass`." msgstr "" -#: library/typing.rst:2168 +#: library/typing.rst:2359 msgid "Protocol classes can be generic, for example::" msgstr "" -#: library/typing.rst:2170 +#: library/typing.rst:2361 msgid "" "class GenProto[T](Protocol):\n" " def meth(self) -> T:\n" " ..." msgstr "" -#: library/typing.rst:2174 +#: library/typing.rst:2365 msgid "" "In code that needs to be compatible with Python 3.11 or older, generic " "Protocols can be written as follows::" msgstr "" -#: library/typing.rst:2177 +#: library/typing.rst:2368 msgid "" "T = TypeVar(\"T\")\n" "\n" @@ -3078,20 +3300,19 @@ msgid "" " ..." msgstr "" -#: library/typing.rst:2187 +#: library/typing.rst:2378 msgid "Mark a protocol class as a runtime protocol." msgstr "" -#: library/typing.rst:2189 +#: library/typing.rst:2380 msgid "" "Such a protocol can be used with :func:`isinstance` and :func:`issubclass`. " -"This raises :exc:`TypeError` when applied to a non-protocol class. This " -"allows a simple-minded structural check, very similar to \"one trick " +"This allows a simple-minded structural check, very similar to \"one trick " "ponies\" in :mod:`collections.abc` such as :class:`~collections.abc." "Iterable`. For example::" msgstr "" -#: library/typing.rst:2194 +#: library/typing.rst:2384 msgid "" "@runtime_checkable\n" "class Closable(Protocol):\n" @@ -3107,7 +3328,12 @@ msgid "" "assert isinstance(threading.Thread(name='Bob'), Named)" msgstr "" -#: library/typing.rst:2209 +#: library/typing.rst:2397 +msgid "" +"This decorator raises :exc:`TypeError` when applied to a non-protocol class." +msgstr "" + +#: library/typing.rst:2401 msgid "" ":func:`!runtime_checkable` will check only the presence of the required " "methods or attributes, not their type signatures or types. For example, :" @@ -3118,7 +3344,7 @@ msgid "" "(instantiate) :class:`ssl.SSLObject`." msgstr "" -#: library/typing.rst:2220 +#: library/typing.rst:2412 msgid "" "An :func:`isinstance` check against a runtime-checkable protocol can be " "surprisingly slow compared to an ``isinstance()`` check against a non-" @@ -3126,7 +3352,7 @@ msgid "" "calls for structural checks in performance-sensitive code." msgstr "" -#: library/typing.rst:2228 +#: library/typing.rst:2420 msgid "" "The internal implementation of :func:`isinstance` checks against runtime-" "checkable protocols now uses :func:`inspect.getattr_static` to look up " @@ -3136,7 +3362,7 @@ msgid "" "versa. Most users are unlikely to be affected by this change." msgstr "" -#: library/typing.rst:2237 +#: library/typing.rst:2429 msgid "" "The members of a runtime-checkable protocol are now considered \"frozen\" at " "runtime as soon as the class has been created. Monkey-patching attributes " @@ -3145,13 +3371,13 @@ msgid "" "`\"What's new in Python 3.12\" ` for more details." msgstr "" -#: library/typing.rst:2248 +#: library/typing.rst:2440 msgid "" "Special construct to add type hints to a dictionary. At runtime it is a " "plain :class:`dict`." msgstr "" -#: library/typing.rst:2251 +#: library/typing.rst:2443 msgid "" "``TypedDict`` declares a dictionary type that expects all of its instances " "to have a certain set of keys, where each key is associated with a value of " @@ -3159,7 +3385,7 @@ msgid "" "enforced by type checkers. Usage::" msgstr "" -#: library/typing.rst:2257 +#: library/typing.rst:2449 msgid "" "class Point2D(TypedDict):\n" " x: int\n" @@ -3172,36 +3398,17 @@ msgid "" "assert Point2D(x=1, y=2, label='first') == dict(x=1, y=2, label='first')" msgstr "" -#: library/typing.rst:2267 +#: library/typing.rst:2459 msgid "" -"To allow using this feature with older versions of Python that do not " -"support :pep:`526`, ``TypedDict`` supports two additional equivalent " -"syntactic forms:" +"An alternative way to create a ``TypedDict`` is by using function-call " +"syntax. The second argument must be a literal :class:`dict`::" msgstr "" -#: library/typing.rst:2271 -msgid "Using a literal :class:`dict` as the second argument::" -msgstr "" - -#: library/typing.rst:2273 +#: library/typing.rst:2462 msgid "Point2D = TypedDict('Point2D', {'x': int, 'y': int, 'label': str})" msgstr "" -#: library/typing.rst:2275 -msgid "Using keyword arguments::" -msgstr "" - -#: library/typing.rst:2277 -msgid "Point2D = TypedDict('Point2D', x=int, y=int, label=str)" -msgstr "" - -#: library/typing.rst:2279 -msgid "" -"The keyword-argument syntax is deprecated in 3.11 and will be removed in " -"3.13. It may also be unsupported by static type checkers." -msgstr "" - -#: library/typing.rst:2283 +#: library/typing.rst:2464 msgid "" "This functional syntax allows defining keys which are not valid :ref:" "`identifiers `, for example because they are keywords or " @@ -3209,7 +3416,7 @@ msgid "" "mangling>` like regular private names::" msgstr "" -#: library/typing.rst:2288 +#: library/typing.rst:2469 msgid "" "# raises SyntaxError\n" "class Point2D(TypedDict):\n" @@ -3224,13 +3431,13 @@ msgid "" "Definition = TypedDict('Definition', {'__schema': str}) # not mangled" msgstr "" -#: library/typing.rst:2300 +#: library/typing.rst:2481 msgid "" "By default, all keys must be present in a ``TypedDict``. It is possible to " "mark individual keys as non-required using :data:`NotRequired`::" msgstr "" -#: library/typing.rst:2303 +#: library/typing.rst:2484 msgid "" "class Point2D(TypedDict):\n" " x: int\n" @@ -3242,19 +3449,19 @@ msgid "" "NotRequired[str]})" msgstr "" -#: library/typing.rst:2311 +#: library/typing.rst:2492 msgid "" "This means that a ``Point2D`` ``TypedDict`` can have the ``label`` key " "omitted." msgstr "" -#: library/typing.rst:2314 +#: library/typing.rst:2495 msgid "" "It is also possible to mark all keys as non-required by default by " "specifying a totality of ``False``::" msgstr "" -#: library/typing.rst:2317 +#: library/typing.rst:2498 msgid "" "class Point2D(TypedDict, total=False):\n" " x: int\n" @@ -3264,7 +3471,7 @@ msgid "" "Point2D = TypedDict('Point2D', {'x': int, 'y': int}, total=False)" msgstr "" -#: library/typing.rst:2324 +#: library/typing.rst:2505 msgid "" "This means that a ``Point2D`` ``TypedDict`` can have any of the keys " "omitted. A type checker is only expected to support a literal ``False`` or " @@ -3272,13 +3479,13 @@ msgid "" "and makes all items defined in the class body required." msgstr "" -#: library/typing.rst:2329 +#: library/typing.rst:2510 msgid "" "Individual keys of a ``total=False`` ``TypedDict`` can be marked as required " "using :data:`Required`::" msgstr "" -#: library/typing.rst:2332 +#: library/typing.rst:2513 msgid "" "class Point2D(TypedDict, total=False):\n" " x: Required[int]\n" @@ -3293,25 +3500,25 @@ msgid "" "}, total=False)" msgstr "" -#: library/typing.rst:2344 +#: library/typing.rst:2525 msgid "" "It is possible for a ``TypedDict`` type to inherit from one or more other " "``TypedDict`` types using the class-based syntax. Usage::" msgstr "" -#: library/typing.rst:2348 +#: library/typing.rst:2529 msgid "" "class Point3D(Point2D):\n" " z: int" msgstr "" -#: library/typing.rst:2351 +#: library/typing.rst:2532 msgid "" "``Point3D`` has three items: ``x``, ``y`` and ``z``. It is equivalent to " "this definition::" msgstr "" -#: library/typing.rst:2354 +#: library/typing.rst:2535 msgid "" "class Point3D(TypedDict):\n" " x: int\n" @@ -3319,13 +3526,13 @@ msgid "" " z: int" msgstr "" -#: library/typing.rst:2359 +#: library/typing.rst:2540 msgid "" "A ``TypedDict`` cannot inherit from a non-\\ ``TypedDict`` class, except " "for :class:`Generic`. For example::" msgstr "" -#: library/typing.rst:2362 +#: library/typing.rst:2543 msgid "" "class X(TypedDict):\n" " x: int\n" @@ -3340,24 +3547,24 @@ msgid "" "class XZ(X, Z): pass # raises TypeError" msgstr "" -#: library/typing.rst:2374 +#: library/typing.rst:2555 msgid "A ``TypedDict`` can be generic::" msgstr "" -#: library/typing.rst:2376 +#: library/typing.rst:2557 msgid "" "class Group[T](TypedDict):\n" " key: T\n" " group: list[T]" msgstr "" -#: library/typing.rst:2380 +#: library/typing.rst:2561 msgid "" "To create a generic ``TypedDict`` that is compatible with Python 3.11 or " "lower, inherit from :class:`Generic` explicitly:" msgstr "" -#: library/typing.rst:2383 +#: library/typing.rst:2564 msgid "" "T = TypeVar(\"T\")\n" "\n" @@ -3366,19 +3573,19 @@ msgid "" " group: list[T]" msgstr "" -#: library/typing.rst:2391 +#: library/typing.rst:2572 msgid "" "A ``TypedDict`` can be introspected via annotations dicts (see :ref:" "`annotations-howto` for more information on annotations best practices), :" "attr:`__total__`, :attr:`__required_keys__`, and :attr:`__optional_keys__`." msgstr "" -#: library/typing.rst:2397 +#: library/typing.rst:2578 msgid "" "``Point2D.__total__`` gives the value of the ``total`` argument. Example:" msgstr "" -#: library/typing.rst:2400 +#: library/typing.rst:2581 msgid "" ">>> from typing import TypedDict\n" ">>> class Point2D(TypedDict): pass\n" @@ -3392,7 +3599,7 @@ msgid "" "True" msgstr "" -#: library/typing.rst:2413 +#: library/typing.rst:2594 msgid "" "This attribute reflects *only* the value of the ``total`` argument to the " "current ``TypedDict`` class, not whether the class is semantically total. " @@ -3403,21 +3610,21 @@ msgid "" "introspection." msgstr "" -#: library/typing.rst:2426 +#: library/typing.rst:2607 msgid "" "``Point2D.__required_keys__`` and ``Point2D.__optional_keys__`` return :" "class:`frozenset` objects containing required and non-required keys, " "respectively." msgstr "" -#: library/typing.rst:2429 +#: library/typing.rst:2610 msgid "" "Keys marked with :data:`Required` will always appear in " "``__required_keys__`` and keys marked with :data:`NotRequired` will always " "appear in ``__optional_keys__``." msgstr "" -#: library/typing.rst:2432 +#: library/typing.rst:2613 msgid "" "For backwards compatibility with Python 3.10 and below, it is also possible " "to use inheritance to declare both required and non-required keys in the " @@ -3426,7 +3633,7 @@ msgid "" "``TypedDict`` with a different value for ``total``:" msgstr "" -#: library/typing.rst:2439 +#: library/typing.rst:2620 msgid "" ">>> class Point2D(TypedDict, total=False):\n" "... x: int\n" @@ -3441,7 +3648,7 @@ msgid "" "True" msgstr "" -#: library/typing.rst:2457 +#: library/typing.rst:2638 msgid "" "If ``from __future__ import annotations`` is used or if annotations are " "given as strings, annotations are not evaluated when the ``TypedDict`` is " @@ -3450,121 +3657,157 @@ msgid "" "attributes may be incorrect." msgstr "" -#: library/typing.rst:2463 +#: library/typing.rst:2644 +msgid "Support for :data:`ReadOnly` is reflected in the following attributes:" +msgstr "" + +#: library/typing.rst:2648 +msgid "" +"A :class:`frozenset` containing the names of all read-only keys. Keys are " +"read-only if they carry the :data:`ReadOnly` qualifier." +msgstr "" + +#: library/typing.rst:2655 +msgid "" +"A :class:`frozenset` containing the names of all mutable keys. Keys are " +"mutable if they do not carry the :data:`ReadOnly` qualifier." +msgstr "" + +#: library/typing.rst:2660 msgid "" "See :pep:`589` for more examples and detailed rules of using ``TypedDict``." msgstr "" -#: library/typing.rst:2467 +#: library/typing.rst:2664 msgid "" "Added support for marking individual keys as :data:`Required` or :data:" "`NotRequired`. See :pep:`655`." msgstr "" -#: library/typing.rst:2471 +#: library/typing.rst:2668 msgid "Added support for generic ``TypedDict``\\ s." msgstr "" -#: library/typing.rst:2475 +#: library/typing.rst:2671 +msgid "" +"Removed support for the keyword-argument method of creating ``TypedDict``\\ " +"s." +msgstr "" + +#: library/typing.rst:2674 +msgid "Support for the :data:`ReadOnly` qualifier was added." +msgstr "" + +#: library/typing.rst:2677 +msgid "" +"When using the functional syntax to create a TypedDict class, failing to " +"pass a value to the 'fields' parameter (``TD = TypedDict(\"TD\")``) is " +"deprecated. Passing ``None`` to the 'fields' parameter (``TD = " +"TypedDict(\"TD\", None)``) is also deprecated. Both will be disallowed in " +"Python 3.15. To create a TypedDict class with 0 fields, use ``class " +"TD(TypedDict): pass`` or ``TD = TypedDict(\"TD\", {})``." +msgstr "" + +#: library/typing.rst:2686 msgid "Protocols" msgstr "" -#: library/typing.rst:2477 +#: library/typing.rst:2688 msgid "" -"The following protocols are provided by the typing module. All are decorated " -"with :func:`@runtime_checkable `." +"The following protocols are provided by the :mod:`!typing` module. All are " +"decorated with :func:`@runtime_checkable `." msgstr "" -#: library/typing.rst:2482 +#: library/typing.rst:2693 msgid "" "An ABC with one abstract method ``__abs__`` that is covariant in its return " "type." msgstr "" -#: library/typing.rst:2487 +#: library/typing.rst:2698 msgid "An ABC with one abstract method ``__bytes__``." msgstr "" -#: library/typing.rst:2491 +#: library/typing.rst:2702 msgid "An ABC with one abstract method ``__complex__``." msgstr "" -#: library/typing.rst:2495 +#: library/typing.rst:2706 msgid "An ABC with one abstract method ``__float__``." msgstr "" -#: library/typing.rst:2499 +#: library/typing.rst:2710 msgid "An ABC with one abstract method ``__index__``." msgstr "" -#: library/typing.rst:2505 +#: library/typing.rst:2716 msgid "An ABC with one abstract method ``__int__``." msgstr "" -#: library/typing.rst:2509 +#: library/typing.rst:2720 msgid "" "An ABC with one abstract method ``__round__`` that is covariant in its " "return type." msgstr "" -#: library/typing.rst:2513 +#: library/typing.rst:2724 msgid "ABCs for working with IO" msgstr "" -#: library/typing.rst:2519 +#: library/typing.rst:2730 msgid "" "Generic type ``IO[AnyStr]`` and its subclasses ``TextIO(IO[str])`` and " "``BinaryIO(IO[bytes])`` represent the types of I/O streams such as returned " "by :func:`open`." msgstr "" -#: library/typing.rst:2525 +#: library/typing.rst:2736 msgid "Functions and decorators" msgstr "" -#: library/typing.rst:2529 +#: library/typing.rst:2740 msgid "Cast a value to a type." msgstr "" -#: library/typing.rst:2531 +#: library/typing.rst:2742 msgid "" "This returns the value unchanged. To the type checker this signals that the " "return value has the designated type, but at runtime we intentionally don't " "check anything (we want this to be as fast as possible)." msgstr "" -#: library/typing.rst:2538 +#: library/typing.rst:2749 msgid "" "Ask a static type checker to confirm that *val* has an inferred type of " "*typ*." msgstr "" -#: library/typing.rst:2540 +#: library/typing.rst:2751 msgid "" "At runtime this does nothing: it returns the first argument unchanged with " "no checks or side effects, no matter the actual type of the argument." msgstr "" -#: library/typing.rst:2543 +#: library/typing.rst:2754 msgid "" "When a static type checker encounters a call to ``assert_type()``, it emits " "an error if the value is not of the specified type::" msgstr "" -#: library/typing.rst:2546 +#: library/typing.rst:2757 msgid "" "def greet(name: str) -> None:\n" " assert_type(name, str) # OK, inferred type of `name` is `str`\n" " assert_type(name, int) # type checker error" msgstr "" -#: library/typing.rst:2550 +#: library/typing.rst:2761 msgid "" "This function is useful for ensuring the type checker's understanding of a " "script is in line with the developer's intentions::" msgstr "" -#: library/typing.rst:2553 +#: library/typing.rst:2764 msgid "" "def complex_function(arg: object):\n" " # Do some complex type-narrowing logic,\n" @@ -3574,16 +3817,16 @@ msgid "" " assert_type(arg, int)" msgstr "" -#: library/typing.rst:2564 +#: library/typing.rst:2775 msgid "" "Ask a static type checker to confirm that a line of code is unreachable." msgstr "" -#: library/typing.rst:2566 +#: library/typing.rst:2777 msgid "Example::" msgstr "" -#: library/typing.rst:2568 +#: library/typing.rst:2779 msgid "" "def int_or_str(arg: int | str) -> None:\n" " match arg:\n" @@ -3595,14 +3838,14 @@ msgid "" " assert_never(unreachable)" msgstr "" -#: library/typing.rst:2577 +#: library/typing.rst:2788 msgid "" "Here, the annotations allow the type checker to infer that the last case can " "never execute, because ``arg`` is either an :class:`int` or a :class:`str`, " "and both options are covered by earlier cases." msgstr "" -#: library/typing.rst:2582 +#: library/typing.rst:2793 msgid "" "If a type checker finds that a call to ``assert_never()`` is reachable, it " "will emit an error. For example, if the type annotation for ``arg`` was " @@ -3612,59 +3855,59 @@ msgid "" "passed in must be the bottom type, :data:`Never`, and nothing else." msgstr "" -#: library/typing.rst:2590 +#: library/typing.rst:2801 msgid "At runtime, this throws an exception when called." msgstr "" -#: library/typing.rst:2593 +#: library/typing.rst:2804 msgid "" "`Unreachable Code and Exhaustiveness Checking `__ has more information about exhaustiveness " "checking with static typing." msgstr "" -#: library/typing.rst:2601 +#: library/typing.rst:2812 msgid "Ask a static type checker to reveal the inferred type of an expression." msgstr "" -#: library/typing.rst:2603 +#: library/typing.rst:2814 msgid "" "When a static type checker encounters a call to this function, it emits a " "diagnostic with the inferred type of the argument. For example::" msgstr "" -#: library/typing.rst:2606 +#: library/typing.rst:2817 msgid "" "x: int = 1\n" "reveal_type(x) # Revealed type is \"builtins.int\"" msgstr "" -#: library/typing.rst:2609 +#: library/typing.rst:2820 msgid "" "This can be useful when you want to debug how your type checker handles a " "particular piece of code." msgstr "" -#: library/typing.rst:2612 +#: library/typing.rst:2823 msgid "" "At runtime, this function prints the runtime type of its argument to :data:" "`sys.stderr` and returns the argument unchanged (allowing the call to be " "used within an expression)::" msgstr "" -#: library/typing.rst:2616 +#: library/typing.rst:2827 msgid "" "x = reveal_type(1) # prints \"Runtime type is int\"\n" "print(x) # prints \"1\"" msgstr "" -#: library/typing.rst:2619 +#: library/typing.rst:2830 msgid "" "Note that the runtime type may be different from (more or less specific " "than) the type statically inferred by a type checker." msgstr "" -#: library/typing.rst:2622 +#: library/typing.rst:2833 msgid "" "Most type checkers support ``reveal_type()`` anywhere, even if the name is " "not imported from ``typing``. Importing the name from ``typing``, however, " @@ -3672,13 +3915,13 @@ msgid "" "clearly." msgstr "" -#: library/typing.rst:2633 +#: library/typing.rst:2844 msgid "" "Decorator to mark an object as providing :func:`dataclass `-like behavior." msgstr "" -#: library/typing.rst:2636 +#: library/typing.rst:2847 msgid "" "``dataclass_transform`` may be used to decorate a class, metaclass, or a " "function that is itself a decorator. The presence of " @@ -3687,11 +3930,11 @@ msgid "" "to :func:`@dataclasses.dataclass `." msgstr "" -#: library/typing.rst:2643 +#: library/typing.rst:2854 msgid "Example usage with a decorator function:" msgstr "" -#: library/typing.rst:2645 +#: library/typing.rst:2856 msgid "" "@dataclass_transform()\n" "def create_model[T](cls: type[T]) -> type[T]:\n" @@ -3704,11 +3947,11 @@ msgid "" " name: str" msgstr "" -#: library/typing.rst:2657 +#: library/typing.rst:2868 msgid "On a base class::" msgstr "" -#: library/typing.rst:2659 +#: library/typing.rst:2870 msgid "" "@dataclass_transform()\n" "class ModelBase: ...\n" @@ -3718,11 +3961,11 @@ msgid "" " name: str" msgstr "" -#: library/typing.rst:2666 +#: library/typing.rst:2877 msgid "On a metaclass::" msgstr "" -#: library/typing.rst:2668 +#: library/typing.rst:2879 msgid "" "@dataclass_transform()\n" "class ModelMeta(type): ...\n" @@ -3734,7 +3977,7 @@ msgid "" " name: str" msgstr "" -#: library/typing.rst:2677 +#: library/typing.rst:2888 msgid "" "The ``CustomerModel`` classes defined above will be treated by type checkers " "similarly to classes created with :func:`@dataclasses.dataclass None:\n" @@ -3940,24 +4183,24 @@ msgid "" " ... # actual implementation goes here" msgstr "" -#: library/typing.rst:2805 +#: library/typing.rst:3016 msgid "" "See :pep:`484` for more details and comparison with other typing semantics." msgstr "" -#: library/typing.rst:2807 +#: library/typing.rst:3018 msgid "" "Overloaded functions can now be introspected at runtime using :func:" "`get_overloads`." msgstr "" -#: library/typing.rst:2814 +#: library/typing.rst:3025 msgid "" "Return a sequence of :func:`@overload `-decorated definitions for " "*func*." msgstr "" -#: library/typing.rst:2817 +#: library/typing.rst:3028 msgid "" "*func* is the function object for the implementation of the overloaded " "function. For example, given the definition of ``process`` in the " @@ -3967,32 +4210,32 @@ msgid "" "returns an empty sequence." msgstr "" -#: library/typing.rst:2824 +#: library/typing.rst:3035 msgid "" "``get_overloads()`` can be used for introspecting an overloaded function at " "runtime." msgstr "" -#: library/typing.rst:2832 +#: library/typing.rst:3043 msgid "Clear all registered overloads in the internal registry." msgstr "" -#: library/typing.rst:2834 +#: library/typing.rst:3045 msgid "This can be used to reclaim the memory used by the registry." msgstr "" -#: library/typing.rst:2841 +#: library/typing.rst:3052 msgid "Decorator to indicate final methods and final classes." msgstr "" -#: library/typing.rst:2843 +#: library/typing.rst:3054 msgid "" "Decorating a method with ``@final`` indicates to a type checker that the " "method cannot be overridden in a subclass. Decorating a class with " "``@final`` indicates that it cannot be subclassed." msgstr "" -#: library/typing.rst:2849 +#: library/typing.rst:3060 msgid "" "class Base:\n" " @final\n" @@ -4009,7 +4252,7 @@ msgid "" " ..." msgstr "" -#: library/typing.rst:2868 +#: library/typing.rst:3079 msgid "" "The decorator will now attempt to set a ``__final__`` attribute to ``True`` " "on the decorated object. Thus, a check like ``if getattr(obj, \"__final__\", " @@ -4019,11 +4262,11 @@ msgid "" "exception." msgstr "" -#: library/typing.rst:2879 +#: library/typing.rst:3090 msgid "Decorator to indicate that annotations are not type hints." msgstr "" -#: library/typing.rst:2881 +#: library/typing.rst:3092 msgid "" "This works as a class or function :term:`decorator`. With a class, it " "applies recursively to all methods and classes defined in that class (but " @@ -4031,34 +4274,40 @@ msgid "" "will ignore all annotations in a function or class with this decorator." msgstr "" -#: library/typing.rst:2887 +#: library/typing.rst:3098 msgid "``@no_type_check`` mutates the decorated object in place." msgstr "" -#: library/typing.rst:2891 +#: library/typing.rst:3102 msgid "Decorator to give another decorator the :func:`no_type_check` effect." msgstr "" -#: library/typing.rst:2893 +#: library/typing.rst:3104 msgid "" "This wraps the decorator with something that wraps the decorated function " "in :func:`no_type_check`." msgstr "" -#: library/typing.rst:2899 +#: library/typing.rst:3107 +msgid "" +"No type checker ever added support for ``@no_type_check_decorator``. It is " +"therefore deprecated, and will be removed in Python 3.15." +msgstr "" + +#: library/typing.rst:3113 msgid "" "Decorator to indicate that a method in a subclass is intended to override a " "method or attribute in a superclass." msgstr "" -#: library/typing.rst:2902 +#: library/typing.rst:3116 msgid "" "Type checkers should emit an error if a method decorated with ``@override`` " "does not, in fact, override anything. This helps prevent bugs that may occur " "when a base class is changed without an equivalent change to a child class." msgstr "" -#: library/typing.rst:2909 +#: library/typing.rst:3123 msgid "" "class Base:\n" " def log_status(self) -> None:\n" @@ -4074,11 +4323,11 @@ msgid "" " ..." msgstr "" -#: library/typing.rst:2924 +#: library/typing.rst:3138 msgid "There is no runtime checking of this property." msgstr "" -#: library/typing.rst:2926 +#: library/typing.rst:3140 msgid "" "The decorator will attempt to set an ``__override__`` attribute to ``True`` " "on the decorated object. Thus, a check like ``if getattr(obj, " @@ -4088,22 +4337,22 @@ msgid "" "without raising an exception." msgstr "" -#: library/typing.rst:2933 +#: library/typing.rst:3147 msgid "See :pep:`698` for more details." msgstr "" -#: library/typing.rst:2940 +#: library/typing.rst:3154 msgid "Decorator to mark a class or function as unavailable at runtime." msgstr "" -#: library/typing.rst:2942 +#: library/typing.rst:3156 msgid "" "This decorator is itself not available at runtime. It is mainly intended to " "mark classes that are defined in type stub files if an implementation " "returns an instance of a private class::" msgstr "" -#: library/typing.rst:2946 +#: library/typing.rst:3160 msgid "" "@type_check_only\n" "class Response: # private or not available at runtime\n" @@ -4113,29 +4362,29 @@ msgid "" "def fetch_response() -> Response: ..." msgstr "" -#: library/typing.rst:2953 +#: library/typing.rst:3167 msgid "" "Note that returning instances of private classes is not recommended. It is " "usually preferable to make such classes public." msgstr "" -#: library/typing.rst:2957 +#: library/typing.rst:3171 msgid "Introspection helpers" msgstr "" -#: library/typing.rst:2961 +#: library/typing.rst:3175 msgid "" "Return a dictionary containing type hints for a function, method, module or " "class object." msgstr "" -#: library/typing.rst:2964 +#: library/typing.rst:3178 msgid "" "This is often the same as ``obj.__annotations__``, but this function makes " "the following changes to the annotations dictionary:" msgstr "" -#: library/typing.rst:2967 +#: library/typing.rst:3181 msgid "" "Forward references encoded as string literals or :class:`ForwardRef` objects " "are handled by evaluating them in *globalns*, *localns*, and (where " @@ -4144,17 +4393,17 @@ msgid "" "inferred from *obj*." msgstr "" -#: library/typing.rst:2972 +#: library/typing.rst:3186 msgid "``None`` is replaced with :class:`types.NoneType`." msgstr "" -#: library/typing.rst:2973 +#: library/typing.rst:3187 msgid "" "If :func:`@no_type_check ` has been applied to *obj*, an " "empty dictionary is returned." msgstr "" -#: library/typing.rst:2975 +#: library/typing.rst:3189 msgid "" "If *obj* is a class ``C``, the function returns a dictionary that merges " "annotations from ``C``'s base classes with those on ``C`` directly. This is " @@ -4164,20 +4413,20 @@ msgid "" "annotations on classes appearing later in the method resolution order." msgstr "" -#: library/typing.rst:2982 +#: library/typing.rst:3196 msgid "" "The function recursively replaces all occurrences of ``Annotated[T, ...]`` " "with ``T``, unless *include_extras* is set to ``True`` (see :class:" "`Annotated` for more information)." msgstr "" -#: library/typing.rst:2986 +#: library/typing.rst:3200 msgid "" "See also :func:`inspect.get_annotations`, a lower-level function that " "returns annotations more directly." msgstr "" -#: library/typing.rst:2991 +#: library/typing.rst:3205 msgid "" "If any forward references in the annotations of *obj* are not resolvable or " "are not valid Python code, this function will raise an exception such as :" @@ -4186,26 +4435,26 @@ msgid "" "imported under :data:`if TYPE_CHECKING `." msgstr "" -#: library/typing.rst:2997 +#: library/typing.rst:3211 msgid "" "Added ``include_extras`` parameter as part of :pep:`593`. See the " "documentation on :data:`Annotated` for more information." msgstr "" -#: library/typing.rst:3001 +#: library/typing.rst:3215 msgid "" "Previously, ``Optional[t]`` was added for function and method annotations if " "a default value equal to ``None`` was set. Now the annotation is returned " "unchanged." msgstr "" -#: library/typing.rst:3008 +#: library/typing.rst:3222 msgid "" "Get the unsubscripted version of a type: for a typing object of the form " "``X[Y, Z, ...]`` return ``X``." msgstr "" -#: library/typing.rst:3011 +#: library/typing.rst:3225 msgid "" "If ``X`` is a typing-module alias for a builtin or :mod:`collections` class, " "it will be normalized to the original class. If ``X`` is an instance of :" @@ -4213,11 +4462,11 @@ msgid "" "class:`ParamSpec`. Return ``None`` for unsupported objects." msgstr "" -#: library/typing.rst:3041 +#: library/typing.rst:3255 msgid "Examples:" msgstr "" -#: library/typing.rst:3019 +#: library/typing.rst:3233 msgid "" "assert get_origin(str) is None\n" "assert get_origin(Dict[str, int]) is dict\n" @@ -4228,13 +4477,13 @@ msgid "" "assert get_origin(P.kwargs) is P" msgstr "" -#: library/typing.rst:3033 +#: library/typing.rst:3247 msgid "" "Get type arguments with all substitutions performed: for a typing object of " "the form ``X[Y, Z, ...]`` return ``(Y, Z, ...)``." msgstr "" -#: library/typing.rst:3036 +#: library/typing.rst:3250 msgid "" "If ``X`` is a union or :class:`Literal` contained in another generic type, " "the order of ``(Y, Z, ...)`` may be different from the order of the original " @@ -4242,18 +4491,50 @@ msgid "" "objects." msgstr "" -#: library/typing.rst:3043 +#: library/typing.rst:3257 msgid "" "assert get_args(int) == ()\n" "assert get_args(Dict[int, str]) == (int, str)\n" "assert get_args(Union[int, str]) == (int, str)" msgstr "" -#: library/typing.rst:3053 +#: library/typing.rst:3267 +msgid "Return the set of members defined in a :class:`Protocol`." +msgstr "" + +#: library/typing.rst:3269 +msgid "" +">>> from typing import Protocol, get_protocol_members\n" +">>> class P(Protocol):\n" +"... def a(self) -> str: ...\n" +"... b: int\n" +">>> get_protocol_members(P) == frozenset({'a', 'b'})\n" +"True" +msgstr "" + +#: library/typing.rst:3278 +msgid "Raise :exc:`TypeError` for arguments that are not Protocols." +msgstr "" + +#: library/typing.rst:3284 +msgid "Determine if a type is a :class:`Protocol`." +msgstr "" + +#: library/typing.rst:3288 +msgid "" +"class P(Protocol):\n" +" def a(self) -> str: ...\n" +" b: int\n" +"\n" +"is_protocol(P) # => True\n" +"is_protocol(int) # => False" +msgstr "" + +#: library/typing.rst:3299 msgid "Check if a type is a :class:`TypedDict`." msgstr "" -#: library/typing.rst:3057 +#: library/typing.rst:3303 msgid "" "class Film(TypedDict):\n" " title: str\n" @@ -4267,36 +4548,52 @@ msgid "" "assert not is_typeddict(TypedDict)" msgstr "" -#: library/typing.rst:3074 +#: library/typing.rst:3320 msgid "" "Class used for internal typing representation of string forward references." msgstr "" -#: library/typing.rst:3076 +#: library/typing.rst:3322 msgid "" "For example, ``List[\"SomeClass\"]`` is implicitly transformed into " "``List[ForwardRef(\"SomeClass\")]``. ``ForwardRef`` should not be " "instantiated by a user, but may be used by introspection tools." msgstr "" -#: library/typing.rst:3081 +#: library/typing.rst:3327 msgid "" ":pep:`585` generic types such as ``list[\"SomeClass\"]`` will not be " "implicitly transformed into ``list[ForwardRef(\"SomeClass\")]`` and thus " "will not automatically resolve to ``list[SomeClass]``." msgstr "" -#: library/typing.rst:3088 +#: library/typing.rst:3335 +msgid "" +"A sentinel object used to indicate that a type parameter has no default " +"value. For example:" +msgstr "" + +#: library/typing.rst:3338 +msgid "" +">>> T = TypeVar(\"T\")\n" +">>> T.__default__ is typing.NoDefault\n" +"True\n" +">>> S = TypeVar(\"S\", default=None)\n" +">>> S.__default__ is None\n" +"True" +msgstr "" + +#: library/typing.rst:3350 msgid "Constant" msgstr "" -#: library/typing.rst:3092 +#: library/typing.rst:3354 msgid "" "A special constant that is assumed to be ``True`` by 3rd party static type " "checkers. It is ``False`` at runtime." msgstr "" -#: library/typing.rst:3097 +#: library/typing.rst:3359 msgid "" "if TYPE_CHECKING:\n" " import expensive_mod\n" @@ -4305,7 +4602,7 @@ msgid "" " local_var: expensive_mod.AnotherType = other_fun()" msgstr "" -#: library/typing.rst:3103 +#: library/typing.rst:3365 msgid "" "The first type annotation must be enclosed in quotes, making it a \"forward " "reference\", to hide the ``expensive_mod`` reference from the interpreter " @@ -4313,7 +4610,7 @@ msgid "" "second annotation does not need to be enclosed in quotes." msgstr "" -#: library/typing.rst:3110 +#: library/typing.rst:3372 msgid "" "If ``from __future__ import annotations`` is used, annotations are not " "evaluated at function definition time. Instead, they are stored as strings " @@ -4321,20 +4618,20 @@ msgid "" "annotation (see :pep:`563`)." msgstr "" -#: library/typing.rst:3122 +#: library/typing.rst:3384 msgid "Deprecated aliases" msgstr "" -#: library/typing.rst:3124 +#: library/typing.rst:3386 msgid "" "This module defines several deprecated aliases to pre-existing standard " -"library classes. These were originally included in the typing module in " -"order to support parameterizing these generic classes using ``[]``. However, " -"the aliases became redundant in Python 3.9 when the corresponding pre-" -"existing classes were enhanced to support ``[]`` (see :pep:`585`)." +"library classes. These were originally included in the :mod:`!typing` module " +"in order to support parameterizing these generic classes using ``[]``. " +"However, the aliases became redundant in Python 3.9 when the corresponding " +"pre-existing classes were enhanced to support ``[]`` (see :pep:`585`)." msgstr "" -#: library/typing.rst:3131 +#: library/typing.rst:3393 msgid "" "The redundant types are deprecated as of Python 3.9. However, while the " "aliases may be removed at some point, removal of these aliases is not " @@ -4342,46 +4639,46 @@ msgid "" "the interpreter for these aliases." msgstr "" -#: library/typing.rst:3136 +#: library/typing.rst:3398 msgid "" "If at some point it is decided to remove these deprecated aliases, a " "deprecation warning will be issued by the interpreter for at least two " -"releases prior to removal. The aliases are guaranteed to remain in the " -"typing module without deprecation warnings until at least Python 3.14." +"releases prior to removal. The aliases are guaranteed to remain in the :mod:" +"`!typing` module without deprecation warnings until at least Python 3.14." msgstr "" -#: library/typing.rst:3141 +#: library/typing.rst:3403 msgid "" "Type checkers are encouraged to flag uses of the deprecated types if the " "program they are checking targets a minimum Python version of 3.9 or newer." msgstr "" -#: library/typing.rst:3147 +#: library/typing.rst:3409 msgid "Aliases to built-in types" msgstr "" -#: library/typing.rst:3151 +#: library/typing.rst:3413 msgid "Deprecated alias to :class:`dict`." msgstr "" -#: library/typing.rst:3153 +#: library/typing.rst:3415 msgid "" "Note that to annotate arguments, it is preferred to use an abstract " "collection type such as :class:`~collections.abc.Mapping` rather than to " "use :class:`dict` or :class:`!typing.Dict`." msgstr "" -#: library/typing.rst:3157 +#: library/typing.rst:3419 msgid "" ":class:`builtins.dict ` now supports subscripting (``[]``). See :pep:" "`585` and :ref:`types-genericalias`." msgstr "" -#: library/typing.rst:3163 +#: library/typing.rst:3425 msgid "Deprecated alias to :class:`list`." msgstr "" -#: library/typing.rst:3165 +#: library/typing.rst:3427 msgid "" "Note that to annotate arguments, it is preferred to use an abstract " "collection type such as :class:`~collections.abc.Sequence` or :class:" @@ -4389,142 +4686,136 @@ msgid "" "typing.List`." msgstr "" -#: library/typing.rst:3170 +#: library/typing.rst:3432 msgid "" ":class:`builtins.list ` now supports subscripting (``[]``). See :pep:" "`585` and :ref:`types-genericalias`." msgstr "" -#: library/typing.rst:3176 +#: library/typing.rst:3438 msgid "Deprecated alias to :class:`builtins.set `." msgstr "" -#: library/typing.rst:3178 +#: library/typing.rst:3440 msgid "" "Note that to annotate arguments, it is preferred to use an abstract " "collection type such as :class:`collections.abc.Set` rather than to use :" "class:`set` or :class:`typing.Set`." msgstr "" -#: library/typing.rst:3182 +#: library/typing.rst:3444 msgid "" ":class:`builtins.set ` now supports subscripting (``[]``). See :pep:" "`585` and :ref:`types-genericalias`." msgstr "" -#: library/typing.rst:3188 +#: library/typing.rst:3450 msgid "Deprecated alias to :class:`builtins.frozenset `." msgstr "" -#: library/typing.rst:3190 +#: library/typing.rst:3452 msgid "" ":class:`builtins.frozenset ` now supports subscripting (``[]``). " "See :pep:`585` and :ref:`types-genericalias`." msgstr "" -#: library/typing.rst:3197 +#: library/typing.rst:3459 msgid "Deprecated alias for :class:`tuple`." msgstr "" -#: library/typing.rst:3199 +#: library/typing.rst:3461 msgid "" ":class:`tuple` and ``Tuple`` are special-cased in the type system; see :ref:" "`annotating-tuples` for more details." msgstr "" -#: library/typing.rst:3202 +#: library/typing.rst:3464 msgid "" ":class:`builtins.tuple ` now supports subscripting (``[]``). See :pep:" "`585` and :ref:`types-genericalias`." msgstr "" -#: library/typing.rst:3208 +#: library/typing.rst:3470 msgid "Deprecated alias to :class:`type`." msgstr "" -#: library/typing.rst:3210 +#: library/typing.rst:3472 msgid "" "See :ref:`type-of-class-objects` for details on using :class:`type` or " "``typing.Type`` in type annotations." msgstr "" -#: library/typing.rst:3215 +#: library/typing.rst:3477 msgid "" ":class:`builtins.type ` now supports subscripting (``[]``). See :pep:" "`585` and :ref:`types-genericalias`." msgstr "" -#: library/typing.rst:3222 +#: library/typing.rst:3484 msgid "Aliases to types in :mod:`collections`" msgstr "" -#: library/typing.rst:3226 +#: library/typing.rst:3488 msgid "Deprecated alias to :class:`collections.defaultdict`." msgstr "" -#: library/typing.rst:3230 +#: library/typing.rst:3492 msgid "" ":class:`collections.defaultdict` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: library/typing.rst:3236 +#: library/typing.rst:3498 msgid "Deprecated alias to :class:`collections.OrderedDict`." msgstr "" -#: library/typing.rst:3240 +#: library/typing.rst:3502 msgid "" ":class:`collections.OrderedDict` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: library/typing.rst:3246 +#: library/typing.rst:3508 msgid "Deprecated alias to :class:`collections.ChainMap`." msgstr "" -#: library/typing.rst:3250 +#: library/typing.rst:3512 msgid "" ":class:`collections.ChainMap` now supports subscripting (``[]``). See :pep:" "`585` and :ref:`types-genericalias`." msgstr "" -#: library/typing.rst:3256 +#: library/typing.rst:3518 msgid "Deprecated alias to :class:`collections.Counter`." msgstr "" -#: library/typing.rst:3260 +#: library/typing.rst:3522 msgid "" ":class:`collections.Counter` now supports subscripting (``[]``). See :pep:" "`585` and :ref:`types-genericalias`." msgstr "" -#: library/typing.rst:3266 +#: library/typing.rst:3528 msgid "Deprecated alias to :class:`collections.deque`." msgstr "" -#: library/typing.rst:3270 +#: library/typing.rst:3532 msgid "" ":class:`collections.deque` now supports subscripting (``[]``). See :pep:" "`585` and :ref:`types-genericalias`." msgstr "" -#: library/typing.rst:3277 +#: library/typing.rst:3539 msgid "Aliases to other concrete types" msgstr "" -#: library/typing.rst:3279 -msgid "" -"The ``typing.io`` namespace is deprecated and will be removed. These types " -"should be directly imported from ``typing`` instead." -msgstr "" - -#: library/typing.rst:3286 +#: library/typing.rst:3544 msgid "" "Deprecated aliases corresponding to the return types from :func:`re.compile` " "and :func:`re.match`." msgstr "" -#: library/typing.rst:3289 +#: library/typing.rst:3547 msgid "" "These types (and the corresponding functions) are generic over :data:" "`AnyStr`. ``Pattern`` can be specialised as ``Pattern[str]`` or " @@ -4532,361 +4823,387 @@ msgid "" "``Match[bytes]``." msgstr "" -#: library/typing.rst:3294 -msgid "" -"The ``typing.re`` namespace is deprecated and will be removed. These types " -"should be directly imported from ``typing`` instead." -msgstr "" - -#: library/typing.rst:3298 +#: library/typing.rst:3552 msgid "" "Classes ``Pattern`` and ``Match`` from :mod:`re` now support ``[]``. See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: library/typing.rst:3304 +#: library/typing.rst:3558 msgid "Deprecated alias for :class:`str`." msgstr "" -#: library/typing.rst:3306 +#: library/typing.rst:3560 msgid "" "``Text`` is provided to supply a forward compatible path for Python 2 code: " "in Python 2, ``Text`` is an alias for ``unicode``." msgstr "" -#: library/typing.rst:3310 +#: library/typing.rst:3564 msgid "" "Use ``Text`` to indicate that a value must contain a unicode string in a " "manner that is compatible with both Python 2 and Python 3::" msgstr "" -#: library/typing.rst:3313 +#: library/typing.rst:3567 msgid "" "def add_unicode_checkmark(text: Text) -> Text:\n" " return text + u' \\u2713'" msgstr "" -#: library/typing.rst:3318 +#: library/typing.rst:3572 msgid "" "Python 2 is no longer supported, and most type checkers also no longer " "support type checking Python 2 code. Removal of the alias is not currently " "planned, but users are encouraged to use :class:`str` instead of ``Text``." msgstr "" -#: library/typing.rst:3328 +#: library/typing.rst:3582 msgid "Aliases to container ABCs in :mod:`collections.abc`" msgstr "" -#: library/typing.rst:3332 +#: library/typing.rst:3586 msgid "Deprecated alias to :class:`collections.abc.Set`." msgstr "" -#: library/typing.rst:3334 +#: library/typing.rst:3588 msgid "" ":class:`collections.abc.Set` now supports subscripting (``[]``). See :pep:" "`585` and :ref:`types-genericalias`." msgstr "" -#: library/typing.rst:3340 +#: library/typing.rst:3594 msgid "" "This type represents the types :class:`bytes`, :class:`bytearray`, and :" "class:`memoryview` of byte sequences." msgstr "" -#: library/typing.rst:3343 +#: library/typing.rst:3597 msgid "" "Prefer :class:`collections.abc.Buffer`, or a union like ``bytes | bytearray " "| memoryview``." msgstr "" -#: library/typing.rst:3348 +#: library/typing.rst:3602 msgid "Deprecated alias to :class:`collections.abc.Collection`." msgstr "" -#: library/typing.rst:3352 +#: library/typing.rst:3606 msgid "" ":class:`collections.abc.Collection` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: library/typing.rst:3358 +#: library/typing.rst:3612 msgid "Deprecated alias to :class:`collections.abc.Container`." msgstr "" -#: library/typing.rst:3360 +#: library/typing.rst:3614 msgid "" ":class:`collections.abc.Container` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: library/typing.rst:3366 +#: library/typing.rst:3620 msgid "Deprecated alias to :class:`collections.abc.ItemsView`." msgstr "" -#: library/typing.rst:3368 +#: library/typing.rst:3622 msgid "" ":class:`collections.abc.ItemsView` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: library/typing.rst:3374 +#: library/typing.rst:3628 msgid "Deprecated alias to :class:`collections.abc.KeysView`." msgstr "" -#: library/typing.rst:3376 +#: library/typing.rst:3630 msgid "" ":class:`collections.abc.KeysView` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: library/typing.rst:3382 +#: library/typing.rst:3636 msgid "Deprecated alias to :class:`collections.abc.Mapping`." msgstr "" -#: library/typing.rst:3384 +#: library/typing.rst:3638 msgid "" ":class:`collections.abc.Mapping` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: library/typing.rst:3390 +#: library/typing.rst:3644 msgid "Deprecated alias to :class:`collections.abc.MappingView`." msgstr "" -#: library/typing.rst:3392 +#: library/typing.rst:3646 msgid "" ":class:`collections.abc.MappingView` now supports subscripting (``[]``). " "See :pep:`585` and :ref:`types-genericalias`." msgstr "" -#: library/typing.rst:3398 +#: library/typing.rst:3652 msgid "Deprecated alias to :class:`collections.abc.MutableMapping`." msgstr "" -#: library/typing.rst:3400 +#: library/typing.rst:3654 msgid "" ":class:`collections.abc.MutableMapping` now supports subscripting (``[]``). " "See :pep:`585` and :ref:`types-genericalias`." msgstr "" -#: library/typing.rst:3407 +#: library/typing.rst:3661 msgid "Deprecated alias to :class:`collections.abc.MutableSequence`." msgstr "" -#: library/typing.rst:3409 +#: library/typing.rst:3663 msgid "" ":class:`collections.abc.MutableSequence` now supports subscripting (``[]``). " "See :pep:`585` and :ref:`types-genericalias`." msgstr "" -#: library/typing.rst:3416 +#: library/typing.rst:3670 msgid "Deprecated alias to :class:`collections.abc.MutableSet`." msgstr "" -#: library/typing.rst:3418 +#: library/typing.rst:3672 msgid "" ":class:`collections.abc.MutableSet` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: library/typing.rst:3424 +#: library/typing.rst:3678 msgid "Deprecated alias to :class:`collections.abc.Sequence`." msgstr "" -#: library/typing.rst:3426 +#: library/typing.rst:3680 msgid "" ":class:`collections.abc.Sequence` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: library/typing.rst:3432 +#: library/typing.rst:3686 msgid "Deprecated alias to :class:`collections.abc.ValuesView`." msgstr "" -#: library/typing.rst:3434 +#: library/typing.rst:3688 msgid "" ":class:`collections.abc.ValuesView` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: library/typing.rst:3441 +#: library/typing.rst:3695 msgid "Aliases to asynchronous ABCs in :mod:`collections.abc`" msgstr "" -#: library/typing.rst:3445 +#: library/typing.rst:3699 msgid "Deprecated alias to :class:`collections.abc.Coroutine`." msgstr "" -#: library/typing.rst:3447 +#: library/typing.rst:3701 msgid "" "See :ref:`annotating-generators-and-coroutines` for details on using :class:" "`collections.abc.Coroutine` and ``typing.Coroutine`` in type annotations." msgstr "" -#: library/typing.rst:3453 +#: library/typing.rst:3707 msgid "" ":class:`collections.abc.Coroutine` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: library/typing.rst:3459 +#: library/typing.rst:3713 msgid "Deprecated alias to :class:`collections.abc.AsyncGenerator`." msgstr "" -#: library/typing.rst:3461 +#: library/typing.rst:3715 msgid "" "See :ref:`annotating-generators-and-coroutines` for details on using :class:" "`collections.abc.AsyncGenerator` and ``typing.AsyncGenerator`` in type " "annotations." msgstr "" -#: library/typing.rst:3467 +#: library/typing.rst:3721 msgid "" ":class:`collections.abc.AsyncGenerator` now supports subscripting (``[]``). " "See :pep:`585` and :ref:`types-genericalias`." msgstr "" -#: library/typing.rst:3474 +#: library/typing.rst:3726 +msgid "The ``SendType`` parameter now has a default." +msgstr "" + +#: library/typing.rst:3731 msgid "Deprecated alias to :class:`collections.abc.AsyncIterable`." msgstr "" -#: library/typing.rst:3478 +#: library/typing.rst:3735 msgid "" ":class:`collections.abc.AsyncIterable` now supports subscripting (``[]``). " "See :pep:`585` and :ref:`types-genericalias`." msgstr "" -#: library/typing.rst:3484 +#: library/typing.rst:3741 msgid "Deprecated alias to :class:`collections.abc.AsyncIterator`." msgstr "" -#: library/typing.rst:3488 +#: library/typing.rst:3745 msgid "" ":class:`collections.abc.AsyncIterator` now supports subscripting (``[]``). " "See :pep:`585` and :ref:`types-genericalias`." msgstr "" -#: library/typing.rst:3494 +#: library/typing.rst:3751 msgid "Deprecated alias to :class:`collections.abc.Awaitable`." msgstr "" -#: library/typing.rst:3498 +#: library/typing.rst:3755 msgid "" ":class:`collections.abc.Awaitable` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: library/typing.rst:3505 +#: library/typing.rst:3762 msgid "Aliases to other ABCs in :mod:`collections.abc`" msgstr "" -#: library/typing.rst:3509 +#: library/typing.rst:3766 msgid "Deprecated alias to :class:`collections.abc.Iterable`." msgstr "" -#: library/typing.rst:3511 +#: library/typing.rst:3768 msgid "" ":class:`collections.abc.Iterable` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: library/typing.rst:3517 +#: library/typing.rst:3774 msgid "Deprecated alias to :class:`collections.abc.Iterator`." msgstr "" -#: library/typing.rst:3519 +#: library/typing.rst:3776 msgid "" ":class:`collections.abc.Iterator` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: library/typing.rst:3525 +#: library/typing.rst:3782 msgid "Deprecated alias to :class:`collections.abc.Callable`." msgstr "" -#: library/typing.rst:3527 +#: library/typing.rst:3784 msgid "" "See :ref:`annotating-callables` for details on how to use :class:" "`collections.abc.Callable` and ``typing.Callable`` in type annotations." msgstr "" -#: library/typing.rst:3530 +#: library/typing.rst:3787 msgid "" ":class:`collections.abc.Callable` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: library/typing.rst:3540 +#: library/typing.rst:3797 msgid "Deprecated alias to :class:`collections.abc.Generator`." msgstr "" -#: library/typing.rst:3542 +#: library/typing.rst:3799 msgid "" "See :ref:`annotating-generators-and-coroutines` for details on using :class:" "`collections.abc.Generator` and ``typing.Generator`` in type annotations." msgstr "" -#: library/typing.rst:3546 +#: library/typing.rst:3803 msgid "" ":class:`collections.abc.Generator` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: library/typing.rst:3552 +#: library/typing.rst:3807 +msgid "Default values for the send and return types were added." +msgstr "" + +#: library/typing.rst:3812 msgid "Deprecated alias to :class:`collections.abc.Hashable`." msgstr "" -#: library/typing.rst:3554 +#: library/typing.rst:3814 msgid "Use :class:`collections.abc.Hashable` directly instead." msgstr "" -#: library/typing.rst:3559 +#: library/typing.rst:3819 msgid "Deprecated alias to :class:`collections.abc.Reversible`." msgstr "" -#: library/typing.rst:3561 +#: library/typing.rst:3821 msgid "" ":class:`collections.abc.Reversible` now supports subscripting (``[]``). See :" "pep:`585` and :ref:`types-genericalias`." msgstr "" -#: library/typing.rst:3567 +#: library/typing.rst:3827 msgid "Deprecated alias to :class:`collections.abc.Sized`." msgstr "" -#: library/typing.rst:3569 +#: library/typing.rst:3829 msgid "Use :class:`collections.abc.Sized` directly instead." msgstr "" -#: library/typing.rst:3575 +#: library/typing.rst:3835 msgid "Aliases to :mod:`contextlib` ABCs" msgstr "" -#: library/typing.rst:3579 +#: library/typing.rst:3839 msgid "Deprecated alias to :class:`contextlib.AbstractContextManager`." msgstr "" -#: library/typing.rst:3583 +#: library/typing.rst:3841 +msgid "" +"The first type parameter, ``T_co``, represents the type returned by the :" +"meth:`~object.__enter__` method. The optional second type parameter, " +"``ExitT_co``, which defaults to ``bool | None``, represents the type " +"returned by the :meth:`~object.__exit__` method." +msgstr "" + +#: library/typing.rst:3848 msgid "" ":class:`contextlib.AbstractContextManager` now supports subscripting " "(``[]``). See :pep:`585` and :ref:`types-genericalias`." msgstr "" -#: library/typing.rst:3590 +#: library/typing.rst:3853 +msgid "Added the optional second type parameter, ``ExitT_co``." +msgstr "" + +#: library/typing.rst:3858 msgid "Deprecated alias to :class:`contextlib.AbstractAsyncContextManager`." msgstr "" -#: library/typing.rst:3594 +#: library/typing.rst:3860 +msgid "" +"The first type parameter, ``T_co``, represents the type returned by the :" +"meth:`~object.__aenter__` method. The optional second type parameter, " +"``AExitT_co``, which defaults to ``bool | None``, represents the type " +"returned by the :meth:`~object.__aexit__` method." +msgstr "" + +#: library/typing.rst:3867 msgid "" ":class:`contextlib.AbstractAsyncContextManager` now supports subscripting " "(``[]``). See :pep:`585` and :ref:`types-genericalias`." msgstr "" -#: library/typing.rst:3600 +#: library/typing.rst:3872 +msgid "Added the optional second type parameter, ``AExitT_co``." +msgstr "" + +#: library/typing.rst:3876 msgid "Deprecation Timeline of Major Features" msgstr "" -#: library/typing.rst:3602 +#: library/typing.rst:3878 msgid "" "Certain features in ``typing`` are deprecated and may be removed in a future " "version of Python. The following table summarizes major deprecations for " @@ -4894,98 +5211,110 @@ msgid "" "listed." msgstr "" -#: library/typing.rst:3609 +#: library/typing.rst:3885 msgid "Feature" msgstr "" -#: library/typing.rst:3610 +#: library/typing.rst:3886 msgid "Deprecated in" msgstr "" -#: library/typing.rst:3611 +#: library/typing.rst:3887 msgid "Projected removal" msgstr "" -#: library/typing.rst:3612 +#: library/typing.rst:3888 msgid "PEP/issue" msgstr "" -#: library/typing.rst:3613 -msgid "``typing.io`` and ``typing.re`` submodules" -msgstr "" - -#: library/typing.rst:3614 -msgid "3.8" -msgstr "" - -#: library/typing.rst:3615 -msgid "3.13" -msgstr "" - -#: library/typing.rst:3616 -msgid ":issue:`38291`" -msgstr "" - -#: library/typing.rst:3617 +#: library/typing.rst:3889 msgid "``typing`` versions of standard collections" msgstr "" -#: library/typing.rst:3622 +#: library/typing.rst:3894 msgid "3.9" msgstr "" -#: library/typing.rst:3619 +#: library/typing.rst:3891 msgid "Undecided (see :ref:`deprecated-aliases` for more information)" msgstr "" -#: library/typing.rst:3620 +#: library/typing.rst:3892 msgid ":pep:`585`" msgstr "" -#: library/typing.rst:3621 +#: library/typing.rst:3893 msgid ":class:`typing.ByteString`" msgstr "" -#: library/typing.rst:3623 +#: library/typing.rst:3895 msgid "3.14" msgstr "" -#: library/typing.rst:3624 +#: library/typing.rst:3896 msgid ":gh:`91896`" msgstr "" -#: library/typing.rst:3625 +#: library/typing.rst:3897 msgid ":data:`typing.Text`" msgstr "" -#: library/typing.rst:3626 +#: library/typing.rst:3898 msgid "3.11" msgstr "" -#: library/typing.rst:3631 library/typing.rst:3635 +#: library/typing.rst:3903 library/typing.rst:3907 msgid "Undecided" msgstr "" -#: library/typing.rst:3628 +#: library/typing.rst:3900 msgid ":gh:`92332`" msgstr "" -#: library/typing.rst:3629 +#: library/typing.rst:3901 msgid ":class:`typing.Hashable` and :class:`typing.Sized`" msgstr "" -#: library/typing.rst:3634 +#: library/typing.rst:3906 msgid "3.12" msgstr "" -#: library/typing.rst:3632 +#: library/typing.rst:3904 msgid ":gh:`94309`" msgstr "" -#: library/typing.rst:3633 +#: library/typing.rst:3905 msgid ":data:`typing.TypeAlias`" msgstr "" -#: library/typing.rst:3636 +#: library/typing.rst:3908 msgid ":pep:`695`" msgstr "" + +#: library/typing.rst:3909 +msgid ":func:`@typing.no_type_check_decorator `" +msgstr "" + +#: library/typing.rst:3914 +msgid "3.13" +msgstr "" + +#: library/typing.rst:3911 +msgid "3.15" +msgstr "" + +#: library/typing.rst:3912 +msgid ":gh:`106309`" +msgstr "" + +#: library/typing.rst:3913 +msgid ":data:`typing.AnyStr`" +msgstr "" + +#: library/typing.rst:3915 +msgid "3.18" +msgstr "" + +#: library/typing.rst:3916 +msgid ":gh:`105578`" +msgstr "" diff --git a/library/unicodedata.po b/library/unicodedata.po index 92ff5cac..6a2eaec8 100644 --- a/library/unicodedata.po +++ b/library/unicodedata.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -25,8 +25,8 @@ msgstr "" msgid "" "This module provides access to the Unicode Character Database (UCD) which " "defines character properties for all Unicode characters. The data contained " -"in this database is compiled from the `UCD version 15.0.0 `_." +"in this database is compiled from the `UCD version 15.1.0 `_." msgstr "" #: library/unicodedata.rst:23 @@ -187,11 +187,11 @@ msgid "Footnotes" msgstr "" #: library/unicodedata.rst:178 -msgid "https://www.unicode.org/Public/15.0.0/ucd/NameAliases.txt" +msgid "https://www.unicode.org/Public/15.1.0/ucd/NameAliases.txt" msgstr "" #: library/unicodedata.rst:180 -msgid "https://www.unicode.org/Public/15.0.0/ucd/NamedSequences.txt" +msgid "https://www.unicode.org/Public/15.1.0/ucd/NamedSequences.txt" msgstr "" #: library/unicodedata.rst:11 diff --git a/library/unittest.mock-examples.po b/library/unittest.mock-examples.po index 5ee43046..d59d15d2 100644 --- a/library/unittest.mock-examples.po +++ b/library/unittest.mock-examples.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -851,7 +851,7 @@ msgid "" "call_count` is one." msgstr "" -#: library/unittest.mock-examples.rst:803 +#: library/unittest.mock-examples.rst:804 msgid "" "Both ``assert_called_with`` and ``assert_called_once_with`` make assertions " "about the *most recent* call. If your mock is going to be called several " @@ -859,7 +859,7 @@ msgid "" "attr:`~Mock.call_args_list`:" msgstr "" -#: library/unittest.mock-examples.rst:815 +#: library/unittest.mock-examples.rst:816 msgid "" "The :data:`call` helper makes it easy to make assertions about these calls. " "You can build up a list of expected calls and compare it to " @@ -867,11 +867,11 @@ msgid "" "``call_args_list``:" msgstr "" -#: library/unittest.mock-examples.rst:825 +#: library/unittest.mock-examples.rst:826 msgid "Coping with mutable arguments" msgstr "" -#: library/unittest.mock-examples.rst:827 +#: library/unittest.mock-examples.rst:828 msgid "" "Another situation is rare, but can bite you, is when your mock is called " "with mutable arguments. ``call_args`` and ``call_args_list`` store " @@ -880,13 +880,13 @@ msgid "" "when the mock was called." msgstr "" -#: library/unittest.mock-examples.rst:832 +#: library/unittest.mock-examples.rst:833 msgid "" "Here's some example code that shows the problem. Imagine the following " "functions defined in 'mymodule'::" msgstr "" -#: library/unittest.mock-examples.rst:835 +#: library/unittest.mock-examples.rst:836 msgid "" "def frob(val):\n" " pass\n" @@ -897,13 +897,13 @@ msgid "" " val.clear()" msgstr "" -#: library/unittest.mock-examples.rst:843 +#: library/unittest.mock-examples.rst:844 msgid "" "When we try to test that ``grob`` calls ``frob`` with the correct argument " "look what happens::" msgstr "" -#: library/unittest.mock-examples.rst:846 +#: library/unittest.mock-examples.rst:847 msgid "" ">>> with patch('mymodule.frob') as mock_frob:\n" "... val = {6}\n" @@ -918,14 +918,14 @@ msgid "" "Called with: ((set(),), {})" msgstr "" -#: library/unittest.mock-examples.rst:858 +#: library/unittest.mock-examples.rst:859 msgid "" "One possibility would be for mock to copy the arguments you pass in. This " "could then cause problems if you do assertions that rely on object identity " "for equality." msgstr "" -#: library/unittest.mock-examples.rst:862 +#: library/unittest.mock-examples.rst:863 msgid "" "Here's one solution that uses the :attr:`~Mock.side_effect` functionality. " "If you provide a ``side_effect`` function for a mock then ``side_effect`` " @@ -936,7 +936,7 @@ msgid "" "me. ::" msgstr "" -#: library/unittest.mock-examples.rst:870 +#: library/unittest.mock-examples.rst:871 msgid "" ">>> from copy import deepcopy\n" ">>> from unittest.mock import Mock, patch, DEFAULT\n" @@ -960,28 +960,28 @@ msgid "" "call({6})" msgstr "" -#: library/unittest.mock-examples.rst:891 +#: library/unittest.mock-examples.rst:892 msgid "" "``copy_call_args`` is called with the mock that will be called. It returns a " "new mock that we do the assertion on. The ``side_effect`` function makes a " "copy of the args and calls our ``new_mock`` with the copy." msgstr "" -#: library/unittest.mock-examples.rst:897 +#: library/unittest.mock-examples.rst:898 msgid "" "If your mock is only going to be used once there is an easier way of " "checking arguments at the point they are called. You can simply do the " "checking inside a ``side_effect`` function." msgstr "" -#: library/unittest.mock-examples.rst:911 +#: library/unittest.mock-examples.rst:912 msgid "" "An alternative approach is to create a subclass of :class:`Mock` or :class:" "`MagicMock` that copies (using :func:`copy.deepcopy`) the arguments. Here's " "an example implementation:" msgstr "" -#: library/unittest.mock-examples.rst:935 +#: library/unittest.mock-examples.rst:937 msgid "" "When you subclass ``Mock`` or ``MagicMock`` all dynamically created " "attributes, and the ``return_value`` will use your subclass automatically. " @@ -989,18 +989,18 @@ msgid "" "``CopyingMock``." msgstr "" -#: library/unittest.mock-examples.rst:941 +#: library/unittest.mock-examples.rst:943 msgid "Nesting Patches" msgstr "" -#: library/unittest.mock-examples.rst:943 +#: library/unittest.mock-examples.rst:945 msgid "" "Using patch as a context manager is nice, but if you do multiple patches you " "can end up with nested with statements indenting further and further to the " "right::" msgstr "" -#: library/unittest.mock-examples.rst:947 +#: library/unittest.mock-examples.rst:949 msgid "" ">>> class MyTest(unittest.TestCase):\n" "...\n" @@ -1017,7 +1017,7 @@ msgid "" ">>> assert mymodule.Foo is original" msgstr "" -#: library/unittest.mock-examples.rst:961 +#: library/unittest.mock-examples.rst:963 msgid "" "With unittest ``cleanup`` functions and the :ref:`start-and-stop` we can " "achieve the same effect without the nested indentation. A simple helper " @@ -1025,7 +1025,7 @@ msgid "" "mock for us::" msgstr "" -#: library/unittest.mock-examples.rst:966 +#: library/unittest.mock-examples.rst:968 msgid "" ">>> class MyTest(unittest.TestCase):\n" "...\n" @@ -1049,24 +1049,24 @@ msgid "" ">>> assert mymodule.Foo is original" msgstr "" -#: library/unittest.mock-examples.rst:989 +#: library/unittest.mock-examples.rst:991 msgid "Mocking a dictionary with MagicMock" msgstr "" -#: library/unittest.mock-examples.rst:991 +#: library/unittest.mock-examples.rst:993 msgid "" "You may want to mock a dictionary, or other container object, recording all " "access to it whilst having it still behave like a dictionary." msgstr "" -#: library/unittest.mock-examples.rst:994 +#: library/unittest.mock-examples.rst:996 msgid "" "We can do this with :class:`MagicMock`, which will behave like a dictionary, " "and using :data:`~Mock.side_effect` to delegate dictionary access to a real " "underlying dictionary that is under our control." msgstr "" -#: library/unittest.mock-examples.rst:998 +#: library/unittest.mock-examples.rst:1000 msgid "" "When the :meth:`~object.__getitem__` and :meth:`~object.__setitem__` methods " "of our ``MagicMock`` are called (normal dictionary access) then " @@ -1074,49 +1074,49 @@ msgid "" "the value too). We can also control what is returned." msgstr "" -#: library/unittest.mock-examples.rst:1003 +#: library/unittest.mock-examples.rst:1005 msgid "" "After the ``MagicMock`` has been used we can use attributes like :data:" "`~Mock.call_args_list` to assert about how the dictionary was used:" msgstr "" -#: library/unittest.mock-examples.rst:1019 +#: library/unittest.mock-examples.rst:1021 msgid "" "An alternative to using ``MagicMock`` is to use ``Mock`` and *only* provide " "the magic methods you specifically want:" msgstr "" -#: library/unittest.mock-examples.rst:1026 +#: library/unittest.mock-examples.rst:1028 msgid "" "A *third* option is to use ``MagicMock`` but passing in ``dict`` as the " "*spec* (or *spec_set*) argument so that the ``MagicMock`` created only has " "dictionary magic methods available:" msgstr "" -#: library/unittest.mock-examples.rst:1034 +#: library/unittest.mock-examples.rst:1036 msgid "" "With these side effect functions in place, the ``mock`` will behave like a " "normal dictionary but recording the access. It even raises a :exc:`KeyError` " "if you try to access a key that doesn't exist." msgstr "" -#: library/unittest.mock-examples.rst:1053 +#: library/unittest.mock-examples.rst:1055 msgid "" "After it has been used you can make assertions about the access using the " "normal mock methods and attributes:" msgstr "" -#: library/unittest.mock-examples.rst:1065 +#: library/unittest.mock-examples.rst:1067 msgid "Mock subclasses and their attributes" msgstr "" -#: library/unittest.mock-examples.rst:1067 +#: library/unittest.mock-examples.rst:1069 msgid "" "There are various reasons why you might want to subclass :class:`Mock`. One " "reason might be to add helper methods. Here's a silly example:" msgstr "" -#: library/unittest.mock-examples.rst:1083 +#: library/unittest.mock-examples.rst:1085 msgid "" "The standard behaviour for ``Mock`` instances is that attributes and the " "return value mocks are of the same type as the mock they are accessed on. " @@ -1126,7 +1126,7 @@ msgid "" "mock of instances of your subclass." msgstr "" -#: library/unittest.mock-examples.rst:1099 +#: library/unittest.mock-examples.rst:1101 msgid "" "Sometimes this is inconvenient. For example, `one user `_ is subclassing mock to created a `Twisted " @@ -1134,7 +1134,7 @@ msgid "" "html>`_. Having this applied to attributes too actually causes errors." msgstr "" -#: library/unittest.mock-examples.rst:1105 +#: library/unittest.mock-examples.rst:1107 msgid "" "``Mock`` (in all its flavours) uses a method called ``_get_child_mock`` to " "create these \"sub-mocks\" for attributes and return values. You can prevent " @@ -1143,25 +1143,25 @@ msgid "" "are then passed onto the mock constructor:" msgstr "" -#: library/unittest.mock-examples.rst:1122 +#: library/unittest.mock-examples.rst:1124 msgid "" "An exception to this rule are the non-callable mocks. Attributes use the " "callable variant because otherwise non-callable mocks couldn't have callable " "methods." msgstr "" -#: library/unittest.mock-examples.rst:1128 +#: library/unittest.mock-examples.rst:1130 msgid "Mocking imports with patch.dict" msgstr "" -#: library/unittest.mock-examples.rst:1130 +#: library/unittest.mock-examples.rst:1132 msgid "" "One situation where mocking can be hard is where you have a local import " "inside a function. These are harder to mock because they aren't using an " "object from the module namespace that we can patch out." msgstr "" -#: library/unittest.mock-examples.rst:1134 +#: library/unittest.mock-examples.rst:1136 msgid "" "Generally local imports are to be avoided. They are sometimes done to " "prevent circular dependencies, for which there is *usually* a much better " @@ -1171,7 +1171,7 @@ msgid "" "attribute and only do the import on first use)." msgstr "" -#: library/unittest.mock-examples.rst:1141 +#: library/unittest.mock-examples.rst:1143 msgid "" "That aside there is a way to use ``mock`` to affect the results of an " "import. Importing fetches an *object* from the :data:`sys.modules` " @@ -1181,7 +1181,7 @@ msgid "" "back. This need not be the case however." msgstr "" -#: library/unittest.mock-examples.rst:1148 +#: library/unittest.mock-examples.rst:1150 msgid "" "This means you can use :func:`patch.dict` to *temporarily* put a mock in " "place in :data:`sys.modules`. Any imports whilst this patch is active will " @@ -1190,29 +1190,29 @@ msgid "" "whatever was there previously will be restored safely." msgstr "" -#: library/unittest.mock-examples.rst:1154 +#: library/unittest.mock-examples.rst:1156 msgid "Here's an example that mocks out the 'fooble' module." msgstr "" -#: library/unittest.mock-examples.rst:1166 +#: library/unittest.mock-examples.rst:1168 msgid "" "As you can see the ``import fooble`` succeeds, but on exit there is no " "'fooble' left in :data:`sys.modules`." msgstr "" -#: library/unittest.mock-examples.rst:1169 +#: library/unittest.mock-examples.rst:1171 msgid "This also works for the ``from module import name`` form:" msgstr "" -#: library/unittest.mock-examples.rst:1179 +#: library/unittest.mock-examples.rst:1181 msgid "With slightly more work you can also mock package imports:" msgstr "" -#: library/unittest.mock-examples.rst:1192 +#: library/unittest.mock-examples.rst:1194 msgid "Tracking order of calls and less verbose call assertions" msgstr "" -#: library/unittest.mock-examples.rst:1194 +#: library/unittest.mock-examples.rst:1196 msgid "" "The :class:`Mock` class allows you to track the *order* of method calls on " "your mock objects through the :attr:`~Mock.method_calls` attribute. This " @@ -1220,7 +1220,7 @@ msgid "" "however we can use :attr:`~Mock.mock_calls` to achieve the same effect." msgstr "" -#: library/unittest.mock-examples.rst:1199 +#: library/unittest.mock-examples.rst:1201 msgid "" "Because mocks track calls to child mocks in ``mock_calls``, and accessing an " "arbitrary attribute of a mock creates a child mock, we can create our " @@ -1228,20 +1228,20 @@ msgid "" "recorded, in order, in the ``mock_calls`` of the parent:" msgstr "" -#: library/unittest.mock-examples.rst:1216 +#: library/unittest.mock-examples.rst:1218 msgid "" "We can then assert about the calls, including the order, by comparing with " "the ``mock_calls`` attribute on the manager mock:" msgstr "" -#: library/unittest.mock-examples.rst:1223 +#: library/unittest.mock-examples.rst:1225 msgid "" "If ``patch`` is creating, and putting in place, your mocks then you can " "attach them to a manager mock using the :meth:`~Mock.attach_mock` method. " "After attaching calls will be recorded in ``mock_calls`` of the manager. ::" msgstr "" -#: library/unittest.mock-examples.rst:1227 +#: library/unittest.mock-examples.rst:1229 msgid "" ">>> manager = MagicMock()\n" ">>> with patch('mymodule.Class1') as MockClass1:\n" @@ -1259,7 +1259,7 @@ msgid "" "call.MockClass2().bar()]" msgstr "" -#: library/unittest.mock-examples.rst:1242 +#: library/unittest.mock-examples.rst:1244 msgid "" "If many calls have been made, but you're only interested in a particular " "sequence of them then an alternative is to use the :meth:`~Mock." @@ -1268,13 +1268,13 @@ msgid "" "mock_calls` then the assert succeeds." msgstr "" -#: library/unittest.mock-examples.rst:1256 +#: library/unittest.mock-examples.rst:1258 msgid "" "Even though the chained call ``m.one().two().three()`` aren't the only calls " "that have been made to the mock, the assert still succeeds." msgstr "" -#: library/unittest.mock-examples.rst:1259 +#: library/unittest.mock-examples.rst:1261 msgid "" "Sometimes a mock may have several calls made to it, and you are only " "interested in asserting about *some* of those calls. You may not even care " @@ -1282,17 +1282,17 @@ msgid "" "``assert_has_calls``:" msgstr "" -#: library/unittest.mock-examples.rst:1271 +#: library/unittest.mock-examples.rst:1273 msgid "More complex argument matching" msgstr "" -#: library/unittest.mock-examples.rst:1273 +#: library/unittest.mock-examples.rst:1275 msgid "" "Using the same basic concept as :data:`ANY` we can implement matchers to do " "more complex assertions on objects used as arguments to mocks." msgstr "" -#: library/unittest.mock-examples.rst:1276 +#: library/unittest.mock-examples.rst:1278 msgid "" "Suppose we expect some object to be passed to a mock that by default " "compares equal based on object identity (which is the Python default for " @@ -1302,28 +1302,28 @@ msgid "" "attributes for us." msgstr "" -#: library/unittest.mock-examples.rst:1283 +#: library/unittest.mock-examples.rst:1285 msgid "" "You can see in this example how a 'standard' call to ``assert_called_with`` " "isn't sufficient:" msgstr "" -#: library/unittest.mock-examples.rst:1298 +#: library/unittest.mock-examples.rst:1301 msgid "" "A comparison function for our ``Foo`` class might look something like this:" msgstr "" -#: library/unittest.mock-examples.rst:1310 +#: library/unittest.mock-examples.rst:1313 msgid "" "And a matcher object that can use comparison functions like this for its " "equality operation would look something like this:" msgstr "" -#: library/unittest.mock-examples.rst:1321 +#: library/unittest.mock-examples.rst:1324 msgid "Putting all this together:" msgstr "" -#: library/unittest.mock-examples.rst:1326 +#: library/unittest.mock-examples.rst:1329 msgid "" "The ``Matcher`` is instantiated with our compare function and the ``Foo`` " "object we want to compare against. In ``assert_called_with`` the ``Matcher`` " @@ -1333,13 +1333,13 @@ msgid "" "raised:" msgstr "" -#: library/unittest.mock-examples.rst:1339 +#: library/unittest.mock-examples.rst:1342 msgid "" "With a bit of tweaking you could have the comparison function raise the :exc:" "`AssertionError` directly and provide a more useful failure message." msgstr "" -#: library/unittest.mock-examples.rst:1342 +#: library/unittest.mock-examples.rst:1345 msgid "" "As of version 1.5, the Python testing library `PyHamcrest `_ provides similar functionality, that may be " diff --git a/library/unittest.mock.po b/library/unittest.mock.po index 68f3a13e..d0081c1b 100644 --- a/library/unittest.mock.po +++ b/library/unittest.mock.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -190,7 +190,7 @@ msgstr "" msgid "The Mock Class" msgstr "" -#: library/unittest.mock.rst:211 +#: library/unittest.mock.rst:213 msgid "" ":class:`Mock` is a flexible mock object intended to replace the use of stubs " "and test doubles throughout your code. Mocks are callable and create " @@ -199,7 +199,7 @@ msgid "" "allowing you to make assertions about what your code has done to them." msgstr "" -#: library/unittest.mock.rst:217 +#: library/unittest.mock.rst:219 msgid "" ":class:`MagicMock` is a subclass of :class:`Mock` with all the magic methods " "pre-created and ready to use. There are also non-callable variants, useful " @@ -207,7 +207,7 @@ msgid "" "`NonCallableMock` and :class:`NonCallableMagicMock`" msgstr "" -#: library/unittest.mock.rst:222 +#: library/unittest.mock.rst:224 msgid "" "The :func:`patch` decorators makes it easy to temporarily replace classes in " "a particular module with a :class:`Mock` object. By default :func:`patch` " @@ -215,13 +215,13 @@ msgid "" "class of :class:`Mock` using the *new_callable* argument to :func:`patch`." msgstr "" -#: library/unittest.mock.rst:230 +#: library/unittest.mock.rst:232 msgid "" "Create a new :class:`Mock` object. :class:`Mock` takes several optional " "arguments that specify the behaviour of the Mock object:" msgstr "" -#: library/unittest.mock.rst:233 +#: library/unittest.mock.rst:235 msgid "" "*spec*: This can be either a list of strings or an existing object (a class " "or instance) that acts as the specification for the mock object. If you pass " @@ -230,21 +230,21 @@ msgid "" "attribute not in this list will raise an :exc:`AttributeError`." msgstr "" -#: library/unittest.mock.rst:239 +#: library/unittest.mock.rst:241 msgid "" "If *spec* is an object (rather than a list of strings) then :attr:`~object." "__class__` returns the class of the spec object. This allows mocks to pass :" "func:`isinstance` tests." msgstr "" -#: library/unittest.mock.rst:243 +#: library/unittest.mock.rst:245 msgid "" "*spec_set*: A stricter variant of *spec*. If used, attempting to *set* or " "get an attribute on the mock that isn't on the object passed as *spec_set* " "will raise an :exc:`AttributeError`." msgstr "" -#: library/unittest.mock.rst:247 +#: library/unittest.mock.rst:249 msgid "" "*side_effect*: A function to be called whenever the Mock is called. See the :" "attr:`~Mock.side_effect` attribute. Useful for raising exceptions or " @@ -253,30 +253,30 @@ msgid "" "value of this function is used as the return value." msgstr "" -#: library/unittest.mock.rst:253 +#: library/unittest.mock.rst:255 msgid "" "Alternatively *side_effect* can be an exception class or instance. In this " "case the exception will be raised when the mock is called." msgstr "" -#: library/unittest.mock.rst:256 +#: library/unittest.mock.rst:258 msgid "" "If *side_effect* is an iterable then each call to the mock will return the " "next value from the iterable." msgstr "" -#: library/unittest.mock.rst:259 +#: library/unittest.mock.rst:261 msgid "A *side_effect* can be cleared by setting it to ``None``." msgstr "" -#: library/unittest.mock.rst:261 +#: library/unittest.mock.rst:263 msgid "" "*return_value*: The value returned when the mock is called. By default this " "is a new Mock (created on first access). See the :attr:`return_value` " "attribute." msgstr "" -#: library/unittest.mock.rst:265 +#: library/unittest.mock.rst:267 msgid "" "*unsafe*: By default, accessing any attribute whose name starts with " "*assert*, *assret*, *asert*, *aseert* or *assrt* will raise an :exc:" @@ -284,7 +284,7 @@ msgid "" "attributes." msgstr "" -#: library/unittest.mock.rst:272 +#: library/unittest.mock.rst:274 msgid "" "*wraps*: Item for the mock object to wrap. If *wraps* is not ``None`` then " "calling the Mock will pass the call through to the wrapped object (returning " @@ -294,50 +294,50 @@ msgid "" "`AttributeError`)." msgstr "" -#: library/unittest.mock.rst:279 +#: library/unittest.mock.rst:281 msgid "" "If the mock has an explicit *return_value* set then calls are not passed to " "the wrapped object and the *return_value* is returned instead." msgstr "" -#: library/unittest.mock.rst:282 +#: library/unittest.mock.rst:284 msgid "" "*name*: If the mock has a name then it will be used in the repr of the mock. " "This can be useful for debugging. The name is propagated to child mocks." msgstr "" -#: library/unittest.mock.rst:286 +#: library/unittest.mock.rst:288 msgid "" "Mocks can also be called with arbitrary keyword arguments. These will be " "used to set attributes on the mock after it is created. See the :meth:" "`configure_mock` method for details." msgstr "" -#: library/unittest.mock.rst:292 +#: library/unittest.mock.rst:294 msgid "Assert that the mock was called at least once." msgstr "" -#: library/unittest.mock.rst:303 +#: library/unittest.mock.rst:305 msgid "Assert that the mock was called exactly once." msgstr "" -#: library/unittest.mock.rst:321 +#: library/unittest.mock.rst:324 msgid "" "This method is a convenient way of asserting that the last call has been " "made in a particular way:" msgstr "" -#: library/unittest.mock.rst:331 +#: library/unittest.mock.rst:334 msgid "" "Assert that the mock was called exactly once and that call was with the " "specified arguments." msgstr "" -#: library/unittest.mock.rst:346 +#: library/unittest.mock.rst:349 msgid "assert the mock has been called with the specified arguments." msgstr "" -#: library/unittest.mock.rst:348 +#: library/unittest.mock.rst:351 msgid "" "The assert passes if the mock has *ever* been called, unlike :meth:" "`assert_called_with` and :meth:`assert_called_once_with` that only pass if " @@ -345,33 +345,33 @@ msgid "" "`assert_called_once_with` it must also be the only call." msgstr "" -#: library/unittest.mock.rst:361 +#: library/unittest.mock.rst:364 msgid "" "assert the mock has been called with the specified calls. The :attr:" "`mock_calls` list is checked for the calls." msgstr "" -#: library/unittest.mock.rst:364 +#: library/unittest.mock.rst:367 msgid "" "If *any_order* is false then the calls must be sequential. There can be " "extra calls before or after the specified calls." msgstr "" -#: library/unittest.mock.rst:368 +#: library/unittest.mock.rst:371 msgid "" "If *any_order* is true then the calls can be in any order, but they must all " "appear in :attr:`mock_calls`." msgstr "" -#: library/unittest.mock.rst:383 +#: library/unittest.mock.rst:386 msgid "Assert the mock was never called." msgstr "" -#: library/unittest.mock.rst:398 +#: library/unittest.mock.rst:402 msgid "The reset_mock method resets all the call attributes on a mock object:" msgstr "" -#: library/unittest.mock.rst:400 +#: library/unittest.mock.rst:404 msgid "" ">>> mock = Mock(return_value=None)\n" ">>> mock('hello')\n" @@ -382,18 +382,18 @@ msgid "" "False" msgstr "" -#: library/unittest.mock.rst:410 +#: library/unittest.mock.rst:414 msgid "" "This can be useful where you want to make a series of assertions that reuse " "the same object." msgstr "" -#: library/unittest.mock.rst:413 +#: library/unittest.mock.rst:417 msgid "" "*return_value* parameter when set to ``True`` resets :attr:`return_value`:" msgstr "" -#: library/unittest.mock.rst:415 +#: library/unittest.mock.rst:419 msgid "" ">>> mock = Mock(return_value=5)\n" ">>> mock('hello')\n" @@ -403,12 +403,12 @@ msgid "" "" msgstr "" -#: library/unittest.mock.rst:424 +#: library/unittest.mock.rst:428 msgid "" "*side_effect* parameter when set to ``True`` resets :attr:`side_effect`:" msgstr "" -#: library/unittest.mock.rst:426 +#: library/unittest.mock.rst:430 msgid "" ">>> mock = Mock(side_effect=ValueError)\n" ">>> mock('hello')\n" @@ -420,113 +420,113 @@ msgid "" "" msgstr "" -#: library/unittest.mock.rst:437 +#: library/unittest.mock.rst:441 msgid "" "Note that :meth:`reset_mock` *doesn't* clear the :attr:`return_value`, :attr:" "`side_effect` or any child attributes you have set using normal assignment " "by default." msgstr "" -#: library/unittest.mock.rst:441 +#: library/unittest.mock.rst:445 msgid "Child mocks are reset as well." msgstr "" -#: library/unittest.mock.rst:443 +#: library/unittest.mock.rst:447 msgid "Added two keyword-only arguments to the reset_mock function." msgstr "" -#: library/unittest.mock.rst:448 +#: library/unittest.mock.rst:452 msgid "" "Add a spec to a mock. *spec* can either be an object or a list of strings. " "Only attributes on the *spec* can be fetched as attributes from the mock." msgstr "" -#: library/unittest.mock.rst:452 +#: library/unittest.mock.rst:456 msgid "If *spec_set* is true then only attributes on the spec can be set." msgstr "" -#: library/unittest.mock.rst:457 +#: library/unittest.mock.rst:461 msgid "" "Attach a mock as an attribute of this one, replacing its name and parent. " "Calls to the attached mock will be recorded in the :attr:`method_calls` and :" "attr:`mock_calls` attributes of this one." msgstr "" -#: library/unittest.mock.rst:464 +#: library/unittest.mock.rst:468 msgid "Set attributes on the mock through keyword arguments." msgstr "" -#: library/unittest.mock.rst:466 +#: library/unittest.mock.rst:470 msgid "" "Attributes plus return values and side effects can be set on child mocks " "using standard dot notation and unpacking a dictionary in the method call:" msgstr "" -#: library/unittest.mock.rst:480 +#: library/unittest.mock.rst:484 msgid "The same thing can be achieved in the constructor call to mocks:" msgstr "" -#: library/unittest.mock.rst:493 +#: library/unittest.mock.rst:497 msgid "" ":meth:`configure_mock` exists to make it easier to do configuration after " "the mock has been created." msgstr "" -#: library/unittest.mock.rst:499 +#: library/unittest.mock.rst:503 msgid "" ":class:`Mock` objects limit the results of ``dir(some_mock)`` to useful " "results. For mocks with a *spec* this includes all the permitted attributes " "for the mock." msgstr "" -#: library/unittest.mock.rst:503 +#: library/unittest.mock.rst:507 msgid "" "See :data:`FILTER_DIR` for what this filtering does, and how to switch it " "off." msgstr "" -#: library/unittest.mock.rst:509 +#: library/unittest.mock.rst:513 msgid "" "Create the child mocks for attributes and return value. By default child " "mocks will be the same type as the parent. Subclasses of Mock may want to " "override this to customize the way child mocks are made." msgstr "" -#: library/unittest.mock.rst:514 +#: library/unittest.mock.rst:518 msgid "" "For non-callable mocks the callable variant will be used (rather than any " "custom subclass)." msgstr "" -#: library/unittest.mock.rst:520 +#: library/unittest.mock.rst:524 msgid "A boolean representing whether or not the mock object has been called:" msgstr "" -#: library/unittest.mock.rst:531 +#: library/unittest.mock.rst:535 msgid "An integer telling you how many times the mock object has been called:" msgstr "" -#: library/unittest.mock.rst:543 +#: library/unittest.mock.rst:547 msgid "Set this to configure the value returned by calling the mock:" msgstr "" -#: library/unittest.mock.rst:550 +#: library/unittest.mock.rst:554 msgid "" "The default return value is a mock object and you can configure it in the " "normal way:" msgstr "" -#: library/unittest.mock.rst:559 +#: library/unittest.mock.rst:563 msgid ":attr:`return_value` can also be set in the constructor:" msgstr "" -#: library/unittest.mock.rst:570 +#: library/unittest.mock.rst:574 msgid "" "This can either be a function to be called when the mock is called, an " "iterable or an exception (class or instance) to be raised." msgstr "" -#: library/unittest.mock.rst:573 +#: library/unittest.mock.rst:577 msgid "" "If you pass in a function it will be called with same arguments as the mock " "and unless the function returns the :data:`DEFAULT` singleton the call to " @@ -535,7 +535,7 @@ msgid "" "the :attr:`return_value`)." msgstr "" -#: library/unittest.mock.rst:579 +#: library/unittest.mock.rst:583 msgid "" "If you pass in an iterable, it is used to retrieve an iterator which must " "yield a value on every call. This value can either be an exception instance " @@ -543,31 +543,31 @@ msgid "" "`DEFAULT` handling is identical to the function case)." msgstr "" -#: library/unittest.mock.rst:584 +#: library/unittest.mock.rst:588 msgid "" "An example of a mock that raises an exception (to test exception handling of " "an API):" msgstr "" -#: library/unittest.mock.rst:594 +#: library/unittest.mock.rst:598 msgid "Using :attr:`side_effect` to return a sequence of values:" msgstr "" -#: library/unittest.mock.rst:601 +#: library/unittest.mock.rst:605 msgid "Using a callable:" msgstr "" -#: library/unittest.mock.rst:611 +#: library/unittest.mock.rst:615 msgid "" ":attr:`side_effect` can be set in the constructor. Here's an example that " "adds one to the value the mock is called with and returns it:" msgstr "" -#: library/unittest.mock.rst:621 +#: library/unittest.mock.rst:625 msgid "Setting :attr:`side_effect` to ``None`` clears it:" msgstr "" -#: library/unittest.mock.rst:635 +#: library/unittest.mock.rst:639 msgid "" "This is either ``None`` (if the mock hasn't been called), or the arguments " "that the mock was last called with. This will be in the form of a tuple: the " @@ -577,7 +577,7 @@ msgid "" "is any keyword arguments (or an empty dictionary)." msgstr "" -#: library/unittest.mock.rst:668 +#: library/unittest.mock.rst:672 msgid "" ":attr:`call_args`, along with members of the lists :attr:`call_args_list`, :" "attr:`method_calls` and :attr:`mock_calls` are :data:`call` objects. These " @@ -585,11 +585,11 @@ msgid "" "make more complex assertions. See :ref:`calls as tuples `." msgstr "" -#: library/unittest.mock.rst:674 +#: library/unittest.mock.rst:678 msgid "Added ``args`` and ``kwargs`` properties." msgstr "" -#: library/unittest.mock.rst:680 +#: library/unittest.mock.rst:684 msgid "" "This is a list of all the calls made to the mock object in sequence (so the " "length of the list is the number of times it has been called). Before any " @@ -598,47 +598,47 @@ msgid "" "`call_args_list`." msgstr "" -#: library/unittest.mock.rst:696 +#: library/unittest.mock.rst:700 msgid "" "Members of :attr:`call_args_list` are :data:`call` objects. These can be " "unpacked as tuples to get at the individual arguments. See :ref:`calls as " "tuples `." msgstr "" -#: library/unittest.mock.rst:703 +#: library/unittest.mock.rst:707 msgid "" "As well as tracking calls to themselves, mocks also track calls to methods " "and attributes, and *their* methods and attributes:" msgstr "" -#: library/unittest.mock.rst:714 +#: library/unittest.mock.rst:718 msgid "" "Members of :attr:`method_calls` are :data:`call` objects. These can be " "unpacked as tuples to get at the individual arguments. See :ref:`calls as " "tuples `." msgstr "" -#: library/unittest.mock.rst:721 +#: library/unittest.mock.rst:725 msgid "" ":attr:`mock_calls` records *all* calls to the mock object, its methods, " "magic methods *and* return value mocks." msgstr "" -#: library/unittest.mock.rst:739 +#: library/unittest.mock.rst:743 msgid "" "Members of :attr:`mock_calls` are :data:`call` objects. These can be " "unpacked as tuples to get at the individual arguments. See :ref:`calls as " "tuples `." msgstr "" -#: library/unittest.mock.rst:745 +#: library/unittest.mock.rst:749 msgid "" "The way :attr:`mock_calls` are recorded means that where nested calls are " "made, the parameters of ancestor calls are not recorded and so will always " "compare equal:" msgstr "" -#: library/unittest.mock.rst:759 +#: library/unittest.mock.rst:763 msgid "" "Normally the :attr:`!__class__` attribute of an object will return its type. " "For a mock object with a :attr:`!spec`, :attr:`!__class__` returns the spec " @@ -646,32 +646,32 @@ msgid "" "the object they are replacing / masquerading as:" msgstr "" -#: library/unittest.mock.rst:768 +#: library/unittest.mock.rst:772 msgid "" ":attr:`!__class__` is assignable to, this allows a mock to pass an :func:" "`isinstance` check without forcing you to use a spec:" msgstr "" -#: library/unittest.mock.rst:778 +#: library/unittest.mock.rst:782 msgid "" "A non-callable version of :class:`Mock`. The constructor parameters have the " "same meaning of :class:`Mock`, with the exception of *return_value* and " "*side_effect* which have no meaning on a non-callable mock." msgstr "" -#: library/unittest.mock.rst:782 +#: library/unittest.mock.rst:786 msgid "" "Mock objects that use a class or an instance as a :attr:`!spec` or :attr:`!" "spec_set` are able to pass :func:`isinstance` tests:" msgstr "" -#: library/unittest.mock.rst:792 +#: library/unittest.mock.rst:796 msgid "" "The :class:`Mock` classes have support for mocking magic methods. See :ref:" "`magic methods ` for the full details." msgstr "" -#: library/unittest.mock.rst:795 +#: library/unittest.mock.rst:799 msgid "" "The mock classes and the :func:`patch` decorators all take arbitrary keyword " "arguments for configuration. For the :func:`patch` decorators the keywords " @@ -679,14 +679,14 @@ msgid "" "arguments are for configuring attributes of the mock:" msgstr "" -#: library/unittest.mock.rst:806 +#: library/unittest.mock.rst:810 msgid "" "The return value and side effect of child mocks can be set in the same way, " "using dotted notation. As you can't use dotted names directly in a call you " "have to create a dictionary and unpack it using ``**``:" msgstr "" -#: library/unittest.mock.rst:821 +#: library/unittest.mock.rst:825 msgid "" "A callable mock which was created with a *spec* (or a *spec_set*) will " "introspect the specification object's signature when matching calls to the " @@ -694,7 +694,7 @@ msgid "" "whether they were passed positionally or by name::" msgstr "" -#: library/unittest.mock.rst:826 +#: library/unittest.mock.rst:830 msgid "" ">>> def f(a, b, c): pass\n" "...\n" @@ -705,7 +705,7 @@ msgid "" ">>> mock.assert_called_with(a=1, b=2, c=3)" msgstr "" -#: library/unittest.mock.rst:834 +#: library/unittest.mock.rst:838 msgid "" "This applies to :meth:`~Mock.assert_called_with`, :meth:`~Mock." "assert_called_once_with`, :meth:`~Mock.assert_has_calls` and :meth:`~Mock." @@ -713,11 +713,11 @@ msgid "" "calls on the mock object." msgstr "" -#: library/unittest.mock.rst:839 +#: library/unittest.mock.rst:843 msgid "Added signature introspection on specced and autospecced mock objects." msgstr "" -#: library/unittest.mock.rst:845 +#: library/unittest.mock.rst:849 msgid "" "A mock intended to be used as a :class:`property`, or other :term:" "`descriptor`, on a class. :class:`PropertyMock` provides :meth:`~object." @@ -725,13 +725,13 @@ msgid "" "value when it is fetched." msgstr "" -#: library/unittest.mock.rst:850 +#: library/unittest.mock.rst:854 msgid "" "Fetching a :class:`PropertyMock` instance from an object calls the mock, " "with no args. Setting it calls the mock with the value being set. ::" msgstr "" -#: library/unittest.mock.rst:853 +#: library/unittest.mock.rst:857 msgid "" ">>> class Foo:\n" "... @property\n" @@ -752,14 +752,14 @@ msgid "" "[call(), call(6)]" msgstr "" -#: library/unittest.mock.rst:871 +#: library/unittest.mock.rst:875 msgid "" "Because of the way mock attributes are stored you can't directly attach a :" "class:`PropertyMock` to a mock object. Instead you can attach it to the mock " "type object::" msgstr "" -#: library/unittest.mock.rst:875 +#: library/unittest.mock.rst:879 msgid "" ">>> m = MagicMock()\n" ">>> p = PropertyMock(return_value=3)\n" @@ -769,14 +769,14 @@ msgid "" ">>> p.assert_called_once_with()" msgstr "" -#: library/unittest.mock.rst:884 +#: library/unittest.mock.rst:888 msgid "" "If an :exc:`AttributeError` is raised by :class:`PropertyMock`, it will be " "interpreted as a missing descriptor and :meth:`~object.__getattr__` will be " "called on the parent mock::" msgstr "" -#: library/unittest.mock.rst:888 +#: library/unittest.mock.rst:892 msgid "" ">>> m = MagicMock()\n" ">>> no_attribute = PropertyMock(side_effect=AttributeError)\n" @@ -785,56 +785,56 @@ msgid "" "" msgstr "" -#: library/unittest.mock.rst:894 +#: library/unittest.mock.rst:898 msgid "See :meth:`~object.__getattr__` for details." msgstr "" -#: library/unittest.mock.rst:899 +#: library/unittest.mock.rst:903 msgid "" "An asynchronous version of :class:`MagicMock`. The :class:`AsyncMock` object " "will behave so the object is recognized as an async function, and the result " "of a call is an awaitable." msgstr "" -#: library/unittest.mock.rst:909 +#: library/unittest.mock.rst:913 msgid "" "The result of ``mock()`` is an async function which will have the outcome of " "``side_effect`` or ``return_value`` after it has been awaited:" msgstr "" -#: library/unittest.mock.rst:912 +#: library/unittest.mock.rst:916 msgid "" "if ``side_effect`` is a function, the async function will return the result " "of that function," msgstr "" -#: library/unittest.mock.rst:914 +#: library/unittest.mock.rst:918 msgid "" "if ``side_effect`` is an exception, the async function will raise the " "exception," msgstr "" -#: library/unittest.mock.rst:916 +#: library/unittest.mock.rst:920 msgid "" "if ``side_effect`` is an iterable, the async function will return the next " "value of the iterable, however, if the sequence of result is exhausted, " "``StopAsyncIteration`` is raised immediately," msgstr "" -#: library/unittest.mock.rst:919 +#: library/unittest.mock.rst:923 msgid "" "if ``side_effect`` is not defined, the async function will return the value " "defined by ``return_value``, hence, by default, the async function returns a " "new :class:`AsyncMock` object." msgstr "" -#: library/unittest.mock.rst:924 +#: library/unittest.mock.rst:928 msgid "" "Setting the *spec* of a :class:`Mock` or :class:`MagicMock` to an async " "function will result in a coroutine object being returned after calling." msgstr "" -#: library/unittest.mock.rst:936 +#: library/unittest.mock.rst:940 msgid "" "Setting the *spec* of a :class:`Mock`, :class:`MagicMock`, or :class:" "`AsyncMock` to a class with asynchronous and synchronous functions will " @@ -844,82 +844,129 @@ msgid "" "functions will be :class:`AsyncMock`." msgstr "" -#: library/unittest.mock.rst:964 +#: library/unittest.mock.rst:968 msgid "" "Assert that the mock was awaited at least once. Note that this is separate " "from the object having been called, the ``await`` keyword must be used:" msgstr "" -#: library/unittest.mock.rst:983 +#: library/unittest.mock.rst:987 msgid "Assert that the mock was awaited exactly once." msgstr "" -#: library/unittest.mock.rst:999 +#: library/unittest.mock.rst:1003 msgid "Assert that the last await was with the specified arguments." msgstr "" -#: library/unittest.mock.rst:1016 +#: library/unittest.mock.rst:1020 msgid "" "Assert that the mock was awaited exactly once and with the specified " "arguments." msgstr "" -#: library/unittest.mock.rst:1033 +#: library/unittest.mock.rst:1037 msgid "Assert the mock has ever been awaited with the specified arguments." msgstr "" -#: library/unittest.mock.rst:1049 +#: library/unittest.mock.rst:1053 msgid "" "Assert the mock has been awaited with the specified calls. The :attr:" "`await_args_list` list is checked for the awaits." msgstr "" -#: library/unittest.mock.rst:1052 +#: library/unittest.mock.rst:1056 msgid "" "If *any_order* is false then the awaits must be sequential. There can be " "extra calls before or after the specified awaits." msgstr "" -#: library/unittest.mock.rst:1056 +#: library/unittest.mock.rst:1060 msgid "" "If *any_order* is true then the awaits can be in any order, but they must " "all appear in :attr:`await_args_list`." msgstr "" -#: library/unittest.mock.rst:1076 +#: library/unittest.mock.rst:1080 msgid "Assert that the mock was never awaited." msgstr "" -#: library/unittest.mock.rst:1083 +#: library/unittest.mock.rst:1087 msgid "" "See :func:`Mock.reset_mock`. Also sets :attr:`await_count` to 0, :attr:" "`await_args` to None, and clears the :attr:`await_args_list`." msgstr "" -#: library/unittest.mock.rst:1088 +#: library/unittest.mock.rst:1092 msgid "" "An integer keeping track of how many times the mock object has been awaited." msgstr "" -#: library/unittest.mock.rst:1103 +#: library/unittest.mock.rst:1107 msgid "" "This is either ``None`` (if the mock hasn’t been awaited), or the arguments " "that the mock was last awaited with. Functions the same as :attr:`Mock." "call_args`." msgstr "" -#: library/unittest.mock.rst:1121 +#: library/unittest.mock.rst:1125 msgid "" "This is a list of all the awaits made to the mock object in sequence (so the " "length of the list is the number of times it has been awaited). Before any " "awaits have been made it is an empty list." msgstr "" -#: library/unittest.mock.rst:1140 +#: library/unittest.mock.rst:1145 +msgid "" +"A version of :class:`MagicMock` for multithreading tests. The :class:" +"`ThreadingMock` object provides extra methods to wait for a call to be " +"invoked, rather than assert on it immediately." +msgstr "" + +#: library/unittest.mock.rst:1149 +msgid "" +"The default timeout is specified by the ``timeout`` argument, or if unset by " +"the :attr:`ThreadingMock.DEFAULT_TIMEOUT` attribute, which defaults to " +"blocking (``None``)." +msgstr "" + +#: library/unittest.mock.rst:1152 +msgid "" +"You can configure the global default timeout by setting :attr:`ThreadingMock." +"DEFAULT_TIMEOUT`." +msgstr "" + +#: library/unittest.mock.rst:1156 +msgid "Waits until the mock is called." +msgstr "" + +#: library/unittest.mock.rst:1158 +msgid "" +"If a timeout was passed at the creation of the mock or if a timeout argument " +"is passed to this function, the function raises an :exc:`AssertionError` if " +"the call is not performed in time." +msgstr "" + +#: library/unittest.mock.rst:1170 +msgid "Waits until the mock is called with the specified arguments." +msgstr "" + +#: library/unittest.mock.rst:1172 +msgid "" +"If a timeout was passed at the creation of the mock the function raises an :" +"exc:`AssertionError` if the call is not performed in time." +msgstr "" + +#: library/unittest.mock.rst:1183 +msgid "" +"Global default timeout in seconds to create instances of :class:" +"`ThreadingMock`." +msgstr "" + +#: library/unittest.mock.rst:1189 msgid "Calling" msgstr "" -#: library/unittest.mock.rst:1142 +#: library/unittest.mock.rst:1191 msgid "" "Mock objects are callable. The call will return the value set as the :attr:" "`~Mock.return_value` attribute. The default return value is a new Mock " @@ -928,26 +975,26 @@ msgid "" "returned each time." msgstr "" -#: library/unittest.mock.rst:1148 +#: library/unittest.mock.rst:1197 msgid "" "Calls made to the object will be recorded in the attributes like :attr:" "`~Mock.call_args` and :attr:`~Mock.call_args_list`." msgstr "" -#: library/unittest.mock.rst:1151 +#: library/unittest.mock.rst:1200 msgid "" "If :attr:`~Mock.side_effect` is set then it will be called after the call " "has been recorded, so if :attr:`!side_effect` raises an exception the call " "is still recorded." msgstr "" -#: library/unittest.mock.rst:1155 +#: library/unittest.mock.rst:1204 msgid "" "The simplest way to make a mock raise an exception when called is to make :" "attr:`~Mock.side_effect` an exception class or instance:" msgstr "" -#: library/unittest.mock.rst:1173 +#: library/unittest.mock.rst:1222 msgid "" "If :attr:`~Mock.side_effect` is a function then whatever that function " "returns is what calls to the mock return. The :attr:`!side_effect` function " @@ -955,7 +1002,7 @@ msgid "" "return value of the call dynamically, based on the input:" msgstr "" -#: library/unittest.mock.rst:1189 +#: library/unittest.mock.rst:1238 msgid "" "If you want the mock to still return the default return value (a new mock), " "or any set return value, then there are two ways of doing this. Either " @@ -963,26 +1010,26 @@ msgid "" "return :data:`DEFAULT`:" msgstr "" -#: library/unittest.mock.rst:1208 +#: library/unittest.mock.rst:1257 msgid "" "To remove a :attr:`~Mock.side_effect`, and return to the default behaviour, " "set the :attr:`!side_effect` to ``None``:" msgstr "" -#: library/unittest.mock.rst:1222 +#: library/unittest.mock.rst:1271 msgid "" "The :attr:`~Mock.side_effect` can also be any iterable object. Repeated " "calls to the mock will return values from the iterable (until the iterable " "is exhausted and a :exc:`StopIteration` is raised):" msgstr "" -#: library/unittest.mock.rst:1238 +#: library/unittest.mock.rst:1287 msgid "" "If any members of the iterable are exceptions they will be raised instead of " "returned::" msgstr "" -#: library/unittest.mock.rst:1241 +#: library/unittest.mock.rst:1290 msgid "" ">>> iterable = (33, ValueError, 66)\n" ">>> m = MagicMock(side_effect=iterable)\n" @@ -996,17 +1043,17 @@ msgid "" "66" msgstr "" -#: library/unittest.mock.rst:1256 +#: library/unittest.mock.rst:1305 msgid "Deleting Attributes" msgstr "" -#: library/unittest.mock.rst:1258 +#: library/unittest.mock.rst:1307 msgid "" "Mock objects create attributes on demand. This allows them to pretend to be " "objects of any type." msgstr "" -#: library/unittest.mock.rst:1261 +#: library/unittest.mock.rst:1310 msgid "" "You may want a mock object to return ``False`` to a :func:`hasattr` call, or " "raise an :exc:`AttributeError` when an attribute is fetched. You can do this " @@ -1014,17 +1061,17 @@ msgid "" "convenient." msgstr "" -#: library/unittest.mock.rst:1265 +#: library/unittest.mock.rst:1314 msgid "" "You \"block\" attributes by deleting them. Once deleted, accessing an " "attribute will raise an :exc:`AttributeError`." msgstr "" -#: library/unittest.mock.rst:1282 +#: library/unittest.mock.rst:1331 msgid "Mock names and the name attribute" msgstr "" -#: library/unittest.mock.rst:1284 +#: library/unittest.mock.rst:1333 msgid "" "Since \"name\" is an argument to the :class:`Mock` constructor, if you want " "your mock object to have a \"name\" attribute you can't just pass it in at " @@ -1032,7 +1079,7 @@ msgid "" "configure_mock`::" msgstr "" -#: library/unittest.mock.rst:1289 +#: library/unittest.mock.rst:1338 msgid "" ">>> mock = MagicMock()\n" ">>> mock.configure_mock(name='my_name')\n" @@ -1040,23 +1087,23 @@ msgid "" "'my_name'" msgstr "" -#: library/unittest.mock.rst:1294 +#: library/unittest.mock.rst:1343 msgid "" "A simpler option is to simply set the \"name\" attribute after mock " "creation::" msgstr "" -#: library/unittest.mock.rst:1296 +#: library/unittest.mock.rst:1345 msgid "" ">>> mock = MagicMock()\n" ">>> mock.name = \"foo\"" msgstr "" -#: library/unittest.mock.rst:1301 +#: library/unittest.mock.rst:1350 msgid "Attaching Mocks as Attributes" msgstr "" -#: library/unittest.mock.rst:1303 +#: library/unittest.mock.rst:1352 msgid "" "When you attach a mock as an attribute of another mock (or as the return " "value) it becomes a \"child\" of that mock. Calls to the child are recorded " @@ -1067,20 +1114,20 @@ msgid "" "calls between mocks:" msgstr "" -#: library/unittest.mock.rst:1321 +#: library/unittest.mock.rst:1370 msgid "" "The exception to this is if the mock has a name. This allows you to prevent " "the \"parenting\" if for some reason you don't want it to happen." msgstr "" -#: library/unittest.mock.rst:1332 +#: library/unittest.mock.rst:1381 msgid "" "Mocks created for you by :func:`patch` are automatically given names. To " "attach mocks that have names to a parent you use the :meth:`~Mock." "attach_mock` method::" msgstr "" -#: library/unittest.mock.rst:1336 +#: library/unittest.mock.rst:1385 msgid "" ">>> thing1 = object()\n" ">>> thing2 = object()\n" @@ -1096,7 +1143,7 @@ msgid "" "[call.child1('one'), call.child2('two')]" msgstr "" -#: library/unittest.mock.rst:1350 +#: library/unittest.mock.rst:1399 msgid "" "The only exceptions are magic methods and attributes (those that have " "leading and trailing double underscores). Mock doesn't create these but " @@ -1106,11 +1153,11 @@ msgid "" "support see :ref:`magic methods `." msgstr "" -#: library/unittest.mock.rst:1359 +#: library/unittest.mock.rst:1408 msgid "The patchers" msgstr "" -#: library/unittest.mock.rst:1361 +#: library/unittest.mock.rst:1410 msgid "" "The patch decorators are used for patching objects only within the scope of " "the function they decorate. They automatically handle the unpatching for " @@ -1118,17 +1165,17 @@ msgid "" "in with statements or as class decorators." msgstr "" -#: library/unittest.mock.rst:1368 +#: library/unittest.mock.rst:1417 msgid "patch" msgstr "" -#: library/unittest.mock.rst:1372 +#: library/unittest.mock.rst:1421 msgid "" "The key is to do the patching in the right namespace. See the section `where " "to patch`_." msgstr "" -#: library/unittest.mock.rst:1376 +#: library/unittest.mock.rst:1425 msgid "" ":func:`patch` acts as a function decorator, class decorator or a context " "manager. Inside the body of the function or with statement, the *target* is " @@ -1136,7 +1183,7 @@ msgid "" "patch is undone." msgstr "" -#: library/unittest.mock.rst:1381 +#: library/unittest.mock.rst:1430 msgid "" "If *new* is omitted, then the target is replaced with an :class:`AsyncMock` " "if the patched object is an async function or a :class:`MagicMock` " @@ -1146,7 +1193,7 @@ msgid "" "by the context manager." msgstr "" -#: library/unittest.mock.rst:1389 +#: library/unittest.mock.rst:1438 msgid "" "*target* should be a string in the form ``'package.module.ClassName'``. The " "*target* is imported and the specified object replaced with the *new* " @@ -1155,26 +1202,26 @@ msgid "" "function is executed, not at decoration time." msgstr "" -#: library/unittest.mock.rst:1395 +#: library/unittest.mock.rst:1444 msgid "" "The *spec* and *spec_set* keyword arguments are passed to the :class:" "`MagicMock` if patch is creating one for you." msgstr "" -#: library/unittest.mock.rst:1398 +#: library/unittest.mock.rst:1447 msgid "" "In addition you can pass ``spec=True`` or ``spec_set=True``, which causes " "patch to pass in the object being mocked as the spec/spec_set object." msgstr "" -#: library/unittest.mock.rst:1401 +#: library/unittest.mock.rst:1450 msgid "" "*new_callable* allows you to specify a different class, or callable object, " "that will be called to create the *new* object. By default :class:" "`AsyncMock` is used for async functions and :class:`MagicMock` for the rest." msgstr "" -#: library/unittest.mock.rst:1405 +#: library/unittest.mock.rst:1454 msgid "" "A more powerful form of *spec* is *autospec*. If you set ``autospec=True`` " "then the mock will be created with a spec from the object being replaced. " @@ -1186,13 +1233,13 @@ msgid "" "func:`create_autospec` function and :ref:`auto-speccing`." msgstr "" -#: library/unittest.mock.rst:1415 +#: library/unittest.mock.rst:1464 msgid "" "Instead of ``autospec=True`` you can pass ``autospec=some_object`` to use an " "arbitrary object as the spec instead of the one being replaced." msgstr "" -#: library/unittest.mock.rst:1418 +#: library/unittest.mock.rst:1467 msgid "" "By default :func:`patch` will fail to replace attributes that don't exist. " "If you pass in ``create=True``, and the attribute doesn't exist, patch will " @@ -1203,13 +1250,13 @@ msgid "" "write passing tests against APIs that don't actually exist!" msgstr "" -#: library/unittest.mock.rst:1428 +#: library/unittest.mock.rst:1477 msgid "" "If you are patching builtins in a module then you don't need to pass " "``create=True``, it will be added by default." msgstr "" -#: library/unittest.mock.rst:1432 +#: library/unittest.mock.rst:1481 msgid "" "Patch can be used as a :class:`~unittest.TestCase` class decorator. It works " "by decorating each test method in the class. This reduces the boilerplate " @@ -1220,7 +1267,7 @@ msgid "" "``patch.TEST_PREFIX``." msgstr "" -#: library/unittest.mock.rst:1439 +#: library/unittest.mock.rst:1488 msgid "" "Patch can be used as a context manager, with the with statement. Here the " "patching applies to the indented block after the with statement. If you use " @@ -1228,26 +1275,26 @@ msgid "" "very useful if :func:`patch` is creating a mock object for you." msgstr "" -#: library/unittest.mock.rst:1444 +#: library/unittest.mock.rst:1493 msgid "" ":func:`patch` takes arbitrary keyword arguments. These will be passed to :" "class:`AsyncMock` if the patched object is asynchronous, to :class:" "`MagicMock` otherwise or to *new_callable* if specified." msgstr "" -#: library/unittest.mock.rst:1448 +#: library/unittest.mock.rst:1497 msgid "" "``patch.dict(...)``, ``patch.multiple(...)`` and ``patch.object(...)`` are " "available for alternate use-cases." msgstr "" -#: library/unittest.mock.rst:1451 +#: library/unittest.mock.rst:1500 msgid "" ":func:`patch` as function decorator, creating the mock for you and passing " "it into the decorated function::" msgstr "" -#: library/unittest.mock.rst:1454 +#: library/unittest.mock.rst:1503 msgid "" ">>> @patch('__main__.SomeClass')\n" "... def function(normal_argument, mock_class):\n" @@ -1257,27 +1304,27 @@ msgid "" "True" msgstr "" -#: library/unittest.mock.rst:1461 +#: library/unittest.mock.rst:1510 msgid "" "Patching a class replaces the class with a :class:`MagicMock` *instance*. If " "the class is instantiated in the code under test then it will be the :attr:" "`~Mock.return_value` of the mock that will be used." msgstr "" -#: library/unittest.mock.rst:1465 +#: library/unittest.mock.rst:1514 msgid "" "If the class is instantiated multiple times you could use :attr:`~Mock." "side_effect` to return a new mock each time. Alternatively you can set the " "*return_value* to be anything you want." msgstr "" -#: library/unittest.mock.rst:1469 +#: library/unittest.mock.rst:1518 msgid "" "To configure return values on methods of *instances* on the patched class " "you must do this on the :attr:`~Mock.return_value`. For example::" msgstr "" -#: library/unittest.mock.rst:1472 +#: library/unittest.mock.rst:1521 msgid "" ">>> class Class:\n" "... def method(self):\n" @@ -1291,13 +1338,13 @@ msgid "" "..." msgstr "" -#: library/unittest.mock.rst:1483 +#: library/unittest.mock.rst:1532 msgid "" "If you use *spec* or *spec_set* and :func:`patch` is replacing a *class*, " "then the return value of the created mock will have the same spec. ::" msgstr "" -#: library/unittest.mock.rst:1486 +#: library/unittest.mock.rst:1535 msgid "" ">>> Original = Class\n" ">>> patcher = patch('__main__.Class', spec=True)\n" @@ -1307,14 +1354,14 @@ msgid "" ">>> patcher.stop()" msgstr "" -#: library/unittest.mock.rst:1493 +#: library/unittest.mock.rst:1542 msgid "" "The *new_callable* argument is useful where you want to use an alternative " "class to the default :class:`MagicMock` for the created mock. For example, " "if you wanted a :class:`NonCallableMock` to be used::" msgstr "" -#: library/unittest.mock.rst:1497 +#: library/unittest.mock.rst:1546 msgid "" ">>> thing = object()\n" ">>> with patch('__main__.thing', new_callable=NonCallableMock) as " @@ -1327,13 +1374,13 @@ msgid "" "TypeError: 'NonCallableMock' object is not callable" msgstr "" -#: library/unittest.mock.rst:1506 +#: library/unittest.mock.rst:1555 msgid "" "Another use case might be to replace an object with an :class:`io.StringIO` " "instance::" msgstr "" -#: library/unittest.mock.rst:1508 +#: library/unittest.mock.rst:1557 msgid "" ">>> from io import StringIO\n" ">>> def foo():\n" @@ -1347,7 +1394,7 @@ msgid "" ">>> test()" msgstr "" -#: library/unittest.mock.rst:1519 +#: library/unittest.mock.rst:1568 msgid "" "When :func:`patch` is creating a mock for you, it is common that the first " "thing you need to do is to configure the mock. Some of that configuration " @@ -1355,7 +1402,7 @@ msgid "" "call will be used to set attributes on the created mock::" msgstr "" -#: library/unittest.mock.rst:1524 +#: library/unittest.mock.rst:1573 msgid "" ">>> patcher = patch('__main__.thing', first='one', second='two')\n" ">>> mock_thing = patcher.start()\n" @@ -1365,7 +1412,7 @@ msgid "" "'two'" msgstr "" -#: library/unittest.mock.rst:1531 +#: library/unittest.mock.rst:1580 msgid "" "As well as attributes on the created mock attributes, like the :attr:`~Mock." "return_value` and :attr:`~Mock.side_effect`, of child mocks can also be " @@ -1374,7 +1421,7 @@ msgid "" "func:`patch` call using ``**``::" msgstr "" -#: library/unittest.mock.rst:1537 +#: library/unittest.mock.rst:1586 msgid "" ">>> config = {'method.return_value': 3, 'other.side_effect': KeyError}\n" ">>> patcher = patch('__main__.thing', **config)\n" @@ -1387,14 +1434,14 @@ msgid "" "KeyError" msgstr "" -#: library/unittest.mock.rst:1547 +#: library/unittest.mock.rst:1596 msgid "" "By default, attempting to patch a function in a module (or a method or an " "attribute in a class) that does not exist will fail with :exc:" "`AttributeError`::" msgstr "" -#: library/unittest.mock.rst:1550 +#: library/unittest.mock.rst:1599 msgid "" ">>> @patch('sys.non_existing_attribute', 42)\n" "... def test():\n" @@ -1407,13 +1454,13 @@ msgid "" "'non_existing_attribute'" msgstr "" -#: library/unittest.mock.rst:1559 +#: library/unittest.mock.rst:1608 msgid "" "but adding ``create=True`` in the call to :func:`patch` will make the " "previous example work as expected::" msgstr "" -#: library/unittest.mock.rst:1562 +#: library/unittest.mock.rst:1611 msgid "" ">>> @patch('sys.non_existing_attribute', 42, create=True)\n" "... def test(mock_stdout):\n" @@ -1422,23 +1469,23 @@ msgid "" ">>> test()" msgstr "" -#: library/unittest.mock.rst:1570 +#: library/unittest.mock.rst:1619 msgid "" ":func:`patch` now returns an :class:`AsyncMock` if the target is an async " "function." msgstr "" -#: library/unittest.mock.rst:1574 +#: library/unittest.mock.rst:1623 msgid "patch.object" msgstr "" -#: library/unittest.mock.rst:1578 +#: library/unittest.mock.rst:1627 msgid "" "patch the named member (*attribute*) on an object (*target*) with a mock " "object." msgstr "" -#: library/unittest.mock.rst:1581 +#: library/unittest.mock.rst:1630 msgid "" ":func:`patch.object` can be used as a decorator, class decorator or a " "context manager. Arguments *new*, *spec*, *create*, *spec_set*, *autospec* " @@ -1447,112 +1494,112 @@ msgid "" "configuring the mock object it creates." msgstr "" -#: library/unittest.mock.rst:1587 +#: library/unittest.mock.rst:1636 msgid "" "When used as a class decorator :func:`patch.object` honours ``patch." "TEST_PREFIX`` for choosing which methods to wrap." msgstr "" -#: library/unittest.mock.rst:1590 +#: library/unittest.mock.rst:1639 msgid "" "You can either call :func:`patch.object` with three arguments or two " "arguments. The three argument form takes the object to be patched, the " "attribute name and the object to replace the attribute with." msgstr "" -#: library/unittest.mock.rst:1594 +#: library/unittest.mock.rst:1643 msgid "" "When calling with the two argument form you omit the replacement object, and " "a mock is created for you and passed in as an extra argument to the " "decorated function:" msgstr "" -#: library/unittest.mock.rst:1605 +#: library/unittest.mock.rst:1654 msgid "" "*spec*, *create* and the other arguments to :func:`patch.object` have the " "same meaning as they do for :func:`patch`." msgstr "" -#: library/unittest.mock.rst:1610 +#: library/unittest.mock.rst:1659 msgid "patch.dict" msgstr "" -#: library/unittest.mock.rst:1614 +#: library/unittest.mock.rst:1663 msgid "" "Patch a dictionary, or dictionary like object, and restore the dictionary to " "its original state after the test." msgstr "" -#: library/unittest.mock.rst:1617 +#: library/unittest.mock.rst:1666 msgid "" "*in_dict* can be a dictionary or a mapping like container. If it is a " "mapping then it must at least support getting, setting and deleting items " "plus iterating over keys." msgstr "" -#: library/unittest.mock.rst:1621 +#: library/unittest.mock.rst:1670 msgid "" "*in_dict* can also be a string specifying the name of the dictionary, which " "will then be fetched by importing it." msgstr "" -#: library/unittest.mock.rst:1624 +#: library/unittest.mock.rst:1673 msgid "" "*values* can be a dictionary of values to set in the dictionary. *values* " "can also be an iterable of ``(key, value)`` pairs." msgstr "" -#: library/unittest.mock.rst:1627 +#: library/unittest.mock.rst:1676 msgid "" "If *clear* is true then the dictionary will be cleared before the new values " "are set." msgstr "" -#: library/unittest.mock.rst:1630 +#: library/unittest.mock.rst:1679 msgid "" ":func:`patch.dict` can also be called with arbitrary keyword arguments to " "set values in the dictionary." msgstr "" -#: library/unittest.mock.rst:1635 +#: library/unittest.mock.rst:1684 msgid "" ":func:`patch.dict` now returns the patched dictionary when used as a context " "manager." msgstr "" -#: library/unittest.mock.rst:1638 +#: library/unittest.mock.rst:1687 msgid "" ":func:`patch.dict` can be used as a context manager, decorator or class " "decorator:" msgstr "" -#: library/unittest.mock.rst:1649 +#: library/unittest.mock.rst:1698 msgid "" "When used as a class decorator :func:`patch.dict` honours ``patch." "TEST_PREFIX`` (default to ``'test'``) for choosing which methods to wrap:" msgstr "" -#: library/unittest.mock.rst:1660 +#: library/unittest.mock.rst:1709 msgid "" "If you want to use a different prefix for your test, you can inform the " "patchers of the different prefix by setting ``patch.TEST_PREFIX``. For more " "details about how to change the value of see :ref:`test-prefix`." msgstr "" -#: library/unittest.mock.rst:1664 +#: library/unittest.mock.rst:1713 msgid "" ":func:`patch.dict` can be used to add members to a dictionary, or simply let " "a test change a dictionary, and ensure the dictionary is restored when the " "test ends." msgstr "" -#: library/unittest.mock.rst:1685 +#: library/unittest.mock.rst:1734 msgid "" "Keywords can be used in the :func:`patch.dict` call to set values in the " "dictionary:" msgstr "" -#: library/unittest.mock.rst:1695 +#: library/unittest.mock.rst:1744 msgid "" ":func:`patch.dict` can be used with dictionary like objects that aren't " "actually dictionaries. At the very minimum they must support item getting, " @@ -1562,24 +1609,24 @@ msgid "" "__iter__` or :meth:`~object.__contains__`." msgstr "" -#: library/unittest.mock.rst:1725 +#: library/unittest.mock.rst:1774 msgid "patch.multiple" msgstr "" -#: library/unittest.mock.rst:1729 +#: library/unittest.mock.rst:1778 msgid "" "Perform multiple patches in a single call. It takes the object to be patched " "(either as an object or a string to fetch the object by importing) and " "keyword arguments for the patches::" msgstr "" -#: library/unittest.mock.rst:1733 +#: library/unittest.mock.rst:1782 msgid "" "with patch.multiple(settings, FIRST_PATCH='one', SECOND_PATCH='two'):\n" " ..." msgstr "" -#: library/unittest.mock.rst:1736 +#: library/unittest.mock.rst:1785 msgid "" "Use :data:`DEFAULT` as the value if you want :func:`patch.multiple` to " "create mocks for you. In this case the created mocks are passed into a " @@ -1587,7 +1634,7 @@ msgid "" "`patch.multiple` is used as a context manager." msgstr "" -#: library/unittest.mock.rst:1741 +#: library/unittest.mock.rst:1790 msgid "" ":func:`patch.multiple` can be used as a decorator, class decorator or a " "context manager. The arguments *spec*, *spec_set*, *create*, *autospec* and " @@ -1595,13 +1642,13 @@ msgid "" "will be applied to *all* patches done by :func:`patch.multiple`." msgstr "" -#: library/unittest.mock.rst:1746 +#: library/unittest.mock.rst:1795 msgid "" "When used as a class decorator :func:`patch.multiple` honours ``patch." "TEST_PREFIX`` for choosing which methods to wrap." msgstr "" -#: library/unittest.mock.rst:1749 +#: library/unittest.mock.rst:1798 msgid "" "If you want :func:`patch.multiple` to create mocks for you, then you can " "use :data:`DEFAULT` as the value. If you use :func:`patch.multiple` as a " @@ -1609,7 +1656,7 @@ msgid "" "keyword. ::" msgstr "" -#: library/unittest.mock.rst:1753 +#: library/unittest.mock.rst:1802 msgid "" ">>> thing = object()\n" ">>> other = object()\n" @@ -1622,14 +1669,14 @@ msgid "" ">>> test_function()" msgstr "" -#: library/unittest.mock.rst:1763 +#: library/unittest.mock.rst:1812 msgid "" ":func:`patch.multiple` can be nested with other ``patch`` decorators, but " "put arguments passed by keyword *after* any of the standard arguments " "created by :func:`patch`::" msgstr "" -#: library/unittest.mock.rst:1766 +#: library/unittest.mock.rst:1815 msgid "" ">>> @patch('sys.exit')\n" "... @patch.multiple('__main__', thing=DEFAULT, other=DEFAULT)\n" @@ -1641,14 +1688,14 @@ msgid "" ">>> test_function()" msgstr "" -#: library/unittest.mock.rst:1775 +#: library/unittest.mock.rst:1824 msgid "" "If :func:`patch.multiple` is used as a context manager, the value returned " "by the context manager is a dictionary where created mocks are keyed by " "name::" msgstr "" -#: library/unittest.mock.rst:1778 +#: library/unittest.mock.rst:1827 msgid "" ">>> with patch.multiple('__main__', thing=DEFAULT, other=DEFAULT) as " "values:\n" @@ -1659,18 +1706,18 @@ msgid "" "..." msgstr "" -#: library/unittest.mock.rst:1789 +#: library/unittest.mock.rst:1838 msgid "patch methods: start and stop" msgstr "" -#: library/unittest.mock.rst:1791 +#: library/unittest.mock.rst:1840 msgid "" "All the patchers have :meth:`!start` and :meth:`!stop` methods. These make " "it simpler to do patching in ``setUp`` methods or where you want to do " "multiple patches without nesting decorators or with statements." msgstr "" -#: library/unittest.mock.rst:1795 +#: library/unittest.mock.rst:1844 msgid "" "To use them call :func:`patch`, :func:`patch.object` or :func:`patch.dict` " "as normal and keep a reference to the returned ``patcher`` object. You can " @@ -1678,13 +1725,13 @@ msgid "" "it." msgstr "" -#: library/unittest.mock.rst:1799 +#: library/unittest.mock.rst:1848 msgid "" "If you are using :func:`patch` to create a mock for you then it will be " "returned by the call to ``patcher.start``. ::" msgstr "" -#: library/unittest.mock.rst:1802 +#: library/unittest.mock.rst:1851 msgid "" ">>> patcher = patch('package.module.ClassName')\n" ">>> from package import module\n" @@ -1697,13 +1744,13 @@ msgid "" ">>> assert module.ClassName is not new_mock" msgstr "" -#: library/unittest.mock.rst:1813 +#: library/unittest.mock.rst:1862 msgid "" "A typical use case for this might be for doing multiple patches in the " "``setUp`` method of a :class:`~unittest.TestCase`::" msgstr "" -#: library/unittest.mock.rst:1816 +#: library/unittest.mock.rst:1865 msgid "" ">>> class MyTest(unittest.TestCase):\n" "... def setUp(self):\n" @@ -1723,7 +1770,7 @@ msgid "" ">>> MyTest('test_something').run()" msgstr "" -#: library/unittest.mock.rst:1835 +#: library/unittest.mock.rst:1884 msgid "" "If you use this technique you must ensure that the patching is \"undone\" by " "calling ``stop``. This can be fiddlier than you might think, because if an " @@ -1731,7 +1778,7 @@ msgid "" "`unittest.TestCase.addCleanup` makes this easier::" msgstr "" -#: library/unittest.mock.rst:1840 +#: library/unittest.mock.rst:1889 msgid "" ">>> class MyTest(unittest.TestCase):\n" "... def setUp(self):\n" @@ -1744,33 +1791,33 @@ msgid "" "..." msgstr "" -#: library/unittest.mock.rst:1850 +#: library/unittest.mock.rst:1899 msgid "" "As an added bonus you no longer need to keep a reference to the ``patcher`` " "object." msgstr "" -#: library/unittest.mock.rst:1853 +#: library/unittest.mock.rst:1902 msgid "" "It is also possible to stop all patches which have been started by using :" "func:`patch.stopall`." msgstr "" -#: library/unittest.mock.rst:1858 +#: library/unittest.mock.rst:1907 msgid "Stop all active patches. Only stops patches started with ``start``." msgstr "" -#: library/unittest.mock.rst:1864 +#: library/unittest.mock.rst:1913 msgid "patch builtins" msgstr "" -#: library/unittest.mock.rst:1865 +#: library/unittest.mock.rst:1914 msgid "" "You can patch any builtins within a module. The following example patches " "builtin :func:`ord`::" msgstr "" -#: library/unittest.mock.rst:1868 +#: library/unittest.mock.rst:1917 msgid "" ">>> @patch('__main__.ord')\n" "... def test(mock_ord):\n" @@ -1781,11 +1828,11 @@ msgid "" "101" msgstr "" -#: library/unittest.mock.rst:1880 +#: library/unittest.mock.rst:1929 msgid "TEST_PREFIX" msgstr "" -#: library/unittest.mock.rst:1882 +#: library/unittest.mock.rst:1931 msgid "" "All of the patchers can be used as class decorators. When used in this way " "they wrap every test method on the class. The patchers recognise methods " @@ -1793,14 +1840,14 @@ msgid "" "the :class:`unittest.TestLoader` finds test methods by default." msgstr "" -#: library/unittest.mock.rst:1887 +#: library/unittest.mock.rst:1936 msgid "" "It is possible that you want to use a different prefix for your tests. You " "can inform the patchers of the different prefix by setting ``patch." "TEST_PREFIX``::" msgstr "" -#: library/unittest.mock.rst:1890 +#: library/unittest.mock.rst:1939 msgid "" ">>> patch.TEST_PREFIX = 'foo'\n" ">>> value = 3\n" @@ -1821,32 +1868,32 @@ msgid "" "3" msgstr "" -#: library/unittest.mock.rst:1910 +#: library/unittest.mock.rst:1959 msgid "Nesting Patch Decorators" msgstr "" -#: library/unittest.mock.rst:1912 +#: library/unittest.mock.rst:1961 msgid "" "If you want to perform multiple patches then you can simply stack up the " "decorators." msgstr "" -#: library/unittest.mock.rst:1915 +#: library/unittest.mock.rst:1964 msgid "You can stack up multiple patch decorators using this pattern:" msgstr "" -#: library/unittest.mock.rst:1931 +#: library/unittest.mock.rst:1980 msgid "" "Note that the decorators are applied from the bottom upwards. This is the " "standard way that Python applies decorators. The order of the created mocks " "passed into your test function matches this order." msgstr "" -#: library/unittest.mock.rst:1939 +#: library/unittest.mock.rst:1988 msgid "Where to patch" msgstr "" -#: library/unittest.mock.rst:1941 +#: library/unittest.mock.rst:1990 msgid "" ":func:`patch` works by (temporarily) changing the object that a *name* " "points to with another one. There can be many names pointing to any " @@ -1854,19 +1901,19 @@ msgid "" "the name used by the system under test." msgstr "" -#: library/unittest.mock.rst:1946 +#: library/unittest.mock.rst:1995 msgid "" "The basic principle is that you patch where an object is *looked up*, which " "is not necessarily the same place as where it is defined. A couple of " "examples will help to clarify this." msgstr "" -#: library/unittest.mock.rst:1950 +#: library/unittest.mock.rst:1999 msgid "" "Imagine we have a project that we want to test with the following structure::" msgstr "" -#: library/unittest.mock.rst:1952 +#: library/unittest.mock.rst:2001 msgid "" "a.py\n" " -> Defines SomeClass\n" @@ -1876,7 +1923,7 @@ msgid "" " -> some_function instantiates SomeClass" msgstr "" -#: library/unittest.mock.rst:1959 +#: library/unittest.mock.rst:2008 msgid "" "Now we want to test ``some_function`` but we want to mock out ``SomeClass`` " "using :func:`patch`. The problem is that when we import module b, which we " @@ -1886,7 +1933,7 @@ msgid "" "like our patching had no effect." msgstr "" -#: library/unittest.mock.rst:1966 +#: library/unittest.mock.rst:2015 msgid "" "The key is to patch out ``SomeClass`` where it is used (or where it is " "looked up). In this case ``some_function`` will actually look up " @@ -1894,11 +1941,11 @@ msgid "" "look like::" msgstr "" -#: library/unittest.mock.rst:1970 +#: library/unittest.mock.rst:2019 msgid "@patch('b.SomeClass')" msgstr "" -#: library/unittest.mock.rst:1972 +#: library/unittest.mock.rst:2021 msgid "" "However, consider the alternative scenario where instead of ``from a import " "SomeClass`` module b does ``import a`` and ``some_function`` uses ``a." @@ -1907,15 +1954,15 @@ msgid "" "``a.SomeClass`` instead::" msgstr "" -#: library/unittest.mock.rst:1977 +#: library/unittest.mock.rst:2026 msgid "@patch('a.SomeClass')" msgstr "" -#: library/unittest.mock.rst:1981 +#: library/unittest.mock.rst:2030 msgid "Patching Descriptors and Proxy Objects" msgstr "" -#: library/unittest.mock.rst:1983 +#: library/unittest.mock.rst:2032 msgid "" "Both patch_ and patch.object_ correctly patch and restore descriptors: class " "methods, static methods and properties. You should patch these on the " @@ -1925,22 +1972,22 @@ msgid "" "arch_d7_2010_12_04.shtml#e1198>`_." msgstr "" -#: library/unittest.mock.rst:1991 +#: library/unittest.mock.rst:2040 msgid "MagicMock and magic method support" msgstr "" -#: library/unittest.mock.rst:1996 +#: library/unittest.mock.rst:2045 msgid "Mocking Magic Methods" msgstr "" -#: library/unittest.mock.rst:1998 +#: library/unittest.mock.rst:2047 msgid "" ":class:`Mock` supports mocking the Python protocol methods, also known as :" "term:`\"magic methods\" `. This allows mock objects to replace " "containers or other objects that implement Python protocols." msgstr "" -#: library/unittest.mock.rst:2002 +#: library/unittest.mock.rst:2051 msgid "" "Because magic methods are looked up differently from normal methods [#]_, " "this support has been specially implemented. This means that only specific " @@ -1948,72 +1995,72 @@ msgid "" "them. If there are any missing that you need please let us know." msgstr "" -#: library/unittest.mock.rst:2007 +#: library/unittest.mock.rst:2056 msgid "" "You mock magic methods by setting the method you are interested in to a " "function or a mock instance. If you are using a function then it *must* take " "``self`` as the first argument [#]_." msgstr "" -#: library/unittest.mock.rst:2030 +#: library/unittest.mock.rst:2079 msgid "" "One use case for this is for mocking objects used as context managers in a :" "keyword:`with` statement:" msgstr "" -#: library/unittest.mock.rst:2042 +#: library/unittest.mock.rst:2091 msgid "" "Calls to magic methods do not appear in :attr:`~Mock.method_calls`, but they " "are recorded in :attr:`~Mock.mock_calls`." msgstr "" -#: library/unittest.mock.rst:2047 +#: library/unittest.mock.rst:2096 msgid "" "If you use the *spec* keyword argument to create a mock then attempting to " "set a magic method that isn't in the spec will raise an :exc:" "`AttributeError`." msgstr "" -#: library/unittest.mock.rst:2050 +#: library/unittest.mock.rst:2099 msgid "The full list of supported magic methods is:" msgstr "" -#: library/unittest.mock.rst:2052 +#: library/unittest.mock.rst:2101 msgid "``__hash__``, ``__sizeof__``, ``__repr__`` and ``__str__``" msgstr "" -#: library/unittest.mock.rst:2053 +#: library/unittest.mock.rst:2102 msgid "``__dir__``, ``__format__`` and ``__subclasses__``" msgstr "" -#: library/unittest.mock.rst:2054 +#: library/unittest.mock.rst:2103 msgid "``__round__``, ``__floor__``, ``__trunc__`` and ``__ceil__``" msgstr "" -#: library/unittest.mock.rst:2055 +#: library/unittest.mock.rst:2104 msgid "" "Comparisons: ``__lt__``, ``__gt__``, ``__le__``, ``__ge__``, ``__eq__`` and " "``__ne__``" msgstr "" -#: library/unittest.mock.rst:2057 +#: library/unittest.mock.rst:2106 msgid "" "Container methods: ``__getitem__``, ``__setitem__``, ``__delitem__``, " "``__contains__``, ``__len__``, ``__iter__``, ``__reversed__`` and " "``__missing__``" msgstr "" -#: library/unittest.mock.rst:2060 +#: library/unittest.mock.rst:2109 msgid "" "Context manager: ``__enter__``, ``__exit__``, ``__aenter__`` and " "``__aexit__``" msgstr "" -#: library/unittest.mock.rst:2061 +#: library/unittest.mock.rst:2110 msgid "Unary numeric methods: ``__neg__``, ``__pos__`` and ``__invert__``" msgstr "" -#: library/unittest.mock.rst:2062 +#: library/unittest.mock.rst:2111 msgid "" "The numeric methods (including right hand and in-place variants): " "``__add__``, ``__sub__``, ``__mul__``, ``__matmul__``, ``__truediv__``, " @@ -2021,100 +2068,100 @@ msgid "" "``__rshift__``, ``__and__``, ``__xor__``, ``__or__``, and ``__pow__``" msgstr "" -#: library/unittest.mock.rst:2066 +#: library/unittest.mock.rst:2115 msgid "" "Numeric conversion methods: ``__complex__``, ``__int__``, ``__float__`` and " "``__index__``" msgstr "" -#: library/unittest.mock.rst:2068 +#: library/unittest.mock.rst:2117 msgid "Descriptor methods: ``__get__``, ``__set__`` and ``__delete__``" msgstr "" -#: library/unittest.mock.rst:2069 +#: library/unittest.mock.rst:2118 msgid "" "Pickling: ``__reduce__``, ``__reduce_ex__``, ``__getinitargs__``, " "``__getnewargs__``, ``__getstate__`` and ``__setstate__``" msgstr "" -#: library/unittest.mock.rst:2071 +#: library/unittest.mock.rst:2120 msgid "File system path representation: ``__fspath__``" msgstr "" -#: library/unittest.mock.rst:2072 +#: library/unittest.mock.rst:2121 msgid "Asynchronous iteration methods: ``__aiter__`` and ``__anext__``" msgstr "" -#: library/unittest.mock.rst:2074 +#: library/unittest.mock.rst:2123 msgid "Added support for :func:`os.PathLike.__fspath__`." msgstr "" -#: library/unittest.mock.rst:2077 +#: library/unittest.mock.rst:2126 msgid "" "Added support for ``__aenter__``, ``__aexit__``, ``__aiter__`` and " "``__anext__``." msgstr "" -#: library/unittest.mock.rst:2081 +#: library/unittest.mock.rst:2130 msgid "" "The following methods exist but are *not* supported as they are either in " "use by mock, can't be set dynamically, or can cause problems:" msgstr "" -#: library/unittest.mock.rst:2084 +#: library/unittest.mock.rst:2133 msgid "``__getattr__``, ``__setattr__``, ``__init__`` and ``__new__``" msgstr "" -#: library/unittest.mock.rst:2085 +#: library/unittest.mock.rst:2134 msgid "" "``__prepare__``, ``__instancecheck__``, ``__subclasscheck__``, ``__del__``" msgstr "" -#: library/unittest.mock.rst:2090 +#: library/unittest.mock.rst:2139 msgid "Magic Mock" msgstr "" -#: library/unittest.mock.rst:2092 +#: library/unittest.mock.rst:2141 msgid "" "There are two ``MagicMock`` variants: :class:`MagicMock` and :class:" "`NonCallableMagicMock`." msgstr "" -#: library/unittest.mock.rst:2097 +#: library/unittest.mock.rst:2146 msgid "" "``MagicMock`` is a subclass of :class:`Mock` with default implementations of " "most of the :term:`magic methods `. You can use ``MagicMock`` " "without having to configure the magic methods yourself." msgstr "" -#: library/unittest.mock.rst:2101 +#: library/unittest.mock.rst:2150 msgid "The constructor parameters have the same meaning as for :class:`Mock`." msgstr "" -#: library/unittest.mock.rst:2103 +#: library/unittest.mock.rst:2152 msgid "" "If you use the *spec* or *spec_set* arguments then *only* magic methods that " "exist in the spec will be created." msgstr "" -#: library/unittest.mock.rst:2109 +#: library/unittest.mock.rst:2158 msgid "A non-callable version of :class:`MagicMock`." msgstr "" -#: library/unittest.mock.rst:2111 +#: library/unittest.mock.rst:2160 msgid "" "The constructor parameters have the same meaning as for :class:`MagicMock`, " "with the exception of *return_value* and *side_effect* which have no meaning " "on a non-callable mock." msgstr "" -#: library/unittest.mock.rst:2115 +#: library/unittest.mock.rst:2164 msgid "" "The magic methods are setup with :class:`MagicMock` objects, so you can " "configure them and use them in the usual way:" msgstr "" -#: library/unittest.mock.rst:2125 +#: library/unittest.mock.rst:2174 msgid "" "By default many of the protocol methods are required to return objects of a " "specific type. These methods are preconfigured with a default return value, " @@ -2123,83 +2170,83 @@ msgid "" "manually if you want to change the default." msgstr "" -#: library/unittest.mock.rst:2131 +#: library/unittest.mock.rst:2180 msgid "Methods and their defaults:" msgstr "" -#: library/unittest.mock.rst:2133 +#: library/unittest.mock.rst:2182 msgid "``__lt__``: :data:`NotImplemented`" msgstr "" -#: library/unittest.mock.rst:2134 +#: library/unittest.mock.rst:2183 msgid "``__gt__``: :data:`!NotImplemented`" msgstr "" -#: library/unittest.mock.rst:2135 +#: library/unittest.mock.rst:2184 msgid "``__le__``: :data:`!NotImplemented`" msgstr "" -#: library/unittest.mock.rst:2136 +#: library/unittest.mock.rst:2185 msgid "``__ge__``: :data:`!NotImplemented`" msgstr "" -#: library/unittest.mock.rst:2137 +#: library/unittest.mock.rst:2186 msgid "``__int__``: ``1``" msgstr "" -#: library/unittest.mock.rst:2138 +#: library/unittest.mock.rst:2187 msgid "``__contains__``: ``False``" msgstr "" -#: library/unittest.mock.rst:2139 +#: library/unittest.mock.rst:2188 msgid "``__len__``: ``0``" msgstr "" -#: library/unittest.mock.rst:2140 +#: library/unittest.mock.rst:2189 msgid "``__iter__``: ``iter([])``" msgstr "" -#: library/unittest.mock.rst:2141 +#: library/unittest.mock.rst:2190 msgid "``__exit__``: ``False``" msgstr "" -#: library/unittest.mock.rst:2142 +#: library/unittest.mock.rst:2191 msgid "``__aexit__``: ``False``" msgstr "" -#: library/unittest.mock.rst:2143 +#: library/unittest.mock.rst:2192 msgid "``__complex__``: ``1j``" msgstr "" -#: library/unittest.mock.rst:2144 +#: library/unittest.mock.rst:2193 msgid "``__float__``: ``1.0``" msgstr "" -#: library/unittest.mock.rst:2145 +#: library/unittest.mock.rst:2194 msgid "``__bool__``: ``True``" msgstr "" -#: library/unittest.mock.rst:2146 +#: library/unittest.mock.rst:2195 msgid "``__index__``: ``1``" msgstr "" -#: library/unittest.mock.rst:2147 +#: library/unittest.mock.rst:2196 msgid "``__hash__``: default hash for the mock" msgstr "" -#: library/unittest.mock.rst:2148 +#: library/unittest.mock.rst:2197 msgid "``__str__``: default str for the mock" msgstr "" -#: library/unittest.mock.rst:2149 +#: library/unittest.mock.rst:2198 msgid "``__sizeof__``: default sizeof for the mock" msgstr "" -#: library/unittest.mock.rst:2151 +#: library/unittest.mock.rst:2200 msgid "For example:" msgstr "" -#: library/unittest.mock.rst:2163 +#: library/unittest.mock.rst:2212 msgid "" "The two equality methods, :meth:`!__eq__` and :meth:`!__ne__`, are special. " "They do the default equality comparison on identity, using the :attr:`~Mock." @@ -2207,7 +2254,7 @@ msgid "" "something else::" msgstr "" -#: library/unittest.mock.rst:2168 +#: library/unittest.mock.rst:2217 msgid "" ">>> MagicMock() == 3\n" "False\n" @@ -2219,102 +2266,102 @@ msgid "" "True" msgstr "" -#: library/unittest.mock.rst:2177 +#: library/unittest.mock.rst:2226 msgid "" "The return value of :meth:`MagicMock.__iter__` can be any iterable object " "and isn't required to be an iterator:" msgstr "" -#: library/unittest.mock.rst:2187 +#: library/unittest.mock.rst:2236 msgid "" "If the return value *is* an iterator, then iterating over it once will " "consume it and subsequent iterations will result in an empty list:" msgstr "" -#: library/unittest.mock.rst:2196 +#: library/unittest.mock.rst:2245 msgid "" "``MagicMock`` has all of the supported magic methods configured except for " "some of the obscure and obsolete ones. You can still set these up if you " "want." msgstr "" -#: library/unittest.mock.rst:2199 +#: library/unittest.mock.rst:2248 msgid "" "Magic methods that are supported but not setup by default in ``MagicMock`` " "are:" msgstr "" -#: library/unittest.mock.rst:2201 +#: library/unittest.mock.rst:2250 msgid "``__subclasses__``" msgstr "" -#: library/unittest.mock.rst:2202 +#: library/unittest.mock.rst:2251 msgid "``__dir__``" msgstr "" -#: library/unittest.mock.rst:2203 +#: library/unittest.mock.rst:2252 msgid "``__format__``" msgstr "" -#: library/unittest.mock.rst:2204 +#: library/unittest.mock.rst:2253 msgid "``__get__``, ``__set__`` and ``__delete__``" msgstr "" -#: library/unittest.mock.rst:2205 +#: library/unittest.mock.rst:2254 msgid "``__reversed__`` and ``__missing__``" msgstr "" -#: library/unittest.mock.rst:2206 +#: library/unittest.mock.rst:2255 msgid "" "``__reduce__``, ``__reduce_ex__``, ``__getinitargs__``, ``__getnewargs__``, " "``__getstate__`` and ``__setstate__``" msgstr "" -#: library/unittest.mock.rst:2208 +#: library/unittest.mock.rst:2257 msgid "``__getformat__``" msgstr "" -#: library/unittest.mock.rst:2212 +#: library/unittest.mock.rst:2261 msgid "" "Magic methods *should* be looked up on the class rather than the instance. " "Different versions of Python are inconsistent about applying this rule. The " "supported protocol methods should work with all supported versions of Python." msgstr "" -#: library/unittest.mock.rst:2216 +#: library/unittest.mock.rst:2265 msgid "" "The function is basically hooked up to the class, but each ``Mock`` instance " "is kept isolated from the others." msgstr "" -#: library/unittest.mock.rst:2221 +#: library/unittest.mock.rst:2270 msgid "Helpers" msgstr "" -#: library/unittest.mock.rst:2224 +#: library/unittest.mock.rst:2273 msgid "sentinel" msgstr "" -#: library/unittest.mock.rst:2228 +#: library/unittest.mock.rst:2277 msgid "" "The ``sentinel`` object provides a convenient way of providing unique " "objects for your tests." msgstr "" -#: library/unittest.mock.rst:2231 +#: library/unittest.mock.rst:2280 msgid "" "Attributes are created on demand when you access them by name. Accessing the " "same attribute will always return the same object. The objects returned have " "a sensible repr so that test failure messages are readable." msgstr "" -#: library/unittest.mock.rst:2235 +#: library/unittest.mock.rst:2284 msgid "" "The ``sentinel`` attributes now preserve their identity when they are :mod:" "`copied ` or :mod:`pickled `." msgstr "" -#: library/unittest.mock.rst:2239 +#: library/unittest.mock.rst:2288 msgid "" "Sometimes when testing you need to test that a specific object is passed as " "an argument to another method, or returned. It can be common to create named " @@ -2322,28 +2369,28 @@ msgid "" "creating and testing the identity of objects like this." msgstr "" -#: library/unittest.mock.rst:2244 +#: library/unittest.mock.rst:2293 msgid "" "In this example we monkey patch ``method`` to return ``sentinel." "some_object``:" msgstr "" -#: library/unittest.mock.rst:2256 +#: library/unittest.mock.rst:2305 msgid "DEFAULT" msgstr "" -#: library/unittest.mock.rst:2261 +#: library/unittest.mock.rst:2310 msgid "" "The :data:`DEFAULT` object is a pre-created sentinel (actually ``sentinel." "DEFAULT``). It can be used by :attr:`~Mock.side_effect` functions to " "indicate that the normal return value should be used." msgstr "" -#: library/unittest.mock.rst:2267 +#: library/unittest.mock.rst:2316 msgid "call" msgstr "" -#: library/unittest.mock.rst:2271 +#: library/unittest.mock.rst:2320 msgid "" ":func:`call` is a helper object for making simpler assertions, for comparing " "with :attr:`~Mock.call_args`, :attr:`~Mock.call_args_list`, :attr:`~Mock." @@ -2351,13 +2398,13 @@ msgid "" "with :meth:`~Mock.assert_has_calls`." msgstr "" -#: library/unittest.mock.rst:2284 +#: library/unittest.mock.rst:2333 msgid "" "For a call object that represents multiple calls, :meth:`call_list` returns " "a list of all the intermediate calls as well as the final call." msgstr "" -#: library/unittest.mock.rst:2288 +#: library/unittest.mock.rst:2337 msgid "" "``call_list`` is particularly useful for making assertions on \"chained " "calls\". A chained call is multiple calls on a single line of code. This " @@ -2365,13 +2412,13 @@ msgid "" "constructing the sequence of calls can be tedious." msgstr "" -#: library/unittest.mock.rst:2293 +#: library/unittest.mock.rst:2342 msgid "" ":meth:`~call.call_list` can construct the sequence of calls from the same " "chained call:" msgstr "" -#: library/unittest.mock.rst:2310 +#: library/unittest.mock.rst:2359 msgid "" "A ``call`` object is either a tuple of (positional args, keyword args) or " "(name, positional args, keyword args) depending on how it was constructed. " @@ -2381,7 +2428,7 @@ msgid "" "to get at the individual arguments they contain." msgstr "" -#: library/unittest.mock.rst:2317 +#: library/unittest.mock.rst:2366 msgid "" "The ``call`` objects in :attr:`Mock.call_args` and :attr:`Mock." "call_args_list` are two-tuples of (positional args, keyword args) whereas " @@ -2390,7 +2437,7 @@ msgid "" "args)." msgstr "" -#: library/unittest.mock.rst:2322 +#: library/unittest.mock.rst:2371 msgid "" "You can use their \"tupleness\" to pull out the individual arguments for " "more complex introspection and assertions. The positional arguments are a " @@ -2398,29 +2445,29 @@ msgid "" "arguments are a dictionary:" msgstr "" -#: library/unittest.mock.rst:2355 +#: library/unittest.mock.rst:2404 msgid "create_autospec" msgstr "" -#: library/unittest.mock.rst:2359 +#: library/unittest.mock.rst:2408 msgid "" "Create a mock object using another object as a spec. Attributes on the mock " "will use the corresponding attribute on the *spec* object as their spec." msgstr "" -#: library/unittest.mock.rst:2363 +#: library/unittest.mock.rst:2412 msgid "" "Functions or methods being mocked will have their arguments checked to " "ensure that they are called with the correct signature." msgstr "" -#: library/unittest.mock.rst:2366 +#: library/unittest.mock.rst:2415 msgid "" "If *spec_set* is ``True`` then attempting to set attributes that don't exist " "on the spec object will raise an :exc:`AttributeError`." msgstr "" -#: library/unittest.mock.rst:2369 +#: library/unittest.mock.rst:2418 msgid "" "If a class is used as a spec then the return value of the mock (the instance " "of the class) will have the same spec. You can use a class as the spec for " @@ -2428,29 +2475,29 @@ msgid "" "be callable if instances of the mock are callable." msgstr "" -#: library/unittest.mock.rst:2374 +#: library/unittest.mock.rst:2423 msgid "" ":func:`create_autospec` also takes arbitrary keyword arguments that are " "passed to the constructor of the created mock." msgstr "" -#: library/unittest.mock.rst:2377 +#: library/unittest.mock.rst:2426 msgid "" "See :ref:`auto-speccing` for examples of how to use auto-speccing with :func:" "`create_autospec` and the *autospec* argument to :func:`patch`." msgstr "" -#: library/unittest.mock.rst:2383 +#: library/unittest.mock.rst:2432 msgid "" ":func:`create_autospec` now returns an :class:`AsyncMock` if the target is " "an async function." msgstr "" -#: library/unittest.mock.rst:2388 +#: library/unittest.mock.rst:2437 msgid "ANY" msgstr "" -#: library/unittest.mock.rst:2392 +#: library/unittest.mock.rst:2441 msgid "" "Sometimes you may need to make assertions about *some* of the arguments in a " "call to mock, but either not care about some of the arguments or want to " @@ -2458,26 +2505,26 @@ msgid "" "assertions on them." msgstr "" -#: library/unittest.mock.rst:2397 +#: library/unittest.mock.rst:2446 msgid "" "To ignore certain arguments you can pass in objects that compare equal to " "*everything*. Calls to :meth:`~Mock.assert_called_with` and :meth:`~Mock." "assert_called_once_with` will then succeed no matter what was passed in." msgstr "" -#: library/unittest.mock.rst:2406 +#: library/unittest.mock.rst:2455 msgid "" ":data:`ANY` can also be used in comparisons with call lists like :attr:" "`~Mock.mock_calls`:" msgstr "" -#: library/unittest.mock.rst:2416 +#: library/unittest.mock.rst:2465 msgid "" ":data:`ANY` is not limited to comparisons with call objects and so can also " "be used in test assertions::" msgstr "" -#: library/unittest.mock.rst:2419 +#: library/unittest.mock.rst:2468 msgid "" "class TestStringMethods(unittest.TestCase):\n" "\n" @@ -2486,11 +2533,11 @@ msgid "" " self.assertEqual(s.split(), ['hello', ANY])" msgstr "" -#: library/unittest.mock.rst:2427 +#: library/unittest.mock.rst:2476 msgid "FILTER_DIR" msgstr "" -#: library/unittest.mock.rst:2431 +#: library/unittest.mock.rst:2480 msgid "" ":data:`FILTER_DIR` is a module level variable that controls the way mock " "objects respond to :func:`dir`. The default is ``True``, which uses the " @@ -2499,7 +2546,7 @@ msgid "" "FILTER_DIR = False``." msgstr "" -#: library/unittest.mock.rst:2437 +#: library/unittest.mock.rst:2486 msgid "" "With filtering on, ``dir(some_mock)`` shows only useful attributes and will " "include any dynamically created attributes that wouldn't normally be shown. " @@ -2508,7 +2555,7 @@ msgid "" "yet:" msgstr "" -#: library/unittest.mock.rst:2443 +#: library/unittest.mock.rst:2492 msgid "" ">>> dir(Mock())\n" "['assert_any_call',\n" @@ -2529,7 +2576,7 @@ msgid "" " ..." msgstr "" -#: library/unittest.mock.rst:2464 +#: library/unittest.mock.rst:2513 msgid "" "Many of the not-very-useful (private to :class:`Mock` rather than the thing " "being mocked) underscore and double underscore prefixed attributes have been " @@ -2538,7 +2585,7 @@ msgid "" "switch :data:`FILTER_DIR`:" msgstr "" -#: library/unittest.mock.rst:2470 +#: library/unittest.mock.rst:2519 msgid "" ">>> from unittest import mock\n" ">>> mock.FILTER_DIR = False\n" @@ -2553,31 +2600,31 @@ msgid "" " ..." msgstr "" -#: library/unittest.mock.rst:2485 +#: library/unittest.mock.rst:2534 msgid "" "Alternatively you can just use ``vars(my_mock)`` (instance members) and " "``dir(type(my_mock))`` (type members) to bypass the filtering irrespective " "of :const:`FILTER_DIR`." msgstr "" -#: library/unittest.mock.rst:2491 +#: library/unittest.mock.rst:2540 msgid "mock_open" msgstr "" -#: library/unittest.mock.rst:2495 +#: library/unittest.mock.rst:2544 msgid "" "A helper function to create a mock to replace the use of :func:`open`. It " "works for :func:`open` called directly or used as a context manager." msgstr "" -#: library/unittest.mock.rst:2498 +#: library/unittest.mock.rst:2547 msgid "" "The *mock* argument is the mock object to configure. If ``None`` (the " "default) then a :class:`MagicMock` will be created for you, with the API " "limited to methods or attributes available on standard file handles." msgstr "" -#: library/unittest.mock.rst:2502 +#: library/unittest.mock.rst:2551 msgid "" "*read_data* is a string for the :meth:`~io.RawIOBase.read`, :meth:`~io." "IOBase.readline`, and :meth:`~io.IOBase.readlines` methods of the file " @@ -2590,49 +2637,49 @@ msgid "" "offer a realistic filesystem for testing." msgstr "" -#: library/unittest.mock.rst:2512 +#: library/unittest.mock.rst:2561 msgid "" "Added :meth:`~io.IOBase.readline` and :meth:`~io.IOBase.readlines` support. " "The mock of :meth:`~io.RawIOBase.read` changed to consume *read_data* rather " "than returning it on each call." msgstr "" -#: library/unittest.mock.rst:2517 +#: library/unittest.mock.rst:2566 msgid "*read_data* is now reset on each call to the *mock*." msgstr "" -#: library/unittest.mock.rst:2520 +#: library/unittest.mock.rst:2569 msgid "" "Added :meth:`~container.__iter__` to implementation so that iteration (such " "as in for loops) correctly consumes *read_data*." msgstr "" -#: library/unittest.mock.rst:2524 +#: library/unittest.mock.rst:2573 msgid "" "Using :func:`open` as a context manager is a great way to ensure your file " "handles are closed properly and is becoming common::" msgstr "" -#: library/unittest.mock.rst:2527 +#: library/unittest.mock.rst:2576 msgid "" "with open('/some/path', 'w') as f:\n" " f.write('something')" msgstr "" -#: library/unittest.mock.rst:2530 +#: library/unittest.mock.rst:2579 msgid "" "The issue is that even if you mock out the call to :func:`open` it is the " "*returned object* that is used as a context manager (and has :meth:`~object." "__enter__` and :meth:`~object.__exit__` called)." msgstr "" -#: library/unittest.mock.rst:2534 +#: library/unittest.mock.rst:2583 msgid "" "Mocking context managers with a :class:`MagicMock` is common enough and " "fiddly enough that a helper function is useful. ::" msgstr "" -#: library/unittest.mock.rst:2537 +#: library/unittest.mock.rst:2586 msgid "" ">>> m = mock_open()\n" ">>> with patch('__main__.open', m):\n" @@ -2649,11 +2696,11 @@ msgid "" ">>> handle.write.assert_called_once_with('some stuff')" msgstr "" -#: library/unittest.mock.rst:2551 +#: library/unittest.mock.rst:2600 msgid "And for reading files::" msgstr "" -#: library/unittest.mock.rst:2553 +#: library/unittest.mock.rst:2602 msgid "" ">>> with patch('__main__.open', mock_open(read_data='bibble')) as m:\n" "... with open('foo') as h:\n" @@ -2663,11 +2710,11 @@ msgid "" ">>> assert result == 'bibble'" msgstr "" -#: library/unittest.mock.rst:2564 +#: library/unittest.mock.rst:2613 msgid "Autospeccing" msgstr "" -#: library/unittest.mock.rst:2566 +#: library/unittest.mock.rst:2615 msgid "" "Autospeccing is based on the existing :attr:`!spec` feature of mock. It " "limits the api of mocks to the api of an original object (the spec), but it " @@ -2677,11 +2724,11 @@ msgid "" "`TypeError` if they are called incorrectly." msgstr "" -#: library/unittest.mock.rst:2573 +#: library/unittest.mock.rst:2622 msgid "Before I explain how auto-speccing works, here's why it is needed." msgstr "" -#: library/unittest.mock.rst:2575 +#: library/unittest.mock.rst:2624 msgid "" ":class:`Mock` is a very powerful and flexible object, but it suffers from a " "flaw which is general to mocking. If you refactor some of your code, rename " @@ -2690,14 +2737,14 @@ msgid "" "tests can all pass even though your code is broken." msgstr "" -#: library/unittest.mock.rst:2583 +#: library/unittest.mock.rst:2632 msgid "" "Before 3.5, tests with a typo in the word assert would silently pass when " "they should raise an error. You can still achieve this behavior by passing " "``unsafe=True`` to Mock." msgstr "" -#: library/unittest.mock.rst:2586 +#: library/unittest.mock.rst:2635 msgid "" "Note that this is another reason why you need integration tests as well as " "unit tests. Testing everything in isolation is all fine and dandy, but if " @@ -2705,27 +2752,27 @@ msgid "" "room for bugs that tests might have caught." msgstr "" -#: library/unittest.mock.rst:2591 +#: library/unittest.mock.rst:2640 msgid "" ":mod:`unittest.mock` already provides a feature to help with this, called " "speccing. If you use a class or instance as the :attr:`!spec` for a mock " "then you can only access attributes on the mock that exist on the real class:" msgstr "" -#: library/unittest.mock.rst:2602 +#: library/unittest.mock.rst:2651 msgid "" "The spec only applies to the mock itself, so we still have the same issue " "with any methods on the mock:" msgstr "" -#: library/unittest.mock.rst:2605 +#: library/unittest.mock.rst:2654 msgid "" ">>> mock.has_data()\n" "\n" ">>> mock.has_data.assret_called_with() # Intentional typo!" msgstr "" -#: library/unittest.mock.rst:2611 +#: library/unittest.mock.rst:2660 msgid "" "Auto-speccing solves this problem. You can either pass ``autospec=True`` to :" "func:`patch` / :func:`patch.object` or use the :func:`create_autospec` " @@ -2737,11 +2784,11 @@ msgid "" "import modules) without a big performance hit." msgstr "" -#: library/unittest.mock.rst:2620 +#: library/unittest.mock.rst:2669 msgid "Here's an example of it in use::" msgstr "" -#: library/unittest.mock.rst:2622 +#: library/unittest.mock.rst:2671 msgid "" ">>> from urllib import request\n" ">>> patcher = patch('__main__.request', autospec=True)\n" @@ -2752,14 +2799,14 @@ msgid "" "" msgstr "" -#: library/unittest.mock.rst:2630 +#: library/unittest.mock.rst:2679 msgid "" "You can see that :class:`!request.Request` has a spec. :class:`!request." "Request` takes two arguments in the constructor (one of which is *self*). " "Here's what happens if we try to call it incorrectly::" msgstr "" -#: library/unittest.mock.rst:2634 +#: library/unittest.mock.rst:2683 msgid "" ">>> req = request.Request()\n" "Traceback (most recent call last):\n" @@ -2767,20 +2814,20 @@ msgid "" "TypeError: () takes at least 2 arguments (1 given)" msgstr "" -#: library/unittest.mock.rst:2639 +#: library/unittest.mock.rst:2688 msgid "" "The spec also applies to instantiated classes (i.e. the return value of " "specced mocks)::" msgstr "" -#: library/unittest.mock.rst:2642 +#: library/unittest.mock.rst:2691 msgid "" ">>> req = request.Request('foo')\n" ">>> req\n" "" msgstr "" -#: library/unittest.mock.rst:2646 +#: library/unittest.mock.rst:2695 msgid "" ":class:`!Request` objects are not callable, so the return value of " "instantiating our mocked out :class:`!request.Request` is a non-callable " @@ -2788,7 +2835,7 @@ msgid "" "error::" msgstr "" -#: library/unittest.mock.rst:2650 +#: library/unittest.mock.rst:2699 msgid "" ">>> req.add_header('spam', 'eggs')\n" "\n" @@ -2799,20 +2846,20 @@ msgid "" ">>> req.add_header.assert_called_with('spam', 'eggs')" msgstr "" -#: library/unittest.mock.rst:2658 +#: library/unittest.mock.rst:2707 msgid "" "In many cases you will just be able to add ``autospec=True`` to your " "existing :func:`patch` calls and then be protected against bugs due to typos " "and api changes." msgstr "" -#: library/unittest.mock.rst:2662 +#: library/unittest.mock.rst:2711 msgid "" "As well as using *autospec* through :func:`patch` there is a :func:" "`create_autospec` for creating autospecced mocks directly:" msgstr "" -#: library/unittest.mock.rst:2670 +#: library/unittest.mock.rst:2719 msgid "" "This isn't without caveats and limitations however, which is why it is not " "the default behaviour. In order to know what attributes are available on the " @@ -2824,7 +2871,7 @@ msgid "" "objects so that introspection is safe [#]_." msgstr "" -#: library/unittest.mock.rst:2679 +#: library/unittest.mock.rst:2728 msgid "" "A more serious problem is that it is common for instance attributes to be " "created in the :meth:`~object.__init__` method and not to exist on the class " @@ -2832,7 +2879,7 @@ msgid "" "restricts the api to visible attributes. ::" msgstr "" -#: library/unittest.mock.rst:2684 +#: library/unittest.mock.rst:2733 msgid "" ">>> class Something:\n" "... def __init__(self):\n" @@ -2847,7 +2894,7 @@ msgid "" "AttributeError: Mock object has no attribute 'a'" msgstr "" -#: library/unittest.mock.rst:2696 +#: library/unittest.mock.rst:2745 msgid "" "There are a few different ways of resolving this problem. The easiest, but " "not necessarily the least annoying, way is to simply set the required " @@ -2856,7 +2903,7 @@ msgid "" "setting them::" msgstr "" -#: library/unittest.mock.rst:2702 +#: library/unittest.mock.rst:2751 msgid "" ">>> with patch('__main__.Something', autospec=True):\n" "... thing = Something()\n" @@ -2864,7 +2911,7 @@ msgid "" "..." msgstr "" -#: library/unittest.mock.rst:2707 +#: library/unittest.mock.rst:2756 msgid "" "There is a more aggressive version of both *spec* and *autospec* that *does* " "prevent you setting non-existent attributes. This is useful if you want to " @@ -2872,7 +2919,7 @@ msgid "" "this particular scenario:" msgstr "" -#: library/unittest.mock.rst:2720 +#: library/unittest.mock.rst:2769 msgid "" "Probably the best way of solving the problem is to add class attributes as " "default values for instance members initialised in :meth:`~object.__init__`. " @@ -2881,13 +2928,13 @@ msgid "" "course) is faster too. e.g." msgstr "" -#: library/unittest.mock.rst:2726 +#: library/unittest.mock.rst:2775 msgid "" "class Something:\n" " a = 33" msgstr "" -#: library/unittest.mock.rst:2731 +#: library/unittest.mock.rst:2780 msgid "" "This brings up another issue. It is relatively common to provide a default " "value of ``None`` for members that will later be an object of a different " @@ -2898,7 +2945,7 @@ msgid "" "These will just be ordinary mocks (well - MagicMocks):" msgstr "" -#: library/unittest.mock.rst:2746 +#: library/unittest.mock.rst:2795 msgid "" "If modifying your production classes to add defaults isn't to your liking " "then there are more options. One of these is simply to use an instance as " @@ -2909,7 +2956,7 @@ msgid "" "alternative object as the *autospec* argument::" msgstr "" -#: library/unittest.mock.rst:2754 +#: library/unittest.mock.rst:2803 msgid "" ">>> class Something:\n" "... def __init__(self):\n" @@ -2924,32 +2971,32 @@ msgid "" "" msgstr "" -#: library/unittest.mock.rst:2767 +#: library/unittest.mock.rst:2816 msgid "" "This only applies to classes or already instantiated objects. Calling a " "mocked class to create a mock instance *does not* create a real instance. It " "is only attribute lookups - along with calls to :func:`dir` - that are done." msgstr "" -#: library/unittest.mock.rst:2772 +#: library/unittest.mock.rst:2821 msgid "Sealing mocks" msgstr "" -#: library/unittest.mock.rst:2781 +#: library/unittest.mock.rst:2830 msgid "" "Seal will disable the automatic creation of mocks when accessing an " "attribute of the mock being sealed or any of its attributes that are already " "mocks recursively." msgstr "" -#: library/unittest.mock.rst:2784 +#: library/unittest.mock.rst:2833 msgid "" "If a mock instance with a name or a spec is assigned to an attribute it " "won't be considered in the sealing chain. This allows one to prevent seal " "from fixing part of the mock object. ::" msgstr "" -#: library/unittest.mock.rst:2788 +#: library/unittest.mock.rst:2837 msgid "" ">>> mock = Mock()\n" ">>> mock.submock.attribute1 = 2\n" @@ -2960,29 +3007,29 @@ msgid "" ">>> mock.not_submock.attribute2 # This won't raise." msgstr "" -#: library/unittest.mock.rst:2800 +#: library/unittest.mock.rst:2849 msgid "" "Order of precedence of :attr:`!side_effect`, :attr:`!return_value` and " "*wraps*" msgstr "" -#: library/unittest.mock.rst:2802 +#: library/unittest.mock.rst:2851 msgid "The order of their precedence is:" msgstr "" -#: library/unittest.mock.rst:2804 +#: library/unittest.mock.rst:2853 msgid ":attr:`~Mock.side_effect`" msgstr "" -#: library/unittest.mock.rst:2805 +#: library/unittest.mock.rst:2854 msgid ":attr:`~Mock.return_value`" msgstr "" -#: library/unittest.mock.rst:2806 +#: library/unittest.mock.rst:2855 msgid "*wraps*" msgstr "" -#: library/unittest.mock.rst:2808 +#: library/unittest.mock.rst:2857 msgid "" "If all three are set, mock will return the value from :attr:`~Mock." "side_effect`, ignoring :attr:`~Mock.return_value` and the wrapped object " @@ -2991,7 +3038,7 @@ msgid "" "of precedence remains unchanged." msgstr "" -#: library/unittest.mock.rst:2826 +#: library/unittest.mock.rst:2875 msgid "" "As ``None`` is the default value of :attr:`~Mock.side_effect`, if you " "reassign its value back to ``None``, the order of precedence will be checked " @@ -2999,46 +3046,46 @@ msgid "" "`~Mock.side_effect`." msgstr "" -#: library/unittest.mock.rst:2835 +#: library/unittest.mock.rst:2884 msgid "" "If the value being returned by :attr:`~Mock.side_effect` is :data:`DEFAULT`, " "it is ignored and the order of precedence moves to the successor to obtain " "the value to return." msgstr "" -#: library/unittest.mock.rst:2844 +#: library/unittest.mock.rst:2893 msgid "" "When :class:`Mock` wraps an object, the default value of :attr:`~Mock." "return_value` will be :data:`DEFAULT`." msgstr "" -#: library/unittest.mock.rst:2853 +#: library/unittest.mock.rst:2902 msgid "" "The order of precedence will ignore this value and it will move to the last " "successor which is the wrapped object." msgstr "" -#: library/unittest.mock.rst:2856 +#: library/unittest.mock.rst:2905 msgid "" "As the real call is being made to the wrapped object, creating an instance " "of this mock will return the real instance of the class. The positional " "arguments, if any, required by the wrapped object must be passed." msgstr "" -#: library/unittest.mock.rst:2874 +#: library/unittest.mock.rst:2923 msgid "" "But if you assign ``None`` to it, this will not be ignored as it is an " "explicit assignment. So, the order of precedence will not move to the " "wrapped object." msgstr "" -#: library/unittest.mock.rst:2882 +#: library/unittest.mock.rst:2931 msgid "" "Even if you set all three at once when initializing the mock, the order of " "precedence remains the same:" msgstr "" -#: library/unittest.mock.rst:2899 +#: library/unittest.mock.rst:2948 msgid "" "If :attr:`~Mock.side_effect` is exhausted, the order of precedence will not " "cause a value to be obtained from the successors. Instead, ``StopIteration`` " diff --git a/library/unittest.po b/library/unittest.po index f4916874..4feca7de 100644 --- a/library/unittest.po +++ b/library/unittest.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -2187,7 +2187,13 @@ msgid "" "coroutines as test functions." msgstr "" -#: library/unittest.rst:1577 +#: library/unittest.rst:1576 +msgid "" +"The *loop_factory* passed to :class:`asyncio.Runner`. Override in subclasses " +"with :class:`asyncio.EventLoop` to avoid using the asyncio policy system." +msgstr "" + +#: library/unittest.rst:1585 msgid "" "Method called to prepare the test fixture. This is called after :meth:" "`setUp`. This is called immediately before calling the test method; other " @@ -2196,7 +2202,7 @@ msgid "" "implementation does nothing." msgstr "" -#: library/unittest.rst:1586 +#: library/unittest.rst:1594 msgid "" "Method called immediately after the test method has been called and the " "result recorded. This is called before :meth:`tearDown`. This is called " @@ -2209,11 +2215,11 @@ msgid "" "the outcome of the test method. The default implementation does nothing." msgstr "" -#: library/unittest.rst:1598 +#: library/unittest.rst:1606 msgid "This method accepts a coroutine that can be used as a cleanup function." msgstr "" -#: library/unittest.rst:1603 +#: library/unittest.rst:1611 msgid "" "Enter the supplied :term:`asynchronous context manager`. If successful, " "also add its :meth:`~object.__aexit__` method as a cleanup function by :meth:" @@ -2221,7 +2227,7 @@ msgid "" "method." msgstr "" -#: library/unittest.rst:1613 +#: library/unittest.rst:1621 msgid "" "Sets up a new event loop to run the test, collecting the result into the :" "class:`TestResult` object passed as *result*. If *result* is omitted or " @@ -2231,11 +2237,11 @@ msgid "" "cancelled." msgstr "" -#: library/unittest.rst:1621 +#: library/unittest.rst:1629 msgid "An example illustrating the order::" msgstr "" -#: library/unittest.rst:1623 +#: library/unittest.rst:1631 msgid "" "from unittest import IsolatedAsyncioTestCase\n" "\n" @@ -2273,14 +2279,14 @@ msgid "" " unittest.main()" msgstr "" -#: library/unittest.rst:1657 +#: library/unittest.rst:1665 msgid "" "After running the test, ``events`` would contain ``[\"setUp\", " "\"asyncSetUp\", \"test_response\", \"asyncTearDown\", \"tearDown\", " "\"cleanup\"]``." msgstr "" -#: library/unittest.rst:1662 +#: library/unittest.rst:1670 msgid "" "This class implements the portion of the :class:`TestCase` interface which " "allows the test runner to drive the test, but does not provide the methods " @@ -2289,11 +2295,11 @@ msgid "" "`unittest`-based test framework." msgstr "" -#: library/unittest.rst:1672 +#: library/unittest.rst:1680 msgid "Grouping tests" msgstr "" -#: library/unittest.rst:1676 +#: library/unittest.rst:1684 msgid "" "This class represents an aggregation of individual test cases and test " "suites. The class presents the interface needed by the test runner to allow " @@ -2301,14 +2307,14 @@ msgid "" "is the same as iterating over the suite, running each test individually." msgstr "" -#: library/unittest.rst:1681 +#: library/unittest.rst:1689 msgid "" "If *tests* is given, it must be an iterable of individual test cases or " "other test suites that will be used to build the suite initially. Additional " "methods are provided to add test cases and suites to the collection later on." msgstr "" -#: library/unittest.rst:1685 +#: library/unittest.rst:1693 msgid "" ":class:`TestSuite` objects behave much like :class:`TestCase` objects, " "except they do not actually implement a test. Instead, they are used to " @@ -2317,47 +2323,47 @@ msgid "" "instances:" msgstr "" -#: library/unittest.rst:1693 +#: library/unittest.rst:1701 msgid "Add a :class:`TestCase` or :class:`TestSuite` to the suite." msgstr "" -#: library/unittest.rst:1698 +#: library/unittest.rst:1706 msgid "" "Add all the tests from an iterable of :class:`TestCase` and :class:" "`TestSuite` instances to this test suite." msgstr "" -#: library/unittest.rst:1701 +#: library/unittest.rst:1709 msgid "" "This is equivalent to iterating over *tests*, calling :meth:`addTest` for " "each element." msgstr "" -#: library/unittest.rst:1704 +#: library/unittest.rst:1712 msgid ":class:`TestSuite` shares the following methods with :class:`TestCase`:" msgstr "" -#: library/unittest.rst:1709 +#: library/unittest.rst:1717 msgid "" "Run the tests associated with this suite, collecting the result into the " "test result object passed as *result*. Note that unlike :meth:`TestCase." "run`, :meth:`TestSuite.run` requires the result object to be passed in." msgstr "" -#: library/unittest.rst:1717 +#: library/unittest.rst:1725 msgid "" "Run the tests associated with this suite without collecting the result. This " "allows exceptions raised by the test to be propagated to the caller and can " "be used to support running tests under a debugger." msgstr "" -#: library/unittest.rst:1724 +#: library/unittest.rst:1732 msgid "" "Return the number of tests represented by this test object, including all " "individual tests and sub-suites." msgstr "" -#: library/unittest.rst:1730 +#: library/unittest.rst:1738 msgid "" "Tests grouped by a :class:`TestSuite` are always accessed by iteration. " "Subclasses can lazily provide tests by overriding :meth:`!__iter__`. Note " @@ -2369,31 +2375,31 @@ msgid "" "overrides :meth:`TestSuite._removeTestAtIndex` to preserve test references." msgstr "" -#: library/unittest.rst:1740 +#: library/unittest.rst:1748 msgid "" "In earlier versions the :class:`TestSuite` accessed tests directly rather " "than through iteration, so overriding :meth:`!__iter__` wasn't sufficient " "for providing tests." msgstr "" -#: library/unittest.rst:1745 +#: library/unittest.rst:1753 msgid "" "In earlier versions the :class:`TestSuite` held references to each :class:" "`TestCase` after :meth:`TestSuite.run`. Subclasses can restore that behavior " "by overriding :meth:`TestSuite._removeTestAtIndex`." msgstr "" -#: library/unittest.rst:1750 +#: library/unittest.rst:1758 msgid "" "In the typical usage of a :class:`TestSuite` object, the :meth:`run` method " "is invoked by a :class:`TestRunner` rather than by the end-user test harness." msgstr "" -#: library/unittest.rst:1755 +#: library/unittest.rst:1763 msgid "Loading and running tests" msgstr "" -#: library/unittest.rst:1759 +#: library/unittest.rst:1767 msgid "" "The :class:`TestLoader` class is used to create test suites from classes and " "modules. Normally, there is no need to create an instance of this class; " @@ -2402,11 +2408,11 @@ msgid "" "customization of some configurable properties." msgstr "" -#: library/unittest.rst:1765 +#: library/unittest.rst:1773 msgid ":class:`TestLoader` objects have the following attributes:" msgstr "" -#: library/unittest.rst:1770 +#: library/unittest.rst:1778 msgid "" "A list of the non-fatal errors encountered while loading tests. Not reset by " "the loader at any point. Fatal errors are signalled by the relevant method " @@ -2414,17 +2420,17 @@ msgid "" "synthetic test that will raise the original error when run." msgstr "" -#: library/unittest.rst:1779 +#: library/unittest.rst:1787 msgid ":class:`TestLoader` objects have the following methods:" msgstr "" -#: library/unittest.rst:1784 +#: library/unittest.rst:1792 msgid "" "Return a suite of all test cases contained in the :class:`TestCase`\\ -" "derived :class:`testCaseClass`." msgstr "" -#: library/unittest.rst:1787 +#: library/unittest.rst:1795 msgid "" "A test case instance is created for each method named by :meth:" "`getTestCaseNames`. By default these are the method names beginning with " @@ -2433,14 +2439,14 @@ msgid "" "method instead." msgstr "" -#: library/unittest.rst:1796 +#: library/unittest.rst:1804 msgid "" "Return a suite of all test cases contained in the given module. This method " "searches *module* for classes derived from :class:`TestCase` and creates an " "instance of the class for each test method defined for the class." msgstr "" -#: library/unittest.rst:1803 +#: library/unittest.rst:1811 msgid "" "While using a hierarchy of :class:`TestCase`\\ -derived classes can be " "convenient in sharing fixtures and helper functions, defining test methods " @@ -2449,7 +2455,7 @@ msgid "" "fixtures are different and defined in subclasses." msgstr "" -#: library/unittest.rst:1809 +#: library/unittest.rst:1817 msgid "" "If a module provides a ``load_tests`` function it will be called to load the " "tests. This allows modules to customize test loading. This is the " @@ -2457,24 +2463,24 @@ msgid "" "argument to ``load_tests``." msgstr "" -#: library/unittest.rst:1814 +#: library/unittest.rst:1822 msgid "Support for ``load_tests`` added." msgstr "" -#: library/unittest.rst:1817 +#: library/unittest.rst:1825 msgid "Support for a keyword-only argument *pattern* has been added." msgstr "" -#: library/unittest.rst:1820 +#: library/unittest.rst:1828 msgid "" "The undocumented and unofficial *use_load_tests* parameter has been removed." msgstr "" -#: library/unittest.rst:1827 +#: library/unittest.rst:1835 msgid "Return a suite of all test cases given a string specifier." msgstr "" -#: library/unittest.rst:1829 +#: library/unittest.rst:1837 msgid "" "The specifier *name* is a \"dotted name\" that may resolve either to a " "module, a test case class, a test method within a test case class, a :class:" @@ -2485,7 +2491,7 @@ msgid "" "object\"." msgstr "" -#: library/unittest.rst:1837 +#: library/unittest.rst:1845 msgid "" "For example, if you have a module :mod:`SampleTests` containing a :class:" "`TestCase`\\ -derived class :class:`SampleTestCase` with three test methods " @@ -2498,31 +2504,31 @@ msgid "" "a side-effect." msgstr "" -#: library/unittest.rst:1847 +#: library/unittest.rst:1855 msgid "The method optionally resolves *name* relative to the given *module*." msgstr "" -#: library/unittest.rst:1849 +#: library/unittest.rst:1857 msgid "" "If an :exc:`ImportError` or :exc:`AttributeError` occurs while traversing " "*name* then a synthetic test that raises that error when run will be " "returned. These errors are included in the errors accumulated by self.errors." msgstr "" -#: library/unittest.rst:1858 +#: library/unittest.rst:1866 msgid "" "Similar to :meth:`loadTestsFromName`, but takes a sequence of names rather " "than a single name. The return value is a test suite which supports all the " "tests defined for each name." msgstr "" -#: library/unittest.rst:1865 +#: library/unittest.rst:1873 msgid "" "Return a sorted sequence of method names found within *testCaseClass*; this " "should be a subclass of :class:`TestCase`." msgstr "" -#: library/unittest.rst:1871 +#: library/unittest.rst:1879 msgid "" "Find all the test modules by recursing into subdirectories from the " "specified start directory, and return a TestSuite object containing them. " @@ -2531,14 +2537,14 @@ msgid "" "Python identifiers) will be loaded." msgstr "" -#: library/unittest.rst:1877 +#: library/unittest.rst:1885 msgid "" "All test modules must be importable from the top level of the project. If " "the start directory is not the top level directory then *top_level_dir* must " "be specified separately." msgstr "" -#: library/unittest.rst:1881 +#: library/unittest.rst:1889 msgid "" "If importing a module fails, for example due to a syntax error, then this " "will be recorded as a single error and discovery will continue. If the " @@ -2546,7 +2552,7 @@ msgid "" "as a skip instead of an error." msgstr "" -#: library/unittest.rst:1886 +#: library/unittest.rst:1894 msgid "" "If a package (a directory containing a file named :file:`__init__.py`) is " "found, the package will be checked for a ``load_tests`` function. If this " @@ -2556,103 +2562,103 @@ msgid "" "itself calls ``loader.discover``." msgstr "" -#: library/unittest.rst:1894 +#: library/unittest.rst:1902 msgid "" "If ``load_tests`` exists then discovery does *not* recurse into the package, " "``load_tests`` is responsible for loading all tests in the package." msgstr "" -#: library/unittest.rst:1898 +#: library/unittest.rst:1906 msgid "" "The pattern is deliberately not stored as a loader attribute so that " "packages can continue discovery themselves." msgstr "" -#: library/unittest.rst:1901 +#: library/unittest.rst:1909 msgid "" "*top_level_dir* is stored internally, and used as a default to any nested " "calls to ``discover()``. That is, if a package's ``load_tests`` calls " "``loader.discover()``, it does not need to pass this argument." msgstr "" -#: library/unittest.rst:1905 +#: library/unittest.rst:1913 msgid "*start_dir* can be a dotted module name as well as a directory." msgstr "" -#: library/unittest.rst:1909 +#: library/unittest.rst:1917 msgid "" "Modules that raise :exc:`SkipTest` on import are recorded as skips, not " "errors." msgstr "" -#: library/unittest.rst:1913 +#: library/unittest.rst:1921 msgid "*start_dir* can be a :term:`namespace packages `." msgstr "" -#: library/unittest.rst:1916 +#: library/unittest.rst:1924 msgid "" "Paths are sorted before being imported so that execution order is the same " "even if the underlying file system's ordering is not dependent on file name." msgstr "" -#: library/unittest.rst:1921 +#: library/unittest.rst:1929 msgid "" "Found packages are now checked for ``load_tests`` regardless of whether " "their path matches *pattern*, because it is impossible for a package name to " "match the default pattern." msgstr "" -#: library/unittest.rst:1926 +#: library/unittest.rst:1934 msgid "" "*start_dir* can not be a :term:`namespace packages `. It " "has been broken since Python 3.7 and Python 3.11 officially remove it." msgstr "" -#: library/unittest.rst:1930 +#: library/unittest.rst:1938 msgid "*top_level_dir* is only stored for the duration of *discover* call." msgstr "" -#: library/unittest.rst:1934 +#: library/unittest.rst:1942 msgid "" "The following attributes of a :class:`TestLoader` can be configured either " "by subclassing or assignment on an instance:" msgstr "" -#: library/unittest.rst:1940 +#: library/unittest.rst:1948 msgid "" "String giving the prefix of method names which will be interpreted as test " "methods. The default value is ``'test'``." msgstr "" -#: library/unittest.rst:1943 +#: library/unittest.rst:1951 msgid "" "This affects :meth:`getTestCaseNames` and all the ``loadTestsFrom*`` methods." msgstr "" -#: library/unittest.rst:1949 +#: library/unittest.rst:1957 msgid "" "Function to be used to compare method names when sorting them in :meth:" "`getTestCaseNames` and all the ``loadTestsFrom*`` methods." msgstr "" -#: library/unittest.rst:1955 +#: library/unittest.rst:1963 msgid "" "Callable object that constructs a test suite from a list of tests. No " "methods on the resulting object are needed. The default value is the :class:" "`TestSuite` class." msgstr "" -#: library/unittest.rst:1972 +#: library/unittest.rst:1980 msgid "This affects all the ``loadTestsFrom*`` methods." msgstr "" -#: library/unittest.rst:1963 +#: library/unittest.rst:1971 msgid "" "List of Unix shell-style wildcard test name patterns that test methods have " "to match to be included in test suites (see ``-k`` option)." msgstr "" -#: library/unittest.rst:1966 +#: library/unittest.rst:1974 msgid "" "If this attribute is not ``None`` (the default), all test methods to be " "included in test suites must match one of the patterns in this list. Note " @@ -2661,13 +2667,13 @@ msgid "" "have to be converted using ``*`` wildcards." msgstr "" -#: library/unittest.rst:1979 +#: library/unittest.rst:1987 msgid "" "This class is used to compile information about which tests have succeeded " "and which have failed." msgstr "" -#: library/unittest.rst:1982 +#: library/unittest.rst:1990 msgid "" "A :class:`TestResult` object stores the results of a set of tests. The :" "class:`TestCase` and :class:`TestSuite` classes ensure that results are " @@ -2675,7 +2681,7 @@ msgid "" "outcome of tests." msgstr "" -#: library/unittest.rst:1987 +#: library/unittest.rst:1995 msgid "" "Testing frameworks built on top of :mod:`unittest` may want access to the :" "class:`TestResult` object generated by running a set of tests for reporting " @@ -2683,61 +2689,61 @@ msgid "" "`TestRunner.run` method for this purpose." msgstr "" -#: library/unittest.rst:1992 +#: library/unittest.rst:2000 msgid "" ":class:`TestResult` instances have the following attributes that will be of " "interest when inspecting the results of running a set of tests:" msgstr "" -#: library/unittest.rst:1998 +#: library/unittest.rst:2006 msgid "" "A list containing 2-tuples of :class:`TestCase` instances and strings " "holding formatted tracebacks. Each tuple represents a test which raised an " "unexpected exception." msgstr "" -#: library/unittest.rst:2004 +#: library/unittest.rst:2012 msgid "" "A list containing 2-tuples of :class:`TestCase` instances and strings " "holding formatted tracebacks. Each tuple represents a test where a failure " "was explicitly signalled using the :ref:`assert\\* methods `." msgstr "" -#: library/unittest.rst:2010 +#: library/unittest.rst:2018 msgid "" "A list containing 2-tuples of :class:`TestCase` instances and strings " "holding the reason for skipping the test." msgstr "" -#: library/unittest.rst:2017 +#: library/unittest.rst:2025 msgid "" "A list containing 2-tuples of :class:`TestCase` instances and strings " "holding formatted tracebacks. Each tuple represents an expected failure or " "error of the test case." msgstr "" -#: library/unittest.rst:2023 +#: library/unittest.rst:2031 msgid "" "A list containing :class:`TestCase` instances that were marked as expected " "failures, but succeeded." msgstr "" -#: library/unittest.rst:2028 +#: library/unittest.rst:2036 msgid "" "A list containing 2-tuples of test case names and floats representing the " "elapsed time of each test which was run." msgstr "" -#: library/unittest.rst:2035 +#: library/unittest.rst:2043 msgid "" "Set to ``True`` when the execution of tests should stop by :meth:`stop`." msgstr "" -#: library/unittest.rst:2039 +#: library/unittest.rst:2047 msgid "The total number of tests run so far." msgstr "" -#: library/unittest.rst:2043 +#: library/unittest.rst:2051 msgid "" "If set to true, ``sys.stdout`` and ``sys.stderr`` will be buffered in " "between :meth:`startTest` and :meth:`stopTest` being called. Collected " @@ -2746,29 +2752,29 @@ msgid "" "error message." msgstr "" -#: library/unittest.rst:2052 +#: library/unittest.rst:2060 msgid "" "If set to true :meth:`stop` will be called on the first failure or error, " "halting the test run." msgstr "" -#: library/unittest.rst:2059 +#: library/unittest.rst:2067 msgid "If set to true then local variables will be shown in tracebacks." msgstr "" -#: library/unittest.rst:2065 +#: library/unittest.rst:2073 msgid "" "Return ``True`` if all tests run so far have passed, otherwise returns " "``False``." msgstr "" -#: library/unittest.rst:2068 +#: library/unittest.rst:2076 msgid "" "Returns ``False`` if there were any :attr:`unexpectedSuccesses` from tests " "marked with the :func:`expectedFailure` decorator." msgstr "" -#: library/unittest.rst:2074 +#: library/unittest.rst:2082 msgid "" "This method can be called to signal that the set of tests being run should " "be aborted by setting the :attr:`shouldStop` attribute to ``True``. :class:" @@ -2776,7 +2782,7 @@ msgid "" "additional tests." msgstr "" -#: library/unittest.rst:2079 +#: library/unittest.rst:2087 msgid "" "For example, this feature is used by the :class:`TextTestRunner` class to " "stop the test framework when the user signals an interrupt from the " @@ -2784,7 +2790,7 @@ msgid "" "implementations can use this in a similar manner." msgstr "" -#: library/unittest.rst:2084 +#: library/unittest.rst:2092 msgid "" "The following methods of the :class:`TestResult` class are used to maintain " "the internal data structures, and may be extended in subclasses to support " @@ -2792,141 +2798,141 @@ msgid "" "tools which support interactive reporting while tests are being run." msgstr "" -#: library/unittest.rst:2092 +#: library/unittest.rst:2100 msgid "Called when the test case *test* is about to be run." msgstr "" -#: library/unittest.rst:2096 +#: library/unittest.rst:2104 msgid "" "Called after the test case *test* has been executed, regardless of the " "outcome." msgstr "" -#: library/unittest.rst:2101 +#: library/unittest.rst:2109 msgid "Called once before any tests are executed." msgstr "" -#: library/unittest.rst:2108 +#: library/unittest.rst:2116 msgid "Called once after all tests are executed." msgstr "" -#: library/unittest.rst:2115 +#: library/unittest.rst:2123 msgid "" "Called when the test case *test* raises an unexpected exception. *err* is a " "tuple of the form returned by :func:`sys.exc_info`: ``(type, value, " "traceback)``." msgstr "" -#: library/unittest.rst:2119 +#: library/unittest.rst:2127 msgid "" "The default implementation appends a tuple ``(test, formatted_err)`` to the " "instance's :attr:`errors` attribute, where *formatted_err* is a formatted " "traceback derived from *err*." msgstr "" -#: library/unittest.rst:2126 +#: library/unittest.rst:2134 msgid "" "Called when the test case *test* signals a failure. *err* is a tuple of the " "form returned by :func:`sys.exc_info`: ``(type, value, traceback)``." msgstr "" -#: library/unittest.rst:2129 +#: library/unittest.rst:2137 msgid "" "The default implementation appends a tuple ``(test, formatted_err)`` to the " "instance's :attr:`failures` attribute, where *formatted_err* is a formatted " "traceback derived from *err*." msgstr "" -#: library/unittest.rst:2136 +#: library/unittest.rst:2144 msgid "Called when the test case *test* succeeds." msgstr "" -#: library/unittest.rst:2138 +#: library/unittest.rst:2146 msgid "The default implementation does nothing." msgstr "" -#: library/unittest.rst:2143 +#: library/unittest.rst:2151 msgid "" "Called when the test case *test* is skipped. *reason* is the reason the " "test gave for skipping." msgstr "" -#: library/unittest.rst:2146 +#: library/unittest.rst:2154 msgid "" "The default implementation appends a tuple ``(test, reason)`` to the " "instance's :attr:`skipped` attribute." msgstr "" -#: library/unittest.rst:2152 +#: library/unittest.rst:2160 msgid "" "Called when the test case *test* fails or errors, but was marked with the :" "func:`expectedFailure` decorator." msgstr "" -#: library/unittest.rst:2155 +#: library/unittest.rst:2163 msgid "" "The default implementation appends a tuple ``(test, formatted_err)`` to the " "instance's :attr:`expectedFailures` attribute, where *formatted_err* is a " "formatted traceback derived from *err*." msgstr "" -#: library/unittest.rst:2162 +#: library/unittest.rst:2170 msgid "" "Called when the test case *test* was marked with the :func:`expectedFailure` " "decorator, but succeeded." msgstr "" -#: library/unittest.rst:2165 +#: library/unittest.rst:2173 msgid "" "The default implementation appends the test to the instance's :attr:" "`unexpectedSuccesses` attribute." msgstr "" -#: library/unittest.rst:2171 +#: library/unittest.rst:2179 msgid "" "Called when a subtest finishes. *test* is the test case corresponding to " "the test method. *subtest* is a custom :class:`TestCase` instance " "describing the subtest." msgstr "" -#: library/unittest.rst:2175 +#: library/unittest.rst:2183 msgid "" "If *outcome* is :const:`None`, the subtest succeeded. Otherwise, it failed " "with an exception where *outcome* is a tuple of the form returned by :func:" "`sys.exc_info`: ``(type, value, traceback)``." msgstr "" -#: library/unittest.rst:2179 +#: library/unittest.rst:2187 msgid "" "The default implementation does nothing when the outcome is a success, and " "records subtest failures as normal failures." msgstr "" -#: library/unittest.rst:2186 +#: library/unittest.rst:2194 msgid "" "Called when the test case finishes. *elapsed* is the time represented in " "seconds, and it includes the execution of cleanup functions." msgstr "" -#: library/unittest.rst:2193 +#: library/unittest.rst:2201 msgid "" "A concrete implementation of :class:`TestResult` used by the :class:" "`TextTestRunner`. Subclasses should accept ``**kwargs`` to ensure " "compatibility as the interface changes." msgstr "" -#: library/unittest.rst:2199 +#: library/unittest.rst:2207 msgid "Added the *durations* keyword parameter." msgstr "" -#: library/unittest.rst:2204 +#: library/unittest.rst:2212 msgid "" "Instance of the :class:`TestLoader` class intended to be shared. If no " "customization of the :class:`TestLoader` is needed, this instance can be " "used instead of repeatedly creating new instances." msgstr "" -#: library/unittest.rst:2213 +#: library/unittest.rst:2221 msgid "" "A basic test runner implementation that outputs results to a stream. If " "*stream* is ``None``, the default, :data:`sys.stderr` is used as the output " @@ -2937,7 +2943,7 @@ msgid "" "unittest." msgstr "" -#: library/unittest.rst:2220 +#: library/unittest.rst:2228 msgid "" "By default this runner shows :exc:`DeprecationWarning`, :exc:" "`PendingDeprecationWarning`, :exc:`ResourceWarning` and :exc:`ImportWarning` " @@ -2947,32 +2953,32 @@ msgid "" "``None``." msgstr "" -#: library/unittest.rst:2228 +#: library/unittest.rst:2236 msgid "Added the *warnings* parameter." msgstr "" -#: library/unittest.rst:2231 +#: library/unittest.rst:2239 msgid "" "The default stream is set to :data:`sys.stderr` at instantiation time rather " "than import time." msgstr "" -#: library/unittest.rst:2235 +#: library/unittest.rst:2243 msgid "Added the *tb_locals* parameter." msgstr "" -#: library/unittest.rst:2238 +#: library/unittest.rst:2246 msgid "Added the *durations* parameter." msgstr "" -#: library/unittest.rst:2243 +#: library/unittest.rst:2251 msgid "" "This method returns the instance of ``TestResult`` used by :meth:`run`. It " "is not intended to be called directly, but can be overridden in subclasses " "to provide a custom ``TestResult``." msgstr "" -#: library/unittest.rst:2247 +#: library/unittest.rst:2255 msgid "" "``_makeResult()`` instantiates the class or callable passed in the " "``TextTestRunner`` constructor as the ``resultclass`` argument. It defaults " @@ -2980,11 +2986,11 @@ msgid "" "class is instantiated with the following arguments::" msgstr "" -#: library/unittest.rst:2252 +#: library/unittest.rst:2260 msgid "stream, descriptions, verbosity" msgstr "" -#: library/unittest.rst:2256 +#: library/unittest.rst:2264 msgid "" "This method is the main public interface to the ``TextTestRunner``. This " "method takes a :class:`TestSuite` or :class:`TestCase` instance. A :class:" @@ -2992,7 +2998,7 @@ msgid "" "run and the results printed to stdout." msgstr "" -#: library/unittest.rst:2267 +#: library/unittest.rst:2275 msgid "" "A command-line program that loads a set of tests from *module* and runs " "them; this is primarily for making test modules conveniently executable. The " @@ -3000,25 +3006,25 @@ msgid "" "of a test script::" msgstr "" -#: library/unittest.rst:2272 +#: library/unittest.rst:2280 msgid "" "if __name__ == '__main__':\n" " unittest.main()" msgstr "" -#: library/unittest.rst:2275 +#: library/unittest.rst:2283 msgid "" "You can run tests with more detailed information by passing in the verbosity " "argument::" msgstr "" -#: library/unittest.rst:2278 +#: library/unittest.rst:2286 msgid "" "if __name__ == '__main__':\n" " unittest.main(verbosity=2)" msgstr "" -#: library/unittest.rst:2281 +#: library/unittest.rst:2289 msgid "" "The *defaultTest* argument is either the name of a single test or an " "iterable of test names to run if no test names are specified via *argv*. If " @@ -3026,14 +3032,14 @@ msgid "" "tests found in *module* are run." msgstr "" -#: library/unittest.rst:2286 +#: library/unittest.rst:2294 msgid "" "The *argv* argument can be a list of options passed to the program, with the " "first element being the program name. If not specified or ``None``, the " "values of :data:`sys.argv` are used." msgstr "" -#: library/unittest.rst:2290 +#: library/unittest.rst:2298 msgid "" "The *testRunner* argument can either be a test runner class or an already " "created instance of it. By default ``main`` calls :func:`sys.exit` with an " @@ -3041,32 +3047,32 @@ msgid "" "code of 5 indicates that no tests were run or skipped." msgstr "" -#: library/unittest.rst:2295 +#: library/unittest.rst:2303 msgid "" "The *testLoader* argument has to be a :class:`TestLoader` instance, and " "defaults to :data:`defaultTestLoader`." msgstr "" -#: library/unittest.rst:2298 +#: library/unittest.rst:2306 msgid "" "``main`` supports being used from the interactive interpreter by passing in " "the argument ``exit=False``. This displays the result on standard output " "without calling :func:`sys.exit`::" msgstr "" -#: library/unittest.rst:2302 +#: library/unittest.rst:2310 msgid "" ">>> from unittest import main\n" ">>> main(module='test_module', exit=False)" msgstr "" -#: library/unittest.rst:2305 +#: library/unittest.rst:2313 msgid "" "The *failfast*, *catchbreak* and *buffer* parameters have the same effect as " "the same-name `command-line options`_." msgstr "" -#: library/unittest.rst:2308 +#: library/unittest.rst:2316 msgid "" "The *warnings* argument specifies the :ref:`warning filter ` " "that should be used while running the tests. If it's not specified, it will " @@ -3075,60 +3081,60 @@ msgid "" "to ``'default'``." msgstr "" -#: library/unittest.rst:2314 +#: library/unittest.rst:2322 msgid "" "Calling ``main`` returns an object with the ``result`` attribute that " "contains the result of the tests run as a :class:`unittest.TestResult`." msgstr "" -#: library/unittest.rst:2317 +#: library/unittest.rst:2325 msgid "The *exit* parameter was added." msgstr "" -#: library/unittest.rst:2320 +#: library/unittest.rst:2328 msgid "" "The *verbosity*, *failfast*, *catchbreak*, *buffer* and *warnings* " "parameters were added." msgstr "" -#: library/unittest.rst:2324 +#: library/unittest.rst:2332 msgid "" "The *defaultTest* parameter was changed to also accept an iterable of test " "names." msgstr "" -#: library/unittest.rst:2332 +#: library/unittest.rst:2340 msgid "load_tests Protocol" msgstr "" -#: library/unittest.rst:2336 +#: library/unittest.rst:2344 msgid "" "Modules or packages can customize how tests are loaded from them during " "normal test runs or test discovery by implementing a function called " "``load_tests``." msgstr "" -#: library/unittest.rst:2339 +#: library/unittest.rst:2347 msgid "" "If a test module defines ``load_tests`` it will be called by :meth:" "`TestLoader.loadTestsFromModule` with the following arguments::" msgstr "" -#: library/unittest.rst:2374 +#: library/unittest.rst:2382 msgid "load_tests(loader, standard_tests, pattern)" msgstr "" -#: library/unittest.rst:2344 +#: library/unittest.rst:2352 msgid "" "where *pattern* is passed straight through from ``loadTestsFromModule``. It " "defaults to ``None``." msgstr "" -#: library/unittest.rst:2347 +#: library/unittest.rst:2355 msgid "It should return a :class:`TestSuite`." msgstr "" -#: library/unittest.rst:2349 +#: library/unittest.rst:2357 msgid "" "*loader* is the instance of :class:`TestLoader` doing the loading. " "*standard_tests* are the tests that would be loaded by default from the " @@ -3137,13 +3143,13 @@ msgid "" "packages as part of test discovery." msgstr "" -#: library/unittest.rst:2355 +#: library/unittest.rst:2363 msgid "" "A typical ``load_tests`` function that loads tests from a specific set of :" "class:`TestCase` classes may look like::" msgstr "" -#: library/unittest.rst:2358 +#: library/unittest.rst:2366 msgid "" "test_cases = (TestCase1, TestCase2, TestCase3)\n" "\n" @@ -3155,7 +3161,7 @@ msgid "" " return suite" msgstr "" -#: library/unittest.rst:2367 +#: library/unittest.rst:2375 msgid "" "If discovery is started in a directory containing a package, either from the " "command line or by calling :meth:`TestLoader.discover`, then the package :" @@ -3165,21 +3171,21 @@ msgid "" "left up to ``load_tests`` which is called with the following arguments::" msgstr "" -#: library/unittest.rst:2376 +#: library/unittest.rst:2384 msgid "" "This should return a :class:`TestSuite` representing all the tests from the " "package. (``standard_tests`` will only contain tests collected from :file:" "`__init__.py`.)" msgstr "" -#: library/unittest.rst:2380 +#: library/unittest.rst:2388 msgid "" "Because the pattern is passed into ``load_tests`` the package is free to " "continue (and potentially modify) test discovery. A 'do nothing' " "``load_tests`` function for a test package would look like::" msgstr "" -#: library/unittest.rst:2384 +#: library/unittest.rst:2392 msgid "" "def load_tests(loader, standard_tests, pattern):\n" " # top level directory cached on loader instance\n" @@ -3189,17 +3195,17 @@ msgid "" " return standard_tests" msgstr "" -#: library/unittest.rst:2391 +#: library/unittest.rst:2399 msgid "" "Discovery no longer checks package names for matching *pattern* due to the " "impossibility of package names matching the default pattern." msgstr "" -#: library/unittest.rst:2398 +#: library/unittest.rst:2406 msgid "Class and Module Fixtures" msgstr "" -#: library/unittest.rst:2400 +#: library/unittest.rst:2408 msgid "" "Class and module level fixtures are implemented in :class:`TestSuite`. When " "the test suite encounters a test from a new class then :meth:`tearDownClass` " @@ -3207,27 +3213,27 @@ msgid "" "`setUpClass` from the new class." msgstr "" -#: library/unittest.rst:2405 +#: library/unittest.rst:2413 msgid "" "Similarly if a test is from a different module from the previous test then " "``tearDownModule`` from the previous module is run, followed by " "``setUpModule`` from the new module." msgstr "" -#: library/unittest.rst:2409 +#: library/unittest.rst:2417 msgid "" "After all the tests have run the final ``tearDownClass`` and " "``tearDownModule`` are run." msgstr "" -#: library/unittest.rst:2412 +#: library/unittest.rst:2420 msgid "" "Note that shared fixtures do not play well with [potential] features like " "test parallelization and they break test isolation. They should be used with " "care." msgstr "" -#: library/unittest.rst:2415 +#: library/unittest.rst:2423 msgid "" "The default ordering of tests created by the unittest test loaders is to " "group all tests from the same modules and classes together. This will lead " @@ -3237,14 +3243,14 @@ msgid "" "functions may be called multiple times in a single test run." msgstr "" -#: library/unittest.rst:2422 +#: library/unittest.rst:2430 msgid "" "Shared fixtures are not intended to work with suites with non-standard " "ordering. A ``BaseTestSuite`` still exists for frameworks that don't want to " "support shared fixtures." msgstr "" -#: library/unittest.rst:2426 +#: library/unittest.rst:2434 msgid "" "If there are any exceptions raised during one of the shared fixture " "functions the test is reported as an error. Because there is no " @@ -3254,15 +3260,15 @@ msgid "" "matter, but if you are a framework author it may be relevant." msgstr "" -#: library/unittest.rst:2435 +#: library/unittest.rst:2443 msgid "setUpClass and tearDownClass" msgstr "" -#: library/unittest.rst:2437 +#: library/unittest.rst:2445 msgid "These must be implemented as class methods::" msgstr "" -#: library/unittest.rst:2439 +#: library/unittest.rst:2447 msgid "" "import unittest\n" "\n" @@ -3276,14 +3282,14 @@ msgid "" " cls._connection.destroy()" msgstr "" -#: library/unittest.rst:2450 +#: library/unittest.rst:2458 msgid "" "If you want the ``setUpClass`` and ``tearDownClass`` on base classes called " "then you must call up to them yourself. The implementations in :class:" "`TestCase` are empty." msgstr "" -#: library/unittest.rst:2454 +#: library/unittest.rst:2462 msgid "" "If an exception is raised during a ``setUpClass`` then the tests in the " "class are not run and the ``tearDownClass`` is not run. Skipped classes will " @@ -3292,15 +3298,15 @@ msgid "" "instead of as an error." msgstr "" -#: library/unittest.rst:2462 +#: library/unittest.rst:2470 msgid "setUpModule and tearDownModule" msgstr "" -#: library/unittest.rst:2464 +#: library/unittest.rst:2472 msgid "These should be implemented as functions::" msgstr "" -#: library/unittest.rst:2466 +#: library/unittest.rst:2474 msgid "" "def setUpModule():\n" " createConnection()\n" @@ -3309,7 +3315,7 @@ msgid "" " closeConnection()" msgstr "" -#: library/unittest.rst:2472 +#: library/unittest.rst:2480 msgid "" "If an exception is raised in a ``setUpModule`` then none of the tests in the " "module will be run and the ``tearDownModule`` will not be run. If the " @@ -3317,13 +3323,13 @@ msgid "" "having been skipped instead of as an error." msgstr "" -#: library/unittest.rst:2477 +#: library/unittest.rst:2485 msgid "" "To add cleanup code that must be run even in the case of an exception, use " "``addModuleCleanup``:" msgstr "" -#: library/unittest.rst:2483 +#: library/unittest.rst:2491 msgid "" "Add a function to be called after :func:`tearDownModule` to cleanup " "resources used during the test class. Functions will be called in reverse " @@ -3332,13 +3338,13 @@ msgid "" "`addModuleCleanup` when they are added." msgstr "" -#: library/unittest.rst:2489 +#: library/unittest.rst:2497 msgid "" "If :meth:`setUpModule` fails, meaning that :func:`tearDownModule` is not " "called, then any cleanup functions added will still be called." msgstr "" -#: library/unittest.rst:2497 +#: library/unittest.rst:2505 msgid "" "Enter the supplied :term:`context manager`. If successful, also add its :" "meth:`~object.__exit__` method as a cleanup function by :func:" @@ -3346,30 +3352,30 @@ msgid "" "method." msgstr "" -#: library/unittest.rst:2507 +#: library/unittest.rst:2515 msgid "" "This function is called unconditionally after :func:`tearDownModule`, or " "after :func:`setUpModule` if :func:`setUpModule` raises an exception." msgstr "" -#: library/unittest.rst:2510 +#: library/unittest.rst:2518 msgid "" "It is responsible for calling all the cleanup functions added by :func:" "`addModuleCleanup`. If you need cleanup functions to be called *prior* to :" "func:`tearDownModule` then you can call :func:`doModuleCleanups` yourself." msgstr "" -#: library/unittest.rst:2515 +#: library/unittest.rst:2523 msgid "" ":func:`doModuleCleanups` pops methods off the stack of cleanup functions one " "at a time, so it can be called at any time." msgstr "" -#: library/unittest.rst:2522 +#: library/unittest.rst:2530 msgid "Signal Handling" msgstr "" -#: library/unittest.rst:2526 +#: library/unittest.rst:2534 msgid "" "The :option:`-c/--catch ` command-line option to unittest, " "along with the ``catchbreak`` parameter to :func:`unittest.main`, provide " @@ -3379,7 +3385,7 @@ msgid "" "A second control-c will raise a :exc:`KeyboardInterrupt` in the usual way." msgstr "" -#: library/unittest.rst:2533 +#: library/unittest.rst:2541 msgid "" "The control-c handling signal handler attempts to remain compatible with " "code or tests that install their own :const:`signal.SIGINT` handler. If the " @@ -3391,48 +3397,48 @@ msgid "" "disabled the :func:`removeHandler` decorator can be used." msgstr "" -#: library/unittest.rst:2542 +#: library/unittest.rst:2550 msgid "" "There are a few utility functions for framework authors to enable control-c " "handling functionality within test frameworks." msgstr "" -#: library/unittest.rst:2547 +#: library/unittest.rst:2555 msgid "" "Install the control-c handler. When a :const:`signal.SIGINT` is received " "(usually in response to the user pressing control-c) all registered results " "have :meth:`~TestResult.stop` called." msgstr "" -#: library/unittest.rst:2554 +#: library/unittest.rst:2562 msgid "" "Register a :class:`TestResult` object for control-c handling. Registering a " "result stores a weak reference to it, so it doesn't prevent the result from " "being garbage collected." msgstr "" -#: library/unittest.rst:2558 +#: library/unittest.rst:2566 msgid "" "Registering a :class:`TestResult` object has no side-effects if control-c " "handling is not enabled, so test frameworks can unconditionally register all " "results they create independently of whether or not handling is enabled." msgstr "" -#: library/unittest.rst:2565 +#: library/unittest.rst:2573 msgid "" "Remove a registered result. Once a result has been removed then :meth:" "`~TestResult.stop` will no longer be called on that result object in " "response to a control-c." msgstr "" -#: library/unittest.rst:2572 +#: library/unittest.rst:2580 msgid "" "When called without arguments this function removes the control-c handler if " "it has been installed. This function can also be used as a test decorator to " "temporarily remove the handler while the test is being executed::" msgstr "" -#: library/unittest.rst:2576 +#: library/unittest.rst:2584 msgid "" "@unittest.removeHandler\n" "def test_signal_handling(self):\n" diff --git a/library/unix.po b/library/unix.po index e56f6031..ad8d2f97 100644 --- a/library/unix.po +++ b/library/unix.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" diff --git a/library/urllib.error.po b/library/urllib.error.po index e52c7425..4311cd9e 100644 --- a/library/urllib.error.po +++ b/library/urllib.error.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" diff --git a/library/urllib.parse.po b/library/urllib.parse.po index f2effb64..ba6c2d4d 100644 --- a/library/urllib.parse.po +++ b/library/urllib.parse.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -37,20 +37,29 @@ msgstr "" msgid "" "The module has been designed to match the internet RFC on Relative Uniform " "Resource Locators. It supports the following URL schemes: ``file``, ``ftp``, " -"``gopher``, ``hdl``, ``http``, ``https``, ``imap``, ``mailto``, ``mms``, " -"``news``, ``nntp``, ``prospero``, ``rsync``, ``rtsp``, ``rtsps``, ``rtspu``, " -"``sftp``, ``shttp``, ``sip``, ``sips``, ``snews``, ``svn``, ``svn+ssh``, " -"``telnet``, ``wais``, ``ws``, ``wss``." +"``gopher``, ``hdl``, ``http``, ``https``, ``imap``, ``itms-services``, " +"``mailto``, ``mms``, ``news``, ``nntp``, ``prospero``, ``rsync``, ``rtsp``, " +"``rtsps``, ``rtspu``, ``sftp``, ``shttp``, ``sip``, ``sips``, ``snews``, " +"``svn``, ``svn+ssh``, ``telnet``, ``wais``, ``ws``, ``wss``." msgstr "" -#: library/urllib.parse.rst:30 +#: library/urllib.parse.rst:32 +msgid "" +"The inclusion of the ``itms-services`` URL scheme can prevent an app from " +"passing Apple's App Store review process for the macOS and iOS App Stores. " +"Handling for the ``itms-services`` scheme is always removed on iOS; on " +"macOS, it *may* be removed if CPython has been built with the :option:`--" +"with-app-store-compliance` option." +msgstr "" + +#: library/urllib.parse.rst:38 msgid "" "The :mod:`urllib.parse` module defines functions that fall into two broad " "categories: URL parsing and URL quoting. These are covered in detail in the " "following sections." msgstr "" -#: library/urllib.parse.rst:34 +#: library/urllib.parse.rst:42 msgid "" "This module's functions use the deprecated term ``netloc`` (or ``net_loc``), " "which was introduced in :rfc:`1808`. However, this term has been obsoleted " @@ -58,17 +67,17 @@ msgid "" "The use of ``netloc`` is continued for backward compatibility." msgstr "" -#: library/urllib.parse.rst:40 +#: library/urllib.parse.rst:48 msgid "URL Parsing" msgstr "" -#: library/urllib.parse.rst:42 +#: library/urllib.parse.rst:50 msgid "" "The URL parsing functions focus on splitting a URL string into its " "components, or on combining URL components into a URL string." msgstr "" -#: library/urllib.parse.rst:47 +#: library/urllib.parse.rst:55 msgid "" "Parse a URL into six components, returning a 6-item :term:`named tuple`. " "This corresponds to the general structure of a URL: ``scheme://netloc/path;" @@ -79,7 +88,7 @@ msgid "" "slash in the *path* component, which is retained if present. For example:" msgstr "" -#: library/urllib.parse.rst:56 +#: library/urllib.parse.rst:64 msgid "" ">>> from urllib.parse import urlparse\n" ">>> urlparse(\"scheme://netloc/path;parameters?query#fragment\")\n" @@ -104,14 +113,14 @@ msgid "" "'http://docs.python.org:80/3/library/urllib.parse.html?highlight=params'" msgstr "" -#: library/urllib.parse.rst:80 +#: library/urllib.parse.rst:88 msgid "" "Following the syntax specifications in :rfc:`1808`, urlparse recognizes a " "netloc only if it is properly introduced by '//'. Otherwise the input is " "presumed to be a relative URL and thus to start with a path component." msgstr "" -#: library/urllib.parse.rst:85 +#: library/urllib.parse.rst:93 msgid "" ">>> from urllib.parse import urlparse\n" ">>> urlparse('//www.cwi.nl:80/%7Eguido/Python.html')\n" @@ -126,7 +135,7 @@ msgid "" " query='', fragment='')" msgstr "" -#: library/urllib.parse.rst:99 +#: library/urllib.parse.rst:107 msgid "" "The *scheme* argument gives the default addressing scheme, to be used only " "if the URL does not specify one. It should be the same type (text or bytes) " @@ -134,7 +143,7 @@ msgid "" "is automatically converted to ``b''`` if appropriate." msgstr "" -#: library/urllib.parse.rst:104 +#: library/urllib.parse.rst:112 msgid "" "If the *allow_fragments* argument is false, fragment identifiers are not " "recognized. Instead, they are parsed as part of the path, parameters or " @@ -142,161 +151,161 @@ msgid "" "return value." msgstr "" -#: library/urllib.parse.rst:109 +#: library/urllib.parse.rst:117 msgid "" "The return value is a :term:`named tuple`, which means that its items can be " "accessed by index or as named attributes, which are:" msgstr "" -#: library/urllib.parse.rst:302 library/urllib.parse.rst:424 +#: library/urllib.parse.rst:310 library/urllib.parse.rst:432 msgid "Attribute" msgstr "" -#: library/urllib.parse.rst:302 library/urllib.parse.rst:424 +#: library/urllib.parse.rst:310 library/urllib.parse.rst:432 msgid "Index" msgstr "" -#: library/urllib.parse.rst:302 library/urllib.parse.rst:424 +#: library/urllib.parse.rst:310 library/urllib.parse.rst:432 msgid "Value" msgstr "" -#: library/urllib.parse.rst:302 library/urllib.parse.rst:424 +#: library/urllib.parse.rst:310 library/urllib.parse.rst:432 msgid "Value if not present" msgstr "" -#: library/urllib.parse.rst:304 +#: library/urllib.parse.rst:312 msgid ":attr:`scheme`" msgstr "" -#: library/urllib.parse.rst:304 library/urllib.parse.rst:426 +#: library/urllib.parse.rst:312 library/urllib.parse.rst:434 msgid "0" msgstr "" -#: library/urllib.parse.rst:304 +#: library/urllib.parse.rst:312 msgid "URL scheme specifier" msgstr "" -#: library/urllib.parse.rst:304 +#: library/urllib.parse.rst:312 msgid "*scheme* parameter" msgstr "" -#: library/urllib.parse.rst:306 +#: library/urllib.parse.rst:314 msgid ":attr:`netloc`" msgstr "" -#: library/urllib.parse.rst:306 library/urllib.parse.rst:428 +#: library/urllib.parse.rst:314 library/urllib.parse.rst:436 msgid "1" msgstr "" -#: library/urllib.parse.rst:306 +#: library/urllib.parse.rst:314 msgid "Network location part" msgstr "" -#: library/urllib.parse.rst:119 library/urllib.parse.rst:124 -#: library/urllib.parse.rst:306 library/urllib.parse.rst:310 -#: library/urllib.parse.rst:426 library/urllib.parse.rst:428 +#: library/urllib.parse.rst:127 library/urllib.parse.rst:132 +#: library/urllib.parse.rst:314 library/urllib.parse.rst:318 +#: library/urllib.parse.rst:434 library/urllib.parse.rst:436 msgid "empty string" msgstr "" -#: library/urllib.parse.rst:308 +#: library/urllib.parse.rst:316 msgid ":attr:`path`" msgstr "" -#: library/urllib.parse.rst:308 +#: library/urllib.parse.rst:316 msgid "2" msgstr "" -#: library/urllib.parse.rst:308 +#: library/urllib.parse.rst:316 msgid "Hierarchical path" msgstr "" -#: library/urllib.parse.rst:121 +#: library/urllib.parse.rst:129 msgid ":attr:`params`" msgstr "" -#: library/urllib.parse.rst:310 +#: library/urllib.parse.rst:318 msgid "3" msgstr "" -#: library/urllib.parse.rst:121 +#: library/urllib.parse.rst:129 msgid "Parameters for last path element" msgstr "" -#: library/urllib.parse.rst:310 +#: library/urllib.parse.rst:318 msgid ":attr:`query`" msgstr "" -#: library/urllib.parse.rst:312 +#: library/urllib.parse.rst:320 msgid "4" msgstr "" -#: library/urllib.parse.rst:310 +#: library/urllib.parse.rst:318 msgid "Query component" msgstr "" -#: library/urllib.parse.rst:312 library/urllib.parse.rst:428 +#: library/urllib.parse.rst:320 library/urllib.parse.rst:436 msgid ":attr:`fragment`" msgstr "" -#: library/urllib.parse.rst:126 +#: library/urllib.parse.rst:134 msgid "5" msgstr "" -#: library/urllib.parse.rst:312 library/urllib.parse.rst:428 +#: library/urllib.parse.rst:320 library/urllib.parse.rst:436 msgid "Fragment identifier" msgstr "" -#: library/urllib.parse.rst:314 +#: library/urllib.parse.rst:322 msgid ":attr:`username`" msgstr "" -#: library/urllib.parse.rst:314 +#: library/urllib.parse.rst:322 msgid "User name" msgstr "" -#: library/urllib.parse.rst:130 library/urllib.parse.rst:134 -#: library/urllib.parse.rst:316 library/urllib.parse.rst:320 +#: library/urllib.parse.rst:138 library/urllib.parse.rst:142 +#: library/urllib.parse.rst:324 library/urllib.parse.rst:328 msgid ":const:`None`" msgstr "" -#: library/urllib.parse.rst:316 +#: library/urllib.parse.rst:324 msgid ":attr:`password`" msgstr "" -#: library/urllib.parse.rst:316 +#: library/urllib.parse.rst:324 msgid "Password" msgstr "" -#: library/urllib.parse.rst:318 +#: library/urllib.parse.rst:326 msgid ":attr:`hostname`" msgstr "" -#: library/urllib.parse.rst:318 +#: library/urllib.parse.rst:326 msgid "Host name (lower case)" msgstr "" -#: library/urllib.parse.rst:320 +#: library/urllib.parse.rst:328 msgid ":attr:`port`" msgstr "" -#: library/urllib.parse.rst:320 +#: library/urllib.parse.rst:328 msgid "Port number as integer, if present" msgstr "" -#: library/urllib.parse.rst:324 +#: library/urllib.parse.rst:332 msgid "" "Reading the :attr:`port` attribute will raise a :exc:`ValueError` if an " "invalid port is specified in the URL. See section :ref:`urlparse-result-" "object` for more information on the result object." msgstr "" -#: library/urllib.parse.rst:328 +#: library/urllib.parse.rst:336 msgid "" "Unmatched square brackets in the :attr:`netloc` attribute will raise a :exc:" "`ValueError`." msgstr "" -#: library/urllib.parse.rst:331 +#: library/urllib.parse.rst:339 msgid "" "Characters in the :attr:`netloc` attribute that decompose under NFKC " "normalization (as used by the IDNA encoding) into any of ``/``, ``?``, " @@ -304,7 +313,7 @@ msgid "" "decomposed before parsing, no error will be raised." msgstr "" -#: library/urllib.parse.rst:150 +#: library/urllib.parse.rst:158 msgid "" "As is the case with all named tuples, the subclass has a few additional " "methods and attributes that are particularly useful. One such method is :" @@ -312,7 +321,7 @@ msgid "" "object replacing specified fields with new values." msgstr "" -#: library/urllib.parse.rst:155 +#: library/urllib.parse.rst:163 msgid "" ">>> from urllib.parse import urlparse\n" ">>> u = urlparse('//www.cwi.nl:80/%7Eguido/Python.html')\n" @@ -326,36 +335,36 @@ msgid "" " params='', query='', fragment='')" msgstr "" -#: library/urllib.parse.rst:169 +#: library/urllib.parse.rst:177 msgid "" ":func:`urlparse` does not perform validation. See :ref:`URL parsing " "security ` for details." msgstr "" -#: library/urllib.parse.rst:172 +#: library/urllib.parse.rst:180 msgid "Added IPv6 URL parsing capabilities." msgstr "" -#: library/urllib.parse.rst:175 +#: library/urllib.parse.rst:183 msgid "" "The fragment is now parsed for all URL schemes (unless *allow_fragments* is " "false), in accordance with :rfc:`3986`. Previously, an allowlist of schemes " "that support fragments existed." msgstr "" -#: library/urllib.parse.rst:345 +#: library/urllib.parse.rst:353 msgid "" "Out-of-range port numbers now raise :exc:`ValueError`, instead of returning :" "const:`None`." msgstr "" -#: library/urllib.parse.rst:349 +#: library/urllib.parse.rst:357 msgid "" "Characters that affect netloc parsing under NFKC normalization will now " "raise :exc:`ValueError`." msgstr "" -#: library/urllib.parse.rst:191 +#: library/urllib.parse.rst:199 msgid "" "Parse a query string given as a string argument (data of type :mimetype:" "`application/x-www-form-urlencoded`). Data are returned as a dictionary. " @@ -363,7 +372,7 @@ msgid "" "lists of values for each name." msgstr "" -#: library/urllib.parse.rst:241 +#: library/urllib.parse.rst:249 msgid "" "The optional argument *keep_blank_values* is a flag indicating whether blank " "values in percent-encoded queries should be treated as blank strings. A true " @@ -372,48 +381,48 @@ msgid "" "treated as if they were not included." msgstr "" -#: library/urllib.parse.rst:247 +#: library/urllib.parse.rst:255 msgid "" "The optional argument *strict_parsing* is a flag indicating what to do with " "parsing errors. If false (the default), errors are silently ignored. If " "true, errors raise a :exc:`ValueError` exception." msgstr "" -#: library/urllib.parse.rst:251 +#: library/urllib.parse.rst:259 msgid "" "The optional *encoding* and *errors* parameters specify how to decode " "percent-encoded sequences into Unicode characters, as accepted by the :meth:" "`bytes.decode` method." msgstr "" -#: library/urllib.parse.rst:255 +#: library/urllib.parse.rst:263 msgid "" "The optional argument *max_num_fields* is the maximum number of fields to " "read. If set, then throws a :exc:`ValueError` if there are more than " "*max_num_fields* fields read." msgstr "" -#: library/urllib.parse.rst:259 +#: library/urllib.parse.rst:267 msgid "" "The optional argument *separator* is the symbol to use for separating the " "query arguments. It defaults to ``&``." msgstr "" -#: library/urllib.parse.rst:217 +#: library/urllib.parse.rst:225 msgid "" "Use the :func:`urllib.parse.urlencode` function (with the ``doseq`` " "parameter set to ``True``) to convert such dictionaries into query strings." msgstr "" -#: library/urllib.parse.rst:265 +#: library/urllib.parse.rst:273 msgid "Add *encoding* and *errors* parameters." msgstr "" -#: library/urllib.parse.rst:268 +#: library/urllib.parse.rst:276 msgid "Added *max_num_fields* parameter." msgstr "" -#: library/urllib.parse.rst:271 +#: library/urllib.parse.rst:279 msgid "" "Added *separator* parameter with the default value of ``&``. Python versions " "earlier than Python 3.10 allowed using both ``;`` and ``&`` as query " @@ -421,20 +430,20 @@ msgid "" "key, with ``&`` as the default separator." msgstr "" -#: library/urllib.parse.rst:237 +#: library/urllib.parse.rst:245 msgid "" "Parse a query string given as a string argument (data of type :mimetype:" "`application/x-www-form-urlencoded`). Data are returned as a list of name, " "value pairs." msgstr "" -#: library/urllib.parse.rst:262 +#: library/urllib.parse.rst:270 msgid "" "Use the :func:`urllib.parse.urlencode` function to convert such lists of " "pairs into query strings." msgstr "" -#: library/urllib.parse.rst:280 +#: library/urllib.parse.rst:288 msgid "" "Construct a URL from a tuple as returned by ``urlparse()``. The *parts* " "argument can be any six-item iterable. This may result in a slightly " @@ -443,7 +452,7 @@ msgid "" "states that these are equivalent)." msgstr "" -#: library/urllib.parse.rst:289 +#: library/urllib.parse.rst:297 msgid "" "This is similar to :func:`urlparse`, but does not split the params from the " "URL. This should generally be used instead of :func:`urlparse` if the more " @@ -453,40 +462,40 @@ msgid "" "returns a 5-item :term:`named tuple`::" msgstr "" -#: library/urllib.parse.rst:296 +#: library/urllib.parse.rst:304 msgid "" "(addressing scheme, network location, path, query, fragment identifier)." msgstr "" -#: library/urllib.parse.rst:420 +#: library/urllib.parse.rst:428 msgid "" "The return value is a :term:`named tuple`, its items can be accessed by " "index or as named attributes:" msgstr "" -#: library/urllib.parse.rst:336 +#: library/urllib.parse.rst:344 msgid "" "Following some of the `WHATWG spec`_ that updates RFC 3986, leading C0 " "control and space characters are stripped from the URL. ``\\n``, ``\\r`` and " "tab ``\\t`` characters are removed from the URL at any position." msgstr "" -#: library/urllib.parse.rst:342 +#: library/urllib.parse.rst:350 msgid "" ":func:`urlsplit` does not perform validation. See :ref:`URL parsing " "security ` for details." msgstr "" -#: library/urllib.parse.rst:353 +#: library/urllib.parse.rst:361 msgid "ASCII newline and tab characters are stripped from the URL." msgstr "" -#: library/urllib.parse.rst:356 +#: library/urllib.parse.rst:364 msgid "" "Leading WHATWG C0 control and space characters are stripped from the URL." msgstr "" -#: library/urllib.parse.rst:363 +#: library/urllib.parse.rst:371 msgid "" "Combine the elements of a tuple as returned by :func:`urlsplit` into a " "complete URL as a string. The *parts* argument can be any five-item " @@ -495,7 +504,7 @@ msgid "" "a ? with an empty query; the RFC states that these are equivalent)." msgstr "" -#: library/urllib.parse.rst:372 +#: library/urllib.parse.rst:380 msgid "" "Construct a full (\"absolute\") URL by combining a \"base URL\" (*base*) " "with another URL (*url*). Informally, this uses components of the base URL, " @@ -503,33 +512,33 @@ msgid "" "path, to provide missing components in the relative URL. For example:" msgstr "" -#: library/urllib.parse.rst:381 +#: library/urllib.parse.rst:389 msgid "" "The *allow_fragments* argument has the same meaning and default as for :func:" "`urlparse`." msgstr "" -#: library/urllib.parse.rst:386 +#: library/urllib.parse.rst:394 msgid "" "If *url* is an absolute URL (that is, it starts with ``//`` or ``scheme://" "``), the *url*'s hostname and/or scheme will be present in the result. For " "example:" msgstr "" -#: library/urllib.parse.rst:389 +#: library/urllib.parse.rst:397 msgid "" ">>> urljoin('http://www.cwi.nl/%7Eguido/Python.html',\n" "... '//www.python.org/%7Eguido')\n" "'http://www.python.org/%7Eguido'" msgstr "" -#: library/urllib.parse.rst:395 +#: library/urllib.parse.rst:403 msgid "" "If you do not want that behavior, preprocess the *url* with :func:`urlsplit` " "and :func:`urlunsplit`, removing possible *scheme* and *netloc* parts." msgstr "" -#: library/urllib.parse.rst:400 +#: library/urllib.parse.rst:408 msgid "" "Because an absolute URL may be passed as the ``url`` parameter, it is " "generally **not secure** to use ``urljoin`` with an attacker-controlled " @@ -538,11 +547,11 @@ msgid "" "``urljoin`` will be the absolute URL." msgstr "" -#: library/urllib.parse.rst:410 +#: library/urllib.parse.rst:418 msgid "Behavior updated to match the semantics defined in :rfc:`3986`." msgstr "" -#: library/urllib.parse.rst:415 +#: library/urllib.parse.rst:423 msgid "" "If *url* contains a fragment identifier, return a modified version of *url* " "with no fragment identifier, and the fragment identifier as a separate " @@ -550,25 +559,25 @@ msgid "" "unmodified and an empty string." msgstr "" -#: library/urllib.parse.rst:426 +#: library/urllib.parse.rst:434 msgid ":attr:`url`" msgstr "" -#: library/urllib.parse.rst:426 +#: library/urllib.parse.rst:434 msgid "URL with no fragment" msgstr "" -#: library/urllib.parse.rst:431 +#: library/urllib.parse.rst:439 msgid "" "See section :ref:`urlparse-result-object` for more information on the result " "object." msgstr "" -#: library/urllib.parse.rst:434 +#: library/urllib.parse.rst:442 msgid "Result is a structured object rather than a simple 2-tuple." msgstr "" -#: library/urllib.parse.rst:439 +#: library/urllib.parse.rst:447 msgid "" "Extract the url from a wrapped URL (that is, a string formatted as ````, ````, ``URL:scheme://host/path`` " @@ -576,11 +585,11 @@ msgid "" "without changes." msgstr "" -#: library/urllib.parse.rst:447 +#: library/urllib.parse.rst:455 msgid "URL parsing security" msgstr "" -#: library/urllib.parse.rst:449 +#: library/urllib.parse.rst:457 msgid "" "The :func:`urlsplit` and :func:`urlparse` APIs do not perform **validation** " "of inputs. They may not raise errors on inputs that other applications " @@ -589,14 +598,14 @@ msgid "" "rather than purity." msgstr "" -#: library/urllib.parse.rst:455 +#: library/urllib.parse.rst:463 msgid "" "Instead of raising an exception on unusual input, they may instead return " "some component parts as empty strings. Or components may contain more than " "perhaps they should." msgstr "" -#: library/urllib.parse.rst:459 +#: library/urllib.parse.rst:467 msgid "" "We recommend that users of these APIs where the values may be used anywhere " "with security implications code defensively. Do some verification within " @@ -605,7 +614,7 @@ msgid "" "that ``hostname``? etc." msgstr "" -#: library/urllib.parse.rst:465 +#: library/urllib.parse.rst:473 msgid "" "What constitutes a URL is not universally well defined. Different " "applications have different needs and desired constraints. For instance the " @@ -617,11 +626,11 @@ msgid "" "API behavior changes." msgstr "" -#: library/urllib.parse.rst:476 +#: library/urllib.parse.rst:484 msgid "Parsing ASCII Encoded Bytes" msgstr "" -#: library/urllib.parse.rst:478 +#: library/urllib.parse.rst:486 msgid "" "The URL parsing functions were originally designed to operate on character " "strings only. In practice, it is useful to be able to manipulate properly " @@ -630,14 +639,14 @@ msgid "" "`bytearray` objects in addition to :class:`str` objects." msgstr "" -#: library/urllib.parse.rst:484 +#: library/urllib.parse.rst:492 msgid "" "If :class:`str` data is passed in, the result will also contain only :class:" "`str` data. If :class:`bytes` or :class:`bytearray` data is passed in, the " "result will contain only :class:`bytes` data." msgstr "" -#: library/urllib.parse.rst:488 +#: library/urllib.parse.rst:496 msgid "" "Attempting to mix :class:`str` data with :class:`bytes` or :class:" "`bytearray` in a single function call will result in a :exc:`TypeError` " @@ -645,7 +654,7 @@ msgid "" "trigger :exc:`UnicodeDecodeError`." msgstr "" -#: library/urllib.parse.rst:493 +#: library/urllib.parse.rst:501 msgid "" "To support easier conversion of result objects between :class:`str` and :" "class:`bytes`, all return values from URL parsing functions provide either " @@ -658,14 +667,14 @@ msgid "" "`str` data (for :meth:`decode` methods)." msgstr "" -#: library/urllib.parse.rst:504 +#: library/urllib.parse.rst:512 msgid "" "Applications that need to operate on potentially improperly quoted URLs that " "may contain non-ASCII data will need to do their own decoding from bytes to " "characters before invoking the URL parsing methods." msgstr "" -#: library/urllib.parse.rst:508 +#: library/urllib.parse.rst:516 msgid "" "The behaviour described in this section applies only to the URL parsing " "functions. The URL quoting functions use their own rules when producing or " @@ -673,15 +682,15 @@ msgid "" "URL quoting functions." msgstr "" -#: library/urllib.parse.rst:513 +#: library/urllib.parse.rst:521 msgid "URL parsing functions now accept ASCII encoded byte sequences" msgstr "" -#: library/urllib.parse.rst:520 +#: library/urllib.parse.rst:528 msgid "Structured Parse Results" msgstr "" -#: library/urllib.parse.rst:522 +#: library/urllib.parse.rst:530 msgid "" "The result objects from the :func:`urlparse`, :func:`urlsplit` and :func:" "`urldefrag` functions are subclasses of the :class:`tuple` type. These " @@ -690,7 +699,7 @@ msgid "" "section, as well as an additional method:" msgstr "" -#: library/urllib.parse.rst:530 +#: library/urllib.parse.rst:538 msgid "" "Return the re-combined version of the original URL as a string. This may " "differ from the original URL in that the scheme may be normalized to lower " @@ -698,72 +707,72 @@ msgid "" "queries, and fragment identifiers will be removed." msgstr "" -#: library/urllib.parse.rst:535 +#: library/urllib.parse.rst:543 msgid "" "For :func:`urldefrag` results, only empty fragment identifiers will be " "removed. For :func:`urlsplit` and :func:`urlparse` results, all noted " "changes will be made to the URL returned by this method." msgstr "" -#: library/urllib.parse.rst:539 +#: library/urllib.parse.rst:547 msgid "" "The result of this method remains unchanged if passed back through the " "original parsing function:" msgstr "" -#: library/urllib.parse.rst:552 +#: library/urllib.parse.rst:560 msgid "" "The following classes provide the implementations of the structured parse " "results when operating on :class:`str` objects:" msgstr "" -#: library/urllib.parse.rst:557 +#: library/urllib.parse.rst:565 msgid "" "Concrete class for :func:`urldefrag` results containing :class:`str` data. " "The :meth:`encode` method returns a :class:`DefragResultBytes` instance." msgstr "" -#: library/urllib.parse.rst:565 +#: library/urllib.parse.rst:573 msgid "" "Concrete class for :func:`urlparse` results containing :class:`str` data. " "The :meth:`encode` method returns a :class:`ParseResultBytes` instance." msgstr "" -#: library/urllib.parse.rst:571 +#: library/urllib.parse.rst:579 msgid "" "Concrete class for :func:`urlsplit` results containing :class:`str` data. " "The :meth:`encode` method returns a :class:`SplitResultBytes` instance." msgstr "" -#: library/urllib.parse.rst:576 +#: library/urllib.parse.rst:584 msgid "" "The following classes provide the implementations of the parse results when " "operating on :class:`bytes` or :class:`bytearray` objects:" msgstr "" -#: library/urllib.parse.rst:581 +#: library/urllib.parse.rst:589 msgid "" "Concrete class for :func:`urldefrag` results containing :class:`bytes` data. " "The :meth:`decode` method returns a :class:`DefragResult` instance." msgstr "" -#: library/urllib.parse.rst:589 +#: library/urllib.parse.rst:597 msgid "" "Concrete class for :func:`urlparse` results containing :class:`bytes` data. " "The :meth:`decode` method returns a :class:`ParseResult` instance." msgstr "" -#: library/urllib.parse.rst:597 +#: library/urllib.parse.rst:605 msgid "" "Concrete class for :func:`urlsplit` results containing :class:`bytes` data. " "The :meth:`decode` method returns a :class:`SplitResult` instance." msgstr "" -#: library/urllib.parse.rst:605 +#: library/urllib.parse.rst:613 msgid "URL Quoting" msgstr "" -#: library/urllib.parse.rst:607 +#: library/urllib.parse.rst:615 msgid "" "The URL quoting functions focus on taking program data and making it safe " "for use as URL components by quoting special characters and appropriately " @@ -772,7 +781,7 @@ msgid "" "isn't already covered by the URL parsing functions above." msgstr "" -#: library/urllib.parse.rst:615 +#: library/urllib.parse.rst:623 msgid "" "Replace special characters in *string* using the :samp:`%{xx}` escape. " "Letters, digits, and the characters ``'_.-~'`` are never quoted. By default, " @@ -781,17 +790,17 @@ msgid "" "not be quoted --- its default value is ``'/'``." msgstr "" -#: library/urllib.parse.rst:667 library/urllib.parse.rst:696 +#: library/urllib.parse.rst:675 library/urllib.parse.rst:704 msgid "*string* may be either a :class:`str` or a :class:`bytes` object." msgstr "" -#: library/urllib.parse.rst:623 +#: library/urllib.parse.rst:631 msgid "" "Moved from :rfc:`2396` to :rfc:`3986` for quoting URL strings. \"~\" is now " "included in the set of unreserved characters." msgstr "" -#: library/urllib.parse.rst:627 +#: library/urllib.parse.rst:635 msgid "" "The optional *encoding* and *errors* parameters specify how to deal with non-" "ASCII characters, as accepted by the :meth:`str.encode` method. *encoding* " @@ -801,17 +810,17 @@ msgid "" "`TypeError` is raised." msgstr "" -#: library/urllib.parse.rst:635 +#: library/urllib.parse.rst:643 msgid "" "Note that ``quote(string, safe, encoding, errors)`` is equivalent to " "``quote_from_bytes(string.encode(encoding, errors), safe)``." msgstr "" -#: library/urllib.parse.rst:638 +#: library/urllib.parse.rst:646 msgid "Example: ``quote('/El Niño/')`` yields ``'/El%20Ni%C3%B1o/'``." msgstr "" -#: library/urllib.parse.rst:643 +#: library/urllib.parse.rst:651 msgid "" "Like :func:`quote`, but also replace spaces with plus signs, as required for " "quoting HTML form values when building up a query string to go into a URL. " @@ -819,21 +828,21 @@ msgid "" "*safe*. It also does not have *safe* default to ``'/'``." msgstr "" -#: library/urllib.parse.rst:648 +#: library/urllib.parse.rst:656 msgid "Example: ``quote_plus('/El Niño/')`` yields ``'%2FEl+Ni%C3%B1o%2F'``." msgstr "" -#: library/urllib.parse.rst:653 +#: library/urllib.parse.rst:661 msgid "" "Like :func:`quote`, but accepts a :class:`bytes` object rather than a :class:" "`str`, and does not perform string-to-bytes encoding." msgstr "" -#: library/urllib.parse.rst:656 +#: library/urllib.parse.rst:664 msgid "Example: ``quote_from_bytes(b'a&\\xef')`` yields ``'a%26%EF'``." msgstr "" -#: library/urllib.parse.rst:662 +#: library/urllib.parse.rst:670 msgid "" "Replace :samp:`%{xx}` escapes with their single-character equivalent. The " "optional *encoding* and *errors* parameters specify how to decode percent-" @@ -841,52 +850,52 @@ msgid "" "decode` method." msgstr "" -#: library/urllib.parse.rst:669 +#: library/urllib.parse.rst:677 msgid "" "*encoding* defaults to ``'utf-8'``. *errors* defaults to ``'replace'``, " "meaning invalid sequences are replaced by a placeholder character." msgstr "" -#: library/urllib.parse.rst:673 +#: library/urllib.parse.rst:681 msgid "Example: ``unquote('/El%20Ni%C3%B1o/')`` yields ``'/El Niño/'``." msgstr "" -#: library/urllib.parse.rst:675 +#: library/urllib.parse.rst:683 msgid "" "*string* parameter supports bytes and str objects (previously only str)." msgstr "" -#: library/urllib.parse.rst:683 +#: library/urllib.parse.rst:691 msgid "" "Like :func:`unquote`, but also replace plus signs with spaces, as required " "for unquoting HTML form values." msgstr "" -#: library/urllib.parse.rst:686 +#: library/urllib.parse.rst:694 msgid "*string* must be a :class:`str`." msgstr "" -#: library/urllib.parse.rst:688 +#: library/urllib.parse.rst:696 msgid "Example: ``unquote_plus('/El+Ni%C3%B1o/')`` yields ``'/El Niño/'``." msgstr "" -#: library/urllib.parse.rst:693 +#: library/urllib.parse.rst:701 msgid "" "Replace :samp:`%{xx}` escapes with their single-octet equivalent, and return " "a :class:`bytes` object." msgstr "" -#: library/urllib.parse.rst:698 +#: library/urllib.parse.rst:706 msgid "" "If it is a :class:`str`, unescaped non-ASCII characters in *string* are " "encoded into UTF-8 bytes." msgstr "" -#: library/urllib.parse.rst:701 +#: library/urllib.parse.rst:709 msgid "Example: ``unquote_to_bytes('a%26%EF')`` yields ``b'a&\\xef'``." msgstr "" -#: library/urllib.parse.rst:707 +#: library/urllib.parse.rst:715 msgid "" "Convert a mapping object or a sequence of two-element tuples, which may " "contain :class:`str` or :class:`bytes` objects, to a percent-encoded ASCII " @@ -895,7 +904,7 @@ msgid "" "be encoded to bytes, otherwise it would result in a :exc:`TypeError`." msgstr "" -#: library/urllib.parse.rst:714 +#: library/urllib.parse.rst:722 msgid "" "The resulting string is a series of ``key=value`` pairs separated by ``'&'`` " "characters, where both *key* and *value* are quoted using the *quote_via* " @@ -908,7 +917,7 @@ msgid "" "``quote`` and specify a value for *safe*." msgstr "" -#: library/urllib.parse.rst:724 +#: library/urllib.parse.rst:732 msgid "" "When a sequence of two-element tuples is used as the *query* argument, the " "first element of each tuple is a key and the second is a value. The value " @@ -919,49 +928,49 @@ msgid "" "order of parameter tuples in the sequence." msgstr "" -#: library/urllib.parse.rst:732 +#: library/urllib.parse.rst:740 msgid "" "The *safe*, *encoding*, and *errors* parameters are passed down to " "*quote_via* (the *encoding* and *errors* parameters are only passed when a " "query element is a :class:`str`)." msgstr "" -#: library/urllib.parse.rst:736 +#: library/urllib.parse.rst:744 msgid "" "To reverse this encoding process, :func:`parse_qs` and :func:`parse_qsl` are " "provided in this module to parse query strings into Python data structures." msgstr "" -#: library/urllib.parse.rst:739 +#: library/urllib.parse.rst:747 msgid "" "Refer to :ref:`urllib examples ` to find out how the :func:" "`urllib.parse.urlencode` method can be used for generating the query string " "of a URL or data for a POST request." msgstr "" -#: library/urllib.parse.rst:743 +#: library/urllib.parse.rst:751 msgid "*query* supports bytes and string objects." msgstr "" -#: library/urllib.parse.rst:746 +#: library/urllib.parse.rst:754 msgid "Added the *quote_via* parameter." msgstr "" -#: library/urllib.parse.rst:752 +#: library/urllib.parse.rst:760 msgid "`WHATWG`_ - URL Living standard" msgstr "" -#: library/urllib.parse.rst:753 +#: library/urllib.parse.rst:761 msgid "" "Working Group for the URL Standard that defines URLs, domains, IP addresses, " "the application/x-www-form-urlencoded format, and their API." msgstr "" -#: library/urllib.parse.rst:756 +#: library/urllib.parse.rst:764 msgid ":rfc:`3986` - Uniform Resource Identifiers" msgstr "" -#: library/urllib.parse.rst:757 +#: library/urllib.parse.rst:765 msgid "" "This is the current standard (STD66). Any changes to urllib.parse module " "should conform to this. Certain deviations could be observed, which are " @@ -969,48 +978,48 @@ msgid "" "requirements as commonly observed in major browsers." msgstr "" -#: library/urllib.parse.rst:762 +#: library/urllib.parse.rst:770 msgid ":rfc:`2732` - Format for Literal IPv6 Addresses in URL's." msgstr "" -#: library/urllib.parse.rst:763 +#: library/urllib.parse.rst:771 msgid "This specifies the parsing requirements of IPv6 URLs." msgstr "" -#: library/urllib.parse.rst:765 +#: library/urllib.parse.rst:773 msgid ":rfc:`2396` - Uniform Resource Identifiers (URI): Generic Syntax" msgstr "" -#: library/urllib.parse.rst:766 +#: library/urllib.parse.rst:774 msgid "" "Document describing the generic syntactic requirements for both Uniform " "Resource Names (URNs) and Uniform Resource Locators (URLs)." msgstr "" -#: library/urllib.parse.rst:769 +#: library/urllib.parse.rst:777 msgid ":rfc:`2368` - The mailto URL scheme." msgstr "" -#: library/urllib.parse.rst:770 +#: library/urllib.parse.rst:778 msgid "Parsing requirements for mailto URL schemes." msgstr "" -#: library/urllib.parse.rst:772 +#: library/urllib.parse.rst:780 msgid ":rfc:`1808` - Relative Uniform Resource Locators" msgstr "" -#: library/urllib.parse.rst:773 +#: library/urllib.parse.rst:781 msgid "" "This Request For Comments includes the rules for joining an absolute and a " "relative URL, including a fair number of \"Abnormal Examples\" which govern " "the treatment of border cases." msgstr "" -#: library/urllib.parse.rst:777 +#: library/urllib.parse.rst:785 msgid ":rfc:`1738` - Uniform Resource Locators (URL)" msgstr "" -#: library/urllib.parse.rst:778 +#: library/urllib.parse.rst:786 msgid "This specifies the formal syntax and semantics of absolute URLs." msgstr "" diff --git a/library/urllib.po b/library/urllib.po index 78364396..ab0be4ab 100644 --- a/library/urllib.po +++ b/library/urllib.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" diff --git a/library/urllib.request.po b/library/urllib.request.po index fa8aba82..6a401f66 100644 --- a/library/urllib.request.po +++ b/library/urllib.request.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-02 23:29+0300\n" +"POT-Creation-Date: 2025-05-04 22:06+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -52,9 +52,8 @@ msgstr "" #: includes/wasm-notavail.rst:5 msgid "" -"This module does not work or is not available on WebAssembly platforms " -"``wasm32-emscripten`` and ``wasm32-wasi``. See :ref:`wasm-availability` for " -"more information." +"This module does not work or is not available on WebAssembly. See :ref:`wasm-" +"availability` for more information." msgstr "" #: library/urllib.request.rst:34 @@ -97,25 +96,12 @@ msgstr "" #: library/urllib.request.rst:58 msgid "" -"The optional *cafile* and *capath* parameters specify a set of trusted CA " -"certificates for HTTPS requests. *cafile* should point to a single file " -"containing a bundle of CA certificates, whereas *capath* should point to a " -"directory of hashed certificate files. More information can be found in :" -"meth:`ssl.SSLContext.load_verify_locations`." -msgstr "" - -#: library/urllib.request.rst:64 -msgid "The *cadefault* parameter is ignored." -msgstr "" - -#: library/urllib.request.rst:66 -msgid "" "This function always returns an object which can work as a :term:`context " "manager` and has the properties *url*, *headers*, and *status*. See :class:" "`urllib.response.addinfourl` for more detail on these properties." msgstr "" -#: library/urllib.request.rst:70 +#: library/urllib.request.rst:62 msgid "" "For HTTP and HTTPS URLs, this function returns a :class:`http.client." "HTTPResponse` object slightly modified. In addition to the three new methods " @@ -125,25 +111,25 @@ msgid "" "documentation for :class:`~http.client.HTTPResponse`." msgstr "" -#: library/urllib.request.rst:78 +#: library/urllib.request.rst:70 msgid "" "For FTP, file, and data URLs and requests explicitly handled by legacy :" "class:`URLopener` and :class:`FancyURLopener` classes, this function returns " "a :class:`urllib.response.addinfourl` object." msgstr "" -#: library/urllib.request.rst:82 +#: library/urllib.request.rst:74 msgid "Raises :exc:`~urllib.error.URLError` on protocol errors." msgstr "" -#: library/urllib.request.rst:84 +#: library/urllib.request.rst:76 msgid "" "Note that ``None`` may be returned if no handler handles the request (though " "the default installed global :class:`OpenerDirector` uses :class:" "`UnknownHandler` to ensure this never happens)." msgstr "" -#: library/urllib.request.rst:88 +#: library/urllib.request.rst:80 msgid "" "In addition, if proxy settings are detected (for example, when a ``*_proxy`` " "environment variable like :envvar:`!http_proxy` is set), :class:" @@ -151,7 +137,7 @@ msgid "" "through the proxy." msgstr "" -#: library/urllib.request.rst:93 +#: library/urllib.request.rst:85 msgid "" "The legacy ``urllib.urlopen`` function from Python 2.6 and earlier has been " "discontinued; :func:`urllib.request.urlopen` corresponds to the old " @@ -160,50 +146,49 @@ msgid "" "`ProxyHandler` objects." msgstr "" -#: library/urllib.request.rst:101 +#: library/urllib.request.rst:93 msgid "" "The default opener raises an :ref:`auditing event ` ``urllib." "Request`` with arguments ``fullurl``, ``data``, ``headers``, ``method`` " "taken from the request object." msgstr "" -#: library/urllib.request.rst:105 +#: library/urllib.request.rst:97 msgid "*cafile* and *capath* were added." msgstr "" -#: library/urllib.request.rst:108 +#: library/urllib.request.rst:100 msgid "" "HTTPS virtual hosts are now supported if possible (that is, if :const:`ssl." "HAS_SNI` is true)." msgstr "" -#: library/urllib.request.rst:111 +#: library/urllib.request.rst:103 msgid "*data* can be an iterable object." msgstr "" -#: library/urllib.request.rst:113 +#: library/urllib.request.rst:105 msgid "*cadefault* was added." msgstr "" -#: library/urllib.request.rst:116 +#: library/urllib.request.rst:108 msgid "*context* was added." msgstr "" -#: library/urllib.request.rst:119 +#: library/urllib.request.rst:111 msgid "" "HTTPS connection now send an ALPN extension with protocol indicator " "``http/1.1`` when no *context* is given. Custom *context* should set ALPN " "protocols with :meth:`~ssl.SSLContext.set_alpn_protocols`." msgstr "" -#: library/urllib.request.rst:126 +#: library/urllib.request.rst:116 msgid "" -"*cafile*, *capath* and *cadefault* are deprecated in favor of *context*. " -"Please use :meth:`ssl.SSLContext.load_cert_chain` instead, or let :func:`ssl." -"create_default_context` select the system's trusted CA certificates for you." +"Remove *cafile*, *capath* and *cadefault* parameters: use the *context* " +"parameter instead." msgstr "" -#: library/urllib.request.rst:134 +#: library/urllib.request.rst:123 msgid "" "Install an :class:`OpenerDirector` instance as the default global opener. " "Installing an opener is only necessary if you want urlopen to use that " @@ -212,7 +197,7 @@ msgid "" "`OpenerDirector`, and any class with the appropriate interface will work." msgstr "" -#: library/urllib.request.rst:144 +#: library/urllib.request.rst:133 msgid "" "Return an :class:`OpenerDirector` instance, which chains the handlers in the " "order given. *handler*\\s can be either instances of :class:`BaseHandler`, " @@ -226,19 +211,19 @@ msgid "" "`HTTPErrorProcessor`." msgstr "" -#: library/urllib.request.rst:154 +#: library/urllib.request.rst:143 msgid "" "If the Python installation has SSL support (i.e., if the :mod:`ssl` module " "can be imported), :class:`HTTPSHandler` will also be added." msgstr "" -#: library/urllib.request.rst:157 +#: library/urllib.request.rst:146 msgid "" "A :class:`BaseHandler` subclass may also change its :attr:`handler_order` " "attribute to modify its position in the handlers list." msgstr "" -#: library/urllib.request.rst:163 +#: library/urllib.request.rst:152 msgid "" "Convert the given local path to a ``file:`` URL. This function uses :func:" "`~urllib.parse.quote` function to encode the path. For historical reasons, " @@ -246,7 +231,7 @@ msgid "" "function being used on Windows::" msgstr "" -#: library/urllib.request.rst:168 +#: library/urllib.request.rst:157 msgid "" ">>> from urllib.request import pathname2url\n" ">>> path = 'C:\\\\Program Files'\n" @@ -254,7 +239,7 @@ msgid "" "'file:///C:/Program%20Files'" msgstr "" -#: library/urllib.request.rst:176 +#: library/urllib.request.rst:165 msgid "" "Convert the given ``file:`` URL to a local path. This function uses :func:" "`~urllib.parse.unquote` to decode the URL. For historical reasons, the given " @@ -262,7 +247,7 @@ msgid "" "function being used on Windows::" msgstr "" -#: library/urllib.request.rst:181 +#: library/urllib.request.rst:170 msgid "" ">>> from urllib.request import url2pathname\n" ">>> url = 'file:///C:/Program%20Files'\n" @@ -270,7 +255,7 @@ msgid "" "'C:\\\\Program Files'" msgstr "" -#: library/urllib.request.rst:188 +#: library/urllib.request.rst:177 msgid "" "This helper function returns a dictionary of scheme to proxy server URL " "mappings. It scans the environment for variables named ``_proxy``, " @@ -280,7 +265,7 @@ msgid "" "uppercase environment variables exist (and disagree), lowercase is preferred." msgstr "" -#: library/urllib.request.rst:198 +#: library/urllib.request.rst:187 msgid "" "If the environment variable ``REQUEST_METHOD`` is set, which usually " "indicates your script is running in a CGI environment, the environment " @@ -291,19 +276,19 @@ msgid "" "(or at least the ``_proxy`` suffix)." msgstr "" -#: library/urllib.request.rst:207 +#: library/urllib.request.rst:196 msgid "The following classes are provided:" msgstr "" -#: library/urllib.request.rst:211 +#: library/urllib.request.rst:200 msgid "This class is an abstraction of a URL request." msgstr "" -#: library/urllib.request.rst:213 +#: library/urllib.request.rst:202 msgid "*url* should be a string containing a valid, properly encoded URL." msgstr "" -#: library/urllib.request.rst:215 +#: library/urllib.request.rst:204 msgid "" "*data* must be an object specifying additional data to send to the server, " "or ``None`` if no such data is needed. Currently HTTP requests are the only " @@ -316,7 +301,7 @@ msgid "" "iterables." msgstr "" -#: library/urllib.request.rst:225 +#: library/urllib.request.rst:214 msgid "" "For an HTTP POST request method, *data* should be a buffer in the standard :" "mimetype:`application/x-www-form-urlencoded` format. The :func:`urllib." @@ -325,7 +310,7 @@ msgid "" "being used as the *data* parameter." msgstr "" -#: library/urllib.request.rst:231 +#: library/urllib.request.rst:220 msgid "" "*headers* should be a dictionary, and will be treated as if :meth:" "`add_header` was called with each key and value as arguments. This is often " @@ -338,7 +323,7 @@ msgid "" "case." msgstr "" -#: library/urllib.request.rst:242 +#: library/urllib.request.rst:231 msgid "" "An appropriate ``Content-Type`` header should be included if the *data* " "argument is present. If this header has not been provided and *data* is not " @@ -346,13 +331,13 @@ msgid "" "as a default." msgstr "" -#: library/urllib.request.rst:247 +#: library/urllib.request.rst:236 msgid "" "The next two arguments are only of interest for correct handling of third-" "party HTTP cookies:" msgstr "" -#: library/urllib.request.rst:250 +#: library/urllib.request.rst:239 msgid "" "*origin_req_host* should be the request-host of the origin transaction, as " "defined by :rfc:`2965`. It defaults to ``http.cookiejar." @@ -362,7 +347,7 @@ msgid "" "for the page containing the image." msgstr "" -#: library/urllib.request.rst:258 +#: library/urllib.request.rst:247 msgid "" "*unverifiable* should indicate whether the request is unverifiable, as " "defined by :rfc:`2965`. It defaults to ``False``. An unverifiable request " @@ -371,7 +356,7 @@ msgid "" "option to approve the automatic fetching of the image, this should be true." msgstr "" -#: library/urllib.request.rst:265 +#: library/urllib.request.rst:254 msgid "" "*method* should be a string that indicates the HTTP request method that will " "be used (e.g. ``'HEAD'``). If provided, its value is stored in the :attr:" @@ -381,7 +366,7 @@ msgid "" "attribute in the class itself." msgstr "" -#: library/urllib.request.rst:273 +#: library/urllib.request.rst:262 msgid "" "The request will not work as expected if the data object is unable to " "deliver its content more than once (e.g. a file or an iterable that can " @@ -391,49 +376,49 @@ msgid "" "library." msgstr "" -#: library/urllib.request.rst:280 +#: library/urllib.request.rst:269 msgid ":attr:`Request.method` argument is added to the Request class." msgstr "" -#: library/urllib.request.rst:283 +#: library/urllib.request.rst:272 msgid "Default :attr:`Request.method` may be indicated at the class level." msgstr "" -#: library/urllib.request.rst:286 +#: library/urllib.request.rst:275 msgid "" "Do not raise an error if the ``Content-Length`` has not been provided and " "*data* is neither ``None`` nor a bytes object. Fall back to use chunked " "transfer encoding instead." msgstr "" -#: library/urllib.request.rst:293 +#: library/urllib.request.rst:282 msgid "" "The :class:`OpenerDirector` class opens URLs via :class:`BaseHandler`\\ s " "chained together. It manages the chaining of handlers, and recovery from " "errors." msgstr "" -#: library/urllib.request.rst:299 +#: library/urllib.request.rst:288 msgid "" "This is the base class for all registered handlers --- and handles only the " "simple mechanics of registration." msgstr "" -#: library/urllib.request.rst:305 +#: library/urllib.request.rst:294 msgid "" "A class which defines a default handler for HTTP error responses; all " "responses are turned into :exc:`~urllib.error.HTTPError` exceptions." msgstr "" -#: library/urllib.request.rst:311 +#: library/urllib.request.rst:300 msgid "A class to handle redirections." msgstr "" -#: library/urllib.request.rst:316 +#: library/urllib.request.rst:305 msgid "A class to handle HTTP Cookies." msgstr "" -#: library/urllib.request.rst:321 +#: library/urllib.request.rst:310 msgid "" "Cause requests to go through a proxy. If *proxies* is given, it must be a " "dictionary mapping protocol names to URLs of proxies. The default is to read " @@ -444,11 +429,11 @@ msgid "" "Configuration Framework." msgstr "" -#: library/urllib.request.rst:329 +#: library/urllib.request.rst:318 msgid "To disable autodetected proxy pass an empty dictionary." msgstr "" -#: library/urllib.request.rst:331 +#: library/urllib.request.rst:320 msgid "" "The :envvar:`no_proxy` environment variable can be used to specify hosts " "which shouldn't be reached via proxy; if set, it should be a comma-separated " @@ -456,24 +441,24 @@ msgid "" "``cern.ch,ncsa.uiuc.edu,some.host:8080``." msgstr "" -#: library/urllib.request.rst:338 +#: library/urllib.request.rst:327 msgid "" "``HTTP_PROXY`` will be ignored if a variable ``REQUEST_METHOD`` is set; see " "the documentation on :func:`~urllib.request.getproxies`." msgstr "" -#: library/urllib.request.rst:344 +#: library/urllib.request.rst:333 msgid "Keep a database of ``(realm, uri) -> (user, password)`` mappings." msgstr "" -#: library/urllib.request.rst:349 +#: library/urllib.request.rst:338 msgid "" "Keep a database of ``(realm, uri) -> (user, password)`` mappings. A realm " "of ``None`` is considered a catch-all realm, which is searched if no other " "realm fits." msgstr "" -#: library/urllib.request.rst:356 +#: library/urllib.request.rst:345 msgid "" "A variant of :class:`HTTPPasswordMgrWithDefaultRealm` that also has a " "database of ``uri -> is_authenticated`` mappings. Can be used by a " @@ -481,7 +466,7 @@ msgid "" "immediately instead of waiting for a ``401`` response first." msgstr "" -#: library/urllib.request.rst:366 +#: library/urllib.request.rst:355 msgid "" "This is a mixin class that helps with HTTP authentication, both to the " "remote host and to a proxy. *password_mgr*, if given, should be something " @@ -500,11 +485,11 @@ msgid "" "will automatically include the authentication credentials." msgstr "" -#: library/urllib.request.rst:383 +#: library/urllib.request.rst:372 msgid "Added ``is_authenticated`` support." msgstr "" -#: library/urllib.request.rst:389 +#: library/urllib.request.rst:378 msgid "" "Handle authentication with the remote host. *password_mgr*, if given, should " "be something that is compatible with :class:`HTTPPasswordMgr`; refer to " @@ -513,7 +498,7 @@ msgid "" "presented with a wrong Authentication scheme." msgstr "" -#: library/urllib.request.rst:432 +#: library/urllib.request.rst:421 msgid "" "Handle authentication with the proxy. *password_mgr*, if given, should be " "something that is compatible with :class:`HTTPPasswordMgr`; refer to " @@ -521,7 +506,7 @@ msgid "" "be supported." msgstr "" -#: library/urllib.request.rst:406 +#: library/urllib.request.rst:395 msgid "" "This is a mixin class that helps with HTTP authentication, both to the " "remote host and to a proxy. *password_mgr*, if given, should be something " @@ -529,7 +514,7 @@ msgid "" "`http-password-mgr` for information on the interface that must be supported." msgstr "" -#: library/urllib.request.rst:415 +#: library/urllib.request.rst:404 msgid "" "Handle authentication with the remote host. *password_mgr*, if given, should " "be something that is compatible with :class:`HTTPPasswordMgr`; refer to " @@ -542,108 +527,108 @@ msgid "" "Digest or Basic." msgstr "" -#: library/urllib.request.rst:425 +#: library/urllib.request.rst:414 msgid "Raise :exc:`ValueError` on unsupported Authentication Scheme." msgstr "" -#: library/urllib.request.rst:440 +#: library/urllib.request.rst:429 msgid "A class to handle opening of HTTP URLs." msgstr "" -#: library/urllib.request.rst:445 +#: library/urllib.request.rst:434 msgid "" "A class to handle opening of HTTPS URLs. *context* and *check_hostname* " "have the same meaning as in :class:`http.client.HTTPSConnection`." msgstr "" -#: library/urllib.request.rst:448 +#: library/urllib.request.rst:437 msgid "*context* and *check_hostname* were added." msgstr "" -#: library/urllib.request.rst:454 +#: library/urllib.request.rst:443 msgid "Open local files." msgstr "" -#: library/urllib.request.rst:458 +#: library/urllib.request.rst:447 msgid "Open data URLs." msgstr "" -#: library/urllib.request.rst:464 +#: library/urllib.request.rst:453 msgid "Open FTP URLs." msgstr "" -#: library/urllib.request.rst:469 +#: library/urllib.request.rst:458 msgid "" "Open FTP URLs, keeping a cache of open FTP connections to minimize delays." msgstr "" -#: library/urllib.request.rst:474 +#: library/urllib.request.rst:463 msgid "A catch-all class to handle unknown URLs." msgstr "" -#: library/urllib.request.rst:1185 +#: library/urllib.request.rst:1174 msgid "Process HTTP error responses." msgstr "" -#: library/urllib.request.rst:485 +#: library/urllib.request.rst:474 msgid "Request Objects" msgstr "" -#: library/urllib.request.rst:487 +#: library/urllib.request.rst:476 msgid "" "The following methods describe :class:`Request`'s public interface, and so " "all may be overridden in subclasses. It also defines several public " "attributes that can be used by clients to inspect the parsed request." msgstr "" -#: library/urllib.request.rst:494 +#: library/urllib.request.rst:483 msgid "The original URL passed to the constructor." msgstr "" -#: library/urllib.request.rst:498 +#: library/urllib.request.rst:487 msgid "" "Request.full_url is a property with setter, getter and a deleter. Getting :" "attr:`~Request.full_url` returns the original request URL with the fragment, " "if it was present." msgstr "" -#: library/urllib.request.rst:504 +#: library/urllib.request.rst:493 msgid "The URI scheme." msgstr "" -#: library/urllib.request.rst:508 +#: library/urllib.request.rst:497 msgid "" "The URI authority, typically a host, but may also contain a port separated " "by a colon." msgstr "" -#: library/urllib.request.rst:513 +#: library/urllib.request.rst:502 msgid "The original host for the request, without port." msgstr "" -#: library/urllib.request.rst:517 +#: library/urllib.request.rst:506 msgid "" "The URI path. If the :class:`Request` uses a proxy, then selector will be " "the full URL that is passed to the proxy." msgstr "" -#: library/urllib.request.rst:522 +#: library/urllib.request.rst:511 msgid "The entity body for the request, or ``None`` if not specified." msgstr "" -#: library/urllib.request.rst:524 +#: library/urllib.request.rst:513 msgid "" "Changing value of :attr:`Request.data` now deletes \"Content-Length\" header " "if it was previously set or calculated." msgstr "" -#: library/urllib.request.rst:530 +#: library/urllib.request.rst:519 msgid "" "boolean, indicates whether the request is unverifiable as defined by :rfc:" "`2965`." msgstr "" -#: library/urllib.request.rst:535 +#: library/urllib.request.rst:524 msgid "" "The HTTP request method to use. By default its value is :const:`None`, " "which means that :meth:`~Request.get_method` will do its normal computation " @@ -654,13 +639,13 @@ msgid "" "argument." msgstr "" -#: library/urllib.request.rst:545 +#: library/urllib.request.rst:534 msgid "" "A default value can now be set in subclasses; previously it could only be " "set via the constructor argument." msgstr "" -#: library/urllib.request.rst:552 +#: library/urllib.request.rst:541 msgid "" "Return a string indicating the HTTP request method. If :attr:`Request." "method` is not ``None``, return its value, otherwise return ``'GET'`` if :" @@ -668,11 +653,11 @@ msgid "" "meaningful for HTTP requests." msgstr "" -#: library/urllib.request.rst:557 +#: library/urllib.request.rst:546 msgid "get_method now looks at the value of :attr:`Request.method`." msgstr "" -#: library/urllib.request.rst:563 +#: library/urllib.request.rst:552 msgid "" "Add another header to the request. Headers are currently ignored by all " "handlers except HTTP handlers, where they are added to the list of headers " @@ -684,64 +669,64 @@ msgid "" "headers added using this method are also added to redirected requests." msgstr "" -#: library/urllib.request.rst:575 +#: library/urllib.request.rst:564 msgid "Add a header that will not be added to a redirected request." msgstr "" -#: library/urllib.request.rst:580 +#: library/urllib.request.rst:569 msgid "" "Return whether the instance has the named header (checks both regular and " "unredirected)." msgstr "" -#: library/urllib.request.rst:586 +#: library/urllib.request.rst:575 msgid "" "Remove named header from the request instance (both from regular and " "unredirected headers)." msgstr "" -#: library/urllib.request.rst:594 +#: library/urllib.request.rst:583 msgid "Return the URL given in the constructor." msgstr "" -#: library/urllib.request.rst:598 +#: library/urllib.request.rst:587 msgid "Returns :attr:`Request.full_url`" msgstr "" -#: library/urllib.request.rst:603 +#: library/urllib.request.rst:592 msgid "" "Prepare the request by connecting to a proxy server. The *host* and *type* " "will replace those of the instance, and the instance's selector will be the " "original URL given in the constructor." msgstr "" -#: library/urllib.request.rst:610 +#: library/urllib.request.rst:599 msgid "" "Return the value of the given header. If the header is not present, return " "the default value." msgstr "" -#: library/urllib.request.rst:616 +#: library/urllib.request.rst:605 msgid "" "Return a list of tuples (header_name, header_value) of the Request headers." msgstr "" -#: library/urllib.request.rst:618 +#: library/urllib.request.rst:607 msgid "" "The request methods add_data, has_data, get_data, get_type, get_host, " "get_selector, get_origin_req_host and is_unverifiable that were deprecated " "since 3.3 have been removed." msgstr "" -#: library/urllib.request.rst:627 +#: library/urllib.request.rst:616 msgid "OpenerDirector Objects" msgstr "" -#: library/urllib.request.rst:629 +#: library/urllib.request.rst:618 msgid ":class:`OpenerDirector` instances have the following methods:" msgstr "" -#: library/urllib.request.rst:634 +#: library/urllib.request.rst:623 msgid "" "*handler* should be an instance of :class:`BaseHandler`. The following " "methods are searched, and added to the possible chains (note that HTTP " @@ -752,53 +737,53 @@ msgid "" "`http_error_404` would handle HTTP 404 errors." msgstr "" -#: library/urllib.request.rst:642 +#: library/urllib.request.rst:631 msgid "" ":meth:`!_open` --- signal that the handler knows how to open " "*protocol* URLs." msgstr "" -#: library/urllib.request.rst:645 +#: library/urllib.request.rst:634 msgid "See |protocol_open|_ for more information." msgstr "" -#: library/urllib.request.rst:647 +#: library/urllib.request.rst:636 msgid "" ":meth:`!http_error_\\` --- signal that the handler knows how to " "handle HTTP errors with HTTP error code *type*." msgstr "" -#: library/urllib.request.rst:650 +#: library/urllib.request.rst:639 msgid "See |http_error_nnn|_ for more information." msgstr "" -#: library/urllib.request.rst:652 +#: library/urllib.request.rst:641 msgid "" ":meth:`!_error` --- signal that the handler knows how to handle " "errors from (non-\\ ``http``) *protocol*." msgstr "" -#: library/urllib.request.rst:655 +#: library/urllib.request.rst:644 msgid "" ":meth:`!_request` --- signal that the handler knows how to pre-" "process *protocol* requests." msgstr "" -#: library/urllib.request.rst:658 +#: library/urllib.request.rst:647 msgid "See |protocol_request|_ for more information." msgstr "" -#: library/urllib.request.rst:660 +#: library/urllib.request.rst:649 msgid "" ":meth:`!_response` --- signal that the handler knows how to post-" "process *protocol* responses." msgstr "" -#: library/urllib.request.rst:663 +#: library/urllib.request.rst:652 msgid "See |protocol_response|_ for more information." msgstr "" -#: library/urllib.request.rst:672 +#: library/urllib.request.rst:661 msgid "" "Open the given *url* (which can be a request object or a string), optionally " "passing the given *data*. Arguments, return values and exceptions raised are " @@ -810,7 +795,7 @@ msgid "" "HTTP, HTTPS and FTP connections." msgstr "" -#: library/urllib.request.rst:684 +#: library/urllib.request.rst:673 msgid "" "Handle an error of the given protocol. This will call the registered error " "handlers for the given protocol with the given arguments (which are protocol " @@ -819,28 +804,28 @@ msgid "" "http_error_\\` methods of the handler classes." msgstr "" -#: library/urllib.request.rst:690 +#: library/urllib.request.rst:679 msgid "" "Return values and exceptions raised are the same as those of :func:`urlopen`." msgstr "" -#: library/urllib.request.rst:692 +#: library/urllib.request.rst:681 msgid "OpenerDirector objects open URLs in three stages:" msgstr "" -#: library/urllib.request.rst:694 +#: library/urllib.request.rst:683 msgid "" "The order in which these methods are called within each stage is determined " "by sorting the handler instances." msgstr "" -#: library/urllib.request.rst:697 +#: library/urllib.request.rst:686 msgid "" "Every handler with a method named like :meth:`!_request` has that " "method called to pre-process the request." msgstr "" -#: library/urllib.request.rst:700 +#: library/urllib.request.rst:689 msgid "" "Handlers with a method named like :meth:`!_open` are called to " "handle the request. This stage ends when a handler either returns a non-\\ :" @@ -848,7 +833,7 @@ msgid "" "`~urllib.error.URLError`). Exceptions are allowed to propagate." msgstr "" -#: library/urllib.request.rst:705 +#: library/urllib.request.rst:694 msgid "" "In fact, the above algorithm is first tried for methods named :meth:" "`~BaseHandler.default_open`. If all such methods return :const:`None`, the " @@ -857,64 +842,64 @@ msgid "" "named :meth:`~BaseHandler.unknown_open`." msgstr "" -#: library/urllib.request.rst:711 +#: library/urllib.request.rst:700 msgid "" "Note that the implementation of these methods may involve calls of the " "parent :class:`OpenerDirector` instance's :meth:`~OpenerDirector.open` and :" "meth:`~OpenerDirector.error` methods." msgstr "" -#: library/urllib.request.rst:715 +#: library/urllib.request.rst:704 msgid "" "Every handler with a method named like :meth:`!_response` has that " "method called to post-process the response." msgstr "" -#: library/urllib.request.rst:722 +#: library/urllib.request.rst:711 msgid "BaseHandler Objects" msgstr "" -#: library/urllib.request.rst:724 +#: library/urllib.request.rst:713 msgid "" ":class:`BaseHandler` objects provide a couple of methods that are directly " "useful, and others that are meant to be used by derived classes. These are " "intended for direct use:" msgstr "" -#: library/urllib.request.rst:731 +#: library/urllib.request.rst:720 msgid "Add a director as parent." msgstr "" -#: library/urllib.request.rst:736 +#: library/urllib.request.rst:725 msgid "Remove any parents." msgstr "" -#: library/urllib.request.rst:738 +#: library/urllib.request.rst:727 msgid "" "The following attribute and methods should only be used by classes derived " "from :class:`BaseHandler`." msgstr "" -#: library/urllib.request.rst:743 +#: library/urllib.request.rst:732 msgid "" "The convention has been adopted that subclasses defining :meth:`!" "_request` or :meth:`!_response` methods are named :class:" "`!\\*Processor`; all others are named :class:`!\\*Handler`." msgstr "" -#: library/urllib.request.rst:750 +#: library/urllib.request.rst:739 msgid "" "A valid :class:`OpenerDirector`, which can be used to open using a different " "protocol, or handle errors." msgstr "" -#: library/urllib.request.rst:756 +#: library/urllib.request.rst:745 msgid "" "This method is *not* defined in :class:`BaseHandler`, but subclasses should " "define it if they want to catch all URLs." msgstr "" -#: library/urllib.request.rst:759 +#: library/urllib.request.rst:748 msgid "" "This method, if implemented, will be called by the parent :class:" "`OpenerDirector`. It should return a file-like object as described in the " @@ -924,38 +909,38 @@ msgid "" "`MemoryError` should not be mapped to :exc:`~urllib.error.URLError`)." msgstr "" -#: library/urllib.request.rst:766 +#: library/urllib.request.rst:755 msgid "This method will be called before any protocol-specific open method." msgstr "" -#: library/urllib.request.rst:773 +#: library/urllib.request.rst:762 msgid "" "This method is *not* defined in :class:`BaseHandler`, but subclasses should " "define it if they want to handle URLs with the given protocol." msgstr "" -#: library/urllib.request.rst:776 +#: library/urllib.request.rst:765 msgid "" "This method, if defined, will be called by the parent :class:" "`OpenerDirector`. Return values should be the same as for :meth:" "`~BaseHandler.default_open`." msgstr "" -#: library/urllib.request.rst:782 +#: library/urllib.request.rst:771 msgid "" "This method is *not* defined in :class:`BaseHandler`, but subclasses should " "define it if they want to catch all URLs with no specific registered handler " "to open it." msgstr "" -#: library/urllib.request.rst:786 +#: library/urllib.request.rst:775 msgid "" "This method, if implemented, will be called by the :attr:`parent` :class:" "`OpenerDirector`. Return values should be the same as for :meth:" "`default_open`." msgstr "" -#: library/urllib.request.rst:793 +#: library/urllib.request.rst:782 msgid "" "This method is *not* defined in :class:`BaseHandler`, but subclasses should " "override it if they intend to provide a catch-all for otherwise unhandled " @@ -964,7 +949,7 @@ msgid "" "other circumstances." msgstr "" -#: library/urllib.request.rst:798 +#: library/urllib.request.rst:787 msgid "" "*req* will be a :class:`Request` object, *fp* will be a file-like object " "with the HTTP error body, *code* will be the three-digit code of the error, " @@ -972,49 +957,49 @@ msgid "" "mapping object with the headers of the error." msgstr "" -#: library/urllib.request.rst:803 +#: library/urllib.request.rst:792 msgid "" "Return values and exceptions raised should be the same as those of :func:" "`urlopen`." msgstr "" -#: library/urllib.request.rst:810 +#: library/urllib.request.rst:799 msgid "" "*nnn* should be a three-digit HTTP error code. This method is also not " "defined in :class:`BaseHandler`, but will be called, if it exists, on an " "instance of a subclass, when an HTTP error with code *nnn* occurs." msgstr "" -#: library/urllib.request.rst:814 +#: library/urllib.request.rst:803 msgid "Subclasses should override this method to handle specific HTTP errors." msgstr "" -#: library/urllib.request.rst:816 +#: library/urllib.request.rst:805 msgid "" "Arguments, return values and exceptions raised should be the same as for :" "meth:`~BaseHandler.http_error_default`." msgstr "" -#: library/urllib.request.rst:824 +#: library/urllib.request.rst:813 msgid "" "This method is *not* defined in :class:`BaseHandler`, but subclasses should " "define it if they want to pre-process requests of the given protocol." msgstr "" -#: library/urllib.request.rst:827 +#: library/urllib.request.rst:816 msgid "" "This method, if defined, will be called by the parent :class:" "`OpenerDirector`. *req* will be a :class:`Request` object. The return value " "should be a :class:`Request` object." msgstr "" -#: library/urllib.request.rst:836 +#: library/urllib.request.rst:825 msgid "" "This method is *not* defined in :class:`BaseHandler`, but subclasses should " "define it if they want to post-process responses of the given protocol." msgstr "" -#: library/urllib.request.rst:839 +#: library/urllib.request.rst:828 msgid "" "This method, if defined, will be called by the parent :class:" "`OpenerDirector`. *req* will be a :class:`Request` object. *response* will " @@ -1023,25 +1008,25 @@ msgid "" "return value of :func:`urlopen`." msgstr "" -#: library/urllib.request.rst:849 +#: library/urllib.request.rst:838 msgid "HTTPRedirectHandler Objects" msgstr "" -#: library/urllib.request.rst:853 +#: library/urllib.request.rst:842 msgid "" "Some HTTP redirections require action from this module's client code. If " "this is the case, :exc:`~urllib.error.HTTPError` is raised. See :rfc:`2616` " "for details of the precise meanings of the various redirection codes." msgstr "" -#: library/urllib.request.rst:857 +#: library/urllib.request.rst:846 msgid "" "An :exc:`~urllib.error.HTTPError` exception raised as a security " "consideration if the HTTPRedirectHandler is presented with a redirected URL " "which is not an HTTP, HTTPS or FTP URL." msgstr "" -#: library/urllib.request.rst:864 +#: library/urllib.request.rst:853 msgid "" "Return a :class:`Request` or ``None`` in response to a redirect. This is " "called by the default implementations of the :meth:`!http_error_30\\*` " @@ -1052,7 +1037,7 @@ msgid "" "URL, or return ``None`` if you can't but another handler might." msgstr "" -#: library/urllib.request.rst:874 +#: library/urllib.request.rst:863 msgid "" "The default implementation of this method does not strictly follow :rfc:" "`2616`, which says that 301 and 302 responses to ``POST`` requests must not " @@ -1061,54 +1046,54 @@ msgid "" "POST to a ``GET``, and the default implementation reproduces this behavior." msgstr "" -#: library/urllib.request.rst:883 +#: library/urllib.request.rst:872 msgid "" "Redirect to the ``Location:`` or ``URI:`` URL. This method is called by the " "parent :class:`OpenerDirector` when getting an HTTP 'moved permanently' " "response." msgstr "" -#: library/urllib.request.rst:889 +#: library/urllib.request.rst:878 msgid "" "The same as :meth:`http_error_301`, but called for the 'found' response." msgstr "" -#: library/urllib.request.rst:894 +#: library/urllib.request.rst:883 msgid "" "The same as :meth:`http_error_301`, but called for the 'see other' response." msgstr "" -#: library/urllib.request.rst:899 +#: library/urllib.request.rst:888 msgid "" "The same as :meth:`http_error_301`, but called for the 'temporary redirect' " "response. It does not allow changing the request method from ``POST`` to " "``GET``." msgstr "" -#: library/urllib.request.rst:906 +#: library/urllib.request.rst:895 msgid "" "The same as :meth:`http_error_301`, but called for the 'permanent redirect' " "response. It does not allow changing the request method from ``POST`` to " "``GET``." msgstr "" -#: library/urllib.request.rst:916 +#: library/urllib.request.rst:905 msgid "HTTPCookieProcessor Objects" msgstr "" -#: library/urllib.request.rst:918 +#: library/urllib.request.rst:907 msgid ":class:`HTTPCookieProcessor` instances have one attribute:" msgstr "" -#: library/urllib.request.rst:922 +#: library/urllib.request.rst:911 msgid "The :class:`http.cookiejar.CookieJar` in which cookies are stored." msgstr "" -#: library/urllib.request.rst:928 +#: library/urllib.request.rst:917 msgid "ProxyHandler Objects" msgstr "" -#: library/urllib.request.rst:934 +#: library/urllib.request.rst:923 msgid "" "The :class:`ProxyHandler` will have a method :meth:`!_open` for " "every *protocol* which has a proxy in the *proxies* dictionary given in the " @@ -1117,17 +1102,17 @@ msgid "" "actually execute the protocol." msgstr "" -#: library/urllib.request.rst:944 +#: library/urllib.request.rst:933 msgid "HTTPPasswordMgr Objects" msgstr "" -#: library/urllib.request.rst:946 +#: library/urllib.request.rst:935 msgid "" "These methods are available on :class:`HTTPPasswordMgr` and :class:" "`HTTPPasswordMgrWithDefaultRealm` objects." msgstr "" -#: library/urllib.request.rst:952 +#: library/urllib.request.rst:941 msgid "" "*uri* can be either a single URI, or a sequence of URIs. *realm*, *user* and " "*passwd* must be strings. This causes ``(user, passwd)`` to be used as " @@ -1135,30 +1120,30 @@ msgid "" "of the given URIs is given." msgstr "" -#: library/urllib.request.rst:960 +#: library/urllib.request.rst:949 msgid "" "Get user/password for given realm and URI, if any. This method will return " "``(None, None)`` if there is no matching user/password." msgstr "" -#: library/urllib.request.rst:963 +#: library/urllib.request.rst:952 msgid "" "For :class:`HTTPPasswordMgrWithDefaultRealm` objects, the realm ``None`` " "will be searched if the given *realm* has no matching user/password." msgstr "" -#: library/urllib.request.rst:970 +#: library/urllib.request.rst:959 msgid "HTTPPasswordMgrWithPriorAuth Objects" msgstr "" -#: library/urllib.request.rst:972 +#: library/urllib.request.rst:961 msgid "" "This password manager extends :class:`HTTPPasswordMgrWithDefaultRealm` to " "support tracking URIs for which authentication credentials should always be " "sent." msgstr "" -#: library/urllib.request.rst:979 +#: library/urllib.request.rst:968 msgid "" "*realm*, *uri*, *user*, *passwd* are as for :meth:`HTTPPasswordMgr." "add_password`. *is_authenticated* sets the initial value of the " @@ -1166,25 +1151,25 @@ msgid "" "*is_authenticated* is specified as ``True``, *realm* is ignored." msgstr "" -#: library/urllib.request.rst:987 +#: library/urllib.request.rst:976 msgid "Same as for :class:`HTTPPasswordMgrWithDefaultRealm` objects" msgstr "" -#: library/urllib.request.rst:993 +#: library/urllib.request.rst:982 msgid "" "Update the ``is_authenticated`` flag for the given *uri* or list of URIs." msgstr "" -#: library/urllib.request.rst:999 +#: library/urllib.request.rst:988 msgid "" "Returns the current state of the ``is_authenticated`` flag for the given URI." msgstr "" -#: library/urllib.request.rst:1006 +#: library/urllib.request.rst:995 msgid "AbstractBasicAuthHandler Objects" msgstr "" -#: library/urllib.request.rst:1011 +#: library/urllib.request.rst:1000 msgid "" "Handle an authentication request by getting a user/password pair, and re-" "trying the request. *authreq* should be the name of the header where the " @@ -1193,7 +1178,7 @@ msgid "" "`Request` object, and *headers* should be the error headers." msgstr "" -#: library/urllib.request.rst:1017 +#: library/urllib.request.rst:1006 msgid "" "*host* is either an authority (e.g. ``\"python.org\"``) or a URL containing " "an authority component (e.g. ``\"http://python.org/\"``). In either case, " @@ -1201,24 +1186,24 @@ msgid "" "and ``\"python.org:80\"`` are fine, ``\"joe:password@python.org\"`` is not)." msgstr "" -#: library/urllib.request.rst:1026 +#: library/urllib.request.rst:1015 msgid "HTTPBasicAuthHandler Objects" msgstr "" -#: library/urllib.request.rst:1031 library/urllib.request.rst:1042 -#: library/urllib.request.rst:1067 library/urllib.request.rst:1078 +#: library/urllib.request.rst:1020 library/urllib.request.rst:1031 +#: library/urllib.request.rst:1056 library/urllib.request.rst:1067 msgid "Retry the request with authentication information, if available." msgstr "" -#: library/urllib.request.rst:1037 +#: library/urllib.request.rst:1026 msgid "ProxyBasicAuthHandler Objects" msgstr "" -#: library/urllib.request.rst:1048 +#: library/urllib.request.rst:1037 msgid "AbstractDigestAuthHandler Objects" msgstr "" -#: library/urllib.request.rst:1053 +#: library/urllib.request.rst:1042 msgid "" "*authreq* should be the name of the header where the information about the " "realm is included in the request, *host* should be the host to authenticate " @@ -1226,55 +1211,55 @@ msgid "" "should be the error headers." msgstr "" -#: library/urllib.request.rst:1062 +#: library/urllib.request.rst:1051 msgid "HTTPDigestAuthHandler Objects" msgstr "" -#: library/urllib.request.rst:1073 +#: library/urllib.request.rst:1062 msgid "ProxyDigestAuthHandler Objects" msgstr "" -#: library/urllib.request.rst:1084 +#: library/urllib.request.rst:1073 msgid "HTTPHandler Objects" msgstr "" -#: library/urllib.request.rst:1089 +#: library/urllib.request.rst:1078 msgid "" "Send an HTTP request, which can be either GET or POST, depending on ``req." "has_data()``." msgstr "" -#: library/urllib.request.rst:1096 +#: library/urllib.request.rst:1085 msgid "HTTPSHandler Objects" msgstr "" -#: library/urllib.request.rst:1101 +#: library/urllib.request.rst:1090 msgid "" "Send an HTTPS request, which can be either GET or POST, depending on ``req." "has_data()``." msgstr "" -#: library/urllib.request.rst:1108 +#: library/urllib.request.rst:1097 msgid "FileHandler Objects" msgstr "" -#: library/urllib.request.rst:1113 +#: library/urllib.request.rst:1102 msgid "" "Open the file locally, if there is no host name, or the host name is " "``'localhost'``." msgstr "" -#: library/urllib.request.rst:1116 +#: library/urllib.request.rst:1105 msgid "" "This method is applicable only for local hostnames. When a remote hostname " "is given, a :exc:`~urllib.error.URLError` is raised." msgstr "" -#: library/urllib.request.rst:1124 +#: library/urllib.request.rst:1113 msgid "DataHandler Objects" msgstr "" -#: library/urllib.request.rst:1128 +#: library/urllib.request.rst:1117 msgid "" "Read a data URL. This kind of URL contains the content encoded in the URL " "itself. The data URL syntax is specified in :rfc:`2397`. This implementation " @@ -1284,51 +1269,51 @@ msgid "" "implementation will raise a :exc:`ValueError` in that case." msgstr "" -#: library/urllib.request.rst:1139 +#: library/urllib.request.rst:1128 msgid "FTPHandler Objects" msgstr "" -#: library/urllib.request.rst:1144 +#: library/urllib.request.rst:1133 msgid "" "Open the FTP file indicated by *req*. The login is always done with empty " "username and password." msgstr "" -#: library/urllib.request.rst:1151 +#: library/urllib.request.rst:1140 msgid "CacheFTPHandler Objects" msgstr "" -#: library/urllib.request.rst:1153 +#: library/urllib.request.rst:1142 msgid "" ":class:`CacheFTPHandler` objects are :class:`FTPHandler` objects with the " "following additional methods:" msgstr "" -#: library/urllib.request.rst:1159 +#: library/urllib.request.rst:1148 msgid "Set timeout of connections to *t* seconds." msgstr "" -#: library/urllib.request.rst:1164 +#: library/urllib.request.rst:1153 msgid "Set maximum number of cached connections to *m*." msgstr "" -#: library/urllib.request.rst:1170 +#: library/urllib.request.rst:1159 msgid "UnknownHandler Objects" msgstr "" -#: library/urllib.request.rst:1175 +#: library/urllib.request.rst:1164 msgid "Raise a :exc:`~urllib.error.URLError` exception." msgstr "" -#: library/urllib.request.rst:1181 +#: library/urllib.request.rst:1170 msgid "HTTPErrorProcessor Objects" msgstr "" -#: library/urllib.request.rst:1187 +#: library/urllib.request.rst:1176 msgid "For 200 error codes, the response object is returned immediately." msgstr "" -#: library/urllib.request.rst:1189 +#: library/urllib.request.rst:1178 msgid "" "For non-200 error codes, this simply passes the job on to the :meth:`!" "http_error_\\` handler methods, via :meth:`OpenerDirector.error`. " @@ -1336,31 +1321,31 @@ msgid "" "error.HTTPError` if no other handler handles the error." msgstr "" -#: library/urllib.request.rst:1197 +#: library/urllib.request.rst:1186 msgid "Process HTTPS error responses." msgstr "" -#: library/urllib.request.rst:1199 +#: library/urllib.request.rst:1188 msgid "The behavior is same as :meth:`http_response`." msgstr "" -#: library/urllib.request.rst:1205 +#: library/urllib.request.rst:1194 msgid "Examples" msgstr "" -#: library/urllib.request.rst:1207 +#: library/urllib.request.rst:1196 msgid "" "In addition to the examples below, more examples are given in :ref:`urllib-" "howto`." msgstr "" -#: library/urllib.request.rst:1210 +#: library/urllib.request.rst:1199 msgid "" "This example gets the python.org main page and displays the first 300 bytes " "of it::" msgstr "" -#: library/urllib.request.rst:1213 +#: library/urllib.request.rst:1202 msgid "" ">>> import urllib.request\n" ">>> with urllib.request.urlopen('http://www.python.org/') as f:\n" @@ -1372,7 +1357,7 @@ msgid "" "class=\"no-js ie8 lt-ie9\">" msgstr "" -#: library/urllib.request.rst:1219 +#: library/urllib.request.rst:1208 msgid "" "Note that urlopen returns a bytes object. This is because there is no way " "for urlopen to automatically determine the encoding of the byte stream it " @@ -1381,26 +1366,26 @@ msgid "" "appropriate encoding." msgstr "" -#: library/urllib.request.rst:1225 +#: library/urllib.request.rst:1214 msgid "" "The following HTML spec document, https://html.spec.whatwg.org/#charset, " "lists the various ways in which an HTML or an XML document could have " "specified its encoding information." msgstr "" -#: library/urllib.request.rst:1229 +#: library/urllib.request.rst:1218 msgid "" "For additional information, see the W3C document: https://www.w3.org/" "International/questions/qa-html-encoding-declarations." msgstr "" -#: library/urllib.request.rst:1231 +#: library/urllib.request.rst:1220 msgid "" "As the python.org website uses *utf-8* encoding as specified in its meta " "tag, we will use the same for decoding the bytes object::" msgstr "" -#: library/urllib.request.rst:1234 +#: library/urllib.request.rst:1223 msgid "" ">>> with urllib.request.urlopen('http://www.python.org/') as f:\n" "... print(f.read(100).decode('utf-8'))\n" @@ -1411,13 +1396,13 @@ msgid "" ">> import urllib.request\n" ">>> f = urllib.request.urlopen('http://www.python.org/')\n" @@ -1432,14 +1417,14 @@ msgid "" "