mirror of
https://github.com/python/cpython.git
synced 2025-08-11 20:40:27 +00:00
Make indentation consistent.
This commit is contained in:
parent
69bd8d2189
commit
aa5bb329fd
1 changed files with 9 additions and 9 deletions
|
@ -1030,7 +1030,7 @@ In addition to the three supplied contexts, new contexts can be created with the
|
||||||
If the argument is a string, no leading or trailing whitespace is
|
If the argument is a string, no leading or trailing whitespace is
|
||||||
permitted.
|
permitted.
|
||||||
|
|
||||||
.. method:: create_decimal_from_float(f)
|
.. method:: create_decimal_from_float(f)
|
||||||
|
|
||||||
Creates a new Decimal instance from a float *f* but rounding using *self*
|
Creates a new Decimal instance from a float *f* but rounding using *self*
|
||||||
as the context. Unlike the :method:`Decimal.from_float` class method,
|
as the context. Unlike the :method:`Decimal.from_float` class method,
|
||||||
|
@ -1039,14 +1039,14 @@ In addition to the three supplied contexts, new contexts can be created with the
|
||||||
|
|
||||||
.. doctest::
|
.. doctest::
|
||||||
|
|
||||||
>>> context = Context(prec=5, rounding=ROUND_DOWN)
|
>>> context = Context(prec=5, rounding=ROUND_DOWN)
|
||||||
>>> context.create_decimal_from_float(math.pi)
|
>>> context.create_decimal_from_float(math.pi)
|
||||||
Decimal('3.1415')
|
Decimal('3.1415')
|
||||||
>>> context = Context(prec=5, traps=[Inexact])
|
>>> context = Context(prec=5, traps=[Inexact])
|
||||||
>>> context.create_decimal_from_float(math.pi)
|
>>> context.create_decimal_from_float(math.pi)
|
||||||
Traceback (most recent call last):
|
Traceback (most recent call last):
|
||||||
...
|
...
|
||||||
Inexact: None
|
Inexact: None
|
||||||
|
|
||||||
.. versionadded:: 2.7
|
.. versionadded:: 2.7
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue