# Copyright (C) 2001-2020, Python Software Foundation # This file is distributed under the same license as the Python package. # Maintained by the python-doc-es workteam. # docs-es@python.org / # https://mail.python.org/mailman3/lists/docs-es.python.org/ # Check https://github.com/python/python-docs-es/blob/3.8/TRANSLATORS to # get the list of volunteers # msgid "" msgstr "" "Project-Id-Version: Python 3.8\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2022-10-25 19:47+0200\n" "PO-Revision-Date: 2021-10-21 00:37-0300\n" "Last-Translator: CatalinaArrey \n" "Language: es\n" "Language-Team: python-doc-es\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=utf-8\n" "Content-Transfer-Encoding: 8bit\n" "Generated-By: Babel 2.10.3\n" #: ../Doc/c-api/init.rst:8 msgid "Initialization, Finalization, and Threads" msgstr "Inicialización, Finalización e Hilos" #: ../Doc/c-api/init.rst:10 msgid "See also :ref:`Python Initialization Configuration `." msgstr "" "Consulte también :ref:`Configuración de inicialización de Python `." #: ../Doc/c-api/init.rst:15 msgid "Before Python Initialization" msgstr "Antes de la inicialización de Python" #: ../Doc/c-api/init.rst:17 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 " "exception of a few functions and the :ref:`global configuration variables " "`." msgstr "" "En una aplicación que incorpora Python, se debe llamar a la función :c:func:" "`Py_Initialize` antes de usar cualquier otra función de API Python/C; con la " "excepción de algunas funciones y :ref:`variables de configuración global " "`." #: ../Doc/c-api/init.rst:22 msgid "" "The following functions can be safely called before Python is initialized:" msgstr "" "Las siguientes funciones se pueden invocar de forma segura antes de que se " "inicializa Python:" #: ../Doc/c-api/init.rst:24 msgid "Configuration functions:" msgstr "Funciones de configuración:" #: ../Doc/c-api/init.rst:26 msgid ":c:func:`PyImport_AppendInittab`" msgstr ":c:func:`PyImport_AppendInittab`" #: ../Doc/c-api/init.rst:27 msgid ":c:func:`PyImport_ExtendInittab`" msgstr ":c:func:`PyImport_ExtendInittab`" #: ../Doc/c-api/init.rst:28 msgid ":c:func:`PyInitFrozenExtensions`" msgstr ":c:func:`PyInitFrozenExtensions`" #: ../Doc/c-api/init.rst:29 msgid ":c:func:`PyMem_SetAllocator`" msgstr ":c:func:`PyMem_SetAllocator`" #: ../Doc/c-api/init.rst:30 msgid ":c:func:`PyMem_SetupDebugHooks`" msgstr ":c:func:`PyMem_SetupDebugHooks`" #: ../Doc/c-api/init.rst:31 msgid ":c:func:`PyObject_SetArenaAllocator`" msgstr ":c:func:`PyObject_SetArenaAllocator`" #: ../Doc/c-api/init.rst:32 msgid ":c:func:`Py_SetPath`" msgstr ":c:func:`Py_SetPath`" #: ../Doc/c-api/init.rst:33 msgid ":c:func:`Py_SetProgramName`" msgstr ":c:func:`Py_SetProgramName`" #: ../Doc/c-api/init.rst:34 msgid ":c:func:`Py_SetPythonHome`" msgstr ":c:func:`Py_SetPythonHome`" #: ../Doc/c-api/init.rst:35 msgid ":c:func:`Py_SetStandardStreamEncoding`" msgstr ":c:func:`Py_SetStandardStreamEncoding`" #: ../Doc/c-api/init.rst:36 msgid ":c:func:`PySys_AddWarnOption`" msgstr ":c:func:`PySys_AddWarnOption`" #: ../Doc/c-api/init.rst:37 msgid ":c:func:`PySys_AddXOption`" msgstr ":c:func:`PySys_AddXOption`" #: ../Doc/c-api/init.rst:38 msgid ":c:func:`PySys_ResetWarnOptions`" msgstr ":c:func:`PySys_ResetWarnOptions`" #: ../Doc/c-api/init.rst:40 msgid "Informative functions:" msgstr "Funciones informativas:" #: ../Doc/c-api/init.rst:42 msgid ":c:func:`Py_IsInitialized`" msgstr ":c:func:`Py_IsInitialized`" #: ../Doc/c-api/init.rst:43 msgid ":c:func:`PyMem_GetAllocator`" msgstr ":c:func:`PyMem_GetAllocator`" #: ../Doc/c-api/init.rst:44 msgid ":c:func:`PyObject_GetArenaAllocator`" msgstr ":c:func:`PyObject_GetArenaAllocator`" #: ../Doc/c-api/init.rst:45 msgid ":c:func:`Py_GetBuildInfo`" msgstr ":c:func:`Py_GetBuildInfo`" #: ../Doc/c-api/init.rst:46 msgid ":c:func:`Py_GetCompiler`" msgstr ":c:func:`Py_GetCompiler`" #: ../Doc/c-api/init.rst:47 msgid ":c:func:`Py_GetCopyright`" msgstr ":c:func:`Py_GetCopyright`" #: ../Doc/c-api/init.rst:48 msgid ":c:func:`Py_GetPlatform`" msgstr ":c:func:`Py_GetPlatform`" #: ../Doc/c-api/init.rst:49 msgid ":c:func:`Py_GetVersion`" msgstr ":c:func:`Py_GetVersion`" #: ../Doc/c-api/init.rst:51 msgid "Utilities:" msgstr "Utilidades:" #: ../Doc/c-api/init.rst:53 msgid ":c:func:`Py_DecodeLocale`" msgstr ":c:func:`Py_DecodeLocale`" #: ../Doc/c-api/init.rst:55 msgid "Memory allocators:" msgstr "Asignadores de memoria:" #: ../Doc/c-api/init.rst:57 msgid ":c:func:`PyMem_RawMalloc`" msgstr ":c:func:`PyMem_RawMalloc`" #: ../Doc/c-api/init.rst:58 msgid ":c:func:`PyMem_RawRealloc`" msgstr ":c:func:`PyMem_RawRealloc`" #: ../Doc/c-api/init.rst:59 msgid ":c:func:`PyMem_RawCalloc`" msgstr ":c:func:`PyMem_RawCalloc`" #: ../Doc/c-api/init.rst:60 msgid ":c:func:`PyMem_RawFree`" msgstr ":c:func:`PyMem_RawFree`" #: ../Doc/c-api/init.rst:64 msgid "" "The following functions **should not be called** before :c:func:" "`Py_Initialize`: :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`." msgstr "" "Las siguientes funciones **no deben llamarse** antes de :c:func:" "`Py_Initialize`: :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` y :c:func:`PyEval_InitThreads`." #: ../Doc/c-api/init.rst:74 msgid "Global configuration variables" msgstr "Variables de configuración global" #: ../Doc/c-api/init.rst:76 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 "" "Python tiene variables para la configuración global para controlar " "diferentes características y opciones. De forma predeterminada, estos " "indicadores están controlados por :ref:`opciones de línea de comando `." #: ../Doc/c-api/init.rst:80 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:" "`Py_BytesWarningFlag` to 1 and ``-bb`` sets :c:data:`Py_BytesWarningFlag` to " "2." msgstr "" "Cuando una opción establece un indicador, el valor del indicador es la " "cantidad de veces que se configuró la opción. Por ejemplo, ``-b`` establece :" "c:data:`Py_BytesWarningFlag` en 1 y ``-bb`` establece :c:data:" "`Py_BytesWarningFlag` en 2." #: ../Doc/c-api/init.rst:86 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 "" "Emite una advertencia al comparar :class:`bytes` o :class:`bytearray` con :" "class:`str` o :class:`bytes` con :class:`int`. Emite un error si es mayor o " "igual a ``2``." #: ../Doc/c-api/init.rst:90 msgid "Set by the :option:`-b` option." msgstr "Establecido por la opción :option:`-b`." #: ../Doc/c-api/init.rst:94 msgid "" "Turn on parser debugging output (for expert only, depending on compilation " "options)." msgstr "" "Activa la salida de depuración del analizador (solo para expertos, según las " "opciones de compilación)." #: ../Doc/c-api/init.rst:97 msgid "" "Set by the :option:`-d` option and the :envvar:`PYTHONDEBUG` environment " "variable." msgstr "" "Establecido por la opción :option:`-d` y la variable de entorno :envvar:" "`PYTHONDEBUG`." #: ../Doc/c-api/init.rst:102 msgid "" "If set to non-zero, Python won't try to write ``.pyc`` files on the import " "of source modules." msgstr "" "Si se establece en un valor distinto de cero, Python no intentará escribir " "archivos ``.pyc`` en la importación de módulos fuente." #: ../Doc/c-api/init.rst:105 msgid "" "Set by the :option:`-B` option and the :envvar:`PYTHONDONTWRITEBYTECODE` " "environment variable." msgstr "" "Establecido por la opción :option:`-B` y la variable de entorno :envvar:" "`PYTHONDONTWRITEBYTECODE`." #: ../Doc/c-api/init.rst:110 msgid "" "Suppress error messages when calculating the module search path in :c:func:" "`Py_GetPath`." msgstr "" "Suprime los mensajes de error al calcular la ruta de búsqueda del módulo en :" "c:func:`Py_GetPath`." #: ../Doc/c-api/init.rst:113 #, fuzzy msgid "Private flag used by ``_freeze_module`` and ``frozenmain`` programs." msgstr "" "Indicador privado utilizado por los programas ``_freeze_importlib`` y " "``frozenmain``." #: ../Doc/c-api/init.rst:117 msgid "" "Set to ``1`` if the :envvar:`PYTHONHASHSEED` environment variable is set to " "a non-empty string." msgstr "" "Se establece en ``1`` si la variable de entorno :envvar:`PYTHONHASHSEED` se " "establece en una cadena de caracteres no vacía." #: ../Doc/c-api/init.rst:120 msgid "" "If the flag is non-zero, read the :envvar:`PYTHONHASHSEED` environment " "variable to initialize the secret hash seed." msgstr "" "Si el indicador no es cero, lee la variable de entorno :envvar:" "`PYTHONHASHSEED` para inicializar la semilla de *hash* secreta." #: ../Doc/c-api/init.rst:125 msgid "" "Ignore all :envvar:`PYTHON*` environment variables, e.g. :envvar:" "`PYTHONPATH` and :envvar:`PYTHONHOME`, that might be set." msgstr "" "Ignorar todas las variables de entorno :envvar:`PYTHON*`, por ejemplo :" "envvar:`PYTHONPATH` y :envvar:`PYTHONHOME`, eso podría establecerse." #: ../Doc/c-api/init.rst:128 msgid "Set by the :option:`-E` and :option:`-I` options." msgstr "Establecido por las opciones :option:`-E` y :option:`-I`." #: ../Doc/c-api/init.rst:132 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 "" "Cuando se pasa una secuencia de comandos (*script*) como primer argumento o " "se usa la opción :option:`-c`, ingresa al modo interactivo después de " "ejecutar la secuencia de comandos o el comando, incluso cuando :data:`sys." "stdin` no parece ser un terminal." #: ../Doc/c-api/init.rst:136 msgid "" "Set by the :option:`-i` option and the :envvar:`PYTHONINSPECT` environment " "variable." msgstr "" "Establecido por la opción :option:`-i` y la variable de entorno :envvar:" "`PYTHONINSPECT`." #: ../Doc/c-api/init.rst:141 msgid "Set by the :option:`-i` option." msgstr "Establecido por la opción :option:`-i`." #: ../Doc/c-api/init.rst:145 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 "" "Ejecuta Python en modo aislado. En modo aislado :data:`sys.path` no contiene " "ni el directorio de la secuencia de comandos (*script*) ni el directorio de " "paquetes del sitio del usuario (*site-pacages*)." #: ../Doc/c-api/init.rst:148 msgid "Set by the :option:`-I` option." msgstr "Establecido por la opción :option:`-I`." #: ../Doc/c-api/init.rst:154 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 "" "Si la bandera no es cero, utilice la codificación ``mbcs`` con el gestor de " "errores ``replace`` en lugar de la codificación UTF-8 con el gestor de error " "``surrogatepass``, para la :term:`filesystem encoding and error handler` " "(codificación del sistema de archivos y gestor de errores)." #: ../Doc/c-api/init.rst:158 msgid "" "Set to ``1`` if the :envvar:`PYTHONLEGACYWINDOWSFSENCODING` environment " "variable is set to a non-empty string." msgstr "" "Establece en ``1`` si la variable de entorno :envvar:" "`PYTHONLEGACYWINDOWSFSENCODING` está configurada en una cadena de caracteres " "no vacía." #: ../Doc/c-api/init.rst:161 msgid "See :pep:`529` for more details." msgstr "Ver :pep:`529` para más detalles." #: ../Doc/c-api/init.rst:163 ../Doc/c-api/init.rst:175 msgid ":ref:`Availability `: Windows." msgstr ":ref:`Disponibilidad `: Windows." #: ../Doc/c-api/init.rst:167 msgid "" "If the flag is non-zero, use :class:`io.FileIO` instead of :class:" "`WindowsConsoleIO` for :mod:`sys` standard streams." msgstr "" "Si el indicador no es cero, use :class:`io.FileIO` en lugar de :class:" "`WindowsConsoleIO` para secuencias estándar :mod:`sys`." #: ../Doc/c-api/init.rst:170 msgid "" "Set to ``1`` if the :envvar:`PYTHONLEGACYWINDOWSSTDIO` environment variable " "is set to a non-empty string." msgstr "" "Establece en ``1`` si la variable de entorno :envvar:" "`PYTHONLEGACYWINDOWSSTDIO` está configurada en una cadena de caracteres no " "vacía." #: ../Doc/c-api/init.rst:173 msgid "See :pep:`528` for more details." msgstr "Ver :pep:`528` para más detalles." #: ../Doc/c-api/init.rst:179 msgid "" "Disable the import of the module :mod:`site` and the site-dependent " "manipulations of :data:`sys.path` that it entails. Also disable these " "manipulations if :mod:`site` is explicitly imported later (call :func:`site." "main` if you want them to be triggered)." msgstr "" "Deshabilita la importación del módulo :mod:`site` y las manipulaciones " "dependientes del sitio de :data:`sys.path` que conlleva. También deshabilita " "estas manipulaciones si :mod:`site` se importa explícitamente más tarde " "(llama a :func:`site.main` si desea que se activen)." #: ../Doc/c-api/init.rst:184 msgid "Set by the :option:`-S` option." msgstr "Establecido por la opción :option:`-S`." #: ../Doc/c-api/init.rst:188 msgid "" "Don't add the :data:`user site-packages directory ` to :data:" "`sys.path`." msgstr "" "No agregue el :data:`directorio de paquetes de sitio del usuario ` (*site-packages*) a :data:`sys.path`." #: ../Doc/c-api/init.rst:191 msgid "" "Set by the :option:`-s` and :option:`-I` options, and the :envvar:" "`PYTHONNOUSERSITE` environment variable." msgstr "" "Establecido por las opciones :option:`-s` y :option:`-I`, y la variable de " "entorno :envvar:`PYTHONNOUSERSITE`." #: ../Doc/c-api/init.rst:196 msgid "" "Set by the :option:`-O` option and the :envvar:`PYTHONOPTIMIZE` environment " "variable." msgstr "" "Establecido por la opción :option:`-O` y la variable de entorno :envvar:" "`PYTHONOPTIMIZE`." #: ../Doc/c-api/init.rst:201 msgid "" "Don't display the copyright and version messages even in interactive mode." msgstr "" "No muestre los mensajes de *copyright* y de versión incluso en modo " "interactivo." #: ../Doc/c-api/init.rst:203 msgid "Set by the :option:`-q` option." msgstr "Establecido por la opción :option:`-q`." #: ../Doc/c-api/init.rst:209 msgid "Force the stdout and stderr streams to be unbuffered." msgstr "Obliga a las secuencias *stdout* y *stderr* a que no tengan búfer." #: ../Doc/c-api/init.rst:211 msgid "" "Set by the :option:`-u` option and the :envvar:`PYTHONUNBUFFERED` " "environment variable." msgstr "" "Establecido por la opción :option:`-u` y la variable de entorno :envvar:" "`PYTHONUNBUFFERED`." #: ../Doc/c-api/init.rst:216 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 " "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 "" "Imprime un mensaje cada vez que se inicializa un módulo, mostrando el lugar " "(nombre de archivo o módulo incorporado) desde el que se carga. Si es mayor " "o igual a ``2``, imprime un mensaje para cada archivo que se verifica al " "buscar un módulo. También proporciona información sobre la limpieza del " "módulo a la salida." #: ../Doc/c-api/init.rst:221 msgid "" "Set by the :option:`-v` option and the :envvar:`PYTHONVERBOSE` environment " "variable." msgstr "" "Establecido por la opción :option:`-v` y la variable de entorno :envvar:" "`PYTHONVERBOSE`." #: ../Doc/c-api/init.rst:226 msgid "Initializing and finalizing the interpreter" msgstr "Inicializando y finalizando el intérprete" #: ../Doc/c-api/init.rst:244 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 "" "Inicializa el intérprete de Python. En una aplicación que incorpora Python, " "se debe llamar antes de usar cualquier otra función de API Python/C; vea :" "ref:`Antes de la inicialización de Python ` para ver algunas " "excepciones." #: ../Doc/c-api/init.rst:248 msgid "" "This initializes the table of loaded modules (``sys.modules``), and creates " "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." msgstr "" "Esto inicializa la tabla de módulos cargados (``sys.modules``) y crea los " "módulos fundamentales :mod:`builtins`, :mod:`__main__` y :mod:`sys`. También " "inicializa la ruta de búsqueda del módulo (``sys.path``). No establece ``sys." "argv``; use :c:func:`PySys_SetArgvEx` para eso. Este es un *no-op* cuando se " "llama por segunda vez (sin llamar primero a :c:func:`Py_FinalizeEx`). No hay " "valor de retorno; es un error fatal si falla la inicialización." #: ../Doc/c-api/init.rst:257 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 "" "En Windows, cambia el modo de consola de ``O_TEXT`` a ``O_BINARY``, lo que " "también afectará los usos de la consola que no sean de Python utilizando C " "*Runtime*." #: ../Doc/c-api/init.rst:263 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." msgstr "" "Esta función funciona como :c:func:`Py_Initialize` si *initsigs* es ``1``. " "Si *initsigs* es ``0``, omite el registro de inicialización de los " "manejadores de señal, lo que podría ser útil cuando Python está incrustado." #: ../Doc/c-api/init.rst:270 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 "" "Retorna verdadero (distinto de cero) cuando el intérprete de Python se ha " "inicializado, falso (cero) si no. Después de que se llama a :c:func:" "`Py_FinalizeEx`, esto retorna falso hasta que :c:func:`Py_Initialize` se " "llama de nuevo." #: ../Doc/c-api/init.rst:277 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:" "`Py_NewInterpreter` below) that were created and not yet destroyed since the " "last call to :c:func:`Py_Initialize`. Ideally, this frees all memory " "allocated by the Python interpreter. This is a no-op when called for a " "second time (without calling :c:func:`Py_Initialize` again first). Normally " "the return value is ``0``. If there were errors during finalization " "(flushing buffered data), ``-1`` is returned." msgstr "" "Deshace todas las inicializaciones realizadas por :c:func:`Py_Initialize` y " "el uso posterior de las funciones de Python/C API, y destruye todos los sub-" "intérpretes (ver :c:func:`Py_NewInterpreter` a continuación) que se crearon " "y aún no se destruyeron desde el última llamada a :c:func:`Py_Initialize`. " "Idealmente, esto libera toda la memoria asignada por el intérprete de " "Python. Este es un *no-op* cuando se llama por segunda vez (sin llamar a :c:" "func:`Py_Initialize` nuevamente primero). Normalmente el valor de retorno es " "``0``. Si hubo errores durante la finalización (lavado de datos almacenados " "en el búfer), se retorna ``-1``." #: ../Doc/c-api/init.rst:286 msgid "" "This function is provided for a number of reasons. An embedding application " "might want to restart Python without having to restart the application " "itself. An application that has loaded the Python interpreter from a " "dynamically loadable library (or DLL) might want to free all memory " "allocated by Python before unloading the DLL. During a hunt for memory leaks " "in an application a developer might want to free all memory allocated by " "Python before exiting from the application." msgstr "" "Esta función se proporciona por varias razones. Una aplicación de " "incrustación puede querer reiniciar Python sin tener que reiniciar la " "aplicación misma. Una aplicación que ha cargado el intérprete de Python " "desde una biblioteca cargable dinámicamente (o DLL) puede querer liberar " "toda la memoria asignada por Python antes de descargar la DLL. Durante una " "búsqueda de pérdidas de memoria en una aplicación, un desarrollador puede " "querer liberar toda la memoria asignada por Python antes de salir de la " "aplicación." #: ../Doc/c-api/init.rst:294 msgid "" "**Bugs and caveats:** The destruction of modules and objects in modules is " "done in random order; this may cause destructors (:meth:`__del__` methods) " "to fail when they depend on other objects (even functions) or modules. " "Dynamically loaded extension modules loaded by Python are not unloaded. " "Small amounts of memory allocated by the Python interpreter may not be freed " "(if you find a leak, please report it). Memory tied up in circular " "references between objects is not freed. Some memory allocated by extension " "modules may not be freed. Some extensions may not work properly if their " "initialization routine is called more than once; this can happen if an " "application calls :c:func:`Py_Initialize` and :c:func:`Py_FinalizeEx` more " "than once." msgstr "" "**Errores y advertencias:** La destrucción de módulos y objetos en módulos " "se realiza en orden aleatorio; esto puede causar que los destructores " "(métodos :meth:`__del__`) fallen cuando dependen de otros objetos (incluso " "funciones) o módulos. Los módulos de extensión cargados dinámicamente " "cargados por Python no se descargan. Es posible que no se liberen pequeñas " "cantidades de memoria asignadas por el intérprete de Python (si encuentra " "una fuga, informe por favor). La memoria atada en referencias circulares " "entre objetos no se libera. Es posible que parte de la memoria asignada por " "los módulos de extensión no se libere. Algunas extensiones pueden no " "funcionar correctamente si su rutina de inicialización se llama más de una " "vez; Esto puede suceder si una aplicación llama a :c:func:`Py_Initialize` y :" "c:func:`Py_FinalizeEx` más de una vez." #: ../Doc/c-api/init.rst:305 msgid "" "Raises an :ref:`auditing event ` ``cpython." "_PySys_ClearAuditHooks`` with no arguments." msgstr "" "Genera un :ref:`evento de auditoría ` ``cpython." "_PySys_ClearAuditHooks`` sin argumentos." #: ../Doc/c-api/init.rst:311 msgid "" "This is a backwards-compatible version of :c:func:`Py_FinalizeEx` that " "disregards the return value." msgstr "" "Esta es una versión compatible con versiones anteriores de :c:func:" "`Py_FinalizeEx` que ignora el valor de retorno." #: ../Doc/c-api/init.rst:316 msgid "Process-wide parameters" msgstr "Parámetros de todo el proceso" #: ../Doc/c-api/init.rst:326 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 `." msgstr "" #: ../Doc/c-api/init.rst:331 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`." msgstr "" "Esta función debería llamarse antes de :c:func:`Py_Initialize`, si es que se " "llama. Especifica qué codificación y manejo de errores usar con IO estándar, " "con los mismos significados que en :func:`str.encode`." #: ../Doc/c-api/init.rst:335 msgid "" "It overrides :envvar:`PYTHONIOENCODING` values, and allows embedding code to " "control IO encoding when the environment variable does not work." msgstr "" "Reemplaza los valores :envvar:`PYTHONIOENCODING`, y permite incrustar código " "para controlar la codificación IO cuando la variable de entorno no funciona." #: ../Doc/c-api/init.rst:338 msgid "" "*encoding* and/or *errors* may be ``NULL`` to use :envvar:`PYTHONIOENCODING` " "and/or default values (depending on other settings)." msgstr "" "*codificación* o *errores* pueden ser ``NULL`` para usar :envvar:" "`PYTHONIOENCODING` o valores predeterminados (dependiendo de otras " "configuraciones)." #: ../Doc/c-api/init.rst:342 msgid "" "Note that :data:`sys.stderr` always uses the \"backslashreplace\" error " "handler, regardless of this (or any other) setting." msgstr "" "Tenga en cuenta que :data:`sys.stderr` siempre usa el controlador de error " "\"*backslashreplace*\", independientemente de esta configuración (o " "cualquier otra)." #: ../Doc/c-api/init.rst:345 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`." msgstr "" "Si se llama a :c:func:`Py_FinalizeEx`, será necesario volver a llamar a esta " "función para afectar las llamadas posteriores a :c:func:`Py_Initialize`." #: ../Doc/c-api/init.rst:348 msgid "" "Returns ``0`` if successful, a nonzero value on error (e.g. calling after " "the interpreter has already been initialized)." msgstr "" "Retorna ``0`` si tiene éxito, un valor distinto de cero en caso de error " "(por ejemplo, llamar después de que el intérprete ya se haya inicializado)" #: ../Doc/c-api/init.rst:363 msgid "" "This API is kept for backward compatibility: setting :c:member:`PyConfig." "program_name` should be used instead, see :ref:`Python Initialization " "Configuration `." msgstr "" #: ../Doc/c-api/init.rst:367 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 " "of the ``argv[0]`` argument to the :c:func:`main` function of the program " "(converted to wide characters). This is used by :c:func:`Py_GetPath` and " "some other functions below to find the Python run-time libraries relative to " "the interpreter executable. The default value is ``'python'``. The " "argument should point to a zero-terminated wide character string in static " "storage whose contents will not change for the duration of the program's " "execution. No code in the Python interpreter will change the contents of " "this storage." msgstr "" "Esta función debería llamarse antes :c:func:`Py_Initialize` se llama por " "primera vez, si es que se llama. Le dice al intérprete el valor del " "argumento ``argv[0]`` para la función :c:func:`main` del programa " "(convertido a caracteres anchos). Esto es utilizado por :c:func:`Py_GetPath` " "y algunas otras funciones a continuación para encontrar las bibliotecas de " "tiempo de ejecución de Python relativas al ejecutable del intérprete. El " "valor predeterminado es ``'python'``. El argumento debe apuntar a una cadena " "de caracteres anchos terminada en cero en almacenamiento estático cuyo " "contenido no cambiará mientras dure la ejecución del programa. Ningún código " "en el intérprete de Python cambiará el contenido de este almacenamiento." #: ../Doc/c-api/init.rst:378 ../Doc/c-api/init.rst:529 #: ../Doc/c-api/init.rst:644 ../Doc/c-api/init.rst:680 #: ../Doc/c-api/init.rst:706 #, fuzzy msgid "" "Use :c:func:`Py_DecodeLocale` to decode a bytes string to get a :c:expr:" "`wchar_*` string." msgstr "" "Use :c:func:`Py_DecodeLocale` para decodificar una cadena de bytes para " "obtener una cadena :c:type:`wchar_ *`." #: ../Doc/c-api/init.rst:388 msgid "" "Return the program name set with :c:func:`Py_SetProgramName`, or the " "default. The returned string points into static storage; the caller should " "not modify its value." msgstr "" "Retorna el nombre del programa establecido con :c:func:`Py_SetProgramName`, " "o el valor predeterminado. La cadena de caracteres retornada apunta al " "almacenamiento estático; la persona que llama no debe modificar su valor." #: ../Doc/c-api/init.rst:392 ../Doc/c-api/init.rst:411 #: ../Doc/c-api/init.rst:452 ../Doc/c-api/init.rst:471 #: ../Doc/c-api/init.rst:495 ../Doc/c-api/init.rst:718 msgid "" "This function should not be called before :c:func:`Py_Initialize`, otherwise " "it returns ``NULL``." msgstr "" "Esta función ya no se puede llamar antes de :c:func:`Py_Initialize()`, de " "otra forma retornará ``NULL``." #: ../Doc/c-api/init.rst:395 ../Doc/c-api/init.rst:414 #: ../Doc/c-api/init.rst:455 ../Doc/c-api/init.rst:474 #: ../Doc/c-api/init.rst:500 ../Doc/c-api/init.rst:721 msgid "It now returns ``NULL`` if called before :c:func:`Py_Initialize`." msgstr "" "Todas las siguientes funciones deben llamarse después de :c:func:" "`Py_Initialize`, de lo contrario retornará ``NULL``." #: ../Doc/c-api/init.rst:401 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 " "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 ``--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." msgstr "" "Retorna el prefijo *prefix* para los archivos instalados independientes de " "la plataforma. Esto se deriva a través de una serie de reglas complicadas " "del nombre del programa establecido con :c:func:`Py_SetProgramName` y " "algunas variables de entorno; por ejemplo, si el nombre del programa es ``'/" "usr/local/bin/python'``, el prefijo es ``'/usr/local'``. La cadena de " "caracteres retornada apunta al almacenamiento estático; la persona que llama " "no debe modificar su valor. Esto corresponde a la variable :makevar:`prefix` " "en el archivo de nivel superior :file:`Makefile` y el argumento ``--prefix`` " "a la secuencia de comandos (*script*) :program:`configure` en tiempo de " "compilación. El valor está disponible para el código de Python como ``sys." "prefix``. Solo es útil en Unix. Ver también la siguiente función." #: ../Doc/c-api/init.rst:420 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 " "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." msgstr "" "Retorna el *exec-prefix* para los archivos instalados *dependientes* de la " "plataforma. Esto se deriva a través de una serie de reglas complicadas del " "nombre del programa establecido con :c:func:`Py_SetProgramName` y algunas " "variables de entorno; por ejemplo, si el nombre del programa es ``'/usr/" "local/bin/python'``, el prefijo `exec` es ``'/usr/local'``. La cadena de " "caracteres retornada apunta al almacenamiento estático; la persona que llama " "no debe modificar su valor. Esto corresponde a la variable :makevar:" "`exec_prefix` en el archivo de nivel superior :file:`Makefile` y el " "argumento ``--exec-prefix`` a la secuencia de comandos (*script*) :program:" "`configure` en tiempo de compilación. El valor está disponible para el " "código de Python como ``sys.exec_prefix``. Solo es útil en Unix." #: ../Doc/c-api/init.rst:430 msgid "" "Background: The exec-prefix differs from the prefix when platform dependent " "files (such as executables and shared libraries) are installed in a " "different directory tree. In a typical installation, platform dependent " "files may be installed in the :file:`/usr/local/plat` subtree while platform " "independent may be installed in :file:`/usr/local`." msgstr "" "Antecedentes: el prefijo *exec* difiere del prefijo cuando los archivos " "dependientes de la plataforma (como ejecutables y bibliotecas compartidas) " "se instalan en un árbol de directorios diferente. En una instalación típica, " "los archivos dependientes de la plataforma pueden instalarse en el subárbol :" "file:`/usr/local/plat` mientras que la plataforma independiente puede " "instalarse en :file:`/usr/local`." #: ../Doc/c-api/init.rst:436 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 " "considered the same platform, but Intel machines running Solaris 2.x are " "another platform, and Intel machines running Linux are yet another " "platform. Different major revisions of the same operating system generally " "also form different platforms. Non-Unix operating systems are a different " "story; the installation strategies on those systems are so different that " "the prefix and exec-prefix are meaningless, and set to the empty string. " "Note that compiled Python bytecode files are platform independent (but not " "independent from the Python version by which they were compiled!)." msgstr "" "En términos generales, una plataforma es una combinación de familias de " "hardware y software, por ejemplo, las máquinas Sparc que ejecutan el sistema " "operativo Solaris 2.x se consideran la misma plataforma, pero las máquinas " "Intel que ejecutan Solaris 2.x son otra plataforma, y las máquinas Intel que " "ejecutan Linux son otra plataforma más. Las diferentes revisiones " "importantes del mismo sistema operativo generalmente también forman " "plataformas diferentes. Los sistemas operativos que no son Unix son una " "historia diferente; Las estrategias de instalación en esos sistemas son tan " "diferentes que el prefijo y el prefijo ``exec`` no tienen sentido y se " "configuran en la cadena vacía. Tenga en cuenta que los archivos de bytecode " "compilados de Python son independientes de la plataforma (¡pero no " "independientes de la versión de Python con la que fueron compilados!)." #: ../Doc/c-api/init.rst:447 msgid "" "System administrators will know how to configure the :program:`mount` or :" "program:`automount` programs to share :file:`/usr/local` between platforms " "while having :file:`/usr/local/plat` be a different filesystem for each " "platform." msgstr "" "Los administradores de sistemas sabrán cómo configurar los programas :" "program:`mount` o :program:`automount` para compartir :file:`/usr/local` " "entre plataformas mientras que :file:`/usr/local/plat` sea un sistema de " "archivos diferente para cada plataforma." #: ../Doc/c-api/init.rst:465 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 " "into static storage; the caller should not modify its value. The value is " "available to Python code as ``sys.executable``." msgstr "" "Retorna el nombre completo del programa del ejecutable de Python; esto se " "calcula como un efecto secundario de derivar la ruta de búsqueda " "predeterminada del módulo del nombre del programa (establecido por :c:func:" "`Py_SetProgramName` arriba). La cadena de caracteres retornada apunta al " "almacenamiento estático; la persona que llama no debe modificar su valor. El " "valor está disponible para el código de Python como ``sys.executable``." #: ../Doc/c-api/init.rst:485 msgid "" "Return the default module search path; this is computed from the program " "name (set by :c:func:`Py_SetProgramName` above) 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 " "string points into static storage; the caller should not modify its value. " "The list :data:`sys.path` is initialized with this value on interpreter " "startup; it can be (and usually is) modified later to change the search path " "for loading modules." msgstr "" "Retorna la ruta de búsqueda del módulo predeterminado; esto se calcula a " "partir del nombre del programa (establecido por :c:func:`Py_SetProgramName` " "antes mencionado) y algunas variables de entorno. La cadena de caracteres " "retornada consiste en una serie de nombres de directorio separados por un " "carácter delimitador dependiente de la plataforma. El carácter delimitador " "es ``':'`` en Unix y macOS, ``';'`` en Windows. La cadena de caracteres " "retornada apunta al almacenamiento estático; la persona que llama no debe " "modificar su valor. La lista :data:`sys.path` se inicializa con este valor " "en el inicio del intérprete; se puede (y generalmente se realiza) modificar " "más adelante para cambiar la ruta de búsqueda para cargar módulos." #: ../Doc/c-api/init.rst:511 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 "" # Actualmente se está usando el sistema operativo macOS, mientras que Mac OS X # es un versión más antigua de la misma. #: ../Doc/c-api/init.rst:516 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 "" "Establece la ruta de búsqueda del módulo predeterminado. Si se llama a esta " "función antes de :c:func:`Py_Initialize`, entonces :c:func:`Py_GetPath` no " "intentará computar una ruta de búsqueda predeterminada, sino que utilizará " "la proporcionada en su lugar. Esto es útil si Python está incrustado por una " "aplicación que tiene pleno conocimiento de la ubicación de todos los " "módulos. Los componentes de la ruta deben estar separados por el carácter " "delimitador dependiente de la plataforma, el cual es ``':'`` en Unix y " "macOS, ``';'`` en Windows." #: ../Doc/c-api/init.rst:524 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 "" "Esto también hace que :data:`sys.executable` se configure en la ruta " "completa del programa (consulte :c:func:`Py_GetProgramFullPath`) y para :" "data:`sys.prefix` y :data:`sys.exec_prefix` a estar vacío. Depende de la " "persona que llama modificarlos si es necesario después de llamar :c:func:" "`Py_Initialize`." #: ../Doc/c-api/init.rst:532 msgid "" "The path argument is copied internally, so the caller may free it after the " "call completes." msgstr "" "El argumento de ruta se copia internamente, por lo que la persona que llama " "puede liberarlo después de que se complete la llamada." #: ../Doc/c-api/init.rst:535 msgid "" "The program full path is now used for :data:`sys.executable`, instead of the " "program name." msgstr "" "La ruta completa del programa ahora se usa para :data:`sys.executable`, en " "lugar del nombre del programa." #: ../Doc/c-api/init.rst:544 msgid "" "Return the version of this Python interpreter. This is a string that looks " "something like ::" msgstr "" "Retorna la versión de este intérprete de Python. Esta es una cadena de " "caracteres que se parece a ::" #: ../Doc/c-api/init.rst:551 #, fuzzy 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 " "period. The returned string points into static storage; the caller should " "not modify its value. The value is available to Python code as :data:`sys." "version`." msgstr "" "La primera palabra (hasta el primer carácter de espacio) es la versión " "actual de Python; los primeros tres caracteres son la versión mayor y menor " "separados por un punto. La cadena de caracteres retornada apunta al " "almacenamiento estático; la persona que llama no debe modificar su valor. El " "valor está disponible para el código Python como :data:`sys.version`." #: ../Doc/c-api/init.rst:556 msgid "See also the :c:var:`Py_Version` constant." msgstr "" #: ../Doc/c-api/init.rst:563 msgid "" "Return the platform identifier for the current platform. On Unix, this is " "formed from the \"official\" name of the operating system, converted to " "lower case, followed by the major revision number; e.g., for Solaris 2.x, " "which is also known as SunOS 5.x, the value is ``'sunos5'``. On macOS, it " "is ``'darwin'``. On Windows, it is ``'win'``. The returned string points " "into static storage; the caller should not modify its value. The value is " "available to Python code as ``sys.platform``." msgstr "" "Retorna el identificador de plataforma para la plataforma actual. En Unix, " "esto se forma a partir del nombre \"oficial\" del sistema operativo, " "convertido a minúsculas, seguido del número de revisión principal; por " "ejemplo, para Solaris 2.x, que también se conoce como SunOS 5.x, el valor es " "``'sunos5'``. En macOS, es `` 'darwin'``. En Windows, es ``'win'``. La " "cadena de caracteres retornada apunta al almacenamiento estático; la persona " "que llama no debe modificar su valor. El valor está disponible para el " "código de Python como ``sys.platform``." #: ../Doc/c-api/init.rst:574 msgid "" "Return the official copyright string for the current Python version, for " "example" msgstr "" "Retorna la cadena de caracteres de copyright oficial para la versión actual " "de Python, por ejemplo" #: ../Doc/c-api/init.rst:576 msgid "``'Copyright 1991-1995 Stichting Mathematisch Centrum, Amsterdam'``" msgstr "``'Copyright 1991-1995 Stichting Mathematisch Centrum, Amsterdam'``" #: ../Doc/c-api/init.rst:580 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 "" "La cadena de caracteres retornada apunta al almacenamiento estático; la " "persona que llama no debe modificar su valor. El valor está disponible para " "el código de Python como ``sys.copyright``." #: ../Doc/c-api/init.rst:586 msgid "" "Return an indication of the compiler used to build the current Python " "version, in square brackets, for example::" msgstr "" "Retorna una indicación del compilador utilizado para construir la versión " "actual de Python, entre corchetes, por ejemplo:" #: ../Doc/c-api/init.rst:593 ../Doc/c-api/init.rst:607 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 "" "La cadena de caracteres retornada apunta al almacenamiento estático; la " "persona que llama no debe modificar su valor. El valor está disponible para " "el código Python como parte de la variable ``sys.version``." #: ../Doc/c-api/init.rst:600 msgid "" "Return information about the sequence number and build date and time of the " "current Python interpreter instance, for example ::" msgstr "" "Retorna información sobre el número de secuencia y la fecha y hora de " "compilación de la instancia actual de intérprete de Python, por ejemplo::" #: ../Doc/c-api/init.rst:619 msgid "" "This API is kept for backward compatibility: setting :c:member:`PyConfig." "argv`, :c:member:`PyConfig.parse_argv` and :c:member:`PyConfig.safe_path` " "should be used instead, see :ref:`Python Initialization Configuration `." msgstr "" #: ../Doc/c-api/init.rst:624 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 " "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 *argv* can be an " "empty string. If this function fails to initialize :data:`sys.argv`, a " "fatal condition is signalled using :c:func:`Py_FatalError`." msgstr "" "Establece :data:`sys.argv` basado en *argc* y *argv*. Estos parámetros son " "similares a los pasados a la función del programa :c:func:`main` con la " "diferencia de que la primera entrada debe referirse al archivo de la " "secuencia de comandos (*script*) que se ejecutará en lugar del ejecutable " "que aloja el intérprete de Python. Si no se ejecuta una secuencia de " "comandos (*script*), la primera entrada en *argv* puede ser una cadena de " "caracteres vacía. Si esta función no puede inicializar :data:`sys.argv`, una " "condición fatal se señala usando :c:func:`Py_FatalError`." #: ../Doc/c-api/init.rst:632 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 "" "Si *updatepath* es cero, esto es todo lo que hace la función. Si " "*updatepath* no es cero, la función también modifica :data:`sys.path` de " "acuerdo con el siguiente algoritmo:" #: ../Doc/c-api/init.rst:636 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 "" "Si el nombre de una secuencia de comandos (*script*) existente se pasa en " "``argv[0]``, la ruta absoluta del directorio donde se encuentra el *script* " "se antepone a :data:`sys.path`." #: ../Doc/c-api/init.rst:639 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 "" "De lo contrario (es decir, si *argc* es ``0`` o ``argv[0]`` no apunta a un " "nombre de archivo existente), una cadena de caracteres vacía se antepone a :" "data:`sys.path`, que es lo mismo que anteponer el directorio de trabajo " "actual (``\".\"``)." #: ../Doc/c-api/init.rst:647 ../Doc/c-api/init.rst:683 msgid "" "See also :c:member:`PyConfig.orig_argv` and :c:member:`PyConfig.argv` " "members of the :ref:`Python Initialization Configuration `." msgstr "" #: ../Doc/c-api/init.rst:651 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 "" "Se recomienda que las aplicaciones que incorporan el intérprete de Python " "para otros fines que no sean ejecutar una sola secuencia de comandos " "(*script*) pasen ``0`` como *updatepath* y actualicen :data:`sys.path` si lo " "desean. Ver `CVE-2008-5983 ` _." #: ../Doc/c-api/init.rst:656 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 "" "En las versiones anteriores a 3.1.3, puede lograr el mismo efecto quitando " "manualmente el primer elemento (*popping*) :data:`sys.path` después de haber " "llamado :c:func:`PySys_SetArgv`, por ejemplo usando ::" #: ../Doc/c-api/init.rst:672 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 "" #: ../Doc/c-api/init.rst:676 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 "" "Esta función funciona como :c:func:`PySys_SetArgvEx` con *updatepath* " "establecido en ``1`` a menos que el intérprete :program:`python` se haya " "iniciado con la opción :option:`-I`." #: ../Doc/c-api/init.rst:686 msgid "The *updatepath* value depends on :option:`-I`." msgstr "El valor *updatepath* depende de la opción :option:`-I`." #: ../Doc/c-api/init.rst:693 msgid "" "This API is kept for backward compatibility: setting :c:member:`PyConfig." "home` should be used instead, see :ref:`Python Initialization Configuration " "`." msgstr "" #: ../Doc/c-api/init.rst:697 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 "" "Establece el directorio \"inicio\" (*\"home\"*) predeterminado, es decir, la " "ubicación de las bibliotecas estándar de Python. Ver :envvar:`PYTHONHOME` " "para el significado de la cadena de caracteres de argumento." #: ../Doc/c-api/init.rst:701 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 " "execution. No code in the Python interpreter will change the contents of " "this storage." msgstr "" "El argumento debe apuntar a una cadena de caracteres terminada en cero en el " "almacenamiento estático cuyo contenido no cambiará mientras dure la " "ejecución del programa. Ningún código en el intérprete de Python cambiará el " "contenido de este almacenamiento." #: ../Doc/c-api/init.rst:714 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." msgstr "" "Retorna el \"inicio\" (*home*) predeterminado, es decir, el valor " "establecido por una llamada anterior a :c:func:`Py_SetPythonHome`, o el " "valor de la variable de entorno :envvar:`PYTHONHOME` si está configurado." #: ../Doc/c-api/init.rst:728 msgid "Thread State and the Global Interpreter Lock" msgstr "Estado del hilo y el bloqueo global del intérprete" #: ../Doc/c-api/init.rst:735 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 " "interpreter lock` or :term:`GIL`, that must be held by the current thread " "before it can safely access Python objects. Without the lock, even the " "simplest operations could cause problems in a multi-threaded program: for " "example, when two threads simultaneously increment the reference count of " "the same object, the reference count could end up being incremented only " "once instead of twice." msgstr "" "El intérprete de Python no es completamente seguro para hilos (*thread-" "safe*). Para admitir programas Python multiproceso, hay un bloqueo global, " "denominado :term:`global interpreter lock` o :term:`GIL`, que debe mantener " "el hilo actual antes de que pueda acceder de forma segura a los objetos " "Python. Sin el bloqueo, incluso las operaciones más simples podrían causar " "problemas en un programa de hilos múltiples: por ejemplo, cuando dos hilos " "incrementan simultáneamente el conteo de referencias del mismo objeto, el " "conteo de referencias podría terminar incrementándose solo una vez en lugar " "de dos veces." #: ../Doc/c-api/init.rst:745 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 " "to emulate concurrency of execution, the interpreter regularly tries to " "switch threads (see :func:`sys.setswitchinterval`). The lock is also " "released around potentially blocking I/O operations like reading or writing " "a file, so that other Python threads can run in the meantime." msgstr "" "Por lo tanto, existe la regla de que solo el hilo que ha adquirido :term:" "`GIL` puede operar en objetos Python o llamar a funciones API Python/C. Para " "emular la concurrencia de ejecución, el intérprete regularmente intenta " "cambiar los hilos (ver :func:`sys.setswitchinterval`). El bloqueo también se " "libera para bloquear potencialmente las operaciones de E/S, como leer o " "escribir un archivo, para que otros hilos de Python puedan ejecutarse " "mientras tanto." #: ../Doc/c-api/init.rst:756 msgid "" "The Python interpreter keeps some thread-specific bookkeeping information " "inside a data structure called :c:type:`PyThreadState`. There's also one " "global variable pointing to the current :c:type:`PyThreadState`: it can be " "retrieved using :c:func:`PyThreadState_Get`." msgstr "" "El intérprete de Python mantiene cierta información de contabilidad " "específica de hilos dentro de una estructura de datos llamada :c:type:" "`PyThreadState`. También hay una variable global que apunta a la actual :c:" "type:`PyThreadState`: se puede recuperar usando :c:func:`PyThreadState_Get`." #: ../Doc/c-api/init.rst:762 msgid "Releasing the GIL from extension code" msgstr "Liberando el GIL del código de extensión" #: ../Doc/c-api/init.rst:764 msgid "" "Most extension code manipulating the :term:`GIL` has the following simple " "structure::" msgstr "" "La mayoría del código de extensión que manipula el :term:`GIL` tiene la " "siguiente estructura simple ::" #: ../Doc/c-api/init.rst:773 msgid "This is so common that a pair of macros exists to simplify it::" msgstr "Esto es tan común que existen un par de macros para simplificarlo:" #: ../Doc/c-api/init.rst:783 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 "" "La macro :c:macro:`Py_BEGIN_ALLOW_THREADS` abre un nuevo bloque y declara " "una variable local oculta; la macro :c:macro:`Py_END_ALLOW_THREADS` cierra " "el bloque." #: ../Doc/c-api/init.rst:787 msgid "The block above expands to the following code::" msgstr "El bloque anterior se expande al siguiente código::" #: ../Doc/c-api/init.rst:799 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 " "and saving the thread state, the current thread state pointer must be " "retrieved before the lock is released (since another thread could " "immediately acquire the lock and store its own thread state in the global " "variable). Conversely, when acquiring the lock and restoring the thread " "state, the lock must be acquired before storing the thread state pointer." msgstr "" "Así es como funcionan estas funciones: el bloqueo global del intérprete se " "usa para proteger el puntero al estado actual del hilo. Al liberar el " "bloqueo y guardar el estado del hilo, el puntero del estado del hilo actual " "debe recuperarse antes de que se libere el bloqueo (ya que otro hilo podría " "adquirir inmediatamente el bloqueo y almacenar su propio estado de hilo en " "la variable global). Por el contrario, al adquirir el bloqueo y restaurar el " "estado del hilo, el bloqueo debe adquirirse antes de almacenar el puntero " "del estado del hilo." #: ../Doc/c-api/init.rst:808 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 " "which don't need access to Python objects, such as compression or " "cryptographic functions operating over memory buffers. For example, the " "standard :mod:`zlib` and :mod:`hashlib` modules release the GIL when " "compressing or hashing data." msgstr "" "Llamar a las funciones de E/S del sistema es el caso de uso más común para " "liberar el GIL, pero también puede ser útil antes de llamar a cálculos de " "larga duración que no necesitan acceso a objetos de Python, como las " "funciones de compresión o criptográficas que operan sobre memorias " "intermedias. Por ejemplo, los módulos estándar :mod:`zlib` y :mod:`hashlib` " "liberan el GIL al comprimir o mezclar datos." #: ../Doc/c-api/init.rst:819 msgid "Non-Python created threads" msgstr "Hilos creados sin Python" #: ../Doc/c-api/init.rst:821 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 " "the code showed above is therefore correct. However, when threads are " "created from C (for example by a third-party library with its own thread " "management), they don't hold the GIL, nor is there a thread state structure " "for them." msgstr "" "Cuando se crean hilos utilizando las API dedicadas de Python (como el " "módulo :mod:`threading`), se les asocia automáticamente un estado del hilo " "y, por lo tanto, el código que se muestra arriba es correcto. Sin embargo, " "cuando los hilos se crean desde C (por ejemplo, por una biblioteca de " "terceros con su propia administración de hilos), no contienen el GIL, ni " "existe una estructura de estado de hilos para ellos." #: ../Doc/c-api/init.rst:828 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 " "must first register these threads with the interpreter by creating a thread " "state data structure, then acquiring the GIL, and finally storing their " "thread state pointer, before you can start using the Python/C API. When you " "are done, you should reset the thread state pointer, release the GIL, and " "finally free the thread state data structure." msgstr "" "Si necesita llamar al código Python desde estos subprocesos (a menudo esto " "será parte de una API de devolución de llamada proporcionada por la " "biblioteca de terceros mencionada anteriormente), primero debe registrar " "estos subprocesos con el intérprete creando una estructura de datos de " "estado del subproceso, luego adquiriendo el GIL, y finalmente almacenando su " "puntero de estado de hilo, antes de que pueda comenzar a usar la API Python/" "C Cuando haya terminado, debe restablecer el puntero del estado del hilo, " "liberar el GIL y finalmente liberar la estructura de datos del estado del " "hilo." #: ../Doc/c-api/init.rst:836 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 "" "Las funciones :c:func:`PyGILState_Ensure` y :c:func:`PyGILState_Release` " "hacen todo lo anterior automáticamente. El idioma típico para llamar a " "Python desde un hilo C es::" #: ../Doc/c-api/init.rst:850 msgid "" "Note that the ``PyGILState_*`` functions assume there is only one global " "interpreter (created automatically by :c:func:`Py_Initialize`). Python " "supports the creation of additional interpreters (using :c:func:" "`Py_NewInterpreter`), but mixing multiple interpreters and the " "``PyGILState_*`` API is unsupported." msgstr "" #: ../Doc/c-api/init.rst:860 msgid "Cautions about fork()" msgstr "Precauciones sobre ``fork()``" #: ../Doc/c-api/init.rst:862 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 " "process forks only the thread that issued the fork will exist. This has a " "concrete impact both on how locks must be handled and on all stored state in " "CPython's runtime." msgstr "" "Otra cosa importante a tener en cuenta sobre los hilos es su comportamiento " "frente a la llamada C :c:func:`fork`. En la mayoría de los sistemas con :c:" "func:`fork`, después de que un proceso se bifurca, solo existirá el hilo que " "emitió el *fork*. Esto tiene un impacto concreto tanto en cómo se deben " "manejar las cerraduras como en todo el estado almacenado en el tiempo de " "ejecución de CPython." #: ../Doc/c-api/init.rst:868 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` " "by acquiring the locks it uses internally before the fork, and releasing " "them afterwards. In addition, it resets any :ref:`lock-objects` in the " "child. When extending or embedding Python, there is no way to inform Python " "of additional (non-Python) locks that need to be acquired before or reset " "after a fork. OS facilities such as :c:func:`pthread_atfork` would need to " "be used to accomplish the same thing. Additionally, when extending or " "embedding Python, calling :c:func:`fork` directly rather than through :func:" "`os.fork` (and returning to or calling into Python) may result in a deadlock " "by one of Python's internal locks being held by a thread that is defunct " "after the fork. :c:func:`PyOS_AfterFork_Child` tries to reset the necessary " "locks, but is not always able to." msgstr "" "El hecho de que solo permanezca al hilo \"actual\" significa que ningún " "bloqueo retenido por otros hilos nunca se liberará. Python resuelve esto " "para :func:`os.fork` adquiriendo los bloqueos que usa internamente antes de " "la bifurcación (*fork*) y soltándolos después. Además, restablece cualquier :" "ref:`lock-objects` en el elemento secundario. Al extender o incrustar " "Python, no hay forma de informar a Python de bloqueos adicionales (que no " "sean Python) que deben adquirirse antes o restablecerse después de una " "bifurcación. Las instalaciones del sistema operativo como :c:func:" "`pthread_atfork` tendrían que usarse para lograr lo mismo. Además, al " "extender o incrustar Python, llamando :c:func:`fork` directamente en lugar " "de a través de :func:`os.fork` (y retornar o llamar a Python) puede resultar " "en un punto muerto (*deadlock*) por uno de los bloqueos internos de Python. " "sostenido por un hilo que no funciona después del *fork*. :c:func:" "`PyOS_AfterFork_Child` intenta restablecer los bloqueos necesarios, pero no " "siempre puede hacerlo." #: ../Doc/c-api/init.rst:883 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 " "means finalizing all other :c:type:`PyThreadState` objects belonging to the " "current interpreter and all other :c:type:`PyInterpreterState` objects. Due " "to this and the special nature of the :ref:`\"main\" interpreter `, :c:func:`fork` should only be called in that " "interpreter's \"main\" thread, where the CPython global runtime was " "originally initialized. The only exception is if :c:func:`exec` will be " "called immediately after." msgstr "" "El hecho de que todos los otros hilos desaparezcan también significa que el " "estado de ejecución de CPython debe limpiarse correctamente, lo que :func:" "`os.fork` lo hace. Esto significa finalizar todos los demás objetos :c:type:" "`PyThreadState` que pertenecen al intérprete actual y todos los demás " "objetos :c:type:`PyInterpreterState`. Debido a esto y a la naturaleza " "especial del :ref:`intérprete \"principal\" `, :c:" "func:`fork` solo debería llamarse en el hilo \"principal\" de ese " "intérprete, donde el CPython global el tiempo de ejecución se inicializó " "originalmente. La única excepción es si :c:func:`exec` se llamará " "inmediatamente después." #: ../Doc/c-api/init.rst:896 msgid "High-level API" msgstr "API de alto nivel" #: ../Doc/c-api/init.rst:898 msgid "" "These are the most commonly used types and functions when writing C " "extension code, or when embedding the Python interpreter:" msgstr "" "Estos son los tipos y funciones más utilizados al escribir código de " "extensión C o al incrustar el intérprete de Python:" #: ../Doc/c-api/init.rst:903 msgid "" "This data structure represents the state shared by a number of cooperating " "threads. Threads belonging to the same interpreter share their module " "administration and a few other internal items. There are no public members " "in this structure." msgstr "" "Esta estructura de datos representa el estado compartido por varios " "subprocesos cooperantes. Los hilos que pertenecen al mismo intérprete " "comparten la administración de su módulo y algunos otros elementos internos. " "No hay miembros públicos en esta estructura." #: ../Doc/c-api/init.rst:908 msgid "" "Threads belonging to different interpreters initially share nothing, except " "process state like available memory, open file descriptors and such. The " "global interpreter lock is also shared by all threads, regardless of to " "which interpreter they belong." msgstr "" "Los hilos que pertenecen a diferentes intérpretes inicialmente no comparten " "nada, excepto el estado del proceso como memoria disponible, descriptores de " "archivos abiertos y demás. El bloqueo global del intérprete también es " "compartido por todos los hilos, independientemente de a qué intérprete " "pertenezcan." #: ../Doc/c-api/init.rst:916 #, fuzzy msgid "" "This data structure represents the state of a single thread. The only " "public data member is :attr:`interp` (:c:expr:`PyInterpreterState *`), which " "points to this thread's interpreter state." msgstr "" "Esta estructura de datos representa el estado de un solo hilo. El único " "miembro de datos públicos es :attr:`interp` (:c:type:`PyInterpreterState " "*`), que apunta al estado del intérprete de este hilo." #: ../Doc/c-api/init.rst:929 msgid "Deprecated function which does nothing." msgstr "Función deprecada que no hace nada." #: ../Doc/c-api/init.rst:931 msgid "" "In Python 3.6 and older, this function created the GIL if it didn't exist." msgstr "" "En Python 3.6 y versiones anteriores, esta función creaba el GIL si no " "existía." #: ../Doc/c-api/init.rst:933 msgid "The function now does nothing." msgstr "La función ahora no hace nada." #: ../Doc/c-api/init.rst:936 msgid "" "This function is now called by :c:func:`Py_Initialize()`, so you don't have " "to call it yourself anymore." msgstr "" "Esta función ahora es llamada por :c:func:`Py_Initialize()`, por lo que ya " "no tiene que llamarla usted mismo." #: ../Doc/c-api/init.rst:940 msgid "" "This function cannot be called before :c:func:`Py_Initialize()` anymore." msgstr "Esta función ya no se puede llamar antes de :c:func:`Py_Initialize()`." #: ../Doc/c-api/init.rst:950 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 "" "Retorna un valor distinto de cero si se ha llamado a :c:func:" "`PyEval_InitThreads`. Esta función se puede invocar sin mantener el GIL y, " "por lo tanto, se puede utilizar para evitar llamadas a la API de bloqueo " "cuando se ejecuta un solo hilo." #: ../Doc/c-api/init.rst:954 msgid "The :term:`GIL` is now initialized by :c:func:`Py_Initialize()`." msgstr "" "El término :term:`GIL` ahora se inicializa con :c:func:`Py_Initialize()`." #: ../Doc/c-api/init.rst:962 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 " "``NULL``). If the lock has been created, the current thread must have " "acquired it." msgstr "" "Libere el bloqueo global del intérprete (si se ha creado) y restablezca el " "estado del hilo a ``NULL``, retornando el estado del hilo anterior (que no " "es ``NULL``). Si se ha creado el bloqueo, el hilo actual debe haberlo " "adquirido." #: ../Doc/c-api/init.rst:970 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 " "created, the current thread must not have acquired it, otherwise deadlock " "ensues." msgstr "" "Adquiera el bloqueo global del intérprete (si se ha creado) y establezca el " "estado del hilo en *tstate*, que no debe ser ``NULL``. Si se ha creado el " "bloqueo, el hilo actual no debe haberlo adquirido, de lo contrario se " "produce un *deadlock*." #: ../Doc/c-api/init.rst:976 ../Doc/c-api/init.rst:1022 #: ../Doc/c-api/init.rst:1304 ../Doc/c-api/init.rst:1342 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 "" "Llamar a esta función desde un hilo cuando finalice el tiempo de ejecución " "terminará el hilo, incluso si Python no creó el hilo. Puede usar :c:func:" "`_Py_IsFinalizing` o :func:`sys.is_finalizing` para verificar si el " "intérprete está en proceso de finalización antes de llamar a esta función " "para evitar una terminación no deseada." #: ../Doc/c-api/init.rst:984 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 "" "Retorna el estado actual del hilo. Se debe mantener el bloqueo global del " "intérprete. Cuando el estado actual del hilo es ``NULL``, esto genera un " "error fatal (por lo que la persona que llama no necesita verificar ``NULL``)." #: ../Doc/c-api/init.rst:991 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 "" "Cambia el estado del hilo actual con el estado del hilo dado por el " "argumento *tstate*, que puede ser ``NULL``. El bloqueo global del intérprete " "debe mantenerse y no se libera." #: ../Doc/c-api/init.rst:996 msgid "" "The following functions use thread-local storage, and are not compatible " "with sub-interpreters:" msgstr "" "Las siguientes funciones utilizan almacenamiento local de hilos y no son " "compatibles con subinterpretes:" #: ../Doc/c-api/init.rst:1001 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 " "be called as many times as desired by a thread as long as each call is " "matched with a call to :c:func:`PyGILState_Release`. In general, other " "thread-related APIs may be used between :c:func:`PyGILState_Ensure` and :c:" "func:`PyGILState_Release` calls as long as the thread state is restored to " "its previous state before the Release(). For example, normal usage of the :" "c:macro:`Py_BEGIN_ALLOW_THREADS` and :c:macro:`Py_END_ALLOW_THREADS` macros " "is acceptable." msgstr "" "Asegúrese de que el subproceso actual esté listo para llamar a la API de " "Python C, independientemente del estado actual de Python o del bloqueo " "global del intérprete. Esto se puede invocar tantas veces como lo desee un " "subproceso siempre que cada llamada coincida con una llamada a :c:func:" "`PyGILState_Release`. En general, se pueden usar otras API relacionadas con " "subprocesos entre :c:func:`PyGILState_Ensure` y :c:func:`PyGILState_Release` " "invoca siempre que el estado del subproceso se restablezca a su estado " "anterior antes del *Release()*. Por ejemplo, el uso normal de las macros :c:" "macro:`Py_BEGIN_ALLOW_THREADS` y :c:macro:`Py_END_ALLOW_THREADS` es " "aceptable." #: ../Doc/c-api/init.rst:1011 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:" "`PyGILState_Release` to ensure Python is left in the same state. Even though " "recursive calls are allowed, these handles *cannot* be shared - each unique " "call to :c:func:`PyGILState_Ensure` must save the handle for its call to :c:" "func:`PyGILState_Release`." msgstr "" "El valor de retorno es un \"identificador\" opaco al estado del hilo cuando :" "c:func:`PyGILState_Ensure` fue llamado, y debe pasarse a :c:func:" "`PyGILState_Release` para asegurar que Python se deje en el mismo estado. " "Aunque las llamadas recursivas están permitidas, estos identificadores *no* " "pueden compartirse; cada llamada única a :c:func:`PyGILState_Ensure` debe " "guardar el identificador para su llamada a :c:func:`PyGILState_Release`." #: ../Doc/c-api/init.rst:1018 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 "" "Cuando la función regrese, el hilo actual contendrá el GIL y podrá llamar a " "código arbitrario de Python. El fracaso es un error fatal." #: ../Doc/c-api/init.rst:1030 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:" "`PyGILState_Ensure` call (but generally this state will be unknown to the " "caller, hence the use of the GILState API)." msgstr "" "Libera cualquier recurso previamente adquirido. Después de esta llamada, el " "estado de Python será el mismo que antes de la llamada correspondiente :c:" "func:`PyGILState_Ensure` (pero en general este estado será desconocido para " "la persona que llama, de ahí el uso de la API ``GILState``)." #: ../Doc/c-api/init.rst:1035 msgid "" "Every call to :c:func:`PyGILState_Ensure` must be matched by a call to :c:" "func:`PyGILState_Release` on the same thread." msgstr "" "Cada llamada a :c:func:`PyGILState_Ensure` debe coincidir con una llamada a :" "c:func:`PyGILState_Release` en el mismo hilo." #: ../Doc/c-api/init.rst:1041 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 " "always has such a thread-state, even if no auto-thread-state call has been " "made on the main thread. This is mainly a helper/diagnostic function." msgstr "" "Obtenga el estado actual del hilo para este hilo. Puede retornar ``NULL`` si " "no se ha utilizado la API ``GILState`` en el hilo actual. Tenga en cuenta " "que el subproceso principal siempre tiene dicho estado de subproceso, " "incluso si no se ha realizado una llamada de estado de subproceso automático " "en el subproceso principal. Esta es principalmente una función auxiliar y de " "diagnóstico." #: ../Doc/c-api/init.rst:1049 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 " "its Python thread state initialized and currently is holding the GIL will it " "return ``1``. This is mainly a helper/diagnostic function. It can be useful " "for example in callback contexts or memory allocation functions when knowing " "that the GIL is locked can allow the caller to perform sensitive actions or " "otherwise behave differently." msgstr "" "Retorna ``1`` si el hilo actual mantiene el GIL y ``0`` de lo contrario. " "Esta función se puede llamar desde cualquier hilo en cualquier momento. Solo " "si se ha inicializado el hilo de Python y actualmente mantiene el GIL, " "retornará ``1``. Esta es principalmente una función auxiliar y de " "diagnóstico. Puede ser útil, por ejemplo, en contextos de devolución de " "llamada o funciones de asignación de memoria cuando saber que el GIL está " "bloqueado puede permitir que la persona que llama realice acciones " "confidenciales o se comporte de otra manera de manera diferente." #: ../Doc/c-api/init.rst:1061 msgid "" "The following macros are normally used without a trailing semicolon; look " "for example usage in the Python source distribution." msgstr "" "Las siguientes macros se usan normalmente sin punto y coma final; busque, " "por ejemplo, el uso en la distribución fuente de Python." #: ../Doc/c-api/init.rst:1067 msgid "" "This macro expands to ``{ PyThreadState *_save; _save = PyEval_SaveThread();" "``. Note that it contains an opening brace; it must be matched with a " "following :c:macro:`Py_END_ALLOW_THREADS` macro. See above for further " "discussion of this macro." msgstr "" "Esta macro se expande a ``{PyThreadState *_save; _save = PyEval_SaveThread();" "``. Tenga en cuenta que contiene una llave de apertura; debe coincidir con " "la siguiente macro :c:macro:`Py_END_ALLOW_THREADS`. Ver arriba para una " "discusión más detallada de esta macro." #: ../Doc/c-api/init.rst:1075 msgid "" "This macro expands to ``PyEval_RestoreThread(_save); }``. Note that it " "contains a closing brace; it must be matched with an earlier :c:macro:" "`Py_BEGIN_ALLOW_THREADS` macro. See above for further discussion of this " "macro." msgstr "" "Esta macro se expande a ``PyEval_RestoreThread(_save); }``. Tenga en cuenta " "que contiene una llave de cierre; debe coincidir con una macro anterior :c:" "macro:`Py_BEGIN_ALLOW_THREADS`. Ver arriba para una discusión más detallada " "de esta macro." #: ../Doc/c-api/init.rst:1083 msgid "" "This macro expands to ``PyEval_RestoreThread(_save);``: it is equivalent to :" "c:macro:`Py_END_ALLOW_THREADS` without the closing brace." msgstr "" "Esta macro se expande a ``PyEval_RestoreThread(_save);``: es equivalente a :" "c:macro:`Py_END_ALLOW_THREADS` sin la llave de cierre." #: ../Doc/c-api/init.rst:1089 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 "" "Esta macro se expande a ``_save = PyEval_SaveThread();``: es equivalente a :" "c:macro:`Py_BEGIN_ALLOW_THREADS` sin la llave de apertura y la declaración " "de variable." #: ../Doc/c-api/init.rst:1095 msgid "Low-level API" msgstr "API de bajo nivel" #: ../Doc/c-api/init.rst:1097 msgid "" "All of the following functions must be called after :c:func:`Py_Initialize`." msgstr "" "Todas las siguientes funciones deben llamarse después de :c:func:" "`Py_Initialize`." #: ../Doc/c-api/init.rst:1099 msgid ":c:func:`Py_Initialize()` now initializes the :term:`GIL`." msgstr ":c:func:`Py_Initialize()` ahora inicializa el :term:`GIL`." #: ../Doc/c-api/init.rst:1105 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 "" "Crea un nuevo objeto de estado de intérprete. No es necesario retener el " "bloqueo global del intérprete, pero se puede retener si es necesario para " "serializar llamadas a esta función." #: ../Doc/c-api/init.rst:1109 msgid "" "Raises an :ref:`auditing event ` ``cpython." "PyInterpreterState_New`` with no arguments." msgstr "" "Genera un :ref:`evento de auditoría ` ``python." "PyInterpreterState_New`` sin argumentos." #: ../Doc/c-api/init.rst:1114 msgid "" "Reset all information in an interpreter state object. The global " "interpreter lock must be held." msgstr "" "Restablece toda la información en un objeto de estado de intérprete. Se debe " "mantener el bloqueo global del intérprete." #: ../Doc/c-api/init.rst:1117 msgid "" "Raises an :ref:`auditing event ` ``cpython." "PyInterpreterState_Clear`` with no arguments." msgstr "" "Lanza una :ref:`eventos de auditoría ` ``python.PyInterpreterState " "Clear`` sin argumentos." #: ../Doc/c-api/init.rst:1122 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 "" "Destruye un objeto de estado de intérprete. No es necesario mantener el " "bloqueo global del intérprete. El estado del intérprete debe haberse " "restablecido con una llamada previa a :c:func:`PyInterpreterState_Clear`." #: ../Doc/c-api/init.rst:1129 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 "" "Crea un nuevo objeto de estado de hilo que pertenece al objeto de intérprete " "dado. No es necesario retener el bloqueo global del intérprete, pero se " "puede retener si es necesario para serializar llamadas a esta función." #: ../Doc/c-api/init.rst:1136 msgid "" "Reset all information in a thread state object. The global interpreter lock " "must be held." msgstr "" "Restablece toda la información en un objeto de estado de hilo. Se debe " "mantener el bloqueo global del intérprete." #: ../Doc/c-api/init.rst:1139 msgid "" "This function now calls the :c:member:`PyThreadState.on_delete` callback. " "Previously, that happened in :c:func:`PyThreadState_Delete`." msgstr "" "Esta función ahora llama a la retrollamada :c:member:`PyThreadState." "on_delete`. Anteriormente, eso sucedía en :c:func:`PyThreadState_Delete`." #: ../Doc/c-api/init.rst:1146 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 "" "Destruye un objeto de estado de hilo. No es necesario mantener el bloqueo " "global del intérprete. El estado del hilo debe haberse restablecido con una " "llamada previa a :c:func:`PyThreadState_Clear`." #: ../Doc/c-api/init.rst:1153 msgid "" "Destroy the current thread state and release the global interpreter lock. " "Like :c:func:`PyThreadState_Delete`, 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 "" "Destruye un objeto de estado de hilo y suelta el bloqueo del intérprete " "global. Como :c:func:`PyThreadState_Delete`, no es necesario mantener el " "bloqueo del intérprete global. El estado del hilo debe haberse restablecido " "con una llamada anterior a :c:func:`PyThreadState_Clear`." #: ../Doc/c-api/init.rst:1161 msgid "Get the current frame of the Python thread state *tstate*." msgstr "Obtiene el marco actual del estado del hilo de Python *tstate*." # Como bien tradujeron con anterioridad, está más claro el decir referencia # sólida a referencia fuerte, el cual no calzaría en este contexto. #: ../Doc/c-api/init.rst:1163 msgid "" "Return a :term:`strong reference`. Return ``NULL`` if no frame is currently " "executing." msgstr "" "Retorna una :term:`strong reference` (referencia sólida). Retorna ``NULL`` " "si no se está ejecutando ningún cuadro." #: ../Doc/c-api/init.rst:1166 msgid "See also :c:func:`PyEval_GetFrame`." msgstr "Vea también :c:func:`PyEval_GetFrame`." #: ../Doc/c-api/init.rst:1168 ../Doc/c-api/init.rst:1177 #: ../Doc/c-api/init.rst:1186 msgid "*tstate* must not be ``NULL``." msgstr "*tstate* no debe ser ``NULL``." #: ../Doc/c-api/init.rst:1175 msgid "" "Get the unique thread state identifier of the Python thread state *tstate*." msgstr "" "Obtiene el identificador de estado de subproceso único del estado del hilo " "de Python *tstate*." #: ../Doc/c-api/init.rst:1184 msgid "Get the interpreter of the Python thread state *tstate*." msgstr "Obtiene el intérprete del estado del hilo de Python *tstate*." #: ../Doc/c-api/init.rst:1193 msgid "Suspend tracing and profiling in the Python thread state *tstate*." msgstr "" #: ../Doc/c-api/init.rst:1195 msgid "Resume them using the :c:func:`PyThreadState_LeaveTracing` function." msgstr "" #: ../Doc/c-api/init.rst:1202 msgid "" "Resume tracing and profiling in the Python thread state *tstate* suspended " "by the :c:func:`PyThreadState_EnterTracing` function." msgstr "" #: ../Doc/c-api/init.rst:1205 msgid "" "See also :c:func:`PyEval_SetTrace` and :c:func:`PyEval_SetProfile` functions." msgstr "" #: ../Doc/c-api/init.rst:1213 msgid "Get the current interpreter." msgstr "Obtiene el intérprete actual." #: ../Doc/c-api/init.rst:1215 msgid "" "Issue a fatal error if there no current Python thread state or no current " "interpreter. It cannot return NULL." msgstr "" "Emite un error fatal si no hay un estado actual del hilo de Python o no hay " "un intérprete actual. No puede retornar NULL." #: ../Doc/c-api/init.rst:1218 ../Doc/c-api/init.rst:1228 msgid "The caller must hold the GIL." msgstr "La persona que llama debe retener el GIL." #: ../Doc/c-api/init.rst:1225 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 "" "Retorna la identificación única del intérprete. Si hubo algún error al " "hacerlo, entonces se retorna ``-1`` y se establece un error." #: ../Doc/c-api/init.rst:1235 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 "" "Retorna un diccionario en el que se pueden almacenar datos específicos del " "intérprete. Si esta función retorna ``NULL``, no se ha producido ninguna " "excepción y la persona que llama debe suponer que no hay disponible una " "instrucción específica del intérprete." #: ../Doc/c-api/init.rst:1239 msgid "" "This is not a replacement for :c:func:`PyModule_GetState()`, which " "extensions should use to store interpreter-specific state information." msgstr "" "Esto no reemplaza a :c:func:`PyModule_GetState()`, que las extensiones deben " "usar para almacenar información de estado específica del intérprete." #: ../Doc/c-api/init.rst:1246 msgid "Type of a frame evaluation function." msgstr "Tipo de función de evaluación de marcos." #: ../Doc/c-api/init.rst:1248 msgid "" "The *throwflag* parameter is used by the ``throw()`` method of generators: " "if non-zero, handle the current exception." msgstr "" "El parámetro *throwflag* es usado por el método de generadores ``throw()``: " "si no es cero, maneja la excepción actual." #: ../Doc/c-api/init.rst:1251 msgid "The function now takes a *tstate* parameter." msgstr "La función ahora recibe un parámetro *tstate*." #: ../Doc/c-api/init.rst:1254 msgid "" "The *frame* parameter changed from ``PyFrameObject*`` to " "``_PyInterpreterFrame*``." msgstr "" #: ../Doc/c-api/init.rst:1259 msgid "Get the frame evaluation function." msgstr "Obtiene la función de evaluación de marcos." #: ../Doc/c-api/init.rst:1261 ../Doc/c-api/init.rst:1269 msgid "See the :pep:`523` \"Adding a frame evaluation API to CPython\"." msgstr "" "Consulte :pep:`523` \"Adición de una API de evaluación de marcos a CPython\"." #: ../Doc/c-api/init.rst:1267 msgid "Set the frame evaluation function." msgstr "Configura la función de evaluación del marco." #: ../Doc/c-api/init.rst:1276 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 " "in the dictionary. It is okay to call this function when no current thread " "state is available. If this function returns ``NULL``, no exception has been " "raised and the caller should assume no current thread state is available." msgstr "" "Retorna un diccionario en el que las extensiones pueden almacenar " "información de estado específica del hilo. Cada extensión debe usar una " "clave única para almacenar el estado en el diccionario. Está bien llamar a " "esta función cuando no hay un estado del hilo actual disponible. Si esta " "función retorna ``NULL``, no se ha producido ninguna excepción y la persona " "que llama debe asumir que no hay disponible ningún estado del hilo actual." #: ../Doc/c-api/init.rst:1285 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. " "This function does not steal any references to *exc*. To prevent naive " "misuse, you must write your own C extension to call this. Must be called " "with the GIL held. Returns the number of thread states modified; this is " "normally one, but will be zero if the thread id isn't found. If *exc* is :" "const:`NULL`, the pending exception (if any) for the thread is cleared. This " "raises no exceptions." msgstr "" "Asincrónicamente lanza una excepción en un hilo. El argumento *id* es el id " "del hilo del hilo de destino; *exc* es el objeto de excepción que se debe " "generar. Esta función no roba ninguna referencia a *exc*. Para evitar el uso " "indebido ingenuo, debe escribir su propia extensión C para llamar a esto. " "Debe llamarse con el GIL retenido. Retorna el número de estados de hilo " "modificados; normalmente es uno, pero será cero si no se encuentra la " "identificación del hilo. Si *exc* es :const:`NULL`, se borra la excepción " "pendiente (si existe) para el hilo. Esto no lanza excepciones." #: ../Doc/c-api/init.rst:1293 #, fuzzy msgid "" "The type of the *id* parameter changed from :c:expr:`long` to :c:expr:" "`unsigned long`." msgstr "" "El tipo del parámetro *id* cambia de :c:type:`long` a :c:type:`unsigned " "long`." #: ../Doc/c-api/init.rst:1299 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 "" "Adquiere el bloqueo global del intérprete y establece el estado actual del " "hilo en *tstate*, que no debe ser ``NULL``. El bloqueo debe haber sido " "creado anteriormente. Si este hilo ya tiene el bloqueo, se produce un " "deadlock." #: ../Doc/c-api/init.rst:1310 ../Doc/c-api/init.rst:1348 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 "" "Actualiza para ser coherente con :c:func:`PyEval_RestoreThread`, :c:func:" "`Py_END_ALLOW_THREADS`, y :c:func:`PyGILState_Ensure`, y termina el hilo " "actual si se llama mientras el intérprete está finalizando." #: ../Doc/c-api/init.rst:1315 msgid "" ":c:func:`PyEval_RestoreThread` is a higher-level function which is always " "available (even when threads have not been initialized)." msgstr "" ":c:func:`PyEval_RestoreThread` es una función de nivel superior que siempre " "está disponible (incluso cuando los subprocesos no se han inicializado)." #: ../Doc/c-api/init.rst:1321 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 " "by the current thread. The *tstate* argument, which must not be ``NULL``, " "is only used to check that it represents the current thread state --- if it " "isn't, a fatal error is reported." msgstr "" "Restablece el estado actual del hilo a ``NULL`` y libera el bloqueo global " "del intérprete. El bloqueo debe haberse creado antes y debe estar retenido " "por el hilo actual. El argumento *tstate*, que no debe ser ``NULL``, solo se " "usa para verificar que representa el estado actual del hilo --- si no lo es, " "se informa un error fatal." #: ../Doc/c-api/init.rst:1327 msgid "" ":c:func:`PyEval_SaveThread` is a higher-level function which is always " "available (even when threads have not been initialized)." msgstr "" ":c:func:`PyEval_SaveThread` es una función de nivel superior que siempre " "está disponible (incluso cuando los hilos no se han inicializado)." #: ../Doc/c-api/init.rst:1333 msgid "" "Acquire the global interpreter lock. The lock must have been created " "earlier. If this thread already has the lock, a deadlock ensues." msgstr "" "Adquiera el bloqueo global de intérprete. El bloqueo debe haber sido creado " "anteriormente. Si este hilo ya tiene el bloqueo, se produce un *deadlock*." #: ../Doc/c-api/init.rst:1336 msgid "" "This function does not update the current thread state. Please use :c:func:" "`PyEval_RestoreThread` or :c:func:`PyEval_AcquireThread` instead." msgstr "" "Esta función no actualiza el estado actual del hilo. Utilice :c:func:" "`PyEval_RestoreThread` o :c:func:`PyEval_AcquireThread` en su lugar." #: ../Doc/c-api/init.rst:1356 msgid "" "Release the global interpreter lock. The lock must have been created " "earlier." msgstr "" "Libere el bloqueo global del intérprete. El bloqueo debe haber sido creado " "anteriormente." #: ../Doc/c-api/init.rst:1358 msgid "" "This function does not update the current thread state. Please use :c:func:" "`PyEval_SaveThread` or :c:func:`PyEval_ReleaseThread` instead." msgstr "" "Esta función no actualiza el estado actual del hilo. Utilice :c:func:" "`PyEval_SaveThread` o :c:func:`PyEval_ReleaseThread` en su lugar." #: ../Doc/c-api/init.rst:1367 msgid "Sub-interpreter support" msgstr "Soporte de subinterprete" #: ../Doc/c-api/init.rst:1369 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 " "same process and perhaps even in the same thread. Sub-interpreters allow you " "to do that." msgstr "" "Si bien en la mayoría de los usos, solo incrustará un solo intérprete de " "Python, hay casos en los que necesita crear varios intérpretes " "independientes en el mismo proceso y tal vez incluso en el mismo hilo. Los " "subinterpretes le permiten hacer eso." #: ../Doc/c-api/init.rst:1374 msgid "" "The \"main\" interpreter is the first one created when the runtime " "initializes. It is usually the only Python interpreter in a process. Unlike " "sub-interpreters, the main interpreter has unique process-global " "responsibilities like signal handling. It is also responsible for execution " "during runtime initialization and is usually the active interpreter during " "runtime finalization. The :c:func:`PyInterpreterState_Main` function " "returns a pointer to its state." msgstr "" "El intérprete \"principal\" es el primero creado cuando se inicializa el " "tiempo de ejecución. Suele ser el único intérprete de Python en un proceso. " "A diferencia de los subinterpretes, el intérprete principal tiene " "responsabilidades globales de proceso únicas, como el manejo de señales. " "También es responsable de la ejecución durante la inicialización del tiempo " "de ejecución y generalmente es el intérprete activo durante la finalización " "del tiempo de ejecución. La función :c:func:`PyInterpreterState_Main` " "retorna un puntero a su estado." #: ../Doc/c-api/init.rst:1381 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 "" "Puede cambiar entre subinterpretes utilizando la función :c:func:" "`PyThreadState_Swap`. Puede crearlos y destruirlos utilizando las siguientes " "funciones:" #: ../Doc/c-api/init.rst:1395 msgid "" "Create a new sub-interpreter. This is an (almost) totally separate " "environment for the execution of Python code. In particular, the new " "interpreter has separate, independent versions of all imported modules, " "including the fundamental modules :mod:`builtins`, :mod:`__main__` and :mod:" "`sys`. The table of loaded modules (``sys.modules``) and the module search " "path (``sys.path``) are also separate. The new environment has no ``sys." "argv`` variable. It has new standard I/O stream file objects ``sys.stdin``, " "``sys.stdout`` and ``sys.stderr`` (however these refer to the same " "underlying file descriptors)." msgstr "" "Crea un nuevo subinterprete. Este es un entorno (casi) totalmente separado " "para la ejecución de código Python. En particular, el nuevo intérprete tiene " "versiones separadas e independientes de todos los módulos importados, " "incluidos los módulos fundamentales :mod:`builtins`, :mod:`__main__` y :mod:" "`sys`. La tabla de módulos cargados (``sys.modules``) y la ruta de búsqueda " "del módulo (``sys.path``) también están separados. El nuevo entorno no tiene " "variable ``sys.argv``. Tiene nuevos objetos de archivo de flujo de E/S " "estándar ``sys.stdin``, ``sys.stdout`` y ``sys.stderr`` (sin embargo, estos " "se refieren a los mismos descriptores de archivo subyacentes)." #: ../Doc/c-api/init.rst:1405 msgid "" "The return value points to the first thread state created in the new sub-" "interpreter. This thread state is made in the current thread state. Note " "that no actual thread is created; see the discussion of thread states " "below. If creation of the new interpreter is unsuccessful, ``NULL`` is " "returned; no exception is set since the exception state is stored in the " "current thread state and there may not be a current thread state. (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; however, " "unlike most other Python/C API functions, there needn't be a current thread " "state on entry.)" msgstr "" "El valor de retorno apunta al primer estado del hilo creado en el nuevo " "subinterprete. Este estado de hilo se realiza en el estado de hilo actual. " "Tenga en cuenta que no se crea ningún hilo real; vea la discusión de los " "estados del hilo a continuación. Si la creación del nuevo intérprete no " "tiene éxito, se retorna ``NULL``; no se establece ninguna excepción, ya que " "el estado de excepción se almacena en el estado actual del hilo y es posible " "que no haya un estado actual del hilo. (Al igual que todas las otras " "funciones de Python/C API, el bloqueo global del intérprete debe mantenerse " "antes de llamar a esta función y aún se mantiene cuando regresa; sin " "embargo, a diferencia de la mayoría de las otras funciones de Python/C API, " "no es necesario que haya un estado del hilo actual en entrada.)" #: ../Doc/c-api/init.rst:1420 msgid "Extension modules are shared between (sub-)interpreters as follows:" msgstr "" "Los módulos de extensión se comparten entre (sub) intérpretes de la " "siguiente manera:" #: ../Doc/c-api/init.rst:1422 msgid "" "For modules using multi-phase initialization, e.g. :c:func:" "`PyModule_FromDefAndSpec`, a separate module object is created and " "initialized for each interpreter. Only C-level static and global variables " "are shared between these module objects." msgstr "" "Para módulos que usan inicialización multifase, por ejemplo :c:func:" "`PyModule_FromDefAndSpec`, se crea e inicializa un objeto de módulo separado " "para cada intérprete. Solo las variables estáticas y globales de nivel C se " "comparten entre estos objetos de módulo." #: ../Doc/c-api/init.rst:1428 msgid "" "For modules using single-phase initialization, e.g. :c:func:" "`PyModule_Create`, the first time a particular extension is imported, it is " "initialized normally, and a (shallow) copy of its module's dictionary is " "squirreled away. When the same extension is imported by another " "(sub-)interpreter, a new module is initialized and filled with the contents " "of this copy; the extension's ``init`` function is not called. Objects in " "the module's dictionary thus end up shared across (sub-)interpreters, which " "might cause unwanted behavior (see `Bugs and caveats`_ below)." msgstr "" "Para módulos que utilizan inicialización monofásica, por ejemplo :c:func:" "`PyModule_Create`, la primera vez que se importa una extensión en " "particular, se inicializa normalmente y una copia (superficial) del " "diccionario de su módulo se guarda. Cuando otro (sub) intérprete importa la " "misma extensión, se inicializa un nuevo módulo y se llena con el contenido " "de esta copia; no se llama a la función ``init`` de la extensión. Los " "objetos en el diccionario del módulo terminan compartidos entre (sub) " "intérpretes, lo que puede causar un comportamiento no deseado (ver Errores y " "advertencias (`Bugs and caveats`_) a continuación)." #: ../Doc/c-api/init.rst:1439 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:" "`Py_FinalizeEx` and :c:func:`Py_Initialize`; in that case, the extension's " "``initmodule`` function *is* called again. As with multi-phase " "initialization, this means that only C-level static and global variables are " "shared between these modules." msgstr "" "Tenga en cuenta que esto es diferente de lo que sucede cuando se importa una " "extensión después de que el intérprete se haya reiniciado por completo " "llamando a :c:func:`Py_FinalizeEx` y :c:func:`Py_Initialize`; en ese caso, " "la función ``initmodule`` de la extensión *es* llamada nuevamente. Al igual " "que con la inicialización de múltiples fases, esto significa que solo se " "comparten variables estáticas y globales de nivel C entre estos módulos." #: ../Doc/c-api/init.rst:1453 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 " "thread states below. When the call returns, the current thread state is " "``NULL``. All thread states associated with this interpreter are " "destroyed. (The global interpreter lock must be held before calling this " "function and is still held when it returns.) :c:func:`Py_FinalizeEx` will " "destroy all sub-interpreters that haven't been explicitly destroyed at that " "point." msgstr "" "Destruye el (sub) intérprete representado por el estado del hilo dado. El " "estado del hilo dado debe ser el estado del hilo actual. Vea la discusión de " "los estados del hilo a continuación. Cuando la llamada regresa, el estado " "actual del hilo es ``NULL``. Todos los estados de hilo asociados con este " "intérprete se destruyen. (El bloqueo global del intérprete debe mantenerse " "antes de llamar a esta función y aún se mantiene cuando vuelve). :c:func:" "`Py_FinalizeEx` destruirá todos los subinterpretes que no se hayan destruido " "explícitamente en ese punto." #: ../Doc/c-api/init.rst:1463 msgid "Bugs and caveats" msgstr "Errores y advertencias" #: ../Doc/c-api/init.rst:1465 msgid "" "Because sub-interpreters (and the main interpreter) are part of the same " "process, the insulation between them isn't perfect --- for example, using " "low-level file operations like :func:`os.close` they can (accidentally or " "maliciously) affect each other's open files. Because of the way extensions " "are shared between (sub-)interpreters, some extensions may not work " "properly; this is especially likely when using single-phase initialization " "or (static) global variables. It is possible to insert objects created in " "one sub-interpreter into a namespace of another (sub-)interpreter; this " "should be avoided if possible." msgstr "" "Debido a que los subinterpretes (y el intérprete principal) son parte del " "mismo proceso, el aislamiento entre ellos no es perfecto --- por ejemplo, " "usando operaciones de archivos de bajo nivel como :func:`os.close` pueden " "(accidentalmente o maliciosamente) afectar los archivos abiertos del otro. " "Debido a la forma en que las extensiones se comparten entre (sub) " "intérpretes, algunas extensiones pueden no funcionar correctamente; esto es " "especialmente probable cuando se utiliza la inicialización monofásica o las " "variables globales (estáticas). Es posible insertar objetos creados en un " "subinterprete en un espacio de nombres de otro (sub) intérprete; Esto debe " "evitarse si es posible." #: ../Doc/c-api/init.rst:1475 msgid "" "Special care should be taken to avoid sharing user-defined functions, " "methods, instances or classes between sub-interpreters, since import " "operations executed by such objects may affect the wrong (sub-)interpreter's " "dictionary of loaded modules. It is equally important to avoid sharing " "objects from which the above are reachable." msgstr "" "Se debe tener especial cuidado para evitar compartir funciones, métodos, " "instancias o clases definidas por el usuario entre los subinterpretes, ya " "que las operaciones de importación ejecutadas por dichos objetos pueden " "afectar el diccionario (sub-) intérprete incorrecto de los módulos cargados. " "Es igualmente importante evitar compartir objetos desde los que se pueda " "acceder a lo anterior." #: ../Doc/c-api/init.rst:1481 #, fuzzy msgid "" "Also note that combining this functionality with ``PyGILState_*`` APIs is " "delicate, because these APIs assume a bijection between Python thread states " "and OS-level threads, an assumption broken by the presence of sub-" "interpreters. It is highly recommended that you don't switch sub-" "interpreters between a pair of matching :c:func:`PyGILState_Ensure` and :c:" "func:`PyGILState_Release` calls. Furthermore, extensions (such as :mod:" "`ctypes`) using these APIs to allow calling of Python code from non-Python " "created threads will probably be broken when using sub-interpreters." msgstr "" "También tenga en cuenta que la combinación de esta funcionalidad con :c:func:" "`PyGILState_\\*` API es delicada, porque estas API suponen una biyección " "entre los estados de hilo de Python e hilos a nivel del sistema operativo, " "una suposición rota por la presencia de subinterpretes. Se recomienda " "encarecidamente que no cambie los subinterpretes entre un par de llamadas " "coincidentes :c:func:`PyGILState_Ensure` y :c:func:`PyGILState_Release`. " "Además, las extensiones (como :mod:`ctypes`) que usan estas API para " "permitir la llamada de código Python desde hilos no creados por Python " "probablemente se rompan cuando se usan subinterpretes." #: ../Doc/c-api/init.rst:1492 msgid "Asynchronous Notifications" msgstr "Notificaciones asincrónicas" #: ../Doc/c-api/init.rst:1494 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 "" "Se proporciona un mecanismo para hacer notificaciones asincrónicas al hilo " "principal del intérprete. Estas notificaciones toman la forma de un puntero " "de función y un argumento de puntero nulo." #: ../Doc/c-api/init.rst:1503 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 "" "Programa una función para que se llame desde el hilo principal del " "intérprete. En caso de éxito, se retorna ``0`` y se pone en cola *func* para " "ser llamado en el hilo principal. En caso de fallo, se retorna ``-1`` sin " "establecer ninguna excepción." #: ../Doc/c-api/init.rst:1507 msgid "" "When successfully queued, *func* will be *eventually* called from the main " "interpreter thread with the argument *arg*. It will be called " "asynchronously with respect to normally running Python code, but with both " "these conditions met:" msgstr "" "Cuando se puso en cola con éxito, *func* será *eventualmente* invocado desde " "el hilo principal del intérprete con el argumento *arg*. Se llamará de forma " "asincrónica con respecto al código Python que se ejecuta normalmente, pero " "con ambas condiciones cumplidas:" #: ../Doc/c-api/init.rst:1512 msgid "on a :term:`bytecode` boundary;" msgstr "en un límite :term:`bytecode`;" #: ../Doc/c-api/init.rst:1513 msgid "" "with the main thread holding the :term:`global interpreter lock` (*func* can " "therefore use the full C API)." msgstr "" "con el hilo principal que contiene el :term:`global interpreter lock` " "(*func*, por lo tanto, puede usar la API C completa)." #: ../Doc/c-api/init.rst:1516 msgid "" "*func* must return ``0`` on success, or ``-1`` on failure with an exception " "set. *func* won't be interrupted to perform another asynchronous " "notification recursively, but it can still be interrupted to switch threads " "if the global interpreter lock is released." msgstr "" "*func* debe retornar ``0`` en caso de éxito o ``-1`` en caso de error con " "una excepción establecida. *func* no se interrumpirá para realizar otra " "notificación asíncrona de forma recursiva, pero aún se puede interrumpir " "para cambiar hilos si se libera el bloqueo global del intérprete." #: ../Doc/c-api/init.rst:1521 msgid "" "This function doesn't need a current thread state to run, and it doesn't " "need the global interpreter lock." msgstr "" "Esta función no necesita un estado de hilo actual para ejecutarse y no " "necesita el bloqueo global del intérprete." #: ../Doc/c-api/init.rst:1524 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 "" "Para llamar a esta función en un subinterprete, quien llama debe mantener el " "GIL. De lo contrario, la función *func* se puede programar para que se llame " "desde el intérprete incorrecto." #: ../Doc/c-api/init.rst:1529 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 " "thread is busy executing a system call, *func* won't be called before the " "system call returns. This function is generally **not** suitable for " "calling Python code from arbitrary C threads. Instead, use the :ref:" "`PyGILState API`." msgstr "" "Esta es una función de bajo nivel, solo útil para casos muy especiales. No " "hay garantía de que *func* se llame lo más rápido posible. Si el hilo " "principal está ocupado ejecutando una llamada al sistema, no se llamará " "*func* antes de que vuelva la llamada del sistema. Esta función generalmente " "**no** es adecuada para llamar a código Python desde hilos C arbitrarios. En " "su lugar, use :ref:`PyGILState API `." #: ../Doc/c-api/init.rst:1536 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 " "from the main interpreter. Each subinterpreter now has its own list of " "scheduled calls." msgstr "" "Si esta función se llama en un subinterprete, la función *func* ahora está " "programada para ser llamada desde el subinterprete, en lugar de ser llamada " "desde el intérprete principal. Cada subinterprete ahora tiene su propia " "lista de llamadas programadas." #: ../Doc/c-api/init.rst:1547 msgid "Profiling and Tracing" msgstr "Perfilado y Rastreo" #: ../Doc/c-api/init.rst:1552 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 "" "El intérprete de Python proporciona soporte de bajo nivel para adjuntar " "funciones de creación de perfiles y seguimiento de ejecución. Estos se " "utilizan para herramientas de análisis de perfiles, depuración y cobertura." #: ../Doc/c-api/init.rst:1556 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 " "call instead. The essential attributes of the facility have not changed; " "the interface allows trace functions to be installed per-thread, and the " "basic events reported to the trace function are the same as had been " "reported to the Python-level trace functions in previous versions." msgstr "" "Esta interfaz C permite que el código de perfilado o rastreo evite la " "sobrecarga de llamar a través de objetos invocables a nivel de Python, " "haciendo una llamada directa a la función C en su lugar. Los atributos " "esenciales de la instalación no han cambiado; la interfaz permite instalar " "funciones de rastreo por hilos, y los eventos básicos informados a la " "función de rastreo son los mismos que se informaron a las funciones de " "rastreo a nivel de Python en versiones anteriores." #: ../Doc/c-api/init.rst:1566 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 " "the registration function as *obj*, *frame* is the frame object to which the " "event pertains, *what* is one of the constants :const:`PyTrace_CALL`, :const:" "`PyTrace_EXCEPTION`, :const:`PyTrace_LINE`, :const:`PyTrace_RETURN`, :const:" "`PyTrace_C_CALL`, :const:`PyTrace_C_EXCEPTION`, :const:`PyTrace_C_RETURN`, " "or :const:`PyTrace_OPCODE`, and *arg* depends on the value of *what*:" msgstr "" "El tipo de la función de rastreo registrada usando :c:func:" "`PyEval_SetProfile` y :c:func:`PyEval_SetTrace`. El primer parámetro es el " "objeto pasado a la función de registro como *obj*, *frame* es el objeto de " "marco al que pertenece el evento, *what* es una de las constantes :const:" "`PyTrace_CALL`, :const:`PyTrace_EXCEPTION` , :const:`PyTrace_LINE`, :const:" "`PyTrace_RETURN`, :const:`PyTrace_C_CALL`, :const:`PyTrace_C_EXCEPTION`, :" "const:`PyTrace_C_RETURN`, o :const:`PyTrace_OPCODE`, y *arg* depende de el " "valor de *what*:" #: ../Doc/c-api/init.rst:1575 msgid "Value of *what*" msgstr "Valor de *what*" #: ../Doc/c-api/init.rst:1575 msgid "Meaning of *arg*" msgstr "Significado de *arg*" #: ../Doc/c-api/init.rst:1577 msgid ":const:`PyTrace_CALL`" msgstr ":const:`PyTrace_CALL`" #: ../Doc/c-api/init.rst:1577 ../Doc/c-api/init.rst:1582 #: ../Doc/c-api/init.rst:1593 msgid "Always :c:data:`Py_None`." msgstr "Siempre :c:data:`Py_None`." #: ../Doc/c-api/init.rst:1579 msgid ":const:`PyTrace_EXCEPTION`" msgstr ":const:`PyTrace_EXCEPTION`" #: ../Doc/c-api/init.rst:1579 msgid "Exception information as returned by :func:`sys.exc_info`." msgstr "Información de excepción retornada por :func:`sys.exc_info`." #: ../Doc/c-api/init.rst:1582 msgid ":const:`PyTrace_LINE`" msgstr ":const:`PyTrace_LINE`" #: ../Doc/c-api/init.rst:1584 msgid ":const:`PyTrace_RETURN`" msgstr ":const:`PyTrace_RETURN`" #: ../Doc/c-api/init.rst:1584 msgid "" "Value being returned to the caller, or ``NULL`` if caused by an exception." msgstr "" "Valor retornado al que llama, o ``NULL`` si es causado por una excepción." #: ../Doc/c-api/init.rst:1587 msgid ":const:`PyTrace_C_CALL`" msgstr ":const:`PyTrace_C_CALL`" #: ../Doc/c-api/init.rst:1587 ../Doc/c-api/init.rst:1589 #: ../Doc/c-api/init.rst:1591 msgid "Function object being called." msgstr "Objeto función que se llaman." #: ../Doc/c-api/init.rst:1589 msgid ":const:`PyTrace_C_EXCEPTION`" msgstr ":const:`PyTrace_C_EXCEPTION`" #: ../Doc/c-api/init.rst:1591 msgid ":const:`PyTrace_C_RETURN`" msgstr ":const:`PyTrace_C_RETURN`" #: ../Doc/c-api/init.rst:1593 msgid ":const:`PyTrace_OPCODE`" msgstr ":const:`PyTrace_OPCODE`" #: ../Doc/c-api/init.rst:1598 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 " "generator. Note that the creation of the iterator for a generator function " "is not reported as there is no control transfer to the Python bytecode in " "the corresponding frame." msgstr "" "El valor del parámetro *what* para una función :c:type:`Py_tracefunc` cuando " "se informa una nueva llamada a una función o método, o una nueva entrada en " "un generador. Tenga en cuenta que la creación del iterador para una función " "de generador no se informa ya que no hay transferencia de control al código " "de bytes de Python en la marco correspondiente." #: ../Doc/c-api/init.rst:1607 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 " "value for *what* when after any bytecode is processed after which the " "exception becomes set within the frame being executed. The effect of this " "is that as exception propagation causes the Python stack to unwind, the " "callback is called upon return to each frame as the exception propagates. " "Only trace functions receives these events; they are not needed by the " "profiler." msgstr "" "El valor del parámetro *what* para una función :c:type:`Py_tracefunc` cuando " "se ha producido una excepción. La función de devolución de llamada se llama " "con este valor para *what* cuando después de que se procese cualquier " "bytecode, después de lo cual la excepción se establece dentro del marco que " "se está ejecutando. El efecto de esto es que a medida que la propagación de " "la excepción hace que la pila de Python se desenrolle, el retorno de llamada " "se llama al retornar a cada marco a medida que se propaga la excepción. Solo " "las funciones de rastreo reciben estos eventos; el perfilador (*profiler*) " "no los necesita." #: ../Doc/c-api/init.rst:1618 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 " "reported. It may be disabled for a frame by setting :attr:`f_trace_lines` to " "*0* on that frame." msgstr "" "El valor pasado como parámetro *what* a una función :c:type:`Py_tracefunc` " "(pero no una función de creación de perfiles) cuando se informa un evento de " "número de línea. Puede deshabilitarse para un marco configurando :attr:" "`f_trace_lines` en *0* en ese marco." #: ../Doc/c-api/init.rst:1625 msgid "" "The value for the *what* parameter to :c:type:`Py_tracefunc` functions when " "a call is about to return." msgstr "" "El valor para el parámetro *what* para :c:type:`Py_tracefunc` funciona " "cuando una llamada está por regresar." #: ../Doc/c-api/init.rst:1631 msgid "" "The value for the *what* parameter to :c:type:`Py_tracefunc` functions when " "a C function is about to be called." msgstr "" "El valor del parámetro *what* para :c:type:`Py_tracefunc` funciona cuando " "una función C está a punto de ser invocada." #: ../Doc/c-api/init.rst:1637 msgid "" "The value for the *what* parameter to :c:type:`Py_tracefunc` functions when " "a C function has raised an exception." msgstr "" "El valor del parámetro *what* para funciones :c:type:`Py_tracefunc` cuando " "una función C ha lanzado una excepción." #: ../Doc/c-api/init.rst:1643 msgid "" "The value for the *what* parameter to :c:type:`Py_tracefunc` functions when " "a C function has returned." msgstr "" "El valor del parámetro *what* para :c:type:`Py_tracefunc` funciona cuando " "una función C ha retornado." #: ../Doc/c-api/init.rst:1649 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 " "event is not emitted by default: it must be explicitly requested by setting :" "attr:`f_trace_opcodes` to *1* on the frame." msgstr "" "El valor del parámetro *what* para funciones :c:type:`Py_tracefunc` (pero no " "funciones de creación de perfiles) cuando un nuevo código de operación está " "a punto de ejecutarse. Este evento no se emite de forma predeterminada: debe " "solicitarse explícitamente estableciendo :attr:`f_trace_opcodes` en *1* en " "el marco." #: ../Doc/c-api/init.rst:1657 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``. " "If the profile function needs to maintain state, using a different value for " "*obj* for each thread provides a convenient and thread-safe place to store " "it. The profile function is called for all monitored events except :const:" "`PyTrace_LINE` :const:`PyTrace_OPCODE` and :const:`PyTrace_EXCEPTION`." msgstr "" "Establece la función del generador de perfiles en *func*. El parámetro *obj* " "se pasa a la función como su primer parámetro, y puede ser cualquier objeto " "de Python o ``NULL``. Si la función de perfilado necesita mantener el " "estado, el uso de un valor diferente para *obj* para cada hilo proporciona " "un lugar conveniente y seguro para guardarlo. Se llama a la función de " "perfilado para todos los eventos supervisados, excepto :const:" "`PyTrace_LINE` :const:`PyTrace_OPCODE` y :const:`PyTrace_EXCEPTION`." #: ../Doc/c-api/init.rst:1664 msgid "See also the :func:`sys.setprofile` function." msgstr "" #: ../Doc/c-api/init.rst:1666 ../Doc/c-api/init.rst:1680 msgid "The caller must hold the :term:`GIL`." msgstr "La persona que llama debe mantener el :term:`GIL`." #: ../Doc/c-api/init.rst:1671 msgid "" "Set the tracing function to *func*. This is similar to :c:func:" "`PyEval_SetProfile`, except the tracing function does receive line-number " "events and per-opcode events, but does not receive any event related to C " "function objects being called. Any trace function registered using :c:func:" "`PyEval_SetTrace` will not receive :const:`PyTrace_C_CALL`, :const:" "`PyTrace_C_EXCEPTION` or :const:`PyTrace_C_RETURN` as a value for the *what* " "parameter." msgstr "" "Establece la función de rastreo en *func*. Esto es similar a :c:func:" "`PyEval_SetProfile`, excepto que la función de rastreo recibe eventos de " "número de línea y eventos por código de operación, pero no recibe ningún " "evento relacionado con los objetos de la función C. Cualquier función de " "rastreo registrada con :c:func:`PyEval_SetTrace` no recibirá :const:" "`PyTrace_C_CALL`, :const:`PyTrace_C_EXCEPTION` o :const:`PyTrace_C_RETURN` " "como valor para el parámetro *what*." #: ../Doc/c-api/init.rst:1678 msgid "See also the :func:`sys.settrace` function." msgstr "" #: ../Doc/c-api/init.rst:1686 msgid "Advanced Debugger Support" msgstr "Soporte avanzado del depurador" #: ../Doc/c-api/init.rst:1691 msgid "" "These functions are only intended to be used by advanced debugging tools." msgstr "" "Estas funciones solo están destinadas a ser utilizadas por herramientas de " "depuración avanzadas." #: ../Doc/c-api/init.rst:1696 msgid "" "Return the interpreter state object at the head of the list of all such " "objects." msgstr "" "Retorna el objeto de estado del intérprete al principio de la lista de todos " "esos objetos." #: ../Doc/c-api/init.rst:1701 msgid "Return the main interpreter state object." msgstr "Retorna el objeto de estado del intérprete principal." #: ../Doc/c-api/init.rst:1706 msgid "" "Return the next interpreter state object after *interp* from the list of all " "such objects." msgstr "" "Retorna el siguiente objeto de estado de intérprete después de *interp* de " "la lista de todos esos objetos." #: ../Doc/c-api/init.rst:1712 msgid "" "Return the pointer to the first :c:type:`PyThreadState` object in the list " "of threads associated with the interpreter *interp*." msgstr "" "Retorna el puntero al primer objeto :c:type:`PyThreadState` en la lista de " "hilos asociados con el intérprete *interp*." #: ../Doc/c-api/init.rst:1718 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 "" "Retorna el siguiente objeto de estado del hilo después de *tstate* de la " "lista de todos los objetos que pertenecen al mismo objeto :c:type:" "`PyInterpreterState`." #: ../Doc/c-api/init.rst:1725 msgid "Thread Local Storage Support" msgstr "Soporte de almacenamiento local de hilo" #: ../Doc/c-api/init.rst:1729 #, fuzzy msgid "" "The Python interpreter provides low-level support for thread-local storage " "(TLS) which wraps the underlying native TLS implementation to support the " "Python-level thread local storage API (:class:`threading.local`). The " "CPython C level APIs are similar to those offered by pthreads and Windows: " "use a thread key and functions to associate a :c:expr:`void*` value per " "thread." msgstr "" "El intérprete de Python proporciona soporte de bajo nivel para el " "almacenamiento local de hilos (TLS) que envuelve la implementación de TLS " "nativa subyacente para admitir la API de almacenamiento local de hilos de " "nivel Python (:class:`threading.local`). Las API de nivel CPython C son " "similares a las ofrecidas por pthreads y Windows: use una clave de hilo y " "funciones para asociar un valor de :c:type:`void*` por hilo." #: ../Doc/c-api/init.rst:1736 msgid "" "The GIL does *not* need to be held when calling these functions; they supply " "their own locking." msgstr "" "El GIL *no* necesita ser retenido al llamar a estas funciones; proporcionan " "su propio bloqueo." #: ../Doc/c-api/init.rst:1739 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 "" "Tenga en cuenta que :file:`Python.h` no incluye la declaración de las API de " "TLS, debe incluir :file:`pythread.h` para usar el almacenamiento local de " "hilos." #: ../Doc/c-api/init.rst:1743 #, fuzzy 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 " "the :c:expr:`void*` values happen to be :c:expr:`PyObject*`, these functions " "don't do refcount operations on them either." msgstr "" "Ninguna de estas funciones API maneja la administración de memoria en nombre " "de los valores :c:type:`void*`. Debe asignarlos y desasignarlos usted mismo. " "Si los valores :c:type:`void*` son :c:type:`PyObject*`, estas funciones " "tampoco realizan operaciones de conteo de referencias en ellos." #: ../Doc/c-api/init.rst:1751 msgid "Thread Specific Storage (TSS) API" msgstr "" "API de almacenamiento específico de hilo (TSS, *Thread Specific Storage*)" #: ../Doc/c-api/init.rst:1753 #, fuzzy 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 "" "La API de TSS se introduce para reemplazar el uso de la API TLS existente " "dentro del intérprete de CPython. Esta API utiliza un nuevo tipo :c:type:" "`Py_tss_t` en lugar de :c:type:`int` para representar las claves del hilo." #: ../Doc/c-api/init.rst:1759 msgid "\"A New C-API for Thread-Local Storage in CPython\" (:pep:`539`)" msgstr "" "\"Una nueva C-API para *Thread-Local Storage* en CPython\" (:pep:`539`)" #: ../Doc/c-api/init.rst:1764 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 " "internal field representing the key's initialization state. There are no " "public members in this structure." msgstr "" "Esta estructura de datos representa el estado de una clave del hilo, cuya " "definición puede depender de la implementación de TLS subyacente, y tiene un " "campo interno que representa el estado de inicialización de la clave. No hay " "miembros públicos en esta estructura." #: ../Doc/c-api/init.rst:1769 msgid "" "When :ref:`Py_LIMITED_API ` is not defined, static allocation of " "this type by :c:macro:`Py_tss_NEEDS_INIT` is allowed." msgstr "" "Cuando :ref:`Py_LIMITED_API ` no está definido, la asignación " "estática de este tipo por :c:macro:`Py_tss_NEEDS_INIT` está permitida." #: ../Doc/c-api/init.rst:1775 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 "" "Esta macro se expande al inicializador para variables :c:type:`Py_tss_t`. " "Tenga en cuenta que esta macro no se definirá con :ref:`Py_LIMITED_API " "`." #: ../Doc/c-api/init.rst:1780 msgid "Dynamic Allocation" msgstr "Asignación dinámica" #: ../Doc/c-api/init.rst:1782 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 "" "Asignación dinámica de :c:type:`Py_tss_t`, requerida en los módulos de " "extensión construidos con :ref:`Py_LIMITED_API `, donde la " "asignación estática de este tipo no es posible debido a que su " "implementación es opaca en el momento de la compilación." #: ../Doc/c-api/init.rst:1789 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 "" "Retorna un valor que es el mismo estado que un valor inicializado con :c:" "macro:`Py_tss_NEEDS_INIT`, o ``NULL`` en caso de falla de asignación " "dinámica." #: ../Doc/c-api/init.rst:1796 #, fuzzy 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 "" "Libera la clave *key* asignada por :c:func:`PyThread_tss_alloc`, después de " "llamar por primera vez :c:func:`PyThread_tss_delete` para asegurarse de que " "los hilos locales asociados no hayan sido asignados. Esto es un *no-op* si " "el argumento *key* es `NULL`." #: ../Doc/c-api/init.rst:1802 #, fuzzy msgid "" "A freed key becomes a dangling pointer. You should reset the key to ``NULL``." msgstr "" "Una clave (*key*) liberada se convierte en un puntero colgante (*dangling " "pointer*), debe restablecer la llave a `NULL`." #: ../Doc/c-api/init.rst:1807 msgid "Methods" msgstr "Métodos" #: ../Doc/c-api/init.rst:1809 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 " "undefined if the given :c:type:`Py_tss_t` has not been initialized by :c:" "func:`PyThread_tss_create`." msgstr "" "El parámetro *key* de estas funciones no debe ser ``NULL``. Además, los " "comportamientos de :c:func:`PyThread_tss_set` y :c:func:`PyThread_tss_get` " "no están definidos si el :c:type:`Py_tss_t` dado no ha sido inicializado " "por :c:func:`PyThread_tss_create`." #: ../Doc/c-api/init.rst:1817 msgid "" "Return a non-zero value if the given :c:type:`Py_tss_t` has been initialized " "by :c:func:`PyThread_tss_create`." msgstr "" "Retorna un valor distinto de cero si :c:type:`Py_tss_t` ha sido inicializado " "por :c:func:`PyThread_tss_create`." #: ../Doc/c-api/init.rst:1823 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 " "initialized by :c:macro:`Py_tss_NEEDS_INIT`. This function can be called " "repeatedly on the same key -- calling it on an already initialized key is a " "no-op and immediately returns success." msgstr "" "Retorna un valor cero en la inicialización exitosa de una clave TSS. El " "comportamiento no está definido si el valor señalado por el argumento *key* " "no se inicializa con :c:macro:`Py_tss_NEEDS_INIT`. Esta función se puede " "invocar repetidamente en la misma tecla: llamarla a una tecla ya " "inicializada es un *no-op* e inmediatamente retorna el éxito." #: ../Doc/c-api/init.rst:1832 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 " "destroyed key is able to be initialized again by :c:func:" "`PyThread_tss_create`. This function can be called repeatedly on the same " "key -- calling it on an already destroyed key is a no-op." msgstr "" "Destruye una clave TSS para olvidar los valores asociados con la clave en " "todos los hilos y cambie el estado de inicialización de la clave a no " "inicializado. Una clave destruida se puede inicializar nuevamente mediante :" "c:func:`PyThread_tss_create`. Esta función se puede invocar repetidamente en " "la misma llave; llamarla en una llave ya destruida es un *no-op*." #: ../Doc/c-api/init.rst:1841 #, fuzzy 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 "" "Retorna un valor cero para indicar la asociación exitosa de un valor a :c:" "type:`void*` con una clave TSS en el hilo actual. Cada hilo tiene un mapeo " "distinto de la clave a un valor :c:type:`void*`." #: ../Doc/c-api/init.rst:1848 #, fuzzy 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 "" "Retorna el valor :c:type:`void*` asociado con una clave TSS en el hilo " "actual. Esto retorna ``NULL`` si no hay ningún valor asociado con la clave " "en el hilo actual." #: ../Doc/c-api/init.rst:1856 msgid "Thread Local Storage (TLS) API" msgstr "API de almacenamiento local de hilos (TLS, *Thread Local Storage*)" #: ../Doc/c-api/init.rst:1858 msgid "" "This API is superseded by :ref:`Thread Specific Storage (TSS) API `." msgstr "" "Esta API es reemplazada por :ref:`API de Almacenamiento Específico de Hilos " "(TSS, por sus significado en inglés *Thread Specific Storage*) `." #: ../Doc/c-api/init.rst:1863 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 " "platforms, :c:func:`PyThread_create_key` will return immediately with a " "failure status, and the other TLS functions will all be no-ops on such " "platforms." msgstr "" "Esta versión de la API no es compatible con plataformas donde la clave TLS " "nativa se define de una manera que no se puede transmitir de forma segura a " "``int``. En tales plataformas, :c:func:`PyThread_create_key` regresará " "inmediatamente con un estado de falla, y las otras funciones TLS serán no " "operativas en tales plataformas." #: ../Doc/c-api/init.rst:1868 msgid "" "Due to the compatibility problem noted above, this version of the API should " "not be used in new code." msgstr "" "Debido al problema de compatibilidad mencionado anteriormente, esta versión " "de la API no debe usarse en código nuevo." #~ msgid "" #~ "Note that the :c:func:`PyGILState_\\*` functions assume there is only one " #~ "global interpreter (created automatically by :c:func:`Py_Initialize`). " #~ "Python supports the creation of additional interpreters (using :c:func:" #~ "`Py_NewInterpreter`), but mixing multiple interpreters and the :c:func:" #~ "`PyGILState_\\*` API is unsupported." #~ msgstr "" #~ "Tenga en cuenta que las funciones :c:func:`PyGILState_\\*` suponen que " #~ "solo hay un intérprete global (creado automáticamente por :c:func:" #~ "`Py_Initialize`). Python admite la creación de intérpretes adicionales " #~ "(usando :c:func:`Py_NewInterpreter`), pero la mezcla de múltiples " #~ "intérpretes y la API :c:func:`PyGILState_\\*` no son compatibles."