]> granicus.if.org Git - python/commitdiff
document 'y(#)' format codes for Py_BuildValue
authorBenjamin Peterson <benjamin@python.org>
Tue, 21 Oct 2008 21:10:07 +0000 (21:10 +0000)
committerBenjamin Peterson <benjamin@python.org>
Tue, 21 Oct 2008 21:10:07 +0000 (21:10 +0000)
Doc/c-api/arg.rst

index c3d051a858f4637d66db2bcf823ed544d908f4f2..94f62f13282c7bba89034f26a47a4d6adef51c9e 100644 (file)
@@ -424,6 +424,14 @@ and the following format units are left untouched.
       Convert a C string and its length to a Python object.  If the C string pointer
       is *NULL*, the length is ignored and ``None`` is returned.
 
+   ``y`` (bytes) [char \*, int]
+      This converts a C string to a Python :func:`bytes` object.  If the C
+      string pointer is *NULL*, ``None`` is returned.
+
+   ``y#`` (bytes) [char \*, int]
+      This converts a C string and its lengths to a Python object.  If the C
+      string pointer is *NULL*, ``None`` is returned.
+
    ``z`` (string or ``None``) [char \*]
       Same as ``s``.