Code very much like yours works fine here. One reason it might not work in your case is if the "..." part of 'def x()' creates a local variable named y. $ cat /tmp/basic_one.py def main(): y() x() def y(): print "y" def x(): print "x" y() main() $ python /tmp/basic_one.py y x y Jeff