[cse491] convert to class

C. Titus Brown ctb at msu.edu
Sun Oct 5 09:02:19 PDT 2008


On Sun, Oct 05, 2008 at 11:51:38AM -0400, Alex Nolley wrote:
-> That's what I was originally thinking of doing except that if you have a
-> class, you have to first declare an instance of that class in order to use
-> it. If you try to use the functions without doing that or without specifying
-> an object of that class to pass into the function (the self argument) Python
-> chokes. Right now I don't see a way to use a server class and still have
-> that program pass Titus's tests. Please correct me if I'm wrong though.

Hey Alex, you're basically correct.  There are some tricks you could do
but they're all bad ideas (that is, have significant drawbacks) and so I
don't even want to show you the code :).

Could you explain a bit more of what you're thinking, though?  In
particular, how would the function signatures (the arguments & return
values) of the various functions change?

And have you thought about simply leaving the three functions I test
alone, and then having delegate use a class to encapsulate information
to pass around to handler functions?

cheers,
--titus
-- 
C. Titus Brown, ctb at msu.edu



More information about the cse491-fall-2008 mailing list