8000 Fix `c-api/file.rst` indexes by sobolevn · Pull Request #114608 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

Fix c-api/file.rst indexes #114608

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jan 27, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Restore initial layout
  • Loading branch information
sobolevn committed Jan 26, 2024
commit 09981305336c1b22a24d36fd077996dad8ddd823
18 changes: 8 additions & 10 deletions Doc/c-api/file.rst
8000
Original file line number Diff line number Diff line change
Expand Up @@ -60,21 +60,19 @@ the :mod:`io` APIs instead.
raised if the end of the file is reached immediately.


.. c:type:: PyObject * (*Py_OpenCodeHookFunction)(PyObject *, void *)

Equivalent of :c:expr:`PyObject *(\*)(PyObject *path,
void *userData)`, where *path* is guaranteed to be
:c:type:`PyUnicodeObject`.

.. versionadded:: 3.8


.. c:function:: int PyFile_SetOpenCodeHook(Py_OpenCodeHookFunction handler)

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:type:`Py_OpenCodeHookFunction`.
The *handler* is a function of type:

.. c:namespace:: NULL
.. c:type:: PyObject * (*Py_OpenCodeHookFunction)(PyObject *, void *)

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 Down
0