Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Documentation of "decimal" library #102431

Closed
Labels
docsDocumentation in the Doc dir
@roman-huk

Description

@roman-huk

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.

Linked PRs

Metadata

Metadata

Assignees

No one assigned

    Labels

    docsDocumentation in the Doc dir

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp