Style: apply black
This commit is contained in:
@@ -28,6 +28,7 @@ minus_doc = """ Opposite of a MO
|
||||
|
||||
minus = Dispatcher("minus", doc=minus_doc)
|
||||
|
||||
|
||||
@minus.register(type(None), MOnumber)
|
||||
def monumber(_, right):
|
||||
"""
|
||||
@@ -37,7 +38,8 @@ def monumber(_, right):
|
||||
<MOnumber - 4>
|
||||
|
||||
"""
|
||||
return MO.factory(- right.value)
|
||||
return MO.factory(-right.value)
|
||||
|
||||
|
||||
@minus.register(type(None), MOFraction)
|
||||
def mofraction(_, right):
|
||||
@@ -84,6 +86,7 @@ def mofraction(_, right):
|
||||
|
||||
return MOFraction(right._numerator, right._denominator, True)
|
||||
|
||||
|
||||
@minus.register(type(None), MOstr)
|
||||
def mostr(_, right):
|
||||
""" Opposite of 'x' is '-x'
|
||||
@@ -95,6 +98,7 @@ def mostr(_, right):
|
||||
"""
|
||||
return MOMonomial(-1, right)
|
||||
|
||||
|
||||
@minus.register(type(None), MOstrPower)
|
||||
def mostrpower(_, right):
|
||||
""" Opposite of 'x^n' is '-x^n'
|
||||
@@ -106,6 +110,7 @@ def mostrpower(_, right):
|
||||
"""
|
||||
return MOMonomial(-1, right.variable, right.power)
|
||||
|
||||
|
||||
@minus.register(type(None), MOMonomial)
|
||||
def momonomial(_, right):
|
||||
""" Opposite of 'ax^n' is '-ax^n'
|
||||
@@ -121,6 +126,7 @@ def momonomial(_, right):
|
||||
coef = Tree("-", None, right.coefficient)
|
||||
return Tree("*", coef, right.strpower)
|
||||
|
||||
|
||||
@minus.register(type(None), MOpolynomial)
|
||||
def mopolynomial(_, right):
|
||||
""" Opposite of a polynomial
|
||||
@@ -133,6 +139,7 @@ def mopolynomial(_, right):
|
||||
neg_coefs = {p: -c.value for (p, c) in right.coefficients.items()}
|
||||
return MOpolynomial(right.variable, neg_coefs)
|
||||
|
||||
|
||||
# -----------------------------
|
||||
# Reglages pour 'vim'
|
||||
# vim:set autoindent expandtab tabstop=4 shiftwidth=4:
|
||||
|
||||
Reference in New Issue
Block a user