[Tutor] Best way to construct this

Sean Cronin[tutor] seancron+pythontutor at gmail.com
Sun Sep 2 18:37:04 CEST 2007


Hey,

Thanks Alan for the help on the classes.  This is my first time using them
(in case you couldn't tell :) ).  However, I can't understand why you want
to make a separate function called parse.  What I am trying to do by having
different functions in the class like maxtemp, and mintemp, is to allow my
self to be able to parse only for certain data,
instead of having one giant function that parses for everything. That
way I have the option of being able to selectively parse the data.
It also gives me the option as you said of being able to reparse the
data later if it became corrupted somehow.


Also, where should I put the value for the maxtempnode since you set them
equal to none in the pseudo code you sent.

>class Weather:
>    def init(self, fname):
>        self.filename = fname
>        self.data = None
>        self.maxtemp = None
>        self.maxnode = None

Should I change the None to what their values should be, or should I do that
at some point later in the code?

Thanks,

-Sean
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.python.org/pipermail/tutor/attachments/20070902/fc37cd6c/attachment.htm 


More information about the Tutor mailing list