Interesting insight from PyCon talk on exceptions....
# random
h
Interesting insight from PyCon talk on exceptions. We should never use this idiom
str(e)
, and only ever
repr(e)
.
repr(e)
will include the exception name
Copy code
In [1]: str(ValueError("Hi"))
Out[1]: 'Hi'

In [2]: repr(ValueError("Hi"))
Out[2]: "ValueError('Hi')"