Conditional operator in Python?

Alex Martelli aleaxit at yahoo.com
Wed Apr 4 03:33:07 EDT 2001


"Amit Patel" <amitp at Xenon.Stanford.EDU> wrote in message
news:9aec8q$kl4$1 at nntp.Stanford.EDU...
>
>  Roy Smith  <roy at panix.com> wrote:
> | "Tim Peters" <tim.one at home.com> wrote:
> | > Eric, there's no feature from *any* language that isn't regularly
suggested
> | > for Python.
> |
> | I have never once seen somebody suggest that we have either
FORTRAN-style
> | computed gotos or counted hollerith constants :-)
>
> FORTRAN-style spaces in identifiers on the other hand ..

...would no doubt be considered 'cool' by the same kind of people who
like the idea of naming standard folders in such ways as "Program Files",
"My Documents", "Windows Update Setup Files", and other space-containing
strings (thus requiring abundant preventive quoting in program startup
strings &c -- yecch).  Avoiding clever parser look-ahead to distinguish
    for a in b:
from
    forainb = 23
seems a much better idea to me (and I _am_ an old Fortran hand!-).

I suspect spaces (or underscores?) within _numeric literals_ might
prove more popular -- I'd LOVE to be able to write, e.g.:
    a = 1 000 000 000
to make the number "one billion" more legible -- but maybe it's not
as good an idea as it seems at first glance: if the number of digits
between separating spaces was not checked, it might be misleading;
if it WAS checked, then I'm not sure that "three by three" is OK in
all locales (but maybe non-US locales need not be supported here,
just as they aren't, for example, for decimal-point).  [Commas as
digit-separators in literals are not acceptable because of backwards
compatibility -- "a=1,000" already has meaning, binding a to a tuple
of 2 elements, of course!].


Alex






More information about the Python-list mailing list