Patch #568124: Add doc string macros.

This commit is contained in:
Martin v. Löwis 2002-06-13 20:33:02 +00:00
parent 654c11ee3a
commit 14f8b4cfcb
63 changed files with 1509 additions and 1625 deletions

View file

@ -1660,48 +1660,48 @@ dict_iteritems(dictobject *dict)
}
static char has_key__doc__[] =
"D.has_key(k) -> 1 if D has a key k, else 0";
PyDoc_STRVAR(has_key__doc__,
"D.has_key(k) -> 1 if D has a key k, else 0");
static char get__doc__[] =
"D.get(k[,d]) -> D[k] if D.has_key(k), else d. d defaults to None.";
PyDoc_STRVAR(get__doc__,
"D.get(k[,d]) -> D[k] if D.has_key(k), else d. d defaults to None.");
static char setdefault_doc__[] =
"D.setdefault(k[,d]) -> D.get(k,d), also set D[k]=d if not D.has_key(k)";
PyDoc_STRVAR(setdefault_doc__,
"D.setdefault(k[,d]) -> D.get(k,d), also set D[k]=d if not D.has_key(k)");
static char pop__doc__[] =
"D.pop(k) -> v, remove specified key and return the corresponding value";
PyDoc_STRVAR(pop__doc__,
"D.pop(k) -> v, remove specified key and return the corresponding value");
static char popitem__doc__[] =
PyDoc_STRVAR(popitem__doc__,
"D.popitem() -> (k, v), remove and return some (key, value) pair as a\n\
2-tuple; but raise KeyError if D is empty";
2-tuple; but raise KeyError if D is empty");
static char keys__doc__[] =
"D.keys() -> list of D's keys";
PyDoc_STRVAR(keys__doc__,
"D.keys() -> list of D's keys");
static char items__doc__[] =
"D.items() -> list of D's (key, value) pairs, as 2-tuples";
PyDoc_STRVAR(items__doc__,
"D.items() -> list of D's (key, value) pairs, as 2-tuples");
static char values__doc__[] =
"D.values() -> list of D's values";
PyDoc_STRVAR(values__doc__,
"D.values() -> list of D's values");
static char update__doc__[] =
"D.update(E) -> None. Update D from E: for k in E.keys(): D[k] = E[k]";
PyDoc_STRVAR(update__doc__,
"D.update(E) -> None. Update D from E: for k in E.keys(): D[k] = E[k]");
static char clear__doc__[] =
"D.clear() -> None. Remove all items from D.";
PyDoc_STRVAR(clear__doc__,
"D.clear() -> None. Remove all items from D.");
static char copy__doc__[] =
"D.copy() -> a shallow copy of D";
PyDoc_STRVAR(copy__doc__,
"D.copy() -> a shallow copy of D");
static char iterkeys__doc__[] =
"D.iterkeys() -> an iterator over the keys of D";
PyDoc_STRVAR(iterkeys__doc__,
"D.iterkeys() -> an iterator over the keys of D");
static char itervalues__doc__[] =
"D.itervalues() -> an iterator over the values of D";
PyDoc_STRVAR(itervalues__doc__,
"D.itervalues() -> an iterator over the values of D");
static char iteritems__doc__[] =
"D.iteritems() -> an iterator over the (key, value) items of D";
PyDoc_STRVAR(iteritems__doc__,
"D.iteritems() -> an iterator over the (key, value) items of D");
static PyMethodDef mapp_methods[] = {
{"has_key", (PyCFunction)dict_has_key, METH_O,
@ -1816,14 +1816,14 @@ dict_iter(dictobject *dict)
return dictiter_new(dict, select_key);
}
static char dictionary_doc[] =
PyDoc_STRVAR(dictionary_doc,
"dict() -> new empty dictionary.\n"
"dict(mapping) -> new dictionary initialized from a mapping object's\n"
" (key, value) pairs.\n"
"dict(seq) -> new dictionary initialized as if via:\n"
" d = {}\n"
" for k, v in seq:\n"
" d[k] = v";
" d[k] = v");
PyTypeObject PyDict_Type = {
PyObject_HEAD_INIT(&PyType_Type)