]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Document PyObject_AsFileDescriptor
authorAndrew M. Kuchling <amk@amk.ca>
Thu, 13 Jul 2000 23:58:16 +0000 (23:58 +0000)
committerAndrew M. Kuchling <amk@amk.ca>
Thu, 13 Jul 2000 23:58:16 +0000 (23:58 +0000)
Doc/api/api.tex
Doc/api/refcounts.dat

index 31ba95ee4b398e44e8d40c1c7d2a116f68c9b563..367cb065b96b3d3194f000fc0beb833087b17112 100644 (file)
@@ -1419,6 +1419,13 @@ failure. This is the equivalent of the Python statement \samp{del
 \var{o}[\var{key}]}.
 \end{cfuncdesc}
 
+\begin{cfuncdesc}{int}{PyObject_AsFileDescriptor}{PyObject *o}
+Derives a file-descriptor from a Python object.  If the object
+is an integer or long integer, its value is returned.  If not, the
+object's \method{fileno()} method is called if it exists; the method
+must return an integer or long integer, which is returned as the file
+descriptor value.  Returns \code{-1} on failure.
+\end{cfuncdesc}
 
 \section{Number Protocol \label{number}}
 
index be4651893a858db06bc2b59af935fed4def8cf92..c31d3b379f7d88fbae12b09634d1d52c4783d75c 100644 (file)
@@ -539,6 +539,9 @@ PyNumber_Xor:PyObject*:o2:0:
 PyOS_GetLastModificationTime:long:::
 PyOS_GetLastModificationTime:char*:filename::
 
+PyObject_AsFileDescriptor:int::: 
+PyObject_AsFileDescriptor:PyObject*:o:0:
+
 PyObject_CallFunction:PyObject*::+1:
 PyObject_CallFunction:PyObject*:callable_object:0:
 PyObject_CallFunction:char*:format::