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

2013-10-13 Thread Georg Brandl
Georg Brandl added the comment: Adding a special case for Decimal isn't as well justified as one for None -- after all it is a fundamental singleton. (Also, None is encoded without lossy conversion.) The encoder/decoder are already extensible by extending Marshaller.dispatch and Unmarshaller.

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

2013-05-25 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- status: open -> pending ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http:/

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

2011-02-01 Thread Mark Dickinson
Changes by Mark Dickinson : -- nosy: +mark.dickinson ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mai

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

2011-01-31 Thread GDR!
GDR! added the comment: While it would be allowed by the spec in the quotation I pasted in the original post, I understand your point, it makes sense. I still think, however, that it should be available at least as an option. There already is allow_none parameter available when marshaling. A

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

2011-01-31 Thread Raymond Hettinger
Raymond Hettinger added the comment: >>> x = decimal.Decimal('9.11') >>> c.dumps(x,), 'whatever') "\n\nwhatever\n\n\n9.11\n\n\n\n" That's what I though you meant and I don't think it is wise. The RPC spec is all about interoperability. The tag

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

2011-01-31 Thread GDR!
GDR! added the comment: Also, I think that should be represented as Decimal when unmarshalling XML-RPC data, because the standard doesn't give any limits on size on precision of data, and the only representation it allows is the one with decimal point, making it an excellent fit for Decimal.

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

2011-01-31 Thread GDR!
GDR! added the comment: I didn't mean to implicitly convert Decimal to float. My point was that xmlrpclib should serialize Decimals natively to avoid loss of precision when converting to float and then to string. Whether other party will be able to represent this number exactly or not should

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

2011-01-31 Thread Raymond Hettinger
Raymond Hettinger 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 com

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

2011-01-31 Thread GDR!
New submission from GDR! : xmlrpc.client (and xmlrpclib in 2.x) can't serialize instances of Decimal, throwing TypeError instead. Because XML is a textual format, converting from decimal to float may cause loss of data. According to http://www.xmlrpc.com/spec, encoding Decimal as XML-RPC is