On 02/27/13 01:56, C Anthony Risinger wrote:
floats are hardware dependent and unsuitable for *anything* that requires some notion of knowable accuracy -- my suggestion would be to wrap incoming Attribute values with a compat layer or something, at the expense of performance :( -- eg, convert incoming float -> str -> Decimal, or probably better, throw an exception (float() + Decimal() already throws, but Python has an [unwritten?] practice of "anything compares to anything" which is the only reason it's attempted at all)

Hi Anthony,

Well, this is a quirk of Python 2.6 which is already fixed in later releases. That's why the code in this patch only works when the interpreter's version is 2.6.

So I don't think it'd make sense to make the life of those who don't use it harder, especially for a "transient" bug such as this.



...this is a known pain point AFAICT:

http://bugs.python.org/issue2531

...but at the end of the day, Decimal is the most suitable primitive IMO.


I agree, that's why I say '[double] comes with its gotchas': http://spyne.io/docs/reference/model.html#spyne.model.primitive.Double. I'm going to make that text clearer though.

But if the user wants to use this, hey, it's in the XML Schema spec, we can't stop them.

What do you think?

Best,
Burak
_______________________________________________
Soap mailing list
[email protected]
http://mail.python.org/mailman/listinfo/soap

Reply via email to