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/024149.html below:

[Python-Dev] __doc__ string of builtin types

[Python-Dev] __doc__ string of builtin types [Python-Dev] __doc__ string of builtin typesPatrick 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
Orbtech





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