Feat: raw methods for tokens
This commit is contained in:
parent
c211ed1591
commit
2317296534
@ -57,6 +57,10 @@ class Polynomial(Token):
|
|||||||
def random(cls):
|
def random(cls):
|
||||||
raise NotImplementedError
|
raise NotImplementedError
|
||||||
|
|
||||||
|
@property
|
||||||
|
def raw(self):
|
||||||
|
raise NotImplementedError("Polynomial does not exists in python")
|
||||||
|
|
||||||
def __setitem__(self, key, item):
|
def __setitem__(self, key, item):
|
||||||
""" Use Polynomial like if they were a dictionnary to set coefficients """
|
""" Use Polynomial like if they were a dictionnary to set coefficients """
|
||||||
raise NotImplementedError("Can't set coefficient of a polynomial")
|
raise NotImplementedError("Can't set coefficient of a polynomial")
|
||||||
|
@ -84,6 +84,11 @@ class Token(object):
|
|||||||
def __tex__(self):
|
def __tex__(self):
|
||||||
return self._mo.__tex__
|
return self._mo.__tex__
|
||||||
|
|
||||||
|
@property
|
||||||
|
def raw(self):
|
||||||
|
""" Get python's raw forme of the token """
|
||||||
|
return self._mo.value
|
||||||
|
|
||||||
def _operate(self, other, operation):
|
def _operate(self, other, operation):
|
||||||
""" Make a operation between 2 Tokens """
|
""" Make a operation between 2 Tokens """
|
||||||
from ..expression import Expression
|
from ..expression import Expression
|
||||||
|
Loading…
Reference in New Issue
Block a user