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:31:58
|
On 5/17/06, Allen Bierbaum <al...@vr...> wrote: > Roman Yakovenko wrote: > >> > 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? > > I assume you mean something like: > > MyClass.someMethod.call_policies =3D .... > > so what if they spell it 'call_pooicies', it that case it will raise the > exception that python would normal raise and just throw and AttributeErro= r. I don't have a problem with exceptions you raise. I have a problem when exception is not raised. User wrote MyClass.named, when he meant MyClass.name and MyClass has named variable. Almost same example, different view: class X{ string name; }; User can not use X.name syntax, because name is the property of every declaration. So he is forced to switch to alternative syntax: X["name"]. I don't like this. > > -Allen > --=20 Roman Yakovenko C++ Python language binding http://www.language-binding.net/ |