Re: How to Teach Python "Variables"

2007-11-29 Thread Hendrik van Rooyen
"J. Clifford Dyer" wrote: > This thread is bleedin' demised. No, you have stunned it. Delicate threads stun easily. To get back to the original question, namely how to teach the concept of a python variable, I would probably take a harder look at the "wandering names" analogy. I think it wa

Re: How to Teach Python "Variables"

2007-11-28 Thread MonkeeSage
On Nov 28, 8:35 am, Aaron Watters <[EMAIL PROTECTED]> wrote: > On Nov 27, 5:31 pm, MonkeeSage <[EMAIL PROTECTED]> wrote: > > > Of course. But then it really depends on the teaching methodology, > > doesn't it? There is no reason (well, barring the restraints of the > > curriculum vitea), that one s

Re: How to Teach Python "Variables"

2007-11-28 Thread Ben Finney
"Chris Mellon" <[EMAIL PROTECTED]> writes: > Whether you like it or not, the term "pointer" has a specific common > meanings. They do not mean "any means by which you may reference a > value". "variable" is certainly less clear and is used much more > loosely, but in the specific context of compa

Re: How to Teach Python "Variables"

2007-11-28 Thread J. Clifford Dyer
On Wed, Nov 28, 2007 at 11:23:42AM -0600, Chris Mellon wrote regarding Re: How to Teach Python "Variables": > > On Nov 28, 2007 10:57 AM, hdante <[EMAIL PROTECTED]> wrote: > > On Nov 28, 2:12 pm, "Chris Mellon" <[EMAIL PROTECTED]> wrote: > > &g

Re: How to Teach Python "Variables"

2007-11-28 Thread Chris Mellon
On Nov 28, 2007 10:57 AM, hdante <[EMAIL PROTECTED]> wrote: > On Nov 28, 2:12 pm, "Chris Mellon" <[EMAIL PROTECTED]> wrote: > > > > Right. Python variables are pointers, except for all the ways that > > they are different. By the same criteria, they are also puppies. Give > > it a rest. > > I'm so

Re: How to Teach Python "Variables"

2007-11-28 Thread hdante
On Nov 28, 2:12 pm, "Chris Mellon" <[EMAIL PROTECTED]> wrote: > > Right. Python variables are pointers, except for all the ways that > they are different. By the same criteria, they are also puppies. Give > it a rest. I'm sorry if your notion of pointer is incorrect. A pointer (or, more formally,

Re: How to Teach Python "Variables"

2007-11-28 Thread hdante
On Nov 28, 2:06 pm, Neil Cerutti <[EMAIL PROTECTED]> wrote: > > > That's right. Languages may have arbitrary sets of operations > > defined for their variables. There's nothing wrong with that. > > No, arbitrary operations would be useless. > 1) You may convince a big company to add you newly dev

Re: How to Teach Python "Variables"

2007-11-28 Thread Chris Mellon
On Nov 28, 2007 9:51 AM, hdante <[EMAIL PROTECTED]> wrote: > On Nov 28, 1:42 pm, Neil Cerutti <[EMAIL PROTECTED]> wrote: > > On 2007-11-28, hdante <[EMAIL PROTECTED]> wrote: > > > > > > > > > On Nov 28, 1:09 am, Steven D'Aprano > > ><[EMAIL PROTECTED]> wrote: > > >> On Tue, 27 Nov 2007 10:21:36 -08

Re: How to Teach Python "Variables"

2007-11-28 Thread Neil Cerutti
On 2007-11-28, hdante <[EMAIL PROTECTED]> wrote: > On Nov 28, 1:42 pm, Neil Cerutti <[EMAIL PROTECTED]> wrote: >> On 2007-11-28, hdante <[EMAIL PROTECTED]> wrote: >> >> >> >> > On Nov 28, 1:09 am, Steven D'Aprano >> ><[EMAIL PROTECTED]> wrote: >> >> On Tue, 27 Nov 2007 10:21:36 -0800, hdante wrote:

Re: How to Teach Python "Variables"

2007-11-28 Thread hdante
On Nov 28, 1:42 pm, Neil Cerutti <[EMAIL PROTECTED]> wrote: > On 2007-11-28, hdante <[EMAIL PROTECTED]> wrote: > > > > > On Nov 28, 1:09 am, Steven D'Aprano > ><[EMAIL PROTECTED]> wrote: > >> On Tue, 27 Nov 2007 10:21:36 -0800, hdante wrote: > >> > Python variables are pointers and that's it. > > >

Re: How to Teach Python "Variables"

2007-11-28 Thread Neil Cerutti
On 2007-11-28, hdante <[EMAIL PROTECTED]> wrote: > On Nov 28, 1:09 am, Steven D'Aprano ><[EMAIL PROTECTED]> wrote: >> On Tue, 27 Nov 2007 10:21:36 -0800, hdante wrote: >> > Python variables are pointers and that's it. >> >> How do I increment a Python variable so that it points to the >> next addre

Re: How to Teach Python "Variables"

2007-11-28 Thread hdante
On Nov 28, 1:09 am, Steven D'Aprano <[EMAIL PROTECTED]> wrote: > On Tue, 27 Nov 2007 10:21:36 -0800, hdante wrote: > > Python variables are pointers and that's it. > > How do I increment a Python variable so that it points to the next > address, like I can do with pointers in C, Pascal, and other l

Re: How to Teach Python "Variables"

2007-11-28 Thread Aaron Watters
On Nov 27, 5:31 pm, MonkeeSage <[EMAIL PROTECTED]> wrote: > Of course. But then it really depends on the teaching methodology, > doesn't it? There is no reason (well, barring the restraints of the > curriculum vitea), that one should learn topics so complex as to > require "off-putting" the *real*

Re: How to Teach Python "Variables"

2007-11-28 Thread Paul Rudin
none <""atavory\"@(none)"> writes: > IIRC, I once saw an explanation how Python doesn't have > "variables" in the sense that, say, C does, and instead has bindings > from names to objects. Does anyone have a link? "Variable" is an abstract concept, and it's a slightly different concept for

Re: How to Teach Python "Variables"

2007-11-27 Thread Steven D'Aprano
On Tue, 27 Nov 2007 10:21:36 -0800, hdante wrote: > Python variables are pointers and that's it. How do I increment a Python variable so that it points to the next address, like I can do with pointers in C, Pascal, and other languages? -- Steven. -- http://mail.python.org/mailman/listinfo/

Re: How to Teach Python "Variables"

2007-11-27 Thread MonkeeSage
On Nov 27, 2:49 pm, Aaron Watters <[EMAIL PROTECTED]> wrote: > In practice there is too much to understand all at > once and in the beginning you have to say "don't worry about that > right now, consider it magic..." Of course they should > eventually understand it. Of course. But then it really

Re: How to Teach Python "Variables"

2007-11-27 Thread Aaron Watters
On Nov 27, 2:20 pm, MonkeeSage <[EMAIL PROTECTED]> wrote: > On Nov 27, 11:50 am, Donn Cave <[EMAIL PROTECTED]> wrote: > I agree with your point, but I think the distinction is this: > pedagogical analogies should be truly *analogous* -- they should not > be "analogies" that are only vaguely si

Re: How to Teach Python "Variables"

2007-11-27 Thread MonkeeSage
On Nov 27, 11:50 am, Donn Cave <[EMAIL PROTECTED]> wrote: > In contrast, I suspect that someone who learns Python concepts > in terms of explanations like `boxes' or `pointers' or whatnot > is at some disadvantage while that lasts, like translating a > foreign language to your own instead of attac

Re: How to Teach Python "Variables"

2007-11-27 Thread hdante
On Nov 27, 2:25 pm, Aaron Watters <[EMAIL PROTECTED]> wrote: > > I hope the participants in this thread realize > that this sort of discussion will cause > any programming newbie to immediately melt into the > floor. All right, answering the original question is good. :-P 1) If the students can

Re: How to Teach Python "Variables"

2007-11-27 Thread Robin Kåveland Hansen
Aurélien Campéas <[EMAIL PROTECTED]> wrote (Sun, 25 Nov 2007 20:09:59 +0100): > none a écrit : > > That's something I've often heard and I don't get it. Somehow I don't > understand how C variables are not like python bindings (the differences > being that C variables are statically typed and c

Re: How to Teach Python "Variables"

2007-11-27 Thread Brian Blais
On Nov 27, 2007, at Nov 27:1:21 PM, hdante wrote: This shouldn't confuse a C programmer if he understands that assignment changes the pointer address, instead of copying the value: Coming from C, I found the pointer analogy to work pretty well, but in my head I always felt that integers (o

Re: How to Teach Python "Variables"

2007-11-27 Thread Aaron Watters
On Nov 27, 11:52 am, "Chris Mellon" <[EMAIL PROTECTED]> wrote: > > I would try to avoid talking > > in generalities about python variables versus C or > > lisp or whatever, unless I was teaching an upper division > > college programming languages survey class. > > I disagree, although it's not real

Re: How to Teach Python "Variables"

2007-11-27 Thread hdante
On Nov 26, 7:49 am, Hrvoje Niksic <[EMAIL PROTECTED]> wrote: > greg <[EMAIL PROTECTED]> writes: > > none wrote: > >> IIRC, I once saw an explanation how Python doesn't have > >> "variables" in the sense that, say, C does, and instead has bindings > >> from names to objects. > > > If you're talk

Re: How to Teach Python "Variables"

2007-11-27 Thread Donn Cave
In article <[EMAIL PROTECTED]>, Aaron Watters <[EMAIL PROTECTED]> wrote: > I would try to avoid talking > in generalities about python variables versus C or > lisp or whatever, unless I was teaching an upper division > college programming languages survey class. > > Instead, I'd fire up the in

Re: How to Teach Python "Variables"

2007-11-27 Thread Chris Mellon
On Nov 27, 2007 10:25 AM, Aaron Watters <[EMAIL PROTECTED]> wrote: > On Nov 27, 10:06 am, hdante <[EMAIL PROTECTED]> wrote: > > On Nov 25, 5:31 pm, none <""atavory\"@(none)"> wrote: > > > And that's it. I think that there is confusion because everything we > > do with python variables are poi

Re: How to Teach Python "Variables"

2007-11-27 Thread Aaron Watters
On Nov 27, 10:06 am, hdante <[EMAIL PROTECTED]> wrote: > On Nov 25, 5:31 pm, none <""atavory\"@(none)"> wrote: > And that's it. I think that there is confusion because everything we > do with python variables are pointer dereferences, except for the > attribution, that instead of dereferencin

Re: How to Teach Python "Variables"

2007-11-27 Thread hdante
On Nov 25, 5:31 pm, none <""atavory\"@(none)"> wrote: > Aurélien Campéas wrote: > > none a écrit : > >> Hello, > > >> IIRC, I once saw an explanation how Python doesn't have > >> "variables" in the sense that, say, C does, and instead has bindings > >> from names to objects. Does anyone hav

Re: How to Teach Python "Variables"

2007-11-27 Thread Neil Cerutti
On 2007-11-26, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > Hrvoje Niksic wrote: >> greg <[EMAIL PROTECTED]> writes: >> >> > none wrote: >> >> IIRC, I once saw an explanation how Python doesn't have >> >> "variables" in the sense that, say, C does, and instead has >> >> bindings from names to obj

Re: How to Teach Python "Variables"

2007-11-26 Thread greg
Hrvoje Niksic wrote: > A C programmer > told that Python variables internally hold pointers expects this code: > > def func(a): > a = 10 > ... > func(x) > > to change the value of x. He shouldn't expect that, because that's not what the equivalent code would do in C. To get that effect in C, y

Re: How to Teach Python "Variables"

2007-11-26 Thread [EMAIL PROTECTED]
Chris Mellon wrote: > On Nov 26, 2007 1:21 PM, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > Hrvoje Niksic wrote: > > > greg <[EMAIL PROTECTED]> writes: > > > > > > > none wrote: > > > >> IIRC, I once saw an explanation how Python doesn't have > > > >> "variables" in the sense that, say, C d

Re: How to Teach Python "Variables"

2007-11-26 Thread Steven D'Aprano
On Mon, 26 Nov 2007 21:37:19 +1300, greg wrote: > none wrote: >> IIRC, I once saw an explanation how Python doesn't have "variables" >> in the sense that, say, C does, and instead has bindings from names to >> objects. > > If you're talking to C programmers, just tell them that Python variabl

Re: How to Teach Python "Variables"

2007-11-26 Thread jkn
On Nov 25, 10:36 pm, Ben Finney <[EMAIL PROTECTED]> wrote: > > In addition to the good answers you've had already, I highly recommend > David Goodger's "Code like a Pythonista" page > http://python.net/~goodger/projects/pycon/2007/idiomatic/handout.html>, > which contains a very good "cardboard box

Re: How to Teach Python "Variables"

2007-11-26 Thread Chris Mellon
On Nov 26, 2007 1:21 PM, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > Hrvoje Niksic wrote: > > greg <[EMAIL PROTECTED]> writes: > > > > > none wrote: > > >> IIRC, I once saw an explanation how Python doesn't have > > >> "variables" in the sense that, say, C does, and instead has bindings > >

Re: How to Teach Python "Variables"

2007-11-26 Thread [EMAIL PROTECTED]
Hrvoje Niksic wrote: > greg <[EMAIL PROTECTED]> writes: > > > none wrote: > >> IIRC, I once saw an explanation how Python doesn't have > >> "variables" in the sense that, say, C does, and instead has bindings > >> from names to objects. > > IMHO, this is nonsense. All that variables are (in a

Re: How to Teach Python "Variables"

2007-11-26 Thread Hrvoje Niksic
greg <[EMAIL PROTECTED]> writes: > none wrote: >> IIRC, I once saw an explanation how Python doesn't have >> "variables" in the sense that, say, C does, and instead has bindings >> from names to objects. > > If you're talking to C programmers, just tell them that Python > variables always cont

Re: How to Teach Python "Variables"

2007-11-26 Thread Simon Brunning
On Nov 25, 2007 6:19 PM, <"@bag.python.org <"none> wrote: > IIRC, I once saw an explanation how Python doesn't have "variables" in > the sense that, say, C does, and instead has bindings from names to > objects. Does anyone have a link? Perhaps you mean: http://effbot.org/zone/python-obje

Re: How to Teach Python "Variables"

2007-11-26 Thread greg
none wrote: > IIRC, I once saw an explanation how Python doesn't have "variables" > in the sense that, say, C does, and instead has bindings from names to > objects. If you're talking to C programmers, just tell them that Python variables always contain pointers. That should give them the ri

Re: How to Teach Python "Variables"

2007-11-25 Thread none
Ben Finney wrote: > none <""atavory\"@(none)"> writes: > >> IIRC, I once saw an explanation how Python doesn't have "variables" >> in the sense that, say, C does, and instead has bindings from names >> to objects. Does anyone have a link? > > In addition to the good answers you've had already, I

Re: How to Teach Python "Variables"

2007-11-25 Thread Ben Finney
none <""atavory\"@(none)"> writes: > IIRC, I once saw an explanation how Python doesn't have "variables" > in the sense that, say, C does, and instead has bindings from names > to objects. Does anyone have a link? In addition to the good answers you've had already, I highly recommend David Goodge

Re: How to Teach Python "Variables"

2007-11-25 Thread Bjoern Schliessmann
Aurélien Campéas wrote: > I mean : aren't C variables also bindings from names to objects ? No, C variables are aliases for memory addresses. Regards, Björn -- BOFH excuse #390: Increased sunspot activity. -- http://mail.python.org/mailman/listinfo/python-list

Re: How to Teach Python "Variables"

2007-11-25 Thread none
Aahz wrote: > In article <[EMAIL PROTECTED]>, none <""atavory\"@(none)"> wrote: >> IIRC, I once saw an explanation how Python doesn't have "variables" in >> the sense that, say, C does, and instead has bindings from names to >> objects. Does anyone have a link? > > http://starship.python.n

Re: How to Teach Python "Variables"

2007-11-25 Thread Andrew Koenig
"Aurélien Campéas" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > I mean : aren't C variables also bindings from names to objects ? Or what > ? No, they're not. In C, when you execute x = y; you cause x to become a copy of y. In Python, when you execute x = y you ca

Re: How to Teach Python "Variables"

2007-11-25 Thread Aahz
In article <[EMAIL PROTECTED]>, none <""atavory\"@(none)"> wrote: > > IIRC, I once saw an explanation how Python doesn't have "variables" in >the sense that, say, C does, and instead has bindings from names to >objects. Does anyone have a link? http://starship.python.net/crew/mwh/hacks/ob

Re: How to Teach Python "Variables"

2007-11-25 Thread none
Aurélien Campéas wrote: > none a écrit : >> Hello, >> >> IIRC, I once saw an explanation how Python doesn't have >> "variables" in the sense that, say, C does, and instead has bindings >> from names to objects. Does anyone have a link? >> >> Thanks, >> >> Ami > > That's something

Re: How to Teach Python "Variables"

2007-11-25 Thread Diez B. Roggisch
Aurélien Campéas schrieb: > none a écrit : >> Hello, >> >> IIRC, I once saw an explanation how Python doesn't have >> "variables" in the sense that, say, C does, and instead has bindings >> from names to objects. Does anyone have a link? >> >> Thanks, >> >> Ami > > That's somethi

Re: How to Teach Python "Variables"

2007-11-25 Thread Aurélien Campéas
none a écrit : > Hello, > > IIRC, I once saw an explanation how Python doesn't have "variables" > in the sense that, say, C does, and instead has bindings from names to > objects. Does anyone have a link? > > Thanks, > > Ami That's something I've often heard and I don't get it

How to Teach Python "Variables"

2007-11-25 Thread none
Hello, IIRC, I once saw an explanation how Python doesn't have "variables" in the sense that, say, C does, and instead has bindings from names to objects. Does anyone have a link? Thanks, Ami -- http://mail.python.org/mailman/listinfo/python-list