Python 3K or Python 2.9?

George Sakkis george.sakkis at gmail.com
Fri Sep 14 18:51:25 EDT 2007


On Sep 12, 1:35 pm, TheFlyingDutchman <zzbba... at aol.com> wrote:

> On Sep 12, 4:40 am, Bjoern Schliessmann <usenet-mail-0306.20.chr0n... at spamgourmet.com> wrote:
> > Ivan Voras wrote:
> > > What does "self" have to do with an object model? It's an
> > > function/method argument that might as well be hidden in the
> > > compiler without ever touching the role it has (if not, why?). I
> > > agree that it's needless noise in a language.
>
> > If this was needless, why do C++ and Java have the "this" pointer?
>
> "this" in C++ and Java is not shown in the parameter list, which was
> what he was
> complaining about.  He wants
>
> class MyClass:
>         def SomeFunction(someParameter):
>            self.someParameter = someParameter
>
> not
>
> class MyClass:
>         def SomeFunction(self, someParameter):
>            self.someParameter = someParameter

If one *really* wants this, it is doable in python too:
http://www.voidspace.org.uk/python/weblog/arch_d7_2006_12_16.shtml#e583

George




More information about the Python-list mailing list