How to Teach Python "Variables"

Chris Mellon arkanes at gmail.com
Wed Nov 28 11:12:47 EST 2007


On Nov 28, 2007 9:51 AM, hdante <hdante at gmail.com> wrote:
> On Nov 28, 1:42 pm, Neil Cerutti <horp... at yahoo.com> wrote:
> > On 2007-11-28, hdante <hda... at gmail.com> wrote:
> >
> >
> >
> > > On Nov 28, 1:09 am, Steven D'Aprano
> > ><ste... at REMOVE.THIS.cybersource.com.au> 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 languages?
> >
> > >> --
> > >> Steven.
> >
> > >  You can't. Python variables still are pointers. Hint:
> >
> > >  int * const x = &y;
> >
> > >  How do I increment x ?
> >
> > Not only that, you can't point x at any other object at all.
> > That's not a Python variable either.
> >
> > --
> > Neil Cerutti
>
>  That's right. Languages may have arbitrary sets of operations defined
> for their variables. There's nothing wrong with that.
>

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.



More information about the Python-list mailing list