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 anupama.srinivas.murthy
Recipients Gwenlliana, anupama.srinivas.murthy, r.david.murray, rhettinger
Date 2015-01-19.10:16:56
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1421662616.65.0.684533136484.issue23217@psf.upfronthosting.co.za>
In-reply-to
Content
In Python 2.7, the capture happens even if there is no decorator. The code:
#Hey this is f
def f():

 return
 
help(f)
gives the output:
Help on function f in module __main__:

f()
    #Hey this is f
whereas a docstring inside the function causes the comment to be ignored. Therefore, the code:
#Hey this is f
def f():
 '''this is the function f'''
 return
 
help(f)
gives the output:
Help on function f in module __main__:

f()
    this is the function f
@Gwenllina:I need to clarify my previous comment. The docstring that would cause the preceding comment to be ignored must be in the inner function in case of the first example. Placing it in f() still causes comment capture as you said
History
Date User Action Args
2015-01-19 10:16:56anupama.srinivas.murthysetrecipients: + anupama.srinivas.murthy, rhettinger, r.david.murray, Gwenlliana
2015-01-19 10:16:56anupama.srinivas.murthysetmessageid: <1421662616.65.0.684533136484.issue23217@psf.upfronthosting.co.za>
2015-01-19 10:16:56anupama.srinivas.murthylinkissue23217 messages
2015-01-19 10:16:56anupama.srinivas.murthycreate