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
d9e7d245
Kaydet (Commit)
d9e7d245
authored
Agu 14, 2002
tarafından
Skip Montanaro
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
add PyDoc_STR and PyDoc_STRVAR calls as examples for module authors
üst
632a4fbd
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
6 deletions
+18
-6
xxmodule.c
Modules/xxmodule.c
+18
-6
No files found.
Modules/xxmodule.c
Dosyayı görüntüle @
d9e7d245
...
...
@@ -57,7 +57,8 @@ Xxo_demo(XxoObject *self, PyObject *args)
}
static
PyMethodDef
Xxo_methods
[]
=
{
{
"demo"
,
(
PyCFunction
)
Xxo_demo
,
METH_VARARGS
},
{
"demo"
,
(
PyCFunction
)
Xxo_demo
,
METH_VARARGS
,
PyDoc_STR
(
"demo() -> None"
)},
{
NULL
,
NULL
}
/* sentinel */
};
...
...
@@ -143,6 +144,11 @@ static PyTypeObject Xxo_Type = {
/* Function of two integers returning integer */
PyDoc_STRVAR
(
xx_foo_doc
,
"foo(i,j)
\n
\
\n
\
Return the sum of i and j."
);
static
PyObject
*
xx_foo
(
PyObject
*
self
,
PyObject
*
args
)
{
...
...
@@ -208,13 +214,19 @@ xx_roj(PyObject *self, PyObject *args)
/* List of functions defined in the module */
static
PyMethodDef
xx_methods
[]
=
{
{
"roj"
,
xx_roj
,
METH_VARARGS
},
{
"foo"
,
xx_foo
,
METH_VARARGS
},
{
"new"
,
xx_new
,
METH_VARARGS
},
{
"bug"
,
xx_bug
,
METH_VARARGS
},
{
"roj"
,
xx_roj
,
METH_VARARGS
,
PyDoc_STR
(
"roj(a,b) -> None"
)},
{
"foo"
,
xx_foo
,
METH_VARARGS
,
xx_foo_doc
},
{
"new"
,
xx_new
,
METH_VARARGS
,
PyDoc_STR
(
"new() -> new Xx object"
)},
{
"bug"
,
xx_bug
,
METH_VARARGS
,
PyDoc_STR
(
"bug(o) -> None"
)},
{
NULL
,
NULL
}
/* sentinel */
};
PyDoc_STRVAR
(
module_doc
,
"This is a template module just for instruction."
);
/* Initialization function for the module (*must* be called initxx) */
...
...
@@ -228,7 +240,7 @@ initxx(void)
Xxo_Type
.
ob_type
=
&
PyType_Type
;
/* Create the module and add the functions */
m
=
Py_InitModule
(
"xx"
,
xx_methods
);
m
=
Py_InitModule
3
(
"xx"
,
xx_methods
,
module_doc
);
/* Add some symbolic constants to the module */
if
(
ErrorObject
==
NULL
)
{
...
...
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