FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

[3.14] gh-141004: Document `PyFile_OpenCode` and `PyFile_OpenCodeObject` (GH-141413) by miss-islington · Pull Request #141425 · python/cpython · GitHub

/ cpython Public
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension .rst  (1) All 1 file type selected
Viewed files
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Unified
Split
Hide whitespace
Diff view
Unified
Split
Hide whitespace
23 changes: 23 additions & 0 deletions Doc/c-api/file.rst
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,29 @@ the :mod:`io` APIs instead.
.. versionadded:: 3.8


.. c:function:: PyObject *PyFile_OpenCodeObject(PyObject *path)

Open *path* with the mode ``'rb'``. *path* must be a Python :class:`str`
object. The behavior of this function may be overridden by
:c:func:`PyFile_SetOpenCodeHook` to allow for some preprocessing of the
text.

This is analogous to :func:`io.open_code` in Python.

On success, this function returns a :term:`strong reference` to a Python
file object. On failure, this function returns ``NULL`` with an exception
set.

.. versionadded:: 3.8


.. c:function:: PyObject *PyFile_OpenCode(const char *path)

Similar to :c:func:`PyFile_OpenCodeObject`, but *path* is a
UTF-8 encoded :c:expr:`const char*`.

.. versionadded:: 3.8


.. c:function:: int PyFile_WriteObject(PyObject *obj, PyObject *p, int flags)

Expand Down
Loading

Back | FazBrowse Home | New Git URL