Changeset - 171aed16f93b
[Not reviewed]
0 1 0
Brett Smith - 4 years ago 2020-04-12 12:58:27
brettcsmith@brettcsmith.org
data: Bugfix super() arguments in Amount.__new__.

Apparently I was more tired than I realized last night.
1 file changed with 1 insertions and 1 deletions:
0 comments (0 inline, 0 general)
conservancy_beancount/data.py
Show inline comments
...
 
@@ -136,13 +136,13 @@ class Amount(bc_amount.Amount):
 
    # beancore.core.Amount adds instance methods to it.
 
    # b.c.Amount.__New__ calls `b.c._Amount.__new__`, which confuses type
 
    # checking. See <https://github.com/python/mypy/issues/1279>.
 
    # It works fine if you use super(), which is better practice anyway.
 
    # So we override __new__ just to call _Amount.__new__ this way.
 
    def __new__(cls, number: decimal.Decimal, currency: str) -> 'Amount':
 
        return super(bc_amount._Amount, Amount).__new__(cls, number, currency)
 
        return super(bc_amount.Amount, Amount).__new__(cls, number, currency)
 

	
 

	
 
class Metadata(MutableMapping[MetaKey, MetaValue]):
 
    """Transaction or posting metadata
 

	
 
    This class wraps a Beancount metadata dictionary with additional methods
0 comments (0 inline, 0 general)