(self, other)
| 2111 | # for simplicity, we only define one operator that |
| 2112 | # propagates expressions |
| 2113 | def __add__(self, other): |
| 2114 | temp = int(self) + int( other) |
| 2115 | if isinstance(self, NamedInt) and isinstance(other, NamedInt): |
| 2116 | return NamedInt( |
| 2117 | '({0} + {1})'.format(self.__name__, other.__name__), |
| 2118 | temp, |
| 2119 | ) |
| 2120 | else: |
| 2121 | return temp |
| 2122 | |
| 2123 | class NEI(NamedInt, Enum): |
| 2124 | __qualname__ = 'NEI' # needed for pickle protocol 4 |