@@ -129,36 +129,36 @@ def __add__(self, other):
129
129
else :
130
130
return other .__add__ (self )
131
131
132
- iself = 0
133
- iother = 0
132
+ i_self = 0
133
+ i_other = 0
134
134
135
135
result = []
136
- while iself < len (self .Data ) and iother < len (other .Data ):
137
- exp_self = self .Data [iself ][0 ]
138
- exp_other = other .Data [iother ][0 ]
136
+ while i_self < len (self .Data ) and i_other < len (other .Data ):
137
+ exp_self = self .Data [i_self ][0 ]
138
+ exp_other = other .Data [i_other ][0 ]
139
139
if exp_self == exp_other :
140
- coeff = self .Data [iself ][1 ] + other .Data [iother ][1 ]
140
+ coeff = self .Data [i_self ][1 ] + other .Data [i_other ][1 ]
141
141
if coeff :
142
142
result .append ((exp_self , coeff ))
143
- iself += 1
144
- iother += 1
143
+ i_self += 1
144
+ i_other += 1
145
145
elif exp_self > exp_other :
146
- result .append ((exp_other , other .Data [iother ][1 ]))
147
- iother += 1
146
+ result .append ((exp_other , other .Data [i_other ][1 ]))
147
+ i_other += 1
148
148
elif exp_self < exp_other :
149
- result .append ((exp_self , self .Data [iself ][1 ]))
150
- iself += 1
149
+ result .append ((exp_self , self .Data [i_self ][1 ]))
150
+ i_self += 1
151
151
152
152
# we have exhausted at least one list, exhaust the other
153
- while iself < len (self .Data ):
154
- exp_self = self .Data [iself ][0 ]
155
- result .append ((exp_self , self .Data [iself ][1 ]))
156
- iself += 1
157
-
158
- while iother < len (other .Data ):
159
- exp_other = other .Data [iother ][0 ]
160
- result .append ((exp_other , other .Data [iother ][1 ]))
161
- iother += 1
153
+ while i_self < len (self .Data ):
154
+ exp_self = self .Data [i_self ][0 ]
155
+ result .append ((exp_self , self .Data [i_self ][1 ]))
156
+ i_self += 1
157
+
158
+ while i_other < len (other .Data ):
159
+ exp_other = other .Data [i_other ][0 ]
160
+ result .append ((exp_other , other .Data [i_other ][1 ]))
161
+ i_other += 1
162
162
163
163
return Polynomial (self .Base , tuple (result ))
164
164
0 commit comments