[Python-Dev] why do we allow this syntax?

Chris Withers chris at simplistix.co.uk
Fri Feb 8 18:45:28 CET 2013


On 08/02/2013 16:17, Oscar Benjamin wrote:
> Decimal.__pos__ uses it to return a Decimal instance that has the
> default precision of the current Decimal context:
>
>>>> from decimal import Decimal
>>>> d = Decimal('0.33333333333333333333333333333333333333')
>>>> d
> Decimal('0.33333333333333333333333333333333333333')
>>>> +d
> Decimal('0.3333333333333333333333333333')

That's the answer I was hoping wouldn't be coming...

Oh well, guess I'll have to improve on my sloppy typing.

Chris

-- 
Simplistix - Content Management, Batch Processing & Python Consulting
             - http://www.simplistix.co.uk


More information about the Python-Dev mailing list