[Python-Dev] __doc__ string of builtin types

Patrick K. O'Brien pobrien@orbtech.com
Thu, 16 May 2002 08:40:38 -0500

[holger krekel]
> as a workaround i have in the past used the check
>     getattr(type(obj),'__doc__','')==getattr(obj,'__doc__','')
> to determine if an object has 'real' documentation.
> only doesn't work for the type-object because type(type)==type.

Thanks for the tip. In my particular case I'm actually using
inspect.getdoc(). I suppose I could apply the same check to what it returns.
Or someone might want to patch inspect.getdoc() if that would be easier in
the short term. Just thought I'd mention that in case Ka-Ping Yee is
following this thread.

Patrick K. O'Brien