[Python-Dev] Simplify lnotab? (AST branch update)

Greg Ewing greg.ewing at canterbury.ac.nz
Fri Oct 14 03:25:26 CEST 2005


Phillip J. Eby wrote:

> +1.  I'd be especially interested in lifting the current requirement 
> that line ranges and byte ranges both increase monotonically.  Even 
> better if the lines for a particular piece of code don't have to all 
> come from the same file.

How about an array of:

   +----------------+----------------+----------------+
   | bytecode index |     file no.   |    line no.    |
   +----------------+----------------+----------------+

Entries are sorted by bytecode index, with each entry
applying from that bytecode position up to the position
of the next entry. The file no. indexes a tuple of file
names attached to the code object. All entries are 32-bit
integers.

Easy to generate, easy to look up with a binary search,
should be big enough for everyone except those generating
obscenely huge code objects on 64-bit platforms.

-- 
Greg Ewing, Computer Science Dept, +--------------------------------------+
University of Canterbury,	   | A citizen of NewZealandCorp, a	  |
Christchurch, New Zealand	   | wholly-owned subsidiary of USA Inc.  |
greg.ewing at canterbury.ac.nz	   +--------------------------------------+


More information about the Python-Dev mailing list