430
431
432def test_partition_formula_single(library_formula_params):
433 formula, params = library_formula_params434 try:
435 next(iter(generate_partitioned_formulas(formula)))
436 except StopIteration:
173 # Factor the intermediate, don't worry about the coeff
174 coeff, factor_list = poly.factor_list()
175 # Go over all the factors of the intermediate, forget the power
176 for factor, power in factor_list:177 # Remove unnecessary variables from the Poly
178 reduced = factor.exclude()
179 # If there are only curve parameters, we do not care about the polynomial
171 # Go over all the unrolled intermediates
172 for name, poly in unrolled:
173 # Factor the intermediate, don't worry about the coeff
174 coeff, factor_list = poly.factor_list()175 # Go over all the factors of the intermediate, forget the power
176 for factor, power in factor_list:
177 # Remove unnecessary variables from the Poly
162 unrolled = map_to_affine(formula, unrolled)
163 # Try all intermediates, zvp_point should return empty set if ZVP points do not exist
164 # Try with a few scalars to actually test more resulting ZVP points
165 for name, poly in unrolled:166 for k in (2, 3, 5):
167 points = zvp_points(poly, secp128r1.curve, k, secp128r1.order)
168 if points:
38 results = unroll_formula(formula)
39 mapped = map_to_affine(formula, results)
40 assert mapped is not None
41 for name, res in mapped: 42 assert isinstance(res, Poly)
43
44
An unused variable takes up space in the code, and can lead to confusion, and it should be removed. If this variable is necessary, name the variable _
to indicate that it will be unused, or start the name with unused
or _unused
.
def update():
for i in range(10): # Usused variable `i`
time.sleep(0.01)
display_result()
def update():
for _ in range(10):
time.sleep(0.01)
display_result()