Subject: Re: Break the dominance of boolean values in boolean context
Date: Wednesday 14th September 2011 00:59:07 UTC (over 6 years ago)
On 9/12/2011 4:20 PM, Lukas Lueg wrote: > Summing all up, I really think that we should break the dominance of > bool() and take a look at how we can implement boolean contexts > without relying on boolean values all the time. I was surprised to find that any() returns True or False, regardless of the values it encounters. Conceptually, these two are the same (where S is a sequence S0, S1, S2, ..., Sn): any(S) S0 or S1 or S2 or ... or Sn They are equivalent except that if Sx is the first true-ish value, the first will return True while the second returns Sx. Why shouldn't any() also return Sx? --Ned.