[Python-ideas] one line class definitions

Ned Batchelder ned at nedbatchelder.com
Fri May 4 00:44:42 CEST 2012


On 5/3/2012 4:57 PM, nbv4 wrote:
> Instead of
>
> class CustomException(Exception):
>     pass
>
> how about just
>
> class CustomException(Exception)
>
How about just:

     class CustomException(Exception): pass

or better yet, using more lines?

--Ned.

> (no colon, no 'pass')
> I'm sure this has been suggested before, but I couldn't find any...
>
>
> _______________________________________________
> Python-ideas mailing list
> Python-ideas at python.org
> http://mail.python.org/mailman/listinfo/python-ideas
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20120503/1d2ef3d5/attachment.html>


More information about the Python-ideas mailing list