O
Oliver Eichler
Hi
what will be the fastest solution to following problem
class a:
def __init__(self):
self.varA = 0
self.varB = 0
s.o. ...
listA = [a]*10
varA = []
varB = []
for l in listA:
varA.append(l.varA)
varB.append(l.varB)
s.o. ...
I could think of:
[varA.append(l.varA) for l in listA]
[varB.append(l.varB) for l in listA]
s.o. ...
But is this faster? After all I have to iterate over listA several times.
Any better solutions?
Oliver
what will be the fastest solution to following problem
class a:
def __init__(self):
self.varA = 0
self.varB = 0
s.o. ...
listA = [a]*10
varA = []
varB = []
for l in listA:
varA.append(l.varA)
varB.append(l.varB)
s.o. ...
I could think of:
[varA.append(l.varA) for l in listA]
[varB.append(l.varB) for l in listA]
s.o. ...
But is this faster? After all I have to iterate over listA several times.
Any better solutions?
Oliver