A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2005-June/054384.html below:

[Python-Dev] Recommend accepting PEP 312 -- Simple Implicit Lambda

[Python-Dev] Recommend accepting PEP 312 -- Simple Implicit Lambda [Python-Dev] Recommend accepting PEP 312 -- Simple Implicit LambdaJim Jewett jimjjewett at gmail.com
Mon Jun 20 19:42:09 CEST 2005
>>>                lambda x,y: x+y*y
>>>                lambda x,y: y**2+x

>>> are essentialy the same functions with different implementations [1].

>> Except that they are not. Think of __pow__, think of __add__ and __radd__.

> You know the difference between the concept of a function and it's 
> infinitely many representations? That's why formal definitions exist.

To clear up the archives, the problem is that Kay and Reinhold were 
talking about different things when they said "function".  

In arithmetic (and most sane extensions), those two lines are 
essentially the same function written different ways.

In python those two lines represent two different functions, because 
x and y might not be (bound to) sane numbers.  The variables could
be bound to objects that redefine the addition, multiplication, and 
exponentiation operators.  So y*y might not be the same as y**2, 
and x+y might not be the same as y+x.  

-jJ
More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4