This is actually applicable to any Python code, but is especially relevant to extensions that save data in Chimera sessions:  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 (i.e. if/else, loops, try/except).  Otherwise you will get the somewhat opaque:

SystemError: com_backpatch: offset too large

So if you have data structures that may be potentially large when written to a session file, try to place their definitions in the session file outside of conditional blocks.

--Eric

                        Eric Pettersen

                        UCSF Computer Graphics Lab

                        pett@cgl.ucsf.edu

                        http://www.cgl.ucsf.edu