Hi there,
I am fairly new to python, the problem is as follows:
newnodes = {}
for i in nodes:
newnodes[i.label] = i.coordinate
is very slow, which is due to the dots, I know that for functions the
dot lookup
can be done outside the loop, can this be done for attributes in any
way? (in such
There's no way that loop takes fifteen minutes just because of the dot
operator. I mean, 20 dots in 15 minutes is 200 dots/second. On a
1 GHz machine, that would be 5 million cycles per dot. That does not
seem reasonable (assuming you haven't overridden the dot operator to do
something more
bgs wrote:
>There's no way that loop takes fifteen minutes just because of the dot
>operator. I mean, 20 dots in 15 minutes is 200 dots/second. On a
>1 GHz machine, that would be 5 million cycles per dot. That does not
>seem reasonable (assuming you haven't overridden the dot operator to d
Hmm, it looks like the dot operator has been overloaded to do something
complicated. (although if you haven't already, try "for i in nodes:
pass" just to make sure). Is it retrieving the data from the network
somewhere? If so, then it looks like it is probably retrieving each
coordinate individu
bgs wrote:
>Hmm, it looks like the dot operator has been overloaded to do something
>complicated. (although if you haven't already, try "for i in nodes:
>pass" just to make sure). Is it retrieving the data from the network
>
>
I tried that (the pass), that runs fast as it should
>somewhere?