[ANN]: Python-by-Example updates

AK andrei.avk at gmail.com
Sat Apr 12 11:12:19 EDT 2008


Max Erickson wrote:
> AK <andrei.avk at gmail.com> wrote:
> 
>> Python-by-Example is a guide to LibRef, aiming to give examples
>> for all functions, classes, modules, etc. Right now examples
>> for functions in some of the most important modules are
>> included.
>>
>> http://pbe.lightbird.net/
>>
>> thanks,
>>
> 
> The second set of examples on the page for decimal doesn't look quite 
> right.
> 
> The first couple of lines:
> 
>     getcontext().prec = 6       # Decimal('3.0')
>     Decimal("3.0")              # Decimal('3.1415926535')
> 
> I would assume that the " = 6" isn't getting processed correctly.
> 
> 
> max
> 

That block of examples was completely mis-formatted.. it should
really be like this:

getcontext().prec = 6
Decimal('3.0')         # Decimal("3.0") [precision will be
                        # applied after an operation, e.g. addition]
Decimal('3.1415926535')    # Decimal("3.1415926535")
Decimal('3.1415926535') + Decimal('2.7182818285')   # Decimal("5.85987")

I fixed it now, thanks for the report!

-- 
ak
Tobu | http://tobu.lightbird.net/ | Freeform DB / Tagger / PIM
Python-by-Example | http://pbe.lightbird.net/ | Guide to LibRef



More information about the Python-list mailing list