PEP 289: universal and existential operators

Alex Martelli aleax at aleax.it
Thu Nov 6 17:06:37 EST 2003


Delaney, Timothy C (Timothy) wrote:

>> From: Alex Martelli [mailto:aleax at aleax.it]
> 
> [lots of good stuff]
> 
>> and if it comes to the comparison after the implied and, the
>> itemsiterator is exhausted by that time.  So, maybe, it _is_
>> for the better that the apparently popular preference for 'all'
>> to mean 'alltrue' stops us from having 'all' work like in SQL
>> instead - it does save us from potentially non-obvious behavior
>> when both comparison chaining and iterators-as-opposed-to-
>> iterables are simultaneously involved.
> 
> I *love* watching people's thought processes in action :)

It's more a case of "besides, those grapes weren't ripe" --
trying to rationalize/console myself that we won't get that
cool SQLish 'all' -- in fact, it would suffice to keep track
of whether more than one comparison is invoked (to restart
iteration on an iterable, raise an appropriate ValueError on
an iterator) to track all _practical_ cases, i.e., excepting
perverse uses such as:

if x > all(foos) < y :

which DESERVE to fail nonobviously...!-)


Alex





More information about the Python-list mailing list