Python Interpreter Bug?

Rakis rakis at gmpexpress.net
Sat Aug 24 00:37:31 CEST 2002


    On my Mandrake Linux 8.2 machine (I tried both the out-of-the-box 
Python 2.2.0 interpreter and the latest 2.2.1 updates from cooker) the 
appended code executes as expected when compiled on the fly but dies 
when loaded from a ".pyc" file.

    Anyone want to verify this ?

    Rakis


#--------------------------------------------------------------
def show_problem( ):
   
    decl       = "class Namespace1::ATest: public T1, private T2"
    class_decl = ""
    bases      = ""
   
    i          = 0
   
    while i < len(decl):
    if decl[i] is ":" and decl[i-1] is not ":" and decl[i+1] is not ":":
        class_decl = decl[:i]
        bases      = decl[i+1:]
    i += 1
   
    print "Class:  ", class_decl
    print "Bases:  ", bases






More information about the Python-list mailing list