Re: [pygccxml-development] mdecl and methods that return values
Brought to you by:
mbaas,
roman_yakovenko
From: Roman Y. <rom...@gm...> - 2006-05-31 04:22:10
|
On 5/30/06, Roman Yakovenko <rom...@gm...> wrote: > Allen, I tried the patch and there are some errors in unit tests. > I will try to fix it tommorrow and commit. I will let you know. 1. __getitem__ has been changed a little: def __getitem__( self, index ): """provides access to declaration. If passed a standard index, then return contained decl. Else call the getitem method of contained decls. """ if isinstance(index, ( int, slice ) ): ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ return self.decls[index] else: return call_redirector_t( '__getitem__', self.decls)(index) slice has been added. But still patch does not work: class X{ X(){} }; global_ns['X'].meber_functions() Will raise an error: AttributeError: 'constructor_t' object has no attribute '__getitem__' The query breaks precondition of call_redirector_t.__call__ : I assume that all functions will return same type We don't have list of same objects. So mdecl_wrapper_t.__getitem__ can not return call_redirector_t( '__getitem__', self.decls)(index) :-(. Without good definition I don't know how to fix this. So, if you don't mind I will not apply the patch. -- Roman Yakovenko C++ Python language binding http://www.language-binding.net/ |