PEP 289: universal and existential operators

rm roel.mathys at yucom.be
Wed Nov 5 15:57:21 EST 2003


austin at smartobject.biz (Jess Austin) wrote in message news:<b3ad1da7.0311050138.433f3478 at posting.google.com>...
> python at rcn.com (Raymond Hettinger) wrote in message news:<5d83790c.0310231158.65595858 at posting.google.com>...
> > Peter Norvig's creative thinking triggered renewed interest in PEP 289.
> > That led to a number of contributors helping to re-work the pep details
> > into a form that has been well received on the python-dev list:
> > 
> >     http://www.python.org/peps/pep-0289.html
> > 
> > In brief, the PEP proposes a list comprehension style syntax for....
> 
> Toward the end of the PEP, we have the following:
> 
> >The utility of generator expressions is greatly enhanced when
> combined with >reduction functions like sum(), min(), and max().
> Separate proposals are >forthcoming that recommend several new
> accumulation functions possibly >including: product(), average(),
> alltrue(), anytrue(), nlargest(), nsmallest().
> 
> 
> This is great.  I'd like to request that alltrue() and anytrue() be
> renamed forall() and exists(), repsectively.  It would allow:
> 
> def prime(x):
>     return forall(x%y for y in xrange(2, math.sqrt(x)))
> 
> etc.  This is a an opportunity to be mathematically precise, and I
> think we should be.  Python is going to have the universal and
> existential operators in a very general syntax, so let's celebrate it
> a little.
> 
> later,
> Jess


maybe allfalse() should be included aswell?

rm




More information about the Python-list mailing list