Commit Graph

76 Commits

Author SHA1 Message Date
Ned Batchelder d25954dff5
docs: fix a few typos identified by codespell (#119516) 2024-05-25 18:13:31 -07:00
Serhiy Storchaka 573acb30f2
gh-115172: Fix explicit index extries for the C API (GH-115173) 2024-02-11 12:23:30 +02:00
Serhiy Storchaka da6760bdf5
gh-65210: Add const qualifiers in PyArg_VaParseTupleAndKeywords() (GH-105958)
Change the declaration of the keywords parameter in functions
PyArg_ParseTupleAndKeywords() and PyArg_VaParseTupleAndKeywords() from `char **`
to `char * const *` in C and `const char * const *` in C++.

It makes these functions compatible with argument of type `const char * const *`,
`const char **` or `char * const *` in C++ and `char * const *` in C
without explicit type cast.

Co-authored-by: C.A.M. Gerlach <CAM.Gerlach@Gerlach.CAM>
2023-12-04 13:14:56 +02:00
Serhiy Storchaka f51f0466c0
gh-107298: Fix some references in the C API documentation (GH-108072) 2023-08-17 11:16:00 +03:00
Serhiy Storchaka 983305268e
gh-107298: Fix yet more Sphinx warnings in the C API doc (GH-107345) 2023-07-27 18:44:32 +03:00
Victor Stinner 8d61a71f9c
gh-107298: Fix more Sphinx warnings in the C API doc (#107329)
Declare the following functions as macros, since they are actually
macros. It avoids a warning on "TYPE" or "macro" argument.

* PyMem_New()
* PyMem_Resize()
* PyModule_AddIntMacro()
* PyModule_AddStringMacro()
* PyObject_GC_New()
* PyObject_GC_NewVar()
* PyObject_New()
* PyObject_NewVar()

Add C standard C types to nitpick_ignore in Doc/conf.py:

* int64_t
* uint64_t
* uintptr_t

No longer ignore non existing "__int" type in nitpick_ignore.

Update Doc/tools/.nitignore
2023-07-27 00:52:40 +00:00
Victor Stinner 87b39028e5
gh-107298: Fix doc references to undocumented modules (#107300)
Update also Doc/tools/.nitignore.
2023-07-26 18:59:06 +02:00
Serhiy Storchaka 329e4a1a3f
gh-86493: Modernize modules initialization code (GH-106858)
Use PyModule_Add() or PyModule_AddObjectRef() instead of soft deprecated
PyModule_AddObject().
2023-07-25 14:34:49 +03:00
Serhiy Storchaka 08a228da05
gh-107091: Fix the use of some C domain roles (#107092) 2023-07-23 12:27:05 +02:00
Serhiy Storchaka fcc816dbff
gh-106919: Use role :c:macro: for referencing the C "constants" (GH-106920) 2023-07-21 10:52:07 +03:00
Inada Naoki 20b7c79b9d
gh-104922: Doc: add note about PY_SSIZE_T_CLEAN (#106314)
Add note about PY_SSIZE_T_CLEAN in extending and embedding document.
2023-07-03 00:54:35 +09:00
Victor Stinner 424049cc11
gh-105145: Remove old functions to config Python init (#105154)
Remove the following old functions to configure the Python
initialization, deprecated in Python 3.11:

* PySys_AddWarnOptionUnicode()
* PySys_AddWarnOption()
* PySys_AddXOption()
* PySys_HasWarnOptions()
* PySys_SetArgvEx()
* PySys_SetArgv()
* PySys_SetPath()
* Py_SetPath()
* Py_SetProgramName()
* Py_SetPythonHome()
* Py_SetStandardStreamEncoding()
* _Py_SetProgramFullPath()

Most of these functions are kept in the stable ABI, except:

* Py_SetStandardStreamEncoding()
* _Py_SetProgramFullPath()

Update Doc/extending/embedding.rst and Doc/extending/extending.rst to
use the new PyConfig API.

_testembed.c:

* check_stdio_details() now sets stdio_encoding and stdio_errors
  of PyConfig.
* Add definitions of functions removed from the API but kept in the
  stable ABI.
* test_init_from_config() and test_init_read_set() now use
  PyConfig_SetString() instead of PyConfig_SetBytesString().

Remove _Py_ClearStandardStreamEncoding() internal function.
2023-06-01 09:14:02 +02:00
Inada Naoki adccff3b3f
gh-104922: Make `PY_SSIZE_T_CLEAN` not mandatory again (#105051) 2023-05-31 18:38:55 +09:00
Adam Turner 0031e62973
gh-93738: Documentation C syntax (:c:type:<C type> -> :c:expr:<C type>) (#97768)
:c:type:`<C type>` -> :c:expr:`<C type>`

Co-authored-by: Łukasz Langa <lukasz@langa.pl>
2022-10-05 11:01:14 -07:00
Adam Turner 0e72606dd4
gh-93738: Documentation C syntax (Function glob patterns -> literal markup) (#97774) 2022-10-05 08:22:28 -07:00
Terry Jan Reedy ad43dc0b54
bpo-25381: Update explanation of exceptions in C. (GH-26838)
* bpo-25381: Update explanation of exception globals

This paragraph in extending/extending.rst was unchanged (except for
NULL markup) since committed in 2007 Aug 15 for 2.6 alpha.

* Respond to reviews and remove duplication.

* Update Doc/extending/extending.rst

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2021-11-15 14:38:53 -08:00
Victor Stinner 2459b92a4d
bpo-43774: Remove --without-cycle-gc doc (GH-25364)
The configure --without-cycle-gc option has been removed in Python
2.3 by the commit cccd1e7248. It's now
time to remove the last reference to it in the documentation.
2021-04-12 16:58:45 +01:00
Shreyan Avigyan ea9b2d6319
bpo-43739: Add type declaration Doc/extending/extending.rst example 2021-04-10 08:54:32 -07:00
Cajetan Rodrigues d4f3923d59
bpo-40279: Add some error-handling to the module initialisation docs example (GH-19705) 2020-04-25 07:27:53 +02:00
Serhiy Storchaka e835b31d2b
bpo-38600: NULL -> ``NULL``. (GH-17001)
Also fix some other formatting.
2019-10-30 21:37:16 +02:00
Serhiy Storchaka 25fc088607
bpo-38600: Change the mark up of NULL in the C API documentation. (GH-16950)
Replace all *NULL* with ``NULL``.
2019-10-30 12:03:20 +02:00
Brandt Bucher 224b8aaa7e bpo-26868: Fix example usage of PyModule_AddObject. (#15725)
* Add a note to the PyModule_AddObject docs.

* Correct example usages of PyModule_AddObject.

* Whitespace.

* Clean up wording.

* 📜🤖 Added by blurb_it.

* First code review.

* Add < 0 in the tests with PyModule_AddObject
2019-09-12 13:11:20 +01:00
Stéphane Wirtel cbb6484573 Doc: Replace the deprecated highlightlang directive by highlight. (#13377)
highlightlang is deprecated since April 2018 in Sphinx.
See https://github.com/sphinx-doc/sphinx/pull/4845
2019-05-17 15:25:34 +05:30
Inada Naoki c88feceb44
Doc: define PY_SSIZE_T_CLEAN always (GH-12794) 2019-04-13 10:46:21 +09:00
Serhiy Storchaka 62be74290a
bpo-33012: Fix invalid function cast warnings with gcc 8. (GH-6749)
Fix invalid function cast warnings with gcc 8
for method conventions different from METH_NOARGS, METH_O and
METH_VARARGS excluding Argument Clinic generated code.
2018-11-27 13:27:31 +02:00
Serhiy Storchaka 3f819ca138
bpo-35110: Fix unintentional spaces around hyphens and dashes. (GH-10231) 2018-10-31 02:26:06 +02:00
Serhiy Storchaka 46936d5a71
Improve highlighting of some code blocks. (GH-6401) 2018-04-08 19:18:04 +03:00
Sanyam Khurana 338cd83c5d bpo-25910: Link redirections in docs (#1933)
Fixes some redirection links in docs.
2018-01-20 01:25:37 +01:00
Emanuele Gaifas cdfe910e74 Extending Python Doc minor updates (GH-4518)
Move footnote markers to be closer to the related terminology:
before the end of the sentence, instead of after.
2017-11-24 00:49:57 -08:00
Sergey Fedoseev d9a2b99ac4 Fix the indentation in Extending Python code example (GH-3244)
Code was indented with three spaces.
Fixed using four spaces.
2017-08-30 07:50:40 -07:00
Serhiy Storchaka 84b8e92e46 bpo-29918: Add missed "const" modifiers in C API documentation. (#846) 2017-03-30 10:01:03 +03:00
Martin Panter 5c67933940 Issue #26638: Mask undefined CLI options to defeat new Sphinx warnings 2016-10-30 04:20:17 +00:00
Martin Panter 1050d2d0c7 Issue #26462: Doc: reduce literal_block warnings, fix syntax highlighting.
Patch by Julien Palard.
2016-07-26 11:18:21 +02:00
Georg Brandl 5d94134040 Closes #25910: fix dead and permanently redirected links in the docs. Thanks to SilentGhost for the patch. 2016-02-26 19:37:12 +01:00
Nick Coghlan 2ab5b092e5 Close #24458: PEP 489 documentation
Patch by Petr Viktorin.
2015-07-03 19:49:15 +10:00
Serhiy Storchaka cd881b850c Fixed documentation of functions with const char* arguments. 2015-06-21 17:12:16 +03:00
Serhiy Storchaka 03863d2b29 Fixed documentation of functions with const char* arguments. 2015-06-21 17:11:21 +03:00
Benjamin Peterson 743ffe248c merge 3.4 2015-01-05 14:39:06 -06:00
Benjamin Peterson 63b55580fb emphasize that cffi is better than extension modules for portability 2015-01-05 14:38:46 -06:00
Georg Brandl e21a531ef1 merge with 3.4 2014-10-31 10:39:29 +01:00
Georg Brandl a4c8c47961 #22613: remaining corrections in extending/reference docs (thanks Jacques Ducasse) 2014-10-31 10:38:49 +01:00
Victor Stinner 25e014bd91 Issue #18395, #22108: Update embedded Python examples to decode correctly
command line parameters: use Py_DecodeLocale() and PyUnicode_DecodeFSDefault().
2014-08-01 12:28:49 +02:00
Serhiy Storchaka 0b68a2d675 Issue 19195: Improved cross-references in C API documentation. 2013-10-09 13:26:17 +03:00
Georg Brandl a072de14be Extending example: use Py_RETURN_NONE 2013-10-06 20:46:08 +02:00
Georg Brandl 49c6fc9679 Minor improvement: add indication that the main function goes on. 2013-10-06 13:14:10 +02:00
Georg Brandl 337672b76c Small clarification in extending docs. 2013-10-06 11:02:38 +02:00
Eli Bendersky bdbc0b08d0 merge 3.2 2012-08-15 14:51:08 +03:00
Eli Bendersky 8f773493b6 Issue #15656: fixing code sample in extending doc 2012-08-15 14:49:49 +03:00
Eli Bendersky 49ac6f4492 Some corrections for the Doc/extending documentation. Closes #14129 2012-02-27 19:18:35 +02:00
Eli Bendersky 44fb613816 fix Doc/extending/extending.rst typo 2012-02-11 10:27:31 +02:00