why cannot assign to function call
Erik Max Francis
max at alcyone.com
Fri Jan 2 23:53:46 CET 2009
Derek Martin wrote:
> On Fri, Jan 02, 2009 at 12:50:44PM -0800, Erik Max Francis wrote:
>>>> Identity isn't defined on math objects, only on Python objects; there
>>>> is no notion of 'is' in math.
>>> This is also false, it even has its own operator (which requires
>>> Unicode to display): ≡
>> That can mean a number of things, one of which means "is identically
>> equal to,"
>
> Quite so.
>
>> but identity means something different in mathematics than it means
>> here.
>
> But for non-mutable objects, aren't they essentially the same?
> Mathematics has no concept of "objects" in the sense that computer
> science does, so of course the best you can really do is draw
> parallels.
That's exactly the point. There is no concept of object identity in
mathematics, so the above statement that you called false is, in fact,
true. The concept does not translate.
>> In computer science, identity means that two expressions are
>> represented by the same object, something which not only has no
>> meaning in mathematics,
>
> We're getting way off track here, but I would argue this is also
> false. Take sets, for example:
>
> A = { 1, 2, 3 }
> B = { 1, 2, 3 }
>
> Is it not true that A ≡ B and in fact these two sets are the same,
> i.e. they are not actually two different sets at all; the have the
> same identity, even considering a definition of "identity" which
> reflects that in Python?
Only if you try to make up a concept of identity that mathematics
doesn't already have. The existing concept, which you invoked, has
nothing to do with _object_ identity, it just has to do with a broader
equality.
> I don't imagine I would agree, based on what I just said. To elaborate,
> each side of the expression contain symbols which always evaluate to
> the same constant. The identity of a constant is constant. :)
Except identities don't have to contain constants at all. They can
contain arbitrary expressions on either side of the "is identically
equal to" symbol. Which clearly indicates that the symbol can't mean
the same thing as the identity operator in computer science, as you were
claiming it did.
--
Erik Max Francis && max at alcyone.com && http://www.alcyone.com/max/
San Jose, CA, USA && 37 18 N 121 57 W && AIM, Y!M erikmaxfrancis
There's something immoral about abandoning your own judgement.
-- John F. Kennedy
More information about the Python-list
mailing list