I wrote a class which looks like:
class EllipticCurve:
points = []
def generatePoints(a, b, p):
...
This generates correct set of points for the curves. I wanted to run a time test on different curves so wrote a main function as:
def main():
for i in range(5):
E = EllipticCurve(a, b, p) # with random values of a, b, p
E.generatePoints()
This generates the correct set of points for the first run, but during successive runs, the previous points are kept. Why?
For Example, after first run if i print E.points:
[(1, 2), (1, 3)] (say)
in the next run it prints:
[(1, 2), (1, 3), (1, 5), (1, 6)]
even though the first 2 tuples were not calculated this run.