Insights on SystemError: com_backpatch: offset too large
Question: In python, `"SystemError: com_backpatch: offset too large"` is thrown when
executing the code generated by the following:

    
    
    f = open("test.py", "w")
    f.write("def fn():\n   a =1000\n")
    for a in xrange(3000):
       if a == 0:
          f.write("   if a == "+str(a)+": \n      print  "+str(a)+"\n")
       else:
          f.write("   elif a == "+str(a)+": \n      print  "+str(a)+"\n")
    
    
    
    f.close()
    
    import test
    

It is clear that if the length statement goes beyond a certain length, it
throws this error.

Can someone give more insight into this error?


Answer: Accourding to this: <http://www.cgl.ucsf.edu/pipermail/chimera-
dev/2007/000404.html>

> The Python bytecode compiler has a limitation of a maximum of a 16 bit
> offset in a jump instruction. This means that you don't want to have 64K
> worth of characters in a single conditional block of code

More details here: <http://www.mail-archive.com/python-
list@python.org/msg72631.html>

