[Freeipa-devel] [PATCH] 035 Fixes for the DNS plugin

Adam Young ayoung at redhat.com
Fri Jan 7 17:05:22 UTC 2011


On 01/07/2011 11:59 AM, Jakub Hrozek wrote:
> On 01/07/2011 05:28 PM, Adam Young wrote:
>> I'm Not a pythonista. What is this line doing?
>>
>>
>> On 01/07/2011 10:58 AM, Jakub Hrozek wrote:
>>> + nameserver = nameserver[-1] == '.' and nameserver or nameserver + '.'
>>
>
> This construct is called the 'and-or trick' and somewhat resembles 
> ternary operator (which was added to python in 2.7 IIRC, so I'm not 
> sure if it's old enough to use) from C and other languages. See 
> http://diveintopython.org/power_of_introspection/and_or.html#d0e9975 
> for details.
>
> But yeah, a simple if would be more readable. A new patch is attached, 
> thanks for bringing it up.
>
>
> _______________________________________________
> Freeipa-devel mailing list
> Freeipa-devel at redhat.com
> https://www.redhat.com/mailman/listinfo/freeipa-devel
ACK
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listman.redhat.com/archives/freeipa-devel/attachments/20110107/9ca09807/attachment.htm>


More information about the Freeipa-devel mailing list