4 May
2012
4 May
'12
6:19 a.m.
On Thu, May 3, 2012 at 1:57 PM, nbv4
Instead of
class CustomException(Exception): pass
how about just
class CustomException(Exception)
(no colon, no 'pass') I'm sure this has been suggested before, but I couldn't find any...
"Special cases aren't special enough to break the rules." -- PEP 20 Just use a docstring-only body; you should be documenting what the exception means anyways: class CustomException(Exception): """This exception means that a custom error happened.""" # other module-level code… Cheers, Chris