We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
inspect.{getsourcelines, findsource}
Run the following program
import inspect import inspect _, lineno1 = inspect.getsourcelines(inspect.currentframe()) _, lineno2 = inspect.findsource(inspect.currentframe()) print(lineno1, lineno2)
Expected Result The line numbers are expected to be 1-based, so the expected output is 1 1.
1 1
Actual Result The actual output is 0 0.
0 0
Related discussion: #103226
main
inspect.getsourcelines()
Bug report
Run the following program
Expected Result
The line numbers are expected to be 1-based, so the expected output is
1 1.Actual Result
The actual output is
0 0.Related discussion: #103226
Your environment
mainbranchLinked PRs
inspect.getsourcelines()to return 1-based line numbers #103226