Adding a Par construct to Python?

Steven D'Aprano steve at REMOVE-THIS-cybersource.com.au
Thu May 28 00:07:00 EDT 2009


On Wed, 27 May 2009 12:58:02 +0000, Albert van der Horst wrote:

>>And how is reduce() supposed to know whether or not some arbitrary
>>function is commutative?
> 
> Why would it or need it? A Python that understands the ``par'' keyword
> is supposed to know it can play some tricks with optimizing reduce() if
> the specific function is commutative.

Fine. Move the smarts out of reduce() into the compiler. How is the 
compiler supposed to know if an arbitrary function is commutative?



-- 
Steven



More information about the Python-list mailing list