strange behavor....

Emile van Sebille emile at fenx.com
Sun Nov 14 16:18:53 EST 2010


On 11/14/2010 12:23 PM Steve Holden said...
> On 11/14/2010 8:29 AM, Emile van Sebille wrote:
> [...]
>> We all know that _everything_ is a disguised method call and we call the
>> disguised method call that resembles a statement where the LHS is
>> separated from the RHS by a single equals sign assignment.
>
> I think your elided attempt to reconcile the opposing viewpoints on this
> thread is creditworthy. We should not allow our wish to resolve
> conflicting viewpoints blind us to reality, however. What method of a
> does the statement
>
>      a = something


Contrivance, but all the same:

 >>> class Test:
...     def __del__(self):
...         global a
...         a = 10
...
 >>> a = Test()
 >>>

... here's your a = something, which also lends credence to Mark's 
argument that you can't easily tell...

 >>> a = 9
 >>>
 >>> print a
10
 >>>

I'd also suggest that long before magic methods like __radd__ and such 
were added, that the expectation that everything _could_ be a magic 
method was there, and that those methods of next best benefit were added 
as time and interest permitted.

That _all_ those possible methods are not yet implemented I leave to the 
developers.  :)

I was mainly trying to point out that until a common vernacular is 
accepted by those engaging in a discussion misconceptions are 
inevitable, and that learning how those terms are applied within a 
context is necessary for advancement.

A numpy matrix is not Neo's Matrix and arguing that it should be or that 
python's use is "wrong" doesn't really get anyone anywhere.

Emile




More information about the Python-list mailing list