anupama srinivas murthy added the comment:

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

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue23217>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to