Re: [pygccxml-development] Chaining calls
Brought to you by:
mbaas,
roman_yakovenko
|
From: Roman Y. <rom...@gm...> - 2006-09-26 18:29:49
|
On 9/26/06, Kevin Bluck <kev...@gm...> wrote:
> In general, I think it would be helpful if methods that modify an object
> instance would return a reference to the modified instance instead of
> 'None'. This would allow calls to be chained if desired rather than
> having to assign an explicit named reference whenever more than one
> operation is desired.
>
> For example, I think it would be great if in addition to writing this:
>
> myclass = mb.class_('myclass')
> ...
> myclass_foo = myclass.member_function('goo')
> myclass_foo.rename('foo')
> myclass_foo.include()
>
> ... you could also write this:
>
> myclass = mb.class_('myclass')
> ...
> myclass.member_function('goo').rename('foo').include()
I don't see a problem with it. Matthias what do you think?
--
Roman Yakovenko
C++ Python language binding
http://www.language-binding.net/
|