On 18 Dec 2013 08:22:58 GMT, Steven D'Aprano <st...@pearwood.info> wrote:
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
context
> when both are valid, save in C++ where you can create a
"pointer-like
> 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.

--
DaveA

--
https://mail.python.org/mailman/listinfo/python-list

Reply via email to