Provide a class representing a monomial unknown. It has only two
attributes, degree and letter.
Example:
| Method Summary |
| |
__init__(self,
letter,
degree)
Build the unknown with two arguments, letter and degree (default is
1). |
| |
__eq__(self,
other)
Check if two Unknown instances are equal. |
| |
__repr__(self)
Return a value that, passed to eval(), should return an Unknown
instance equal to self. |
| |
__str__(self)
Return the class instance in a human readable manner |
| |
eval(self,
value)
Return the result of value^degree. |
| |
get_degree(self)
Return the degree of the unknown |
| |
get_letter(self)
Return the letter of the unknown |
| |
set_degree(self,
degree)
Check if the new degree is a valid integer |
| |
set_letter(self,
letter)
Check if letter is one and only one alphabetic char and assign it to
self._letter |
| Inherited from object |
| |
__delattr__(...)
x.__delattr__('name') <==> del x.name |
| |
__getattribute__(...)
x.__getattribute__('name') <==> x.name |
| |
__hash__(x)
x.__hash__() <==> hash(x) |
| |
__new__(T,
S,
...)
T.__new__(S, ...) -> a new object with type S, a subtype of T |
| |
__reduce__(...)
helper for pickle |
| |
__reduce_ex__(...)
helper for pickle |
| |
__setattr__(...)
x.__setattr__('name', value) <==> x.name = value |