> (...), I did not see that the extra variable was bound in the > _make_safearray_type closure.
Taking a new look at the code now, I even see that extra is initialized in a similar way (at the beginning of _make_safearray_type) to what I did in create: if cls._vartype_ == VT_RECORD and extra is None and len(value) > 0 and hasattr(value[0], '_recordinfo_'): import comtypes.typeinfo extra = comtypes.typeinfo.GetRecordInfoFromGuids(*value[0]._recordinfo_) the only difference there is that you did try/else and I used hasattr. > PS: Thinking about the code I'm wondering why I didn't use the outer definition > of 'extra' in the create(...) method directly instead of passing it as a parameter... That could be another solution, to remove the 'extra' parameter from create (though I don't know whether someone may already be using it and this could break that code). Another one could be renaming the 'extra' parameter in create, and assign the bound 'extra' variable if None is provided as an argument (or filled in by the default value). Saludos, ------------------------------------------------------------------------------ Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day trial. Simplify your report design, integration and deployment - and focus on what you do best, core application coding. Discover what's new with Crystal Reports now. http://p.sf.net/sfu/bobj-july _______________________________________________ comtypes-users mailing list comtypes-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/comtypes-users