A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2002-May/024150.html below:

[Python-Dev] __doc__ string of builtin types

[Python-Dev] __doc__ string of builtin typesholger krekel pyth@devel.trillke.net
Thu, 16 May 2002 16:27:32 +0200
Patrick K. O'Brien wrote:
> [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.

i have just patched my inspect.py and pydoc.py to include the above
check. works fine! next time i update my cvs tree i submit
a patch.

regards,

    holger




RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4