Raise class exception or instance of class exception when no arguments are passed

python

Solution

It doesn't matter, as Python will create the instance if you only raised the class.

However, it is better to be explicit and create the instance yourself, to make it unambiguous you meant to use it without arguments.

Problem

I saw that sometimes there are raised classes and sometimes there are raised instances of classes. Which way to raise exception is better if you don't want to add any additional info as arguments ``` raise ValueError ``` or ``` raise ValueError() ``` ?

Original source