Re: [pygccxml-development] Patch to add a little syntactic sugar
Brought to you by:
mbaas,
roman_yakovenko
From: Roman Y. <rom...@gm...> - 2006-05-17 18:04:35
|
On 5/17/06, Roman Yakovenko <rom...@gm...> wrote: > On 5/17/06, Allen Bierbaum <al...@vr...> wrote: > > 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 =3D mb.global_ns.namespace( 'my_ns',) > > ns["MyClass"].exclude() > > class_a =3D ns["ClassA"] > > class_a["doSomething"].include() I like this part of the patch > > It also allows an attribute interface (similar to Pyste). > > > > ns.MyClass.exclude() > > class_a =3D ns.ClassA > > class_a.doSomething.include() This one I like less. If user made some mistake and spelled wrong property = name of the class_t or namespace_t and there is a declaration with that name, then .... I prefer to apply the patch without __getattr__ part. Thoughts? --=20 Roman Yakovenko C++ Python language binding http://www.language-binding.net/ |