Too many 'self' in python.That's a big flaw in this language.

John Nagle nagle at animats.com
Thu Jun 28 16:12:03 EDT 2007


Alex Martelli wrote:
> Bjoern Schliessmann <usenet-mail-0306.20.chr0n0ss at spamgourmet.com>
> wrote:
>    ...
> 
>>Mh, strange, I personally like to use "this.a" in C++, to make clear
>>I use an instance variable.
> 
> 
> That would be nice, unfortunately your C++ compiler will refuse that,
> and force you to use this->a instead;-).

    Yes, as Strostrup admits, "this" should have been a reference.
Early versions of C++ didn't have references.

    One side effect of that mistake was the "delete(this)" idiom,
which does not play well with inheritance.  But that's a digression here.

				John Nagle



More information about the Python-list mailing list