On 9/4/06, Matthias Baas <ba...@ir...> wrote:
> rom...@us... wrote:
> > @@ -121,12 +121,16 @@
> >
> > Returns a reference to the internal list (which may be modified).
> > """
> > + if None is self._function_transformers:
> > + #TODO: for trivial cases get_size( int&, int& ) Py++ should guess
> > + #function transformers
>
> On what information would such a guess be based? The declaration doesn't
> contain any reliable information about the intention of the programmer.
It is not true. You can treat both arguments as in_out:
boost::python::tuple get_size( int, int ){
return make_tuple( ... )
}
The function "get_size" becomes callable. May be it have bad
interface, but still.
> Will the implicit guess be available when the user also attaches some
> transformers?
Program development is the interactive process. User\programmer will
see that the
interface is not optimal. Programmer will be able to come back and decide,
whether it leaves Py++ created transformations and add his own or replace them.
> And while we're at it, just out of curiosity, why do you initialize
> _function_transformers with None instead of an empty list?
I will add "default( calculated )" transformers on first time. After
this I will not touch it
and user is responsible for it's management. See for example
class_t.indexing_suite
property.
> (to me it
> appears as if this only has disadvantages, mainly that you always have
> to test it against None if you want to access the attribute)
Please read the code:
if None is self._function_transformers:
#TODO: for trivial cases get_size( int&, int& ) Py++ should guess
#function transformers
self._function_transformers = []
return self._function_transformers
None will be never returned from this function.
--
Roman Yakovenko
C++ Python language binding
http://www.language-binding.net/
|