Do I always have to write "self." ?

jsolbrig at my-deja.com jsolbrig at my-deja.com
Fri Apr 28 20:58:36 EDT 2000


Actually,
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 webcom.com


In article <270420001706386648%pecora at anvil.nrl.navy.mil>,
  "Louis M. Pecora" <pecora at anvil.nrl.navy.mil> 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 Deja.com http://www.deja.com/
Before you buy.



More information about the Python-list mailing list