Skip to content

Commit

Permalink
gh-101100: Fix sphinx warnings in c-api/file.rst
Browse files Browse the repository at this point in the history
  • Loading branch information
sobolevn committed Jan 25, 2024
1 parent c63c614 commit af83cde
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 4 deletions.
9 changes: 6 additions & 3 deletions Doc/c-api/file.rst
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,12 @@ the :mod:`io` APIs instead.
Overrides the normal behavior of :func:`io.open_code` to pass its parameter
through the provided handler.
The handler is a function of type :c:expr:`PyObject *(\*)(PyObject *path,
void *userData)`, where *path* is guaranteed to be :c:type:`PyUnicodeObject`.
The handler is a function of type:
.. c:type:: Py_OpenCodeHookFunction
Equivalent of :c:expr:`PyObject *(\*)(PyObject *path,
void *userData)`, where *path* is guaranteed to be :c:type:`PyUnicodeObject`.
The *userData* pointer is passed into the hook function. Since hook
functions may be called from different runtimes, this pointer should not
Expand All @@ -87,7 +91,6 @@ the :mod:`io` APIs instead.
.. versionadded:: 3.8
.. c:function:: int PyFile_WriteObject(PyObject *obj, PyObject *p, int flags)
.. index:: single: Py_PRINT_RAW
Expand Down
7 changes: 7 additions & 0 deletions Doc/c-api/object.rst
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,13 @@ Object Protocol
to NotImplemented and return it).


.. c:macro:: Py_PRINT_RAW
Flag to be used with multiple functions that print the object (like :c:func:`PyObject_Print` and :c:func:`PyFile_WriteObject`).
If passed, these function would use the :func:`str` of the object
instead of the :func:`repr`.


.. c:function:: int PyObject_Print(PyObject *o, FILE *fp, int flags)
Print an object *o*, on file *fp*. Returns ``-1`` on error. The flags argument
Expand Down
1 change: 0 additions & 1 deletion Doc/tools/.nitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

Doc/c-api/descriptor.rst
Doc/c-api/exceptions.rst
Doc/c-api/file.rst
Doc/c-api/float.rst
Doc/c-api/gcsupport.rst
Doc/c-api/init.rst
Expand Down

0 comments on commit af83cde

Please sign in to comment.