@@ -35,8 +35,8 @@ msgstr ""
3535#: ../../faq/extending.rst:18
3636msgid ""
3737"Yes, you can create built-in modules containing functions, variables, "
38- "exceptions and even new types in C. This is explained in the document "
39- ":ref: `extending-index`."
38+ "exceptions and even new types in C. This is explained in the document :ref: "
39+ "`extending-index`."
4040msgstr ""
4141
4242#: ../../faq/extending.rst:22
@@ -49,10 +49,10 @@ msgstr ""
4949
5050#: ../../faq/extending.rst:28
5151msgid ""
52- "Yes, using the C compatibility features found in C++. Place ``extern \" C \" { "
53- " ... }`` around the Python include files and put ``extern \" C\" `` before each "
54- " function that is going to be called by the Python interpreter. Global or "
55- "static C++ objects with constructors are probably not a good idea."
52+ "Yes, using the C compatibility features found in C++. Place ``extern "
53+ "\" C \" { ... }`` around the Python include files and put ``extern \" C\" `` "
54+ "before each function that is going to be called by the Python interpreter. "
55+ "Global or static C++ objects with constructors are probably not a good idea."
5656msgstr ""
5757
5858#: ../../faq/extending.rst:37
@@ -76,8 +76,8 @@ msgid ""
7676"The highest-level function to do this is :c:func:`PyRun_SimpleString` which "
7777"takes a single string argument to be executed in the context of the module "
7878"``__main__`` and returns ``0`` for success and ``-1`` when an exception "
79- "occurred (including :exc:`SyntaxError`). If you want more control, use "
80- ":c: func:`PyRun_String`; see the source for :c:func:`PyRun_SimpleString` in "
79+ "occurred (including :exc:`SyntaxError`). If you want more control, use :c: "
80+ "func:`PyRun_String`; see the source for :c:func:`PyRun_SimpleString` in "
8181"``Python/pythonrun.c``."
8282msgstr ""
8383
@@ -100,23 +100,23 @@ msgstr ""
100100msgid ""
101101"That depends on the object's type. If it's a tuple, :c:func:`PyTuple_Size` "
102102"returns its length and :c:func:`PyTuple_GetItem` returns the item at a "
103- "specified index. Lists have similar functions, :c:func:`PyList_Size` and "
104- ":c: func:`PyList_GetItem`."
103+ "specified index. Lists have similar functions, :c:func:`PyList_Size` and :c: "
104+ "func:`PyList_GetItem`."
105105msgstr ""
106106
107107#: ../../faq/extending.rst:72
108108msgid ""
109- "For bytes, :c:func:`PyBytes_Size` returns its length and "
110- ":c:func: `PyBytes_AsStringAndSize` provides a pointer to its value and its "
111- "length. Note that Python bytes objects may contain null bytes so C's "
112- ":c:func:`! strlen` should not be used."
109+ "For bytes, :c:func:`PyBytes_Size` returns its length and :c:func: "
110+ "`PyBytes_AsStringAndSize` provides a pointer to its value and its length. "
111+ "Note that Python bytes objects may contain null bytes so C's :c:func:`! "
112+ "strlen` should not be used."
113113msgstr ""
114114
115115#: ../../faq/extending.rst:77
116116msgid ""
117117"To test the type of an object, first make sure it isn't ``NULL``, and then "
118- "use :c:func:`PyBytes_Check`, :c:func:`PyTuple_Check`, :c:func:`PyList_Check`, "
119- " etc."
118+ "use :c:func:`PyBytes_Check`, :c:func:`PyTuple_Check`, :c:func:"
119+ "`PyList_Check`, etc."
120120msgstr ""
121121
122122#: ../../faq/extending.rst:80
@@ -145,8 +145,8 @@ msgstr ""
145145msgid ""
146146"The :c:func:`PyObject_CallMethod` function can be used to call an arbitrary "
147147"method of an object. The parameters are the object, the name of the method "
148- "to call, a format string like that used with :c:func:`Py_BuildValue`, and the "
149- " argument values::"
148+ "to call, a format string like that used with :c:func:`Py_BuildValue`, and "
149+ "the argument values::"
150150msgstr ""
151151
152152#: ../../faq/extending.rst:102
@@ -165,8 +165,8 @@ msgstr ""
165165
166166#: ../../faq/extending.rst:109
167167msgid ""
168- "To call, e.g., a file object's \" seek\" method with arguments 10, 0 (assuming "
169- " the file object pointer is \" f\" )::"
168+ "To call, e.g., a file object's \" seek\" method with arguments 10, 0 "
169+ "(assuming the file object pointer is \" f\" )::"
170170msgstr ""
171171
172172#: ../../faq/extending.rst:112
@@ -253,11 +253,11 @@ msgstr ""
253253
254254#: ../../faq/extending.rst:173
255255msgid ""
256- "If the module hasn't been imported yet (i.e. it is not yet present in "
257- ":data: `sys.modules`), this initializes the module; otherwise it simply "
258- "returns the value of ``sys.modules[\" <modulename>\" ]``. Note that it doesn't"
259- " enter the module into any namespace -- it only ensures it has been "
260- "initialized and is stored in :data:`sys.modules`."
256+ "If the module hasn't been imported yet (i.e. it is not yet present in :data: "
257+ "`sys.modules`), this initializes the module; otherwise it simply returns the "
258+ "value of ``sys.modules[\" <modulename>\" ]``. Note that it doesn't enter the "
259+ "module into any namespace -- it only ensures it has been initialized and is "
260+ "stored in :data:`sys.modules`."
261261msgstr ""
262262
263263#: ../../faq/extending.rst:179
@@ -272,8 +272,8 @@ msgstr ""
272272
273273#: ../../faq/extending.rst:184
274274msgid ""
275- "Calling :c:func:`PyObject_SetAttrString` to assign to variables in the module "
276- " also works."
275+ "Calling :c:func:`PyObject_SetAttrString` to assign to variables in the "
276+ "module also works."
277277msgstr ""
278278
279279#: ../../faq/extending.rst:189
@@ -284,10 +284,10 @@ msgstr ""
284284msgid ""
285285"Depending on your requirements, there are many approaches. To do this "
286286"manually, begin by reading :ref:`the \" Extending and Embedding\" document "
287- "<extending-index>`. Realize that for the Python run-time system, there isn't "
288- " a whole lot of difference between C and C++ -- so the strategy of building a "
289- " new Python type around a C structure (pointer) type will also work for C++ "
290- "objects."
287+ "<extending-index>`. Realize that for the Python run-time system, there "
288+ "isn't a whole lot of difference between C and C++ -- so the strategy of "
289+ "building a new Python type around a C structure (pointer) type will also "
290+ "work for C++ objects."
291291msgstr ""
292292
293293#: ../../faq/extending.rst:197
@@ -301,8 +301,8 @@ msgstr ""
301301#: ../../faq/extending.rst:203
302302msgid ""
303303"Setup must end in a newline, if there is no newline there, the build process "
304- "fails. (Fixing this requires some ugly shell script hackery, and this bug is "
305- " so minor that it doesn't seem worth the effort.)"
304+ "fails. (Fixing this requires some ugly shell script hackery, and this bug "
305+ "is so minor that it doesn't seem worth the effort.)"
306306msgstr ""
307307
308308#: ../../faq/extending.rst:209
@@ -311,8 +311,8 @@ msgstr ""
311311
312312#: ../../faq/extending.rst:211
313313msgid ""
314- "When using GDB with dynamically loaded extensions, you can't set a breakpoint "
315- " in your extension until your extension is loaded."
314+ "When using GDB with dynamically loaded extensions, you can't set a "
315+ "breakpoint in your extension until your extension is loaded."
316316msgstr ""
317317
318318#: ../../faq/extending.rst:214
@@ -366,8 +366,8 @@ msgid ""
366366"Sometimes you want to emulate the Python interactive interpreter's behavior, "
367367"where it gives you a continuation prompt when the input is incomplete (e.g. "
368368"you typed the start of an \" if\" statement or you didn't close your "
369- "parentheses or triple string quotes), but it gives you a syntax error message "
370- " immediately when the input is invalid."
369+ "parentheses or triple string quotes), but it gives you a syntax error "
370+ "message immediately when the input is invalid."
371371msgstr ""
372372
373373#: ../../faq/extending.rst:250
@@ -380,8 +380,8 @@ msgstr ""
380380msgid ""
381381"The easiest way to do it in C is to call :c:func:`PyRun_InteractiveLoop` "
382382"(perhaps in a separate thread) and let the Python interpreter handle the "
383- "input for you. You can also set the :c:func:`PyOS_ReadlineFunctionPointer` to "
384- " point at your custom input function. See ``Modules/readline.c`` and "
383+ "input for you. You can also set the :c:func:`PyOS_ReadlineFunctionPointer` "
384+ "to point at your custom input function. See ``Modules/readline.c`` and "
385385"``Parser/myreadline.c`` for more hints."
386386msgstr ""
387387
@@ -398,20 +398,19 @@ msgstr ""
398398
399399#: ../../faq/extending.rst:268
400400msgid ""
401- "Can I create an object class with some methods implemented in C and others in "
402- " Python (e.g. through inheritance)?"
401+ "Can I create an object class with some methods implemented in C and others "
402+ "in Python (e.g. through inheritance)?"
403403msgstr ""
404404
405405#: ../../faq/extending.rst:270
406406msgid ""
407- "Yes, you can inherit from built-in classes such as :class:`int`, "
408- ":class: `list`, :class:`dict`, etc."
407+ "Yes, you can inherit from built-in classes such as :class:`int`, :class: "
408+ "`list`, :class:`dict`, etc."
409409msgstr ""
410410
411411#: ../../faq/extending.rst:273
412412msgid ""
413- "The Boost Python Library (BPL, "
414- "https://www.boost.org/libs/python/doc/index.html) provides a way of doing "
415- "this from C++ (i.e. you can inherit from an extension class written in C++ "
416- "using the BPL)."
413+ "The Boost Python Library (BPL, https://www.boost.org/libs/python/doc/index."
414+ "html) provides a way of doing this from C++ (i.e. you can inherit from an "
415+ "extension class written in C++ using the BPL)."
417416msgstr ""
0 commit comments