arskom/spyne — pull request #155 by xtfxme (2012-07-09 20:20:00+00:00)
Title: Use decimal.Decimal() to represent Infinity

float() usage raises inconsistencies dependent on machine architecture and Python version, particularly when trying to compare with other primitives like Decimal.

Python 2.6:
>>> from decimal import Decimal
>>> Decimal('123.456') < float('inf')
False
>>> hash(Decimal('inf')), hash(float('inf'))
(-1954451676, 314159)

Python 2.7:
>>> from decimal import Decimal
>>> Decimal('123.456') < float('inf')
True
>>> hash(Decimal('inf')), hash(float('inf'))
(314159, 314159)

... at the minimum, it's currently breaking soft validation.