POV-Ray : Newsgroups : povray.off-topic : Programming style question - specifically Python : Re: Programming style question - specifically Python Server Time
29 Jul 2024 14:25:26 EDT (-0400)
  Re: Programming style question - specifically Python  
From: Shay
Date: 21 Aug 2011 01:52:04
Message: <4e509d04@news.povray.org>
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. However, a bit of 
guess-work reveals that:

bool_b = False if bool_a else min(...)

does work. So, I learned something there.


Thanks.
 -Shay


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.