Help, re SMTP posting / RFC822
Benjamin Schollnick
junkster at nospam.rochester.rr.com
Sat Sep 18 09:56:35 EDT 1999
On Sat, 18 Sep 1999 05:29:19, "Phil Mayes" <nospam at bitbucket.com>
wrote:
> > On this routine, I was getting name lookup errors, until I changed
> >the references to include "self.",
> > which makes some degree of sense. But then, I was getting Attribute
> >Errors, until I changed all the
> > other calls in the module to be self's.
> >
> > It makes sense, but I was suprised that I would manually (via self)
> >have to tell python that the data
> > is from the object's local namespace, instead of it automatically
> >recognizing that. (Ala Borland Pascal)
>
> Yes, you do have to - it's the equivalent of C++'s this. Again, guaranteed
> to bite a few times before becoming intuitive. My common error was:
> ...
> self.x = 3
> ...
> x = 7
> ...
> if self.x == 7: # WHAT?! why doesn't this succeed ?!
> The above creates a separate variable x that is local to the member
> function.
Yeah, exactly, it makes sense but I'm so use to a compilier that does
that automatically. It's a little counter intuitive, but AOK.
I was worried that I was manipulating the variable space incorrectly,
thanks
for the reassurance.... After all, this is my first "so-called major"
step into
PYTHON OOP. If you take a look, every language has it's own variants
of
"OPP-ness", python is no different >g<.
- Benjamin
================================
Please feel free to copy any and or
all of this sig.
A little something for spam bots:
root at localhost postmaster at localhost admin at localhost
abuse at localhost postmaster at 127.0.0.1
Chairman William Kennard: bkennard at fcc.gov
Commissioner Susan Ness: sness at fcc.gov
Commissioner Harold Furchtgott-Roth: hfurchtg at fcc.gov
Commissioner Michael Powell: mpowell at fcc.gov
Commissioner Gloria Tristani: gtristan at fcc.gov
consumerline at ftc.gov
fccinfo at fcc.gov
ssegal at fcc.gov
More information about the Python-list
mailing list