[Python-Dev] __doc__ string of builtin types
Thomas Heller
thomas.heller@ion-tof.com
Thu, 16 May 2002 10:54:31 +0200
From: "Patrick K. O'Brien" <pobrien@orbtech.com>
> [Thomas Heller]
> >
> > (I've filed a slightly confused bug report 550290.)
> >
> > "spam".__doc__ is the same as str.__doc__,
> > it describes what the str(...) would do. Same for
> > 42 . __doc__, and certainly many other objects.
> > While normally I don't care about the doc-string of
> > these objects, the output of pydoc looks strange:
>
> I agree. I see the same thing with the namespace viewer in PyCrust under
> Python 2.2 and it is less than ideal, imho.
>
I've uploaded a patch to http://www.python.org/sf/550290, currently
for stringobject.c only, which keeps the current doc-string
for the 'str' type/function, but returns None as the doc-string
of str instances. The same could (and should) be done for
int, float, and maybe other builtin types as well. The patch
can easily be changed to return an actual doc-string.
Thomas