Re: Experiences/guidance on teaching Python as a first programming language

Dave Angel davea at
Wed Dec 18 13:53:23 CET 2013

On 18 Dec 2013 08:22:58 GMT, Steven D'Aprano <steve at> 
> On Wed, 18 Dec 2013 13:11:58 +1100, Chris Angelico wrote:
> > The one differentiation that I don't like is between the . and ->
> > operators. The distinction feels like syntactic salt. There's no 
> > when both are valid, save in C++ where you can create a 
> > object" that implements the -> operator (and has the . operator 
for its
> > own members).

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.


More information about the Python-list mailing list