Re: [pygccxml-development] mdecl and methods that return values
Brought to you by:
mbaas,
roman_yakovenko
From: Roman Y. <rom...@gm...> - 2006-05-31 17:46:52
|
On 5/31/06, Allen Bierbaum <al...@vr...> wrote: > > class X{ X(){} }; > > > > global_ns['X'].meber_functions() > > > > Will raise an error: AttributeError: 'constructor_t' object has no > > attribute '__getitem__' > > I would have to look into this further, but what is calling __getitem__ > on a constructor_t object? call_redirector_t.__call__, because: global_ns['X'] is equivalent to get all declarations that have name 'X' class and its constructors match the query I suggest you to debug small example and see what happens. > > 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) :-(. > > > Maybe the precondition should be modified slightly. Maybe the > precondition should be that all objects returned can be wrapped with in > a mdecl. So the preconditions would be the same as those for creating > an mdecl. And unless I am missing something, an mdecl can wrap objects > of different types. > > For example a call like: > > mfs = my_class.member_functions() > > Will return an mdecl that wraps constructors, calldefs, and any other > types of members. This is how it works right now. The main problem is how to define precondition. -- Roman Yakovenko C++ Python language binding http://www.language-binding.net/ |