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
9a69112f
Kaydet (Commit)
9a69112f
authored
Haz 20, 1995
tarafından
Jack Jansen
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Jim Fulton's change to support doc strings
üst
1e054024
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
30 additions
and
4 deletions
+30
-4
module_method
Tools/modulator/Templates/module_method
+4
-0
module_tail
Tools/modulator/Templates/module_tail
+7
-1
object_method
Tools/modulator/Templates/object_method
+4
-0
object_tail
Tools/modulator/Templates/object_tail
+10
-0
genmodule.py
Tools/modulator/genmodule.py
+5
-3
No files found.
Tools/modulator/Templates/module_method
Dosyayı görüntüle @
9a69112f
static char $abbrev$_$method$__doc__[] =
""
;
static PyObject *
$abbrev$_$method$(self, args)
PyObject *self; /* Not used */
...
...
Tools/modulator/Templates/module_tail
Dosyayı görüntüle @
9a69112f
...
...
@@ -9,13 +9,19 @@ static struct PyMethodDef $abbrev$_methods[] = {
/* Initialization function for the module (*must* be called init$name$) */
static char $name$_module_documentation[] =
""
;
void
init$name$()
{
PyObject *m, *d;
/* Create the module and add the functions */
m = Py_InitModule("$name$", $abbrev$_methods);
m = Py_InitModule4("$name$", $abbrev$_methods,
$name$_module_documentation,
(PyObject*)NULL,PYTHON_API_VERSION);
/* Add some symbolic constants to the module */
d = PyModule_GetDict(m);
...
...
Tools/modulator/Templates/object_method
Dosyayı görüntüle @
9a69112f
static char $abbrev$_$method$__doc__[] =
""
;
static PyObject *
$abbrev$_$method$(self, args)
$abbrev$object *self;
...
...
Tools/modulator/Templates/object_tail
Dosyayı görüntüle @
9a69112f
static char $Abbrev$type__doc__[] =
""
;
static PyTypeObject $Abbrev$type = {
PyObject_HEAD_INIT(&PyType_Type)
0, /*ob_size*/
...
...
@@ -16,6 +20,12 @@ static PyTypeObject $Abbrev$type = {
$tp_as_sequence$, /*tp_as_sequence*/
$tp_as_mapping$, /*tp_as_mapping*/
(hashfunc)$tp_hash$, /*tp_hash*/
(binaryfunc)$tp_call$, /*tp_call*/
(reprfunc)$tp_str$, /*tp_str*/
/* Space for future expansion */
0L,0L,0L,0L,
$Abbrev$type__doc__ /* Documentation string */
};
/* End of code for $name$ objects */
...
...
Tools/modulator/genmodule.py
Dosyayı görüntüle @
9a69112f
...
...
@@ -28,7 +28,7 @@ error = 'genmodule.error'
# Names of functions in the object-description struct.
#
FUNCLIST
=
[
'new'
,
'tp_dealloc'
,
'tp_print'
,
'tp_getattr'
,
'tp_setattr'
,
'tp_compare'
,
'tp_repr'
,
'tp_hash'
]
'tp_compare'
,
'tp_repr'
,
'tp_hash'
,
'tp_call'
,
'tp_str'
]
TYPELIST
=
[
'tp_as_number'
,
'tp_as_sequence'
,
'tp_as_mapping'
,
'structure'
]
#
...
...
@@ -81,7 +81,8 @@ class module(writer):
for
fn
in
self
.
methodlist
:
self
.
method
=
fn
self
.
addcode
(
'module_method'
,
fp
)
new_ml
=
new_ml
+
(
'{"
%
s",
\t
%
s_
%
s,
\t
1},
\n
'
%
(
fn
,
self
.
abbrev
,
fn
))
new_ml
=
new_ml
+
(
'{"
%
s",
\t
%
s_
%
s,
\t
1,
\t
%
s_
%
s__doc__},
\n
'
%
(
fn
,
self
.
abbrev
,
fn
,
self
.
abbrev
,
fn
))
self
.
methodlist
=
new_ml
self
.
addcode
(
'module_tail'
,
fp
)
...
...
@@ -106,7 +107,8 @@ class object(writer):
for
fn
in
self
.
methodlist
:
self
.
method
=
fn
self
.
addcode
(
'object_method'
,
fp
)
new_ml
=
new_ml
+
(
'{"
%
s",
\t
%
s_
%
s,
\t
1},
\n
'
%
(
fn
,
self
.
abbrev
,
fn
))
new_ml
=
new_ml
+
(
'{"
%
s",
\t
%
s_
%
s,
\t
1,
\t
%
s_
%
s__doc__},
\n
'
%
(
fn
,
self
.
abbrev
,
fn
,
self
.
abbrev
,
fn
))
self
.
methodlist
=
new_ml
self
.
addcode
(
'object_mlist'
,
fp
)
...
...
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