New submission from Aivar Annamaa: Following program shows that frame.f_code.co_firstlineno ignores first line if it is a comment (or empty line), but inspect.getsource(frame.f_code) returns also the first line:
# first line import inspect frame = inspect.currentframe() print(frame.f_code.co_firstlineno) print(inspect.findsource(frame.f_code)) ---------- messages: 276211 nosy: Aivar.Annamaa priority: normal severity: normal status: open title: If module starts with comment or empty line then frame.f_code.co_firstlineno is inconsistent with inspect.findsource _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue28121> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com