I've cc'd this to the sage-finance Sage development group, which you
might want to subscribe to:
http://groups.google.com/group/sage-finance
Regarding your question:
1. It should be FinanceDate(2009, 2, 6).add_business_days(5)
since in Python people usually use CamelCase for class constructors,
but lower case and underscores for function names. It's just the
usual convention.
2. What you are doing -- returning a new object -- is generally a
good idea, though of course it depends on context. If you don't,
imagine code like this:
sage: foo = FinanceDate(2009,2,6)
sage: foo
datetime.date(2009, 2, 6)
sage: o = find_optimum(bar, foo)
sage: foo
datetime.date(2009, 2, 14)
... suddenly foo has a completely different value just because you happened
to call some function, which happened to internally muck with foo's
value. By making the date object immutable, this possible confusing
side-effect is avoided.
In C++ there is a const keyword that helps avoid this problem. But in
Python there is not const -- anything passed into a function is just a
reference, and has to "protect itself".
How's your finance package work going?
William