Storing records from a parsed file

Ben Benjamin.Barker at gmail.com
Sat Sep 30 11:54:23 EDT 2006


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




More information about the Python-list mailing list