RE: [Pymoney-general] An attempt of implementation.
Brought to you by:
facundobatista
From: Batista, F. <Fac...@te...> - 2005-05-17 02:05:10
|
[ds...@us...] #- I'm sending two files, which are an attempt to implement my current #- understanding of the PEP. They're not finished (Currency.distrib #- and DefaultContext.distrib methods are still to be written,=20 #- I also need #- to add more tests) and I'm not really sure that all of those For these early stages, we should only code the test_cases, as to put = in black&white our PEP understanding. Later, when the discussion is settled, we'll code the module itself. This procedure assure us that we have an explained PEP with examples = and detailed cases (the test cases), and we don't do the same work several = times (just code money.py when we finish the other step). However, I did a small check to money.py, and found two big issues: - We should inheritate decimal.Context, and let it to do all the work, = we should only configure it. Or better, just use it, and provide = getcontext() and setcontext() methods, and the DefaultContext struct in money.py but = then using those from decimal. - In Currency, we should *use* Decimal, not *inheritate* it. Anyway, we'll define these when we code money.py, not now, ;) #- PS. I'm not submitting it to the sf.net patch tracker, should I? Just test cases in this first stage. Thank you! . Facundo Bit=E1cora De Vuelo: http://www.taniquetil.com.ar/plog PyAr - Python Argentina: http://www.python.org/ar/ |