[issue11084] Serialization of decimal.Decimal to XML-RPC

Raymond Hettinger report at bugs.python.org
Mon Jan 31 21:02:15 CET 2011


Raymond Hettinger <rhettinger at users.sourceforge.net> added the comment:

-1 on an implicit, lossy conversion.

The principal reasons for using decimal in the first place is avoid representation error.  For example, when money is being represented as a decimal, it is improper to convert it to float (where it can no longer be compared for equality and where the representable range is smaller).

A user needs explicit control in this situation, converting to float when it doesn't matter, or using an API that allows the decimal repr to be handled.

One other issue is that in an RPC environment, good design suggests that the client do its best to match the type expectations for of the functions on the server.  Implicit signature changing makes even less sense for RPC than it does in a regular application.

----------
nosy: +rhettinger
type: behavior -> feature request
versions: +Python 3.3 -Python 3.1

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue11084>
_______________________________________


More information about the Python-bugs-list mailing list