
July 30, 2000
2:02 p.m.
Hasn't backward compatibility already been broken for 2.0? So why not break it a little more?
Sure -- within reason.
It always seemed odd to me that the current line number is always kept up to date, even though 99.999% of the time, no one will care. Why not just keep a small table that holds the offset in the bytecode at which each line starts, and look it up when it's needed?
That already exists. Search for co_lnotab, and for PyCode_Addr2Line(). --Guido van Rossum (home page: http://www.pythonlabs.com/~guido/)