|
From: Luigi B. <lui...@gm...> - 2011-10-03 10:42:26
|
On Sun, 2011-10-02 at 09:08 +0800, R Yan wrote: > And would it benefit at all if someone contributes a module that reads > currency codes and calendars at runtime? As for calendars, the rationale is having rules (for example, "each 25 december" or "the third Wednesday in October") that remain valid for each year, instead of having to generate and distribute the data files. The possibility of creating a calendar at runtime is given by the BespokeCalendar class, whose instances take a list of dates (to be read from a file or otherwise) and build the corresponding calendar. I'd leave out the part where one reads the file, especially since it depends on locales (today's date is written as 03/10/2011 in Italy and 10/03/2011 in the US). For currencies, you might add a constructor to the Currency class that takes the needed data and thus instantiates a currency at runtime. Again, I'd prefer to leave out the "read from a text file" part (or from a database, or from any other source) that can be done easily by any application using the library. Luigi -- Never mistake motion for action. -- Ernest Hemingway |