the implementation of "child = childP1 + childP2" is wrong here. If we use the example in the figure of "Illustration of ordered crossover (credit: Lee Jacobson)", the resulting offspring of your implementation is "954321678" which is wrong. The correct result should be "954326781".
child = [None] * len(parent1)
childP1 = []
geneA = int(random.random() * len(parent1))
geneB = int(random.random() * len(parent1))
startGene = min(geneA, geneB)
endGene = max(geneA, geneB)
for i in range(startGene, endGene):
childP1.append(parent1[i])
child[i] = parent1[i] # copy segment to the same position
ptr = 0
for item in parent2:
if item not in childP1:
while ptr < len(parent1) and child[ptr] != None: # find the next None element
ptr += 1
child[ptr] = item # only copy the remaining gene to positions that are None
ptr += 1
return child