Bugs item #1367183, was opened at 2005-11-26 12:42
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1367183&group_id=5470

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Python Library
Group: Python 2.4
Status: Open
Resolution: None
Priority: 5
Submitted By: Drew Perttula (drewp)
Assigned to: Nobody/Anonymous (nobody)
Summary: inspect.getdoc fails on objs that use property for __doc__

Initial Comment:
inspect.getdoc has these lines:

     if not isinstance(doc, types.StringTypes):
         return None

which interfere with the case where __doc__ is some
other thing that has a good __str__. I wanted to make a
lazy __doc__ that did an expensive lookup of some
external documentation only when it was str()'d, but
since doc displayers often (correctly) use
inspect.getdoc, they were getting None.

I think the intention of the test in getdoc() is to
avoid trying string operations on a __doc__ that is
None. I think that a more lenient version would allow
me to do my fancy docstrings but still solve the
'__doc__ is None' problem. Please consider the
following patch:

if doc is None:
     return None
doc = str(doc)



----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1367183&group_id=5470
_______________________________________________
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to