[pygccxml-development] Patch to add a little syntactic sugar
Brought to you by:
mbaas,
roman_yakovenko
From: Allen B. <al...@vr...> - 2006-05-17 16:54:37
|
I have included a patch that I find useful for simplifying decl lookup in pyplusplus. It allows code like the following to be written using the __getitem__ interface. ns = mb.global_ns.namespace( 'my_ns',) ns["MyClass"].exclude() class_a = ns["ClassA"] class_a["doSomething"].include() It also allows an attribute interface (similar to Pyste). ns.MyClass.exclude() class_a = ns.ClassA class_a.doSomething.include() These both can be used to dramatically reduce the amount of clutter (redundant code calls) using in a script to generate bindings. Although the second one could be seen as a little dangerous because of potential name conflicts, I think the interface of Pyste has proven that people like an interface like this because it allows something that feels like a very tight domain specific langauge for creating bindings. I know that neither of these methods is anything more then syntactic sugar, but IMHO it is pretty sweet sugar. :) -Allen |