Trinary operator?

Philipp Lenssen lenssen at hitnet.rwth-aachen.de
Wed Apr 17 15:23:02 EDT 2002


"Philipp Lenssen" <lenssen at hitnet.rwth-aachen.de> wrote in message
news:a9khoc$j7h$1 at nets3.rz.RWTH-Aachen.DE...
>..
> The three commented lines above would not have been needed if I'd use
> something like '... name="' + (key != 'station') ? key : 'station' + '"
...'
>..

That should be '... name="' + (key != 'station') ? key : 'lastStation' + '"
...'

Or since I sometimes prefer testing in a positive way rather than the most
likey, '... name="' + (key == 'station') ? 'lastStation' : key + '" ...'





More information about the Python-list mailing list