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

Aaron Brady castironpi at gmail.com
Mon Nov 10 14:08:34 EST 2008


On Nov 7, 3:03 pm, Arnaud Delobelle <arno... at googlemail.com> 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 as well?
>
> 5. When we got a new Napoleon, does this mean that our neighbours got a
>    new Nelson?
>
> Now a question about the questions about the story:
>
>    To be able to understand the story and answer questions 1-5, do we
>    need to think of Napoleon, Nelson and Polion as variables containing
>    references to cat objects, or is it enough to think of them as three
>    names for cats?

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?

My point is that the assignment operation is rare in natural language.

Some examples:

unitedstates.president= people['Barack Obama']
catholicchurch.pope= people['Joseph Ratzinger']
chicagocubs.manager= people['Lou Pienella']

That is, in January, 'The President' will start to refer to a
different person.  But you don't see:

popstars['Britney Spears']= people['Ricky Martin']
people['Richard Nixon']= people['Ronald Reagan']

You also have expressions, such as 'the man in the corner drinking
Coke' and 'the first street on the right', which would not be likely
to be modeled as attributes, per se, such as:

corner.men.drinking['Coke']
street.ontheright[0]

You'd more likely use:

"select id from people where standingin = 'corner' and drinking =
'coke'"
"select id from streets where distanceonright =
min( distanceonright )"

Maybe in the future we'll see relational code, rather than
hierarchical subclasses:

>>> "select fly from birds where name = 'bluejay'"
'flap_wings()'
>>> "select fly from birds where name = 'ostrich'"
'raise CannotFlyException'



More information about the Python-list mailing list