Can I do this faster?

Emile van Sebille emile at fenx.com
Thu Aug 10 10:06:04 EDT 2000


While not as fast as a static cache, this is faster than
looping through:

s.__rowDict.keys()[s.__rowDict.values().index(row)]

--

Emile van Sebille
emile at fenx.com
-------------------


"Horst Gassner" <horst at proceryon.at> wrote in message
news:3990FBCE.ED3458D8 at proceryon.at...
> Hello!
>
> The following code is executed very often in my program
and I would be
> happy if someone could help me to speed this up.
>
> def __GetRowID (s, row):
> for key in s.__rowDict.keys():
> if s.__rowDict[key]['data'] == row:
> return key
>
> Thanx in advance
> Horst





More information about the Python-list mailing list