Do I always have to write "self." ?

jsolbrig at jsolbrig at
Fri Apr 28 20:58:36 EDT 2000

What I'd like to see would for "self" to an official keyword rather than
simply a convention. The more things that are "conventional" but not
required, the more potential there is for occasional bugs.
And occasional bugs are the WORST.

Of course, a real programmer would never make a mistake like that -
that's why all real programmers are still using assembler. But for the
rest of us small-brained folks, more discipline is good.

jsolbrig at

In article <270420001706386648%pecora at>,
  "Louis M. Pecora" <pecora at> wrote:
> I am two weeks plus into learning Python and have started on a first
> real project.  Amazing language.  BUT, now that I've gotten going with
> classes, I'm finding I hate seeing all those  "self."  prefixes on the
> class variables.  Python is generally very clean, but the classes I
> write use a lot of "per-instance" variables, hence seem to require
> self.  As a result the expressions can become cluttered and harder to
> read than C++ in this particular case -- imagine that!  Is there any
> relief here?  Any (simple) way around writing that self. every time?
> Thanks.  Love Python so far otherwise.

Sent via
Before you buy.

More information about the Python-list mailing list