|
![](/i/fill.gif) |
On 8/20/2011 22:52, Shay wrote:
> On Fri, 19 Aug 2011 13:49:01 -0700, Darren New wrote:
>
>> On 8/19/2011 13:04, Shay wrote:
>>> bool_a = len(A[0]) == 2
>>> bool_b = min([A[2] == x[2] for x in A[1:]) bool_c = ccw_angle(*A)< pi
>>>
>>> bool_b will not work if bool_a is true
>>
>> bool_b = bool_a ? min(...) : false
>
> Beautiful, but that doesn't seem to be valid Python.
OK. I had assumed python had that operator. It's the same as
if bool_a then bool_b = min(...) else bool_b = false;
> bool_b = False if bool_a else min(...)
> does work. So, I learned something there.
I think you *might* have the condition reversed on that. That looks like
it's saying you don't evaluate bool_b if bool_a is true.
--
Darren New, San Diego CA, USA (PST)
How come I never get only one kudo?
Post a reply to this message
|
![](/i/fill.gif) |