diff --git a/c-api/extension-modules.po b/c-api/extension-modules.po index dde5dbfb..e5aeb310 100644 --- a/c-api/extension-modules.po +++ b/c-api/extension-modules.po @@ -3,25 +3,24 @@ # This file is distributed under the same license as the Python package. # FIRST AUTHOR , 2025. # -#, fuzzy msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2025-10-11 20:40+0000\n" -"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" -"Last-Translator: FULL NAME \n" +"PO-Revision-Date: 2026-06-05 20:00+0000\n" +"Last-Translator: Mir Jung \n" "Language: ko\n" -"Language-Team: ko \n" +"Language-Team: Korean (https://python.flowdas.com)\n" "Plural-Forms: nplurals=1; plural=0;\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=utf-8\n" "Content-Transfer-Encoding: 8bit\n" -"Generated-By: Babel 2.17.0\n" +"Generated-By: Babel 2.18.0\n" #: ../../c-api/extension-modules.rst:6 msgid "Defining extension modules" -msgstr "" +msgstr "확장 모듈 정의" #: ../../c-api/extension-modules.rst:8 msgid "" @@ -31,6 +30,9 @@ msgid "" "settings), and which exports an :ref:`initialization function `." msgstr "" +"CPython용 C 확장은 공유 라이브러리(예를 들어 리눅스의 ``.so`` 파일, 윈도우의 ``.pyd`` DLL)로, 파이썬 " +"프로세스로 로드 가능하고(예를 들어 호환되는 컴파일러 설정으로 컴파일된) :ref:`초기화 함수 `\\ 를 익스포트합니다." #: ../../c-api/extension-modules.rst:13 msgid "" @@ -40,6 +42,10 @@ msgid "" "module name plus an extension listed in " ":py:attr:`importlib.machinery.EXTENSION_SUFFIXES`." msgstr "" +"기본적으로 임포트 가능하려면(즉, :py:class:`importlib.machinery.ExtensionFileLoader`\\ " +"에 의해), 공유 라이브러리는 :py:attr:`sys.path` 에 있어야 하고, 모듈 이름에 " +":py:attr:`importlib.machinery.EXTENSION_SUFFIXES` 에 나열된 확장자를 붙인 이름이어야 " +"합니다." #: ../../c-api/extension-modules.rst:21 msgid "" @@ -48,6 +54,9 @@ msgid "" "tool is Setuptools, whose documentation can be found at " "https://setuptools.pypa.io/en/latest/setuptools.html." msgstr "" +"확장 모듈을 빌드, 패키징 및 배포하는 작업은 제삼자 도구를 사용하는 것이 가장 좋으며, 이 문서의 범위를 벗어납니다. 적합한 도구" +" 중 하나는 Setuptools로, 문서는 " +"https://setuptools.pypa.io/en/latest/setuptools.html 에서 찾을 수 있습니다." #: ../../c-api/extension-modules.rst:26 msgid "" @@ -55,6 +64,8 @@ msgid "" "initialized using :c:func:`PyModuleDef_Init`. This allows splitting the " "creation process into several phases:" msgstr "" +"일반적으로 초기화 함수는 :c:func:`PyModuleDef_Init` 을 사용하여 초기화된 모듈 정의를 반환합니다. 이를 통해 " +"생성 과정을 여러 단계로 나눌 수 있습니다:" #: ../../c-api/extension-modules.rst:30 msgid "" @@ -62,6 +73,8 @@ msgid "" "capabilities the module supports, and it can adjust the environment or " "refuse loading an incompatible extension." msgstr "" +"실질적인 코드가 실행되기 전에, 파이썬은 모듈이 지원하는 기능을 파악하고, 환경을 조정하거나 호환되지 않는 확장의 로드를 거부할 수" +" 있습니다." #: ../../c-api/extension-modules.rst:33 msgid "" @@ -70,12 +83,17 @@ msgid "" "initial attributes like :attr:`~module.__package__` and " ":attr:`~module.__loader__`." msgstr "" +"기본적으로 파이썬 자체가 모듈 객체를 생성합니다 -- 즉, 클래스의 경우 :py:meth:`object.__new__` 와 동등한 " +"작업을 수행합니다. 또한 :attr:`~module.__package__` 와 :attr:`~module.__loader__` 같은" +" 초기 어트리뷰트를 설정합니다." #: ../../c-api/extension-modules.rst:37 msgid "" "Afterwards, the module object is initialized using extension-specific " "code -- the equivalent of :py:meth:`~object.__init__` on classes." msgstr "" +"이후 모듈 객체는 확장에 특화된 코드를 사용하여 초기화됩니다 -- 클래스의 경우 :py:meth:`~object.__init__` " +"와 동등합니다." #: ../../c-api/extension-modules.rst:40 msgid "" @@ -85,14 +103,17 @@ msgid "" ":ref:`single-phase-initialization section below ` for details." msgstr "" +"이것은 초기화 함수가 완전히 구성된 모듈을 반환하는 레거시(하지만 여전히 지원되는) *단일 단계 초기화* 방식과 구별하기 위해 " +"*다단계 초기화*\\ 라고 합니다. 자세한 내용은 :ref:`아래의 단일 단계 초기화 섹션 `\\ 을 참조하십시오." #: ../../c-api/extension-modules.rst:48 msgid "Added support for multi-phase initialization (:pep:`489`)." -msgstr "" +msgstr "다단계 초기화 지원이 추가되었습니다 (:pep:`489`)." #: ../../c-api/extension-modules.rst:52 msgid "Multiple module instances" -msgstr "" +msgstr "다중 모듈 인스턴스" #: ../../c-api/extension-modules.rst:54 msgid "" @@ -102,6 +123,9 @@ msgid "" "and type objects. The old module is subject to normal garbage collection." " This mirrors the behavior of pure-Python modules." msgstr "" +"기본적으로 확장 모듈은 싱글톤이 아닙니다. 예를 들어, :py:attr:`sys.modules` 항목이 제거되고 모듈이 다시 " +"임포트되면 새 모듈 객체가 생성되고, 일반적으로 새 메서드와 형 객체로 채워집니다. 이전 모듈은 일반적인 가비지 컬렉션의 대상이 " +"됩니다. 이는 순수 파이썬 모듈의 동작을 반영합니다." #: ../../c-api/extension-modules.rst:61 msgid "" @@ -111,6 +135,9 @@ msgid "" "sharing Python objects between module instances would likely cause " "crashes or undefined behavior." msgstr "" +"추가 모듈 인스턴스는 :ref:`서브 인터프리터 ` 에서 또는 파이썬 런타임 " +"재초기화(:c:func:`Py_Finalize` 와 :c:func:`Py_Initialize`) 후에 생성될 수 있습니다. 이 경우" +" 모듈 인스턴스 간에 파이썬 객체를 공유하면 크래시나 정의되지 않은 동작이 발생할 가능성이 있습니다." #: ../../c-api/extension-modules.rst:68 msgid "" @@ -120,12 +147,17 @@ msgid "" " objects, should be specific to a particular module instance. See :ref" ":`isolating-extensions-howto` for more details and a practical guide." msgstr "" +"이러한 문제를 피하려면 확장 모듈의 각 인스턴스가 *격리*\\ 되어야 합니다: 한 인스턴스의 변경이 다른 인스턴스에 묵시적으로 " +"영향을 주어서는 안 되며, 파이썬 객체에 대한 참조를 포함하여 모듈이 소유한 모든 상태는 특정 모듈 인스턴스에 한정되어야 합니다. " +"자세한 내용과 실용적인 안내는 :ref:`isolating-extensions-howto`\\ 를 참조하십시오." #: ../../c-api/extension-modules.rst:74 msgid "" "A simpler way to avoid these issues is :ref:`raising an error on repeated" " initialization `." msgstr "" +"이러한 문제를 피하는 더 간단한 방법은 :ref:`반복 초기화 시 에러 발생시키기 `\\ 입니다." #: ../../c-api/extension-modules.rst:77 msgid "" @@ -135,23 +167,26 @@ msgid "" "initialization, as above. A module may also be limited to the main " "interpreter using the :c:data:`Py_mod_multiple_interpreters` slot." msgstr "" +"모든 모듈은 :ref:`서브 인터프리터 `\\ 를 지원하거나, 그렇지 않으면 지원하지 " +"않음을 명시적으로 알려야 합니다. 이는 위에서 설명한 것처럼 격리 또는 반복 초기화 차단을 통해 보통 달성됩니다. 모듈은 " +":c:data:`Py_mod_multiple_interpreters` 슬롯을 사용하여 메인 인터프리터로만 제한될 수도 있습니다." #: ../../c-api/extension-modules.rst:89 msgid "Initialization function" -msgstr "" +msgstr "초기화 함수" #: ../../c-api/extension-modules.rst:91 msgid "" "The initialization function defined by an extension module has the " "following signature:" -msgstr "" +msgstr "확장 모듈이 정의하는 초기화 함수의 시그니처는 다음과 같습니다:" #: ../../c-api/extension-modules.rst:96 #, python-brace-format msgid "" "Its name should be :samp:`PyInit_{}`, with ```` replaced by " "the name of the module." -msgstr "" +msgstr "이름은 :samp:`PyInit_{}` 이어야 하며, ```` 은 모듈 이름으로 대체됩니다." #: ../../c-api/extension-modules.rst:99 #, python-brace-format @@ -163,6 +198,10 @@ msgid "" ":samp:`PyInitU_{}`, with ```` encoded using Python's " "*punycode* encoding with hyphens replaced by underscores. In Python:" msgstr "" +"ASCII만으로 구성된 이름의 모듈은 함수 이름이 :samp:`PyInit_{}` 이어야 하며, ```` 은 " +"모듈 이름으로 대체됩니다. :ref:`multi-phase-initialization` 을 사용할 때는 ASCII가 아닌 모듈 " +"이름도 허용됩니다. 이 경우 초기화 함수 이름은 :samp:`PyInitU_{}` 이며, ```` 은 파이썬의" +" *punycode* 인코딩으로 인코딩되고 하이픈은 밑줄로 대체됩니다. 파이썬으로 표현하면:" #: ../../c-api/extension-modules.rst:106 msgid "" @@ -173,32 +212,38 @@ msgid "" " suffix = b'U_' + name.encode('punycode').replace(b'-', b'_')\n" " return b'PyInit' + suffix" msgstr "" +"def initfunc_name(name):\n" +" try:\n" +" suffix = b'_' + name.encode('ascii')\n" +" except UnicodeEncodeError:\n" +" suffix = b'U_' + name.encode('punycode').replace(b'-', b'_')\n" +" return b'PyInit' + suffix" #: ../../c-api/extension-modules.rst:115 msgid "" "It is recommended to define the initialization function using a helper " "macro:" -msgstr "" +msgstr "초기화 함수는 헬퍼 매크로를 사용하여 정의하는 것이 권장됩니다:" #: ../../c-api/extension-modules.rst:119 msgid "Declare an extension module initialization function. This macro:" -msgstr "" +msgstr "확장 모듈 초기화 함수를 선언합니다. 이 매크로는:" #: ../../c-api/extension-modules.rst:122 msgid "specifies the :c:expr:`PyObject*` return type," -msgstr "" +msgstr ":c:expr:`PyObject*` 반환 형을 지정하고," #: ../../c-api/extension-modules.rst:123 msgid "adds any special linkage declarations required by the platform, and" -msgstr "" +msgstr "플랫폼에 필요한 특수 링크 선언을 추가하며," #: ../../c-api/extension-modules.rst:124 msgid "for C++, declares the function as ``extern \"C\"``." -msgstr "" +msgstr "C++의 경우 함수를 ``extern \"C\"`` 로 선언합니다." #: ../../c-api/extension-modules.rst:126 msgid "For example, a module called ``spam`` would be defined like this::" -msgstr "" +msgstr "예를 들어, ``spam`` 이라는 모듈은 다음과 같이 정의됩니다::" #: ../../c-api/extension-modules.rst:128 #, python-brace-format @@ -215,6 +260,17 @@ msgid "" " return PyModuleDef_Init(&spam_module);\n" "}" msgstr "" +"static struct PyModuleDef spam_module = {\n" +" .m_base = PyModuleDef_HEAD_INIT,\n" +" .m_name = \"spam\",\n" +" ...\n" +"};\n" +"\n" +"PyMODINIT_FUNC\n" +"PyInit_spam(void)\n" +"{\n" +" return PyModuleDef_Init(&spam_module);\n" +"}" #: ../../c-api/extension-modules.rst:140 msgid "" @@ -225,16 +281,20 @@ msgid "" "`Multiple modules in one library `__ section in :pep:`489` for details." msgstr "" +"여러 초기화 함수를 정의하여 단일 공유 라이브러리에서 여러 모듈을 익스포트할 수 있습니다. 그러나 임포트하려면 심볼릭 링크나 커스텀" +" 임포터를 사용해야 합니다. 기본적으로는 파일 이름에 해당하는 함수만 찾기 때문입니다. 자세한 내용은 :pep:`489` 의 `단일" +" 라이브러리 안의 다중 모듈 `__ 섹션을 참조하십시오." #: ../../c-api/extension-modules.rst:147 msgid "" "The initialization function is typically the only non-\\ ``static`` item " "defined in the module's C source." -msgstr "" +msgstr "초기화 함수는 일반적으로 모듈의 C 소스에서 ``static``\\ 이 아닌 유일한 항목입니다." #: ../../c-api/extension-modules.rst:154 msgid "Multi-phase initialization" -msgstr "" +msgstr "다단계 초기화" #: ../../c-api/extension-modules.rst:156 msgid "" @@ -244,22 +304,28 @@ msgid "" " ``PyModuleDef`` instance must be initialized using the following " "function:" msgstr "" +"일반적으로 :ref:`초기화 함수 ` (``PyInit_modulename``)는 " +"``NULL``\\ 이 아닌 :c:member:`~PyModuleDef.m_slots` 를 가진 " +":c:type:`PyModuleDef` 인스턴스를 반환합니다. 반환되기 전에 ``PyModuleDef`` 인스턴스는 다음 함수를 " +"사용하여 초기화되어야 합니다:" #: ../../c-api/extension-modules.rst:165 msgid "" "Ensure a module definition is a properly initialized Python object that " "correctly reports its type and a reference count." -msgstr "" +msgstr "모듈 정의기 형과 참조 횟수를 정확하게 보고하는 제대로 초기화된 파이썬 객체임을 보장해야 합니다." #: ../../c-api/extension-modules.rst:168 msgid "Return *def* cast to ``PyObject*``, or ``NULL`` if an error occurred." -msgstr "" +msgstr "에러가 발생하면 ``NULL`` 을, 그렇지 않으면 ``PyObject*`` 로 캐스팅된 *def*\\ 를 반환합니다." #: ../../c-api/extension-modules.rst:170 msgid "" "Calling this function is required for :ref:`multi-phase-initialization`. " "It should not be used in other contexts." msgstr "" +"이 함수 호출은 :ref:`multi-phase-initialization` 에 필요합니다. 다른 컨텍스트에서는 사용하지 않아야 " +"합니다." #: ../../c-api/extension-modules.rst:173 msgid "" @@ -267,10 +333,12 @@ msgid "" "allocated. This function may return either a new reference or a borrowed " "one; this reference must not be released." msgstr "" +"파이썬은 ``PyModuleDef`` 구조체가 정적으로 할당된다고 가정합니다. 이 함수는 새 참조 또는 빌린 참조를 반환할 수 " +"있으며, 이 참조는 해제해서는 안 됩니다." #: ../../c-api/extension-modules.rst:184 msgid "Legacy single-phase initialization" -msgstr "" +msgstr "레거시 단일 단계 초기화" #: ../../c-api/extension-modules.rst:187 msgid "" @@ -278,6 +346,8 @@ msgid "" " modules, with known drawbacks and design flaws. Extension module authors" " are encouraged to use multi-phase initialization instead." msgstr "" +"단일 단계 초기화는 확장 모듈을 초기화하는 레거시 메커니즘으로, 알려진 단점과 설계상 결함이 있습니다. 확장 모듈 작성자는 대신 " +"다단계 초기화를 사용하도록 권장됩니다." #: ../../c-api/extension-modules.rst:191 msgid "" @@ -287,23 +357,27 @@ msgid "" ":c:func:`PyModule_Create` and functions like " ":c:func:`PyModule_AddObjectRef`." msgstr "" +"단일 단계 초기화에서 :ref:`초기화 함수 `\\는 " +"(``PyInit_modulename``) 모듈 객체를 생성하고, 채워서 반환해야 합니다. 이는 보통 " +":c:func:`PyModule_Create` 와 :c:func:`PyModule_AddObjectRef` 같은 함수를 사용하여 " +"수행됩니다." #: ../../c-api/extension-modules.rst:197 msgid "" "Single-phase initialization differs from the :ref:`default ` in the following ways:" -msgstr "" +msgstr "단일 단계 초기화는 다음과 같은 점에서 :ref:`기본 단계 `\\와 다릅니다:" #: ../../c-api/extension-modules.rst:200 msgid "Single-phase modules are, or rather *contain*, “singletons”." -msgstr "" +msgstr "단일 단계 모듈은 \"싱글톤\"이거나 오히려 \"싱글톤\"을 *포함* 합니다." #: ../../c-api/extension-modules.rst:202 msgid "" "When the module is first initialized, Python saves the contents of the " "module's ``__dict__`` (that is, typically, the module's functions and " "types)." -msgstr "" +msgstr "모듈이 처음 초기화될 때, 파이썬은 모듈의 ``__dict__`` 내용(즉, 일반적으로 모듈의 함수와 형)을 저장합니다." #: ../../c-api/extension-modules.rst:206 msgid "" @@ -313,6 +387,9 @@ msgid "" "module ``_testsinglephase`` [#testsinglephase]_ that defines a function " "``sum`` and an exception class ``error``:" msgstr "" +"이후 임포트에서는 파이썬이 초기화 함수를 다시 호출하지 않습니다. 대신 새 ``__dict__`` 를 가진 새 모듈 객체를 생성하고" +" 저장된 내용을 복사합니다. 예를 들어, 함수 ``sum`` 과 예외 클래스 ``error`` 를 정의하는 단일 단계 모듈 " +"``_testsinglephase`` [#testsinglephase]_ 가 있다고 가정하면:" #: ../../c-api/extension-modules.rst:214 msgid "" @@ -329,10 +406,22 @@ msgid "" ">>> one.error is two.error\n" "True" msgstr "" +">>> import sys\n" +">>> import _testsinglephase as one\n" +">>> del sys.modules['_testsinglephase']\n" +">>> import _testsinglephase as two\n" +">>> one is two\n" +"False\n" +">>> one.__dict__ is two.__dict__\n" +"False\n" +">>> one.sum is two.sum\n" +"True\n" +">>> one.error is two.error\n" +"True" #: ../../c-api/extension-modules.rst:229 msgid "The exact behavior should be considered a CPython implementation detail." -msgstr "" +msgstr "정확한 동작은 CPython 구현 세부 사항으로 간주해야 합니다." #: ../../c-api/extension-modules.rst:231 msgid "" @@ -342,6 +431,9 @@ msgid "" "Specifically, when a sub-module is imported, this mechanism prepends the " "parent package name to the name of the module." msgstr "" +"``PyInit_modulename``\\이 *spec* 인자를 받지 않는다는 사실을 우회하기 위해, 임포트 장치의 일부 상태가 " +"저장되어 ``PyInit_modulename`` 호출 중에 생성되는 첫 번째 적합한 모듈에 적용됩니다. 구체적으로, 서브 모듈이 " +"임포트될 때 이 메커니즘은 부모 패키지 이름을 모듈 이름 앞에 붙입니다." #: ../../c-api/extension-modules.rst:237 msgid "" @@ -349,20 +441,24 @@ msgid "" "object as soon as possible, before any other module objects can be " "created." msgstr "" +"단일 단계 ``PyInit_modulename`` 함수는 다른 모듈 객체가 생성되기 전에 가능한 한 빨리 \"자신의\" 모듈 객체를" +" 생성해야 합니다." #: ../../c-api/extension-modules.rst:240 msgid "Non-ASCII module names (``PyInitU_modulename``) are not supported." -msgstr "" +msgstr "ASCII가 아닌 모듈 이름(``PyInitU_modulename``)은 지원되지 않습니다." #: ../../c-api/extension-modules.rst:242 msgid "" "Single-phase modules support module lookup functions like " ":c:func:`PyState_FindModule`." -msgstr "" +msgstr "단일 단계 모듈은 :c:func:`PyState_FindModule` 같은 모듈 조회 함수를 지원합니다." #: ../../c-api/extension-modules.rst:245 msgid "" "``_testsinglephase`` is an internal module used in CPython's self-test " "suite; your installation may or may not include it." msgstr "" +"``_testsinglephase`` 는 CPython의 자체 테스트 스위트에서 사용되는 내부 모듈로, 설치 환경에 따라 포함될 " +"수도 있고 포함되지 않을 수도 있습니다."