Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
nexedi
cython
Commits
89fab1ad
Commit
89fab1ad
authored
Apr 23, 2019
by
Zackery Spytz
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add PyBytes_FromObject() and PyObject_Bytes()
The comments were taken from the CPython docs. Closes #2713.
parent
874a7994
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
0 deletions
+12
-0
Cython/Includes/cpython/bytes.pxd
Cython/Includes/cpython/bytes.pxd
+4
-0
Cython/Includes/cpython/object.pxd
Cython/Includes/cpython/object.pxd
+8
-0
No files found.
Cython/Includes/cpython/bytes.pxd
View file @
89fab1ad
...
...
@@ -68,6 +68,10 @@ cdef extern from "Python.h":
# Return value: New reference.
# Identical to PyBytes_FromFormat() except that it takes exactly two arguments.
bytes
PyBytes_FromObject
(
object
o
)
# Return value: New reference.
# Return the bytes representation of object o that implements the buffer protocol.
Py_ssize_t
PyBytes_Size
(
object
string
)
except
-
1
# Return the length of the string in string object string.
...
...
Cython/Includes/cpython/object.pxd
View file @
89fab1ad
...
...
@@ -181,6 +181,14 @@ cdef extern from "Python.h":
# equivalent of the Python expression "str(o)". Called by the
# str() built-in function and by the print statement.
object
PyObject_Bytes
(
object
o
)
# Return value: New reference.
# Compute a bytes representation of object o. Return NULL on
# failure and a bytes object on success. This is equivalent to
# the Python expression bytes(o), when o is not an integer.
# Unlike bytes(o), a TypeError is raised when o is an integer
# instead of a zero-initialized bytes object.
object
PyObject_Unicode
(
object
o
)
# Return value: New reference.
# Compute a Unicode string representation of object o. Returns the
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment