Are there any declaration keywords in python, like local, global, private, public etc. I know it\'s type free but how do you know if this statement:
x = 5;
I just realized there's a more direct answer too:
x = 5 def test(): print 'x' in globals() if __name__ == "__main__": test()
So if 'variablename' in globals(): the statement is an assignment otherwise the statement is a declaration