[Python-ideas] one line class definitions
Guido van Rossum
guido at python.org
Fri May 4 00:56:07 CEST 2012
(Repeat, somehow the message to which I replied had
python-ideas at googlegroups.com which doesn't exist.)
On Thu, May 3, 2012 at 2:53 PM, Guido van Rossum <guido at python.org> wrote:
> That's just asking for more mysterious errors if you forget the colon.
> You can always write
>
> class Foo(Bar): pass
>
> On Thu, May 3, 2012 at 1:57 PM, nbv4 <nbvfour at gmail.com> wrote:
>> 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...
>>
>> _______________________________________________
>> Python-ideas mailing list
>> Python-ideas at python.org
>> http://mail.python.org/mailman/listinfo/python-ideas
>>
>
>
>
> --
> --Guido van Rossum (python.org/~guido)
--
--Guido van Rossum (python.org/~guido)
More information about the Python-ideas
mailing list