ternary operator

David LeBlanc whisper at oz.net
Fri Feb 7 17:22:01 EST 2003


> -----Original Message-----
> From: python-list-admin at python.org
> [mailto:python-list-admin at python.org]On Behalf Of Andrew Koenig
> Sent: Friday, February 07, 2003 8:20
> To: python-list at python.org
> Subject: Re: ternary operator
>
>
> David> I think that's POOR programming practice!
>
> Then how would you write the following loop?
>
>         i = 0;
>         while i < len(n) and x[i] != y:
>                 i += 1
>
> --
> Andrew Koenig, ark at research.att.com, http://www.research.att.com/info/ark

I think you missed the point twice: it's not about indexing, it's about
calling a function whose side effects you depend on (always) in a component
of an expression that might not get evaluated.

Dave LeBlanc
Seattle, WA USA






More information about the Python-list mailing list