Thomas Haller <thom...@gmail.com> added the comment:

> We could keep f_lineno unchanged, despite the fact that its value can be wrong

It was not completely wrong. It was seemingly good enough for the past 20+ 
years.


The change in behaviour is one thing. It's also inconvenient that, even when 
being aware of the change in behaviour, there is no workaround to get the same 
number across python versions. Something like:

  if hasattr(frame, 'f_lineno_legacy'):
      return frame.f_lineno_legacy
  else
      return frame.f_lineno

Are you aware of such a workaround?


> But there are some drawbacks in such approach.

Definitely. While I don't agree with the decision and priorities for how the 
final approach was chosen, thank you for explaining them :)

----------

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

Reply via email to