<br><div class="gmail_quote">On Wed, Mar 27, 2013 at 10:48 PM, Shane Green <span dir="ltr"><<a href="mailto:shane@umbrellacode.com" target="_blank">shane@umbrellacode.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

<div style="word-wrap:break-word">That's clever: even works for zero because it's returned by or as second false.  Cool.  So I suppose I have to come up with more examples now ;-)  <div><br></div><div>Actually, on that point, I actually think the seen.added(value)  (with a better name) is quite a bit cleaner than the one using "or".   Clever as it is, I think someone learning the language would flinch when they saw that… :-)</div>

</div></blockquote><div><br></div><div>Yes, I suppose it's a bit obscure but you're only going to use it in a case where you value brevity over clarity, right?</div><div> </div><div>The C comma operator which always returns the second value, not depending that the first value is false. You can write this in Python as:</div>

<div><br></div><div><font face="courier new, monospace">    (foo, bar)[1]</font></div><div><br></div><div>or is there some cleaner way to write that?</div><div><br></div><div><font face="courier new, monospace">    #define comma  and False or</font></div>

<div><font face="courier new, monospace">    :-)</font></div><div> </div><font face="arial, helvetica, sans-serif">--- Bruce</font><div><span style="font-family:arial,helvetica,sans-serif">Latest blog post: Alice's Puzzle Page </span><a href="http://www.vroospeak.com/" target="_blank" style="font-family:arial,helvetica,sans-serif">http://www.vroospeak.com</a></div>

<div><div><font face="arial, helvetica, sans-serif">Learn how hackers think: <a href="http://j.mp/gruyere-security" target="_blank">http://j.mp/gruyere-security</a></font></div></div><div> </div></div>