Difference between raise Exception, "foo" and raise Exception("foo")?
The title is pretty self explanatory -- what's the difference between:
raise Exception, "foo"
a开发者_开发问答nd
raise Exception("foo")
Does it do exactly the same thing, just different syntax?
I'm using Python 2.x, but I'd like to hear of any differences in Python 3.x
both amount to the same thing in Python2. in Python3, the raise Exception, "foo"
syntax is no longer supported.
精彩评论