Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit91f33ef

Browse files
miss-islingtonZeroIntensityStanFromIreland
authored
[3.14]gh-141004: DocumentPyFile_OpenCode andPyFile_OpenCodeObject (GH-141413) (GH-141425)
gh-141004: Document `PyFile_OpenCode` and `PyFile_OpenCodeObject` (GH-141413)(cherry picked from commit2befce8)Co-authored-by: Peter Bierma <zintensitydev@gmail.com>Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
1 parent03fca07 commit91f33ef

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

‎Doc/c-api/file.rst‎

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,29 @@ the :mod:`io` APIs instead.
9393
..versionadded::3.8
9494
9595
96+
..c:function:: PyObject *PyFile_OpenCodeObject(PyObject *path)
97+
98+
Open *path* with the mode ``'rb'``. *path* must be a Python:class:`str`
99+
object. The behavior of this function may be overridden by
100+
:c:func:`PyFile_SetOpenCodeHook` to allow for some preprocessing of the
101+
text.
102+
103+
This is analogous to:func:`io.open_code` in Python.
104+
105+
On success, this function returns a:term:`strong reference` to a Python
106+
file object. On failure, this function returns ``NULL`` with an exception
107+
set.
108+
109+
..versionadded::3.8
110+
111+
112+
..c:function:: PyObject *PyFile_OpenCode(const char *path)
113+
114+
Similar to:c:func:`PyFile_OpenCodeObject`, but *path* is a
115+
UTF-8 encoded:c:expr:`const char*`.
116+
117+
..versionadded::3.8
118+
96119
97120
..c:function::intPyFile_WriteObject(PyObject *obj, PyObject *p, int flags)
98121

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp