[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[taler-taler-util] branch master updated: update "import" statement, pl
From: |
gnunet |
Subject: |
[taler-taler-util] branch master updated: update "import" statement, plus all downstream references |
Date: |
Thu, 10 Feb 2022 20:03:56 +0100 |
This is an automated email from the git hooks/post-receive script.
ttn pushed a commit to branch master
in repository taler-util.
The following commit(s) were added to refs/heads/master by this push:
new 97fa378 update "import" statement, plus all downstream references
97fa378 is described below
commit 97fa3789735fdb8518bcd26f4154f3fc379a9e78
Author: Thien-Thi Nguyen <ttn@gnuvola.org>
AuthorDate: Thu Feb 10 14:03:30 2022 -0500
update "import" statement, plus all downstream references
Thanks to MS for the Pythonic advice. :-D
---
doc/doc.org | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/doc/doc.org b/doc/doc.org
index 84702ae..7834a48 100644
--- a/doc/doc.org
+++ b/doc/doc.org
@@ -63,9 +63,9 @@ the constructor throws an =AmountOverflowError= exception.
The constructor takes three args: /currency/, /value/, /fraction/.
-: >>> import taler.util.amount as Amount
+: >>> from taler.util import amount
: # KUDOS 10.50
-: >>> amt = Amount.Amount ("KUDOS", 10, 50000000)
+: >>> amt = amount.Amount ("KUDOS", 10, 50000000)
: >>> amt
: Amount(currency='KUDOS', value=10, fraction=50000000)
@@ -78,7 +78,7 @@ You can use classmethod =parse= to read a string as an
=Amount= object.
This function can throw =AmountFormatError= if the string is malformed,
and =AmountOverflowError= if the fraction portion is too long.
-: >>> Amount.Amount.parse ("KUDOS:10.12345678")
+: >>> amount.Amount.parse ("KUDOS:10.12345678")
: Amount(currency='KUDOS', value=10, fraction=12345678)
An =Amount= object supports addition and subtraction.
@@ -87,7 +87,7 @@ a =CurrencyMismatchError= exception.
: >>> amt + amt
: Amount(currency='KUDOS', value=21, fraction=0)
-: >>> another = Amount.Amount ("KUDOS", 5, 42)
+: >>> another = amount.Amount ("KUDOS", 5, 42)
: >>> amt - another
: Amount(currency='KUDOS', value=5, fraction=49999958)
@@ -164,7 +164,7 @@ The classmethod =parse= recognizes a leading =+= or =-=, and
additionally accepts a plain =CURRENCY:VALUE.FRACTION= form as a
positive =SignedAmount=.
-: >>> Amount.SignedAmount.parse ("-KUDOS:2.34")
+: >>> amount.SignedAmount.parse ("-KUDOS:2.34")
: SignedAmount(is_positive=False, amount=Amount(currency='KUDOS', value=2,
fraction=34000000))
Lastly, a =SignedAmount= object can flip its sign using a unary minus.
--
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [taler-taler-util] branch master updated: update "import" statement, plus all downstream references,
gnunet <=