Saturday, August 6, 2011

slight modification?

I think the date subtraction function should be in the closeddates class.

One time I read a description of proper object/class use that went something like this: An object should contain data and all of the function necessary to manipulate that data.

That might be a oversimplification but it kind of rings true with Python. All lists are an instance of a class, and the .append() method is a part of that class. I'm not calling append() which then initializes the class and makes the manipulation. So, the act of manipulating the closed case data should be inside the class.

Then I can just say:

c = closedcases(filename).subtract_dates()

right?

No comments:

Post a Comment