+ def __hash__(self):
+ return self._hash
+
+ def coefficient(self, symbol):
+ if isinstance(symbol, Symbol):
+ symbol = symbol.name
+ elif not isinstance(symbol, str):
+ raise TypeError('symbol must be a string or a Symbol instance')
+ if symbol == self.name:
+ return 1
+ else:
+ return 0
+
+ def coefficients(self):
+ yield self.name, 1
+
+ @property
+ def constant(self):
+ return 0
+
+ @property
+ def symbols(self):
+ return self.name,
+
+ @property
+ def dimension(self):
+ return 1
+