SV: SV: A little disappointed so far

Carsten Gehling carsten at gehling.dk
Tue May 27 17:48:22 EDT 2003


> Fra: python-list-admin at python.org
> [mailto:python-list-admin at python.org]På vegne af Duncan Booth
> Sendt: 19. maj 2003 16:30

> > 2) assignments in test-expressions - eg:
> > while i++ < 10:
> > or
> > if row = cursor.fetchone() != None:
>
> The first of these is often (not always) better written as a for loop in
> Python. These days it is often worthwhile looking at any while loop and
> considering whether to use a for loop and an iterator instead.
>
> The second also looks like it should end up being a for loop:
>
>     for row in cursor:
>        ...

This only goes to show, that I still (as you also points out) does not think
Pythonic yet. What a very neat feature... :-)

> >
> > 3) the ternary operator - x = y > z ? k : m (and, no, I do NOT like
> > any of the workarounds in the Python Cookbook)
>
> A readable form of conditional expression is planned to be added
> in Python
> 2.4. See http://www.python.org/peps/pep-0308.html for the
> proposal and the
> various options that were discussed.

Where do I vote for this? I sincerily wants the ternary operator implemented
(tell me even if you should be against it :-)

- Carsten






More information about the Python-list mailing list