A syntax idea for one-liners

marshall marshall at spamhole.com
Mon May 26 01:49:34 EDT 2003


Peter Hansen <peter at engcorp.com> wrote in message 
> Beni Cherniavsky wrote:
>  
> Warning!  Warning!  Absolutely unreadable code alert!
> 
> >     if a: if b: c;; if d: e;;; f; h
> 
> (You're not serious, are you?  I checked, but it's not April 1st... ;-)
> 
> -Peter

IMHO one liners are inherently unreadable.  But Beni says:

"Of course, this should be strongly discouraged in normal code where
one can do otherwise."

Exactly what form would such discouragement take?

Wouldn't it be easier to just use a routine that converts the above to
current Python syntax and apply it in the special cases you mentioned?

Marshall




More information about the Python-list mailing list