[prev in list] [next in list] [prev in thread] [next in thread] 

List:       python-list
Subject:    Re: Storing records from a parsed file
From:       "Ben" <Benjamin.Barker () gmail ! com>
Date:       2006-09-30 15:54:23
Message-ID: 1159631663.871973.301930 () m7g2000cwm ! googlegroups ! com
[Download RAW message or body]

Finally got it all sorted :-)

I got slightly confused because it seems that if you refer to class
variables from methods within that class you need to explicitly state
that they are self, otherwise, since class variables are all public in
python, things could get quite confusing.

Ben


Ben wrote:
> Ah - I think I've sorted it out.
>
> I can now have data1.function()
>
> or
>
> data2.function()
>
>
> etc
>
>
> However, I can still call function() directly:
>
> function()
>
>  which seems very odd Indeed. The only instances of function are within
> classes data1 and data2, and these definitions are different, so I
> don't see why I can get away with calling it without reference to a
> base class - for a start how does it know whivh one to call... will
> investigate :-p

-- 
http://mail.python.org/mailman/listinfo/python-list
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic