Is there a difference between “raise exception()” and “raise exception” without parenthesis?

后端 未结 3 645
旧时难觅i
旧时难觅i 2020-12-03 02:12

Defining a parameterless exception:

class MyException(Exception):
    pass

When raised, is there any difference between:

ra         


        
3条回答
  •  情深已故
    2020-12-03 02:52

    Go look at the docs for the raise statement. It's creating an instance of MyException.

提交回复
热议问题