开发者

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜