Re: Finding the instance reference of an object [long and probably boring]

2008-11-11 Thread Steve Holden
greg wrote: > Arnaud Delobelle wrote: >> But in the course of conversation I might refer to >> Napoleon, meaning Napoleon Bonaparte (1769 - 1821) or Napoleon III (1808 >> - 1873). > > That's more like referring to the name 'Napoleon' in > two different namespaces. The original binding still > exis

Re: Finding the instance reference of an object [long and probably boring]

2008-11-10 Thread greg
Aaron Brady wrote: I thought of another way Python's passing method could be implemented. Parameters are passed as namespace-name pairs, and every time a variable occurs, it's looked up in the namespace it's in. If it's changed (concurrently) in the outer scope, a copy is made into the inner s

Re: Finding the instance reference of an object [long and probably boring]

2008-11-10 Thread greg
Arnaud Delobelle wrote: But in the course of conversation I might refer to Napoleon, meaning Napoleon Bonaparte (1769 - 1821) or Napoleon III (1808 - 1873). That's more like referring to the name 'Napoleon' in two different namespaces. The original binding still exists, you're just switching co

Re: Finding the instance reference of an object [long and probably boring]

2008-11-10 Thread Joe Strout
On Nov 10, 2008, at 2:30 PM, Aaron Brady wrote: I agree with Terry that all calling is call-by-value, and Steven that all calling is call-by-bit-flipping. I agree with Joe that call-by- object is a special case of call-by-value. Woo! Almost sounds like approaching consensus. :) However, I'

Re: Finding the instance reference of an object [long and probably boring]

2008-11-10 Thread Aaron Brady
On Nov 10, 2:45 pm, Arnaud Delobelle <[EMAIL PROTECTED]> wrote: > Aaron Brady <[EMAIL PROTECTED]> writes: > > Do you ever say to someone, "'Napoleon' will no longer refer to > > Nelson.  It is this lobster now instead", while you are holding a > > lobster? > > Not explicitly.  But in the course of

Re: Finding the instance reference of an object [long and probably boring]

2008-11-10 Thread Arnaud Delobelle
Aaron Brady <[EMAIL PROTECTED]> writes: > Do you ever say to someone, "'Napoleon' will no longer refer to > Nelson. It is this lobster now instead", while you are holding a > lobster? Not explicitly. But in the course of conversation I might refer to Napoleon, meaning Napoleon Bonaparte (1769 -

Re: Finding the instance reference of an object [long and probably boring]

2008-11-10 Thread Aaron Brady
On Nov 7, 3:03 pm, Arnaud Delobelle <[EMAIL PROTECTED]> wrote: > 1. Is Napoleon a copy of Dobby or are they the same cat? > > 2. Is Polion a copy of Napoleon or are they the same cat? > > 3. When we got rid of Napoleon's fleas, was Nelson deflea-ed as well? > > 4. When Napoleon died, did Nelson die

Re: Finding the instance reference of an object [long and probably boring]

2008-11-08 Thread Grant Edwards
On 2008-11-08, Terry Reedy <[EMAIL PROTECTED]> wrote: > Steven D'Aprano wrote: >> In an attempt to keep this post from hitting the ridiculous length of one > >> (Aside: I've learned one thing in this discussion. Despite the number of >> sources I've read that claim that if you pass an array to a

Re: Finding the instance reference of an object [long and probably boring]

2008-11-08 Thread Terry Reedy
Steven D'Aprano wrote: In an attempt to keep this post from hitting the ridiculous length of one (Aside: I've learned one thing in this discussion. Despite the number of sources I've read that claim that if you pass an array to a C function the entire array will be copied, this does not appea

Re: Finding the instance reference of an object [long and probably boring]

2008-11-08 Thread Aaron Brady
On Nov 8, 8:42 am, Joe Strout <[EMAIL PROTECTED]> wrote: > On Nov 7, 2008, at 6:21 PM, Aaron Brady wrote: > > > Therefore objects don't need names to exist.  Having a name is > > sufficient but not necessary to exist.  Being in a container is > > neither necessary -nor- sufficient. > > What do you

Re: Finding the instance reference of an object [long and probably boring]

2008-11-08 Thread Joe Strout
On Nov 7, 2008, at 6:21 PM, Aaron Brady wrote: Therefore objects don't need names to exist. Having a name is sufficient but not necessary to exist. Being in a container is neither necessary -nor- sufficient. What do you mean? Being in a container isn't necessary, but it certainly is suffi

Re: Finding the instance reference of an object [long and probably boring]

2008-11-07 Thread Steven D'Aprano
On Fri, 07 Nov 2008 13:05:16 -0700, Joe Strout wrote: > In Python, AFAICT, there is only one type, the object reference. So, > the type of every variable is 'reference', and each one contains a > reference. This is wrong. If we take "variable" to mean "name", then Python names do not have types

Re: Finding the instance reference of an object [long and probably boring]

2008-11-07 Thread Steven D'Aprano
In an attempt to keep this post from hitting the ridiculous length of one of my posts last night, I'm going to skip over a lot of things Joe writes that aren't critical. Just because I've skipped over a comment doesn't mean I agree with it, merely that I don't think it gains much to argue the p

Re: Finding the instance reference of an object [long and probably boring]

2008-11-07 Thread Aaron Brady
On Nov 7, 3:39 pm, Arnaud Delobelle <[EMAIL PROTECTED]> wrote: > Aaron Brady <[EMAIL PROTECTED]> writes: > >  Furthermore, some class models variables like this: > > > a.b= 'abc' > > a.c= 'def' > > a.d= 'ghi' > > > It also allows index access: a[0], a[1], a[2], respectively.  'abc' > > has two name

Re: Finding the instance reference of an object [long and probably boring]

2008-11-07 Thread Arnaud Delobelle
Aaron Brady <[EMAIL PROTECTED]> writes: > Furthermore, some class models variables like this: > > a.b= 'abc' > a.c= 'def' > a.d= 'ghi' > > It also allows index access: a[0], a[1], a[2], respectively. 'abc' > has two names: 'a.b', and 'a[0]'. Correct? You know very well that a.b and a[0] aren't

Re: Finding the instance reference of an object [long and probably boring]

2008-11-07 Thread Aaron Brady
On Nov 7, 3:03 pm, Arnaud Delobelle <[EMAIL PROTECTED]> wrote: > Joe Strout <[EMAIL PROTECTED]> writes: > > So.  How about this for a summary? > > > "Python uses call-by-sharing.  That's a special case of call-by-value > > where the variables are references to objects; it is these references > > th

Re: Finding the instance reference of an object [long and probably boring]

2008-11-07 Thread Steve Holden
Joe Strout wrote: > On Nov 7, 2008, at 12:13 PM, Terry Reedy wrote: [...] >>> I wonder if that could be tested systematically. Perhaps we could >>> round up 20 newbies, divide them into two groups of 10, give each one >>> a 1-page explanation either based on passing object references >>> by-value,

Re: Finding the instance reference of an object [long and probably boring]

2008-11-07 Thread Arnaud Delobelle
Joe Strout <[EMAIL PROTECTED]> writes: > So. How about this for a summary? > > "Python uses call-by-sharing. That's a special case of call-by-value > where the variables are references to objects; it is these references > that are copied to the parameters, not the objects themselves. For > user

Re: Finding the instance reference of an object [long and probably boring]

2008-11-07 Thread Joe Strout
On Nov 7, 2008, at 12:35 PM, Terry Reedy wrote: http://en.wikipedia.org/wiki/Call_by_something#Call_by_sharing Call by sharing Also known as "call by object" or "call by object-sharing" is an evaluation strategy first named by Barbara Liskov et al for the language CLU in 1974[1]. It is use

Re: Finding the instance reference of an object [long and probably boring]

2008-11-07 Thread Joe Strout
On Nov 7, 2008, at 12:13 PM, Terry Reedy wrote: Python has two types of names. Some complex objects -- modules, classes, and functions, and wrappers and subclasses thereof, have 'definition names' that are used instead of a 'value' to print a representation. Otherwise, names are identifie

Re: Finding the instance reference of an object [long and probably boring]

2008-11-07 Thread Terry Reedy
Steven D'Aprano wrote: On Fri, 07 Nov 2008 08:48:19 -0700, Joe Strout wrote: Unfortunately, the term "name" is *slightly* ambiguous in Python. There are names, and then there are objects which have a name attribute, which holds a string. This attribute is usually called __name__ but sometimes

Re: Finding the instance reference of an object [long and probably boring]

2008-11-07 Thread Terry Reedy
Joe Strout wrote: On Nov 6, 2008, at 10:35 PM, Steve Holden wrote: Note: I tried to say "name" above instead of "variable" but I couldn't bring myself to do it -- "name" seems to generic to do that job. Python has two types of names. Some complex objects -- modules, classes, and functions,

Re: Finding the instance reference of an object [long and probably boring]

2008-11-07 Thread Joe Strout
On Nov 7, 2008, at 10:29 AM, Steven D'Aprano wrote: Note: I tried to say "name" above instead of "variable" but I couldn't bring myself to do it -- "name" seems to generic to do that job. Lots of things have names that are not variables: modules have names, classes have names, methods hav

Re: Finding the instance reference of an object [long and probably boring]

2008-11-07 Thread Steven D'Aprano
On Fri, 07 Nov 2008 08:48:19 -0700, Joe Strout wrote: > I think of it this way: every variable is an object reference; no > special syntax needed for it because that's the only type of variable > there is. (Just as with Java or .NET, when dealing with any class type; > Python is just a little mor

Re: Finding the instance reference of an object [long and probably boring]

2008-11-07 Thread Joe Strout
On Nov 6, 2008, at 10:35 PM, Steve Holden wrote: That's good to hear. Your arguments are sometimes pretty good, and usually well made, but there's been far too much insistence on all sides about being right and not enough on reaching agreement about how Python's well-defined semantics for ass

Re: Finding the instance reference of an object [long and probably boring]

2008-11-06 Thread Ben Finney
Steve Holden <[EMAIL PROTECTED]> writes: > One of the reasons for Python's continue march towards world > domination (allow me my fantasies) is its consistent simplicity. > Those last two words would be my candidate for the definition of > "Pythonicity". +1 QOTW -- \ Eccles: “I'll get

Re: Finding the instance reference of an object [long and probably boring]

2008-11-06 Thread Steve Holden
Joe Strout wrote: > On Nov 6, 2008, at 12:44 PM, Arnaud Delobelle wrote: > >> I know this thread has grown quite personal for some of its >> participants. I am posting in a spirit of peace and understanding :) > > Thanks, I'll do the same. > That's good to hear. Your arguments are sometimes pre