Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
cpython
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Batuhan Osman TASKAYA
cpython
Commits
9b743f51
Kaydet (Commit)
9b743f51
authored
Şub 20, 2006
tarafından
Georg Brandl
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Bug #1013800: document PyFunction_* functions
üst
de2cde61
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
112 additions
and
11 deletions
+112
-11
concrete.tex
Doc/api/concrete.tex
+75
-1
refcounts.dat
Doc/api/refcounts.dat
+37
-10
No files found.
Doc/api/concrete.tex
Dosyayı görüntüle @
9b743f51
...
@@ -2222,6 +2222,80 @@ There are very few functions specific to instance objects.
...
@@ -2222,6 +2222,80 @@ There are very few functions specific to instance objects.
\end{cfuncdesc}
\end{cfuncdesc}
\subsection
{
Function Objects
\label
{
function-objects
}}
\obindex
{
function
}
There are a few functions specific to Python functions.
\begin{ctypedesc}
{
PyFunctionObject
}
The C structure used for functions.
\end{ctypedesc}
\begin{cvardesc}
{
PyTypeObject
}{
PyFunction
_
Type
}
This is an instance of
\ctype
{
PyTypeObject
}
and represents the
Python function type. It is exposed to Python programmers as
\code
{
types.FunctionType
}
.
\withsubitem
{
(in module types)
}{
\ttindex
{
MethodType
}}
\end{cvardesc}
\begin{cfuncdesc}
{
int
}{
PyFunction
_
Check
}{
PyObject *o
}
Return true if
\var
{
o
}
is a function object (has type
\cdata
{
PyFunction
_
Type
}
). The parameter must not be
\NULL
{}
.
\end{cfuncdesc}
\begin{cfuncdesc}
{
PyObject*
}{
PyFunction
_
New
}{
PyObject *code,
PyObject *globals
}
Return a new function object associated with the code object
\var
{
code
}
.
\var
{
globals
}
must be a dictionary with the the global
varaibles accessible to the function.
The function's docstring, name and
\var
{__
module
__}
are retrieved
from the code object, the argument defaults and closure are set to
\NULL
{}
.
\end{cfuncdesc}
\begin{cfuncdesc}
{
PyObject*
}{
PyFunction
_
GetCode
}{
PyObject *op
}
Return the code object associated with the function object
\var
{
op
}
.
\end{cfuncdesc}
\begin{cfuncdesc}
{
PyObject*
}{
PyFunction
_
GetGlobals
}{
PyObject *op
}
Return the globals dictionary associated with the function object
\var
{
op
}
.
\end{cfuncdesc}
\begin{cfuncdesc}
{
PyObject*
}{
PyFunction
_
GetModule
}{
PyObject *op
}
Return the
\var
{__
module
__}
attribute of the function object
\var
{
op
}
.
This is normally a string containing the module name, but can be set
to any other object by Python code.
\end{cfuncdesc}
\begin{cfuncdesc}
{
PyObject*
}{
PyFunction
_
GetDefaults
}{
PyObject *op
}
Return the argument default values of the function object
\var
{
op
}
.
This can be a tuple of arguments or
\NULL
{}
.
\end{cfuncdesc}
\begin{cfuncdesc}
{
int
}{
PyFunction
_
SetDefaults
}{
PyObject *op,
PyObject *defaults
}
Set the argument default values for the function object
\var
{
op
}
.
\var
{
defaults
}
must be
\var
{
Py
_
None
}
or a tuple.
Raises
\exception
{
SystemError
}
and returns
\code
{
-1
}
on failure.
\end{cfuncdesc}
\begin{cfuncdesc}
{
PyObject*
}{
PyFunction
_
GetClosure
}{
PyObject *op
}
Return the closure associated with the function object
\var
{
op
}
.
This can be
\NULL
{}
or a tuple of cell objects.
\end{cfuncdesc}
\begin{cfuncdesc}
{
int
}{
PyFunction
_
SetClosure
}{
PyObject *op,
PyObject *closure
}
Set the closure associated with the function object
\var
{
op
}
.
\var
{
closure
}
must be
\var
{
Py
_
None
}
or a tuple of cell objects.
Raises
\exception
{
SystemError
}
and returns
\code
{
-1
}
on failure.
\end{cfuncdesc}
\subsection
{
Method Objects
\label
{
method-objects
}}
\subsection
{
Method Objects
\label
{
method-objects
}}
\obindex
{
method
}
\obindex
{
method
}
...
@@ -2655,7 +2729,7 @@ when accessed. Cell objects are not likely to be useful elsewhere.
...
@@ -2655,7 +2729,7 @@ when accessed. Cell objects are not likely to be useful elsewhere.
\end{ctypedesc}
\end{ctypedesc}
\begin{cvardesc}
{
PyTypeObject
}{
PyCell
_
Type
}
\begin{cvardesc}
{
PyTypeObject
}{
PyCell
_
Type
}
The type object corresponding to cell objects
The type object corresponding to cell objects
.
\end{cvardesc}
\end{cvardesc}
\begin{cfuncdesc}
{
int
}{
PyCell
_
Check
}{
ob
}
\begin{cfuncdesc}
{
int
}{
PyCell
_
Check
}{
ob
}
...
...
Doc/api/refcounts.dat
Dosyayı görüntüle @
9b743f51
...
@@ -337,21 +337,48 @@ PyFloat_Check:PyObject*:p:0:
...
@@ -337,21 +337,48 @@ PyFloat_Check:PyObject*:p:0:
PyFloat_FromDouble:PyObject*::+1:
PyFloat_FromDouble:PyObject*::+1:
PyFloat_FromDouble:double:v::
PyFloat_FromDouble:double:v::
PyFunction_GetClosure:PyObject*::0:
PyFunction_GetClosure:PyObject*:op:0:
PyFunction_GetCode:PyObject*::0:
PyFunction_GetCode:PyObject*:op:0:
PyFunction_GetDefaults:PyObject*::0:
PyFunction_GetDefaults:PyObject*:op:0:
PyFunction_GetGlobals:PyObject*::0:
PyFunction_GetGlobals:PyObject*:op:0:
PyFunction_GetModule:PyObject*::0:
PyFunction_GetModule:PyObject*:op:0:
PyFunction_New:PyObject*::+1:
PyFunction_New:PyObject*:code:+1:
PyFunction_New:PyObject*:globals:+1:
PyFunction_SetClosure:int:::
PyFunction_SetClosure:PyObject*:op:0:
PyFunction_SetClosure:PyObject*:closure:+1:
PyFunction_SetDefaults:int:::
PyFunction_SetDefaults:PyObject*:op:0:
PyFunction_SetDefaults:PyObject*:defaults:+1:
Py_InitModule:PyObject*::0:
Py_InitModule:PyObject*::0:
Py_InitModule:
name:char*
::
Py_InitModule:
char*:name
::
Py_InitModule:
methods:PyMethodDef[]
::
Py_InitModule:
PyMethodDef[]:methods
::
Py_InitModule3:PyObject*::0:
Py_InitModule3:PyObject*::0:
Py_InitModule3:
name:char*
::
Py_InitModule3:
char*:name
::
Py_InitModule3:
methods:PyMethodDef[]
::
Py_InitModule3:
PyMethodDef[]:methods
::
Py_InitModule3:
doc:char*
::
Py_InitModule3:
char*:doc
::
Py_InitModule4:PyObject*::0:
Py_InitModule4:PyObject*::0:
Py_InitModule4:
name:char*
::
Py_InitModule4:
char*:name
::
Py_InitModule4:
methods:PyMethodDef[]
::
Py_InitModule4:
PyMethodDef[]:methods
::
Py_InitModule4:
doc:char*
::
Py_InitModule4:
char*:doc
::
Py_InitModule4:
self:PyObject*
::
Py_InitModule4:
PyObject*:self
::
Py_InitModule4:
apiver:int
::usually provided by Py_InitModule or Py_InitModule3
Py_InitModule4:
int:apiver
::usually provided by Py_InitModule or Py_InitModule3
PyImport_AddModule:PyObject*::0:reference borrowed from sys.modules
PyImport_AddModule:PyObject*::0:reference borrowed from sys.modules
PyImport_AddModule:char*:name::
PyImport_AddModule:char*:name::
...
...
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