""" Test of invalid chars in source code and how Python handles them. """ # A ^@ causes itself and the next two characters to be ignored. de f = 1 # the ^@e^M" are ignored, leaving "df" de = 2 # the ^@e^M" are ignored, leaving "d" try: d;print "d=%s defined" % d except NameError, e: print e try: e;print "e=%s defined" % e except NameError, e: print e try: f;print "f=%s defined" % f except NameError, e: print e try: de;print "de=%s defined" % de except NameError, e: print e try: df;print "df=%s defined" % df except NameError, e: print e try: ef;print "ef=%s defined" % ef except NameError, e: print e ac = "ac" ag = "ag" # The next two lines are equivalent to: lst = [abc,ag] lst = [ac,abc] g] print "lst=%s" % lst if ac == ab c: print "ac == a^@b^Mc matched!!!" else: print "No match" # The next statement is not executed when it should be and no error message is issued. print "End of Test"