[python-win32] Slow convert collection to list (search a fast way)

Michel Claveau mc at mclaveau.com
Thu Feb 12 08:04:24 CET 2009


Hi!

I get a collection of (COM) objects:
    tobj = oie.prepartableau(    #it's a JScript array of objects, returned 
by a JScript function via COM
I convert (translate? transtype?) this collection to LIST:
    lobj = list(tobj)
But it's (very) slow(*). I tried  [i for i in tobj] ; I tried with iter ; 
with 'for' ; etc.  All is slow.

Who know a way for fast get the collection like LIST?
Thanks in advance.

-- 
Michel Claveau


(*) slow:  0.7 seconds for len=1000





More information about the python-win32 mailing list