Pass variable by reference

Mark H Harris harrismh777 at gmail.com
Fri May 9 18:30:10 EDT 2014


On 5/7/14 8:31 PM, Chris Angelico wrote:
> On Thu, May 8, 2014 at 4:11 AM, Mark H Harris <harrismh777 at gmail.com> wrote:
>> And we must never forget that CPython's underpinnings, uhm C, uses
>> variables, C ones...  (never mind)
>
> Be careful of this one. It's utterly irrelevant to your point, and may
> be distracting. I could implement Ook in Python; does that mean that
> Ook has a socket library? Clearly not.

     Probably. Although, its turtles all the way down. C is a better way 
to write asm code (more efficient, less lines of code, better 
abstraction, way more readable). wow, use C to build Python.  Python is 
requires way less lines of code than C, better abstraction, more 
efficient, and way more readable. Now, down under the stack of turtles, 
we are still placing values into memory boxes (variables) although we 
are getting there from a very abstract and indirect way; but its turtles 
all the way down from a certain point of view.

     On the other hand, if we are coming at this from the highest level 
(strictly pure Python coding) all we care about is abstracting the real 
world by constructing objects which interact with the rest of the world 
and with themselves. We are no longer interested in modeling memory 
(although that does happen somewhere) --- what we are interested in is 
modeling life and the objects of life. The mechanism of {name: object} 
is so far above the simple name -- value  pair mechanism we used to call 
'variables' (boxes holding native types) that we really need some new 
name for the concept... is a Python 'name' a variable. No. Then what is 
it?  If we call it a variable (what ever we mean by that) someone is 
going to be confused as they try to write Python code. What should it be 
referred to?

     Someone said it is silly to say that Python has no variables. I 
disagree. We need a way to speak about Python variables that highlights 
the distinctions which create for new coders (and some old ones too) the 
misunderstandings and surprises which spark a debate like this one. As 
someone else pointed out its a both|and.  I suppose I agree. OTOH:

A = 7

Seven is not a C integer native type, and A is not a static int 
variable.  7 is an object, and the name A is bound to it.  What shall we 
call  A  ?

object nomenclature :   A is objname,  objhandle,  OBH. or just handle.

I think we need to stop calling it a variable.


marcus



More information about the Python-list mailing list