R. David Murray added the comment:

Well, there's nobody being paid for keeping track of bugs and responding, so 
things do slip through the cracks.  Pinging an issue after there's been a lack 
of response for a while is appropriate, if you notice it yourself :)  (Mark, 
while he was trying to be helpful, does not speak for the Python community.)

As far as the question of is this intentional, the answer is yes.  Presumably 
you are calling it on the 'main' function.  If you call it on the module, you 
will get all source lines from that module.  (You can't call it "on the file", 
the argument must be an object.)

You'll see why it is intentional for the 'main' case if you consider that while 
in Python whitespace is syntactically significant, this is *not* true for 
Python comments indentation, because comments are treated as if they *are* 
whitespace.  getsourcelines stops looking at sourcelines on the last line 
recorded in the lnotab for that function, so any subsequent comments are not 
considered part of the function.

So, I'm closing this as "not a bug" since it works as expected for me in both 
python 2.7 and 3.6.

Thanks for waking the issue up, Pam.  You have contributed to python by getting 
an open issue closed, but you'll have to find something else to work on during 
the break I'm afraid.

----------
nosy: +r.david.murray
resolution:  -> not a bug
stage:  -> resolved
status: open -> closed

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

Reply via email to