"self" in a class is annoying and errorprone

Meinrad Recheis meinrad.recheis at aon.at
Wed Feb 12 08:52:26 EST 2003


^whops that was a bee's nest i went into...

ok, i m going to accept, that python is almost petrified.
anyway ruby is better in several dimensions, and still willing to change 
or improve!

have a nice day, -Meinrad


Meinrad Recheis wrote:
> hello everyone,
> 
> I think it must be possible to change python so that self can be omitted 
> inside a class
>     # except for some reasons like this:
>     __init__(""" i dont like this self """ self, x)
>         self.x = x    # here self is useful
>     
> 
> self is simply annoying.
> (why allways need self as first parameter?? the interpreter could mask 
> that for us)
> self is prone to be forgotten!! leads to potential scope errors
> would make source code shorter, and more beautiful
> 
> shouldn t that be discussed for the sake of PYTHON?
> 
> - Meinrad
> 





More information about the Python-list mailing list