Re: [pygccxml-development] Additional attribute functionality
Brought to you by:
mbaas,
roman_yakovenko
From: Ben S. <bsc...@lu...> - 2007-12-05 18:31:56
|
=20 =09 =09 However, I think I'll stick to mem_fun*s(..., allow_empty=3Dtrue) for now. It makes more sense... =09 =09 In this case it make more sense to set allow_empty to be always true by =09 scopedef_t. ALLOW_EMPTY_MDECL_WRAPPER =3D True=20 =20 This is what I am doing now. It seems to work ok with the _select_multiple functions. PS. I don't understand how we are avoiding a loop by writing =20 for decl in class_.decls(): =20 wouldn't this be the same if decls() returned a list? And then the benefit of a list would be it's standard operations... =09 =09 It is hard to come with good example for pygccxml only classes, partly because declaration classes doesn't contain functionality, but only data.=20 =09 For Py++ it is very easy, for example update some property for all selected declarations: =09 decls =3D class_.decls( some condition ) decls.xxx =3D yyy =09 Or even=20 =09 class_.decls( some condition ).xxx =3D yyy=20 =09 it is much shorter than =09 [ d.xxx =3D yyy for d in class_.decls( some condition ) ) =09 But may be you are right. I will think about this point. =20 If this functionality works, then it would be VERY good to add the above comments to the code and/or documentation. I didn't understand that you could do this before. However, I think that having query operators that return lists of decls would be good because it provides more functionality then mdecl_wrapper_t, you can concatenate lists together and it leaves open the possibility of adding functionality to decls. This doesn't mean you need to remove the mdecl_wrapper_t functions, they are pretty innovative... =20 Cheers Ben =20 =20 --=20 Roman Yakovenko C++ Python language binding http://www.language-binding.net/=20 |