Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork33.3k
Closed
Description
Documentation of "decimal" library - Context.logical_??? methods
There is a understatement in docstring ofdecimal.Context.logical_xxx methods. All arguments should be instances ofdecimal.Decimal, but consisting only of binary digits only (i.e. "0" and "1"). If the number is not an integer or consists of digits other than 0 and 1, an exception is thrown:
>>> import decimal>>> ctx = decimal.getcontext()>>> ctx.logical_or(decimal.Decimal(15), decimal.Decimal(22))Traceback (most recent call last): File "<pyshell#71>", line 1, in <module> ctx.logical_or(Decimal(15), Decimal(22))decimal.InvalidOperation: [<class 'decimal.InvalidOperation'>]I think it would be good to describe this behavior explicitly.