[Python-checkins] python/dist/src/Tools/modulator/Templates
object_gc, NONE, 1.1.2.1 object_getset, NONE,
1.1.2.1 object_tp_descr_get, NONE, 1.1.2.1 object_tp_descr_set,
NONE, 1.1.2.1 object_tp_init, NONE, 1.1.2.1 object_tp_iter,
NONE, 1.1.2.1 object_tp_iternext, NONE, 1.1.2.1 object_tp_new,
NONE, 1.1.2.1 module_tail, 1.4, 1.4.46.1 object_head, 1.3,
1.3.16.1 object_method, 1.4, 1.4.18.1 object_mlist, 1.2,
1.2.46.1 object_structure, 1.3, 1.3.18.1 object_tail, 1.4,
1.4.46.1 object_tp_as_mapping, 1.3,
1.3.18.1 object_tp_as_number, 1.3,
1.3.18.1 object_tp_as_sequence, 1.3, 1.3.18.1 object_tp_call,
1.3, 1.3.18.1 object_tp_compare, 1.2,
1.2.18.1 object_tp_dealloc, 1.3, 1.3.18.1 object_tp_getattr,
1.3, 1.3.18.1 object_tp_hash, 1.2, 1.2.18.1 object_tp_print,
1.2, 1.2.18.1 object_tp_repr, 1.3, 1.3.18.1 object_tp_setattr,
1.4, 1.4.18.1 object_tp_str, 1.2, 1.2.18.1 object_new, 1.2, NONE
dcjim at users.sourceforge.net
dcjim at users.sourceforge.net
Mon Jul 12 22:40:19 CEST 2004
Update of /cvsroot/python/python/dist/src/Tools/modulator/Templates
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11285/Templates
Modified Files:
Tag: jim-modulator
module_tail object_head object_method object_mlist
object_structure object_tail object_tp_as_mapping
object_tp_as_number object_tp_as_sequence object_tp_call
object_tp_compare object_tp_dealloc object_tp_getattr
object_tp_hash object_tp_print object_tp_repr
object_tp_setattr object_tp_str
Added Files:
Tag: jim-modulator
object_gc object_getset object_tp_descr_get
object_tp_descr_set object_tp_init object_tp_iter
object_tp_iternext object_tp_new
Removed Files:
Tag: jim-modulator
object_new
Log Message:
Updating to generate new-stype types.
Checking in work on progress. Maybe someone else wants to try it out.
--- NEW FILE: object_gc ---
static int
$abbrev$_traverse($abbrev$$object$ *self, visitproc visit, void *arg)
{
/* For each subobject that could be involved in cycles, do
code like:
if (self->xxx != NULL && visit(self->xxx, arg) < 0)
return -1;
*/
return 0;
}
static int
$abbrev$_clear($abbrev$$object$ *self)
{
/* XXXX Drop references that may have created reference
cycles. Immutable objects do not have to define this method
since they can never directly create reference cycles. Note
that the object must still be valid after calling this
method (don't just call Py_DECREF() on a reference). The
collector will call this method if it detects that this
object is involved in a reference cycle.
*/
return 0;
}
--- NEW FILE: object_getset ---
/* Code to use getters and/or setters to support attributes */
/* Create gettrs and settrs. Here's an example that gets and
sets a first name.
*/
/*
static PyObject *
$abbrev$_getfirst($abbrev$$object$ *self, void *closure)
{
Py_INCREF(self->first);
return self->first;
}
*/
/*
static int
$abbrev$_setfirst($abbrev$$object$ *self, PyObject *value, void *closure)
{
Py_DECREF(self->first);
Py_INCREF(value);
self->first = value;
return 0;
}
*/
static PyGetSetDef $abbrev$_getset[] = {
/*
{"first",
(getter)$abbrev$_getfirst, (setter)$abbrev$_setfirst,
"first name",
NULL},
*/
{NULL} /* Sentinel */
};
--- NEW FILE: object_tp_descr_get ---
static PyObject *
$abbrev$_descr_get($abbrev$$object$ *self, PyObject *inst, PyObject *cls)
{
/* XXXX Add your own get code here */
/* Note that inst may be NULL */
}
--- NEW FILE: object_tp_descr_set ---
static int
$abbrev$_descr_set($abbrev$$object$ *self, PyObject *inst, PyObject *newvalue)
{
/* XXXX Add your own set code here */
return 0;
}
--- NEW FILE: object_tp_init ---
static int
$abbrev$_init($abbrev$$object$ *self, PyObject *args, PyObject *kwds)
{
static char *kwlist[] = {NULL};
if (! PyArg_ParseTupleAndKeywords(args, kwds, "", kwlist,
))
return NULL;
return 0
}
--- NEW FILE: object_tp_iter ---
static PyObject *
$abbrev$_iter($abbrev$$object$ *self)
{
/* XXXX Return an iterator for the object. If the object is an
iterator, then just return the object.
*/
}
--- NEW FILE: object_tp_iternext ---
static PyObject *
$abbrev$_iternext($abbrev$$object$ *self)
{
/* XXXX Return the next object in the iteration. Raise
StopIteration when done.
*/
PyErr_SetObject(PyExc_StopIteration, Py_None);
}
--- NEW FILE: object_tp_new ---
static PyObject *
$abbrev$_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
{
$abbrev$$object$ *self;
self = ($abbrev$$object$ *)type->tp_alloc(type, 0);
if (self != NULL) {
/* setup instance variables here */
}
return (PyObject *)self;
}
Index: module_tail
===================================================================
RCS file: /cvsroot/python/python/dist/src/Tools/modulator/Templates/module_tail,v
retrieving revision 1.4
retrieving revision 1.4.46.1
diff -C2 -d -r1.4 -r1.4.46.1
*** module_tail 7 Mar 1996 16:16:54 -0000 1.4
--- module_tail 12 Jul 2004 20:40:15 -0000 1.4.46.1
***************
*** 3,37 ****
static struct PyMethodDef $abbrev$_methods[] = {
! $methodlist$
{NULL, (PyCFunction)NULL, 0, NULL} /* sentinel */
};
- /* 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_InitModule4("$name$", $abbrev$_methods,
! $name$_module_documentation,
! (PyObject*)NULL,PYTHON_API_VERSION);
/* Add some symbolic constants to the module */
- d = PyModule_GetDict(m);
ErrorObject = PyString_FromString("$name$.error");
! PyDict_SetItemString(d, "error", ErrorObject);
!
/* XXXX Add constants here */
-
- /* Check for errors */
- if (PyErr_Occurred())
- Py_FatalError("can't initialize module $name$");
}
--- 3,36 ----
static struct PyMethodDef $abbrev$_methods[] = {
! $methodlist$
{NULL, (PyCFunction)NULL, 0, NULL} /* sentinel */
};
static char $name$_module_documentation[] =
""
;
! #ifndef PyMODINIT_FUNC /* declarations for DLL import/export */
! #define PyMODINIT_FUNC void
! #endif
! PyMODINIT_FUNC
! init$name$(void)
{
! PyObject *m;
! $ready_types$
/* Create the module and add the functions */
! m = Py_InitModule3("$name$", $abbrev$_methods,
! $name$_module_documentation);
!
! if (m == NULL)
! return;
/* Add some symbolic constants to the module */
ErrorObject = PyString_FromString("$name$.error");
! if (PyModule_AddObject(m, "error", ErrorObject) < 0)
! return;
! $add_types$
/* XXXX Add constants here */
}
Index: object_head
===================================================================
RCS file: /cvsroot/python/python/dist/src/Tools/modulator/Templates/object_head,v
retrieving revision 1.3
retrieving revision 1.3.16.1
diff -C2 -d -r1.3 -r1.3.16.1
*** object_head 17 Jul 2002 16:30:39 -0000 1.3
--- object_head 12 Jul 2004 20:40:15 -0000 1.3.16.1
***************
*** 1,13 ****
- /* Declarations for objects of type $name$ */
-
typedef struct {
PyObject_HEAD
/* XXXX Add your own stuff here */
! } $abbrev$object;
!
! static PyTypeObject $Abbrev$type;
!
!
!
! /* ---------------------------------------------------------------- */
--- 1,5 ----
typedef struct {
PyObject_HEAD
/* XXXX Add your own stuff here */
! } $abbrev$$object$;
Index: object_method
===================================================================
RCS file: /cvsroot/python/python/dist/src/Tools/modulator/Templates/object_method,v
retrieving revision 1.4
retrieving revision 1.4.18.1
diff -C2 -d -r1.4 -r1.4.18.1
*** object_method 27 Dec 2001 23:35:42 -0000 1.4
--- object_method 12 Jul 2004 20:40:15 -0000 1.4.18.1
***************
*** 5,9 ****
static PyObject *
! $abbrev$_$method$($abbrev$object *self, PyObject *args)
{
if (!PyArg_ParseTuple(args, ""))
--- 5,9 ----
static PyObject *
! $abbrev$_$method$($abbrev$$object$ *self, PyObject *args)
{
if (!PyArg_ParseTuple(args, ""))
Index: object_mlist
===================================================================
RCS file: /cvsroot/python/python/dist/src/Tools/modulator/Templates/object_mlist,v
retrieving revision 1.2
retrieving revision 1.2.46.1
diff -C2 -d -r1.2 -r1.2.46.1
*** object_mlist 16 May 1995 13:46:53 -0000 1.2
--- object_mlist 12 Jul 2004 20:40:15 -0000 1.2.46.1
***************
*** 1,8 ****
static struct PyMethodDef $abbrev$_methods[] = {
! $methodlist$
{NULL, NULL} /* sentinel */
};
-
- /* ---------- */
-
--- 1,5 ----
static struct PyMethodDef $abbrev$_methods[] = {
! $methodlist$
{NULL, NULL} /* sentinel */
};
Index: object_structure
===================================================================
RCS file: /cvsroot/python/python/dist/src/Tools/modulator/Templates/object_structure,v
retrieving revision 1.3
retrieving revision 1.3.18.1
diff -C2 -d -r1.3 -r1.3.18.1
*** object_structure 27 Dec 2001 23:35:42 -0000 1.3
--- object_structure 12 Jul 2004 20:40:15 -0000 1.3.18.1
***************
*** 4,37 ****
#include "structmember.h"
! #define OFF(x) offsetof(XXXXobject, x)
!
! static struct memberlist $abbrev$_memberlist[] = {
! /* XXXX Add lines like { "foo", T_INT, OFF(foo), RO } */
{NULL} /* Sentinel */
};
-
- static PyObject *
- $abbrev$_getattr($abbrev$object *self, char *name)
- {
- PyObject *rv;
-
- /* XXXX Add your own getattr code here */
- rv = PyMember_Get((char *)/*XXXX*/0, $abbrev$_memberlist, name);
- if (rv)
- return rv;
- PyErr_Clear();
- return Py_FindMethod($abbrev$_methods, (PyObject *)self, name);
- }
-
-
- static int
- $abbrev$_setattr($abbrev$object *self, char *name, PyObject *v)
- {
- /* XXXX Add your own setattr code here */
- if ( v == NULL ) {
- PyErr_SetString(PyExc_AttributeError, "Cannot delete attribute");
- return -1;
- }
- return PyMember_Set((char *)/*XXXX*/0, $abbrev$_memberlist, name, v);
- }
--- 4,12 ----
#include "structmember.h"
! static PyMemberDef $abbrev$_members[] = {
! /* XXXX Add lines like
! { "foo", T_INT, offsetof($abbrev$$object,ドル foo), RO },
! */
{NULL} /* Sentinel */
};
Index: object_tail
===================================================================
RCS file: /cvsroot/python/python/dist/src/Tools/modulator/Templates/object_tail,v
retrieving revision 1.4
retrieving revision 1.4.46.1
diff -C2 -d -r1.4 -r1.4.46.1
*** object_tail 12 Oct 1995 13:45:24 -0000 1.4
--- object_tail 12 Jul 2004 20:40:15 -0000 1.4.46.1
***************
*** 1,30 ****
! static char $Abbrev$type__doc__[] =
""
;
! static PyTypeObject $Abbrev$type = {
! PyObject_HEAD_INIT(&PyType_Type)
! 0, /*ob_size*/
! "$name$", /*tp_name*/
! sizeof($abbrev$object), /*tp_basicsize*/
! 0, /*tp_itemsize*/
! /* methods */
! (destructor)$tp_dealloc,ドル /*tp_dealloc*/
! (printfunc)$tp_print,ドル /*tp_print*/
! (getattrfunc)$tp_getattr,ドル /*tp_getattr*/
! (setattrfunc)$tp_setattr,ドル /*tp_setattr*/
! (cmpfunc)$tp_compare,ドル /*tp_compare*/
! (reprfunc)$tp_repr,ドル /*tp_repr*/
! $tp_as_number,ドル /*tp_as_number*/
! $tp_as_sequence,ドル /*tp_as_sequence*/
! $tp_as_mapping,ドル /*tp_as_mapping*/
! (hashfunc)$tp_hash,ドル /*tp_hash*/
! (ternaryfunc)$tp_call,ドル /*tp_call*/
! (reprfunc)$tp_str,ドル /*tp_str*/
!
! /* Space for future expansion */
! 0L,0L,0L,0L,
! $Abbrev$type__doc__ /* Documentation string */
};
--- 1,51 ----
! static char $Abbrev$$type$__doc__[] =
""
;
! static PyTypeObject $abbrev$$type$ = {
! PyObject_HEAD_INIT(NULL)
! /* ob_size */ 0,
! /* tp_name */ "$module$."
! "$name$",
! /* tp_basicsize */ sizeof($abbrev$$object$),
! /* tp_itemsize */ 0,
! /* tp_dealloc */ (destructor)$tp_dealloc,ドル
! /* tp_print */ (printfunc)$tp_print,ドル
! /* tp_getattr */ (getattrfunc)0,
! /* tp_setattr */ (setattrfunc)0,
! /* tp_compare */ (cmpfunc)$tp_compare,ドル
! /* tp_repr */ (reprfunc)$tp_repr,ドル
! /* tp_as_number */ $tp_as_number,ドル
! /* tp_as_sequence */ $tp_as_sequence,ドル
! /* tp_as_mapping */ $tp_as_mapping,ドル
! /* tp_hash */ (hashfunc)$tp_hash,ドル
! /* tp_call */ (ternaryfunc)$tp_call,ドル
! /* tp_str */ (reprfunc)$tp_str,ドル
! /* tp_getattro */ (getattrofunc)$tp_getattr$o,
! /* tp_setattro */ (setattrofunc)$tp_setattr$o,
! /* tp_as_buffer */ 0,
! /* tp_flags */ Py_TPFLAGS_DEFAULT
! | Py_TPFLAGS_BASETYPE $extra_flags,ドル
! /* tp_doc */ $Abbrev$$type$__doc__,
! /* tp_traverse */ (traverseproc)$tp_traverse,ドル
! /* tp_clear */ (inquiry)$tp_clear,ドル
! /* tp_richcompare */ (richcmpfunc)0,
! /* tp_weaklistoffset */ (long)0,
! /* tp_iter */ (getiterfunc)$tp_iter,ドル
! /* tp_iternext */ (iternextfunc)$tp_iternext,ドル
! /* tp_methods */ $tp_methods,ドル
! /* tp_members */ $tp_members,ドル
! /* tp_getset */ $tp_getset,ドル
! /* tp_base */ 0,
! /* tp_dict */ 0, /* internal use */
! /* tp_descr_get */ (descrgetfunc)$tp_descr_get,ドル
! /* tp_descr_set */ (descrsetfunc)$tp_descr_set,ドル
! /* tp_dictoffset */ 0,
! /* tp_init */ (initproc)$tp_init,ドル
! /* tp_alloc */ (allocfunc)0,
! /* tp_new */ (newfunc)$tp_new,ドル
! /* tp_free */ 0, /* Low-level free-mem routine */
! /* tp_is_gc */ (inquiry)0, /* For PyObject_IS_GC */
};
Index: object_tp_as_mapping
===================================================================
RCS file: /cvsroot/python/python/dist/src/Tools/modulator/Templates/object_tp_as_mapping,v
retrieving revision 1.3
retrieving revision 1.3.18.1
diff -C2 -d -r1.3 -r1.3.18.1
*** object_tp_as_mapping 27 Dec 2001 23:35:42 -0000 1.3
--- object_tp_as_mapping 12 Jul 2004 20:40:15 -0000 1.3.18.1
***************
*** 3,7 ****
static int
! $abbrev$_length($abbrev$object *self)
{
/* XXXX Return the size of the mapping */
--- 3,7 ----
static int
! $abbrev$_length($abbrev$$object$ *self)
{
/* XXXX Return the size of the mapping */
***************
*** 9,13 ****
static PyObject *
! $abbrev$_subscript($abbrev$object *self, PyObject *key)
{
/* XXXX Return the item of self indexed by key */
--- 9,13 ----
static PyObject *
! $abbrev$_subscript($abbrev$$object$ *self, PyObject *key)
{
/* XXXX Return the item of self indexed by key */
***************
*** 15,19 ****
static int
! $abbrev$_ass_sub($abbrev$object *self, PyObject *v, PyObject *w)
{
/* XXXX Put w in self under key v */
--- 15,19 ----
static int
! $abbrev$_ass_sub($abbrev$$object$ *self, PyObject *v, PyObject *w)
{
/* XXXX Put w in self under key v */
***************
*** 22,28 ****
static PyMappingMethods $abbrev$_as_mapping = {
! (inquiry)$abbrev$_length, /*mp_length*/
! (binaryfunc)$abbrev$_subscript, /*mp_subscript*/
! (objobjargproc)$abbrev$_ass_sub, /*mp_ass_subscript*/
};
--- 22,28 ----
static PyMappingMethods $abbrev$_as_mapping = {
! /* mp_length */ (inquiry)$abbrev$_length,
! /* mp_subscript */ (binaryfunc)$abbrev$_subscript,
! /* mp_ass_subscript */ (objobjargproc)$abbrev$_ass_sub,
};
Index: object_tp_as_number
===================================================================
RCS file: /cvsroot/python/python/dist/src/Tools/modulator/Templates/object_tp_as_number,v
retrieving revision 1.3
retrieving revision 1.3.18.1
diff -C2 -d -r1.3 -r1.3.18.1
*** object_tp_as_number 27 Dec 2001 23:35:42 -0000 1.3
--- object_tp_as_number 12 Jul 2004 20:40:15 -0000 1.3.18.1
***************
*** 2,7 ****
/* Code to access $name$ objects as numbers */
static PyObject *
! $abbrev$_add($abbrev$object *v, $abbrev$object *w)
{
/* XXXX Add them */
--- 2,18 ----
/* Code to access $name$ objects as numbers */
+ /* Note that we follow the new pattern without coersion.
+ We leave the coerce slot empty and all binary and ternary operations
+ take PyObject* arguments. At least one of the arguments will be of
+ an $abbrev$$object,ドル but it may not be the first.
+ */
+
+ /* If you don't want to implement any of these, just remove the
+ function def and change the reference to a 0 in the structure
+ below.
+ */
+
static PyObject *
! $abbrev$_add(PyObject *v, PyObject *w)
{
/* XXXX Add them */
***************
*** 9,13 ****
static PyObject *
! $abbrev$_sub($abbrev$object *v, $abbrev$object *w)
{
/* XXXX Subtract them */
--- 20,24 ----
static PyObject *
! $abbrev$_sub(PyObject *v, PyObject *w)
{
/* XXXX Subtract them */
***************
*** 15,19 ****
static PyObject *
! $abbrev$_mul($abbrev$object *v, $abbrev$object *w)
{
/* XXXX Multiply them */
--- 26,30 ----
static PyObject *
! $abbrev$_mul(PyObject *v, PyObject *w)
{
/* XXXX Multiply them */
***************
*** 21,25 ****
static PyObject *
! $abbrev$_div($abbrev$object *x, $abbrev$object *y)
{
/* XXXX Divide them */
--- 32,36 ----
static PyObject *
! $abbrev$_div(PyObject *x, PyObject *y)
{
/* XXXX Divide them */
***************
*** 27,31 ****
static PyObject *
! $abbrev$_mod($abbrev$object *x, $abbrev$object *y)
{
/* XXXX Modulo them */
--- 38,42 ----
static PyObject *
! $abbrev$_mod(PyObject *x, PyObject *y)
{
/* XXXX Modulo them */
***************
*** 33,37 ****
static PyObject *
! $abbrev$_divmod($abbrev$object *x, $abbrev$object *y)
{
/* XXXX Return 2-tuple with div and mod */
--- 44,48 ----
static PyObject *
! $abbrev$_divmod(PyObject *x, PyObject *y)
{
/* XXXX Return 2-tuple with div and mod */
***************
*** 39,43 ****
static PyObject *
! $abbrev$_pow($abbrev$object *v, $abbrev$object *w, $abbrev$object *z)
{
/* XXXX */
--- 50,54 ----
static PyObject *
! $abbrev$_pow(PyObject *v, PyObject *w, PyObject *z)
{
/* XXXX */
***************
*** 45,49 ****
static PyObject *
! $abbrev$_neg($abbrev$object *v)
{
/* XXXX */
--- 56,60 ----
static PyObject *
! $abbrev$_neg($abbrev$$object$ *v)
{
/* XXXX */
***************
*** 51,55 ****
static PyObject *
! $abbrev$_pos($abbrev$object *v)
{
/* XXXX */
--- 62,66 ----
static PyObject *
! $abbrev$_pos($abbrev$$object$ *v)
{
/* XXXX */
***************
*** 57,61 ****
static PyObject *
! $abbrev$_abs($abbrev$object *v)
{
/* XXXX */
--- 68,72 ----
static PyObject *
! $abbrev$_abs($abbrev$$object$ *v)
{
/* XXXX */
***************
*** 63,67 ****
static int
! $abbrev$_nonzero($abbrev$object *v)
{
/* XXXX Return 1 if non-zero */
--- 74,78 ----
static int
! $abbrev$_nonzero($abbrev$$object$ *v)
{
/* XXXX Return 1 if non-zero */
***************
*** 69,73 ****
static PyObject *
! $abbrev$_invert($abbrev$object *v)
{
/* XXXX */
--- 80,84 ----
static PyObject *
! $abbrev$_invert($abbrev$$object$ *v)
{
/* XXXX */
***************
*** 75,79 ****
static PyObject *
! $abbrev$_lshift($abbrev$object *v, $abbrev$object *w)
{
/* XXXX */
--- 86,90 ----
static PyObject *
! $abbrev$_lshift(PyObject *v, PyObject *w)
{
/* XXXX */
***************
*** 81,85 ****
static PyObject *
! $abbrev$_rshift($abbrev$object *v, $abbrev$object *w)
{
/* XXXX */
--- 92,96 ----
static PyObject *
! $abbrev$_rshift(PyObject *v, PyObject *w)
{
/* XXXX */
***************
*** 87,91 ****
static PyObject *
! $abbrev$_and($abbrev$object *v, $abbrev$object *w)
{
/* XXXX */
--- 98,102 ----
static PyObject *
! $abbrev$_and(PyObject *v, PyObject *w)
{
/* XXXX */
***************
*** 93,97 ****
static PyObject *
! $abbrev$_xor($abbrev$object *v, $abbrev$object *w)
{
/* XXXX */
--- 104,108 ----
static PyObject *
! $abbrev$_xor(PyObject *v, PyObject *w)
{
/* XXXX */
***************
*** 99,116 ****
static PyObject *
! $abbrev$_or($abbrev$object *v, $abbrev$object *w)
{
/* XXXX */
}
- static int
- $abbrev$_coerce(PyObject **pv, PyObject **pw)
- {
- /* XXXX I haven't a clue... */
- return 1;
- }
-
static PyObject *
! $abbrev$_int($abbrev$object *v)
{
/* XXXX */
--- 110,120 ----
static PyObject *
! $abbrev$_or(PyObject *v, PyObject *w)
{
/* XXXX */
}
static PyObject *
! $abbrev$_int($abbrev$$object$ *v)
{
/* XXXX */
***************
*** 118,122 ****
static PyObject *
! $abbrev$_long($abbrev$object *v)
{
/* XXXX */
--- 122,126 ----
static PyObject *
! $abbrev$_long($abbrev$$object$ *v)
{
/* XXXX */
***************
*** 124,128 ****
static PyObject *
! $abbrev$_float($abbrev$object *v)
{
/* XXXX */
--- 128,132 ----
static PyObject *
! $abbrev$_float($abbrev$$object$ *v)
{
/* XXXX */
***************
*** 130,134 ****
static PyObject *
! $abbrev$_oct($abbrev$object *v)
{
/* XXXX Return object as octal stringobject */
--- 134,138 ----
static PyObject *
! $abbrev$_oct($abbrev$$object$ *v)
{
/* XXXX Return object as octal stringobject */
***************
*** 136,169 ****
static PyObject *
! $abbrev$_hex($abbrev$object *v)
{
/* XXXX Return object as hex stringobject */
}
static PyNumberMethods $abbrev$_as_number = {
! (binaryfunc)$abbrev$_add, /*nb_add*/
! (binaryfunc)$abbrev$_sub, /*nb_subtract*/
! (binaryfunc)$abbrev$_mul, /*nb_multiply*/
! (binaryfunc)$abbrev$_div, /*nb_divide*/
! (binaryfunc)$abbrev$_mod, /*nb_remainder*/
! (binaryfunc)$abbrev$_divmod, /*nb_divmod*/
! (ternaryfunc)$abbrev$_pow, /*nb_power*/
! (unaryfunc)$abbrev$_neg, /*nb_negative*/
! (unaryfunc)$abbrev$_pos, /*nb_positive*/
! (unaryfunc)$abbrev$_abs, /*nb_absolute*/
! (inquiry)$abbrev$_nonzero, /*nb_nonzero*/
! (unaryfunc)$abbrev$_invert, /*nb_invert*/
! (binaryfunc)$abbrev$_lshift, /*nb_lshift*/
! (binaryfunc)$abbrev$_rshift, /*nb_rshift*/
! (binaryfunc)$abbrev$_and, /*nb_and*/
! (binaryfunc)$abbrev$_xor, /*nb_xor*/
! (binaryfunc)$abbrev$_or, /*nb_or*/
! (coercion)$abbrev$_coerce, /*nb_coerce*/
! (unaryfunc)$abbrev$_int, /*nb_int*/
! (unaryfunc)$abbrev$_long, /*nb_long*/
! (unaryfunc)$abbrev$_float, /*nb_float*/
! (unaryfunc)$abbrev$_oct, /*nb_oct*/
! (unaryfunc)$abbrev$_hex, /*nb_hex*/
};
! /* ------------------------------------------------------- */
--- 140,263 ----
static PyObject *
! $abbrev$_hex($abbrev$$object$ *v)
{
/* XXXX Return object as hex stringobject */
}
+ PyObject *
+ $abbrev$_inplace_add(PyObject *v, PyObject *w)
+ {
+ }
+
+ PyObject *
+ $abbrev$_inplace_subtract(PyObject *v, PyObject *w)
+ {
+ }
+
+ PyObject *
+ $abbrev$_inplace_multiply(PyObject *v, PyObject *w)
+ {
+ }
+
+ PyObject *
+ $abbrev$_inplace_divide(PyObject *v, PyObject *w)
+ {
+ }
+
+ PyObject *
+ $abbrev$_inplace_remainder(PyObject *v, PyObject *w)
+ {
+ }
+
+ PyObject *
+ $abbrev$b_inplace_power(PyObject *v, PyObject *w, PyObject *modulo)
+ {
+ }
+
+ PyObject *
+ $abbrev$_inplace_lshift(PyObject *v, PyObject *w)
+ {
+ }
+
+ PyObject *
+ $abbrev$_inplace_rshift(PyObject *v, PyObject *w)
+ {
+ }
+
+ PyObject *
+ $abbrev$_inplace_and(PyObject *v, PyObject *w)
+ {
+ }
+
+ PyObject *
+ $abbrev$_inplace_xor(PyObject *v, PyObject *w)
+ {
+ }
+
+ PyObject *
+ $abbrev$_inplace_or(PyObject *v, PyObject *w)
+ {
+ }
+
+ PyObject *
+ $abbrev$_floor_divide(PyObject *v, PyObject *w)
+ {
+ }
+
+ PyObject *
+ $abbrev$_true_divide(PyObject *v, PyObject *w)
+ {
+ }
+
+ PyObject *
+ $abbrev$_inplace_floor_divide(PyObject *v, PyObject *w)
+ {
+ }
+
+ PyObject *
+ $abbrev$_inplace_true_divide(PyObject *v, PyObject *w)
+ {
+ }
+
static PyNumberMethods $abbrev$_as_number = {
! /* nb_add */ (binaryfunc)$abbrev$_add,
! /* nb_subtract */ (binaryfunc)$abbrev$_sub,
! /* nb_multiply */ (binaryfunc)$abbrev$_mul,
! /* nb_divide */ (binaryfunc)$abbrev$_div,
! /* nb_remainder */ (binaryfunc)$abbrev$_mod,
! /* nb_divmod */ (binaryfunc)$abbrev$_divmod,
! /* nb_power */ (ternaryfunc)$abbrev$_pow,
! /* nb_negative */ (unaryfunc)$abbrev$_neg,
! /* nb_positive */ (unaryfunc)$abbrev$_pos,
! /* nb_absolute */ (unaryfunc)$abbrev$_abs,
! /* nb_nonzero */ (inquiry)$abbrev$_nonzero,
! /* nb_invert */ (unaryfunc)$abbrev$_invert,
! /* nb_lshift */ (binaryfunc)$abbrev$_lshift,
! /* nb_rshift */ (binaryfunc)$abbrev$_rshift,
! /* nb_and */ (binaryfunc)$abbrev$_and,
! /* nb_xor */ (binaryfunc)$abbrev$_xor,
! /* nb_or */ (binaryfunc)$abbrev$_or,
! /* nb_coerce */ 0, /* Coercion is obsolete! */
! /* nb_int */ (unaryfunc)$abbrev$_int,
! /* nb_long */ (unaryfunc)$abbrev$_long,
! /* nb_float */ (unaryfunc)$abbrev$_float,
! /* nb_oct */ (unaryfunc)$abbrev$_oct,
! /* nb_hex */ (unaryfunc)$abbrev$_hex,
! /* nb_inplace_add */ (binaryfunc)$abbrev$_inplace_add,
! /* nb_inplace_subtract */ (binaryfunc)$abbrev$_inplace_subtract,
! /* nb_inplace_multiply */ (binaryfunc)$abbrev$_inplace_multiply,
! /* nb_inplace_divide */ (binaryfunc)$abbrev$_inplace_divide,
! /* nb_inplace_remainder */ (binaryfunc)$abbrev$_inplace_remainder,
! /* nb_inplace_power */ (ternaryfunc)$abbrev$_inplace_power,
! /* nb_inplace_lshift */ (binaryfunc)$abbrev$_inplace_lshift,
! /* nb_inplace_rshift */ (binaryfunc)$abbrev$_inplace_rshift,
! /* nb_inplace_and */ (binaryfunc)$abbrev$_inplace_and,
! /* nb_inplace_xor */ (binaryfunc)$abbrev$_inplace_xor,
! /* nb_inplace_or */ (binaryfunc)$abbrev$_inplace_or,
! /* nb_floor_divide */ (binaryfunc)$abbrev$_floor_divide,
! /* nb_true_divide */ (binaryfunc)$abbrev$_true_divide,
! /* nb_inplace_floor_divide */ (binaryfunc)$abbrev$_inplace_floor_divide,
! /* nb_inplace_true_divide */ (binaryfunc)$abbrev$_inplace_true_divide,
};
! /* ------------------------------------------------------- */
Index: object_tp_as_sequence
===================================================================
RCS file: /cvsroot/python/python/dist/src/Tools/modulator/Templates/object_tp_as_sequence,v
retrieving revision 1.3
retrieving revision 1.3.18.1
diff -C2 -d -r1.3 -r1.3.18.1
*** object_tp_as_sequence 27 Dec 2001 23:35:42 -0000 1.3
--- object_tp_as_sequence 12 Jul 2004 20:40:15 -0000 1.3.18.1
***************
*** 3,7 ****
static int
! $abbrev$_length($abbrev$object *self)
{
/* XXXX Return the size of the object */
--- 3,7 ----
static int
! $abbrev$_length($abbrev$$object$ *self)
{
/* XXXX Return the size of the object */
***************
*** 9,13 ****
static PyObject *
! $abbrev$_concat($abbrev$object *self, PyObject *bb)
{
/* XXXX Return the concatenation of self and bb */
--- 9,13 ----
static PyObject *
! $abbrev$_concat($abbrev$$object$ *self, PyObject *bb)
{
/* XXXX Return the concatenation of self and bb */
***************
*** 15,19 ****
static PyObject *
! $abbrev$_repeat($abbrev$object *self, int n)
{
/* XXXX Return a new object that is n times self */
--- 15,19 ----
static PyObject *
! $abbrev$_repeat($abbrev$$object$ *self, int n)
{
/* XXXX Return a new object that is n times self */
***************
*** 21,25 ****
static PyObject *
! $abbrev$_item($abbrev$object *self, int i)
{
/* XXXX Return the i-th object of self */
--- 21,25 ----
static PyObject *
! $abbrev$_item($abbrev$$object$ *self, int i)
{
/* XXXX Return the i-th object of self */
***************
*** 27,31 ****
static PyObject *
! $abbrev$_slice($abbrev$object *self, int ilow, int ihigh)
{
/* XXXX Return the ilow..ihigh slice of self in a new object */
--- 27,31 ----
static PyObject *
! $abbrev$_slice($abbrev$$object$ *self, int ilow, int ihigh)
{
/* XXXX Return the ilow..ihigh slice of self in a new object */
***************
*** 33,37 ****
static int
! $abbrev$_ass_item($abbrev$object *self, int i, PyObject *v)
{
/* XXXX Assign to the i-th element of self */
--- 33,37 ----
static int
! $abbrev$_ass_item($abbrev$$object$ *self, int i, PyObject *v)
{
/* XXXX Assign to the i-th element of self */
***************
*** 40,44 ****
static int
! $abbrev$_ass_slice(PyListObject *self, int ilow, int ihigh, PyObject *v)
{
/* XXXX Replace ilow..ihigh slice of self with v */
--- 40,44 ----
static int
! $abbrev$_ass_slice($abbrev$$object$ *self, int ilow, int ihigh, PyObject *v)
{
/* XXXX Replace ilow..ihigh slice of self with v */
***************
*** 46,57 ****
}
static PySequenceMethods $abbrev$_as_sequence = {
! (inquiry)$abbrev$_length, /*sq_length*/
! (binaryfunc)$abbrev$_concat, /*sq_concat*/
! (intargfunc)$abbrev$_repeat, /*sq_repeat*/
! (intargfunc)$abbrev$_item, /*sq_item*/
! (intintargfunc)$abbrev$_slice, /*sq_slice*/
! (intobjargproc)$abbrev$_ass_item, /*sq_ass_item*/
! (intintobjargproc)$abbrev$_ass_slice, /*sq_ass_slice*/
};
--- 46,79 ----
}
+ static int
+ $abbrev$_contains($abbrev$$object$ *self, PyObject *v)
+ {
+ /* XXXX Does self contain v? */
+ return 0;
+ }
+
+ static PyObject *
+ $abbrev$_inplace_concat($abbrev$$object$ *self, PyObject *v)
+ {
+ /* XXXX Concat self and v in place */
+ }
+
+ static PyObject *
+ $abbrev$_inplace_repeat($abbrev$$object$ *self, int i)
+ {
+ /* XXXX Repeat self in place */
+ }
+
static PySequenceMethods $abbrev$_as_sequence = {
! /* sq_length */ (inquiry)$abbrev$_length,
! /* sq_concat */ (binaryfunc)$abbrev$_concat,
! /* sq_repeat */ (intargfunc)$abbrev$_repeat,
! /* sq_item */ (intargfunc)$abbrev$_item,
! /* sq_slice */ (intintargfunc)$abbrev$_slice,
! /* sq_ass_item */ (intobjargproc)$abbrev$_ass_item,
! /* sq_ass_slice */ (intintobjargproc)$abbrev$_ass_slice,
! /* sq_contains */ (objobjproc)$abbrev$_contains,
! /* sq_inplace_concat */ (binaryfunc)$abbrev$_inplace_concat,
! /* sq_inplace_repeat */ (intargfunc)$abbrev$_inplace_repeat,
};
Index: object_tp_call
===================================================================
RCS file: /cvsroot/python/python/dist/src/Tools/modulator/Templates/object_tp_call,v
retrieving revision 1.3
retrieving revision 1.3.18.1
diff -C2 -d -r1.3 -r1.3.18.1
*** object_tp_call 27 Dec 2001 23:35:42 -0000 1.3
--- object_tp_call 12 Jul 2004 20:40:15 -0000 1.3.18.1
***************
*** 1,5 ****
static PyObject *
! $abbrev$_call($abbrev$object *self, PyObject *args, PyObject *kwargs)
{
/* XXXX Return the result of calling self with argument args */
--- 1,5 ----
static PyObject *
! $abbrev$_call($abbrev$$object$ *self, PyObject *args, PyObject *kwargs)
{
/* XXXX Return the result of calling self with argument args */
Index: object_tp_compare
===================================================================
RCS file: /cvsroot/python/python/dist/src/Tools/modulator/Templates/object_tp_compare,v
retrieving revision 1.2
retrieving revision 1.2.18.1
diff -C2 -d -r1.2 -r1.2.18.1
*** object_tp_compare 27 Dec 2001 23:35:42 -0000 1.2
--- object_tp_compare 12 Jul 2004 20:40:15 -0000 1.2.18.1
***************
*** 1,5 ****
static int
! $abbrev$_compare($abbrev$object *v, $abbrev$object *w)
{
/* XXXX Compare objects and return -1, 0 or 1 */
--- 1,5 ----
static int
! $abbrev$_compare($abbrev$$object$ *v, $abbrev$$object$ *w)
{
/* XXXX Compare objects and return -1, 0 or 1 */
Index: object_tp_dealloc
===================================================================
RCS file: /cvsroot/python/python/dist/src/Tools/modulator/Templates/object_tp_dealloc,v
retrieving revision 1.3
retrieving revision 1.3.18.1
diff -C2 -d -r1.3 -r1.3.18.1
*** object_tp_dealloc 27 Dec 2001 23:35:43 -0000 1.3
--- object_tp_dealloc 12 Jul 2004 20:40:15 -0000 1.3.18.1
***************
*** 1,7 ****
static void
! $abbrev$_dealloc($abbrev$object *self)
! {
/* XXXX Add your own cleanup code here */
! PyMem_DEL(self);
}
--- 1,7 ----
static void
! $abbrev$_dealloc($abbrev$$object$ *self)
! {$call_clear$
/* XXXX Add your own cleanup code here */
! self->ob_type->tp_free((PyObject*)self);
}
Index: object_tp_getattr
===================================================================
RCS file: /cvsroot/python/python/dist/src/Tools/modulator/Templates/object_tp_getattr,v
retrieving revision 1.3
retrieving revision 1.3.18.1
diff -C2 -d -r1.3 -r1.3.18.1
*** object_tp_getattr 27 Dec 2001 23:35:43 -0000 1.3
--- object_tp_getattr 12 Jul 2004 20:40:15 -0000 1.3.18.1
***************
*** 1,7 ****
static PyObject *
! $abbrev$_getattr($abbrev$object *self, char *name)
{
! /* XXXX Add your own getattr code here */
! return Py_FindMethod($abbrev$_methods, (PyObject *)self, name);
}
--- 1,10 ----
static PyObject *
! $abbrev$_getattro($abbrev$$object$ *self, PyObject *name)
{
! /* XXXX Add your own getattr code here
! Do you *really* want to do this? Rather than using
! descriptors? */
! Py_INCREF(Py_None);
! return Py_None;
}
Index: object_tp_hash
===================================================================
RCS file: /cvsroot/python/python/dist/src/Tools/modulator/Templates/object_tp_hash,v
retrieving revision 1.2
retrieving revision 1.2.18.1
diff -C2 -d -r1.2 -r1.2.18.1
*** object_tp_hash 27 Dec 2001 23:35:43 -0000 1.2
--- object_tp_hash 12 Jul 2004 20:40:15 -0000 1.2.18.1
***************
*** 1,5 ****
static long
! $abbrev$_hash($abbrev$object *self)
{
/* XXXX Return a hash of self (or -1) */
--- 1,5 ----
static long
! $abbrev$_hash($abbrev$$object$ *self)
{
/* XXXX Return a hash of self (or -1) */
Index: object_tp_print
===================================================================
RCS file: /cvsroot/python/python/dist/src/Tools/modulator/Templates/object_tp_print,v
retrieving revision 1.2
retrieving revision 1.2.18.1
diff -C2 -d -r1.2 -r1.2.18.1
*** object_tp_print 27 Dec 2001 23:35:43 -0000 1.2
--- object_tp_print 12 Jul 2004 20:40:15 -0000 1.2.18.1
***************
*** 1,5 ****
static int
! $abbrev$_print($abbrev$object *self, FILE *fp, int flags)
{
/* XXXX Add code here to print self to fp */
--- 1,5 ----
static int
! $abbrev$_print($abbrev$$object$ *self, FILE *fp, int flags)
{
/* XXXX Add code here to print self to fp */
Index: object_tp_repr
===================================================================
RCS file: /cvsroot/python/python/dist/src/Tools/modulator/Templates/object_tp_repr,v
retrieving revision 1.3
retrieving revision 1.3.18.1
diff -C2 -d -r1.3 -r1.3.18.1
*** object_tp_repr 27 Dec 2001 23:35:43 -0000 1.3
--- object_tp_repr 12 Jul 2004 20:40:15 -0000 1.3.18.1
***************
*** 1,5 ****
static PyObject *
! $abbrev$_repr($abbrev$object *self)
{
PyObject *s;
--- 1,5 ----
static PyObject *
! $abbrev$_repr($abbrev$$object$ *self)
{
PyObject *s;
Index: object_tp_setattr
===================================================================
RCS file: /cvsroot/python/python/dist/src/Tools/modulator/Templates/object_tp_setattr,v
retrieving revision 1.4
retrieving revision 1.4.18.1
diff -C2 -d -r1.4 -r1.4.18.1
*** object_tp_setattr 27 Dec 2001 23:35:43 -0000 1.4
--- object_tp_setattr 12 Jul 2004 20:40:15 -0000 1.4.18.1
***************
*** 1,5 ****
static int
! $abbrev$_setattr($abbrev$object *self, char *name, PyObject *v)
{
/* Set attribute 'name' to value 'v'. v==NULL means delete */
--- 1,5 ----
static int
! $abbrev$_setattro($abbrev$$object$ *self, PyObject *name, PyObject *v)
{
/* Set attribute 'name' to value 'v'. v==NULL means delete */
Index: object_tp_str
===================================================================
RCS file: /cvsroot/python/python/dist/src/Tools/modulator/Templates/object_tp_str,v
retrieving revision 1.2
retrieving revision 1.2.18.1
diff -C2 -d -r1.2 -r1.2.18.1
*** object_tp_str 27 Dec 2001 23:35:43 -0000 1.2
--- object_tp_str 12 Jul 2004 20:40:15 -0000 1.2.18.1
***************
*** 1,5 ****
static PyObject *
! $abbrev$_str($abbrev$object *self)
{
PyObject *s;
--- 1,5 ----
static PyObject *
! $abbrev$_str($abbrev$$object$ *self)
{
PyObject *s;
--- object_new DELETED ---
More information about the Python-checkins
mailing list