Difference between raise Exception, “foo” and raise Exception(“foo”)?

前端 未结 1 888
孤城傲影
孤城傲影 2021-02-19 02:55

The title is pretty self explanatory -- what\'s the difference between:

raise Exception, \"foo\"

and

raise Exception(\"foo\")
<         


        
相关标签:
1条回答
  • 2021-02-19 03:21

    both amount to the same thing in Python2. in Python3, the raise Exception, "foo" syntax is no longer supported.

    0 讨论(0)
提交回复
热议问题