summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorMartin v. Löwis <martin@v.loewis.de>2003-01-04 00:33:13 (GMT)
committerMartin v. Löwis <martin@v.loewis.de>2003-01-04 00:33:13 (GMT)
commit3919571f82079cb92c7783ab74a1823f8fdbf3eb (patch)
tree8945568ed98dc7f545159ed1b1776404bea15653 /Modules
parent4fede1a36bf4130bceddb786ccee1a259f203f45 (diff)
downloadcpython-3919571f82079cb92c7783ab74a1823f8fdbf3eb.zip
cpython-3919571f82079cb92c7783ab74a1823f8fdbf3eb.tar.gz
cpython-3919571f82079cb92c7783ab74a1823f8fdbf3eb.tar.bz2
Wrap doc strings in PyDoc_STRVAR. Fix .string docstring. Provide default
macro definitions for older Python releases.
Diffstat (limited to 'Modules')
-rw-r--r--Modules/_tkinter.c24
1 files changed, 21 insertions, 3 deletions
diff --git a/Modules/_tkinter.c b/Modules/_tkinter.c
index d6407e2..c759a3a 100644
--- a/Modules/_tkinter.c
+++ b/Modules/_tkinter.c
@@ -37,6 +37,15 @@ Copyright (C) 1994 Steen Lumholt.
#define MAC_TCL
#endif
+/* Allow using this code in Python 2.[12] */
+#ifndef PyDoc_STRVAR
+#define PyDoc_STRVAR(name,str) static char name[] = PyDoc_STR(str)
+#endif
+
+#ifndef PyMODINIT_FUNC
+#define PyPyMODINIT_FUNC void
+#endif
+
/* Starting with Tcl 8.4, many APIs offer const-correctness. Unfortunately,
making _tkinter correct for this API means to break earlier
versions. USE_COMPAT_CONST allows to make _tkinter work with both 8.4 and
@@ -723,6 +732,9 @@ PyTclObject_str(PyTclObject *self)
}
/* Like _str, but create Unicode if necessary. */
+PyDoc_STRVAR(PyTclObject_string__doc__,
+"the string representation of this object, either as string or Unicode");
+
static PyObject *
PyTclObject_string(PyTclObject *self, void *ignored)
{
@@ -755,6 +767,8 @@ PyTclObject_string(PyTclObject *self, void *ignored)
}
#ifdef Py_USING_UNICODE
+PyDoc_STRVAR(PyTclObject_unicode__doc__, "convert argument to unicode");
+
static PyObject *
PyTclObject_unicode(PyTclObject *self, void *ignored)
{
@@ -779,21 +793,25 @@ PyTclObject_repr(PyTclObject *self)
return PyString_FromString(buf);
}
+PyDoc_STRVAR(get_typename__doc__, "name of the Tcl type");
+
static PyObject*
get_typename(PyTclObject* obj, void* ignored)
{
return PyString_FromString(obj->value->typePtr->name);
}
+
static PyGetSetDef PyTclObject_getsetlist[] = {
- {"typename", (getter)get_typename, NULL, "name of the Tcl type"},
- {"string", (getter)PyTclObject_string, NULL, "name of the Tcl type"},
+ {"typename", (getter)get_typename, NULL, get_typename__doc__},
+ {"string", (getter)PyTclObject_string, NULL,
+ PyTclObject_string__doc__},
{0},
};
static PyMethodDef PyTclObject_methods[] = {
{"__unicode__", (PyCFunction)PyTclObject_unicode, METH_NOARGS,
- "convert argument to unicode"},
+ PyTclObject_unicode__doc__},
{0}
};