| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent f0a5e61 commit 699aa6e
32 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -35,8 +35,8 @@ msgstr "" | |||
| 35 | 35 | #: ../../faq/extending.rst:18 | |
| 36 | 36 | msgid "" | |
| 37 | 37 | "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`." | ||
| 40 | 40 | msgstr "" | |
| 41 | 41 | ||
| 42 | 42 | #: ../../faq/extending.rst:22 | |
@@ -49,10 +49,10 @@ msgstr "" | |||
| 49 | 49 | ||
| 50 | 50 | #: ../../faq/extending.rst:28 | |
| 51 | 51 | msgid "" | |
| 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." | ||
| 56 | 56 | msgstr "" | |
| 57 | 57 | ||
| 58 | 58 | #: ../../faq/extending.rst:37 | |
@@ -76,8 +76,8 @@ msgid "" | |||
| 76 | 76 | "The highest-level function to do this is :c:func:`PyRun_SimpleString` which " | |
| 77 | 77 | "takes a single string argument to be executed in the context of the module " | |
| 78 | 78 | "``__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 " | ||
| 81 | 81 | "``Python/pythonrun.c``." | |
| 82 | 82 | msgstr "" | |
| 83 | 83 | ||
@@ -100,23 +100,23 @@ msgstr "" | |||
| 100 | 100 | msgid "" | |
| 101 | 101 | "That depends on the object's type. If it's a tuple, :c:func:`PyTuple_Size` " | |
| 102 | 102 | "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`." | ||
| 105 | 105 | msgstr "" | |
| 106 | 106 | ||
| 107 | 107 | #: ../../faq/extending.rst:72 | |
| 108 | 108 | msgid "" | |
| 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." | ||
| 113 | 113 | msgstr "" | |
| 114 | 114 | ||
| 115 | 115 | #: ../../faq/extending.rst:77 | |
| 116 | 116 | msgid "" | |
| 117 | 117 | "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." | ||
| 120 | 120 | msgstr "" | |
| 121 | 121 | ||
| 122 | 122 | #: ../../faq/extending.rst:80 | |
@@ -145,8 +145,8 @@ msgstr "" | |||
| 145 | 145 | msgid "" | |
| 146 | 146 | "The :c:func:`PyObject_CallMethod` function can be used to call an arbitrary " | |
| 147 | 147 | "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::" | ||
| 150 | 150 | msgstr "" | |
| 151 | 151 | ||
| 152 | 152 | #: ../../faq/extending.rst:102 | |
@@ -165,8 +165,8 @@ msgstr "" | |||
| 165 | 165 | ||
| 166 | 166 | #: ../../faq/extending.rst:109 | |
| 167 | 167 | msgid "" | |
| 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\")::" | ||
| 170 | 170 | msgstr "" | |
| 171 | 171 | ||
| 172 | 172 | #: ../../faq/extending.rst:112 | |
@@ -253,11 +253,11 @@ msgstr "" | |||
| 253 | 253 | ||
| 254 | 254 | #: ../../faq/extending.rst:173 | |
| 255 | 255 | msgid "" | |
| 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`." | ||
| 261 | 261 | msgstr "" | |
| 262 | 262 | ||
| 263 | 263 | #: ../../faq/extending.rst:179 | |
@@ -272,8 +272,8 @@ msgstr "" | |||
| 272 | 272 | ||
| 273 | 273 | #: ../../faq/extending.rst:184 | |
| 274 | 274 | msgid "" | |
| 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." | ||
| 277 | 277 | msgstr "" | |
| 278 | 278 | ||
| 279 | 279 | #: ../../faq/extending.rst:189 | |
@@ -284,10 +284,10 @@ msgstr "" | |||
| 284 | 284 | msgid "" | |
| 285 | 285 | "Depending on your requirements, there are many approaches. To do this " | |
| 286 | 286 | "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." | ||
| 291 | 291 | msgstr "" | |
| 292 | 292 | ||
| 293 | 293 | #: ../../faq/extending.rst:197 | |
@@ -301,8 +301,8 @@ msgstr "" | |||
| 301 | 301 | #: ../../faq/extending.rst:203 | |
| 302 | 302 | msgid "" | |
| 303 | 303 | "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.)" | ||
| 306 | 306 | msgstr "" | |
| 307 | 307 | ||
| 308 | 308 | #: ../../faq/extending.rst:209 | |
@@ -311,8 +311,8 @@ msgstr "" | |||
| 311 | 311 | ||
| 312 | 312 | #: ../../faq/extending.rst:211 | |
| 313 | 313 | msgid "" | |
| 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." | ||
| 316 | 316 | msgstr "" | |
| 317 | 317 | ||
| 318 | 318 | #: ../../faq/extending.rst:214 | |
@@ -366,8 +366,8 @@ msgid "" | |||
| 366 | 366 | "Sometimes you want to emulate the Python interactive interpreter's behavior, " | |
| 367 | 367 | "where it gives you a continuation prompt when the input is incomplete (e.g. " | |
| 368 | 368 | "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." | ||
| 371 | 371 | msgstr "" | |
| 372 | 372 | ||
| 373 | 373 | #: ../../faq/extending.rst:250 | |
@@ -380,8 +380,8 @@ msgstr "" | |||
| 380 | 380 | msgid "" | |
| 381 | 381 | "The easiest way to do it in C is to call :c:func:`PyRun_InteractiveLoop` " | |
| 382 | 382 | "(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 " | ||
| 385 | 385 | "``Parser/myreadline.c`` for more hints." | |
| 386 | 386 | msgstr "" | |
| 387 | 387 | ||
@@ -398,20 +398,19 @@ msgstr "" | |||
| 398 | 398 | ||
| 399 | 399 | #: ../../faq/extending.rst:268 | |
| 400 | 400 | msgid "" | |
| 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)?" | ||
| 403 | 403 | msgstr "" | |
| 404 | 404 | ||
| 405 | 405 | #: ../../faq/extending.rst:270 | |
| 406 | 406 | msgid "" | |
| 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." | ||
| 409 | 409 | msgstr "" | |
| 410 | 410 | ||
| 411 | 411 | #: ../../faq/extending.rst:273 | |
| 412 | 412 | msgid "" | |
| 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)." | ||
| 417 | 416 | msgstr "" | |
| Back | FazBrowse Home | New Git URL |
0 commit comments