This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author raulcd
Recipients Gwenlliana, anupama.srinivas.murthy, r.david.murray, raulcd, rhettinger
Date 2015-04-15.20:05:56
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1429128356.41.0.0474805641337.issue23217@psf.upfronthosting.co.za>
In-reply-to
Content
I am not sure what the expected behavior is. Based on the code on pydoc.py we can find:
def getdoc(object):
    """Get the doc string or comments for an object."""
    result = inspect.getdoc(object) or inspect.getcomments(object)

So if the doc string is not found it searches for the lines of comments immediately preceding the object's source code.

This is why the example from Anupama returns the preceding comment on both python2.7 and python3.5 (not only on python2.7).

@rhettinger this seems like a deliberate decision to add as help documentation the preceding comment if the docstring is not found. What were you expecting? Should this be changed?
History
Date User Action Args
2015-04-15 20:05:56raulcdsetrecipients: + raulcd, rhettinger, r.david.murray, anupama.srinivas.murthy, Gwenlliana
2015-04-15 20:05:56raulcdsetmessageid: <1429128356.41.0.0474805641337.issue23217@psf.upfronthosting.co.za>
2015-04-15 20:05:56raulcdlinkissue23217 messages
2015-04-15 20:05:56raulcdcreate