[orm-devel] NUMERICAL and DECIMAL on the Python side
Sat, 7 Dec 2002 02:23:32 +0100
I've read some of psycopg's sourcecode and found that it has a very
flexible type system which can be extended in such a way that you can
map PostgreSQL types to custom Python classes. float was chosen for
NUMERIC and DECIMAL to keep the number of psycopg's dependencies at a
minimum. See Federico Di Gregorio's statement on
In the same thread on the psycopg list someone suggest the FixedPoint
module as a storage class for these SQL Types on the Python side. See
for more on this one. For financial calculations this seems to be the
way to go. I do not really know whether it is well suited for math
with really big quantities as are NUMERIC and DECIMAL. mx.Number
looks like a good solution for that.
I guess we need to take both packages into account. Does anyone on
this list know of any other packages for exact arbitrary precision
math that matches the SQL types better?
Also, I wonder how good these extra dependencies are for orm...
_..._ Diedrich Vorberg
/ _ _ \ http://www.tux4web.de
| (o)_(o) | email@example.com
\( ) / .---.
//'._.'\ \ / \ Internet Dienstleistungen
// . \ \ \.@-@./ und 'Consulting'.
|| . \ \ /`\_/`\
|\ : / | // _ \\ Linux Rules!
\ `) ' (` /_ | \ )|_
_)``".____,.'"` (_ /`\_`> <_/ \
) )'--'( ( \__/'---'\__/