A syntax idea for one-liners
Michele Simionato
mis6 at pitt.edu
Wed May 28 10:57:11 EDT 2003
Beni Cherniavsky <cben at techunix.technion.ac.il> wrote in message news:<mailman.1053893140.26725.python-list at python.org>...
<snip>
>
> if a: if b: c;; if d: e;;; f; h
<snip>
-1 on the syntax, even if I am not against the idea of improving Python
support for one-liners (still, it is not my highest priority).
You can already write (at least on Linux)
$ echo -e "if a:\n if b:\n c\n if d:\n e\nf\nh"
if a:
if b:
c
if d:
e
f
h
which is ugly but (at least to me) more comprehensible than the semicolon
notation. IMHO, the problem of writing a multiline statement as a one-liner has
to be devolved to the operating system, not to Python, which by design, is
intended to spare horizontal space at the expense of vertical space.
Just my 0.02 c
Michele
More information about the Python-list
mailing list