[C++-sig] TnFOX with the latest py++ from SVN

David Abrahams dave at boost-consulting.com
Wed Oct 4 12:53:56 CEST 2006


"Niall Douglas" <s_sourceforge at nedprod.com> writes:

>> You could try to do something unspeakable, like looking back up the python
>> traceback and decompiling the code of the caller to figure it out, but
>> even if that could work sometimes, it wouldn't work all the time.
>> Anyway, if you want to try to implement such an abomination, more
>> power to you, but it will never go into Boost.Python.
>
> Almost for the coding challenge that looks like fun, but well I'm 
> nowhere near fifteen years old any more!
>
> More sensible would be if Python supplied this information to BPL. 
> Then BPL can rightly throw an exception if you effectively bind to an 
> rvalue. In other words, would you support adding this functionality 
> to Python and afterwards BPL?

If you can get it past Guido, then I'd support adding it to the BPL,
but IMO your chances are 0% because it would incur overheads on every
function call that are needed on a tiny fraction, but more importantly
it totally violates the Python programming model.

The right way to wrap functions with such out parameters to transform
the interface on the Python side so that tuples are returned.

-- 
Dave Abrahams
Boost Consulting
www.boost-consulting.com




More information about the Cplusplus-sig mailing list