Skip to content

Commit

Permalink
Applied black code style for newest changes related to arithmetic dou…
Browse files Browse the repository at this point in the history
…ble asterisk use
  • Loading branch information
kalaspuff committed Feb 28, 2022
1 parent 94e6239 commit ad9f1e8
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 4 deletions.
1 change: 0 additions & 1 deletion stockholm/compat/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ class CurrencyValue(Protocol):
interchangeable_with: Optional[Union[Tuple[str, ...], List[str], Set[str]]]
preferred_ticker: Optional[str]


except ImportError: # pragma: no cover
# Compatibility import for Python 3.7
this_module = sys.modules[__name__]
Expand Down
2 changes: 1 addition & 1 deletion stockholm/money.py
Original file line number Diff line number Diff line change
Expand Up @@ -849,7 +849,7 @@ def __pow__(self, other: Any) -> MoneyType:
if converted_other._currency is not None:
raise InvalidOperandError("Unable to use a monetary amount as an exponent")

amount = self._amount ** converted_other._amount
amount = self._amount**converted_other._amount
return cls(amount, currency=self._currency)

def __neg__(self) -> MoneyType:
Expand Down
4 changes: 2 additions & 2 deletions tests/test_arithmetics.py
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ def test_pow() -> None:
assert m1.currency == "BIT"
assert str(m1) == "2.00 BIT"

m2 = m1 ** 4
m2 = m1**4
assert isinstance(m2, Money)
assert m2.amount == 16
assert m2.currency == "BIT"
Expand All @@ -260,7 +260,7 @@ def test_pow() -> None:
assert str(m2) == "16.00 BIT"

with pytest.raises(InvalidOperandError):
m1 ** m1
m1**m1

assert Money(2) ** Money(4) == 16

Expand Down

0 comments on commit ad9f1e8

Please sign in to comment.