Movatterモバイル変換


[0]ホーム

URL:


homepage

Message145937

This issue trackerhas been migrated toGitHub, and is currentlyread-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

AuthorCameron.Hayne
RecipientsCameron.Hayne
Date2011-10-19.18:59:41
SpamBayes Score3.5193548e-10
Marked as misclassifiedNo
Message-id<1319050782.47.0.924539258184.issue13223@psf.upfronthosting.co.za>
In-reply-to
Content
If the docstring for a method has example code that uses 'self',the 'self' will not appear in the HTML generated by pydoc.writedocExample:#---------------------------------def getAnswer(self):    """    Return the answer.    Example of use:        answer = self.getAnswer()    """    return 42#---------------------------------The generated HTML will have:getAnswer(self)    Return the answer.    Example of use:        answer = getAnswer()where the final "getAnswer" is an HTML link.--------------------------------------------I believe the problem arises on line 553 of the Python 2.7 version of pydoc.py which is as follows:    results.append(self.namelink(name, methods, funcs, classes))The appended text is the same whether or not the method call in the docstring was prefaced with 'self' or not. The 'self' has been eaten up by the regex and is in the 'selfdot' variable which is ignored by the above line.
History
DateUserActionArgs
2011-10-19 18:59:42Cameron.Haynesetrecipients: +Cameron.Hayne
2011-10-19 18:59:42Cameron.Haynesetmessageid: <1319050782.47.0.924539258184.issue13223@psf.upfronthosting.co.za>
2011-10-19 18:59:41Cameron.Haynelinkissue13223 messages
2011-10-19 18:59:41Cameron.Haynecreate
Supported byThe Python Software Foundation,
Powered byRoundup
Copyright © 1990-2022,Python Software Foundation
Legal Statements

[8]ページ先頭

©2009-2026 Movatter.jp