|
1 | 1 | # SOME DESCRIPTIVE TITLE. |
2 | | -# Copyright (C) 2001-2019, Python Software Foundation |
| 2 | +# Copyright (C) 2001 Python Software Foundation |
3 | 3 | # This file is distributed under the same license as the Python package. |
4 | 4 | # FIRST AUTHOR <EMAIL@ADDRESS>, YEAR. |
5 | 5 | # |
6 | 6 | #, fuzzy |
7 | 7 | msgid "" |
8 | 8 | msgstr "" |
9 | | -"Project-Id-Version: Python 3.8\n" |
| 9 | +"Project-Id-Version: Python 3.14\n" |
10 | 10 | "Report-Msgid-Bugs-To: \n" |
11 | | -"POT-Creation-Date: 2019-09-01 14:24+0000\n" |
12 | | -"PO-Revision-Date: 2017-02-16 17:39+0000\n" |
13 | | -"Language-Team: Indonesian (https://www.transifex.com/python-doc/teams/5390/id/)\n" |
| 11 | +"POT-Creation-Date: 2025-05-09 14:19+0000\n" |
| 12 | +"PO-Revision-Date: 2021-06-28 00:50+0000\n" |
| 13 | +"Language-Team: Indonesian (https://app.transifex.com/python-doc/teams/5390/id/)\n" |
14 | 14 | "MIME-Version: 1.0\n" |
15 | 15 | "Content-Type: text/plain; charset=UTF-8\n" |
16 | 16 | "Content-Transfer-Encoding: 8bit\n" |
17 | 17 | "Language: id\n" |
18 | 18 | "Plural-Forms: nplurals=1; plural=0;\n" |
19 | 19 |
|
20 | 20 | #: ../../c-api/stable.rst:7 |
21 | | -msgid "Stable Application Binary Interface" |
| 21 | +msgid "C API Stability" |
22 | 22 | msgstr "" |
23 | 23 |
|
24 | 24 | #: ../../c-api/stable.rst:9 |
25 | 25 | msgid "" |
26 | | -"Traditionally, the C API of Python will change with every release. Most " |
27 | | -"changes will be source-compatible, typically by only adding API, rather than" |
28 | | -" changing existing API or removing API (although some interfaces do get " |
29 | | -"removed after being deprecated first)." |
| 26 | +"Unless documented otherwise, Python's C API is covered by the Backwards " |
| 27 | +"Compatibility Policy, :pep:`387`. Most changes to it are source-compatible " |
| 28 | +"(typically by only adding new API). Changing existing API or removing API is" |
| 29 | +" only done after a deprecation period or to fix serious issues." |
30 | 30 | msgstr "" |
31 | 31 |
|
32 | | -#: ../../c-api/stable.rst:14 |
| 32 | +#: ../../c-api/stable.rst:15 |
33 | 33 | msgid "" |
34 | | -"Unfortunately, the API compatibility does not extend to binary compatibility" |
35 | | -" (the ABI). The reason is primarily the evolution of struct definitions, " |
36 | | -"where addition of a new field, or changing the type of a field, might not " |
37 | | -"break the API, but can break the ABI. As a consequence, extension modules " |
38 | | -"need to be recompiled for every Python release (although an exception is " |
39 | | -"possible on Unix when none of the affected interfaces are used). In " |
40 | | -"addition, on Windows, extension modules link with a specific pythonXY.dll " |
41 | | -"and need to be recompiled to link with a newer one." |
| 34 | +"CPython's Application Binary Interface (ABI) is forward- and backwards-" |
| 35 | +"compatible across a minor release (if these are compiled the same way; see " |
| 36 | +":ref:`stable-abi-platform` below). So, code compiled for Python 3.10.0 will " |
| 37 | +"work on 3.10.8 and vice versa, but will need to be compiled separately for " |
| 38 | +"3.9.x and 3.11.x." |
| 39 | +msgstr "" |
| 40 | + |
| 41 | +#: ../../c-api/stable.rst:21 |
| 42 | +msgid "There are two tiers of C API with different stability expectations:" |
42 | 43 | msgstr "" |
43 | 44 |
|
44 | 45 | #: ../../c-api/stable.rst:23 |
45 | 46 | msgid "" |
46 | | -"Since Python 3.2, a subset of the API has been declared to guarantee a " |
47 | | -"stable ABI. Extension modules wishing to use this API (called \"limited " |
48 | | -"API\") need to define ``Py_LIMITED_API``. A number of interpreter details " |
49 | | -"then become hidden from the extension module; in return, a module is built " |
50 | | -"that works on any 3.x version (x>=2) without recompilation." |
| 47 | +":ref:`Unstable API <unstable-c-api>`, may change in minor versions without a" |
| 48 | +" deprecation period. It is marked by the ``PyUnstable`` prefix in names." |
| 49 | +msgstr "" |
| 50 | + |
| 51 | +#: ../../c-api/stable.rst:25 |
| 52 | +msgid "" |
| 53 | +":ref:`Limited API <limited-c-api>`, is compatible across several minor " |
| 54 | +"releases. When :c:macro:`Py_LIMITED_API` is defined, only this subset is " |
| 55 | +"exposed from ``Python.h``." |
51 | 56 | msgstr "" |
52 | 57 |
|
53 | 58 | #: ../../c-api/stable.rst:29 |
| 59 | +msgid "These are discussed in more detail below." |
| 60 | +msgstr "" |
| 61 | + |
| 62 | +#: ../../c-api/stable.rst:31 |
| 63 | +msgid "" |
| 64 | +"Names prefixed by an underscore, such as ``_Py_InternalState``, are private " |
| 65 | +"API that can change without notice even in patch releases. If you need to " |
| 66 | +"use this API, consider reaching out to `CPython developers " |
| 67 | +"<https://discuss.python.org/c/core-dev/c-api/30>`_ to discuss adding public " |
| 68 | +"API for your use case." |
| 69 | +msgstr "" |
| 70 | + |
| 71 | +#: ../../c-api/stable.rst:40 |
| 72 | +msgid "Unstable C API" |
| 73 | +msgstr "" |
| 74 | + |
| 75 | +#: ../../c-api/stable.rst:44 |
| 76 | +msgid "" |
| 77 | +"Any API named with the ``PyUnstable`` prefix exposes CPython implementation " |
| 78 | +"details, and may change in every minor release (e.g. from 3.9 to 3.10) " |
| 79 | +"without any deprecation warnings. However, it will not change in a bugfix " |
| 80 | +"release (e.g. from 3.10.0 to 3.10.1)." |
| 81 | +msgstr "" |
| 82 | + |
| 83 | +#: ../../c-api/stable.rst:49 |
| 84 | +msgid "" |
| 85 | +"It is generally intended for specialized, low-level tools like debuggers." |
| 86 | +msgstr "" |
| 87 | + |
| 88 | +#: ../../c-api/stable.rst:51 |
| 89 | +msgid "" |
| 90 | +"Projects that use this API are expected to follow CPython development and " |
| 91 | +"spend extra effort adjusting to changes." |
| 92 | +msgstr "" |
| 93 | + |
| 94 | +#: ../../c-api/stable.rst:56 |
| 95 | +msgid "Stable Application Binary Interface" |
| 96 | +msgstr "" |
| 97 | + |
| 98 | +#: ../../c-api/stable.rst:58 |
| 99 | +msgid "" |
| 100 | +"For simplicity, this document talks about *extensions*, but the Limited API " |
| 101 | +"and Stable ABI work the same way for all uses of the API – for example, " |
| 102 | +"embedding Python." |
| 103 | +msgstr "" |
| 104 | + |
| 105 | +#: ../../c-api/stable.rst:65 |
| 106 | +msgid "Limited C API" |
| 107 | +msgstr "" |
| 108 | + |
| 109 | +#: ../../c-api/stable.rst:67 |
| 110 | +msgid "" |
| 111 | +"Python 3.2 introduced the *Limited API*, a subset of Python's C API. " |
| 112 | +"Extensions that only use the Limited API can be compiled once and be loaded " |
| 113 | +"on multiple versions of Python. Contents of the Limited API are :ref:`listed" |
| 114 | +" below <limited-api-list>`." |
| 115 | +msgstr "" |
| 116 | + |
| 117 | +#: ../../c-api/stable.rst:74 |
| 118 | +msgid "" |
| 119 | +"Define this macro before including ``Python.h`` to opt in to only use the " |
| 120 | +"Limited API, and to select the Limited API version." |
| 121 | +msgstr "" |
| 122 | + |
| 123 | +#: ../../c-api/stable.rst:77 |
| 124 | +msgid "" |
| 125 | +"Define ``Py_LIMITED_API`` to the value of :c:macro:`PY_VERSION_HEX` " |
| 126 | +"corresponding to the lowest Python version your extension supports. The " |
| 127 | +"extension will be ABI-compatible with all Python 3 releases from the " |
| 128 | +"specified one onward, and can use Limited API introduced up to that version." |
| 129 | +msgstr "" |
| 130 | + |
| 131 | +#: ../../c-api/stable.rst:83 |
| 132 | +msgid "" |
| 133 | +"Rather than using the ``PY_VERSION_HEX`` macro directly, hardcode a minimum " |
| 134 | +"minor version (e.g. ``0x030A0000`` for Python 3.10) for stability when " |
| 135 | +"compiling with future Python versions." |
| 136 | +msgstr "" |
| 137 | + |
| 138 | +#: ../../c-api/stable.rst:87 |
| 139 | +msgid "" |
| 140 | +"You can also define ``Py_LIMITED_API`` to ``3``. This works the same as " |
| 141 | +"``0x03020000`` (Python 3.2, the version that introduced Limited API)." |
| 142 | +msgstr "" |
| 143 | + |
| 144 | +#: ../../c-api/stable.rst:94 |
| 145 | +msgid "Stable ABI" |
| 146 | +msgstr "" |
| 147 | + |
| 148 | +#: ../../c-api/stable.rst:96 |
| 149 | +msgid "" |
| 150 | +"To enable this, Python provides a *Stable ABI*: a set of symbols that will " |
| 151 | +"remain ABI-compatible across Python 3.x versions." |
| 152 | +msgstr "" |
| 153 | + |
| 154 | +#: ../../c-api/stable.rst:101 |
| 155 | +msgid "" |
| 156 | +"The Stable ABI prevents ABI issues, like linker errors due to missing " |
| 157 | +"symbols or data corruption due to changes in structure layouts or function " |
| 158 | +"signatures. However, other changes in Python can change the *behavior* of " |
| 159 | +"extensions. See Python's Backwards Compatibility Policy (:pep:`387`) for " |
| 160 | +"details." |
| 161 | +msgstr "" |
| 162 | + |
| 163 | +#: ../../c-api/stable.rst:107 |
| 164 | +msgid "" |
| 165 | +"The Stable ABI contains symbols exposed in the :ref:`Limited API <limited-c-" |
| 166 | +"api>`, but also other ones – for example, functions necessary to support " |
| 167 | +"older versions of the Limited API." |
| 168 | +msgstr "" |
| 169 | + |
| 170 | +#: ../../c-api/stable.rst:111 |
| 171 | +msgid "" |
| 172 | +"On Windows, extensions that use the Stable ABI should be linked against " |
| 173 | +"``python3.dll`` rather than a version-specific library such as " |
| 174 | +"``python39.dll``." |
| 175 | +msgstr "" |
| 176 | + |
| 177 | +#: ../../c-api/stable.rst:115 |
| 178 | +msgid "" |
| 179 | +"On some platforms, Python will look for and load shared library files named " |
| 180 | +"with the ``abi3`` tag (e.g. ``mymodule.abi3.so``). It does not check if such" |
| 181 | +" extensions conform to a Stable ABI. The user (or their packaging tools) " |
| 182 | +"need to ensure that, for example, extensions built with the 3.10+ Limited " |
| 183 | +"API are not installed for lower versions of Python." |
| 184 | +msgstr "" |
| 185 | + |
| 186 | +#: ../../c-api/stable.rst:122 |
| 187 | +msgid "" |
| 188 | +"All functions in the Stable ABI are present as functions in Python's shared " |
| 189 | +"library, not solely as macros. This makes them usable from languages that " |
| 190 | +"don't use the C preprocessor." |
| 191 | +msgstr "" |
| 192 | + |
| 193 | +#: ../../c-api/stable.rst:128 |
| 194 | +msgid "Limited API Scope and Performance" |
| 195 | +msgstr "" |
| 196 | + |
| 197 | +#: ../../c-api/stable.rst:130 |
| 198 | +msgid "" |
| 199 | +"The goal for the Limited API is to allow everything that is possible with " |
| 200 | +"the full C API, but possibly with a performance penalty." |
| 201 | +msgstr "" |
| 202 | + |
| 203 | +#: ../../c-api/stable.rst:133 |
| 204 | +msgid "" |
| 205 | +"For example, while :c:func:`PyList_GetItem` is available, its “unsafe” macro" |
| 206 | +" variant :c:func:`PyList_GET_ITEM` is not. The macro can be faster because " |
| 207 | +"it can rely on version-specific implementation details of the list object." |
| 208 | +msgstr "" |
| 209 | + |
| 210 | +#: ../../c-api/stable.rst:138 |
| 211 | +msgid "" |
| 212 | +"Without ``Py_LIMITED_API`` defined, some C API functions are inlined or " |
| 213 | +"replaced by macros. Defining ``Py_LIMITED_API`` disables this inlining, " |
| 214 | +"allowing stability as Python's data structures are improved, but possibly " |
| 215 | +"reducing performance." |
| 216 | +msgstr "" |
| 217 | + |
| 218 | +#: ../../c-api/stable.rst:143 |
| 219 | +msgid "" |
| 220 | +"By leaving out the ``Py_LIMITED_API`` definition, it is possible to compile " |
| 221 | +"a Limited API extension with a version-specific ABI. This can improve " |
| 222 | +"performance for that Python version, but will limit compatibility. Compiling" |
| 223 | +" with ``Py_LIMITED_API`` will then yield an extension that can be " |
| 224 | +"distributed where a version-specific one is not available – for example, for" |
| 225 | +" prereleases of an upcoming Python version." |
| 226 | +msgstr "" |
| 227 | + |
| 228 | +#: ../../c-api/stable.rst:152 |
| 229 | +msgid "Limited API Caveats" |
| 230 | +msgstr "" |
| 231 | + |
| 232 | +#: ../../c-api/stable.rst:154 |
54 | 233 | msgid "" |
55 | | -"In some cases, the stable ABI needs to be extended with new functions. " |
56 | | -"Extension modules wishing to use these new APIs need to set " |
57 | | -"``Py_LIMITED_API`` to the ``PY_VERSION_HEX`` value (see " |
58 | | -":ref:`apiabiversion`) of the minimum Python version they want to support " |
59 | | -"(e.g. ``0x03030000`` for Python 3.3). Such modules will work on all " |
60 | | -"subsequent Python releases, but fail to load (because of missing symbols) on" |
61 | | -" the older releases." |
| 234 | +"Note that compiling with ``Py_LIMITED_API`` is *not* a complete guarantee " |
| 235 | +"that code conforms to the :ref:`Limited API <limited-c-api>` or the " |
| 236 | +":ref:`Stable ABI <stable-abi>`. ``Py_LIMITED_API`` only covers definitions, " |
| 237 | +"but an API also includes other issues, such as expected semantics." |
62 | 238 | msgstr "" |
63 | 239 |
|
64 | | -#: ../../c-api/stable.rst:36 |
| 240 | +#: ../../c-api/stable.rst:159 |
65 | 241 | msgid "" |
66 | | -"As of Python 3.2, the set of functions available to the limited API is " |
67 | | -"documented in :pep:`384`. In the C API documentation, API elements that are" |
68 | | -" not part of the limited API are marked as \"Not part of the limited API.\"" |
| 242 | +"One issue that ``Py_LIMITED_API`` does not guard against is calling a " |
| 243 | +"function with arguments that are invalid in a lower Python version. For " |
| 244 | +"example, consider a function that starts accepting ``NULL`` for an argument." |
| 245 | +" In Python 3.9, ``NULL`` now selects a default behavior, but in Python 3.8, " |
| 246 | +"the argument will be used directly, causing a ``NULL`` dereference and " |
| 247 | +"crash. A similar argument works for fields of structs." |
| 248 | +msgstr "" |
| 249 | + |
| 250 | +#: ../../c-api/stable.rst:166 |
| 251 | +msgid "" |
| 252 | +"Another issue is that some struct fields are currently not hidden when " |
| 253 | +"``Py_LIMITED_API`` is defined, even though they're part of the Limited API." |
| 254 | +msgstr "" |
| 255 | + |
| 256 | +#: ../../c-api/stable.rst:169 |
| 257 | +msgid "" |
| 258 | +"For these reasons, we recommend testing an extension with *all* minor Python" |
| 259 | +" versions it supports, and preferably to build with the *lowest* such " |
| 260 | +"version." |
| 261 | +msgstr "" |
| 262 | + |
| 263 | +#: ../../c-api/stable.rst:172 |
| 264 | +msgid "" |
| 265 | +"We also recommend reviewing documentation of all used API to check if it is " |
| 266 | +"explicitly part of the Limited API. Even with ``Py_LIMITED_API`` defined, a " |
| 267 | +"few private declarations are exposed for technical reasons (or even " |
| 268 | +"unintentionally, as bugs)." |
| 269 | +msgstr "" |
| 270 | + |
| 271 | +#: ../../c-api/stable.rst:177 |
| 272 | +msgid "" |
| 273 | +"Also note that the Limited API is not necessarily stable: compiling with " |
| 274 | +"``Py_LIMITED_API`` with Python 3.8 means that the extension will run with " |
| 275 | +"Python 3.12, but it will not necessarily *compile* with Python 3.12. In " |
| 276 | +"particular, parts of the Limited API may be deprecated and removed, provided" |
| 277 | +" that the Stable ABI stays stable." |
| 278 | +msgstr "" |
| 279 | + |
| 280 | +#: ../../c-api/stable.rst:187 |
| 281 | +msgid "Platform Considerations" |
| 282 | +msgstr "" |
| 283 | + |
| 284 | +#: ../../c-api/stable.rst:189 |
| 285 | +msgid "" |
| 286 | +"ABI stability depends not only on Python, but also on the compiler used, " |
| 287 | +"lower-level libraries and compiler options. For the purposes of the " |
| 288 | +":ref:`Stable ABI <stable-abi>`, these details define a “platform”. They " |
| 289 | +"usually depend on the OS type and processor architecture" |
| 290 | +msgstr "" |
| 291 | + |
| 292 | +#: ../../c-api/stable.rst:194 |
| 293 | +msgid "" |
| 294 | +"It is the responsibility of each particular distributor of Python to ensure " |
| 295 | +"that all Python versions on a particular platform are built in a way that " |
| 296 | +"does not break the Stable ABI. This is the case with Windows and macOS " |
| 297 | +"releases from ``python.org`` and many third-party distributors." |
| 298 | +msgstr "" |
| 299 | + |
| 300 | +#: ../../c-api/stable.rst:204 |
| 301 | +msgid "Contents of Limited API" |
| 302 | +msgstr "" |
| 303 | + |
| 304 | +#: ../../c-api/stable.rst:207 |
| 305 | +msgid "" |
| 306 | +"Currently, the :ref:`Limited API <limited-c-api>` includes the following " |
| 307 | +"items:" |
| 308 | +msgstr "" |
| 309 | + |
| 310 | +#: ../../c-api/stable.rst:42 |
| 311 | +msgid "PyUnstable" |
69 | 312 | msgstr "" |
0 commit comments