Experiences/guidance on teaching Python as a first programming language

Chris Angelico rosuav at gmail.com
Wed Dec 18 15:55:10 CET 2013


On Wed, Dec 18, 2013 at 11:53 PM, Dave Angel <davea at davea.name> wrote:
> Funny you should say that in the middle of a discussion about lifetime.  In
> C, when you do the -> thing, you're now in a different struct with a
> potentially different lifetime.  If p is a local,  with auto lifetime,  then
> so is p.x
>
> So, although the two are mutually exclusive,  there's valuable information
> hidden in the required choice.

Sure, but you can figure out whether p is a local struct or a local
pointer to some other struct by looking at its declaration. Do you
also need to look at every usage of it? We don't adorn every / with a
marker saying whether we're dividing ints or floats, and that's
something that could be potentially useful (float division of two ints
being what Py3 does). Why adorn pointer usage?

ChrisA



More information about the Python-list mailing list