No 1.6! (was Re: A REALLY COOL PYTHON FEATURE:)

Glyph Lefkowitz glyph at twistedmatrix.com
Fri May 19 02:46:06 CEST 2000


m.faassen at vet.uu.nl (Martijn Faassen) writes:

>   I sit on the chair
        .
>   chair.sit() 

Hmm.  This is not the way I think of it.  I would never say
chair.sit() ... more like, 

"Bob, sit on the chair."

bob.sit(chair)

After all, who's doing the work here; bob, or the chair?

> Similarly:
> 
>   I append to the list

I tend not to think of things as so person-focused ;-).  *I* will
append nothing to the list; I am merely telling the list what it shall
do.  I plan to be somewhere else entirely when this program is
running.

>   list.append()

So what "list.append(element)" says to me is, "List, append
element. (to yourself, of course)"

>   I draw on a paper with a blue color
> 
>   paper.draw(color='blue')

This doesn't make sense either.  For me it would be:

pen.paper=paper
pen.draw(color='blue')

"Pen, you're going to be drawing on that piece of paper.  Draw in
blue."

> In the case of 'foo'.join() this stops making sense:
> 
>   I join the list of strings with spaces.
> 
>   ' '.join(list)

> In this case, it feels obvious to us that the *list* is the big target,
> and the space is what we're joining with. We don't think:
[snip]

Finally, this makes sense to me, becuase what I'm saying is;

"' ' (which we all know to be a string), join list together".  Being a
programming language, "tell me what the result is" is implicit =).

> lots-of-instinctive-language-analysis-ly yours,

my-intuition-is-nonintuitive-ly y'rs,

-- 
                  __________________________________________
                 |    ______      __   __  _____  _     _   |
                 |   |  ____ |      \_/   |_____] |_____|   |
                 |   |_____| |_____  |    |       |     |   |
                 |   @ t w i s t e d m a t r i x  . c o m   |
                 |   http://www.twistedmatrix.com/~glyph/   |
                 `__________________________________________'




More information about the Python-list mailing list