Python as first language (Re: static variables?)

John Roth johnroth at ameritech.net
Wed Nov 20 15:38:50 EST 2002


"Brian Quinlan" <brian at sweetapp.com> wrote in message
news:mailman.1037821774.32088.python-list at python.org...
> Hung Jung Lu wrote:
> > Sorry for digressing, but this reminds me of an old debate on
whether
> > Python is suitable as the first language to teach.
> >
> > Well, the thing is that Python works with "name binding". And the
> > concepts of name spaces, name binding, objects, mutability, etc. are
> > just a bit non-obvious. Once a person understands these things, or
if
> > a person knows about pointers, hashmaps and memory structure,
> > everything becomes clear. But for someone not familiar with either
of
> > these sets of concepts, Python can be hard to explain.
>
> I think that the conceptual problem that people have with assignment
> being a binding operation is that they are used to names labeling some
> sort of memory mailbox.

If you take the word "memory" out of there, that does describe Python.
I think this is a false distinction. I can find only two issues with
names:

One is languages where the name itself has properties (static typed
languages are a great example of this, although Python is moving
toward this with the notion of properties in 2.2)

The other is where there are separate name spaces for certain things.
For example, methods in Java aren't first class objects, so Java can
have multiple methods with the same name, and keep them separate.
Python's name model can't - there can only be one object bound to
a name at a time (although again, properties seem to violate that rule).
>
> If you had not preconceived notion of what "names" mean then you might
> have fewer problems.
>
> Cheers,
> Brian
>
>





More information about the Python-list mailing list