On Wed, Mar 27, 2013 at 10:48 PM, Shane Green firstname.lastname@example.org:
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 ;-)
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… :-)
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?
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:
or is there some cleaner way to write that?
#define comma and False or :-)