Fix(MO): MOMonomial variable can be str in __init__

This commit is contained in:
Bertrand Benjamin 2018-11-13 15:55:55 +01:00
parent 17153dd345
commit f6f6741398

View File

@ -101,10 +101,11 @@ class MOMonomial(MO):
raise MOError("The coefficient of a monomial should not be 0") raise MOError("The coefficient of a monomial should not be 0")
self._coefficient = _coefficient self._coefficient = _coefficient
if isinstance(variable, MOstrPower): _variable = MO.factory(variable)
_variable = variable.variable if isinstance(_variable, MOstrPower):
_power = MO.factory(variable.power.value * power) _power = MO.factory(_variable.power.value * power)
elif isinstance(variable, MOstr): _variable = _variable.variable
elif isinstance(_variable, MOstr):
_variable = variable _variable = variable
_power = MO.factory(power) _power = MO.factory(power)
else: else: